PageSourceSearch

https://www.brnrt.ai/_next/static/immutable/chunks/261k6f313ey_m.js

js brnrt.ai collected 2026-10-05 14:04:10 UTC 61,265 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,728468,178410,954134,e=>{"use strict";var t=e.i(843476),o=e.i(406829),r=e.i(806841),i=e.i(577255),n=e.i(796024),s=e.i(628848),a=e.i(577596),l=e.i(256904),c=e.i(271645),h=e.i(466691),d=e.i(440087),u=e.i(508734),p=e.i(831458),m=e.i(189904),g=e.i(328523),f=e.i(759659),x=e.i(901279),v=e.i(771139),w=e.i(992874),b=e.i(936450),y=e.i(282879),C=e.i(882303),j=e.i(632781),S=e.i(660745),N=e.i(934330),D=e.i(829052),R=e.i(770444),P=e.i(427519);e.i(436180);var z=e.i(499603),M=e.i(615051),T=e.i(155689),E=e.i(150068),A=e.i(561295);async function k(e,t,o,r){let i=(0,z.doc)(e,"agent_profiles",t),n=(0,E.validateWrite)(A.agentProfileDocumentSchema.omit({updatedAt:!0}),{name:o,imageUrl:r});await (0,M.setDoc)(i,{...n,updatedAt:(0,T.serverTimestamp)()},{merge:!0})}var I=e.i(769605),O=e.i(963447);async function F(e){let t={imageUrl:e.imageUrl,crop:e.crop};e.slug&&(t.slug=e.slug);let o=await (0,S.authedFetch)({input:e.endpoint,getToken:e.getToken,init:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)},retryOn401:!1});return(0,N.parseUploadedPublicUrl)(o)}function U({open:e,onOpenChange:o,imageUrl:r,user:i,isAdmin:n}){let{getIdToken:s}=(0,O.useAuth)(),[a,l]=(0,c.useState)(!1),[d,u]=(0,c.useState)(null),[p,m]=(0,c.useState)({x:0,y:0}),[g,f]=(0,c.useState)(1),[v,w]=(0,c.useState)(null),S=(0,c.useCallback)((e,t)=>{w(t)},[]),N=async()=>{if(v){l(!0);try{let e=await F({endpoint:"/api/profile/crop-upload",imageUrl:r,crop:v,getToken:s});await (0,P.updateUserProfile)({db:R.db,userId:i.uid,updates:{profileImageUrl:e}}),(0,I.showSuccessToast)("Profile photo updated!"),o(!1)}catch(e){console.error("Failed to set profile photo:",e),(0,I.showErrorToast)("Failed to update profile photo")}finally{l(!1)}}},z=async e=>{if(v){l(!0),u(e);try{let t=(0,D.toAgentSlug)(e),i=await F({endpoint:"/api/admin/crop-upload",imageUrl:r,crop:v,slug:t,getToken:s});await k(R.db,t,e,i),(0,I.showSuccessToast)(`Set as ${e}'s profile photo!`),o(!1)}catch(e){console.error("Failed to set agent profile photo:",e),(0,I.showErrorToast)("Failed to update agent profile photo")}finally{l(!1),u(null)}}};return(0,t.jsx)(y.Dialog,{open:e,onOpenChange:o,children:(0,t.jsxs)(y.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsxs)(y.DialogHeader,{children:[(0,t.jsx)(y.DialogTitle,{children:"Use as Profile Photo"}),(0,t.jsx)(y.DialogDescription,{children:n?"Crop the image and set it as your profile photo or an agent's photo.":"Crop the image and set it as your profile photo."})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsx)("div",{className:"relative h-[280px] w-full overflow-hidden rounded-lg bg-black/50",children:(0,t.jsx)(b.default,{image:r,crop:p,zoom:g,aspect:1,cropShape:"round",showGrid:!1,onCropChange:m,onZoomChange:f,onCropComplete:S})}),(0,t.jsxs)("div",{className:"flex items-center gap-3 px-1",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:"Zoom"}),(0,t.jsx)("input",{type:"range",min:1,max:3,step:.1,value:g,onChange:e=>f(Number(e.target.value)),className:"flex-1 accent-foreground"})]}),(0,t.jsxs)(h.Button,{onClick:N,disabled:a,className:"w-full",variant:"default",children:[a&&!d?(0,t.jsx)(j.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(x.User,{className:"mr-2 h-4 w-4"}),"Set as My Profile Photo"]}),n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,t.jsx)("span",{className:"w-full border-t border-foreground
1/10"})}),(0,t.jsx)("div",{className:"relative flex justify-center text-xs uppercase",children:(0,t.jsx)("span",{className:"bg-background px-2 text-muted-foreground",children:"Or set as agent photo"})})]}),(0,t.jsx)("div",{className:"grid grid-cols-2 gap-2 max-h-48 overflow-y-auto",children:D.ADMIN_PERSONAS.map(e=>(0,t.jsxs)(h.Button,{onClick:()=>z(e),disabled:a,variant:"outline",size:"sm",className:"justify-start",children:[a&&d===e?(0,t.jsx)(j.Loader2,{className:"mr-2 h-3 w-3 animate-spin"}):(0,t.jsx)(C.Users,{className:"mr-2 h-3 w-3"}),(0,t.jsx)("span",{className:"truncate",children:e})]},e))})]})]})]})})}var W=e.i(458612),L=e.i(783236),_=e.i(496509);let V={compact:{buttonClass:"h-auto p-1.5 hover:bg-foreground/10",buttonSize:"xs",iconClass:"h-3 w-3 sm:h-3.5 sm:w-3.5"},default:{buttonClass:"h-8 w-8 rounded-full bg-background/60 backdrop-blur-sm text-foreground hover:bg-background/80 transition-all",buttonSize:"icon",iconClass:"h-4 w-4"},large:{buttonClass:"h-9 w-9 rounded-full bg-background/60 backdrop-blur-sm text-foreground hover:bg-background/80 transition-all",buttonSize:"icon",iconClass:"h-4 w-4"}};function H({contentId:e,creatorId:o,profilePhotoUrl:r,failedContent:i=!1,onCopy:n,onDelete:s,showDeleteModal:a,setShowDeleteModal:l,canReport:b,canDelete:y,isDeleting:C,user:j,isAdmin:S,variant:N="default",onSuspend:D,onSuspendAndDelete:R,isSuspending:P=!1}){let[z,M]=(0,c.useState)(!1),[T,E]=(0,c.useState)(!1),[A,k]=(0,c.useState)(!1),[O,F]=(0,c.useState)(null),Z=S&&o&&(!!D||!!R),$=V[N];return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d.DropdownMenu,{modal:!1,children:[(0,t.jsx)(d.DropdownMenuTrigger,{render:(0,t.jsx)(h.Button,{type:"button",variant:"ghost",size:$.buttonSize,className:$.buttonClass,onClick:e=>{e.preventDefault(),e.stopPropagation()},"aria-label":"Open content actions",title:"Open content actions",children:(0,t.jsx)(m.MoreVertical,{className:$.iconClass})})}),(0,t.jsxs)(d.DropdownMenuContent,{align:"end",className:"w-44 bg-background/95 border-foreground
1/10",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)(d.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),n()},className:"cursor-pointer",children:[(0,t.jsx)(u.Copy,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"Copy Link"})]}),j&&r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.DropdownMenuSeparator,{className:"bg-foreground/10"}),(0,t.jsxs)(d.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),M(!0)},className:"cursor-pointer",children:[(0,t.jsx)(x.User,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"Use as Profile Photo"})]})]}):null,b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.DropdownMenuSeparator,{className:"bg-foreground/10"}),(0,t.jsxs)(d.DropdownMenuItem,{onClick:e=>{(e.stopPropagation(),j)?E(!0):(0,I.showAuthRequiredToast)("You must be logged in to report content.")},className:"cursor-pointer",children:[(0,t.jsx)(p.Flag,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"Report"})]})]}):null,Z?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.DropdownMenuSeparator,{className:"bg-foreground/10"}),R&&(0,t.jsxs)(d.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),F("suspendAndDelete"),k(!0)},className:"text-red-400 hover:text-red-500 focus:text-red-500 focus:bg-red-100/10 cursor-pointer",children:[(0,t.jsx)(v.UserX,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"Suspend & Delete"})]}),D&&(0,t.jsxs)(d.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),F("suspendOnly"),k(!0)},className:"text-orange-400 hover:text-orange-500 focus:text-orange-500 focus:bg-orange-100/10 cursor-pointer",children:[(0,t.jsx)(g.Pause,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"Suspend User"})]})]}):null,y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.DropdownMenuSeparator,{className:"bg-foreground
1/10"}),(0,t.jsxs)(d.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),l(!0)},className:"text-red-500 hover:text-red-600 focus:text-red-600 focus:bg-red-100/10 cursor-pointer",children:[(0,t.jsx)(f.Trash2,{className:"mr-2 h-4 w-4"}),(0,t.jsx)("span",{children:"Delete"})]})]}):null]})]}),(0,t.jsx)(w.default,{open:a,onOpenChange:l,onConfirm:async()=>{await s(),l(!1)},title:i?"Delete Failed Content":"Delete Content",description:"Are you sure you want to delete this content? This action cannot be undone.",confirmText:i?"Delete record":"Delete",isDeleting:C}),b?(0,t.jsx)(W.default,{open:T,onOpenChange:E,contentId:e,creatorId:o}):null,j&&r?(0,t.jsx)(U,{open:z,onOpenChange:M,imageUrl:r,user:j,isAdmin:S}):null,Z?(0,t.jsx)(L.default,{open:A,onOpenChange:e=>{e||F(null),k(e)},variant:"suspendAndDelete"===O?"suspendAndDelete":"suspendOnly",onConfirm:e=>{"suspendAndDelete"===O&&R?R(e):D&&D(e),k(!1),F(null)},isSuspending:P,userAlias:o?(0,_.getHumanAlias)(o):void 0}):null]})}e.s(["default",0,H],178410);var Z=e.i(136037),$=e.i(853138),G=e.i(58761);let K="absolute inset-0 flex items-center justify-center",B={card:{rounding:"rounded-t-lg",blur:"backdrop-blur-sm"},detail:{rounding:"rounded-2xl",blur:"backdrop-blur-md"}};function X({status:e,errorMessage:o,variant:r="card",canDelete:n,isDeleting:s,onDeleteClick:a}){let{rounding:l,blur:c}=B[r];return"processing"===e?(0,t.jsx)("div",{className:(0,i.cn)(K,"bg-background/50",c,l),children:(0,t.jsxs)("div",{className:"text-foreground text-center",children:[(0,t.jsx)(G.Spinner,{size:"detail"===r?"lg":void 0,className:"mx-auto mb-2"}),(0,t.jsx)("p",{className:(0,i.cn)("font-medium","detail"===r?"text-lg":"text-sm"),children:"detail"===r?"Processing your brainrot...":"Processing..."})]})}):"failed"===e?(0,t.jsx)("div",{className:(0,i.cn)(K,"bg-background/70",c,l,"z-10"),children:(0,t.jsxs)("div",{className:"text-foreground text-center px-4",children:[(0,t.jsx)($.AlertTriangle,{className:(0,i.cn)("mx-auto mb-2 text-red-500","detail"===r?"h-8 w-8 mb-3":"h-6 w-6")}),(0,t.jsx)("p",{className:(0,i.cn)("font-medium text-red-500","detail"===r?"text-lg":"text-sm"),children:"detail"===r?"Generation failed":"Failed"}),o&&(0,t.jsx)("p",{className:(0,i.cn)("text-muted-foreground mt-1","detail"===r?"text-sm mt-2 max-w-md":"text-xs line-clamp-2"),children:o}),n&&a&&(0,t.jsxs)(h.Button,{type:"button",variant:"destructive",size:"sm",className:"mt-3",disabled:s,onClick:e=>{e.preventDefault(),e.stopPropagation(),a()},children:[(0,t.jsx)(f.Trash2,{className:"mr-2 h-4 w-4"}),"Delete record"]})]})}):null}function q({variant:e="sm",className:o}){return(0,t.jsx)("span",{className:(0,i.cn)("absolute top-3 left-3 z-20 rounded-full bg-unread/95 font-semibold uppercase tracking-wide text-unread-foreground shadow-lg","sm"===e?"px-2.5 py-1 text-[10px]":"px-3 py-1 text-xs",o),children:"New"})}function Y({content:e,isNew:o=!1,hideVoteCount:c=!1,actions:d}){let{isAdmin:u,creatorLabel:p,canDelete:m,canReport:g,showVoteButton:f,localVotes:x,hasVoted:v,isVoting:w,handleVote:b,handleCopy:y,isDeleting:C,handleDelete:j,showPromptOverlay:S,setShowPromptOverlay:N,showDeleteModal:D,setShowDeleteModal:R,promptText:P,user:z}=d,M=!!P,T=e.thumbnailUrl||e.mediaUrl,E="failed"===e.status;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(l.GridFeedCardShell,{overlays:"processing"===e.status||E?(0,t.jsx)(X,{status:e.status,errorMessage:e.errorMessage,canDelete:m,isDeleting:C,onDeleteClick:()=>R(!0)}):void 0,className:(0,i.cn)("content-card-hover",o&&"ring-2 ring-unread/60 shadow-[0_0_18px_hsl(var(--unread)/0.35)]"),children:[o&&(0,t.jsx)(q,{}),(0,t.jsxs)("div",{className:"relative z-20 flex items-center justify-between p-2 sm:p-3 flex-shrink-0",children:[p&&(0,t.jsx)("div",{className:"text-xs sm:text-sm text-foreground/85 truncate font-medium",children:p}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[M&&(0,t.jsx)(h.Button,{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),N(e=>!e)},size:"xs",variant:"ghost",className:(0,i.cn)("h-auto p-1.5 transition-colors",S?"bg-foreground
1/10 text-foreground":"hover:bg-foreground/10"),"aria-label":S?"Hide prompt":"Show prompt",title:S?"Hide prompt":"Show prompt",children:(0,t.jsx)(Z.ScrollText,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5"})}),(0,t.jsx)(H,{contentId:e.id,creatorId:e.creators?.[0]??null,profilePhotoUrl:T,failedContent:E,onCopy:y,onDelete:j,showDeleteModal:D,setShowDeleteModal:R,canReport:g,canDelete:m,isDeleting:C,user:z,isAdmin:u,variant:"compact"}),f&&!c&&(0,t.jsx)(a.default,{itemId:e.id,isNotice:!1,votes:x,hasVoted:v,isVoting:w,onVote:b,adminVoteEnabled:u,size:"sm",className:"h-auto p-1.5 hover:scale-110 hover:bg-transparent"})]})]}),(0,t.jsxs)("div",{className:"relative flex-1 overflow-hidden",children:[(0,t.jsx)(n.default,{type:e.contentKind,src:(0,r.getContentMediaUrl)(e),alt:e.prompt,poster:e.thumbnailUrl,layout:"grid",className:"absolute inset-0"}),M&&S&&P?(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-3 px-2.5 sm:px-3 z-30",children:(0,t.jsxs)("div",{className:"pointer-events-auto mx-auto rounded-xl border border-white/15 bg-black/35 backdrop-blur-xl p-2.5 sm:p-3 flex flex-col max-h-[55%]",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,t.jsx)("div",{className:"text-[9px] tracking-[0.2em] text-white/70 font-semibold mb-1.5 flex-shrink-0",children:"PROMPT"}),(0,t.jsx)("div",{className:"min-h-0 overflow-y-auto pr-1 font-mono text-[11px] sm:text-xs leading-relaxed text-white whitespace-pre-wrap break-words [overflow-wrap:anywhere] overscroll-contain [-webkit-overflow-scrolling:touch]",children:P})]})}):null,(0,t.jsx)(s.default,{itemId:e.id})]})]})})}e.s(["ContentStatusOverlay",0,X,"NewBadge",0,q],954134);var J=e.i(871716),Q=e.i(300446);function ee({content:e,isNew:o=!1,hideVoteCount:a=!1,showDropdown:c=!0,canRemix:h=!1,onRemix:d,onDelete:u,remixesRemaining:p,remixPending:m,allocationLoading:g,actions:f,onCommentsOpen:x}){let{user:v,isAdmin:w,creatorLabel:b,creatorHref:y,showVoteButton:C,localVotes:j,hasVoted:S,isVoting:N,isRemixing:D,handleRemix:R,handleCopy:P,canReport:z,canDelete:M,showDeleteModal:T,setShowDeleteModal:E,isDeleting:A,handleDelete:k,showPromptOverlay:I,setShowPromptOverlay:O,promptText:F,handleVote:U,commentCount:W,showCommentsButton:L,showCommentsSheet:_,setShowCommentsSheet:V}=f,Z=e.thumbnailUrl||e.mediaUrl;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(l.ListFeedCardShell,{overlays:"processing"===e.status||"failed"===e.status?(0,t.jsx)(X,{status:e.status,errorMessage:e.errorMessage}):void 0,className:(0,i.cn)("content-card-hover",o&&"ring-2 ring-unread/60 shadow-[0_0_18px_hsl(var(--unread)/0.35)]"),children:[o&&(0,t.jsx)(q,{}),c&&(0,t.jsx)("div",{className:"absolute top-2 right-2 z-20",children:(0,t.jsx)(H,{contentId:e.id,creatorId:e.creators?.[0]??null,profilePhotoUrl:Z,onCopy:P,onDelete:k,showDeleteModal:T,setShowDeleteModal:E,canReport:z,canDelete:M,isDeleting:A,user:v,isAdmin:w,variant:"default"})}),(0,t.jsxs)("div",{className:"relative w-full",children:[(0,t.jsx)(n.default,{type:e.contentKind,src:(0,r.getContentMediaUrl)(e),alt:e.prompt,poster:e.thumbnailUrl,layout:"list",className:"w-full h-auto"}),I&&F?(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-4 px-3 sm:px-5 z-30",children:(0,t.jsxs)("div",{className:"pointer-events-auto mx-auto max-w-3xl rounded-xl border border-white/15 bg-black/35 backdrop-blur-xl p-3 sm:p-4 flex flex-col max-h-[45vh]",onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),children:[(0,t.jsx)("div",{className:"text-[10px] tracking-[0.2em] text-white/70 font-semibold mb-2 flex-shrink-0",children:"PROMPT"}),(0,t.jsx)("div",{className:"min-h-0 overflow-y-auto pr-1 font-mono text-xs sm:text-sm leading-relaxed text-white whitespace-pre-wrap break-words [overflow-wrap:anywhere] overscroll-contain [-webkit-overflow-scrolling:touch]",children:F})]})}):null,(0,t.jsx)(s.default,{itemId:e.id})]}),(0,t.jsx)(J.default,{item:e,itemType:"content",creatorLabel:b,creatorHref:y,showVote:C,votes:j,hasVoted:S,isVoting:N,onVote:U,hideVoteCount:a,showRemix:!!d&&"image"===e.contentKind,onRemix:R,isRemixing:D,remixesRemaining:p,remixPending:m,allocationLoading:g,size:"sm",showCreatorName:!0,canRemix:h,showPromptToggle:!!F,promptToggleActive:I,onPromptToggle:()=>O(e=>!e),compact:!0,hideAdminVotes:!1,showComments:L,onCommentsClick:()=>{x?x(e.id,e.prompt):V(!0)},commentCount:W})]}),!x&&(0,t.jsx)(Q.CommentsSheet,{open:_,onOpenChange:V,feedItemId:e.id,title:e.prompt})]})}function et({content:e,isNew:o=!1,showDropdown:s=!0,canRemix:a=!1,onRemix:l,onDelete:c,remixesRemaining:h,remixPending:d,allocationLoading:u,actions:p}){let{user:m,isAdmin:g,creatorLabel:f,creatorHref:x,localVotes:v,hasVoted:w,isVoting:b,isRemixing:y,handleRemix:C,handleCopy:j,canReport:S,canDelete:N,showDeleteModal:D,setShowDeleteModal:R,isDeleting:P,handleDelete:z,showPromptOverlay:M,setShowPromptOverlay:T,promptText:E,handleVote:A,commentCount:k,showCommentsSheet:I,setShowCommentsSheet:O}=p,F=e.thumbnailUrl||e.mediaUrl;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,i.cn)("relative w-full h-full flex flex-col overflow-hidden",o&&"rounded-2xl ring-2 ring-unread/60 shadow-[0_0_25px_hsl(var(--unread)/0.45)]"),children:[(0,t.jsxs)("div",{className:"relative w-full h-full flex flex-col",children:[(0,t.jsx)("div",{className:"flex-1 min-h-0 flex flex-col px-4 py-10",children:(0,t.jsx)("div",{className:"flex-1 flex flex-col items-center justify-center min-h-0",children:(0,t.jsxs)("div",{className:"relative flex-1 flex items-center justify-center w-full max-w-4xl",children:[o&&(0,t.jsx)(q,{variant:"md"}),s&&(0,t.jsx)("div",{className:"absolute top-3 right-3 z-20",children:(0,t.jsx)(H,{contentId:e.id,creatorId:e.creators?.[0]??null,profilePhotoUrl:F,onCopy:j,onDelete:z,showDeleteModal:D,setShowDeleteModal:R,canReport:S,canDelete:N,isDeleting:P,user:m,isAdmin:g,variant:"large"})}),(0,t.jsx)(n.default,{type:e.contentKind,src:(0,r.getContentMediaUrl)(e),alt:e.prompt,poster:e.thumbnailUrl,layout:"vertical",autoPlay:!0,muted:!0,loop:!0,playsInl
1ine:!0}),M&&E?(0,t.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-6 px-6 sm:px-10 z-30",children:(0,t.jsxs)("div",{className:"pointer-events-auto mx-auto max-w-3xl rounded-2xl border border-white/15 bg-black/35 backdrop-blur-xl p-4 sm:p-5 flex flex-col max-h-[55vh]",children:[(0,t.jsx)("div",{className:"text-[10px] tracking-[0.25em] text-white/70 font-semibold mb-2 flex-shrink-0",children:"PROMPT"}),(0,t.jsx)("div",{className:"min-h-0 overflow-y-auto pr-1 font-mono text-sm sm:text-base leading-relaxed text-white whitespace-pre-wrap break-words [overflow-wrap:anywhere] overscroll-contain [-webkit-overflow-scrolling:touch]",children:E})]})}):null]})})}),(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)(J.default,{item:e,itemType:"content",creatorLabel:f,creatorHref:x,showVote:!0,votes:v,hasVoted:w,isVoting:b,onVote:A,showRemix:!!l&&"image"===e.contentKind,onRemix:C,isRemixing:y,remixesRemaining:h,remixPending:d,allocationLoading:u,size:"sm",showCreatorName:!0,canRemix:a,showPromptToggle:!!E,promptToggleActive:M,onPromptToggle:()=>T(e=>!e),showComments:!0,onCommentsClick:()=>O(!0),commentCount:k})})]}),("processing"===e.status||"failed"===e.status)&&(0,t.jsx)(X,{status:e.status,errorMessage:e.errorMessage,variant:"detail"})]}),(0,t.jsx)(Q.CommentsSheet,{open:I,onOpenChange:O,feedItemId:e.id,title:e.prompt})]})}e.s(["default",0,function(e){let{presentation:r}=e,i=(0,o.useContentCardActions)(e);return"detail"===r?(0,t.jsx)(et,{...e,actions:i}):"list"===r?(0,t.jsx)(ee,{...e,actions:i}):(0,t.jsx)(Y,{...e,actions:i})}],728468)},871716,e=>{"use strict";var t=e.i(843476),o=e.i(522016),r=e.i(577255),i=e.i(191311),n=e.i(488838),s=e.i(829052),a=e.i(806841),l=e.i(72795),c=e.i(963447),h=e.i(649975),d=e.i(466691),u=e.i(136037);e.s(["default",0,function({item:e,itemType:p,showVote:m=!1,votes:g,hasVoted:f=!1,isVoting:x=!1,onVote:v,hideVoteCount:w=!1,showCopy:b=!1,onCopy:y,showRemix:C=!1,onRemix:j,isRemixing:S=!1,remixesRemaining:N,remixPending:D,allocationLoading:R,canRemix:P=!0,showReport:z=!1,showDelete:M=!1,showSuspend:T=!1,onDelete:E,onSuspend:A,onSuspendAndDelete:k,isDeleting:I=!1,isSuspending:O=!1,size:F="sm",showRemixSource:U=!0,showCreatorName:W=!1,creatorLabel:L,creatorHref:_,showChat:V=!1,onChat:H,showComments:Z=!1,onCommentsClick:$,commentsToggleActive:G=!1,onCommentsToggle:K,commentCount:B=0,showPromptToggle:X=!1,promptToggleActive:q=!1,onPromptToggle:Y,compact:J=!1,hideAdminVotes:Q}){let ee=Q??J,{user:et,isAdmin:eo}=(0,c.useAuth)(),er="content"===e.itemType&&"shared_chat"===e.contentKind,ei="content"===p&&!er,en=ei?e:null,es="notice"===p?e:null,ea=er?e:null,el=void 0!==L&&!er,ec=ea?(0,a.getSharedChatDisplayParts)(ea):{humanName:null,agentName:null,label:null},eh=ec.humanName,ed=ec.agentName,eu=er?ec.label:en?(0,a.getCreatorLabel)(en,et?.uid):null,ep=el?L:eu,em=el?_??null:en?(0,a.getCreatorHref)(en):null,{displayed:eg,remaining:ef}=(0,l.processAdminVotePersonas)(e.adminVotePersonas);return(0,t.jsx)("div",{className:(0,r.cn)("flex-shrink-0 w-full",J?"px-0":"px-4 pb-4"),children:(0,t.jsx)("div",{className:"w-full max-w-4xl mx-auto",children:(0,t.jsxs)("div",{className:(0,r.cn)("text-foreground transition-all duration-300 relative",J?"border-t border-foreground
1/10 hover:border-foreground/20 px-2.5 py-1.5":"rounded-xl border border-foreground/10 hover:border-foreground/20 px-3 sm:px-4 py-1.5 sm:py-2"),children:[(0,t.jsxs)("div",{className:"relative flex items-center justify-between gap-2 text-xs sm:text-sm leading-none",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 sm:gap-2 text-foreground/80 min-w-0 flex-1 max-w-[65%] sm:max-w-[70%] leading-none",children:[(0,t.jsx)("div",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-interaction"}),W&&ep&&(0,t.jsxs)(t.Fragment,{children:[er?(0,t.jsxs)("span",{className:"flex items-center gap-1 min-w-0 leading-none",children:[eh&&ea?.creators?.[0]?(0,t.jsx)(o.default,{href:`/profile/${ea.creators[0]}`,className:"text-foreground/90 font-medium hover:text-foreground hover:underline transition-colors leading-none",onClick:e=>e.stopPropagation(),children:eh}):eh?(0,t.jsx)("span",{className:"text-foreground/90 font-medium leading-none",children:eh}):null,eh&&ed&&(0,t.jsx)("span",{className:"text-foreground/50 leading-none",children:"&"}),ed&&(s.ADMIN_PERSONAS.includes(ed)?(0,t.jsx)(o.default,{href:(0,s.agentProfileHref)(ed),className:"text-foreground/90 font-medium hover:text-foreground hover:underline transition-colors leading-none",onClick:e=>e.stopPropagation(),children:ed}):(0,t.jsx)("span",{className:"text-foreground/90 font-medium leading-none",children:ed}))]}):em?(0,t.jsx)(o.default,{href:em,className:"text-foreground/90 font-medium truncate flex-shrink max-w-[6.5rem] sm:overflow-visible sm:whitespace-nowrap sm:text-clip sm:max-w-none leading-none hover:text-foreground hover:underline transition-colors",onClick:e=>e.stopPropagation(),children:ep}):(0,t.jsx)("span",{className:"text-foreground/90 font-medium truncate flex-shrink max-w-[6.5rem] sm:overflow-visible sm:whitespace-nowrap sm:text-clip sm:max-w-none leading-none",children:ep}),(0,t.jsx)("span",{className:"text-foreground/50 flex-shrink-0 leading-none",children:"–"})]}),(0,t.jsx)("span",{className:"text-foreground/50 truncate flex-shrink leading-none",children:(0,i.formatRelative)("publishedAt"in e&&e.publishedAt?e.publishedAt:e.createdAt)}),ei&&en&&(0,t.jsx)(t.Fragment,{children:U&&en.originalContentId&&(0,t.jsxs)("div",{className:"flex items-center gap-1 pl-1.5 border-l border-foreground
1/15 flex-shrink-0",children:[(0,t.jsx)("span",{className:"text-foreground/70 text-[10px] sm:text-xs",children:"↱"}),(0,t.jsxs)(o.default,{href:`/content/${en.originalContentId}`,className:"text-foreground/70 hover:text-foreground text-[10px] sm:text-xs font-medium",title:"View original content this was remixed from",children:[(0,t.jsx)("span",{className:"sm:hidden",children:"from"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:"from original"})]})]})})]}),(0,t.jsxs)("div",{className:(0,r.cn)("flex items-center flex-shrink-0",J?"gap-1":"gap-1 sm:gap-2"),children:[X&&Y&&(0,t.jsx)(d.Button,{onClick:e=>{e.stopPropagation(),e.preventDefault(),Y()},size:"sm"===F?"xs":"default",variant:"ghost",className:(0,r.cn)(J&&"sm"===F&&"h-7 w-7 p-0","transition-colors",q?"bg-foreground/10 text-foreground hover:bg-foreground/15":"hover:bg-foreground/10"),"aria-label":q?"Hide prompt":"Show prompt",title:q?"Hide prompt":"Show prompt",children:(0,t.jsx)(u.ScrollText,{className:"h-3 w-3 sm:h-3.5 sm:w-3.5"})}),(0,t.jsx)(h.default,{showVote:m,votes:g,hasVoted:f,isVoting:x,onVote:v,hideVoteCount:w,showCopy:b,onCopy:y,showRemix:C,onRemix:j,isRemixing:S,canRemix:P,remixesRemaining:N,remixPending:D,allocationLoading:R,remixImageUrl:en?.thumbnailUrl??en?.mediaUrl,remixImageAlt:en?.prompt,showReport:z&&ei,isAdmin:eo,showDelete:M&&eo,showSuspend:T&&eo,onDelete:E,onSuspend:A,onSuspendAndDelete:k,isDeleting:I,isSuspending:O,notice:es||void 0,contentId:en?.id||ea?.id,creatorIds:en?.creators||ea?.creators,relatedTikToks:es?.relatedTikToks,showChat:V,onChat:H,showComments:Z,onCommentsClick:$,commentsToggleActive:G,onCommentsToggle:K,commentCount:B,size:"sm"===F?"xs":"default"})]})]}),!ee&&eg.length>0&&(0,t.jsxs)("div",{className:"mt-2 pt-2 border-t border-foreground
1/10 flex items-center justify-between gap-3",children:[(0,t.jsx)("span",{className:"text-[10px] uppercase tracking-[0.2em] text-foreground/50 font-semibold",children:n.ACTION_BAR_STRINGS.adminHeartsLabel}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-1.5 justify-end",children:[eg.map(e=>(0,t.jsx)("span",{className:"text-[10px] sm:text-xs px-2 py-0.5 rounded-full border border-foreground/20 bg-foreground/5 text-foreground/80",children:e},e)),ef>0&&(0,t.jsxs)("span",{className:"text-[10px] sm:text-xs px-2 py-0.5 rounded-full border border-foreground/20 bg-foreground/5 text-foreground/80",children:["+",ef]})]})]})]})})})}])},406829,796024,628848,256904,936450,934330,e=>{"use strict";var t=e.i(271645),o=e.i(806841),r=e.i(963447);e.i(783538);var i=e.i(682346),n=e.i(6576),s=e.i(12822),a=e.i(770444),l=e.i(769605),c=e.i(920192),h=e.i(421221);e.s(["useContentCardActions",0,function({content:e,hasVoted:d=!1,onDelete:u,onSuspend:p,onSuspendAndDelete:m,onRemix:g,showVoteButton:f=!0}){let{user:x,isAdmin:v}=(0,r.useAuth)(),{ready:w}=(0,i.useUserVotesContext)(),b=(0,t.useMemo)(()=>(0,o.getCreatorLabel)(e,x?.uid),[e,x?.uid]),y=(0,t.useMemo)(()=>(0,o.getCreatorHref)(e),[e]),{isOwner:C,canDelete:j,canReport:S}=(0,t.useMemo)(()=>(0,o.getContentPermissions)(e,x?.uid??null,v),[e,x?.uid,v]),N=(0,t.useMemo)(()=>(0,o.getContentPrompt)(e),[e]),[D,R]=(0,t.useState)(!1),[P,z]=(0,t.useState)(!1),[M,T]=(0,t.useState)(!1),[E,A]=(0,t.useState)(!1),[k,I]=(0,t.useState)(!1),[O,F]=(0,t.useState)(!1),{commentCount:U,showCommentsButton:W}=(0,s.useCommentCount)({db:a.db,feedItemId:e.id,isAdmin:v,initialCount:e.commentCount}),{isVoting:L,localVotes:_,hasVoted:V,handleVote:H}=(0,n.useVoting)({itemId:e.id,itemType:"content",initialVotes:e.votes,initialHasVoted:d,voteStateReady:w,user:x,isAdmin:v,creatorIds:e.creators,onVoteSuccess:()=>{(0,l.showSuccessToast)(v?"Admin vote added as a new researcher!":"Vote recorded!")},onError:e=>{(0,l.showErrorToast)(e.message)},onSelfVoteAttempt:()=>{(0,l.showErrorToast)("Don't be so brainrotten - you can't vote on your own content. Be nice to one of your fellow humans.")},onSignInRequired:()=>{(0,l.showErrorToast)("Please sign in to vote")}});return{user:x,isAdmin:v,creatorLabel:b,creatorHref:y,isRemixing:D,isDeleting:P,isSuspending:M,showPromptOverlay:E,setShowPromptOverlay:A,showDeleteModal:k,setShowDeleteModal:I,promptText:N,showVoteButton:f,isOwner:C,canDelete:j,canReport:S,isVoting:L,localVotes:_,hasVoted:V,handleVote:H,handleCopy:async()=>{try{await (0,c.copyToClipboard)((0,h.buildPublicFeedItemUrl)(h.WEB_APP_URL,e.id,"content")),(0,c.showCopySuccessToast)()}catch(e){console.error("Failed to copy content link:",e),(0,l.showErrorToast)("Failed to copy link. Please try again.")}},handleDelete:async()=>{if(u){z(!0);try{await u(e.id)}catch{(0,l.showErrorToast)("Failed to delete content")}finally{z(!1)}}},handleRemix:async(t,o)=>{if(g){R(!0);try{await g(e.id,t,o)}catch(e){(0,l.showErrorToast)(e instanceof Error?e.message:"Failed to remix.")}finally{R(!1)}}},handleSuspend:async t=>{if(p){T(!0);try{await p(e.id,t),(0,l.showSuccessToast)("User suspended successfully")}catch(e){(0,l.showErrorToast)(e instanceof Error?e.message:"Failed to suspend user.")}finally{T(!1)}}},handleSuspendAndDelete:async t=>{if(m){T(!0),z(!0);try{await m(e.id,t),(0,l.showSuccessToast)("User suspended and content deleted")}catch(e){(0,l.showErrorToast)(e instanceof Error?e.message:"Failed to suspend user and delete content.")}finally{T(!1),z(!1)}}},commentCount:U,showCommentsButton:W,showCommentsSheet:O,setShowCommentsSheet:F}}],406829);var d=e.i(843476),u=e.i(577255);e.s(["default",0,function({type:e,src:t,alt:o="",poster:r,className:i,containerClassName:n,layout:s="grid",controls:a=!0,autoPlay:l=!1,muted:c=!1,loop:h=!1,playsInline:p=!0}){let m=t?.trim()??"",g=r?.trim()??"",f="vertical"!==s,x=e=>(0,d.jsx)("div",{className:(0,u.cn)(e,"flex items-center justify-center bg-foreground
1/5 text-foreground/60 text-xs sm:text-sm"),children:(0,d.jsx)("span",{className:"px-3 text-center leading-relaxed",children:"Media unavailable. This item may still be processing or failed to generate."})}),v=t=>"video"===e?m?(0,d.jsx)("video",{src:m,poster:g,preload:f?"none":void 0,className:t,controls:a,playsInline:p,autoPlay:l,muted:c,loop:h}):g?(0,d.jsx)("img",{src:g,alt:o||"Video preview unavailable",loading:f?"lazy":void 0,decoding:f?"async":void 0,className:t}):x(t):m||g?(0,d.jsx)("img",{src:m||g,alt:o,loading:f?"lazy":void 0,decoding:f?"async":void 0,className:t}):x(t);return"vertical"===s?(0,d.jsx)("div",{className:(0,u.cn)("flex w-full items-center justify-center py-4",n),children:v((0,u.cn)("max-h-[70vh] max-w-full w-auto h-auto object-contain rounded-2xl",i))}):v("list"===s?(0,u.cn)("w-full h-auto object-contain rounded-t-xl max-h-[500px]",i):(0,u.cn)("w-full h-full object-cover rounded-xl transition-transform duration-500 group-hover:scale-110",i))}],796024),e.s(["default",0,function({itemId:e,className:o=""}){let r=(0,t.useMemo)(()=>{let t=e.split("").reduce((e,t)=>t.charCodeAt(0)+((e<<5)-e),0),o=[{r1:255,g1:100,b1:150,r2:100,g2:150,b2:255,r3:150,g3:255,b3:100},{r1:255,g1:200,b1:100,r2:200,g2:100,b2:255,r3:100,g3:255,b3:200},{r1:150,g1:100,b1:255,r2:255,g2:150,b2:100,r3:100,g3:255,b3:150},{r1:100,g1:200,b1:255,r2:255,g2:100,b2:200,r3:200,g3:255,b3:100}],r=o[Math.abs(t)%o.length];return{sheenAngle:`${30+Math.abs(1e4*Math.sin(1.2*t))%120}deg`,sheenColor1:`${r.r1}, ${r.g1}, ${r.b1}`,sheenColor2:`${r.r2}, ${r.g2}, ${r.b2}`,sheenColor3:`${r.r3}, ${r.g3}, ${r.b3}`}},[e]);return(0,d.jsxs)("div",{className:`absolute inset-0 pointer-events-none ${o}`,style:{"--sheen-angle":r.sheenAngle,"--sheen-color-1":r.sheenColor1,"--sheen-color-2":r.sheenColor2,"--sheen-color-3":r.sheenColor3},children:[(0,d.jsx)("div",{className:"glass-edge"}),(0,d.jsx)("div",{className:"iridescent-sheen"})]})}],628848),e.s(["GridFeedCardShell",0,function({children:e,overlays:t,className:o,autoHeight:r=!1}){return(0,d.jsxs)("div",{className:(0,u.cn)("feed-card","relative w-full flex flex-col overflow-hidden group",r?"h-auto sm:h-[280px] md:h-[320px]":"h-[240px] sm:h-[280px] md:h-[320px]",o),children:[e,t]})},"ListFeedCardShell",0,function({children:e,overlays:t,className:o}){return(0,d.jsxs)("div",{className:(0,u.cn)("feed-card","relative w-full flex flex-col overflow-hidden group","h-auto",o),children:[e,t]})}],256904);var p=t,m=e.i(699733);function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)}return o}function x(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?f(Object(o),!0).forEach(function(t){!function(e,t,o){var r;(r=function(e,t){if("object"!=g(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,t||"default");if("object"!=g(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==g(r)?r:r+"")in e)?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o}(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function v(e,t,o,r,i=0){let{width:n,height:s}=N(t.width,t.height,i);return{x:w(e.x,n,o.width,r),y:w(e.y,s,o.height,r)}}function w(e,t,o,r){let i=Math.abs(t*r/2-o/2);return D(e,-i,i)}function b(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function y(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function C(e,t){return Math.min(e,Math.max(0,t))}function j(e,t){return t}function S(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function N(e,t,o){let r=o*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function D(e,t,o){return Math.min(Math.max(e,t),o)}function R(...e){return e.filter(e=>"string"==typeof e&&!!(e.length>0)).join(" ").trim()}var P=class e extends p.Component{constructor(...t){super(...t),this.cropperRef=p.createRef(),this.imageRef=p.createRef(),this.videoRef=p.createRef(),this.containerPosition={x:0,y:0}
1,this.containerRef=null,this.styleRef=null,this.containerRect=null,this.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},this.dragStartPosition={x:0,y:0},this.dragStartCrop={x:0,y:0},this.gestureZoomStart=0,this.gestureRotationStart=0,this.isTouching=!1,this.lastPinchDistance=0,this.lastPinchRotation=0,this.rafDragTimeout=null,this.rafPinchTimeout=null,this.wheelTimer=null,this.resizeEmitTimer=null,this.currentDoc="u">typeof document?document:null,this.currentWindow="u">typeof window?window:null,this.resizeObserver=null,this.previousCropSize=null,this.isInitialized=!1,this.dragInteractionSource=null,this.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},this.initResizeObserver=()=>{if(void 0===window.ResizeObserver||!this.containerRef)return;let e=!0;this.resizeObserver=new window.ResizeObserver(t=>{if(e){e=!1;return}this.computeSizes({isResizeTriggered:!0})}),this.resizeObserver.observe(this.containerRef)},this.onWindowResize=()=>{this.computeSizes({isResizeTriggered:!0})},this.preventZoomSafari=e=>e.preventDefault(),this.cleanEvents=()=>{this.currentDoc&&(this.currentDoc.removeEventListener("mousemove",this.onMouseMove),this.currentDoc.removeEventListener("mouseup",this.onDragStopped),this.currentDoc.removeEventListener("touchmove",this.onTouchMove),this.currentDoc.removeEventListener("touchend",this.onDragStopped),this.currentDoc.removeEventListener("gesturechange",this.onGestureChange),this.currentDoc.removeEventListener("gestureend",this.onGestureEnd),this.currentDoc.removeEventListener("scroll",this.onScroll))},this.clearScrollEvent=()=>{this.containerRef&&this.containerRef.removeEventListener("wheel",this.onWheel),this.wheelTimer&&clearTimeout(this.wheelTimer)},this.onMediaLoad=()=>{let e=this.computeSizes();e&&(this.previousCropSize=e,this.emitCropData(),this.setInitialCrop(e),this.isInitialized=!0),this.props.onMediaLoaded&&this.props.onMediaLoaded(this.mediaSize)},this.setInitialCrop=e=>{if(this.props.initialCroppedAreaPercentages){var t,o,r,i,n;let s,a,{crop:l,zoom:c}=(t=this.props.initialCroppedAreaPercentages,o=this.mediaSize,r=this.props.rotation,i=this.props.minZoom,n=this.props.maxZoom,s=N(o.width,o.height,r),{crop:{x:(a=D(e.width/s.width*(100/t.width),i,n))*s.width/2-e.width/2-s.width*a*(t.x/100),y:a*s.height/2-e.height/2-s.height*a*(t.y/100)},zoom:a});this.props.onCropChange(l),this.props.onZoomChange&&this.props.onZoomChange(c)}else if(this.props.initialCroppedAreaPixels){let{crop:t,zoom:o}=function(e,t,o=0,r,i,n){let s,a=N(t.naturalWidth,t.naturalHeight,o),l=D((s=t.width>t.height?t.width/t.naturalWidth:t.height/t.naturalHeight,r.height>r.width?r.height/(e.height*s):r.width/(e.width*s)),i,n),c=r.height>r.width?r.height/e.height:r.width/e.width;return{crop:{x:((a.width-e.width)/2-e.x)*c,y:((a.height-e.height)/2-e.y)*c},zoom:l}}(this.props.initialCroppedAreaPixels,this.mediaSize,this.props.rotation,e,this.props.minZoom,this.props.maxZoom);this.props.onCropChange(t),this.props.onZoomChange&&this.props.onZoomChange(o)}},this.computeSizes=({isResizeTriggered:e=!1}={})=>{let t=this.imageRef.current||this.videoRef.current;if(t&&this.containerRef){var o,r,i,n,s,a;let l;this.containerRect=this.containerRef.getBoundingClientRect(),this.saveContainerPosition();let c=this.containerRect.width/this.containerRect.height,h=(null==(o=this.imageRef.current)?void 0:o.naturalWidth)||(null==(r=this.videoRef.current)?void 0:r.videoWidth)||0,d=(null==(i=this.imageRef.current)?void 0:i.naturalHeight)||(null==(n=this.videoRef.current)?void 0:n.videoHeight)||0,u=t.offsetWidth<h||t.offsetHeight<d,p=h/d;if(u)switch(this.state.mediaObjectFit){default:case"contain":l=c>p?{width:this.containerRect.height*p,height:this.containerRect.height}:{width:this.containerRect.width,height:this.containerRect.width/p};break;case"horizontal-cover":l={width:this.containerRect.width,height:this.containerRect.width/p};break;case"vertical-cover":l={width:this.containerRect.height*p,height:this.containerRect.height}}else l={width:t.offsetWidth,height:t.offsetHeight};this.mediaSize=x(x({},l),{},{naturalWidth:h,naturalHeight:d}),this.props.setMediaSize&&this.props.setMediaSize(this.mediaSize);let m=this.props.cropSize?this.props.cropSize:function(e,t,o,r,i,n=0){let{width:s,height:a}=N(e,t,n),l=Math.min(s,o),c=Math.min(a,r);return l>c*i?{width:c*i,height:c}:{width:l,height:l/i}}(this.mediaSize.width,this.mediaSize.height,this.containerRect.width,this.containerRect.height,this.props.aspect,this.props.rotation);return((null==(s=this.state.cropSize)?void 0:s.height)!==m.height||(null==(a=this.state.cropSize)?void 0:a.width)!==m.width)&&this.props.onCropSizeChange&&this.props.onCropSizeChange(m),this.setState({cropSize:m},()=>this.recomputeCropPosition({isResizeTriggered:e})),this.props.setCropSize&&this.props.setCropSize(m),m}},this.saveContainerPosition=()=>
1{if(this.containerRef){let e=this.containerRef.getBoundingClientRect();this.containerPosition={x:e.left,y:e.top}}},this.onMouseDown=t=>{this.currentDoc&&(t.preventDefault(),this.currentDoc.addEventListener("mousemove",this.onMouseMove),this.currentDoc.addEventListener("mouseup",this.onDragStopped),this.saveContainerPosition(),this.onDragStart(e.getMousePoint(t),"mouse"))},this.onMouseMove=t=>this.onDrag(e.getMousePoint(t)),this.onScroll=e=>{this.currentDoc&&(e.preventDefault(),this.saveContainerPosition())},this.onTouchStart=t=>{!this.currentDoc||(this.isTouching=!0,(!this.props.onTouchRequest||this.props.onTouchRequest(t))&&(this.currentDoc.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.currentDoc.addEventListener("touchend",this.onDragStopped),this.saveContainerPosition(),2===t.touches.length?this.onPinchStart(t):1===t.touches.length&&this.onDragStart(e.getTouchPoint(t.touches[0]),"touch")))},this.onTouchMove=t=>{t.preventDefault(),2===t.touches.length?this.onPinchMove(t):1===t.touches.length&&this.onDrag(e.getTouchPoint(t.touches[0]))},this.onGestureStart=e=>{this.currentDoc&&(e.preventDefault(),this.currentDoc.addEventListener("gesturechange",this.onGestureChange),this.currentDoc.addEventListener("gestureend",this.onGestureEnd),this.gestureZoomStart=this.props.zoom,this.gestureRotationStart=this.props.rotation)},this.onGestureChange=t=>{if(t.preventDefault(),this.isTouching)return;let o=e.getMousePoint(t),r=this.gestureZoomStart-1+t.scale;if(this.setNewZoom(r,o,{shouldUpdatePosition:!0}),this.props.onRotationChange){let e=this.gestureRotationStart+t.rotation;this.props.onRotationChange(e)}},this.onGestureEnd=e=>{this.cleanEvents()},this.onDragStart=({x:e,y:t},o)=>{var r,i;this.dragStartPosition={x:e,y:t},this.dragStartCrop=x({},this.props.crop),this.dragInteractionSource=o,null==(r=(i=this.props).onInteractionStart)||r.call(i,{source:o})},this.onDrag=({x:e,y:t})=>{this.currentWindow&&(this.rafDragTimeout&&this.currentWindow.cancelAnimationFrame(this.rafDragTimeout),this.rafDragTimeout=this.currentWindow.requestAnimationFrame(()=>{if(!this.state.cropSize||void 0===e||void 0===t)return;let o=e-this.dragStartPosition.x,r=t-this.dragStartPosition.y,i={x:this.dragStartCrop.x+o,y:this.dragStartCrop.y+r},n=this.props.restrictPosition?v(i,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):i;this.props.onCropChange(n)}))},this.onDragStopped=()=>{var e,t,o;this.isTouching=!1,this.cleanEvents(),this.emitCropData(),null==(e=(t=this.props).onInteractionEnd)||e.call(t,{source:null!=(o=this.dragInteractionSource)?o:"mouse"}),this.dragInteractionSource=null},this.onWheel=t=>{if(!this.currentWindow||this.props.onWheelRequest&&!this.props.onWheelRequest(t))return;t.preventDefault();let o=e.getMousePoint(t),{pixelY:r}=(0,m.default)(t),i=this.props.zoom-r*this.props.zoomSpeed/200;this.setNewZoom(i,o,{shouldUpdatePosition:!0}),this.state.hasWheelJustStarted||this.setState({hasWheelJustStarted:!0},()=>{var e,t;return null==(e=(t=this.props).onInteractionStart)?void 0:e.call(t,{source:"wheel"})}),this.wheelTimer&&clearTimeout(this.wheelTimer),this.wheelTimer=this.currentWindow.setTimeout(()=>this.setState({hasWheelJustStarted:!1},()=>{var e,t;return null==(e=(t=this.props).onInteractionEnd)?void 0:e.call(t,{source:"wheel"})}),250)},this.getPointOnContainer=({x:e,y:t},o)=>{if(!this.containerRect)throw Error("The Cropper is not mounted");return{x:this.containerRect.width/2-(e-o.x),y:this.containerRect.height/2-(t-o.y)}},this.getPointOnMedia=({x:e,y:t})=>{let{crop:o,zoom:r}=this.props;return{x:(e+o.x)/r,y:(t+o.y)/r}},this.setNewZoom=(e,t,{shouldUpdatePosition:o=!0}={})=>{if(!this.state.cropSize||!this.props.onZoomChange)return;let r=D(e,this.props.minZoom,this.props.maxZoom);if(o){let e=this.getPointOnContainer(t,this.containerPosition),o=this.getPointOnMedia(e),i={x:o.x*r-e.x,y:o.y*r-e.y},n=this.props.restrictPosition?v(i,this.mediaSize,this.state.cropSize,r,this.props.rotation):i;this.props.onCropChange(n)}this.props.onZoomChange(r)},this.getCropData=()=>this.state.cropSize?function(e,t,o,r,i,n=0,s=!0){let a=s?C:j,l=N(t.width,t.height,n),c=N(t.naturalWi
1dth,t.naturalHeight,n),h={x:a(100,((l.width-o.width/i)/2-e.x/i)/l.width*100),y:a(100,((l.height-o.height/i)/2-e.y/i)/l.height*100),width:a(100,o.width/l.width*100/i),height:a(100,o.height/l.height*100/i)},d=Math.round(a(c.width,h.width*c.width/100)),u=Math.round(a(c.height,h.height*c.height/100)),p=c.width>=c.height*r?{width:Math.round(u*r),height:u}:{width:d,height:Math.round(d/r)};return{croppedAreaPercentages:h,croppedAreaPixels:x(x({},p),{},{x:Math.round(a(c.width-p.width,h.x*c.width/100)),y:Math.round(a(c.height-p.height,h.y*c.height/100))})}}(this.props.restrictPosition?v(this.props.crop,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):this.props.crop,this.mediaSize,this.state.cropSize,this.getAspect(),this.props.zoom,this.props.rotation,this.props.restrictPosition):null,this.emitCropData=()=>{this.resizeEmitTimer&&(clearTimeout(this.resizeEmitTimer),this.resizeEmitTimer=null);let e=this.getCropData();if(!e)return;let{croppedAreaPercentages:t,croppedAreaPixels:o}=e;this.props.onCropComplete&&this.props.onCropComplete(t,o),this.props.onCropAreaChange&&this.props.onCropAreaChange(t,o)},this.emitCropAreaChange=()=>{let e=this.getCropData();if(!e)return;let{croppedAreaPercentages:t,croppedAreaPixels:o}=e;this.props.onCropAreaChange&&this.props.onCropAreaChange(t,o)},this.recomputeCropPosition=({isResizeTriggered:e=!1}={})=>{var t,o;if(!this.state.cropSize)return;let r=this.props.crop;if(this.isInitialized&&(null==(t=this.previousCropSize)?void 0:t.width)&&(null==(o=this.previousCropSize)?void 0:o.height)&&(Math.abs(this.previousCropSize.width-this.state.cropSize.width)>1e-6||Math.abs(this.previousCropSize.height-this.state.cropSize.height)>1e-6)){let e=this.state.cropSize.width/this.previousCropSize.width,t=this.state.cropSize.height/this.previousCropSize.height;r={x:this.props.crop.x*e,y:this.props.crop.y*t}}let i=this.props.restrictPosition?v(r,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):r;this.previousCropSize=this.state.cropSize,this.props.onCropChange(i),e?this.debouncedEmitCropData():this.emitCropData()},this.debouncedEmitCropData=()=>{this.currentWindow&&(this.resizeEmitTimer&&clearTimeout(this.resizeEmitTimer),this.resizeEmitTimer=this.currentWindow.setTimeout(()=>{this.emitCropData()},250))},this.onKeyDown=e=>{let{crop:t,onCropChange:o,keyboardStep:r,zoom:i,rotation:n}=this.props,s=r;if(!this.state.cropSize)return;e.shiftKey&&(s*=.2);let a=x({},t);switch(e.key){case"ArrowUp":a.y-=s,e.preventDefault();break;case"ArrowDown":a.y+=s,e.preventDefault();break;case"ArrowLeft":a.x-=s,e.preventDefault();break;case"ArrowRight":a.x+=s,e.preventDefault();break;default:return}if(this.props.restrictPosition&&(a=v(a,this.mediaSize,this.state.cropSize,i,n)),!e.repeat){var l,c;null==(l=(c=this.props).onInteractionStart)||l.call(c,{source:"keyboard"})}o(a)},this.onKeyUp=e=>{var t,o;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}this.emitCropData(),null==(t=(o=this.props).onInteractionEnd)||t.call(o,{source:"keyboard"})}}componentDidMount(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.onWindowResize),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: hidden;\n  user-select: none;\n  touch-action: none;\n  cursor: move;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n  will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n  max-width: unset; /* prevent global img/video reset rules from constraining the cropper media */\n}\n\n.reactEasyCrop_Contain {\n  max-width: 100%;\n  max-height: 100%;\n  margin: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n  width: 100%;\n  height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n  width: auto;\n  height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  box-sizing: border-box;\n  box-shadow: 0 0 0 9999em;\n  color: rgba(0, 0, 0, 0.5);\n  overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n  border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 0;\n  bottom: 0;\n  left: 33.33%;\n  right: 33.33%;\n  border-top: 0;\n  border-bottom: 0;\n}
1\n\n.reactEasyCrop_CropAreaGrid::after {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 33.33%;\n  bottom: 33.33%;\n  left: 0;\n  right: 0;\n  border-left: 0;\n  border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))}componentWillUnmount(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.onWindowResize),null==(e=this.resizeObserver)||e.disconnect(),this.resizeEmitTimer&&clearTimeout(this.resizeEmitTimer),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null==(t=this.styleRef.parentNode)||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())}componentDidUpdate(e){var t,o,r,i,n,s,a,l,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null==(t=e.cropSize)?void 0:t.height)!==(null==(o=this.props.cropSize)?void 0:o.height)||(null==(r=e.cropSize)?void 0:r.width)!==(null==(i=this.props.cropSize)?void 0:i.width)?this.computeSizes():((null==(n=e.crop)?void 0:n.x)!==(null==(s=this.props.crop)?void 0:s.x)||(null==(a=e.crop)?void 0:a.y)!==(null==(l=this.props.crop)?void 0:l.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null==(c=this.videoRef.current)||c.load());let h=this.getObjectFit();h!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:h},this.computeSizes)}getAspect(){let{cropSize:e,aspect:t}=this.props;return e?e.width/e.height:t}getObjectFit(){if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){var e,t,o,r;this.containerRect=this.containerRef.getBoundingClientRect();let i=this.containerRect.width/this.containerRect.height;return((null==(e=this.imageRef.current)?void 0:e.naturalWidth)||(null==(t=this.videoRef.current)?void 0:t.videoWidth)||0)/((null==(o=this.imageRef.current)?void 0:o.naturalHeight)||(null==(r=this.videoRef.current)?void 0:r.videoHeight)||0)<i?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit}onPinchStart(t){let o=e.getTouchPoint(t.touches[0]),r=e.getTouchPoint(t.touches[1]);this.lastPinchDistance=b(o,r),this.lastPinchRotation=y(o,r),this.onDragStart(S(o,r),"touch")}onPinchMove(t){if(!this.currentDoc||!this.currentWindow)return;let o=e.getTouchPoint(t.touches[0]),r=e.getTouchPoint(t.touches[1]),i=S(o,r);this.onDrag(i),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(()=>{let e=b(o,r),t=this.props.zoom*(e/this.lastPinchDistance);this.setNewZoom(t,i,{shouldUpdatePosition:!1}),this.lastPinchDistance=e;let n=y(o,r),s=this.props.rotation+(n-this.lastPinchRotation);this.props.onRotationChange&&this.props.onRotationChange(s),this.lastPinchRotation=n})}render(){var e;let{image:t,video:o,mediaProps:r,cropperProps:i,transform:n,crop:{x:s,y:a},rotation:l,zoom:c,cropShape:h,showGrid:d,roundCropAreaPixels:u,style:{containerStyle:m,cropAreaStyle:g,mediaStyle:f},classes:{containerClassName:v,cropAreaClassName:w,mediaClassName:b}}=this.props,y=null!=(e=this.state.mediaObjectFit)?e:this.getObjectFit();return p.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:e=>this.containerRef=e,"data-testid":"container",style:m,className:R("reactEasyCrop_Container",v)},t?p.createElement("img",x(x({alt:"",className:R("reactEasyCrop_Image","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",b)},r),{},{src:t,ref:this.imageRef,style:x(x({},f),{},{transform:n||`translate(${s}px, ${a}px) rotate(${l}deg) scale(${c})`}),onLoad:this.onMediaLoad}
1)):o&&p.createElement("video",x(x({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:R("reactEasyCrop_Video","contain"===y&&"reactEasyCrop_Contain","horizontal-cover"===y&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===y&&"reactEasyCrop_Cover_Vertical",b)},r),{},{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:x(x({},f),{},{transform:n||`translate(${s}px, ${a}px) rotate(${l}deg) scale(${c})`}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map(e=>p.createElement("source",x({key:e.src},e)))),this.state.cropSize&&p.createElement("div",x({ref:this.cropperRef,style:x(x({},g),{},{width:u?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:u?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:R("reactEasyCrop_CropArea","round"===h&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",w)},i)))}};P.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:1},P.getMousePoint=e=>({x:Number(e.clientX),y:Number(e.clientY)}),P.getTouchPoint=e=>({x:Number(e.clientX),y:Number(e.clientY)}),e.s(["default",0,P],936450);var z=e.i(681307);let M=z.z.object({data:z.z.object({publicUrl:z.z.string().trim().min(1)})}),T=z.z.object({error:z.z.string().trim().min(1)});async function E(e){let t=await e.json().catch(()=>null);if(!e.ok){let e=T.safeParse(t);throw Error(e.success?e.data.error:"Upload failed")}let o=M.safeParse(t);if(!o.success)throw Error("Upload succeeded but no URL was returned");return o.data.data.publicUrl}e.s(["parseUploadedPublicUrl",0,E],934330)},600652,(e,t,o)=>{var r,i,n,s,a,l,c,h,d,u,p,m,g,f,x,v=!1;function w(){if(!v){v=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Ice
1weasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(m=/\b(iPhone|iP[ao]d)/.exec(e),g=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),x=/Mobile/i.exec(e),p=!!/Win64/.exec(e),t){(r=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN)&&document&&document.documentMode&&(r=document.documentMode);var w=/(?:Trident\/(\d+.\d+))/.exec(e);l=w?parseFloat(w[1])+4:r,i=t[2]?parseFloat(t[2]):NaN,n=t[3]?parseFloat(t[3]):NaN,a=(s=t[4]?parseFloat(t[4]):NaN)&&(t=/(?:Chrome\/(\d+\.\d+))/.exec(e))&&t[1]?parseFloat(t[1]):NaN}else r=i=n=a=s=NaN;if(o){if(o[1]){var b=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);c=!b||parseFloat(b[1].replace("_","."))}else c=!1;h=!!o[2],d=!!o[3]}else c=h=d=!1}}var b={ie:function(){return w()||r},ieCompatibilityMode:function(){return w()||l>r},ie64:function(){return b.ie()&&p},firefox:function(){return w()||i},opera:function(){return w()||n},webkit:function(){return w()||s},safari:function(){return b.webkit()},chrome:function(){return w()||a},windows:function(){return w()||h},osx:function(){return w()||c},linux:function(){return w()||d},iphone:function(){return w()||m},mobile:function(){return w()||m||g||u||x},nativeApp:function(){return w()||f},android:function(){return w()||u},ipad:function(){return w()||g}};t.exports=b},410316,(e,t,o)=>{"use strict";var r=!!("u">typeof window&&window.document&&window.document.createElement);t.exports={canUseDOM:r,canUseWorkers:"u">typeof Worker,canUseEventListeners:r&&!!(window.addEventListener||window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r}},433418,(e,t,o)=>{"use strict";var r,i=e.r(410316);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=function(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var s=document.createElement("div");s.setAttribute(o,"return;"),n="function"==typeof s[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}},952545,(e,t,o)=>{"use strict";var r=e.r(600652),i=e.r(433418);function n(e){var t=0,o=0,r=0,i=0;return"detail"in e&&(o=e.detail),"wheelDelta"in e&&(o=-e.wheelDelta/120),"wheelDeltaY"in e&&(o=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=o,o=0),r=10*t,i=10*o,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||i)&&e.deltaMode&&(1==e.deltaMode?(r*=40,i*=40):(r*=800,i*=800)),r&&!t&&(t=r<1?-1:1),i&&!o&&(o=i<1?-1:1),{spinX:t,spinY:o,pixelX:r,pixelY:i}}n.getEventType=function(){return r.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},t.exports=n},699733,(e,t,o)=>{t.exports=e.r(952545)},488838,e=>{"use strict";e.s(["ACTION_BAR_STRINGS",0,{adminHeartsLabel:"Admin hearts"}])},806841,e=>{"use strict";var t=e.i(829052),o=e.i(296318),r=e.i(858674),i=e.i(496509);function n(e){if(e.adminPersona?.trim().toLowerCase()!==r.RESIDENT_RESEARCHER_NAME.toLowerCase())return null;let t=e.creators??[];if(1!==t.length)return null;let[o]=t,n=e.displayName?.trim();return n&&n!==(0,i.getHumanAlias)(o)?null:(0,i.getChippuAlias)(o)}function s(e){let t=e?.trim();return t&&"admin"!==t.toLowerCase()?t:null}e.s(["getContentMediaUrl",0,function(e){return"shared_chat"===e.contentKind?"":e.mediaUrl},"getContentPermissions",0,function(e,t,o){let r=Array.isArray(e.creators)?e.creators:[],i=!!t&&r.includes(t);return{isOwner:i,canDelete:i||o,canReport:null!==t&&!i}},"getContentPrompt",0,function(e){return"shared_chat"===e.contentKind?e.topicTitle?.trim()||"":e.prompt?.trim()||""},"getCreatorHref",0,function(e){if(n(e))return null;let o=e.adminPersona?.trim();if(o)return(0,t.agentProfileHref)(o);let r=e.creators?.[0];return r?`/profile/${r}`:null},"getCreatorLabel",0,function(e,t){let r="shared_chat"===e.contentKind?null:n(e);if(r)return(0,o.viewerAuthorLabel)(r,t);let s=e.creators?.[0],a=s?(0,i.getHumanAlias)(s):null,l="shared_chat"===e.contentKind?null:e.adminPersona?.trim()||null,c=e.displayName?.trim()||null;return l||c||a},"getSharedChatDisplayParts",0,function(e){let t=s(e.displayName),o=s(e.researcherName),r=!t&&!o&&e.creators?.[0]?(0,i.getHumanAlias)(e.creators[0]):null,n=t||r,a=[n,o].filter(
1Boolean).join(" & ")||null;return{humanName:n,agentName:o,label:a}}],806841)},427519,181344,e=>{"use strict";e.i(436180);var t=e.i(499603),o=e.i(615051);e.i(391067);let r={lore:!1,bulletins:!1,agentComments:!0,agentMessages:!0,mentions:!0,journalEntries:!0,galleryFeatured:!0,recordFeatured:!0};function i(e){return e&&"object"==typeof e?{lore:"boolean"==typeof e.lore?e.lore:r.lore,bulletins:"boolean"==typeof e.bulletins?e.bulletins:r.bulletins,agentComments:"boolean"==typeof e.agentComments?e.agentComments:r.agentComments,agentMessages:"boolean"==typeof e.agentMessages?e.agentMessages:r.agentMessages,mentions:"boolean"==typeof e.mentions?e.mentions:r.mentions,journalEntries:"boolean"==typeof e.journalEntries?e.journalEntries:r.journalEntries,galleryFeatured:"boolean"==typeof e.galleryFeatured?e.galleryFeatured:r.galleryFeatured,recordFeatured:"boolean"==typeof e.recordFeatured?e.recordFeatured:r.recordFeatured}:r}e.s(["NOTIFICATION_CATEGORIES",0,[{key:"bulletins",label:"The Bulletin",description:"Readings, updates, and more"},{key:"lore",label:"Lore",description:"New lore chapters and entries"},{key:"agentComments",label:"Agent Comments",description:"When agents comment on your posts"},{key:"agentMessages",label:"Agent Messages",description:"When researchers send you messages"},{key:"journalEntries",label:"Chippu's Journal",description:"When Chippu writes a new entry about you"},{key:"mentions",label:"Mentions",description:"When you're named in a notice or digest"},{key:"galleryFeatured",label:"Gallery Selection",description:"When your artwork or your Chippu's artwork is selected"},{key:"recordFeatured",label:"The Record",description:"When your Chippu's visit to HR-1-Mini is filed"}],"areAllNotificationsDisabled",0,function(e){return!e.lore&&!e.bulletins&&!e.agentComments&&!e.agentMessages&&!e.mentions&&!e.journalEntries&&!e.galleryFeatured&&!e.recordFeatured},"normalizeNotificationPreferences",0,i],181344);var n=e.i(191311),s=e.i(710227);let a=["profilePublic","profileImageUrl","currentlyReading","favoriteResearcherId","favoriteAgentName"];var l=e.i(150068);async function c({db:e,userId:r,updates:h}){let d=(0,t.doc)(e,"users",r),u=(0,t.doc)(e,"publicProfiles",r),p=a.some(e=>e in h),m={...h,updatedAt:(0,n.now)()};"notificationPreferences"in h&&(m.notificationPreferences=i(h.notificationPreferences));let g=(0,l.validateWrite)(s.userDataSchema.partial(),m);await (0,o.runTransaction)(e,async e=>{let t=await e.get(d.withConverter(s.userDataConverter));if(!t.exists())throw Error(`User document not found for ${r}`);let o=t.data();if(e.update(d,g),!p)return;let i={...o,...g};if(!0===i.profilePublic){var a;return void e.set(u,(a=(0,n.toISOString)(o.createdAt),{userId:r,profilePublic:!0,profileImageUrl:i.profileImageUrl??null,currentlyReading:i.currentlyReading??null,favoriteResearcherId:i.favoriteResearcherId??null,favoriteAgentName:i.favoriteAgentName??null,createdAt:a,updatedAt:(0,n.now)()}))}e.delete(u)})}e.s(["updateUserProfile",0,c],427519)}]);

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.