@shumai-one/shumai 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/{chunk-snhsjs4x.js → chunk-07jszkhj.js} +62 -62
- package/bin/chunk-0c67210c.js +1 -0
- package/bin/{chunk-kswvyqq1.js → chunk-0wvhahzh.js} +2 -2
- package/bin/chunk-161rxeq2.js +2 -0
- package/bin/{chunk-trveq4wg.js → chunk-1bgsphyz.js} +2 -2
- package/bin/{chunk-vap4k11j.js → chunk-1dqsf5qj.js} +6 -6
- package/bin/{chunk-zxk7q0zk.js → chunk-1jybg56e.js} +1 -1
- package/bin/chunk-1kt5dzjv.js +2 -0
- package/bin/{chunk-drepsbb4.js → chunk-1t51fp6n.js} +1 -1
- package/bin/{chunk-cbgq517y.js → chunk-2jrjwaqr.js} +2 -2
- package/bin/chunk-2qjfpmcf.js +2 -0
- package/bin/{chunk-wjyaezs7.js → chunk-2vzzd0q6.js} +1 -1
- package/bin/chunk-2yr5k567.js +2 -0
- package/bin/chunk-2z1pnt7h.js +2 -0
- package/bin/{chunk-0zv3bks2.js → chunk-3d5rm1d1.js} +1 -1
- package/bin/{chunk-w4ghe71n.js → chunk-3d9tfxp4.js} +1 -1
- package/bin/{chunk-0qjfahk9.js → chunk-3dgahs95.js} +1 -1
- package/bin/{chunk-dqxeztfa.js → chunk-3j5njrpr.js} +2 -2
- package/bin/{chunk-ryzz5fht.js → chunk-3n4224c0.js} +1 -1
- package/bin/{chunk-914bp49r.js → chunk-3tg39jx7.js} +3 -3
- package/bin/chunk-3vmapyk9.js +1 -0
- package/bin/{chunk-g3fpmyyn.js → chunk-46wfxyd7.js} +2 -2
- package/bin/{chunk-4hkkdm2q.js → chunk-47tn3vtg.js} +1 -1
- package/bin/{chunk-1zwajpwf.js → chunk-4syt6rn0.js} +3 -3
- package/bin/chunk-5kvc1gp2.js +1 -0
- package/bin/{chunk-xa18z1py.js → chunk-5vvvgjvz.js} +2 -2
- package/bin/{chunk-5nm2jvg5.js → chunk-6vxzkrsj.js} +11 -11
- package/bin/{chunk-ytdwk2fq.js → chunk-6y4xkcte.js} +2 -2
- package/bin/{chunk-fpc4p0j8.js → chunk-7e5z637e.js} +2 -2
- package/bin/chunk-7nvk7waw.js +1 -0
- package/bin/{chunk-rq0n0vcc.js → chunk-80qz30dc.js} +2 -2
- package/bin/chunk-886pnknh.js +3 -0
- package/bin/{chunk-6ghcj4a9.js → chunk-8cn7fx40.js} +1 -1
- package/bin/chunk-908pypkr.js +1 -0
- package/bin/chunk-952qwf17.js +2 -0
- package/bin/chunk-988casfy.js +1 -0
- package/bin/chunk-9a2tf0mh.js +2 -0
- package/bin/{chunk-nkdk229f.js → chunk-9d0thqcy.js} +1 -1
- package/bin/{chunk-s2k4qntr.js → chunk-9nvymwqj.js} +2 -2
- package/bin/{chunk-mz0yjra0.js → chunk-9trnkbtr.js} +4 -4
- package/bin/{chunk-t2hy6tj9.js → chunk-a4056d0r.js} +1 -1
- package/bin/{chunk-ze20rm02.js → chunk-a796sgcw.js} +4 -4
- package/bin/{chunk-kpgfqkp0.js → chunk-afnzb9ne.js} +2 -2
- package/bin/chunk-apfrw0wd.js +3 -0
- package/bin/{chunk-wndm3px3.js → chunk-axmd242s.js} +1 -1
- package/bin/{chunk-nr20tvnw.js → chunk-b3aqmcps.js} +2 -2
- package/bin/chunk-b6q287d1.js +2 -0
- package/bin/{chunk-j1tkmcae.js → chunk-b9hyc0a1.js} +2 -2
- package/bin/chunk-ba33nf0q.js +4 -0
- package/bin/chunk-batadmvr.js +2 -0
- package/bin/{chunk-1t167cvj.js → chunk-brwbhbmc.js} +7 -7
- package/bin/chunk-bvdvp192.js +1 -0
- package/bin/{chunk-fahk9h62.js → chunk-crja7whq.js} +2 -2
- package/bin/{chunk-98715kc3.js → chunk-d7fwggt6.js} +2 -2
- package/bin/chunk-db1msmdh.js +2 -0
- package/bin/{chunk-97f2af6d.js → chunk-dbw8c1jj.js} +5 -5
- package/bin/{chunk-7gmdnsdg.js → chunk-dj5a6kkh.js} +1 -1
- package/bin/chunk-dkx3pmdz.js +1 -0
- package/bin/{chunk-071x515q.js → chunk-dmvvt8va.js} +2 -2
- package/bin/{chunk-3tedzb2j.js → chunk-dpc11hpd.js} +9 -9
- package/bin/{chunk-ks8xzc95.js → chunk-dscq4a4k.js} +2 -2
- package/bin/{chunk-jmpb5633.js → chunk-dz076sh7.js} +1 -1
- package/bin/chunk-edqd8evk.js +2 -0
- package/bin/{chunk-0qaq0sp8.js → chunk-ehpfg3km.js} +2 -2
- package/bin/chunk-ey3h4sct.js +2 -0
- package/bin/{chunk-vm5fx7td.js → chunk-ga3pahzf.js} +1 -1
- package/bin/chunk-gc6m7agb.js +3 -0
- package/bin/{chunk-7bcxj1jd.js → chunk-gcjsw9yp.js} +1 -1
- package/bin/chunk-gqr5hxhj.js +2 -0
- package/bin/{chunk-jrjnqx78.js → chunk-gsfcpcye.js} +1 -1
- package/bin/chunk-h9mka9br.js +2 -0
- package/bin/chunk-hacyjx1s.js +1 -0
- package/bin/chunk-hd6dnnyg.js +2 -0
- package/bin/chunk-he5nvmqw.js +1 -0
- package/bin/{chunk-reyxk4bw.js → chunk-hnhdq2wd.js} +1 -1
- package/bin/{chunk-gt4csat6.js → chunk-hs2r9qaw.js} +2 -2
- package/bin/{chunk-fb40xxz3.js → chunk-hxyg5q2a.js} +2 -2
- package/bin/chunk-hyr1vtfp.js +1 -0
- package/bin/{chunk-zw86wnwe.js → chunk-j9ks8bd7.js} +2 -2
- package/bin/{chunk-1gvscz88.js → chunk-jg2v25d2.js} +2 -2
- package/bin/chunk-jh8q3885.js +211 -0
- package/bin/chunk-jzbrt2vk.js +1 -0
- package/bin/chunk-k6avge95.js +10 -0
- package/bin/{chunk-msfw3jmc.js → chunk-kg8eg9z3.js} +2 -2
- package/bin/chunk-kk42xhgz.js +1 -0
- package/bin/{chunk-3ttrhqy3.js → chunk-kmbjp5kp.js} +2 -2
- package/bin/{chunk-jgs8an3h.js → chunk-md5pcq46.js} +8 -8
- package/bin/{chunk-xarsrs08.js → chunk-mtb9fpj2.js} +1 -1
- package/bin/chunk-n3xjwszr.js +2 -0
- package/bin/chunk-nqym3zbs.js +1 -0
- package/bin/{chunk-579e4wv4.js → chunk-p75f5pgq.js} +2 -2
- package/bin/{chunk-hm0dkzed.js → chunk-pdh9bnyj.js} +2 -2
- package/bin/{chunk-rhvv1vvk.js → chunk-pgj2kjnn.js} +2 -2
- package/bin/{chunk-hmpwg5za.js → chunk-pvg3msgw.js} +8 -8
- package/bin/{chunk-4991gz3y.js → chunk-pwkby9h7.js} +6 -6
- package/bin/{chunk-fnmwksnb.js → chunk-qbqym9m6.js} +2 -2
- package/bin/{chunk-4wy87hwd.js → chunk-qgkbxw1k.js} +2 -2
- package/bin/{chunk-1j27fzy1.js → chunk-qs7855cz.js} +2 -2
- package/bin/{chunk-7jtmwt5a.js → chunk-radcwage.js} +2 -2
- package/bin/{chunk-gk2q9a3f.js → chunk-rmzcarv9.js} +2 -2
- package/bin/{chunk-s2fnfyn9.js → chunk-rp4pc6kz.js} +1 -1
- package/bin/{chunk-5adsx8x4.js → chunk-rsd164d9.js} +2 -2
- package/bin/{chunk-hk5rc6cd.js → chunk-s05cdax2.js} +4 -4
- package/bin/{chunk-pazjhrnf.js → chunk-sab7tjxw.js} +5 -5
- package/bin/chunk-sebbjvgv.css +1 -0
- package/bin/{chunk-bkr5zm4h.js → chunk-t350k3s1.js} +1 -1
- package/bin/{chunk-4v41a1r9.js → chunk-t7bvde99.js} +3 -3
- package/bin/chunk-t8gv2ekj.js +14 -0
- package/bin/chunk-teqprbd8.js +2 -0
- package/bin/chunk-tgr86ac4.js +2 -0
- package/bin/{chunk-5hg6kcfz.js → chunk-v8v8vdf7.js} +9 -9
- package/bin/chunk-vm5tn0zm.js +2 -0
- package/bin/chunk-vzj2j11x.js +2 -0
- package/bin/chunk-w1wxzqqb.js +2 -0
- package/bin/chunk-wmjp8dcm.js +1 -0
- package/bin/chunk-wy8dkyxj.js +1 -0
- package/bin/{chunk-a6gx7f5q.js → chunk-y1b3ck7m.js} +1 -1
- package/bin/{chunk-1xh34aew.js → chunk-y20sbaz5.js} +2 -2
- package/bin/{chunk-qsr1a0rp.js → chunk-y56yvezn.js} +1 -1
- package/bin/{chunk-9t8n2des.js → chunk-yfr0hzb7.js} +2 -2
- package/bin/chunk-ysv80zyb.js +5 -0
- package/bin/chunk-z08bqvkc.js +42 -0
- package/bin/{chunk-5tcdwep5.js → chunk-z6jpt0h6.js} +4 -4
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +605 -370
- package/package.json +7 -7
- package/prisma/migrations/20260913130237_add_asset_comment_asset_id_idx/migration.sql +2 -0
- package/prisma/migrations/20260914024424_add_asset_comment_reactions/migration.sql +22 -0
- package/prisma/migrations/20260914064432_limit_reaction_code_length/migration.sql +8 -0
- package/prisma/migrations/20260914092940_add_jpeg_preview_flags/migration.sql +5 -0
- package/prisma/schema.prisma +22 -0
- package/bin/chunk-0cmx7k4c.js +0 -1
- package/bin/chunk-16xax8kk.js +0 -1
- package/bin/chunk-2w5xqhjm.js +0 -1
- package/bin/chunk-3zkasqb8.js +0 -1
- package/bin/chunk-453ykvaw.js +0 -2
- package/bin/chunk-4mjywsj8.js +0 -3
- package/bin/chunk-5vzrpz50.js +0 -2
- package/bin/chunk-77fmkpdz.js +0 -10
- package/bin/chunk-7kjgvxqa.js +0 -2
- package/bin/chunk-7pw1550a.js +0 -2
- package/bin/chunk-7rhz2gze.js +0 -211
- package/bin/chunk-837fky18.js +0 -3
- package/bin/chunk-84as6x83.js +0 -1
- package/bin/chunk-8e28hcny.js +0 -2
- package/bin/chunk-9ccw540k.js +0 -2
- package/bin/chunk-9ybt6vbm.js +0 -1
- package/bin/chunk-avwgktxb.js +0 -2
- package/bin/chunk-d27mm390.js +0 -1
- package/bin/chunk-dj92fss9.js +0 -2
- package/bin/chunk-f6svp4dp.js +0 -2
- package/bin/chunk-fsyzs0tf.js +0 -1
- package/bin/chunk-fxecgp5k.js +0 -1
- package/bin/chunk-gc5sbfa5.js +0 -2
- package/bin/chunk-gdm6yfqq.js +0 -2
- package/bin/chunk-gye8gabk.js +0 -2
- package/bin/chunk-j2bvj2yn.js +0 -2
- package/bin/chunk-jffktpqg.js +0 -1
- package/bin/chunk-k2k9vjq6.js +0 -1
- package/bin/chunk-m9pr03kn.js +0 -2
- package/bin/chunk-mfn9qjm4.js +0 -2
- package/bin/chunk-nbdw8fen.js +0 -1
- package/bin/chunk-q806pqeh.js +0 -1
- package/bin/chunk-qka4mkmj.js +0 -2
- package/bin/chunk-rchsme43.js +0 -3
- package/bin/chunk-rqf7999q.js +0 -42
- package/bin/chunk-rssgmj7x.js +0 -2
- package/bin/chunk-t7nsgg5k.js +0 -4
- package/bin/chunk-tm7f32c7.js +0 -14
- package/bin/chunk-vy8gntez.js +0 -1
- package/bin/chunk-vyzptrea.js +0 -2
- package/bin/chunk-wdsf44hs.js +0 -2
- package/bin/chunk-x5jwwvs0.js +0 -1
- package/bin/chunk-x92cq59c.js +0 -1
- package/bin/chunk-xtf3c29c.css +0 -1
- package/bin/chunk-xx337zcw.js +0 -2
- package/bin/chunk-xz6713tj.js +0 -2
- package/bin/chunk-yfnem6se.js +0 -2
package/bin/chunk-5vzrpz50.js
DELETED
package/bin/chunk-77fmkpdz.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{D,N,h,O,w,u,C,B,t,o,U,Tr,A,T,Ha,be,hr,Xt,Si,ve,De,S,bn,wn,vn,xn,Ee,Ie,Te,Dy,M_,G_,Uf,Sv,gC,vC,xC,AI,it,ua,gt,At,yt,Ls,Ur,Qt,le}from"./chunk-7rhz2gze.js";import{ii,In}from"./chunk-m9pr03kn.js";var tn=Tr((m,j)=>({isDrawing:!1,currentTool:"arrow",currentColor:"#ef4444",annotations:[],history:[[]],historyIndex:0,setIsDrawing:(l)=>m({isDrawing:l}),setTool:(l)=>m({currentTool:l}),setColor:(l)=>m({currentColor:l}),addAnnotation:(l)=>{let{annotations:f,history:g,historyIndex:L}=j(),v=[...f,l],b=g.slice(0,L+1);b.push(v),m({annotations:v,history:b,historyIndex:b.length-1})},setAnnotations:(l)=>{m({annotations:l,history:[l],historyIndex:0})},undo:()=>{let{historyIndex:l,history:f}=j();if(l>0){let g=l-1;m({annotations:f[g],historyIndex:g})}},redo:()=>{let{historyIndex:l,history:f}=j();if(l<f.length-1){let g=l+1;m({annotations:f[g],historyIndex:g})}},reset:()=>m({isDrawing:!1,currentTool:"arrow",annotations:[],history:[[]],historyIndex:0})}));var Mt=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],iu=T("arrow-left",Mt);var Dt=[["path",{d:"m11 10 3 3",key:"fzmg1i"}],["path",{d:"M6.5 21A3.5 3.5 0 1 0 3 17.5a2.62 2.62 0 0 1-.708 1.792A1 1 0 0 0 3 21z",key:"p4q2r7"}],["path",{d:"M9.969 17.031 21.378 5.624a1 1 0 0 0-3.002-3.002L6.967 14.031",key:"wy6l02"}]],$e=T("brush",Dt);var Et=[["path",{d:"M5 12h14",key:"1ays0h"}]],xa=T("minus",Et);var Rt=[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]],He=T("redo",Rt);var Tt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Be=T("square",Tt);var Lt=[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]],Oe=T("undo",Lt);C();var St=["#ef4444","#f97316","#eab308","#22c55e","#3b82f6","#a855f7","#ec4899","#000000","#ffffff"],Us=D(({projectId:m,onSendMessage:j,replyingTo:l,onCancelReply:f,placeholder:g,initialText:L="",value:v,onChangeText:b,disabled:he=!1,allowMentions:qe,disableMentions:We=!1,allowAttachments:Ke=!0,workspaceAssets:E,onRemoveWorkspaceAsset:xe,allowMarkup:Ve,hideAnnotationControl:Xe=!1,canMarkup:Qe=!0,markupDisabledTooltip:Ge,allowTimestamp:Je=!0,currentTime:x,frameRate:y,startTimecode:ye,formatTimestamp:R,bottomLeftExtra:Ye,isStreaming:ae=!1,onAbort:Ze,onTyping:H},et)=>{let[k,q]=u([]),[se,J]=u(null),[I,tt]=u(!0),W=qe??!We,nt=Ve??!Xe,K=Je,{videoTimeDisplayMode:Y}=Qt(),ot=O(()=>{if(x===void 0)return"";if(R)return R(x);if(!y)return"";let e=Math.round(x*y);return In(e,y,Y,ye)},[x,y,Y,ye,R]),{teamId:Z,ensureTeamIdForProject:we}=it(),{members:Ne,loading:ke,fetchMembers:rt,fetchProjectMembers:at}=Ur();h(()=>{if(m&&!Z)we(m)},[m,Z,we]);let{isDrawing:st,setIsDrawing:V,currentTool:ee,setTool:te,currentColor:Ce,setColor:lt,undo:ct,redo:dt,history:ut,historyIndex:Ae,annotations:ie,reset:Me}=tn(),[ce,_]=u(!1),[de,mt]=u(""),[X,Q]=u(0),[M,Re]=u({bots:!1,users:!1}),[ue,P]=u(!1),pt=O(()=>{if(!I||!K||x===void 0||!R&&!y||ue)return"";if(Y==="timecode")return"pl-[120px]";return"pl-[85px]"},[I,K,x,y,ue,Y,R]),s=w(null),ne=w(null),F=w(null),Le=w(null),z=w(!1),{mutateAsync:Se}=U({mutationFn:async({projectId:e,data:n})=>{let r=await A.api.projects[":projectId"].attachments.$post({param:{projectId:e},json:n});if(!r.ok)throw Error("Failed to create attachment");return await r.json()}});h(()=>{if(v!==void 0&&s.current){if(z.current){z.current=!1;return}if(s.current.innerText!==v)s.current.innerText=v,P(!!v.trim())}else if(L&&s.current){s.current.innerText=L,P(!!L.trim()),s.current.focus();let e=document.createRange(),n=window.getSelection();e.selectNodeContents(s.current),e.collapse(!1),n?.removeAllRanges(),n?.addRange(e)}},[v,L]);let me=w(null),_e=N((e)=>{if(!s.current)return;let n=document.createElement("span");n.contentEditable="false",n.dataset.type="mention",n.dataset.id=e.id,n.className="inline-block bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 px-1.5 py-0.5 rounded-md text-sm font-medium align-middle select-none mx-0.5",n.innerText=`@${e.name}`;let r=document.createTextNode(" ");s.current.appendChild(n),s.current.appendChild(r);let i=document.createRange(),c=window.getSelection();i.setStartAfter(r),i.collapse(!0),c?.removeAllRanges(),c?.addRange(i),P(!0);let a=s.current.innerText||"";z.current=!0,b?.(a),H?.(),s.current.focus()},[b,H]);h(()=>{if(l&&s.current){if(l.id!==me.current){if(me.current=l.id,W&&l.creator?.id&&l.creator?.name){let r=s.current.querySelectorAll('span[data-type="mention"]');if(!Array.from(r).some((c)=>c.dataset.id===l.creator.id)){_e({id:l.creator.id,name:l.creator.name});return}}}s.current.focus();let e=document.createRange(),n=window.getSelection();e.selectNodeContents(s.current),e.collapse(!1),n?.removeAllRanges(),n?.addRange(e)}else if(!l)me.current=null},[l,W,_e]),h(()=>()=>{V(!1)},[V]);let G=Ne.filter((e)=>e.type==="agent"&&e.name?.toLowerCase().startsWith(de.toLowerCase())).map((e)=>({type:"user",data:e})),oe=Ne.filter((e)=>e.type!=="agent"&&e.name?.toLowerCase().startsWith(de.toLowerCase())).map((e)=>({type:"user",data:e})),re=[...M.bots?[]:G,...M.users?[]:oe];h(()=>{Q(0)},[de,ce,M]),h(()=>{Le.current?.querySelector(`[data-index="${X}"]`)?.scrollIntoView({block:"nearest"})},[X]);let Pe=(e)=>e.split(" ").map((n)=>n[0]).slice(0,2).join("").toUpperCase(),Fe=()=>{if(!s.current)return;let e=s.current.innerText||"";if(P(!!e.trim()),z.current=!0,b?.(e),H?.(),!W){_(!1),F.current=null;return}let n=window.getSelection();if(!n||n.rangeCount===0)return;let r=n.getRangeAt(0),{startContainer:i,startOffset:c}=r;if(i.nodeType===Node.TEXT_NODE){let d=(i.textContent||"").slice(0,c),p=d.lastIndexOf("@");if(p!==-1){let Ct=p===0,It=d[p-1];if(Ct||/\s/.test(It)){let je=d.slice(p+1);if(!/\s/.test(je)){if(mt(je),_(!0),m)at(m,!0,!0);else if(Z)rt(Z,!0,!0);let ge=document.createRange();ge.setStart(i,p),ge.setEnd(i,c),F.current=ge;return}}}}_(!1),F.current=null},pe=(e)=>{if(!F.current||!s.current)return;let n=F.current;n.deleteContents();let r=document.createElement("span");r.contentEditable="false",r.dataset.type="mention",r.dataset.id=e.data.id,r.className="inline-block bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300 px-1.5 py-0.5 rounded-md text-sm font-medium align-middle select-none mx-0.5",r.innerText=`@${e.data.name}`,n.insertNode(r);let i=document.createTextNode(" ");r.after(i);let c=document.createRange(),a=window.getSelection();c.setStartAfter(i),c.collapse(!0),a?.removeAllRanges(),a?.addRange(c),_(!1),F.current=null,P(!0);let d=s.current.innerText||"";z.current=!0,b?.(d),H?.(),s.current.focus()},ft=(e)=>{e.preventDefault();let n=e.clipboardData.getData("text/plain");if(!n)return;let r=window.getSelection();if(!r||r.rangeCount===0||!s.current?.contains(r.anchorNode)){if(s.current){s.current.focus();let c=document.createRange();c.selectNodeContents(s.current),c.collapse(!1),r=window.getSelection(),r?.removeAllRanges(),r?.addRange(c)}}if(!(typeof document.execCommand==="function"&&document.queryCommandSupported?.("insertText")&&document.execCommand("insertText",!1,n))){let c=window.getSelection();if(c&&c.rangeCount>0){let a=c.getRangeAt(0);a.deleteContents();let d=document.createTextNode(n);a.insertNode(d),a.setStartAfter(d),a.collapse(!0),c.removeAllRanges(),c.addRange(a)}else if(s.current)s.current.innerText+=n}Fe()},bt=(e)=>{if(e.nativeEvent.isComposing)return;if(ce&&W&&re.length>0){if(e.key==="ArrowUp"){e.preventDefault(),Q((n)=>n>0?n-1:re.length-1);return}if(e.key==="ArrowDown"){e.preventDefault(),Q((n)=>n<re.length-1?n+1:0);return}if(e.key==="Enter"||e.key==="Tab"){e.preventDefault(),pe(re[X]);return}if(e.key==="Escape"){e.preventDefault(),_(!1);return}}if(e.key==="Enter"&&!e.shiftKey)e.preventDefault(),Ue()},ht=N(async(e)=>{if(!e.target.files)return;let n=Array.from(e.target.files);for(let r of n){let i=`${Date.now()}-${r.name}`,c={id:i,file:r,progress:0};q((a)=>[...a,c]);try{let a=await Se({projectId:m,data:{fileName:r.name,contentType:r.type,size:r.size}});if(a.uploadUrl&&a.id)await fetch(a.uploadUrl,{method:"PUT",body:r,headers:{"Content-Type":r.type}}),q((d)=>d.map((p)=>p.id===i?{...p,progress:100,attachmentId:a.id}:p))}catch(a){q((d)=>d.map((p)=>p.id===i?{...p,error:a instanceof Error?a.message:"Upload failed"}:p))}}if(ne.current)ne.current.value=""},[m,Se]),xt=(e)=>{q((n)=>n.filter((r)=>r.id!==e))},Ue=()=>{if(!s.current)return;if(k.some((a)=>!a.attachmentId&&!a.error))return;let n=k.map((a)=>a.attachmentId).filter((a)=>!!a),r=k.filter((a)=>!a.error&&!!a.attachmentId).map((a)=>({id:a.attachmentId,name:a.file.name,type:a.file.type,url:a.file.type.startsWith("image/")||Ls(a.file.name)?URL.createObjectURL(a.file):void 0})),i="";s.current.childNodes.forEach((a)=>{if(a.nodeType===Node.TEXT_NODE)i+=a.textContent;else if(a.nodeType===Node.ELEMENT_NODE){let d=a;if(d.dataset.type==="mention")i+=`<@${d.dataset.id}>`;else if(d.tagName==="BR")i+=`
|
|
2
|
-
`;else if(d.tagName==="DIV"||d.tagName==="P")i+=`
|
|
3
|
-
`+d.innerText;else i+=d.innerText}}),i=i.trim();let c=(E?.length??0)>0;if(!i&&n.length===0&&ie.length===0&&!c)return;if(j(i,n,ie,l?.id,K&&I?x:void 0,r),s.current.innerHTML="",P(!1),z.current=!0,b?.(""),q([]),J(null),V(!1),Me(),_(!1),f)f()},fe=k.some((e)=>!e.attachmentId&&!e.error),vt=k.some((e)=>!!e.attachmentId),wt=(E?.length??0)>0,Nt=he||ae,ze=(ue||vt||ie.length>0||wt)&&!Nt,kt=E&&E.length>0||k.length>0||!!l;return o("div",{ref:et,className:"relative flex flex-col w-full border border-foreground/35 rounded-3xl shadow-sm transition-all duration-200 bg-background",children:[t("style",{children:`
|
|
4
|
-
[contenteditable]:empty:before {
|
|
5
|
-
content: attr(data-placeholder);
|
|
6
|
-
color: #9ca3af;
|
|
7
|
-
cursor: text;
|
|
8
|
-
}
|
|
9
|
-
`}),ce&&W&&(ke||G.length>0||oe.length>0)&&t("div",{onMouseDown:(e)=>e.preventDefault(),className:"absolute bottom-full left-4 mb-2 w-64 rounded-xl shadow-lg border border-border overflow-hidden z-20 bg-popover text-popover-foreground animate-in fade-in slide-in-from-bottom-2 duration-200",children:t("div",{ref:Le,className:"h-64 overflow-y-auto",children:ke?o("div",{className:"p-2 space-y-4 animate-pulse",children:[o("div",{className:"space-y-2",children:[t("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:t(le,{className:"h-3 w-16"})}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(le,{className:"w-6 h-6 rounded-full"}),t(le,{className:"h-4 w-28"})]}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(le,{className:"w-6 h-6 rounded-full"}),t(le,{className:"h-4 w-20"})]})]}),o("div",{className:"space-y-2",children:[t("div",{className:"px-3 py-1.5 bg-muted/50 border-b border-border",children:t(le,{className:"h-3 w-16"})}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(le,{className:"w-6 h-6 rounded-full"}),t(le,{className:"h-4 w-32"})]}),o("div",{className:"flex items-center gap-2 px-3 py-2",children:[t(le,{className:"w-6 h-6 rounded-full"}),t(le,{className:"h-4 w-24"})]})]})]}):o(B,{children:[G.length>0&&o(B,{children:[o("button",{type:"button",onMouseDown:(e)=>e.preventDefault(),onClick:(e)=>{e.preventDefault(),e.stopPropagation(),Re((n)=>({...n,bots:!n.bots})),s.current?.focus()},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border flex items-center justify-between hover:bg-muted transition-colors cursor-pointer select-none",children:[t("span",{children:"Agents"}),t(be,{className:`w-3 h-3 transition-transform ${M.bots?"-rotate-90":""}`})]}),!M.bots&&G.map((e,n)=>{let r=n;return o("button",{type:"button","data-index":r,onMouseDown:(i)=>i.preventDefault(),onClick:()=>pe(e),onMouseEnter:()=>Q(r),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left cursor-pointer ${r===X?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[o(Ee,{className:"w-6 h-6",children:[e.type==="user"&&e.data.image&&t(Ie,{src:e.data.image,alt:e.data.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-purple-400 text-black font-semibold",children:Pe(e.data.name)})]}),t("span",{className:"text-sm",children:e.data.name})]},e.data.id)})]}),oe.length>0&&o(B,{children:[o("button",{type:"button",onMouseDown:(e)=>e.preventDefault(),onClick:(e)=>{e.preventDefault(),e.stopPropagation(),Re((n)=>({...n,users:!n.users})),s.current?.focus()},className:"w-full text-xs font-semibold text-muted-foreground px-3 py-2 bg-muted/50 border-b border-border flex items-center justify-between hover:bg-muted transition-colors cursor-pointer select-none",children:[t("span",{children:"Members"}),t(be,{className:`w-3 h-3 transition-transform ${M.users?"-rotate-90":""}`})]}),!M.users&&oe.map((e,n)=>{let r=M.bots?0:G.length,i=n+r;return o("button",{type:"button","data-index":i,onMouseDown:(c)=>c.preventDefault(),onClick:()=>pe(e),onMouseEnter:()=>Q(i),className:`w-full flex items-center gap-2 px-3 py-2 transition-colors text-left cursor-pointer ${i===X?"bg-accent text-accent-foreground":"hover:bg-accent/50"}`,children:[o(Ee,{className:"w-6 h-6",children:[e.type==="user"&&e.data.image&&t(Ie,{src:e.data.image,alt:e.data.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-purple-400 text-black font-semibold",children:Pe(e.data.name)})]}),t("span",{className:"text-sm",children:e.data.name})]},e.data.id)})]})]})})}),kt&&o("div",{className:"flex flex-col gap-2 p-3 pb-0 animate-in fade-in slide-in-from-bottom-2 duration-200",children:[E&&E.length>0&&t("div",{className:"flex flex-col gap-1.5 min-h-0 max-h-[160px] overflow-y-auto border border-border/60 rounded-lg bg-muted/20 p-2.5 divide-y divide-border/50",children:E.map((e)=>o("div",{className:"flex items-center justify-between py-1 text-xs group",children:[o("div",{className:"flex items-baseline gap-1.5 min-w-0 pr-2",children:[t("span",{className:"truncate font-medium text-foreground",children:e.name}),t("span",{className:"text-[9px] text-muted-foreground uppercase flex-shrink-0",children:e.type})]}),xe&&t("button",{onClick:()=>xe(e.id),className:"text-muted-foreground hover:text-destructive transition-colors p-0.5 cursor-pointer",title:gC?.()||"Remove from context",children:t(ve,{className:"h-3.5 w-3.5"})})]},e.id))}),l&&o("div",{className:"flex items-center justify-between bg-muted p-2 px-3 rounded-lg border border-border",children:[t("div",{className:"text-xs text-muted-foreground truncate mr-2",children:xC({message:l.message||""})}),t("button",{onClick:f,className:"text-muted-foreground hover:text-foreground p-1 rounded-full hover:bg-muted-foreground/10 shrink-0",children:t(De,{className:"w-3.5 h-3.5"})})]}),k.length>0&&t("div",{className:"flex gap-3 overflow-x-auto py-2 px-1 scrollbar-hide",children:k.map((e)=>o("div",{className:"relative group flex-shrink-0",children:[o("div",{className:"w-16 h-16 rounded-lg border border-gray-200 overflow-hidden bg-gray-50 flex items-center justify-center",children:[e.file.type.startsWith("image/")?t("img",{src:URL.createObjectURL(e.file),alt:"preview",onClick:()=>J(e.file),className:`w-full h-full object-cover ${!e.attachmentId?"opacity-50":""}`}):t(Xt,{className:"w-8 h-8 text-gray-400"}),fe&&!e.attachmentId&&!e.error&&t("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:t(ii,{progress:e.progress,className:"w-10 h-10"})})]}),t("button",{onClick:()=>xt(e.id),className:"absolute -top-1.5 -right-1.5 bg-gray-500 text-white rounded-full p-0.5 shadow-md opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-500 z-10 cursor-pointer",children:t(De,{className:"w-3 h-3"})}),t("span",{className:"text-[10px] text-gray-500 mt-1 block max-w-[4rem] truncate text-center",children:e.file.name})]},e.id))})]}),o("div",{onClick:()=>s.current?.focus(),className:"w-full px-4 pt-1 pb-1 cursor-text flow-root max-h-60 overflow-y-auto",children:[K&&I&&x!==void 0&&(y!==void 0||R!==void 0)&&t("div",{onClick:(e)=>{e.stopPropagation(),s.current?.focus()},className:"float-left select-none bg-blue-100 dark:bg-blue-900/40 text-blue-600 dark:text-blue-300 px-2.5 py-0.5 mt-3 mr-2 rounded-sm text-xs font-mono font-bold flex items-center gap-1 cursor-text",children:ot}),t("div",{ref:s,contentEditable:!he&&!ae,suppressContentEditableWarning:!0,onInput:Fe,onKeyDown:bt,onPaste:ft,"data-placeholder":g||(l?vC():Sv()),className:`bg-transparent border-none focus:ring-0 resize-none min-h-[40px] leading-relaxed py-2 focus:outline-none block whitespace-pre-wrap break-words ${pt}`})]}),o("div",{className:"flex justify-between items-center px-2 pb-2",children:[st?o("div",{className:"flex items-center gap-2 overflow-x-auto scrollbar-hide w-full mr-2",children:[t(S,{onClick:()=>{V(!1),Me()},variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer text-gray-500 hover:text-gray-700 hover:bg-gray-100 mr-2",title:"Back",children:t(iu,{className:"w-4 h-4"})}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),t("button",{onClick:()=>te("arrow"),className:`p-1.5 rounded hover:bg-gray-100 ${ee==="arrow"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Arrow",children:t(Ha,{size:16,className:"rotate-45"})}),t("button",{onClick:()=>te("line"),className:`p-1.5 rounded hover:bg-gray-100 ${ee==="line"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Line",children:t(xa,{size:16,className:"-rotate-45"})}),t("button",{onClick:()=>te("box"),className:`p-1.5 rounded hover:bg-gray-100 ${ee==="box"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Box",children:t(Be,{size:16})}),t("button",{onClick:()=>te("freehand"),className:`p-1.5 rounded hover:bg-gray-100 ${ee==="freehand"?"text-blue-500 bg-blue-50":"text-gray-500"}`,title:"Freehand",children:t($e,{size:16})}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),o(gt,{children:[t(At,{asChild:!0,children:o("button",{className:"flex items-center gap-1 p-1 rounded hover:bg-gray-100",children:[t("div",{className:"w-4 h-4 rounded-full border border-gray-200",style:{backgroundColor:Ce}}),t(be,{size:12,className:"text-gray-500"})]})}),t(yt,{className:"w-auto p-2",align:"center",side:"top",children:t("div",{className:"flex items-center gap-1",children:St.map((e)=>t("button",{onClick:()=>lt(e),className:`w-6 h-6 rounded-full border border-gray-200 transition-transform hover:scale-110 ${Ce===e?"ring-2 ring-blue-500 ring-offset-1":""}`,style:{backgroundColor:e}},e))})})]}),t("div",{className:"h-4 w-px bg-gray-300 mx-1"}),t("button",{onClick:ct,disabled:Ae<=0,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:t(Oe,{size:16})}),t("button",{onClick:dt,disabled:Ae>=ut.length-1,className:"p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-500",children:t(He,{size:16})})]}):o("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[80%]",children:[Ye,Ke&&o(B,{children:[t("input",{type:"file",ref:ne,className:"hidden",multiple:!0,onChange:ht}),t(S,{onClick:()=>ne.current?.click(),className:"p-2 rounded-full cursor-pointer shrink-0",variant:"ghost",size:"icon",title:Dy(),children:t(Si,{className:"w-4 h-4"})})]}),K&&x!==void 0&&(y!==void 0||R!==void 0)&&t(S,{onClick:()=>tt(!I),variant:I?"secondary":"ghost",size:"icon",className:`p-2 rounded-full cursor-pointer shrink-0 ${I?"text-blue-600 bg-blue-50 dark:bg-blue-900/20":""}`,title:I?M_():G_(),children:t(hr,{className:"w-4 h-4"})}),nt&&(Qe?t(S,{onClick:()=>{H?.(),V(!0)},variant:"ghost",size:"icon",className:"p-2 rounded-full cursor-pointer shrink-0",title:AI(),children:t(ua,{className:"w-4 h-4"})}):t(bn,{children:o(wn,{children:[t(vn,{asChild:!0,children:t("span",{className:"inline-block cursor-not-allowed shrink-0",children:t(S,{disabled:!0,variant:"ghost",size:"icon",className:"p-2 rounded-full opacity-40 cursor-not-allowed pointer-events-none",children:t(ua,{className:"w-4 h-4"})})})}),t(xn,{side:"top",children:t("p",{className:"text-xs",children:Ge||Uf()})})]})}))]}),ae?t("button",{onClick:Ze,className:"p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 shadow-sm bg-destructive text-destructive-foreground hover:bg-destructive/90 transform hover:-translate-y-0.5 cursor-pointer",title:"Stop generation",children:t("div",{className:"h-4 w-4 flex items-center justify-center",children:t("div",{className:"h-3 w-3 rounded-[2px] bg-white"})})}):t("button",{onClick:Ue,disabled:!ze||fe,className:`p-2 rounded-full transition-all duration-200 flex items-center justify-center shrink-0 ${ze&&!fe?"bg-blue-600 text-white shadow-md hover:bg-blue-700 hover:shadow-lg transform hover:-translate-y-0.5 cursor-pointer":"bg-gray-400 cursor-not-allowed opacity-50"}`,children:t(Ha,{className:"w-4 h-4"})})]}),se&&o("div",{className:"fixed inset-0 z-[100] bg-black/95 flex flex-col items-center justify-center p-4 animate-in fade-in duration-200",onClick:()=>J(null),children:[t("button",{className:"absolute top-4 right-4 text-white/70 hover:text-white hover:bg-white/20 rounded-full p-2 transition-colors z-50",children:t(De,{className:"w-8 h-8"})}),t("div",{className:"w-full h-full flex items-center justify-center p-2",children:t("img",{src:URL.createObjectURL(se),alt:"Enlarged view",className:"max-w-full max-h-[85vh] object-contain rounded shadow-2xl cursor-zoom-out",onClick:(e)=>{e.stopPropagation(),J(null)}})}),t("div",{className:"absolute bottom-6 text-white text-sm font-medium bg-black/50 px-4 py-2 rounded-full backdrop-blur-sm",children:se.name})]})]})});Us.displayName="ChatInput";
|
|
10
|
-
export{iu,xa,tn,Us};
|
package/bin/chunk-7kjgvxqa.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{D,h,Ge,O,w,u,C,B,t,o,K,U,Tr,A,T,wt,Un,Me,be,Gr,pt,hr,Rs,Po,fe,Ut,De,E,dt,he,Y,Lt,se,oa,sa,zn,ia,Cc,S,Ee,Ie,Te,ge,Ae,ye,W,is,Xu,mm,nd,Ic,Uy,Fy,Tc,zy,jy,qy,gf,Mc,Hy,$y,ke,fl,sd,If,ml,Tf,Rf,kf,Ti,Zf,Qv,Vv,gd,Fh,Yf,_d,Oo,UC,vg,VC,HI,pe,Qg,ue,me,de,Tt,H,Wo,kr,un,jn,R,lt,xe,Pi,Ja,Ld,El,fr,Hc,$c,Xn,Ni,gt,At,yt,Mr,xr,V,qe,Ur}from"./chunk-7rhz2gze.js";import{Eo,pr}from"./chunk-gc5sbfa5.js";import{Hn,oo}from"./chunk-cbgq517y.js";import{rn}from"./chunk-ytdwk2fq.js";function Dt(e){let n=e.lastIndexOf(".");if(n>0)return[0,n];return[0,e.length]}function ps(e){e.focus();let[n,r]=Dt(e.value);if(typeof e.setSelectionRange==="function")e.setSelectionRange(n,r);else e.select()}var Pt=[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]],Zo=T("audio-lines",Pt);var Or=Tr((e)=>({fields:[],loadedProjectId:null,setFields:(n,r)=>e({fields:n,loadedProjectId:r}),updateFields:(n)=>e({fields:n})}));function Ke(e,n){let{start:r,end:a}=El(n?.in,e),i=+r>+a,s=i?+r:+a,c=i?a:r;c.setHours(0,0,0,0);let l=n?.step??1;if(!l)return[];if(l<0)l=-l,i=!i;let m=[];while(+c<=s)m.push(lt(r,c)),c.setDate(c.getDate()+l),c.setHours(0,0,0,0);return i?m.reverse():m}function Ne(e,n){return xe(e,n?.in).getDate()}function We(e,n){return xe(e,n?.in).getDay()}function Fe(e,n){return xe(e,n?.in).getHours()}function Re(e,n){return xe(e,n?.in).getMinutes()}var Ot=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Pe=T("circle-question-mark",Ot);var Vt=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],Ze=T("text-align-start",Vt);var Bt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],Xe=T("ban",Bt);var Ht=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Qe=T("hash",Ht);var $t=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Zs=T("settings",$t);var zt=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Se=T("star",zt);var Gt=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],Ye=T("tags",Gt);var jt=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Je=T("toggle-left",jt);var Kt=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],Bi=T("type",Kt);C();var Wt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.date,[s,c]=u(!1),l=w(null),m=e?new Date(e):new Date,f=Ja(m)?m:new Date,[v,x]=u(f);h(()=>{if(s&&e){let N=new Date(e);if(Ja(N))x(N)}},[s,e]),h(()=>{let N=(g)=>{if(l.current&&!l.current.contains(g.target)){if(s)c(!1)}};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[s]);let p=()=>{if(!a)c(!0)},F=(N)=>{if(!N)return"";let g=new Date(N);if(!Ja(g))return"Invalid Date";let k="PPP";if(i?.displayFormat==="usa")k="MM/dd/yyyy";else if(i?.displayFormat==="euro")k="dd/MM/yyyy";else if(i?.displayFormat==="iso")k="yyyy-MM-dd";if(i?.includeTime)if(i?.timeFormat==="twenty_four_hour")k+=" HH:mm";else k+=" p";let j=fr(g,k);if(i?.displayTimezone)j+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return j},d=new Date(v.getFullYear(),v.getMonth(),1),M=Ld(v),z=Ke({start:d,end:M}),P=We(d),b=(N)=>{let g=new Date(N);if(i?.includeTime)g.setHours(Fe(f)),g.setMinutes(Re(f));let k=g.toISOString();if(r(k),!i?.includeTime)c(!1)},G=(N,g)=>{let k=e?new Date(e):new Date;if(!Ja(k))k.setTime(new Date().getTime());if(N==="hour")k.setHours(g);if(N==="minute")k.setMinutes(g);let j=k.toISOString();r(j)},y=Array.from({length:24},(N,g)=>g),X=Array.from({length:12},(N,g)=>g*5);if(s)return o("div",{className:"relative w-full",ref:l,children:[t("div",{className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm shadow-sm min-h-[28px] flex items-center",children:e?F(e):t("span",{className:"text-muted-foreground",children:"Select date..."})}),o("div",{className:"absolute z-50 top-full left-0 mt-1 bg-popover border border-border rounded-lg shadow-xl flex flex-col md:flex-row overflow-hidden min-w-[280px]",children:[o("div",{className:"p-4 w-64",children:[o("div",{className:"flex justify-between items-center mb-4",children:[t("button",{onClick:()=>x(Pi(v,-1)),className:"p-1 hover:bg-accent rounded",children:t(Gr,{className:"w-4 h-4"})}),t("span",{className:"font-semibold text-sm",children:fr(v,"MMMM yyyy")}),t("button",{onClick:()=>x(Pi(v,1)),className:"p-1 hover:bg-accent rounded",children:t(pt,{className:"w-4 h-4"})})]}),t("div",{className:"grid grid-cols-7 gap-1 text-center text-xs mb-2 text-muted-foreground",children:["Su","Mo","Tu","We","Th","Fr","Sa"].map((N)=>t("div",{children:N},N))}),o("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:P}).map((N,g)=>t("div",{},`empty-${g}`)),z.map((N)=>{let g=e?new Date(e):null,k=g&&Ja(g)&&Ne(g)===Ne(N)&&Hc(g)===Hc(N)&&$c(g)===$c(N);return t("button",{onClick:()=>b(N),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${k?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:Ne(N)},N.toString())})]})]}),i?.includeTime&&o("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[o("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[t(hr,{className:"w-3 h-3"})," Time"]}),o("div",{className:"flex flex-1 h-64",children:[t("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:y.map((N)=>t("div",{onClick:()=>G("hour",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${Fe(f)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))}),t("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:X.map((N)=>t("div",{onClick:()=>G("minute",N),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${Re(f)===N?"bg-primary/10 font-medium text-primary":""}`,children:N.toString().padStart(2,"0")},N))})]})]})]})]});return t("div",{onClick:p,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!a?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e?F(e):t("span",{className:"text-muted-foreground italic",children:"Empty"})})},et=Wt;C();var Zt=({value:e,onSave:n,readOnly:r})=>{let[a,i]=u(!1),[s,c]=u(e||""),l=w(null),m=w(null),[f,v]=u(!1);h(()=>{c(e||"")},[e]),h(()=>{if(a&&l.current)l.current.focus(),v(!1)},[a]),h(()=>{let d=(M)=>{if(f&&m.current&&!m.current.contains(M.target))v(!1)};if(f)document.addEventListener("mousedown",d);return()=>{document.removeEventListener("mousedown",d)}},[f]);let x=()=>{i(!1),n(s)},p=(d)=>{d.stopPropagation(),v(!0)},F=(d)=>{if(d.stopPropagation(),!r)i(!0)};if(a)return t("textarea",{ref:l,value:s,onChange:(d)=>c(d.target.value),onBlur:x,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return o("div",{ref:m,className:"relative w-full text-sm",children:[t("div",{onClick:p,className:`w-full text-foreground rounded border border-transparent transition-all px-2 py-1 h-[48px] line-clamp-2 whitespace-pre-wrap overflow-hidden ${!r?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:e?e:t("span",{className:"text-muted-foreground italic",children:"Empty"})}),f&&t("div",{onClick:F,className:`absolute top-0 left-0 w-full min-h-full h-auto z-50 bg-background border border-ring rounded shadow-lg px-2 py-1 whitespace-pre-wrap ${!r?"cursor-text":""}`,children:e?e:t("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},tt=Zt;C();var Xt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.number,[s,c]=u(!1),[l,m]=u(""),f=w(null);h(()=>{m(e!==void 0&&e!==null?e.toString():"")},[e]),h(()=>{if(s&&f.current)f.current.focus()},[s]);let v=()=>{if(!a)c(!0)},x=()=>{if(c(!1),l==="")r(void 0);else{let d=parseFloat(l);r(isNaN(d)?void 0:d)}},p=(d)=>{if(d.key==="Enter")d.stopPropagation(),f.current?.blur()},F=(d)=>{if(d===void 0||d===null||isNaN(d))return"";return d.toFixed(i?.scale)};if(s)return t("input",{ref:f,type:"number",step:1/Math.pow(10,i?.scale||0),value:l,onChange:(d)=>m(d.target.value),onBlur:x,onKeyDown:p,onDoubleClick:(d)=>d.stopPropagation(),className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm text-left font-mono"});return t("div",{onClick:v,onDoubleClick:(d)=>d.stopPropagation(),className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors text-left font-mono ${!a?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e!==void 0&&e!==null?F(e):t("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},ot=Xt;C();var Qt=({value:e,config:n,onSave:r,readOnly:a})=>{let i=n?.rating,s=Math.max(2,Math.min(6,i?.maxValue||5)),[c,l]=u(null),m=(v,x)=>{if(v.stopPropagation(),a)return;let p;if(e===x)p=0;else p=x;r(p)},f=Array.from({length:s},(v,x)=>x+1);return t("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!a&&l(null),onDoubleClick:(v)=>v.stopPropagation(),children:f.map((v)=>{let x=c!==null?v<=c:v<=(e||0);return t("button",{onClick:(p)=>m(p,v),onMouseEnter:()=>!a&&l(v),className:`focus:outline-none transition-transform ${!a?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:a,children:t(Se,{className:`w-5 h-5 transition-colors ${x?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},v)})})},au=Qt;C();C();var qt=Object.defineProperty,I=(e,n)=>qt(e,"name",{value:n,configurable:!0}),rt=["PageUp","PageDown"],at=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],it={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ve="Slider",[Le,Jt,eo]=sa(ve),[Ve,nr]=dt(ve,[eo]),[to,we]=Ve(ve),no=D(I(function(n,r){let{name:a,min:i=0,max:s=100,step:c=1,orientation:l="horizontal",disabled:m=!1,minStepsBetweenThumbs:f=0,defaultValue:v=[i],value:x,onValueChange:p=I(()=>{},"onValueChange"),onValueCommit:F=I(()=>{},"onValueCommit"),inverted:d=!1,form:M,...z}=n,P=w(new Set),b=w(0),G=w(!1),X=l==="horizontal"?ro:ao,[N,g]=u(null),k=he(r,g),[j=[],ee]=Lt({prop:x,defaultProp:v,onChange:I((Z)=>{[...P.current][b.current]?.focus({preventScroll:!0,focusVisible:G.current}),G.current=!1,p(Z)},"onChange")}),q=w(j),oe=w(j);h(()=>{let Z=M?N?.ownerDocument.getElementById(M):N?.closest("form");if(Z instanceof HTMLFormElement){let te=I(()=>ee(oe.current),"reset");return Z.addEventListener("reset",te),()=>Z.removeEventListener("reset",te)}},[N,M,ee]);function _(Z){let te=xt(j,Z);L(Z,te)}I(_,"handleSlideStart");function Q(Z){L(Z,b.current)}I(Q,"handleSlideMove");function J(){if(String(j)!==String(q.current))F(j)}I(J,"handleSlideEnd");function L(Z,te,{commit:Ue}={commit:!1}){let ze=He(c),_e=ce(Math.round((Z-i)/c)*c+i,ze),le=ia(_e,[i,s]);ee((ae=[])=>{let ne=ht(ae,le,te);if(St(ne,f*c)){b.current=ne.indexOf(le);let je=String(ne)!==String(ae);if(je&&Ue)F(ne);return je?ne:ae}else return ae})}return I(L,"updateValues"),t(to,{scope:n.__scopeSlider,name:a,disabled:m,min:i,max:s,valueIndexToChangeRef:b,thumbs:P.current,values:j,orientation:l,form:M,children:t(Le.Provider,{scope:n.__scopeSlider,children:t(Le.Slot,{scope:n.__scopeSlider,children:t(X,{"aria-disabled":m,"data-disabled":m?"":void 0,...z,ref:k,onPointerDown:Y(z.onPointerDown,()=>{if(!m)q.current=j,G.current=!1}),min:i,max:s,inverted:d,onSlideStart:m?void 0:_,onSlideMove:m?void 0:Q,onSlideEnd:m?void 0:J,onHomeKeyDown:()=>{if(!m)G.current=!0,L(i,0,{commit:!0})},onEndKeyDown:()=>{if(!m)G.current=!0,L(s,j.length-1,{commit:!0})},onStepKeyDown:({event:Z,direction:te})=>{if(!m){G.current=!0;let _e=rt.includes(Z.key)||Z.shiftKey&&at.includes(Z.key)?10:1,le=b.current,ae=j[le],ne=Ct(ae,{min:i,step:c,direction:te,multiplier:_e});L(ne,le,{commit:!0})}}})})})})},"Slider")),[st,ct]=Ve(ve,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ro=D(I(function(n,r){let{min:a,max:i,dir:s,inverted:c,onSlideStart:l,onSlideMove:m,onSlideEnd:f,onStepKeyDown:v,...x}=n,[p,F]=u(null),d=he(r,F),M=w(void 0),z=zn(s),P=z==="ltr",b=P&&!c||!P&&c;function G(y){let X=M.current||p.getBoundingClientRect(),N=[0,X.width],k=Ce(N,b?[a,i]:[i,a]);return M.current=X,k(y-X.left)}return I(G,"getValueFromPointer"),t(st,{scope:n.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:t(ut,{dir:z,"data-orientation":"horizontal",...x,ref:d,style:{...x.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:(y)=>{let X=G(y.clientX);l?.(X)},onSlideMove:(y)=>{let X=G(y.clientX);m?.(X)},onSlideEnd:()=>{M.current=void 0,f?.()},onStepKeyDown:(y)=>{let N=it[b?"from-left":"from-right"].includes(y.key);v?.({event:y,direction:N?-1:1})}})})},"SliderHorizontal")),ao=D(I(function(n,r){let{min:a,max:i,inverted:s,onSlideStart:c,onSlideMove:l,onSlideEnd:m,onStepKeyDown:f,...v}=n,x=w(null),p=he(r,x),F=w(void 0),d=!s;function M(z){let P=F.current||x.current.getBoundingClientRect(),b=[0,P.height],y=Ce(b,d?[i,a]:[a,i]);return F.current=P,y(z-P.top)}return I(M,"getValueFromPointer"),t(st,{scope:n.__scopeSlider,startEdge:d?"bottom":"top",endEdge:d?"top":"bottom",size:"height",direction:d?1:-1,children:t(ut,{"data-orientation":"vertical",...v,ref:p,style:{...v.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:(z)=>{let P=M(z.clientY);c?.(P)},onSlideMove:(z)=>{let P=M(z.clientY);l?.(P)},onSlideEnd:()=>{F.current=void 0,m?.()},onStepKeyDown:(z)=>{let b=it[d?"from-bottom":"from-top"].includes(z.key);f?.({event:z,direction:b?-1:1})}})})},"SliderVertical")),ut=D(I(function(n,r){let{__scopeSlider:a,onSlideStart:i,onSlideMove:s,onSlideEnd:c,onHomeKeyDown:l,onEndKeyDown:m,onStepKeyDown:f,...v}=n,x=we(ve,a);return t(se.span,{...v,ref:r,onKeyDown:Y(n.onKeyDown,(p)=>{if(p.key==="Home")l(p),p.preventDefault();else if(p.key==="End")m(p),p.preventDefault();else if(rt.concat(at).includes(p.key))f(p),p.preventDefault()}),onPointerDown:Y(n.onPointerDown,(p)=>{let F=p.target;if(F.setPointerCapture(p.pointerId),p.preventDefault(),x.thumbs.has(F))F.focus({preventScroll:!0,focusVisible:!1});else i(p)}),onPointerMove:Y(n.onPointerMove,(p)=>{if(p.target.hasPointerCapture(p.pointerId))s(p)}),onPointerUp:Y(n.onPointerUp,(p)=>{let F=p.target;if(F.hasPointerCapture(p.pointerId))F.releasePointerCapture(p.pointerId),c(p)})})},"SliderImpl")),io="SliderTrack",so=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=we(io,a);return t(se.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...i,ref:r})},"SliderTrack")),nt="SliderRange",lo=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=we(nt,a),c=ct(nt,a),l=w(null),m=he(r,l),f=s.values.length,v=s.values.map((F)=>Be(F,s.min,s.max)),x=f>1?Math.min(...v):0,p=100-Math.max(...v);return t(se.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...i,ref:m,style:{...n.style,[c.startEdge]:x+"%",[c.endEdge]:p+"%"}})},"SliderRange")),co="SliderThumb",[uo,mt]=Ve(co),mo="SliderThumbProvider";function ft(e){let{__scopeSlider:n,name:r,children:a,internal_do_not_use_render:i}=e,s=we(mo,n),c=Jt(n),[l,m]=u(null),f=O(()=>l?c().findIndex((z)=>z.ref.current===l):-1,[c,l]),v=oa(l),x=l?!!s.form||!!l.closest("form"):!0,p=s.values[f],F=r??(s.name?s.name+(s.values.length>1?"[]":""):void 0),d=p===void 0?0:Be(p,s.min,s.max);h(()=>{if(l)return s.thumbs.add(l),()=>{s.thumbs.delete(l)}},[l,s.thumbs]);let M={value:p,name:F,form:s.form,isFormControl:x,index:f,thumb:l,onThumbChange:m,percent:d,size:v};return t(uo,{scope:n,...M,children:Et(i)?i(M):a})}I(ft,"SliderThumbProvider");var Oe="SliderThumbTrigger",fo=D(I(function(n,r){let{__scopeSlider:a,...i}=n,s=we(Oe,a),c=ct(Oe,a),{index:l,value:m,percent:f,size:v,onThumbChange:x}=mt(Oe,a),p=he(r,x),F=vt(l,s.values.length),d=v?.[c.size],M=d?bt(d,f,c.direction):0;return t("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[c.startEdge]:`calc(${f}% + ${M}px)`},children:t(Le.ItemSlot,{scope:a,children:t(se.span,{role:"slider","aria-label":n["aria-label"]||F,"aria-valuemin":s.min,"aria-valuenow":m,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...i,ref:p,style:m===void 0?{display:"none"}:n.style,onFocus:Y(n.onFocus,()=>{s.valueIndexToChangeRef.current=l})})})})},"SliderThumbTrigger")),po=D(I(function(n,r){let{__scopeSlider:a,name:i,...s}=n;return t(ft,{__scopeSlider:a,name:i,internal_do_not_use_render:({index:c,isFormControl:l})=>o(B,{children:[t(fo,{...s,ref:r,__scopeSlider:a}),l?t(ho,{__scopeSlider:a},c):null]})})},"SliderThumb")),go="SliderBubbleInput",ho=D(I(function({__scopeSlider:n,...r},a){let{value:i,name:s,form:c}=mt(go,n),l=w(null),m=he(l,a),f=Cc(i);return h(()=>{let v=l.current;if(!v)return;let x=window.HTMLInputElement.prototype,F=Object.getOwnPropertyDescriptor(x,"value").set;if(f!==i&&F){let d=new Event("input",{bubbles:!0});F.call(v,i),v.dispatchEvent(d)}},[f,i]),t(se.input,{style:{display:"none"},name:s,form:c,...r,ref:m,defaultValue:i})},"SliderBubbleInput"));function ht(e=[],n,r){let a=[...e];return a[r]=n,a.sort((i,s)=>i-s)}I(ht,"getNextSortedValues");function Be(e,n,r){let s=100/(r-n)*(e-n);return ia(s,[0,100])}I(Be,"convertValueToPercentage");function vt(e,n){if(n>2)return`Value ${e+1} of ${n}`;else if(n===2)return["Minimum","Maximum"][e];else return}I(vt,"getLabel");function xt(e,n){if(e.length===1)return 0;let r=e.map((i)=>Math.abs(i-n)),a=Math.min(...r);return r.indexOf(a)}I(xt,"getClosestValueIndex");function bt(e,n,r){let a=e/2,i=50,s=Ce([0,50],[0,a]);return(a-s(n)*r)*r}I(bt,"getThumbInBoundsOffset");function Nt(e){return e.slice(0,-1).map((n,r)=>e[r+1]-n)}I(Nt,"getStepsBetweenValues");function St(e,n){if(n>0){let r=Nt(e);return Math.min(...r)>=n}return!0}I(St,"hasMinStepsBetweenValues");function Ce(e,n){return(r)=>{if(e[0]===e[1]||n[0]===n[1])return n[0];let a=(n[1]-n[0])/(e[1]-e[0]);return n[0]+a*(r-e[0])}}I(Ce,"linearScale");function He(e){if(!Number.isFinite(e))return 0;let n=e.toString();if(n.includes("e")){let[a,i]=n.split("e"),s=a.split(".")[1]||"",c=Number(i);return Math.max(0,s.length-c)}let r=n.split(".")[1];return r?r.length:0}I(He,"getDecimalCount");function ce(e,n){let r=Math.pow(10,n);return Math.round(e*r)/r}I(ce,"roundValue");function Ct(e,{min:n,step:r,direction:a,multiplier:i}){let s=He(r),c=(e-n)/r,l=Math.round(c),m=ce(l*r+n,s)===ce(e,s),f;if(m)f=l+i*a;else if(a>0)f=Math.ceil(c);else f=Math.floor(c);return ce(f*r+n,s)}I(Ct,"getNextStepValue");function Et(e){return typeof e==="function"}I(Et,"isFunction");var re;(function(e){e.Base32IncorrectEncoding="B32_ENC_INVALID",e.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",e.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",e.EncodeTimeNegative="ENC_TIME_NEG",e.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",e.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",e.PRNGDetectFailure="PRNG_DETECT",e.ULIDInvalid="ULID_INVALID",e.Unexpected="UNEXPECTED",e.UUIDInvalid="UUID_INVALID"})(re||(re={}));class ie extends Error{constructor(e,n){super(`${n} (${e})`);this.name="ULIDError",this.code=e}}function xo(e){let n=Math.floor(e()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(n)}function bo(e){let n=yo(),r=n&&(n.crypto||n.msCrypto)||null;if(typeof r?.getRandomValues==="function")return()=>{let a=new Uint8Array(1);return r.getRandomValues(a),a[0]/256};else if(typeof r?.randomBytes==="function")return()=>r.randomBytes(1).readUInt8()/256;throw new ie(re.PRNGDetectFailure,"Failed to find a reliable PRNG")}function yo(){if(So())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function wo(e,n){let r="";for(;e>0;e--)r=xo(n)+r;return r}function No(e,n=10){if(isNaN(e))throw new ie(re.EncodeTimeValueMalformed,`Time must be a number: ${e}`);else if(e>281474976710655)throw new ie(re.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${e}`);else if(e<0)throw new ie(re.EncodeTimeNegative,`Time must be positive: ${e}`);else if(Number.isInteger(e)===!1)throw new ie(re.EncodeTimeValueMalformed,`Time must be an integer: ${e}`);let r,a="";for(let i=n;i>0;i--)r=e%32,a="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(r)+a,e=(e-r)/32;return a}function So(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Bo(e,n){let r=n||bo(),a=!e||isNaN(e)?Date.now():e;return No(a,10)+wo(16,r)}function Co(e,n,r){let a=e.slice();return a.splice(r,0,a.splice(n,1)[0]),a}function su(e,n,r,a){if(r===a)return e;let i=Co(n,r,a),s=new Set(n.map((l)=>l.id)),c=0;return e.map((l)=>s.has(l.id)?i[c++]:l)}async function Ui(e){let n=[],r=[],a=e.items;if(a)for(let c=0;c<a.length;c++){let l=a[c];if(l.kind==="file"){let m=l.webkitGetAsEntry?.();if(m)r.push({entry:m,path:""})}}else return Array.from(e.files);let i=(c)=>new Promise((l)=>{c.readEntries((m)=>l(m),()=>l([]))}),s=(c)=>new Promise((l,m)=>{c.file((f)=>l(f),(f)=>m(f))});while(r.length>0){let c=r.shift();if(!c)continue;let{entry:l,path:m}=c;if(l.isFile)try{let f=await s(l),v=m?`${m}/${f.name}`:f.name;Object.defineProperty(f,"webkitRelativePath",{value:v,writable:!1,configurable:!0}),n.push(f)}catch(f){console.error("Error reading file entry:",f)}else if(l.isDirectory){let f=l.createReader(),v=[],x=await i(f);while(x.length>0)v=v.concat(x),x=await i(f);let p=m?`${m}/${l.name}`:l.name;for(let F of v)r.push({entry:F,path:p})}}return n}C();C();function Bl(){let[e,n]=u(!1);return o(pe,{open:e,onOpenChange:n,children:[t(Qg,{asChild:!0,children:o(S,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-transparent text-muted-foreground hover:text-foreground inline-flex items-center justify-center shrink-0 ml-1",title:gf(),children:[t(Pe,{className:"h-3.5 w-3.5"}),t("span",{className:"sr-only",children:gf()})]})}),o(ue,{className:"sm:max-w-[500px]",children:[o(me,{children:[o(de,{className:"flex items-center gap-2",children:[t(Pe,{className:"h-5 w-5 text-muted-foreground"}),gf()]}),t(Tt,{children:qy()})]}),o("div",{className:"space-y-4 py-2",children:[o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(Xe,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t("span",{children:Mc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:Hy()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:$y()})]}),o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(rn,{className:"h-4 w-4 text-amber-500 shrink-0"}),t("span",{children:Ic()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:Uy()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:Fy()})]}),o("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[o("div",{className:"flex items-center gap-2 font-medium text-sm",children:[t(wt,{className:"h-4 w-4 text-blue-500 shrink-0"}),t("span",{children:Tc()})]}),t("p",{className:"text-xs text-muted-foreground leading-relaxed",children:zy()}),t("p",{className:"text-xs italic text-muted-foreground/80",children:jy()})]})]})]})]})}var si=["red","orange","yellow","green","blue","purple","gray"],wa={red:{bg:"rgba(239, 68, 68, 0.15)",text:"#ef4444",hex:"#ef4444"},orange:{bg:"rgba(249, 115, 22, 0.15)",text:"#f97316",hex:"#f97316"},yellow:{bg:"rgba(234, 179, 8, 0.15)",text:"#ca8a04",hex:"#eab308"},green:{bg:"rgba(34, 197, 94, 0.15)",text:"#16a34a",hex:"#22c55e"},blue:{bg:"rgba(59, 130, 246, 0.15)",text:"#2563eb",hex:"#3b82f6"},purple:{bg:"rgba(168, 85, 247, 0.15)",text:"#9333ea",hex:"#a855f7"},gray:{bg:"rgba(128, 128, 128, 0.15)",text:"#4b5563",hex:"#808080"},system:{bg:"rgba(128, 128, 128, 0.1)",text:"#6b7280",hex:"#808080"}};function ms(e){if(!e)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let n=e.toLowerCase(),r=wa[n];if(r)return{backgroundColor:r.bg,color:r.text};if(e.startsWith("#"))return{backgroundColor:`${e}33`,color:e};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:e}}function va(e=[]){let n=new Set(e.map((a)=>a.color?.toLowerCase()).filter(Boolean)),r=si.filter((a)=>!n.has(a.toLowerCase()));if(r.length>0)return r[Math.floor(Math.random()*r.length)];return si[Math.floor(Math.random()*si.length)]}var ai={[Mr.text]:Bi,[Mr.longText]:Ze,[Mr.select]:Po,[Mr.selectMulti]:Ye,[Mr.rating]:Se,[Mr.number]:Qe,[Mr.toggle]:Je,[Mr.date]:Un,[Mr.user]:Hn,[Mr.userMulti]:oo};function _o({field:e,index:n,onVisibilityChange:r}){let{ref:a,handleRef:i}=Ni({id:e.id,index:n}),s=e.config?.type?ai[e.config.type]:null;return o("div",{ref:a,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[o("div",{className:"flex items-center gap-2",children:[t("div",{ref:i,className:"cursor-grab",children:t(Rs,{className:"h-4 w-4 text-muted-foreground"})}),s&&t(s,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.config?.autofillSource===xr.CONTENT&&t(rn,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.config?.autofillSource===xr.CREATION_CONTEXT&&t(wt,{className:"h-4 w-4 text-muted-foreground shrink-0"}),t("span",{className:"text-sm truncate",children:e.config?.name})]}),t(qe,{checked:e.visible,onCheckedChange:(c)=>r(e.id,c)})]})}function Kp({projectId:e,onManageFields:n,onSave:r}){let{fields:a,updateFields:i}=Or(),[s,c]=u(""),[l,m]=u("list"),[f,v]=u(""),[x,p]=u(""),[F,d]=u(xr.NONE),[M,z]=u(""),[P,b]=u([]),G=K();h(()=>{G.invalidateQueries({queryKey:["fields",e]})},[e,G]);let y=A.api.projects[":projectId"].fields.order.$patch,{mutate:X}=U({mutationFn:async(_)=>{if(!(await y(_)).ok)throw Error(Tf());return null}}),N=A.api.projects[":projectId"].fields.$post,{mutate:g}=U({mutationFn:async(_)=>{let Q=await N(_);if(!Q.ok)throw Error(If());return await Q.json()},onSuccess:(_)=>{let Q={..._,visible:!0},J=[...a,Q];i(J),v(""),b([]),X({param:{projectId:e},json:J.map((L)=>({fieldId:L.id,visible:L.visible||!1}))}),r?.()}}),k=O(()=>a.filter((_)=>_.config?.name?.toLowerCase().includes(s.toLowerCase())),[a,s]),j=(_)=>{if(_.canceled)return;let{source:Q}=_.operation;if(!Xn(Q))return;let{initialIndex:J,index:L}=Q;if(J===L)return;let Z=su(a,k,J,L);i(Z),X({param:{projectId:e},json:Z.map((te)=>({fieldId:te.id,visible:te.visible||!1}))})},ee=(_,Q)=>{let J=a.map((L)=>L.id===_?{...L,visible:Q}:L);i(J),X({param:{projectId:e},json:J.map((L)=>({fieldId:L.id,visible:L.visible||!1}))})},q=()=>{if(!f||!x)return;let _=x===Mr.select?{select:{options:P}}:x===Mr.selectMulti?{selectMulti:{options:P}}:{};g({param:{projectId:e},json:{config:{name:f,type:x,autofillSource:F,..._},label:f,description:M}})},oe=a.filter((_)=>_.visible).length;if(l==="create")return t("div",{className:"w-80 p-4",children:o("div",{className:"space-y-4",children:[o("div",{className:"space-y-2",children:[t(V,{htmlFor:"field-name",children:Rf()}),t(H,{id:"field-name",placeholder:Vv(),value:f,onChange:(_)=>v(_.target.value),autoFocus:!0})]}),o("div",{className:"space-y-2",children:[t(V,{children:kf()}),o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"outline",className:"w-full justify-between font-normal",children:[x?t("span",{className:"capitalize",children:x.replace(/_/g," ")}):t("span",{className:"text-muted-foreground border-dashed",children:VC()}),t(be,{className:"ml-2 h-4 w-4 opacity-50"})]})}),t(ye,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(Mr).map((_)=>t(W,{onClick:()=>{p(_),b([])},className:"capitalize",children:_.replace(/_/g," ")},_))})]})]}),o("div",{className:"space-y-2",children:[t(V,{htmlFor:"field-desc",children:fl()}),t(H,{id:"field-desc",placeholder:sd(),value:M,onChange:(_)=>z(_.target.value)})]}),o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center gap-1",children:[t(V,{children:nd()}),t(Bl,{})]}),o(Eo,{type:"single",value:F,onValueChange:(_)=>{if(_)d(_)},className:"w-full grid grid-cols-3 border rounded-md p-1 gap-1",children:[t(pr,{value:xr.NONE,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:Mc()}),t(pr,{value:xr.CONTENT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:Ic()}),t(pr,{value:xr.CREATION_CONTEXT,className:"text-[11px] leading-tight py-1 px-1 h-auto min-h-[32px] w-full text-center justify-center whitespace-normal font-medium",children:Tc()})]})]}),(x===Mr.select||x===Mr.selectMulti)&&o("div",{className:"space-y-2",children:[o("div",{className:"flex items-center justify-between",children:[t(V,{className:"text-sm font-medium",children:_d()}),o(S,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let _={id:Bo(),displayName:gd(),color:va(P)};b([...P,_])},children:[t(fe,{className:"h-4 w-4 mr-1"})," ",Xu()]})]}),t("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:P.map((_,Q)=>o("div",{className:"flex items-center gap-2",children:[t(H,{value:_.displayName,onChange:(J)=>{let L=[...P];L[Q]={..._,displayName:J.target.value},b(L)},placeholder:Yf(),className:"h-8 flex-1"}),o(gt,{children:[t(At,{asChild:!0,children:t("button",{type:"button",className:"w-6 h-6 rounded-full border shrink-0 cursor-pointer focus:outline-none hover:scale-105 transition-transform",style:{backgroundColor:wa[_.color||""]?.hex||_.color||"#808080"}})}),t(yt,{className:"p-2 w-auto",align:"end",children:t("div",{className:"flex gap-1",children:si.map((J)=>t("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:wa[J]?.hex||J},onClick:()=>{let L=[...P];L[Q]={..._,color:J},b(L)}},J))})})]}),t(S,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{b(P.filter((J,L)=>L!==Q))},children:t(De,{className:"h-4 w-4"})})]},_.id))})]}),o("div",{className:"flex gap-2 pt-2",children:[t(S,{variant:"secondary",className:"flex-1",onClick:()=>{m("list"),v(""),p(""),d(xr.NONE),z(""),b([])},children:ke()}),t(S,{className:"flex-1",onClick:q,disabled:!f||!x,children:Oo()})]})]})});return o("div",{className:"w-80 p-4",children:[t("div",{className:"flex items-center justify-between mb-4",children:o("h3",{className:"font-semibold",children:[Ti()," ",t("span",{className:"text-muted-foreground text-sm font-normal",children:HI({count:oe})})]})}),o("div",{className:"relative mb-4",children:[t(Ut,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),t(H,{placeholder:UC(),value:s,onChange:(_)=>c(_.target.value),className:"pl-8"})]}),t("div",{className:"max-h-60 overflow-y-auto pr-2",children:t(jn,{sensors:[un.configure({activationConstraints:[new kr.Distance({value:8})]}),Wo],onDragEnd:j,children:k.map((_,Q)=>t(_o,{field:_,index:Q,onVisibilityChange:ee},_.id))})}),n&&o("div",{className:"mt-4 space-y-2",children:[o(S,{variant:"secondary",className:"w-full",onClick:n,children:[t(Zs,{className:"h-4 w-4 mr-2"}),Zf()]}),o(S,{className:"w-full",onClick:()=>m("create"),children:[t(fe,{className:"h-4 w-4 mr-2"}),Qv()]})]})]})}var Fo=({value:e,config:n,onSave:r,readOnly:a,fieldId:i})=>{let s=n?.select,c=s?.options||[],[l,m]=u(!1),[f,v]=u(""),x=c.find((y)=>y.id===e),p=f.trim(),F=c.filter((y)=>y.displayName.toLowerCase().includes(p.toLowerCase())),d=c.some((y)=>y.displayName.trim().toLowerCase()===p.toLowerCase()||y.id.toLowerCase()===p.toLowerCase()),M=()=>{if(!a)m(!0)},z=(y)=>{r(y),m(!1),v("")},P=(y)=>{if(a)return;if(m(y),!y)v("")},b=async()=>{if(!p)return;let y={id:p.toLowerCase().replace(/\s+/g,"-"),displayName:p,color:va(c)},X=[...c,y],N={...n,select:{...s,options:X}};if(i)try{let g=await A.api.fields[":fieldId"].$put({param:{fieldId:i},json:{config:N}});if(!g.ok){R.error(ml());return}let k=await g.json(),ee=Or.getState().fields.map((q)=>q.id===k.id?{...q,...k,visible:q.visible}:q);Or.getState().updateFields(ee)}catch{R.error(ml());return}r(y.id),v(""),m(!1)};return t("div",{className:"relative w-full",onClick:(y)=>y.stopPropagation(),children:o(gt,{open:!a&&l,onOpenChange:P,children:[t(At,{asChild:!0,children:o("div",{onClick:M,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!a?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((y)=>{if(!y)return t("span",{className:"text-muted-foreground italic text-sm",children:"Select an option"});return t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium h-[22px]",style:ms(y.color),children:y.displayName})})(x),!a&&t(be,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),o(yt,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[o("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(y)=>y.stopPropagation(),children:[t(Ut,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),t("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:vg(),value:f,onChange:(y)=>v(y.target.value),autoFocus:!0})]}),o("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[f===""&&o("div",{onClick:()=>z(""),className:"px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground rounded cursor-pointer flex items-center gap-2",children:[t(De,{className:"w-3.5 h-3.5"})," Clear"]}),F.map((y)=>t("div",{onClick:()=>z(y.id),className:`px-2.5 py-1.5 text-xs hover:bg-accent rounded cursor-pointer flex items-center justify-between ${e===y.id?"bg-accent/50 font-medium":""}`,children:t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:ms(y.color),children:y.displayName})},y.id)),F.length===0&&!p&&t("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:Fh()}),p!==""&&!d&&o("div",{onClick:b,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[t(fe,{className:"w-3.5 h-3.5 shrink-0"}),t("span",{className:"truncate",children:mm({name:p})})]})]})]})]})})},_t=Fo;C();var Mo=({value:e=[],config:n,onSave:r,readOnly:a,fieldId:i})=>{let s=n?.selectMulti,c=s?.options||[],l=w(null),[m,f]=u(!1),[v,x]=u(e.length),[p,F]=u(""),d=c.filter((g)=>(e||[]).includes(g.id))||[],M=p.trim(),z=c.filter((g)=>g.displayName.toLowerCase().includes(M.toLowerCase())),P=c.some((g)=>g.displayName.trim().toLowerCase()===M.toLowerCase()||g.id.toLowerCase()===M.toLowerCase());Ge(()=>{if(m){x(d.length);return}if(l.current){let g=l.current.clientWidth-8,j=document.createElement("canvas").getContext("2d");if(j&&g>0){j.font="500 12px ui-sans-serif, system-ui, sans-serif";let ee=4,q=d.map((Z)=>Math.ceil(j.measureText(Z.displayName).width)+18);if(q.reduce((Z,te)=>Z+te,0)+Math.max(0,q.length-1)*ee<=g){x(d.length);return}let Q=g-32-ee,J=0,L=0;for(let Z=0;Z<q.length;Z++){let te=L>0?J+ee+q[Z]:q[Z];if(te>Q)break;J=te,L++}x(L)}}},[d,m,e]);let b=(g)=>{let k=e||[],j;if(k.includes(g))j=k.filter((ee)=>ee!==g);else j=[...k,g];r(j)},G=async()=>{if(!M)return;let g={id:M.toLowerCase().replace(/\s+/g,"-"),displayName:M,color:va(c)},k=[...c,g],j={...n,selectMulti:{...s,options:k}};if(i)try{let ee=await A.api.fields[":fieldId"].$put({param:{fieldId:i},json:{config:j}});if(!ee.ok){R.error(ml());return}let q=await ee.json(),_=Or.getState().fields.map((Q)=>Q.id===q.id?{...Q,...q,visible:Q.visible}:Q);Or.getState().updateFields(_)}catch{R.error(ml());return}r([...e||[],g.id]),F("")},y=(g)=>{if(g.stopPropagation(),!a)f(!0)},X=d.length-v;return t("div",{className:"relative w-full",onClick:(g)=>g.stopPropagation(),children:o(gt,{open:!a&&m,onOpenChange:(g)=>{if(a)return;if(f(g),!g)F("")},children:[t(At,{asChild:!0,children:o("div",{ref:l,onClick:y,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!a||X>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[d.length===0&&t("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),d.slice(0,v).map((g)=>t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium border border-transparent whitespace-nowrap h-[22px]",style:ms(g.color),children:g.displayName},g.id)),X>0&&o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",X]})]})}),o(yt,{side:"bottom",align:"start",sideOffset:4,className:"p-1.5 w-64 max-h-72 flex flex-col bg-popover border border-border rounded-lg shadow-lg",children:[o("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(g)=>g.stopPropagation(),children:[t(Ut,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),t("input",{type:"text",className:"w-full pl-7 pr-2 py-1 text-xs bg-muted/50 border border-input rounded-md focus:outline-none focus:ring-1 focus:ring-ring text-foreground",placeholder:vg(),value:p,onChange:(g)=>F(g.target.value),autoFocus:!0})]}),o("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[z.map((g)=>{let k=(e||[]).includes(g.id);return o("div",{onClick:()=>b(g.id),className:`px-2.5 py-1.5 hover:bg-accent rounded cursor-pointer flex items-center justify-between text-xs ${k?"bg-accent/30 font-medium":""}`,children:[t("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:ms(g.color),children:g.displayName}),k&&t(Me,{className:"w-3.5 h-3.5 text-primary"})]},g.id)}),z.length===0&&!M&&t("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:Fh()}),M!==""&&!P&&o("div",{onClick:G,className:"px-2.5 py-1.5 text-xs text-primary hover:bg-accent rounded cursor-pointer flex items-center gap-1.5 font-medium border-t border-border mt-1 pt-1.5",children:[t(fe,{className:"w-3.5 h-3.5 shrink-0"}),t("span",{className:"truncate",children:mm({name:M})})]})]})]})]})})},Ft=Mo;C();var Ro=({value:e,onSave:n,readOnly:r})=>{let[a,i]=u(!1),[s,c]=u(e||""),l=w(null);h(()=>{c(e||"")},[e]),h(()=>{if(a&&l.current)l.current.focus()},[a]);let m=()=>{if(!r)i(!0)},f=()=>{i(!1),n(s)},v=(x)=>{if(x.key==="Enter")l.current?.blur()};if(a)return t("input",{ref:l,type:"text",value:s,onChange:(x)=>c(x.target.value),onBlur:f,onKeyDown:v,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return t("div",{onClick:m,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!r?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:e||t("span",{className:"text-muted-foreground italic",children:"Empty"})})},Mt=Ro;var ko=({value:e,onSave:n,readOnly:r})=>t("div",{className:"flex items-center h-[28px] w-full",onClick:(i)=>i.stopPropagation(),children:t(qe,{checked:e,onCheckedChange:(i)=>{if(!r)n(i)},disabled:r,className:"cursor-pointer"})}),Rt=ko;C();var To=({value:e,onSave:n,readOnly:r})=>{let a=is(),{members:i,fetchMembers:s}=Ur(),[c,l]=u(!1);h(()=>{if(a)s(a)},[a,s]);let m=i.find((d)=>d.id===e),f=()=>{if(!r)l(!0)},v=(d)=>{n(d),l(!1)},x=(d)=>{if(r)return;l(d)},p=(d)=>d.split(" ").map((M)=>M[0]).slice(0,2).join("").toUpperCase();return t("div",{className:"relative w-full",onClick:(d)=>d.stopPropagation(),children:o(gt,{open:!r&&c,onOpenChange:x,children:[t(At,{asChild:!0,children:o("div",{onClick:f,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!r?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((d)=>{if(!d)return t("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return o("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border h-[22px]",children:[o(Ee,{className:"w-4 h-4",children:[t(Ie,{src:d.image,alt:d.name,className:"object-cover"}),t(Te,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:p(d.name)})]}),t("span",{className:"truncate max-w-[120px]",children:d.name})]})})(m),!r&&t(be,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),o(yt,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:[o("div",{onClick:()=>v(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[t(De,{className:"w-3 h-3"})," Clear"]}),i.map((d)=>o("div",{onClick:()=>v(d.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[o(Ee,{className:"w-5 h-5",children:[t(Ie,{src:d.image,alt:d.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:p(d.name)})]}),t("span",{className:"text-sm font-medium text-foreground",children:d.name})]},d.id))]})]})})},kt=To;C();var Io=({value:e=[],onSave:n,readOnly:r})=>{let a=is(),{members:i,fetchMembers:s}=Ur(),c=w(null),[l,m]=u(!1),[f,v]=u(e.length);h(()=>{if(a)s(a)},[a,s]);let x=i.filter((b)=>(e||[]).includes(b.id)),p=(b)=>b.split(" ").map((G)=>G[0]).slice(0,2).join("").toUpperCase();Ge(()=>{if(l){v(x.length);return}if(c.current){let b=c.current.clientWidth-8,y=document.createElement("canvas").getContext("2d");if(y&&b>0){y.font="500 12px ui-sans-serif, system-ui, sans-serif";let X=4,N=x.map((oe)=>Math.min(100,Math.ceil(y.measureText(oe.name).width))+40);if(N.reduce((oe,_)=>oe+_,0)+Math.max(0,N.length-1)*X<=b){v(x.length);return}let j=b-32-X,ee=0,q=0;for(let oe=0;oe<N.length;oe++){let _=q>0?ee+X+N[oe]:N[oe];if(_>j)break;ee=_,q++}v(q)}}},[x,l,e]);let F=(b)=>{let G=e||[],y;if(G.includes(b))y=G.filter((X)=>X!==b);else y=[...G,b];n(y)},d=(b)=>{if(b.stopPropagation(),!r)m(!0)},M=x.length-f,z=(b)=>{if(r)return;m(b)},P=(b)=>o("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full text-xs font-medium bg-muted text-foreground border whitespace-nowrap h-[22px]",children:[o(Ee,{className:"w-4 h-4",children:[t(Ie,{src:b.image,alt:b.name,className:"object-cover"}),t(Te,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:p(b.name)})]}),t("span",{className:"truncate max-w-[100px]",children:b.name})]},b.id);return t("div",{className:"relative w-full",onClick:(b)=>b.stopPropagation(),children:o(gt,{open:!r&&l,onOpenChange:z,children:[t(At,{asChild:!0,children:o("div",{ref:c,onClick:d,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!r||M>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[x.length===0&&t("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),x.slice(0,f).map(P),M>0&&o("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-muted text-muted-foreground h-[22px]",children:["+",M]})]})}),t(yt,{className:"p-1 w-[--radix-popover-trigger-width] min-w-[200px] max-h-60 overflow-auto bg-popover border border-border rounded-lg shadow-lg",align:"start",children:i.map((b)=>{let G=(e||[]).includes(b.id);return o("div",{onClick:()=>F(b.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[o("div",{className:"flex items-center gap-2",children:[o(Ee,{className:"w-5 h-5",children:[t(Ie,{src:b.image,alt:b.name,className:"object-cover"}),t(Te,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:p(b.name)})]}),t("span",{className:"text-sm font-medium text-foreground",children:b.name})]}),G&&t(Me,{className:"w-4 h-4 text-primary"})]},b.id)})})]})})},It=Io;var Do=(e)=>{if(!e.config)return t("div",{children:"Unknown Field Type"});switch(e.config.type){case"text":return t(Mt,{...e,value:e.value,onSave:e.onSave});case"longText":return t(tt,{...e,value:e.value,onSave:e.onSave});case"select":return t(_t,{...e,value:e.value,onSave:e.onSave});case"selectMulti":return t(Ft,{...e,value:e.value,onSave:e.onSave});case"rating":return t(au,{...e,value:e.value,onSave:e.onSave});case"number":return t(ot,{...e,value:e.value,onSave:e.onSave});case"toggle":return t(Rt,{...e,value:e.value,onSave:e.onSave});case"date":return t(et,{...e,value:e.value,onSave:e.onSave});case"user":return t(kt,{...e,value:e.value,onSave:e.onSave});case"userMulti":return t(It,{...e,value:e.value,onSave:e.onSave});default:return t("div",{children:"Unknown Field Type"})}},hs=Do;C();function Bs({className:e,defaultValue:n,value:r,min:a=0,max:i=100,...s}){let c=O(()=>Array.isArray(r)?r:Array.isArray(n)?n:[a,i],[r,n,a,i]);return o(no,{"data-slot":"slider",defaultValue:n,value:r,min:a,max:i,className:E("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...s,children:[t(so,{"data-slot":"slider-track",className:E("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:t(lo,{"data-slot":"slider-range",className:E("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(l,m)=>t(po,{"data-slot":"slider-thumb",className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},m))]})}
|
|
2
|
-
export{Zo,Zs,Bi,su,Ui,Or,Bo,ps,au,Bl,si,wa,ms,va,ai,Kp,hs,Bs};
|
package/bin/chunk-7pw1550a.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u,C,K,U,A,Ya,Od,R,yr}from"./chunk-7rhz2gze.js";var Y={x:0.5,y:0.5};class oi extends Od{apply({activatorEvent:g,shape:I,transform:m}){if(!I||!(g instanceof PointerEvent))return m;let h=this.options?.anchor??Y,{boundingRectangle:p}=I.initial,F=p.left+p.width*h.x,l=p.top+p.height*h.y;return{x:m.x+g.clientX-F,y:m.y+g.clientY-l}}static configure=Ya(oi)}C();function Dl({teamId:g,projectId:I,assetId:m,folders:h,files:p,selectedIds:F,onClearSelection:l}){let D=K(),[d,S]=u(void 0),q=(n,r)=>{let s=["search",g,m,n?"folder":"file"],i=D.getQueriesData({queryKey:s}),o=(t)=>{if(typeof t!=="object"||t===null)return!1;let e=t;return"field"in e&&"order"in e&&typeof e.field==="string"&&(e.order==="asc"||e.order==="desc")};for(let[t,e]of i){if(!e||!Array.isArray(e.pages))continue;let f=t.find(o),a=e.pages.flatMap((c)=>c.data??[]),x=a.findIndex((c)=>c.id===r.id);if(x===-1)continue;if(a[x]={...a[x],...r},f?.field==="custom"){let c=f.order==="desc";a.sort((w,T)=>{let b=w.sortIndex??"",k=T.sortIndex??"";if(b===k)return 0;if(c)return b<k?1:-1;else return b<k?-1:1})}let E=0,X=e.pages.map((c)=>{let w=c.data?c.data.length:0,T=a.slice(E,E+w);return E+=w,{...c,data:T}});D.setQueryData(t,{...e,pages:X})}},j=A.api.projects[":projectId"].reparent.$post,{mutate:v}=U({mutationFn:async(n)=>{if(!(await j(n)).ok)throw Error("Failed to move assets");return null}}),P=A.api.folders[":folderId"].order.$patch,{mutate:Q}=U({mutationFn:async(n)=>{let r=await P(n);if(!r.ok)throw Error("Failed to reorder folder");return await r.json()}}),L=A.api.files[":fileId"].order.$patch,{mutate:M}=U({mutationFn:async(n)=>{let r=await L(n);if(!r.ok)throw Error("Failed to reorder file");return await r.json()}}),O=A.api.shares[":shareId"].assets.$post,{mutate:z}=U({mutationFn:async(n)=>{let r=await O(n);if(!r.ok)throw Error("Failed to add asset to share");return await r.json()}});return{dragState:d,handleDragStart:(n)=>{let r=n.operation.source;if(!r)return;let y=r.id.split(":").pop(),s=r.data;if(!s)return;let i,o;if(F.has(y))i=new Set(F),o=[...h,...p].filter((f)=>F.has(f.id));else i=new Set([y]),o=[s.item];let t=o.some((f)=>f.type==="folder"),e=i.size===1&&o.length===1&&o[0].type==="file";S({isActive:!0,draggedIds:i,hasFolders:t,isSingleFile:e,itemCount:i.size})},handleDragEnd:(n)=>{let{target:r}=n.operation;if(r&&d){let y=r.id.split(":").pop(),s=r.data;if(s?.type==="chatbot-sidebar"){let t=[...h,...p].filter((e)=>d.draggedIds.has(e.id)).map((e)=>({id:e.id,name:e.name||"Unnamed",type:e.type}));yr.getState().addAssets(t),l(),S(void 0);return}if(s?.type==="share-link"){let o=y,t=Array.from(d.draggedIds);z({param:{shareId:o},json:{assetIds:t}},{onSuccess:(e)=>{if(e.addedCount===0)R.info("Assets already exists in share");else R.success(`Added ${e.addedCount} item(s) to share link`);D.invalidateQueries({queryKey:["shares",I]}),l()},onError:(e)=>{R.error(`Failed to add to share: ${e.message}`)}}),S(void 0);return}let i=!1;if(s&&!d.draggedIds.has(y)){if(s.type==="folder"||s.type==="reorder")i=!0;else if(s.type==="file"||s.type==="version_stack"){if(d.isSingleFile)i=!0}}if(s?.type==="reorder"){let{position:o,item:t}=s,e=d.hasFolders,f=Array.from(d.draggedIds)[0];if(e)Q({param:{folderId:f},json:o==="before"?{beforeIndex:t.sortIndex??void 0}:{afterIndex:t.sortIndex??void 0}},{onSuccess:(a)=>{R.success("Folder reordered"),q(!0,a),l()},onError:(a)=>{R.error(`Failed to reorder: ${a.message}`)}});else M({param:{fileId:f},json:o==="before"?{beforeIndex:t.sortIndex??void 0}:{afterIndex:t.sortIndex??void 0}},{onSuccess:(a)=>{R.success("File reordered"),q(!1,a),l()},onError:(a)=>{R.error(`Failed to reorder: ${a.message}`)}})}else if(i)v({param:{projectId:I},json:{assetIds:Array.from(d.draggedIds),newParentId:y}},{onSuccess:()=>{R.success("Assets moved successfully"),D.invalidateQueries({queryKey:["search",g,m]}),D.invalidateQueries({queryKey:["folders"]}),l()},onError:()=>{R.error("Failed to move assets")}})}S(void 0)}}}
|
|
2
|
-
export{oi,Dl};
|