@shumai-one/shumai 0.4.0 → 0.4.2

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.
Files changed (184) hide show
  1. package/bin/{chunk-2xgvs3as.js → chunk-07h4b77v.js} +2 -2
  2. package/bin/{chunk-gazp5662.js → chunk-0t4n4d5w.js} +2 -2
  3. package/bin/{chunk-x9akgj7w.js → chunk-1611z9jg.js} +2 -2
  4. package/bin/{chunk-kvnfgr29.js → chunk-1phqxp6z.js} +1 -1
  5. package/bin/chunk-23hckrrz.js +2 -0
  6. package/bin/{chunk-ymr5ybxk.js → chunk-30z44j1g.js} +2 -2
  7. package/bin/{chunk-fcsfssar.js → chunk-3j463k1g.js} +1 -1
  8. package/bin/{chunk-zye42cfp.js → chunk-4181tdds.js} +1 -1
  9. package/bin/chunk-480jtqng.js +4 -0
  10. package/bin/{chunk-m8z8jvdq.js → chunk-4c3g146q.js} +2 -2
  11. package/bin/chunk-4ca0zt5e.js +1 -0
  12. package/bin/chunk-4d9bgmf2.js +2 -0
  13. package/bin/{chunk-fvbd5dk7.js → chunk-4ev56fss.js} +5 -5
  14. package/bin/{chunk-zmyawgth.js → chunk-4gk52tjq.js} +1 -1
  15. package/bin/chunk-4mdqkj4d.js +1 -0
  16. package/bin/{chunk-mhps85dd.js → chunk-4r91fggc.js} +1 -1
  17. package/bin/chunk-50fb1x3w.js +1 -0
  18. package/bin/chunk-59gj1njz.js +1 -0
  19. package/bin/{chunk-j04sztp3.js → chunk-5pr0t7fb.js} +1 -1
  20. package/bin/chunk-5vewxmz7.js +3 -0
  21. package/bin/chunk-62zx96pe.js +2 -0
  22. package/bin/chunk-63y0eb07.js +2 -0
  23. package/bin/chunk-6d5xrgfx.js +2 -0
  24. package/bin/{chunk-etprs58p.js → chunk-6gbtz5bf.js} +2 -2
  25. package/bin/{chunk-wrgwjg2g.js → chunk-6gjg5egq.js} +1 -1
  26. package/bin/{chunk-4q782s34.js → chunk-6m4jz9s1.js} +3 -3
  27. package/bin/{chunk-wehhpcm1.js → chunk-6s4x525w.js} +1 -1
  28. package/bin/{chunk-xzag8w1v.js → chunk-6w2wmvqs.js} +1 -1
  29. package/bin/{chunk-r2shjtte.js → chunk-77d23vcn.js} +2 -2
  30. package/bin/{chunk-vhcqazqf.js → chunk-77m5p188.js} +2 -2
  31. package/bin/chunk-7bvx087f.js +1 -0
  32. package/bin/chunk-7pfjfrjg.js +5 -0
  33. package/bin/{chunk-1qr0ajc8.js → chunk-7q10s127.js} +1 -1
  34. package/bin/{chunk-c3msq02x.js → chunk-7thx8ctx.js} +2 -2
  35. package/bin/{chunk-vvhs586e.js → chunk-8t4s91gh.js} +1 -1
  36. package/bin/{chunk-k3r97v7j.js → chunk-98ey5p2e.js} +1 -1
  37. package/bin/{chunk-44edgqvy.js → chunk-9amndcyh.js} +3 -3
  38. package/bin/chunk-9bk23g9x.js +1 -0
  39. package/bin/chunk-9mkcfy43.js +1 -0
  40. package/bin/{chunk-0h8rjeyj.js → chunk-9t3nsq5n.js} +2 -2
  41. package/bin/{chunk-j536e9nx.js → chunk-9tjq99ds.js} +2 -2
  42. package/bin/chunk-9wm9rwh1.js +2 -0
  43. package/bin/{chunk-nz2v1jmd.js → chunk-ab16fyg4.js} +2 -2
  44. package/bin/chunk-arv0g2av.js +1 -0
  45. package/bin/{chunk-hx2mvd20.js → chunk-aytj4zxg.js} +2 -2
  46. package/bin/{chunk-02afmyqy.js → chunk-b1ypjqgp.js} +2 -2
  47. package/bin/{chunk-93ecxcy4.js → chunk-bdjv0ykq.js} +1 -1
  48. package/bin/chunk-c1k86mfa.js +10 -0
  49. package/bin/{chunk-wy2f6mby.js → chunk-caa96dgd.js} +1 -1
  50. package/bin/chunk-ce4v2yjy.js +1 -0
  51. package/bin/{chunk-m2tbft2c.js → chunk-cqh60y54.js} +2 -2
  52. package/bin/chunk-cvq7zgw7.js +1 -0
  53. package/bin/{chunk-tcm57j8r.js → chunk-d9mjbtp2.js} +2 -2
  54. package/bin/{chunk-xkhwj8mw.js → chunk-dn7sbjws.js} +2 -2
  55. package/bin/{chunk-p49h5fxs.js → chunk-dxyq9h8n.js} +1 -1
  56. package/bin/{chunk-3twtxs5m.js → chunk-e3cabksx.js} +1 -1
  57. package/bin/{chunk-52dr035y.js → chunk-egcrbj94.js} +2 -2
  58. package/bin/chunk-ev17v1mv.js +2 -0
  59. package/bin/chunk-evtpwg71.js +2 -0
  60. package/bin/{chunk-2rbexbv0.js → chunk-f3e0nsv2.js} +1 -1
  61. package/bin/chunk-f40gjqpq.js +2 -0
  62. package/bin/chunk-fe7822ak.js +299 -0
  63. package/bin/{chunk-4b7jcpgv.js → chunk-g8tkhw9j.js} +2 -2
  64. package/bin/{chunk-mgnxa0vy.js → chunk-g9r0p4t8.js} +1 -1
  65. package/bin/chunk-gbjyh9ms.js +1 -0
  66. package/bin/{chunk-thbfw1ed.js → chunk-gtbsb39v.js} +1 -1
  67. package/bin/{chunk-zh752hw8.js → chunk-gytz1q13.js} +1 -1
  68. package/bin/chunk-h0fxysxs.js +7 -0
  69. package/bin/{chunk-aw5zkdma.js → chunk-h8bdvsqt.js} +2 -2
  70. package/bin/{chunk-76433x4d.js → chunk-hag024w8.js} +2 -2
  71. package/bin/chunk-hc6w5nw4.js +7 -0
  72. package/bin/chunk-j69dqc48.js +2 -0
  73. package/bin/{chunk-yfqz6f72.js → chunk-jbtw1zym.js} +1 -1
  74. package/bin/{chunk-9k76s3y6.js → chunk-jc1vb7rj.js} +2 -2
  75. package/bin/{chunk-41d9gkx7.js → chunk-jdv78w9r.js} +1 -1
  76. package/bin/{chunk-dag45evp.js → chunk-jjs70y9v.js} +1 -1
  77. package/bin/{chunk-ysvhtgve.js → chunk-jmdar2gz.js} +2 -2
  78. package/bin/chunk-jvwz10n4.js +2 -0
  79. package/bin/{chunk-ck6msfch.js → chunk-k47md1g4.js} +2 -2
  80. package/bin/{chunk-yyjx8nbq.js → chunk-k4v0brcb.js} +1 -1
  81. package/bin/chunk-k6n7c07e.js +1 -0
  82. package/bin/{chunk-kjjhvrk1.js → chunk-kk2cstsg.js} +1 -1
  83. package/bin/{chunk-3r33kewe.js → chunk-knz4h56q.js} +3 -3
  84. package/bin/{chunk-j5rx3x1q.js → chunk-kqqtt6bd.js} +1 -1
  85. package/bin/{chunk-ez6veng7.js → chunk-kvyp1t4j.js} +1 -1
  86. package/bin/{chunk-djx2r4nj.js → chunk-kxskpgsq.js} +2 -2
  87. package/bin/{chunk-3gjn4pyp.js → chunk-m6srbjcs.js} +2 -2
  88. package/bin/{chunk-8956rryj.js → chunk-mcc1scxs.js} +2 -2
  89. package/bin/{chunk-0bfqrx5q.js → chunk-mq83a0kk.js} +2 -2
  90. package/bin/chunk-mxm8g4q0.js +1 -0
  91. package/bin/{chunk-6m1k317a.js → chunk-nhpgdqq5.js} +2 -2
  92. package/bin/{chunk-pdjar480.js → chunk-nne496aa.js} +2 -2
  93. package/bin/{chunk-s73c0brj.js → chunk-nqpb0r9h.js} +1 -1
  94. package/bin/chunk-ns0zww9g.js +2 -0
  95. package/bin/{chunk-9cmvymm5.js → chunk-ps4xfp23.js} +1 -1
  96. package/bin/chunk-pz2ec6xt.js +2 -0
  97. package/bin/{chunk-vkgxrn1h.js → chunk-q163k309.js} +2 -2
  98. package/bin/chunk-q1da61ps.js +1 -0
  99. package/bin/{chunk-7x1vkftb.js → chunk-qrf0ady6.js} +2 -2
  100. package/bin/{chunk-d7en47eh.js → chunk-qy28f25e.js} +1 -1
  101. package/bin/{chunk-xjnghr99.js → chunk-r7s4ypw1.js} +1 -1
  102. package/bin/chunk-ran23vm9.js +1 -0
  103. package/bin/chunk-rfvdc4n0.js +2 -0
  104. package/bin/{chunk-8rcfhfq5.js → chunk-rgthkvgx.js} +1 -1
  105. package/bin/chunk-s39n3yw3.js +2 -0
  106. package/bin/{chunk-xv5h4dv1.js → chunk-s7wdd0g7.js} +1 -1
  107. package/bin/{chunk-n8gsjwht.js → chunk-s88ha5kx.js} +2 -2
  108. package/bin/chunk-sf91bt9m.js +2 -0
  109. package/bin/{chunk-2x46963w.js → chunk-sjwbjf9j.js} +1 -1
  110. package/bin/chunk-t62076pv.js +1 -0
  111. package/bin/{chunk-he1ywtxx.js → chunk-tbbwss3v.js} +1 -1
  112. package/bin/{chunk-06spnkta.js → chunk-tjcc7a6y.js} +1 -1
  113. package/bin/{chunk-qac5hr5h.js → chunk-tp6ab26e.js} +1 -1
  114. package/bin/{chunk-md12a1sf.js → chunk-v2wxk9p5.js} +2 -2
  115. package/bin/chunk-vbk6y4hk.js +2 -0
  116. package/bin/{chunk-vcf2qk9h.js → chunk-vfgfg5fk.js} +2 -2
  117. package/bin/{chunk-gjnrd32m.js → chunk-vm6c3xx9.js} +2 -2
  118. package/bin/{chunk-agabtxrc.js → chunk-vsx96mt6.js} +1 -1
  119. package/bin/{chunk-et0cewj7.js → chunk-wbyw1shz.js} +2 -2
  120. package/bin/chunk-whh2vh50.css +1 -0
  121. package/bin/{chunk-792t2653.js → chunk-wjkcq65s.js} +2 -2
  122. package/bin/{chunk-5yhn31rd.js → chunk-wkefwkfp.js} +1 -1
  123. package/bin/{chunk-gcc6pte2.js → chunk-x7bsnk1e.js} +2 -2
  124. package/bin/{chunk-tn67sjb2.js → chunk-xbhw6bpz.js} +2 -2
  125. package/bin/{chunk-34kaja59.js → chunk-xg5yrcj5.js} +2 -2
  126. package/bin/{chunk-wzmpvadf.js → chunk-xw2gpcsh.js} +1 -1
  127. package/bin/{chunk-sx6y697s.js → chunk-ycq8ank7.js} +1 -1
  128. package/bin/chunk-yp9hvkc5.js +73 -0
  129. package/bin/{chunk-dkjkn8t3.js → chunk-ytypyfkc.js} +2 -2
  130. package/bin/{chunk-62ebss6h.js → chunk-z1kjmf60.js} +2 -2
  131. package/bin/chunk-z36bx86r.js +2 -0
  132. package/bin/chunk-z7hdnecp.js +3 -0
  133. package/bin/chunk-zeby1cq7.js +2 -0
  134. package/bin/chunk-zs5e8z1w.js +1 -0
  135. package/bin/chunk-zxnyefg5.js +2 -0
  136. package/bin/shumai-app.html +1 -1
  137. package/bin/shumai-app.js +312 -342
  138. package/package.json +7 -7
  139. package/prisma/schema.prisma +1 -1
  140. package/bin/chunk-045f1bw7.js +0 -2
  141. package/bin/chunk-0n1wfwcm.js +0 -2
  142. package/bin/chunk-1fwzepfn.js +0 -2
  143. package/bin/chunk-2xevs82j.js +0 -2
  144. package/bin/chunk-31y5j4hr.js +0 -1
  145. package/bin/chunk-34adtqqh.js +0 -1
  146. package/bin/chunk-4j8fbckp.js +0 -1
  147. package/bin/chunk-57s7yj35.js +0 -1
  148. package/bin/chunk-6tse78c7.js +0 -2
  149. package/bin/chunk-8nyve0cr.js +0 -7
  150. package/bin/chunk-ajndx51c.js +0 -2
  151. package/bin/chunk-bbyc2jfq.js +0 -1
  152. package/bin/chunk-br7d2qwc.js +0 -1
  153. package/bin/chunk-by6g0vye.js +0 -2
  154. package/bin/chunk-c24fvhm6.js +0 -1
  155. package/bin/chunk-c6aszz6p.js +0 -1
  156. package/bin/chunk-csqvmx1m.js +0 -2
  157. package/bin/chunk-dg8c91j5.js +0 -1
  158. package/bin/chunk-dk8vk17v.js +0 -2
  159. package/bin/chunk-ex2ym5pz.js +0 -2
  160. package/bin/chunk-f2zbsrc9.js +0 -2
  161. package/bin/chunk-gcpr2a24.js +0 -7
  162. package/bin/chunk-gpjkegdp.js +0 -1
  163. package/bin/chunk-jt6d0zb1.js +0 -2
  164. package/bin/chunk-jwgfkpek.js +0 -3
  165. package/bin/chunk-k2065y29.js +0 -2
  166. package/bin/chunk-k514bttd.js +0 -1
  167. package/bin/chunk-k7chm9a9.js +0 -2
  168. package/bin/chunk-kjgejwjp.css +0 -1
  169. package/bin/chunk-kqpzx5az.js +0 -73
  170. package/bin/chunk-kxr8fjsq.js +0 -2
  171. package/bin/chunk-mha3rsh7.js +0 -2
  172. package/bin/chunk-nn0px81k.js +0 -307
  173. package/bin/chunk-ns804tmv.js +0 -2
  174. package/bin/chunk-p1temt1j.js +0 -1
  175. package/bin/chunk-rkz6x3r0.js +0 -2
  176. package/bin/chunk-svz0ds0g.js +0 -1
  177. package/bin/chunk-t31basc5.js +0 -1
  178. package/bin/chunk-t6qdrw24.js +0 -1
  179. package/bin/chunk-wvwqgff4.js +0 -1
  180. package/bin/chunk-ww1cy08p.js +0 -1
  181. package/bin/chunk-xfp27ya9.js +0 -2
  182. package/bin/chunk-y0f4bc9f.js +0 -2
  183. package/bin/chunk-y2s0tjaa.js +0 -3
  184. package/bin/chunk-y3dy4pdt.js +0 -2
@@ -1,2 +0,0 @@
1
- import{Pl as r,Ul as o,Xi as e}from"./chunk-kqpzx5az.js";function u({className:a,size:t="default",...s}){return e(o.Root,{"data-slot":"avatar","data-size":t,className:r("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",a),...s})}function l({className:a,...t}){return e(o.Image,{"data-slot":"avatar-image",className:r("aspect-square size-full",a),...t})}function d({className:a,...t}){return e(o.Fallback,{"data-slot":"avatar-fallback",className:r("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",a),...t})}
2
- export{u as Zh,l as _h,d as $h};
@@ -1,2 +0,0 @@
1
- import{$ as O2,aa as F0}from"./chunk-4b7jcpgv.js";import{xf as w0,yf as U2,zf as y2}from"./chunk-mhps85dd.js";import{Ef as y0,Ff as r0,Gf as x0,Hf as h0,If as L0,Kf as T0}from"./chunk-ns804tmv.js";import{Mf as o,Nf as u,Of as j,Tf as h,Uf as t}from"./chunk-2xevs82j.js";import{Lg as w2,Mg as T2,Ng as C2,Wg as R2}from"./chunk-7x1vkftb.js";import{Hh as l0,Ih as r,Sh as K0,Xh as O0}from"./chunk-9cmvymm5.js";import{Yh as S0}from"./chunk-6m1k317a.js";import{$h as b0,Zh as Q0,_h as q0}from"./chunk-kxr8fjsq.js";import{ai as F2,ci as V2,di as S2,ei as m2}from"./chunk-02afmyqy.js";import{Ci as $0,Li as k2,Mi as K2,Ni as J2,Oi as Z2,Qi as X2,Ri as Y2,Si as H0,qi as H2,vi as E0,xi as D0}from"./chunk-8nyve0cr.js";import{Ui as Z0}from"./chunk-62ebss6h.js";import{Aj as v0,Dj as Q2,Gl as v2,Hl as c2,Lk as G2,Ll as _0,Mj as $2,Pl as B0,Qj as c0,Tj as q2,Vi as I,Vj as m0,Wj as X0,Xi as P,Xj as j0,Yi as J,Yj as n0,bl as k0,ck as i0,dm as A0,jm as x,kl as Y0,ml as M2,mm as G,nm as G0,qj as f0,sl as W0,tk as b2,uk as B2,ul as A2,xl as g2,zl as W2}from"./chunk-kqpzx5az.js";import{kn as E}from"./chunk-p49h5fxs.js";function l2(N){let $=N.lastIndexOf(".");if($>0)return[0,$];return[0,N.length]}function z5(N){N.focus();let[$,k]=l2(N.value);if(typeof N.setSelectionRange==="function")N.setSelectionRange($,k);else N.select()}var i=D0((N)=>({fields:[],loadedProjectId:null,setFields:($,k)=>N({fields:$,loadedProjectId:k}),updateFields:($)=>N({fields:$})}));function o0(N,$){let{start:k,end:K}=x0($?.in,N),X=+k>+K,M=X?+k:+K,z=X?K:k;z.setHours(0,0,0,0);let Y=$?.step??1;if(!Y)return[];if(Y<0)Y=-Y,X=!X;let H=[];while(+z<=M)H.push(l0(k,z)),z.setDate(z.getDate()+Y),z.setHours(0,0,0,0);return X?H.reverse():H}function g0(N,$){return r(N,$?.in).getDate()}function u0(N,$){return r(N,$?.in).getDay()}function R0(N,$){return r(N,$?.in).getHours()}function U0(N,$){return r(N,$?.in).getMinutes()}var a=E(I(),1);var x2=({value:N,config:$,onSave:k,readOnly:K})=>{let X=$?.date,[M,z]=a.useState(!1),Y=a.useRef(null),H=N?new Date(N):new Date,Q=K0(H)?H:new Date,[q,b]=a.useState(Q);a.useEffect(()=>{if(M&&N){let g=new Date(N);if(K0(g))b(g)}},[M,N]),a.useEffect(()=>{let g=(_)=>{if(Y.current&&!Y.current.contains(_.target)){if(M)z(!1)}};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[M]);let v=()=>{if(!K)z(!0)},S=(g)=>{if(!g)return"";let _=new Date(g);if(!K0(_))return"Invalid Date";let c="PPP";if(X?.displayFormat==="usa")c="MM/dd/yyyy";else if(X?.displayFormat==="euro")c="dd/MM/yyyy";else if(X?.displayFormat==="iso")c="yyyy-MM-dd";if(X?.includeTime)if(X?.timeFormat==="twenty_four_hour")c+=" HH:mm";else c+=" p";let C=O0(_,c);if(X?.displayTimezone)C+=` (${Intl.DateTimeFormat().resolvedOptions().timeZone})`;return C},Z=new Date(q.getFullYear(),q.getMonth(),1),F=r0(q),w=o0({start:Z,end:F}),y=u0(Z),A=(g)=>{let _=new Date(g);if(X?.includeTime)_.setHours(R0(Q)),_.setMinutes(U0(Q));let c=_.toISOString();if(k(c),!X?.includeTime)z(!1)},T=(g,_)=>{let c=N?new Date(N):new Date;if(!K0(c))c.setTime(new Date().getTime());if(g==="hour")c.setHours(_);if(g==="minute")c.setMinutes(_);let C=c.toISOString();k(C)},W=Array.from({length:24},(g,_)=>_),O=Array.from({length:12},(g,_)=>_*5);if(M)return J("div",{className:"relative w-full",ref:Y,children:[P("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:N?S(N):P("span",{className:"text-muted-foreground",children:"Select date..."})}),J("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:[J("div",{className:"p-4 w-64",children:[J("div",{className:"flex justify-between items-center mb-4",children:[P("button",{onClick:()=>b(y0(q,-1)),className:"p-1 hover:bg-accent rounded",children:P(j0,{className:"w-4 h-4"})}),P("span",{className:"font-semibold text-sm",children:O0(q,"MMMM yyyy")}),P("button",{onClick:()=>b(y0(q,1)),className:"p-1 hover:bg-accent rounded",children:P(n0,{className:"w-4 h-4"})})]}),P("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((g)=>P("div",{children:g},g))}),J("div",{className:"grid grid-cols-7 gap-1 text-center text-sm",children:[Array.from({length:y}).map((g,_)=>P("div",{},`empty-${_}`)),w.map((g)=>{let _=N?new Date(N):null,c=_&&K0(_)&&g0(_)===g0(g)&&h0(_)===h0(g)&&L0(_)===L0(g);return P("button",{onClick:()=>A(g),className:`w-8 h-8 rounded-full flex items-center justify-center hover:bg-accent transition-colors ${c?"bg-primary text-primary-foreground hover:bg-primary/90":"text-foreground"}`,children:g0(g)},g.toString())})]})]}),X?.includeTime&&J("div",{className:"border-l border-border bg-muted w-32 flex flex-col",children:[J("div",{className:"p-2 border-b border-border text-xs font-semibold text-muted-foreground flex items-center justify-center gap-1",children:[P(i0,{className:"w-3 h-3"})," Time"]}),J("div",{className:"flex flex-1 h-64",children:[P("div",{className:"flex-1 overflow-y-auto scrollbar-hide border-r border-border",children:W.map((g)=>P("div",{onClick:()=>T("hour",g),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${R0(Q)===g?"bg-primary/10 font-medium text-primary":""}`,children:g.toString().padStart(2,"0")},g))}),P("div",{className:"flex-1 overflow-y-auto scrollbar-hide",children:O.map((g)=>P("div",{onClick:()=>T("minute",g),className:`px-2 py-1 text-center text-sm cursor-pointer hover:bg-accent ${U0(Q)===g?"bg-primary/10 font-medium text-primary":""}`,children:g.toString().padStart(2,"0")},g))})]})]})]})]});return P("div",{onClick:v,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded border border-transparent transition-colors ${!K?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:N?S(N):P("span",{className:"text-muted-foreground italic",children:"Empty"})})},a0=x2;var l=E(I(),1);var o2=({value:N,onSave:$,readOnly:k})=>{let[K,X]=l.useState(!1),[M,z]=l.useState(N||""),Y=l.useRef(null),H=l.useRef(null),[Q,q]=l.useState(!1);l.useEffect(()=>{z(N||"")},[N]),l.useEffect(()=>{if(K&&Y.current)Y.current.focus(),q(!1)},[K]),l.useEffect(()=>{let Z=(F)=>{if(Q&&H.current&&!H.current.contains(F.target))q(!1)};if(Q)document.addEventListener("mousedown",Z);return()=>{document.removeEventListener("mousedown",Z)}},[Q]);let b=()=>{X(!1),$(M)},v=(Z)=>{Z.stopPropagation(),q(!0)},S=(Z)=>{if(Z.stopPropagation(),!k)X(!0)};if(K)return P("textarea",{ref:Y,value:M,onChange:(Z)=>z(Z.target.value),onBlur:b,className:"w-full min-h-[80px] p-2 border border-ring rounded bg-background text-sm outline-none shadow-sm resize-none"});return J("div",{ref:H,className:"relative w-full text-sm",children:[P("div",{onClick:v,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 ${!k?"cursor-pointer hover:bg-accent hover:border-border":"cursor-pointer"}`,title:"Click to expand",children:N?N:P("span",{className:"text-muted-foreground italic",children:"Empty"})}),Q&&P("div",{onClick:S,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 ${!k?"cursor-text":""}`,children:N?N:P("span",{className:"text-muted-foreground italic",children:"Empty"})})]})},d0=o2;var d=E(I(),1);var u2=({value:N,config:$,onSave:k,readOnly:K})=>{let X=$?.number,[M,z]=d.useState(!1),[Y,H]=d.useState(""),Q=d.useRef(null);d.useEffect(()=>{H(N!==void 0&&N!==null?N.toString():"")},[N]),d.useEffect(()=>{if(M&&Q.current)Q.current.focus()},[M]);let q=()=>{if(!K)z(!0)},b=()=>{if(z(!1),Y==="")k(void 0);else{let Z=parseFloat(Y);k(isNaN(Z)?void 0:Z)}},v=(Z)=>{if(Z.key==="Enter")Z.stopPropagation(),Q.current?.blur()},S=(Z)=>{if(Z===void 0||Z===null||isNaN(Z))return"";return Z.toFixed(X?.scale)};if(M)return P("input",{ref:Q,type:"number",step:1/Math.pow(10,X?.scale||0),value:Y,onChange:(Z)=>H(Z.target.value),onBlur:b,onKeyDown:v,onDoubleClick:(Z)=>Z.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 P("div",{onClick:q,onDoubleClick:(Z)=>Z.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 ${!K?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:N!==void 0&&N!==null?S(N):P("span",{className:"text-muted-foreground italic font-sans text-left block",children:"Empty"})})},t0=u2;var s0=E(I(),1);var j2=({value:N,config:$,onSave:k,readOnly:K})=>{let X=$?.rating,M=Math.max(2,Math.min(6,X?.maxValue||5)),[z,Y]=s0.useState(null),H=(q,b)=>{if(q.stopPropagation(),K)return;let v;if(N===b)v=0;else v=b;k(v)},Q=Array.from({length:M},(q,b)=>b+1);return P("div",{className:"flex items-center gap-1 h-[28px]",onMouseLeave:()=>!K&&Y(null),onDoubleClick:(q)=>q.stopPropagation(),children:Q.map((q)=>{let b=z!==null?q<=z:q<=(N||0);return P("button",{onClick:(v)=>H(v,q),onMouseEnter:()=>!K&&Y(q),className:`focus:outline-none transition-transform ${!K?"cursor-pointer hover:scale-110":"cursor-default"}`,type:"button",disabled:K,children:P(W0,{className:`w-5 h-5 transition-colors ${b?"fill-yellow-400 text-yellow-400":"fill-muted text-muted-foreground/30"}`})},q)})})},e0=j2;var p0=E(I(),1);var P0;(function(N){N.Base32IncorrectEncoding="B32_ENC_INVALID",N.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",N.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",N.EncodeTimeNegative="ENC_TIME_NEG",N.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",N.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",N.PRNGDetectFailure="PRNG_DETECT",N.ULIDInvalid="ULID_INVALID",N.Unexpected="UNEXPECTED",N.UUIDInvalid="UUID_INVALID"})(P0||(P0={}));class J0 extends Error{constructor(N,$){super(`${$} (${N})`);this.name="ULIDError",this.code=N}}function n2(N){let $=Math.floor(N()*32)%32;return"0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt($)}function i2(N){let $=r2(),k=$&&($.crypto||$.msCrypto)||null;if(typeof k?.getRandomValues==="function")return()=>{let K=new Uint8Array(1);return k.getRandomValues(K),K[0]/256};else if(typeof k?.randomBytes==="function")return()=>k.randomBytes(1).readUInt8()/256;throw new J0(P0.PRNGDetectFailure,"Failed to find a reliable PRNG")}function r2(){if(t2())return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof globalThis<"u")return globalThis;return null}function a2(N,$){let k="";for(;N>0;N--)k=n2($)+k;return k}function d2(N,$=10){if(isNaN(N))throw new J0(P0.EncodeTimeValueMalformed,`Time must be a number: ${N}`);else if(N>281474976710655)throw new J0(P0.EncodeTimeSizeExceeded,`Cannot encode a time larger than 281474976710655: ${N}`);else if(N<0)throw new J0(P0.EncodeTimeNegative,`Time must be positive: ${N}`);else if(Number.isInteger(N)===!1)throw new J0(P0.EncodeTimeValueMalformed,`Time must be an integer: ${N}`);let k,K="";for(let X=$;X>0;X--)k=N%32,K="0123456789ABCDEFGHJKMNPQRSTVWXYZ".charAt(k)+K,N=(N-k)/32;return K}function t2(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function N2(N,$){let k=$||i2(),K=!N||isNaN(N)?Date.now():N;return d2(K,10)+a2(16,k)}function s2(N,$,k){let K=N.slice();return K.splice(k,0,K.splice($,1)[0]),K}function P2(N,$,k,K){if(k===K)return N;let X=s2($,k,K),M=new Set($.map((Y)=>Y.id)),z=0;return N.map((Y)=>M.has(Y.id)?X[z++]:Y)}async function l5(N){let $=[],k=[],K=N.items;if(K)for(let z=0;z<K.length;z++){let Y=K[z];if(Y.kind==="file"){let H=Y.webkitGetAsEntry?.();if(H)k.push({entry:H,path:""})}}else return Array.from(N.files);let X=(z)=>{return new Promise((Y)=>{z.readEntries((H)=>Y(H),()=>Y([]))})},M=(z)=>{return new Promise((Y,H)=>{z.file((Q)=>Y(Q),(Q)=>H(Q))})};while(k.length>0){let z=k.shift();if(!z)continue;let{entry:Y,path:H}=z;if(Y.isFile)try{let Q=await M(Y),q=H?`${H}/${Q.name}`:Q.name;Object.defineProperty(Q,"webkitRelativePath",{value:q,writable:!1,configurable:!0}),$.push(Q)}catch(Q){console.error("Error reading file entry:",Q)}else if(Y.isDirectory){let Q=Y.createReader(),q=[],b=await X(Q);while(b.length>0)q=q.concat(b),b=await X(Q);let v=H?`${H}/${Y.name}`:Y.name;for(let S of q)k.push({entry:S,path:v})}}return $}var p=E(I(),1);var _2=E(I(),1);function z2(){let[N,$]=_2.useState(!1);return J(k2,{open:N,onOpenChange:$,children:[P(K2,{asChild:!0,children:J(x,{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:G.autofill_source_help_title(),children:[P(f0,{className:"h-3.5 w-3.5"}),P("span",{className:"sr-only",children:G.autofill_source_help_title()})]})}),J(J2,{className:"sm:max-w-[500px]",children:[J(Z2,{children:[J(X2,{className:"flex items-center gap-2",children:[P(f0,{className:"h-5 w-5 text-muted-foreground"}),G.autofill_source_help_title()]}),P(Y2,{children:G.autofill_source_help_desc()})]}),J("div",{className:"space-y-4 py-2",children:[J("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[J("div",{className:"flex items-center gap-2 font-medium text-sm",children:[P($2,{className:"h-4 w-4 text-muted-foreground shrink-0"}),P("span",{children:G.autofill_source_none()})]}),P("p",{className:"text-xs text-muted-foreground leading-relaxed",children:G.autofill_source_none_desc()}),P("p",{className:"text-xs italic text-muted-foreground/80",children:G.autofill_source_none_example()})]}),J("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[J("div",{className:"flex items-center gap-2 font-medium text-sm",children:[P(v0,{className:"h-4 w-4 text-amber-500 shrink-0"}),P("span",{children:G.autofill_source_content()})]}),P("p",{className:"text-xs text-muted-foreground leading-relaxed",children:G.autofill_source_content_desc()}),P("p",{className:"text-xs italic text-muted-foreground/80",children:G.autofill_source_content_example()})]}),J("div",{className:"rounded-lg border p-3.5 space-y-1.5 bg-muted/30",children:[J("div",{className:"flex items-center gap-2 font-medium text-sm",children:[P(c0,{className:"h-4 w-4 text-blue-500 shrink-0"}),P("span",{children:G.autofill_source_creation_context()})]}),P("p",{className:"text-xs text-muted-foreground leading-relaxed",children:G.autofill_source_creation_context_desc()}),P("p",{className:"text-xs italic text-muted-foreground/80",children:G.autofill_source_creation_context_example()})]})]})]})]})}var V0=["red","orange","yellow","green","blue","purple","gray"],I0={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 z0(N){if(!N)return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:"#6b7280"};let $=N.toLowerCase(),k=I0[$];if(k)return{backgroundColor:k.bg,color:k.text};if(N.startsWith("#"))return{backgroundColor:`${N}33`,color:N};return{backgroundColor:"rgba(128, 128, 128, 0.1)",color:N}}function M0(N=[]){let $=new Set(N.map((K)=>K.color?.toLowerCase()).filter(Boolean)),k=V0.filter((K)=>!$.has(K.toLowerCase()));if(k.length>0)return k[Math.floor(Math.random()*k.length)];return V0[Math.floor(Math.random()*V0.length)]}var e2={[h.text]:W2,[h.longText]:Q2,[h.select]:G2,[h.selectMulti]:A2,[h.rating]:W0,[h.number]:B2,[h.toggle]:g2,[h.date]:q2,[h.user]:v2,[h.userMulti]:c2};function N5({field:N,index:$,onVisibilityChange:k}){let{ref:K,handleRef:X}=y2({id:N.id,index:$}),M=N.config?.type?e2[N.config.type]:null;return J("div",{ref:K,className:"flex items-center justify-between p-2 rounded-md hover:bg-muted",children:[J("div",{className:"flex items-center gap-2",children:[P("div",{ref:X,className:"cursor-grab",children:P(b2,{className:"h-4 w-4 text-muted-foreground"})}),M&&P(M,{className:"h-4 w-4 text-muted-foreground shrink-0"}),N.config?.autofillSource===t.CONTENT&&P(v0,{className:"h-4 w-4 text-muted-foreground shrink-0"}),N.config?.autofillSource===t.CREATION_CONTEXT&&P(c0,{className:"h-4 w-4 text-muted-foreground shrink-0"}),P("span",{className:"text-sm truncate",children:N.config?.name})]}),P(S0,{checked:N.visible,onCheckedChange:(z)=>k(N.id,z)})]})}function b1({projectId:N,onManageFields:$,onSave:k}){let{fields:K,updateFields:X}=i(),[M,z]=p.useState(""),[Y,H]=p.useState("list"),[Q,q]=p.useState(""),[b,v]=p.useState(""),[S,Z]=p.useState(t.NONE),[F,w]=p.useState(""),[y,A]=p.useState([]),T=H2();p.useEffect(()=>{T.invalidateQueries({queryKey:["fields",N]})},[N,T]);let W=$0.api.projects[":projectId"].fields.order.$patch,{mutate:O}=E0({mutationFn:async(B)=>{if(!(await W(B)).ok)throw Error(G.failed_update_fields_order());return null}}),g=$0.api.projects[":projectId"].fields.$post,{mutate:_}=E0({mutationFn:async(B)=>{let m=await g(B);if(!m.ok)throw Error(G.failed_create_field());return await m.json()},onSuccess:(B)=>{let m={...B,visible:!0},U=[...K,m];X(U),q(""),A([]),O({param:{projectId:N},json:U.map((V)=>({fieldId:V.id,visible:V.visible||!1}))}),k?.()}}),c=p.useMemo(()=>K.filter((B)=>B.config?.name?.toLowerCase().includes(M.toLowerCase())),[K,M]),C=(B)=>{if(B.canceled)return;let{source:m}=B.operation;if(!U2(m))return;let{initialIndex:U,index:V}=m;if(U===V)return;let D=P2(K,c,U,V);X(D),O({param:{projectId:N},json:D.map((N0)=>({fieldId:N0.id,visible:N0.visible||!1}))})},L=(B,m)=>{let U=K.map((V)=>V.id===B?{...V,visible:m}:V);X(U),O({param:{projectId:N},json:U.map((V)=>({fieldId:V.id,visible:V.visible||!1}))})},R=()=>{if(!Q||!b)return;let B=b===h.select?{select:{options:y}}:b===h.selectMulti?{selectMulti:{options:y}}:{};_({param:{projectId:N},json:{config:{name:Q,type:b,autofillSource:S,...B},label:Q,description:F}})},f=K.filter((B)=>B.visible).length;if(Y==="create")return P("div",{className:"w-80 p-4",children:J("div",{className:"space-y-4",children:[J("div",{className:"space-y-2",children:[P(Z0,{htmlFor:"field-name",children:G.field_name()}),P(G0,{id:"field-name",placeholder:G.new_field_placeholder(),value:Q,onChange:(B)=>q(B.target.value),autoFocus:!0})]}),J("div",{className:"space-y-2",children:[P(Z0,{children:G.field_type()}),J(F2,{children:[P(V2,{asChild:!0,children:J(x,{variant:"outline",className:"w-full justify-between font-normal",children:[b?P("span",{className:"capitalize",children:b.replace(/_/g," ")}):P("span",{className:"text-muted-foreground border-dashed",children:G.select_field_type()}),P(X0,{className:"ml-2 h-4 w-4 opacity-50"})]})}),P(S2,{className:"w-[--radix-dropdown-menu-trigger-width]",children:Object.values(h).map((B)=>P(m2,{onClick:()=>{v(B),A([])},className:"capitalize",children:B.replace(/_/g," ")},B))})]})]}),J("div",{className:"space-y-2",children:[P(Z0,{htmlFor:"field-desc",children:G.description()}),P(G0,{id:"field-desc",placeholder:G.description_optional_placeholder(),value:F,onChange:(B)=>w(B.target.value)})]}),J("div",{className:"space-y-2",children:[J("div",{className:"flex items-center gap-1",children:[P(Z0,{children:G.autofill_source()}),P(z2,{})]}),J(O2,{type:"single",value:S,onValueChange:(B)=>{if(B)Z(B)},className:"w-full grid grid-cols-3 border rounded-md p-1 gap-1",children:[P(F0,{value:t.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:G.autofill_source_none()}),P(F0,{value:t.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:G.autofill_source_content()}),P(F0,{value:t.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:G.autofill_source_creation_context()})]})]}),(b===h.select||b===h.selectMulti)&&J("div",{className:"space-y-2",children:[J("div",{className:"flex items-center justify-between",children:[P(Z0,{className:"text-sm font-medium",children:G.options()}),J(x,{variant:"ghost",size:"sm",className:"h-8 px-2",onClick:()=>{let B={id:N2(),displayName:G.new_option(),color:M0(y)};A([...y,B])},children:[P(k0,{className:"h-4 w-4 mr-1"})," ",G.add_option()]})]}),P("div",{className:"space-y-2 max-h-40 overflow-y-auto pr-1",children:y.map((B,m)=>J("div",{className:"flex items-center gap-2",children:[P(G0,{value:B.displayName,onChange:(U)=>{let V=[...y];V[m]={...B,displayName:U.target.value},A(V)},placeholder:G.option_name_placeholder(),className:"h-8 flex-1"}),J(o,{children:[P(u,{asChild:!0,children:P("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:I0[B.color||""]?.hex||B.color||"#808080"}})}),P(j,{className:"p-2 w-auto",align:"end",children:P("div",{className:"flex gap-1",children:V0.map((U)=>P("button",{type:"button",className:"w-5 h-5 rounded-full border cursor-pointer hover:scale-110 transition-transform",style:{backgroundColor:I0[U]?.hex||U},onClick:()=>{let V=[...y];V[m]={...B,color:U},A(V)}},U))})})]}),P(x,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>{A(y.filter((U,V)=>V!==m))},children:P(_0,{className:"h-4 w-4"})})]},B.id))})]}),J("div",{className:"flex gap-2 pt-2",children:[P(x,{variant:"secondary",className:"flex-1",onClick:()=>{H("list"),q(""),v(""),Z(t.NONE),w(""),A([])},children:G.cancel()}),P(x,{className:"flex-1",onClick:R,disabled:!Q||!b,children:G.save()})]})]})});return J("div",{className:"w-80 p-4",children:[P("div",{className:"flex items-center justify-between mb-4",children:J("h3",{className:"font-semibold",children:[G.fields()," ",P("span",{className:"text-muted-foreground text-sm font-normal",children:G.visible_count({count:f})})]})}),J("div",{className:"relative mb-4",children:[P(Y0,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),P(G0,{placeholder:G.search_fields_placeholder(),value:M,onChange:(B)=>z(B.target.value),className:"pl-8"})]}),P("div",{className:"max-h-60 overflow-y-auto pr-2",children:P(R2,{sensors:[C2.configure({activationConstraints:[new T2.Distance({value:8})]}),w2],onDragEnd:C,children:c.map((B,m)=>P(N5,{field:B,index:m,onVisibilityChange:L},B.id))})}),$&&J("div",{className:"mt-4 space-y-2",children:[J(x,{variant:"secondary",className:"w-full",onClick:$,children:[P(M2,{className:"h-4 w-4 mr-2"}),G.manage_fields()]}),J(x,{className:"w-full",onClick:()=>H("create"),children:[P(k0,{className:"h-4 w-4 mr-2"}),G.new_field()]})]})]})}var P5=({value:N,config:$,onSave:k,readOnly:K,fieldId:X})=>{let M=$?.select,z=M?.options||[],[Y,H]=p0.useState(!1),[Q,q]=p0.useState(""),b=z.find((W)=>W.id===N),v=Q.trim(),S=z.filter((W)=>W.displayName.toLowerCase().includes(v.toLowerCase())),Z=z.some((W)=>W.displayName.trim().toLowerCase()===v.toLowerCase()||W.id.toLowerCase()===v.toLowerCase()),F=()=>{if(!K)H(!0)},w=(W)=>{k(W),H(!1),q("")},y=(W)=>{if(K)return;if(H(W),!W)q("")},A=async()=>{if(!v)return;let W={id:v.toLowerCase().replace(/\s+/g,"-"),displayName:v,color:M0(z)},O=[...z,W],g={...$,select:{...M,options:O}};if(X)try{let _=await $0.api.fields[":fieldId"].$put({param:{fieldId:X},json:{config:g}});if(!_.ok){H0.error(G.failed_update_field());return}let c=await _.json(),L=i.getState().fields.map((R)=>R.id===c.id?{...R,...c,visible:R.visible}:R);i.getState().updateFields(L)}catch{H0.error(G.failed_update_field());return}k(W.id),q(""),H(!1)};return P("div",{className:"relative w-full",onClick:(W)=>W.stopPropagation(),children:J(o,{open:!K&&Y,onOpenChange:y,children:[P(u,{asChild:!0,children:J("div",{onClick:F,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!K?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((W)=>{if(!W)return P("span",{className:"text-muted-foreground italic text-sm",children:"Select an option"});return P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium h-[22px]",style:z0(W.color),children:W.displayName})})(b),!K&&P(X0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),J(j,{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:[J("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(W)=>W.stopPropagation(),children:[P(Y0,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),P("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:G.search_options_placeholder(),value:Q,onChange:(W)=>q(W.target.value),autoFocus:!0})]}),J("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[Q===""&&J("div",{onClick:()=>w(""),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:[P(_0,{className:"w-3.5 h-3.5"})," Clear"]}),S.map((W)=>P("div",{onClick:()=>w(W.id),className:`px-2.5 py-1.5 text-xs hover:bg-accent rounded cursor-pointer flex items-center justify-between ${N===W.id?"bg-accent/50 font-medium":""}`,children:P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:z0(W.color),children:W.displayName})},W.id)),S.length===0&&!v&&P("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:G.no_options_found()}),v!==""&&!Z&&J("div",{onClick:A,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:[P(k0,{className:"w-3.5 h-3.5 shrink-0"}),P("span",{className:"truncate",children:G.add_option_with_name({name:v})})]})]})]})]})})},h2=P5;var s=E(I(),1);var $5=({value:N=[],config:$,onSave:k,readOnly:K,fieldId:X})=>{let M=$?.selectMulti,z=M?.options||[],Y=s.useRef(null),[H,Q]=s.useState(!1),[q,b]=s.useState(N.length),[v,S]=s.useState(""),Z=z.filter((_)=>(N||[]).includes(_.id))||[],F=v.trim(),w=z.filter((_)=>_.displayName.toLowerCase().includes(F.toLowerCase())),y=z.some((_)=>_.displayName.trim().toLowerCase()===F.toLowerCase()||_.id.toLowerCase()===F.toLowerCase());s.useLayoutEffect(()=>{if(H){b(Z.length);return}if(Y.current){let _=Y.current.clientWidth-8,C=document.createElement("canvas").getContext("2d");if(C&&_>0){C.font="500 12px ui-sans-serif, system-ui, sans-serif";let L=4,R=Z.map((D)=>Math.ceil(C.measureText(D.displayName).width)+18);if(R.reduce((D,N0)=>D+N0,0)+Math.max(0,R.length-1)*L<=_){b(Z.length);return}let m=_-32-L,U=0,V=0;for(let D=0;D<R.length;D++){let N0=V>0?U+L+R[D]:R[D];if(N0>m)break;U=N0,V++}b(V)}}},[Z,H,N]);let A=(_)=>{let c=N||[],C;if(c.includes(_))C=c.filter((L)=>L!==_);else C=[...c,_];k(C)},T=async()=>{if(!F)return;let _={id:F.toLowerCase().replace(/\s+/g,"-"),displayName:F,color:M0(z)},c=[...z,_],C={...$,selectMulti:{...M,options:c}};if(X)try{let L=await $0.api.fields[":fieldId"].$put({param:{fieldId:X},json:{config:C}});if(!L.ok){H0.error(G.failed_update_field());return}let R=await L.json(),B=i.getState().fields.map((m)=>m.id===R.id?{...m,...R,visible:m.visible}:m);i.getState().updateFields(B)}catch{H0.error(G.failed_update_field());return}k([...N||[],_.id]),S("")},W=(_)=>{if(_.stopPropagation(),!K)Q(!0)},O=Z.length-q;return P("div",{className:"relative w-full",onClick:(_)=>_.stopPropagation(),children:J(o,{open:!K&&H,onOpenChange:(_)=>{if(K)return;if(Q(_),!_)S("")},children:[P(u,{asChild:!0,children:J("div",{ref:Y,onClick:W,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!K||O>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[Z.length===0&&P("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),Z.slice(0,q).map((_)=>P("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:z0(_.color),children:_.displayName},_.id)),O>0&&J("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:["+",O]})]})}),J(j,{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:[J("div",{className:"relative pb-1.5 border-b border-border mb-1",onClick:(_)=>_.stopPropagation(),children:[P(Y0,{className:"w-3.5 h-3.5 absolute left-2 top-2 text-muted-foreground"}),P("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:G.search_options_placeholder(),value:v,onChange:(_)=>S(_.target.value),autoFocus:!0})]}),J("div",{className:"overflow-y-auto max-h-48 min-h-[120px] space-y-0.5",children:[w.map((_)=>{let c=(N||[]).includes(_.id);return J("div",{onClick:()=>A(_.id),className:`px-2.5 py-1.5 hover:bg-accent rounded cursor-pointer flex items-center justify-between text-xs ${c?"bg-accent/30 font-medium":""}`,children:[P("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",style:z0(_.color),children:_.displayName}),c&&P(m0,{className:"w-3.5 h-3.5 text-primary"})]},_.id)}),w.length===0&&!F&&P("div",{className:"px-2.5 py-2 text-xs text-muted-foreground italic text-center",children:G.no_options_found()}),F!==""&&!y&&J("div",{onClick:T,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:[P(k0,{className:"w-3.5 h-3.5 shrink-0"}),P("span",{className:"truncate",children:G.add_option_with_name({name:F})})]})]})]})]})})},L2=$5;var e=E(I(),1);var k5=({value:N,onSave:$,readOnly:k})=>{let[K,X]=e.useState(!1),[M,z]=e.useState(N||""),Y=e.useRef(null);e.useEffect(()=>{z(N||"")},[N]),e.useEffect(()=>{if(K&&Y.current)Y.current.focus()},[K]);let H=()=>{if(!k)X(!0)},Q=()=>{X(!1),$(M)},q=(b)=>{if(b.key==="Enter")Y.current?.blur()};if(K)return P("input",{ref:Y,type:"text",value:M,onChange:(b)=>z(b.target.value),onBlur:Q,onKeyDown:q,className:"w-full px-2 py-1 border border-ring rounded bg-background text-sm outline-none shadow-sm"});return P("div",{onClick:H,className:`w-full min-h-[28px] px-2 py-1 text-sm text-foreground rounded truncate border border-transparent transition-colors ${!k?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:N||P("span",{className:"text-muted-foreground italic",children:"Empty"})})},f2=k5;var K5=({value:N,onSave:$,readOnly:k})=>{return P("div",{className:"flex items-center h-[28px] w-full",onClick:(X)=>X.stopPropagation(),children:P(S0,{checked:N,onCheckedChange:(X)=>{if(!k)$(X)},disabled:k,className:"cursor-pointer"})})},E2=K5;var C0=E(I(),1);var J5=({value:N,onSave:$,readOnly:k})=>{let K=w0(),{members:X,fetchMembers:M}=T0(),[z,Y]=C0.useState(!1);C0.useEffect(()=>{if(K)M(K)},[K,M]);let H=X.find((Z)=>Z.id===N),Q=()=>{if(!k)Y(!0)},q=(Z)=>{$(Z),Y(!1)},b=(Z)=>{if(k)return;Y(Z)},v=(Z)=>{return Z.split(" ").map((F)=>F[0]).slice(0,2).join("").toUpperCase()};return P("div",{className:"relative w-full",onClick:(Z)=>Z.stopPropagation(),children:J(o,{open:!k&&z,onOpenChange:b,children:[P(u,{asChild:!0,children:J("div",{onClick:Q,className:`flex items-center justify-between w-full h-[28px] px-2 rounded border border-transparent transition-colors ${!k?"cursor-pointer hover:bg-accent hover:border-border group":""}`,children:[((Z)=>{if(!Z)return P("span",{className:"text-muted-foreground italic text-sm",children:"Select user"});return J("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:[J(Q0,{className:"w-4 h-4",children:[P(q0,{src:Z.image,alt:Z.name,className:"object-cover"}),P(b0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:v(Z.name)})]}),P("span",{className:"truncate max-w-[120px]",children:Z.name})]})})(H),!k&&P(X0,{className:"w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100"})]})}),J(j,{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:[J("div",{onClick:()=>q(""),className:"px-3 py-2 text-sm text-muted-foreground hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[P(_0,{className:"w-3 h-3"})," Clear"]}),X.map((Z)=>J("div",{onClick:()=>q(Z.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center gap-2 rounded-sm",children:[J(Q0,{className:"w-5 h-5",children:[P(q0,{src:Z.image,alt:Z.name,className:"object-cover"}),P(b0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:v(Z.name)})]}),P("span",{className:"text-sm font-medium text-foreground",children:Z.name})]},Z.id))]})]})})},I2=J5;var n=E(I(),1);var Z5=({value:N=[],onSave:$,readOnly:k})=>{let K=w0(),{members:X,fetchMembers:M}=T0(),z=n.useRef(null),[Y,H]=n.useState(!1),[Q,q]=n.useState(N.length);n.useEffect(()=>{if(K)M(K)},[K,M]);let b=X.filter((A)=>(N||[]).includes(A.id)),v=(A)=>{return A.split(" ").map((T)=>T[0]).slice(0,2).join("").toUpperCase()};n.useLayoutEffect(()=>{if(Y){q(b.length);return}if(z.current){let A=z.current.clientWidth-8,W=document.createElement("canvas").getContext("2d");if(W&&A>0){W.font="500 12px ui-sans-serif, system-ui, sans-serif";let O=4,g=b.map((f)=>{return Math.min(100,Math.ceil(W.measureText(f.name).width))+40});if(g.reduce((f,B)=>f+B,0)+Math.max(0,g.length-1)*O<=A){q(b.length);return}let C=A-32-O,L=0,R=0;for(let f=0;f<g.length;f++){let B=R>0?L+O+g[f]:g[f];if(B>C)break;L=B,R++}q(R)}}},[b,Y,N]);let S=(A)=>{let T=N||[],W;if(T.includes(A))W=T.filter((O)=>O!==A);else W=[...T,A];$(W)},Z=(A)=>{if(A.stopPropagation(),!k)H(!0)},F=b.length-Q,w=(A)=>{if(k)return;H(A)},y=(A)=>{return J("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:[J(Q0,{className:"w-4 h-4",children:[P(q0,{src:A.image,alt:A.name,className:"object-cover"}),P(b0,{className:"text-[8px] bg-rose-400 text-black font-semibold",children:v(A.name)})]}),P("span",{className:"truncate max-w-[100px]",children:A.name})]},A.id)};return P("div",{className:"relative w-full",onClick:(A)=>A.stopPropagation(),children:J(o,{open:!k&&Y,onOpenChange:w,children:[P(u,{asChild:!0,children:J("div",{ref:z,onClick:Z,className:`w-full px-1 py-1 flex flex-wrap gap-1 rounded border border-transparent transition-all box-border h-[32px] overflow-hidden ${!k||F>0?"cursor-pointer hover:bg-accent hover:border-border":""}`,children:[b.length===0&&P("span",{className:"text-muted-foreground text-sm italic px-1 pt-0.5",children:"Empty"}),b.slice(0,Q).map(y),F>0&&J("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:["+",F]})]})}),P(j,{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:X.map((A)=>{let T=(N||[]).includes(A.id);return J("div",{onClick:()=>S(A.id),className:"px-3 py-2 hover:bg-accent cursor-pointer flex items-center justify-between rounded-sm",children:[J("div",{className:"flex items-center gap-2",children:[J(Q0,{className:"w-5 h-5",children:[P(q0,{src:A.image,alt:A.name,className:"object-cover"}),P(b0,{className:"text-[10px] bg-rose-400 text-black font-semibold",children:v(A.name)})]}),P("span",{className:"text-sm font-medium text-foreground",children:A.name})]}),T&&P(m0,{className:"w-4 h-4 text-primary"})]},A.id)})})]})})},p2=Z5;var X5=(N)=>{if(!N.config)return P("div",{children:"Unknown Field Type"});switch(N.config.type){case"text":return P(f2,{...N,value:N.value,onSave:N.onSave});case"longText":return P(d0,{...N,value:N.value,onSave:N.onSave});case"select":return P(h2,{...N,value:N.value,onSave:N.onSave});case"selectMulti":return P(L2,{...N,value:N.value,onSave:N.onSave});case"rating":return P(e0,{...N,value:N.value,onSave:N.onSave});case"number":return P(t0,{...N,value:N.value,onSave:N.onSave});case"toggle":return P(E2,{...N,value:N.value,onSave:N.onSave});case"date":return P(a0,{...N,value:N.value,onSave:N.onSave});case"user":return P(I2,{...N,value:N.value,onSave:N.onSave});case"userMulti":return P(p2,{...N,value:N.value,onSave:N.onSave});default:return P("div",{children:"Unknown Field Type"})}},GN=X5;var gN=({progress:N,className:$})=>{let K=2*Math.PI*20,X=K-Math.min(100,Math.max(0,N))/100*K;return J("svg",{viewBox:"0 0 50 50",className:B0("w-12 h-12",$),children:[P("circle",{cx:"25",cy:"25",r:20,className:"stroke-muted",strokeWidth:"4",fill:"transparent"}),P("circle",{cx:"25",cy:"25",r:20,className:"stroke-primary transition-all duration-300 ease-out",strokeWidth:"4",fill:"transparent",strokeDasharray:K,strokeDashoffset:X,transform:"rotate(-90 25 25)"}),P("text",{x:"50%",y:"50%",textAnchor:"middle",dy:".3em",className:"fill-foreground text-[10px] font-bold",children:`${Math.round(N)}%`})]})};var Y5=(N)=>{if(isNaN(N))return"00:00";let $=new Date(N*1000),k=$.getUTCHours(),K=$.getUTCMinutes().toString().padStart(2,"0"),X=$.getUTCSeconds().toString().padStart(2,"0");if(k)return`${k}:${K}:${X}`;return`${K}:${X}`},cN=(N,$,k,K)=>{if(k==="frames")return`${N} fr`;if(k==="standard")return Y5(N/$);let X=Math.round($),M=$!==X,z=!1;if(M&&(X===30||X===60))z=!0;let Y=0;if(K){let Z=K.match(/^([012]\d):(\d\d):(\d\d)(:|;|\.)(\d+)$/);if(Z){let F=parseInt(Z[1],10),w=parseInt(Z[2],10),y=parseInt(Z[3],10),A=parseInt(Z[5],10);if(z=Z[4]!==":",Y=(F*3600+w*60+y)*X+A,z){let T=F*60+w,W=$<30?2:4;Y-=W*(T-Math.floor(T/10))}}}let H=N+Y;if(z){let Z=$<30?2:4,F=Math.floor(H/(17982*Z/2)),w=H%(17982*Z/2);if(w<Z)w=w+Z;H+=9*Z*F+Z*Math.floor((w-Z)/(1798*Z/2))}let Q=H%X,q=Math.floor(H/X)%60,b=Math.floor(H/(X*60))%60,v=Math.floor(H/(X*3600))%24,S=z?";":":";return`${v.toString().padStart(2,"0")}:${b.toString().padStart(2,"0")}:${q.toString().padStart(2,"0")}${S}${Q.toString().padStart(2,"0")}`};var FN=(N,$)=>{if(!$)return 0;let k=1/$;return N*k+k/2},_5=(N)=>Math.max(100,3000/(N||30)),VN=({dbTotalFrames:N,containerDuration:$,frameRate:k})=>{let K=k||30,X=Math.round($*K);if(N<=0)return X;let M=N/K,z=$-M,Y=_5(K)/1000;return z>Y?X:N};var D2=E(I(),1);function TN({className:N,defaultValue:$,value:k,min:K=0,max:X=100,...M}){let z=D2.useMemo(()=>Array.isArray(k)?k:Array.isArray($)?$:[K,X],[k,$,K,X]);return J(A0.Root,{"data-slot":"slider",defaultValue:$,value:k,min:K,max:X,className:B0("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",N),...M,children:[P(A0.Track,{"data-slot":"slider-track",className:B0("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:P(A0.Range,{"data-slot":"slider-range",className:B0("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:z.length},(Y,H)=>P(A0.Thumb,{"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"},H))]})}
2
- export{P2 as F,l5 as G,i as H,N2 as I,gN as J,z5 as K,e0 as L,z2 as M,V0 as N,I0 as O,z0 as P,M0 as Q,e2 as R,b1 as S,GN as T,Y5 as U,cN as V,FN as W,_5 as X,VN as Y,TN as Z};