1 line
11 KiB
JavaScript
Vendored
1 line
11 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8714],{99611:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var o=n(1413),r=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},l=n(42135),a=function(e,t){return r.createElement(l.Z,(0,o.Z)((0,o.Z)({},e),{},{ref:t,icon:i}))};a.displayName="EyeOutlined";var s=r.forwardRef(a)},68795:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var o=n(1413),r=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},l=n(42135),a=function(e,t){return r.createElement(l.Z,(0,o.Z)((0,o.Z)({},e),{},{ref:t,icon:i}))};a.displayName="SearchOutlined";var s=r.forwardRef(a)},79531:function(e,t,n){"use strict";n.d(t,{Z:function(){return A}});var o=n(87462),r=n(4942),i=n(94184),l=n.n(i),a=n(67294),s=n(53124),c=n(65223),u=n(82586),d=n(97685),f=n(71002),p=n(1413),m={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},v=n(42135),h=function(e,t){return a.createElement(v.Z,(0,p.Z)((0,p.Z)({},e),{},{ref:t,icon:m}))};h.displayName="EyeInvisibleOutlined";var g=a.forwardRef(h),w=n(99611),y=n(98423),x=n(42550),Z=n(72922),C=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)0>t.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},b=function(e){return e?a.createElement(w.Z,null):a.createElement(g,null)},_={click:"onClick",hover:"onMouseOver"},E=a.forwardRef(function(e,t){var n=e.visibilityToggle,i=void 0===n||n,c="object"===(0,f.Z)(i)&&void 0!==i.visible,p=(0,a.useState)(function(){return!!c&&i.visible}),m=(0,d.Z)(p,2),v=m[0],h=m[1],g=(0,a.useRef)(null);a.useEffect(function(){c&&h(i.visible)},[c,i]);var w=(0,Z.Z)(g),E=function(){e.disabled||(v&&w(),h(function(e){var t,n=!e;return"object"===(0,f.Z)(i)&&(null===(t=i.onVisibleChange)||void 0===t||t.call(i,n)),n}))},j=function(t){var n,o=e.action,i=e.iconRender,l=_[void 0===o?"click":o]||"",s=(void 0===i?b:i)(v),c=(n={},(0,r.Z)(n,l,E),(0,r.Z)(n,"className","".concat(t,"-icon")),(0,r.Z)(n,"key","passwordIcon"),(0,r.Z)(n,"onMouseDown",function(e){e.preventDefault()}),(0,r.Z)(n,"onMouseUp",function(e){e.preventDefault()}),n);return a.cloneElement(a.isValidElement(s)?s:a.createElement("span",null,s),c)};return a.createElement(s.C,null,function(n){var s=n.getPrefixCls,c=e.className,d=e.prefixCls,f=e.inputPrefixCls,p=e.size,m=C(e,["className","prefixCls","inputPrefixCls","size"]),h=s("input",f),w=s("input-password",d),Z=i&&j(w),b=l()(w,c,(0,r.Z)({},"".concat(w,"-").concat(p),!!p)),_=(0,o.Z)((0,o.Z)({},(0,y.Z)(m,["suffix","iconRender","visibilityToggle"])),{type:v?"text":"password",className:b,prefixCls:h,suffix:Z});return p&&(_.size=p),a.createElement(u.ZP,(0,o.Z)({ref:(0,x.sQ)(t,g)},_))})}),j=n(68795),M=n(71577),N=n(97647),O=n(4173),z=n(96159),k=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)0>t.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},S=a.forwardRef(function(e,t){var n,i,c=e.prefixCls,d=e.inputPrefixCls,f=e.className,p=e.size,m=e.suffix,v=e.enterButton,h=void 0!==v&&v,g=e.addonAfter,w=e.loading,y=e.disabled,Z=e.onSearch,C=e.onChange,b=e.onCompositionStart,_=e.onCompositionEnd,E=k(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),S=a.useContext(s.E_),P=S.getPrefixCls,F=S.direction,A=a.useContext(N.Z),B=a.useRef(!1),L=P("input-search",c),R=P("input",d),T=(0,O.ri)(L,F).compactSize||p||A,I=a.useRef(null),U=function(e){var t;document.activeElement===(null===(t=I.current)||void 0===t?void 0:t.input)&&e.preventDefault()},D=function(e){var t,n;Z&&Z(null===(n=null===(t=I.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e)},Q="boolean"==typeof h?a.createElement(j.Z,null):null,q="".concat(L,"-button"),H=h||{},K=H.type&&!0===H.type.__ANT_BUTTON;i=K||"button"===H.type?(0,z.Tm)(H,(0,o.Z)({onMouseDown:U,onClick:function(e){var t,n;null===(n=null===(t=null==H?void 0:H.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),D(e)},key:"enterButton"},K?{className:q,size:T}:{})):a.createElement(M.Z,{className:q,type:h?"primary":void 0,size:T,disabled:y,key:"enterButton",onMouseDown:U,onClick:D,loading:w,icon:Q},h),g&&(i=[i,(0,z.Tm)(g,{key:"addonAfter"})]);var V=l()(L,(n={},(0,r.Z)(n,"".concat(L,"-rtl"),"rtl"===F),(0,r.Z)(n,"".concat(L,"-").concat(T),!!T),(0,r.Z)(n,"".concat(L,"-with-button"),!!h),n),f);return a.createElement(u.ZP,(0,o.Z)({ref:(0,x.sQ)(I,t),onPressEnter:function(e){B.current||w||D(e)}},E,{size:T,onCompositionStart:function(e){B.current=!0,null==b||b(e)},onCompositionEnd:function(e){B.current=!1,null==_||_(e)},prefixCls:R,addonAfter:i,suffix:m,onChange:function(e){e&&e.target&&"click"===e.type&&Z&&Z(e.target.value,e),C&&C(e)},className:V,disabled:y}))}),P=n(80173),F=u.ZP;F.Group=function(e){var t,n=(0,a.useContext)(s.E_),i=n.getPrefixCls,u=n.direction,d=e.prefixCls,f=e.className,p=i("input-group",d),m=l()(p,(t={},(0,r.Z)(t,"".concat(p,"-lg"),"large"===e.size),(0,r.Z)(t,"".concat(p,"-sm"),"small"===e.size),(0,r.Z)(t,"".concat(p,"-compact"),e.compact),(0,r.Z)(t,"".concat(p,"-rtl"),"rtl"===u),t),void 0===f?"":f),v=(0,a.useContext)(c.aM),h=(0,a.useMemo)(function(){return(0,o.Z)((0,o.Z)({},v),{isFormItemInput:!1})},[v]);return a.createElement("span",{className:m,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},a.createElement(c.aM.Provider,{value:h},e.children))},F.Search=S,F.TextArea=P.Z,F.Password=E;var A=F},68714:function(e,t,n){"use strict";n.r(t),n.d(t,{FollowModal:function(){return p}});var o=n(85893),r=n(26713),i=n(11382),l=n(14670),a=n(79531),s=n(71577),c=n(67294),u=n(13096),d=n.n(u),f=n(53899);let p=e=>{let{handleClose:t,account:n,name:u}=e,[p,m]=(0,c.useState)(null),[v,h]=(0,c.useState)(!1),[g,w]=(0,c.useState)(!1),[y,x]=(0,c.useState)(null),Z=e=>{m(e),(0,f.ME)(e)?h(!0):h(!1)},C=async()=>{if(v){w(!0);try{let e=p.replace(/^@+/,""),n=await fetch("/api/remotefollow",{method:"POST",body:JSON.stringify({account:e})}),o=await n.json();if(o.redirectUrl&&(window.open(o.redirectUrl,"_blank"),t()),!o.success){x(o.message),w(!1);return}if(!o.redirectUrl){x("Unable to follow."),w(!1);return}}catch(e){x(e.message)}w(!1)}};return(0,o.jsxs)(r.Z,{direction:"vertical",id:"follow-modal",children:[(0,o.jsxs)("div",{className:d().header,children:["By following this stream you'll get notified on the Fediverse when it goes live. Now is a great time to",(0,o.jsx)("a",{href:"https://owncast.online/join-fediverse",target:"_blank",rel:"noreferrer",children:"\xa0learn about the Fediverse\xa0"}),"if it's new to you."]}),(0,o.jsxs)(i.Z,{spinning:g,children:[y&&(0,o.jsx)(l.Z,{message:"Follow Error",description:y,type:"error",showIcon:!0}),(0,o.jsxs)("div",{className:d().account,children:[(0,o.jsx)("img",{src:"/logo",alt:"logo",className:d().logo}),(0,o.jsxs)("div",{className:d().username,children:[(0,o.jsx)("div",{className:d().name,children:u}),(0,o.jsx)("div",{children:n})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:d().instructions,children:"Enter your username @server to follow"}),(0,o.jsx)(a.Z,{value:p,size:"large",onChange:e=>Z(e.target.value),placeholder:"Your fediverse account @account@server",defaultValue:p}),(0,o.jsx)("div",{className:d().footer,children:"You'll be redirected to your Fediverse server and asked to confirm the action."})]}),(0,o.jsxs)(r.Z,{className:d().buttons,children:[(0,o.jsx)(s.Z,{disabled:!v,type:"primary",onClick:C,children:"Follow"}),(0,o.jsx)(s.Z,{onClick:()=>{window.open("https://owncast.online/join-fediverse","_blank")},type:"primary",children:"Join the Fediverse"})]})]})]})}},53899:function(e,t,n){"use strict";n.d(t,{Kf:function(){return i},ME:function(){return a},ax:function(){return o},bu:function(){return l},jv:function(){return r}});let o="https?://.*";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["http:","https:"];try{let n=new URL(e);if(""===n.protocol||""===n.hostname||!t.includes(n.protocol))return!1}catch(e){return!1}return!0}function i(e,t){e.startsWith("@")&&(e=e.slice(1));let n=e.split(/:|@/),[o,r,i]=n;return o===t&&3===n.length&&!!o&&!!r&&!!i}function l(e){e.startsWith("matrix:")&&(e=e.slice(7)),e.startsWith("@")&&(e=e.slice(1));let t=e.split(":"),[n,o]=t;return 2===t.length&&!!n&&!!o}function a(e){let t=e.replace(/^@+/,"");return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t).toLowerCase())}},13096:function(e){e.exports={header:"FollowModal_header__la1ji",buttons:"FollowModal_buttons__tt4Mc",instructions:"FollowModal_instructions__HiKFF",footer:"FollowModal_footer__AjucH",account:"FollowModal_account__cmHkm",logo:"FollowModal_logo__Ew8xK",username:"FollowModal_username__A_OTw",name:"FollowModal_name__Sf_TP"}}}]); |