PageSourceSearch

https://brickfilms.com/assets/ThreadForm-C7XaXvUZ.js

js brickfilms.com collected 2026-09-24 09:23:05 UTC 3,756 bytes, 7 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./jsx-runtime-Bbmj7Sro.js";import{t as n}from"./react-C21x__mS.js";import{t as r}from"./withTranslation-B3sbfl5p.js";import{Q as i,a,h as o,rt as s,s as c,st as l,tt as u}from"./index-_WGeRyKy.js";import{t as d}from"./Editor-C4KLBuhX.js";import{t as f}from"./Input-BxDB3KTF.js";import{t as p}from"./FormGrid-BDifxQPZ.js";import{t as m}from"./FormGroup-DYhG67Gb.js";import{t as h}from"./Select-CN5Z9-5h.js";import{t as g}from"./Switch-xji8DAZr.js";import{n as _,t as v}from"./threads-DvKnfXyQ.js";var y=o(),b=e(n()),x=t(),S=`RIGHT`,C=(e,t)=>n=>{if(n.id===`ALL`||n.id===`REPLIED`||n.id===`WELCOME`&&t===`CREATE`&&e.includes(`CREATE_THREAD`))return!1;if(n.id===`WELCOME`&&e.includes(`CREATE_INTRODUCTION_THREAD`)||(!n.private||n.private===!0&&e.includes(`ACCESS_PRIVATE_THREADS`))&&(e.includes(`CREATE_THREAD`)||t===`EDIT`))return!0},w=r()(({t:e,thread:t={language:s(),title:``,isPinned:!1,requiredRole:`GUEST`,isLocked:!1,message:``},onSubmit:n=()=>{},loading:r=!1,buttonLabel:o,allowedActions:w=[],mode:T=`CREATE`,username:E=``,useIntroductionMode:D=!1})=>{var O,k;let[A,j]=(0,b.useState)(!1),M=v.filter(C(w,T)).map(t=>({value:t.id,label:t.title(e)})),N=_.map(t=>({value:t.id,label:t.title(e)})),P=c({mode:`all`,defaultValues:{...(0,y.pick)(t,[`category`,`language`,`title`,`isPinned`,`isLocked`,`message`,`requiredRole`]),...t.category?{category:t.category}:{category:M==null||(O=M[0])==null?void 0:O.value},...D?{title:`#${E}`}:{},message:(t==null||(k=t.messages)==null||(k=k.edges)==null||(k=k[0])==null||(k=k.node)==null||(k=k.message)==null?void 0:k.value)||``}}),F=(0,b.useRef)(null),{register:I,handleSubmit:L,control:R,formState:{errors:z,isDirty:B,isValid:V}}=P,H=e(`Required field`),U={title:I(`title`,{required:H,minLength:{value:3,message:e(`The title need to be at least 3 characters long`)}}),category:I(`category`,{required:H}),language:I(`language`,{required:H}),isPinned:I(`isPinned`),requiredRole:I(`requiredRole`,{required:H}),isLocked:I(`isLocked`),...T===`CREATE`?{message:I(`message`,{required:H})}:{}};return(0,x.jsx)(a,{...P,children:(0,x.jsxs)(`form`,{id:`thread`,children:[(0,x.jsxs)(p,{children:[(0,x.jsx)(m,{label:e(`Title`),id:`title`,error:z.title,required:!0,children:(0,x.jsx)(f,{id:`title`,register:U.title,readOnly:D})}),(0,x.jsx)(m,{label:e(`Language`),id:`language`,error:z.language,required:!0,children:(0,x.jsx)(h,{control:R,options:u(),register:U.language})}),!D&&(0,x.jsx)(m,{label:e(`Category`),id:`category`,error:z.category,required:!0,children:(0,x.jsx)(h,{control:R,options:M,register:U.category})}),w.includes(`CREATE_THREAD_ROLE`)&&(0,x.jsx)(m,{label:e(`Visibility`),id:`requiredRole`,error:z.requiredRole,required:!0,children:(0,x.jsx)(h,{control:R,options:N,register:U.requiredRole})}),w.includes(`CREATE_THREAD_PINNED`)&&(0,x.jsx)(m,{label:e(`Is pinned?`),id:`isPinned`,error:z.isPinned,children:(0,x.jsx)(g,{id:`isPinned`,register:U.isPinned})}),w.includes(`CREATE_THREAD_LOCKED`)&&(0,x.jsx)(m,{label:e(`Is locked?`),id:`isLocked`,error:z.isLocked,children:(0,x.jsx)(g,{id:`isLocked`,register:U.isLocked})})]}),T===`CREATE`&&(0,x.jsx)(m,{label:e(D?`Your introduction`:`Message`),error:z.message,required:!0,children:(0,x.jsx)(d,{ref:F,control:R,placeholder:e(D?`- What are your hobbies in real life?
2- How old are you?
3- Have you already done some brickfilms?
4- What software are you using?
5- How did you discover Brickfilms.com?
6- What do you expect from the community?`:`Write your message`),t:e,register:U.message,onUploadStatusChange:j})}),(0,x.jsx)(i,{position:S,children:(0,x.jsx)(l,{action:L(n),disabled:!B||!V||A,loading:r,type:`submit`,form:`thread`,label:o})})]})})});export{w as t};
7//# sourceMappingURL=ThreadForm-C7XaXvUZ.js.map

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.