@satoshibits/react-json-schema-builder 1.1.0 → 1.1.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 (211) hide show
  1. package/dist/components/ui/button.d.ts.map +1 -1
  2. package/dist/index.cjs10.js +1 -1
  3. package/dist/index.cjs11.js +1 -1
  4. package/dist/index.cjs11.js.map +1 -1
  5. package/dist/index.cjs2.js +1 -1
  6. package/dist/index.cjs2.js.map +1 -1
  7. package/dist/index.cjs23.js +1 -1
  8. package/dist/index.cjs24.js +1 -1
  9. package/dist/index.cjs25.js +1 -1
  10. package/dist/index.cjs26.js +1 -1
  11. package/dist/index.cjs27.js +1 -1
  12. package/dist/index.cjs3.js +1 -1
  13. package/dist/index.cjs3.js.map +1 -1
  14. package/dist/index.cjs30.js +1 -1
  15. package/dist/index.cjs31.js +1 -1
  16. package/dist/index.cjs34.js +1 -1
  17. package/dist/index.cjs36.js +1 -1
  18. package/dist/index.cjs37.js +1 -1
  19. package/dist/index.cjs38.js +1 -1
  20. package/dist/index.cjs39.js +1 -1
  21. package/dist/index.cjs40.js +1 -1
  22. package/dist/index.cjs41.js +1 -1
  23. package/dist/index.cjs43.js +1 -1
  24. package/dist/index.cjs47.js +1 -1
  25. package/dist/index.cjs49.js +6 -1
  26. package/dist/index.cjs49.js.map +1 -1
  27. package/dist/index.cjs50.js +6 -1
  28. package/dist/index.cjs50.js.map +1 -1
  29. package/dist/index.cjs51.js +2 -2
  30. package/dist/index.cjs51.js.map +1 -1
  31. package/dist/index.cjs52.js +2 -2
  32. package/dist/index.cjs52.js.map +1 -1
  33. package/dist/index.cjs53.js +1 -6
  34. package/dist/index.cjs53.js.map +1 -1
  35. package/dist/index.cjs54.js +1 -6
  36. package/dist/index.cjs54.js.map +1 -1
  37. package/dist/index.cjs55.js +1 -5
  38. package/dist/index.cjs55.js.map +1 -1
  39. package/dist/index.cjs56.js +1 -1
  40. package/dist/index.cjs56.js.map +1 -1
  41. package/dist/index.cjs57.js +1 -1
  42. package/dist/index.cjs57.js.map +1 -1
  43. package/dist/index.cjs58.js +1 -1
  44. package/dist/index.cjs58.js.map +1 -1
  45. package/dist/index.cjs59.js +1 -1
  46. package/dist/index.cjs59.js.map +1 -1
  47. package/dist/index.cjs60.js +1 -1
  48. package/dist/index.cjs60.js.map +1 -1
  49. package/dist/index.cjs61.js +1 -1
  50. package/dist/index.cjs61.js.map +1 -1
  51. package/dist/index.cjs62.js +1 -1
  52. package/dist/index.cjs62.js.map +1 -1
  53. package/dist/index.cjs63.js +1 -1
  54. package/dist/index.cjs63.js.map +1 -1
  55. package/dist/index.cjs64.js +1 -1
  56. package/dist/index.cjs64.js.map +1 -1
  57. package/dist/index.cjs65.js +1 -1
  58. package/dist/index.cjs65.js.map +1 -1
  59. package/dist/index.cjs66.js +1 -1
  60. package/dist/index.cjs66.js.map +1 -1
  61. package/dist/index.cjs67.js +1 -1
  62. package/dist/index.cjs67.js.map +1 -1
  63. package/dist/index.cjs68.js +1 -1
  64. package/dist/index.cjs68.js.map +1 -1
  65. package/dist/index.cjs69.js +1 -1
  66. package/dist/index.cjs69.js.map +1 -1
  67. package/dist/index.cjs70.js +1 -1
  68. package/dist/index.cjs70.js.map +1 -1
  69. package/dist/index.cjs71.js +1 -1
  70. package/dist/index.cjs71.js.map +1 -1
  71. package/dist/index.cjs72.js +1 -1
  72. package/dist/index.cjs72.js.map +1 -1
  73. package/dist/index.cjs73.js +1 -1
  74. package/dist/index.cjs73.js.map +1 -1
  75. package/dist/index.cjs74.js +1 -1
  76. package/dist/index.cjs74.js.map +1 -1
  77. package/dist/index.cjs75.js +1 -1
  78. package/dist/index.cjs75.js.map +1 -1
  79. package/dist/index.cjs76.js +5 -1
  80. package/dist/index.cjs76.js.map +1 -1
  81. package/dist/index.cjs77.js +1 -1
  82. package/dist/index.cjs77.js.map +1 -1
  83. package/dist/index.cjs78.js +1 -1
  84. package/dist/index.cjs78.js.map +1 -1
  85. package/dist/index.cjs79.js +1 -1
  86. package/dist/index.cjs79.js.map +1 -1
  87. package/dist/index.cjs80.js +1 -1
  88. package/dist/index.cjs80.js.map +1 -1
  89. package/dist/index.cjs81.js +1 -1
  90. package/dist/index.cjs81.js.map +1 -1
  91. package/dist/index.cjs82.js +1 -1
  92. package/dist/index.cjs82.js.map +1 -1
  93. package/dist/index.cjs87.js +1 -1
  94. package/dist/index.cjs89.js +1 -1
  95. package/dist/index.cjs94.js +38 -1
  96. package/dist/index.cjs94.js.map +1 -1
  97. package/dist/index.cjs95.js +1 -38
  98. package/dist/index.cjs95.js.map +1 -1
  99. package/dist/index.cjs96.js +1 -1
  100. package/dist/index.cjs96.js.map +1 -1
  101. package/dist/index.cjs97.js +1 -1
  102. package/dist/index.cjs97.js.map +1 -1
  103. package/dist/index.cjs98.js +1 -1
  104. package/dist/index.cjs98.js.map +1 -1
  105. package/dist/index.es10.js +1 -1
  106. package/dist/index.es11.js +4 -3
  107. package/dist/index.es11.js.map +1 -1
  108. package/dist/index.es2.js +73 -71
  109. package/dist/index.es2.js.map +1 -1
  110. package/dist/index.es23.js +1 -1
  111. package/dist/index.es24.js +1 -1
  112. package/dist/index.es25.js +1 -1
  113. package/dist/index.es26.js +1 -1
  114. package/dist/index.es27.js +1 -1
  115. package/dist/index.es3.js +131 -134
  116. package/dist/index.es3.js.map +1 -1
  117. package/dist/index.es30.js +1 -1
  118. package/dist/index.es31.js +1 -1
  119. package/dist/index.es34.js +1 -1
  120. package/dist/index.es36.js +7 -7
  121. package/dist/index.es37.js +20 -20
  122. package/dist/index.es38.js +1 -1
  123. package/dist/index.es39.js +1 -1
  124. package/dist/index.es40.js +1 -1
  125. package/dist/index.es41.js +1 -1
  126. package/dist/index.es43.js +1 -1
  127. package/dist/index.es47.js +4 -4
  128. package/dist/index.es49.js +21 -8
  129. package/dist/index.es49.js.map +1 -1
  130. package/dist/index.es50.js +9 -5
  131. package/dist/index.es50.js.map +1 -1
  132. package/dist/index.es51.js +32 -15
  133. package/dist/index.es51.js.map +1 -1
  134. package/dist/index.es52.js +12 -3
  135. package/dist/index.es52.js.map +1 -1
  136. package/dist/index.es53.js +8 -38
  137. package/dist/index.es53.js.map +1 -1
  138. package/dist/index.es54.js +5 -18
  139. package/dist/index.es54.js.map +1 -1
  140. package/dist/index.es55.js +30 -252
  141. package/dist/index.es55.js.map +1 -1
  142. package/dist/index.es56.js +6 -21
  143. package/dist/index.es56.js.map +1 -1
  144. package/dist/index.es57.js +25 -5
  145. package/dist/index.es57.js.map +1 -1
  146. package/dist/index.es58.js +62 -23
  147. package/dist/index.es58.js.map +1 -1
  148. package/dist/index.es59.js +27 -63
  149. package/dist/index.es59.js.map +1 -1
  150. package/dist/index.es60.js +5 -29
  151. package/dist/index.es60.js.map +1 -1
  152. package/dist/index.es61.js +24 -5
  153. package/dist/index.es61.js.map +1 -1
  154. package/dist/index.es62.js +3 -24
  155. package/dist/index.es62.js.map +1 -1
  156. package/dist/index.es63.js +45 -32
  157. package/dist/index.es63.js.map +1 -1
  158. package/dist/index.es64.js +7 -3
  159. package/dist/index.es64.js.map +1 -1
  160. package/dist/index.es65.js +123 -44
  161. package/dist/index.es65.js.map +1 -1
  162. package/dist/index.es66.js +14 -7
  163. package/dist/index.es66.js.map +1 -1
  164. package/dist/index.es67.js +125 -116
  165. package/dist/index.es67.js.map +1 -1
  166. package/dist/index.es68.js +10 -14
  167. package/dist/index.es68.js.map +1 -1
  168. package/dist/index.es69.js +209 -127
  169. package/dist/index.es69.js.map +1 -1
  170. package/dist/index.es70.js +12 -10
  171. package/dist/index.es70.js.map +1 -1
  172. package/dist/index.es71.js +7 -215
  173. package/dist/index.es71.js.map +1 -1
  174. package/dist/index.es72.js +4 -13
  175. package/dist/index.es72.js.map +1 -1
  176. package/dist/index.es73.js +27 -7
  177. package/dist/index.es73.js.map +1 -1
  178. package/dist/index.es74.js +49 -3
  179. package/dist/index.es74.js.map +1 -1
  180. package/dist/index.es75.js +9 -28
  181. package/dist/index.es75.js.map +1 -1
  182. package/dist/index.es76.js +253 -48
  183. package/dist/index.es76.js.map +1 -1
  184. package/dist/index.es77.js +21 -8
  185. package/dist/index.es77.js.map +1 -1
  186. package/dist/index.es78.js +11 -67
  187. package/dist/index.es78.js.map +1 -1
  188. package/dist/index.es79.js +203 -10
  189. package/dist/index.es79.js.map +1 -1
  190. package/dist/index.es80.js +20 -203
  191. package/dist/index.es80.js.map +1 -1
  192. package/dist/index.es81.js +392 -21
  193. package/dist/index.es81.js.map +1 -1
  194. package/dist/index.es82.js +61 -386
  195. package/dist/index.es82.js.map +1 -1
  196. package/dist/index.es87.js +1 -1
  197. package/dist/index.es89.js +4 -4
  198. package/dist/index.es94.js +69 -65
  199. package/dist/index.es94.js.map +1 -1
  200. package/dist/index.es95.js +8 -68
  201. package/dist/index.es95.js.map +1 -1
  202. package/dist/index.es96.js +14 -9
  203. package/dist/index.es96.js.map +1 -1
  204. package/dist/index.es97.js +62 -14
  205. package/dist/index.es97.js.map +1 -1
  206. package/dist/index.es98.js +64 -61
  207. package/dist/index.es98.js.map +1 -1
  208. package/dist/packages/builder/context.d.ts +3 -1
  209. package/dist/packages/builder/context.d.ts.map +1 -1
  210. package/dist/packages/builder/schema-builder.d.ts.map +1 -1
  211. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;8EA4BnB,CAAC;AAEF,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,2CAUF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;8EA4BnB,CAAC;AAEF,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,2CAWF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index.cjs49.js");function c(...e){return i.a(f,e)}function f(e,o=[],r=[]){if(typeof e=="function")return e;if(typeof e!="object"||e===null||e instanceof Date||e instanceof RegExp)return structuredClone(e);let t=o.indexOf(e);return t!==-1?r[t]:(o.push(e),Array.isArray(e)?l(e,o,r):s(e,o,r))}function s(e,o,r){let t={};r.push(t);for(let[u,n]of Object.entries(e))t[u]=f(n,o,r);return t}function l(e,o,r){let t=[];r.push(t);for(let[u,n]of e.entries())t[u]=f(n,o,r);return t}exports.a=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index.cjs53.js");function c(...e){return i.a(f,e)}function f(e,o=[],r=[]){if(typeof e=="function")return e;if(typeof e!="object"||e===null||e instanceof Date||e instanceof RegExp)return structuredClone(e);let t=o.indexOf(e);return t!==-1?r[t]:(o.push(e),Array.isArray(e)?l(e,o,r):s(e,o,r))}function s(e,o,r){let t={};r.push(t);for(let[u,n]of Object.entries(e))t[u]=f(n,o,r);return t}function l(e,o,r){let t=[];r.push(t);for(let[u,n]of e.entries())t[u]=f(n,o,r);return t}exports.a=c;
2
2
  //# sourceMappingURL=index.cjs10.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("./index.cjs34.js"),u=require("./index.cjs35.js"),c=require("./index.cjs22.js"),e=u.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function v({className:t,variant:r,size:i,asChild:n=!1,...s}){const o=n?d.Slot:"button";return a.jsx(o,{"data-slot":"button",className:c.cn(e({variant:r,size:i,className:t})),...s})}exports.Button=v;exports.buttonVariants=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("./index.cjs34.js"),u=require("./index.cjs35.js"),c=require("./index.cjs22.js"),e=u.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function v({className:t,variant:r,size:i,asChild:n=!1,...s}){const o=n?d.Slot:"button";return a.jsx(o,{"data-slot":"button",className:c.cn(e({variant:r,size:i,className:t})),type:"button",...s})}exports.Button=v;exports.buttonVariants=e;
2
2
  //# sourceMappingURL=index.cjs11.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs11.js","sources":["../src/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40\",\n outline:\n \"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"],"names":["buttonVariants","cva","Button","className","variant","size","asChild","props","Comp","Slot","jsx","cn"],"mappings":"+MAMMA,EAAiBC,EAAA,IACrB,6cACA,CACE,SAAU,CACR,QAAS,CACP,QACE,mEACF,YACE,uIACF,QACE,2FACF,UACE,yEACF,MAAO,+CACP,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,gCACT,GAAI,gDACJ,GAAI,uCACJ,KAAM,QAAA,CAEV,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SAAA,CACR,CAEJ,EAEA,SAASC,EAAO,CACd,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,GAAGC,CACL,EAGK,CACG,MAAAC,EAAOF,EAAUG,EAAAA,KAAO,SAG5B,OAAAC,EAAA,IAACF,EAAA,CACC,YAAU,SACV,UAAWG,KAAGX,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAA,CAAW,CAAC,EACzD,GAAGI,CAAA,CACN,CAEJ"}
1
+ {"version":3,"file":"index.cjs11.js","sources":["../src/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40\",\n outline:\n \"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot : \"button\";\n\n return (\n <Comp\n data-slot=\"button\"\n className={cn(buttonVariants({ variant, size, className }))}\n type=\"button\"\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"],"names":["buttonVariants","cva","Button","className","variant","size","asChild","props","Comp","Slot","jsx","cn"],"mappings":"+MAMMA,EAAiBC,EAAA,IACrB,6cACA,CACE,SAAU,CACR,QAAS,CACP,QACE,mEACF,YACE,uIACF,QACE,2FACF,UACE,yEACF,MAAO,+CACP,KAAM,iDACR,EACA,KAAM,CACJ,QAAS,gCACT,GAAI,gDACJ,GAAI,uCACJ,KAAM,QAAA,CAEV,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,SAAA,CACR,CAEJ,EAEA,SAASC,EAAO,CACd,UAAAC,EACA,QAAAC,EACA,KAAAC,EACA,QAAAC,EAAU,GACV,GAAGC,CACL,EAGK,CACG,MAAAC,EAAOF,EAAUG,EAAAA,KAAO,SAG5B,OAAAC,EAAA,IAACF,EAAA,CACC,YAAU,SACV,UAAWG,KAAGX,EAAe,CAAE,QAAAI,EAAS,KAAAC,EAAM,UAAAF,CAAA,CAAW,CAAC,EAC1D,KAAK,SACJ,GAAGI,CAAA,CACN,CAEJ"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),m=require("react"),C=require("./index.cjs9.js"),f=require("./index.cjs10.js"),h=m.createContext(void 0),v={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"title",description:"",properties:{},required:[]};function x({children:l,initialSchema:p}){const[n,u]=m.useState(p??v),[a,c]=m.useState([]);return w.jsx(h.Provider,{value:{schema:n,setSchema:u,path:a,setPath:c},children:l})}function R(){const l=m.useContext(h);if(l===void 0)throw new Error("useSchema must be used within a SchemaProvider");const{path:p,schema:n,setSchema:u}=l,a=(r,e)=>{let t=r,i=null,o=null;for(const s of e)t.type==="array"&&t.items&&!Array.isArray(t.items)&&typeof t.items=="object"&&t.items.type==="object"&&typeof t.items.properties?.[s]=="object"?(o=t.items,i=t.items.properties[s],t=t.items):t.type==="object"&&t.properties&&!Array.isArray(t.properties)&&typeof t.properties[s]=="object"&&(o=t,i=t.properties[s],t=t.properties[s]);return{propertySchema:i,parentSchema:o}},c=r=>{const{propertySchema:e}=a(r??n,p);return e?e.type==="array"?e.items:e:r??n},q=()=>{const{propertySchema:r}=a(n,p);return r},S=(r,e)=>{const t=f.a(n),i=c(t);if(i.properties?.[r]){const o=Object.entries(i.properties).map(([s,g])=>[s===r?e:s,g]);i.properties=Object.fromEntries(o)}i.required?.includes(r)&&(i.required=i.required.map(o=>o===r?e:o)),u(t)},b=(r,e)=>{const t=f.a(n),i=c(t);typeof e=="object"&&"isRequired"in e&&(i.type==="object"&&(i.required||(i.required=[]),e.isRequired?i.required.includes(r)||i.required.push(r):i.required=i.required.filter(s=>s!==r)),delete e.isRequired);let o=!1;if(i.type==="object"&&i.properties){const s=i.properties[r];typeof s!="boolean"&&s&&typeof e!="boolean"&&(e.type&&e.type!==s.type?e={title:s.title,description:s.description,default:s.default,...e}:e.enum?(delete e.type,delete e.items,delete e.properties,e={title:s.title,description:s.description,...e}):e={...s,...e},i.properties[r]=e),o=!0}if(u(t),o)return{status:"success",property:i.properties[r]}},d=(r,e,t)=>{const i=f.a(n),o=c(i);return o.type!=="object"&&(o.type="object"),o.properties||(o.properties={}),o.properties[r]?{status:"error",code:"key-exists",message:`Property with key ${r} already exists`}:(e.enum&&(delete e.type,delete e.items,delete e.properties),o.properties[r]=e,t&&(o.required||(o.required=[]),o.required.includes(r)||o.required.push(r)),u(i),{status:"success",property:o.properties[r]})},j=r=>{const e=f.a(n),t=c(e);t.type==="object"&&t.required&&(t.required=t.required.filter(i=>i!==r)),t.type==="object"&&t.properties&&delete t.properties[r],u(e)},P=r=>{const e=c().properties;if(!e||C.a(e)||typeof e[r]=="boolean")return;const t=e[r],i=`${r}_copy`,o=f.a(t);return d(i,o,y(r))},y=r=>{if(p.length){const{propertySchema:e}=a(n,p);return e?.type==="array"&&e.items&&typeof e.items!="boolean"&&!Array.isArray(e.items)&&e.items?.type==="object"?!!e.items?.required?.includes(r):!!e?.required?.includes(r)}return!!n?.required?.includes(r)};return{...l,getCurrentSchema:c,getCurrentProperty:q,handlePropertyChange:b,handleAddProperty:d,handleKeyChange:S,navigateToCorrectNesting:a,handleDeleteProperty:j,isPropertyRequired:y,getValue:()=>n,handleDuplicateProperty:P}}exports.SchemaContext=h;exports.SchemaProvider=x;exports.useSchema=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),d=require("react"),x=require("./index.cjs9.js"),m=require("./index.cjs10.js"),h=d.createContext(void 0),C={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"title",description:"",properties:{},required:[]};function R({children:c,initialSchema:f}){const[p,n]=d.useState(f??C),[u,a]=d.useState([]);return v.jsx(h.Provider,{value:{schema:p,setSchema:n,path:u,setPath:a},children:c})}function B({onSchemaChange:c}={}){const f=d.useContext(h);if(f===void 0)throw new Error("useSchema must be used within a SchemaProvider");const{path:p,schema:n,setSchema:u}=f,a=(t,e)=>{let r=t,i=null,o=null;for(const s of e)r.type==="array"&&r.items&&!Array.isArray(r.items)&&typeof r.items=="object"&&r.items.type==="object"&&typeof r.items.properties?.[s]=="object"?(o=r.items,i=r.items.properties[s],r=r.items):r.type==="object"&&r.properties&&!Array.isArray(r.properties)&&typeof r.properties[s]=="object"&&(o=r,i=r.properties[s],r=r.properties[s]);return{propertySchema:i,parentSchema:o}},l=t=>{const{propertySchema:e}=a(t??n,p);return e?e.type==="array"?e.items:e:t??n},b=()=>{const{propertySchema:t}=a(n,p);return t},S=(t,e)=>{const r=m.a(n),i=l(r);if(i.properties?.[t]){const o=Object.entries(i.properties).map(([s,w])=>[s===t?e:s,w]);i.properties=Object.fromEntries(o)}i.required?.includes(t)&&(i.required=i.required.map(o=>o===t?e:o)),u(r),c?.(r)},j=(t,e)=>{const r=m.a(n),i=l(r);typeof e=="object"&&"isRequired"in e&&(i.type==="object"&&(i.required||(i.required=[]),e.isRequired?i.required.includes(t)||i.required.push(t):i.required=i.required.filter(s=>s!==t)),delete e.isRequired);let o=!1;if(i.type==="object"&&i.properties){const s=i.properties[t];typeof s!="boolean"&&s&&typeof e!="boolean"&&(e.type&&e.type!==s.type?e={title:s.title,description:s.description,default:s.default,...e}:e.enum?(delete e.type,delete e.items,delete e.properties,e={title:s.title,description:s.description,...e}):e={...s,...e},i.properties[t]=e),o=!0}if(u(r),c?.(r),o)return{status:"success",property:i.properties[t]}},y=(t,e,r)=>{const i=m.a(n),o=l(i);return o.type!=="object"&&(o.type="object"),o.properties||(o.properties={}),o.properties[t]?{status:"error",code:"key-exists",message:`Property with key ${t} already exists`}:(e.enum&&(delete e.type,delete e.items,delete e.properties),o.properties[t]=e,r&&(o.required||(o.required=[]),o.required.includes(t)||o.required.push(t)),u(i),c?.(i),{status:"success",property:o.properties[t]})},P=t=>{const e=m.a(n),r=l(e);r.type==="object"&&r.required&&(r.required=r.required.filter(i=>i!==t)),r.type==="object"&&r.properties&&delete r.properties[t],u(e),c?.(e)},g=t=>{const e=l().properties;if(!e||x.a(e)||typeof e[t]=="boolean")return;const r=e[t],i=`${t}_copy`,o=m.a(r);return y(i,o,q(t))},q=t=>{if(p.length){const{propertySchema:e}=a(n,p);return e?.type==="array"&&e.items&&typeof e.items!="boolean"&&!Array.isArray(e.items)&&e.items?.type==="object"?!!e.items?.required?.includes(t):!!e?.required?.includes(t)}return!!n?.required?.includes(t)};return{...f,getCurrentSchema:l,getCurrentProperty:b,handlePropertyChange:j,handleAddProperty:y,handleKeyChange:S,navigateToCorrectNesting:a,handleDeleteProperty:P,isPropertyRequired:q,getValue:()=>n,handleDuplicateProperty:g}}exports.SchemaContext=h;exports.SchemaProvider=R;exports.useSchema=B;
2
2
  //# sourceMappingURL=index.cjs2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs2.js","sources":["../src/packages/builder/context.tsx"],"sourcesContent":["import { createContext, useContext, useState } from \"react\";\n\nimport type { PropsWithChildren, SetStateAction } from \"react\";\nimport type { JSONSchema7, JSONSchema7Definition } from \"json-schema\";\nimport { clone, isEmpty } from \"remeda\";\nimport type { OperationError } from \"./shared-types\";\n\ninterface ContextState<T extends JSONSchema7> {\n schema: T;\n setSchema: React.Dispatch<T>;\n path: string[];\n setPath: React.Dispatch<SetStateAction<string[]>>;\n}\n\nexport const SchemaContext = createContext<\n ContextState<JSONSchema7> | undefined\n>(undefined);\n\nconst defaultSchema: JSONSchema7 = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n type: \"object\",\n title: \"title\",\n description: \"\",\n properties: {},\n required: [],\n};\n\nfunction SchemaProvider({\n children,\n initialSchema,\n}: PropsWithChildren<{ initialSchema?: JSONSchema7 }>) {\n const [schema, setSchema] = useState<JSONSchema7>(\n initialSchema ?? defaultSchema,\n );\n\n /**\n * Path represents the path to a nested property in the schema.\n * It should only contain property keys.\n * An empty path means the current schema is the root schema since\n * the path only represents nested properties.\n */\n const [path, setPath] = useState<string[]>([]);\n\n // NOTE: you *might* need to memoize your values\n // Learn more in http://kcd.im/optimize-context\n\n return (\n <SchemaContext.Provider value={{ schema, setSchema, path, setPath }}>\n {children}\n </SchemaContext.Provider>\n );\n}\n\nexport type PropertyAddError = OperationError & {\n status: \"error\";\n};\n\nexport interface PropertyAddSuccess {\n status: \"success\";\n property: JSONSchema7;\n}\n\nexport interface PropertyChangeSuccess {\n status: \"success\";\n property: JSONSchema7Definition;\n}\n\nfunction useSchema() {\n const context = useContext(SchemaContext);\n\n if (context === undefined) {\n throw new Error(\"useSchema must be used within a SchemaProvider\");\n }\n\n const { path, schema, setSchema } = context;\n\n /**\n * Navigates to the correct property schema of the latest key in the provided path.\n *\n * It will traverse both \"properties\" and \"items\" to find the correct property schema.\n *\n * It will only return a property schema if the provided path is valid i.e. it\n * correctly follows the schema's nesting structure.\n *\n * It will only return a parent schema if the provided path is valid i.e. it\n * correctly follows the schema's nesting structure.\n */\n const navigateToCorrectNesting = (\n providedSchema: JSONSchema7,\n providedPath: string[],\n ) => {\n let current = providedSchema;\n let propertySchema: JSONSchema7 | null = null;\n // Should be the schema of type \"object\" containing the property in its properties key\n let parentSchema: JSONSchema7 | null = null;\n\n for (const p of providedPath) {\n if (\n current.type === \"array\" &&\n current.items &&\n !Array.isArray(current.items) &&\n typeof current.items === \"object\" &&\n current.items.type === \"object\" &&\n typeof current.items.properties?.[p] === \"object\"\n ) {\n parentSchema = current.items;\n propertySchema = current.items.properties[p];\n current = current.items;\n } else if (\n current.type === \"object\" &&\n current.properties &&\n !Array.isArray(current.properties) &&\n typeof current.properties[p] === \"object\"\n ) {\n parentSchema = current;\n propertySchema = current.properties[p];\n current = current.properties[p];\n }\n }\n\n return { propertySchema, parentSchema };\n };\n\n /**\n * Gets the current schema of the latest key in the path.\n * If path is empty, it will return the root schema.\n *\n * It should always return the \"object\" schema of the current path.\n */\n const getCurrentSchema = (initialSchema?: JSONSchema7) => {\n // Gets the correct object schema if under nesting\n // Otherwise, return the root schema\n const { propertySchema } = navigateToCorrectNesting(\n initialSchema ?? schema,\n path,\n );\n\n if (propertySchema) {\n if (propertySchema.type === \"array\") {\n return propertySchema.items as JSONSchema7;\n }\n\n return propertySchema;\n }\n\n return initialSchema ?? schema;\n };\n\n /**\n * Gets the correct property schema of the latest key in the path.\n * If no path is provided, it will return null.\n */\n const getCurrentProperty = () => {\n const { propertySchema } = navigateToCorrectNesting(schema, path);\n\n return propertySchema;\n };\n\n /**\n * Change the key of a property in the schema. It expects\n * the find the key at the current path.\n */\n const handleKeyChange = (key: string, newKey: string) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to change\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n if (current.properties?.[key]) {\n //Important: maintain order as to not confuse users\n const newProperties = Object.entries(current.properties).map(\n ([k, val]) => {\n return [k === key ? newKey : k, val];\n },\n );\n\n current.properties = Object.fromEntries(\n newProperties,\n ) as JSONSchema7[\"properties\"];\n }\n\n if (current.required?.includes(key)) {\n current.required = current.required.map((item) =>\n item === key ? newKey : item,\n );\n }\n\n setSchema(newSchema);\n };\n\n const handlePropertyChange = (\n key: string,\n updates: Partial<JSONSchema7Definition> & { isRequired?: boolean },\n ): PropertyChangeSuccess | undefined => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to change\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Handle required field updates\n if (typeof updates === \"object\" && \"isRequired\" in updates) {\n if (current.type === \"object\") {\n if (!current.required) {\n current.required = [];\n }\n if (updates.isRequired) {\n if (!current.required.includes(key)) {\n current.required.push(key);\n }\n } else {\n current.required = current.required.filter((item) => item !== key);\n }\n }\n delete updates.isRequired;\n }\n\n let isUpdated = false;\n\n // Update the property\n if (current.type === \"object\" && current.properties) {\n const originalProperty = current.properties[key];\n // Ensure the property exists and is not a boolean\n if (typeof originalProperty !== \"boolean\" && originalProperty) {\n if (typeof updates !== \"boolean\") {\n //if updates changes the type of the property,\n //only the title, description, and default properties should remain\n //from the original property\n if (updates.type && updates.type !== originalProperty.type) {\n updates = {\n title: originalProperty.title,\n description: originalProperty.description,\n default: originalProperty.default,\n ...updates,\n };\n } else if (updates.enum) {\n //if the property is an enum, only the title and description should remain\n //from the original property\n delete updates.type;\n delete updates.items;\n delete updates.properties;\n updates = {\n title: originalProperty.title,\n description: originalProperty.description,\n ...updates,\n };\n } else {\n updates = { ...originalProperty, ...updates };\n }\n\n current.properties[key] = updates;\n }\n }\n isUpdated = true;\n }\n\n setSchema(newSchema);\n\n if (isUpdated) {\n return { status: \"success\", property: current.properties![key]! };\n }\n };\n\n /**\n * Adds a sibling property to the current schema.\n */\n const handleAddProperty = (\n key: string,\n propertyToAdd: JSONSchema7,\n isRequired: boolean,\n ) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to add\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Ensure the current schema has a properties object\n if (current.type !== \"object\") {\n current.type = \"object\";\n }\n if (!current.properties) {\n current.properties = {};\n }\n\n //Ensure there's no existing property with the same key\n if (current.properties[key]) {\n return {\n status: \"error\",\n code: \"key-exists\" as const,\n message: `Property with key ${key} already exists`,\n } satisfies PropertyAddError;\n }\n\n if (propertyToAdd.enum) {\n //ensure that only the enum property is present\n delete propertyToAdd.type;\n delete propertyToAdd.items;\n delete propertyToAdd.properties;\n }\n\n // Add the new property\n current.properties[key] = propertyToAdd;\n\n // Handle required field\n if (isRequired) {\n if (!current.required) {\n current.required = [];\n }\n if (!current.required.includes(key)) {\n current.required.push(key);\n }\n }\n\n setSchema(newSchema);\n\n return {\n status: \"success\" as const,\n property: current.properties[key],\n } satisfies PropertyAddSuccess;\n };\n\n const handleDeleteProperty = (key: string) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to delete\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Handle required field updates\n if (current.type === \"object\") {\n if (current.required) {\n current.required = current.required.filter((item) => item !== key);\n }\n }\n\n // Delete the property\n if (current.type === \"object\" && current.properties) {\n delete current.properties[key];\n }\n\n setSchema(newSchema);\n };\n\n const handleDuplicateProperty = (key: string) => {\n const currentProperties = getCurrentSchema().properties;\n if (\n !currentProperties ||\n isEmpty(currentProperties) ||\n typeof currentProperties[key] === \"boolean\"\n ) {\n return;\n }\n\n const propertyToDuplicate = currentProperties[key]!;\n const newKey = `${key}_copy`;\n const newProperty = clone(propertyToDuplicate);\n\n // Add the duplicated property\n return handleAddProperty(newKey, newProperty, isPropertyRequired(key));\n };\n\n const isPropertyRequired = (key: string) => {\n if (path.length) {\n const { propertySchema } = navigateToCorrectNesting(schema, path);\n\n if (\n propertySchema?.type === \"array\" &&\n propertySchema.items &&\n typeof propertySchema.items !== \"boolean\" &&\n !Array.isArray(propertySchema.items) &&\n propertySchema.items?.type === \"object\"\n ) {\n return Boolean(propertySchema.items?.required?.includes(key));\n } else {\n return Boolean(propertySchema?.required?.includes(key));\n }\n }\n\n return Boolean(schema?.required?.includes(key));\n };\n\n /**\n * Programatically get the current schema value\n */\n const getValue = () => {\n return schema;\n };\n\n return {\n ...context,\n getCurrentSchema,\n getCurrentProperty,\n handlePropertyChange,\n handleAddProperty,\n handleKeyChange,\n navigateToCorrectNesting,\n handleDeleteProperty,\n isPropertyRequired,\n getValue,\n handleDuplicateProperty,\n };\n}\n\nexport { SchemaProvider, useSchema };\n"],"names":["SchemaContext","createContext","defaultSchema","SchemaProvider","children","initialSchema","schema","setSchema","useState","path","setPath","jsx","useSchema","context","useContext","navigateToCorrectNesting","providedSchema","providedPath","current","propertySchema","parentSchema","p","getCurrentSchema","getCurrentProperty","handleKeyChange","key","newKey","newSchema","clone","newProperties","k","val","item","handlePropertyChange","updates","isUpdated","originalProperty","handleAddProperty","propertyToAdd","isRequired","handleDeleteProperty","handleDuplicateProperty","currentProperties","isEmpty","propertyToDuplicate","newProperty","isPropertyRequired"],"mappings":"mMAcaA,EAAgBC,gBAE3B,MAAS,EAELC,EAA6B,CACjC,QAAS,0CACT,KAAM,SACN,MAAO,QACP,YAAa,GACb,WAAY,CAAC,EACb,SAAU,CAAA,CACZ,EAEA,SAASC,EAAe,CACtB,SAAAC,EACA,cAAAC,CACF,EAAuD,CAC/C,KAAA,CAACC,EAAQC,CAAS,EAAIC,EAAA,SAC1BH,GAAiBH,CACnB,EAQM,CAACO,EAAMC,CAAO,EAAIF,EAAAA,SAAmB,CAAA,CAAE,EAM3C,OAAAG,MAACX,EAAc,SAAd,CAAuB,MAAO,CAAE,OAAAM,EAAQ,UAAAC,EAAW,KAAAE,EAAM,QAAAC,CAAQ,EAC/D,SAAAN,CACH,CAAA,CAEJ,CAgBA,SAASQ,GAAY,CACb,MAAAC,EAAUC,aAAWd,CAAa,EAExC,GAAIa,IAAY,OACR,MAAA,IAAI,MAAM,gDAAgD,EAGlE,KAAM,CAAE,KAAAJ,EAAM,OAAAH,EAAQ,UAAAC,CAAc,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,EAAe,OACf,OAAOA,EAAe,OAAU,WAChC,CAAC,MAAM,QAAQA,EAAe,KAAK,GACnCA,EAAe,OAAO,OAAS,SAExB,EAAQA,EAAe,OAAO,UAAU,SAASM,CAAG,EAEpD,EAAQN,GAAgB,UAAU,SAASM,CAAG,CACvD,CAGF,MAAO,EAAQnB,GAAQ,UAAU,SAASmB,CAAG,CAC/C,EASO,MAAA,CACL,GAAGZ,EACH,iBAAAS,EACA,mBAAAC,EACA,qBAAAU,EACA,kBAAAI,EACA,gBAAAb,EACA,yBAAAT,EACA,qBAAAyB,EACA,mBAAAM,EACA,SAde,IACRxC,EAcP,wBAAAmC,CACF,CACF"}
1
+ {"version":3,"file":"index.cjs2.js","sources":["../src/packages/builder/context.tsx"],"sourcesContent":["import { createContext, useContext, useState } from \"react\";\n\nimport type { PropsWithChildren, SetStateAction } from \"react\";\nimport type { JSONSchema7, JSONSchema7Definition } from \"json-schema\";\nimport { clone, isEmpty } from \"remeda\";\nimport type { OperationError } from \"./shared-types\";\n\ninterface ContextState<T extends JSONSchema7> {\n schema: T;\n setSchema: React.Dispatch<T>;\n path: string[];\n setPath: React.Dispatch<SetStateAction<string[]>>;\n}\n\nexport const SchemaContext = createContext<\n ContextState<JSONSchema7> | undefined\n>(undefined);\n\nconst defaultSchema: JSONSchema7 = {\n $schema: \"http://json-schema.org/draft-07/schema#\",\n type: \"object\",\n title: \"title\",\n description: \"\",\n properties: {},\n required: [],\n};\n\nfunction SchemaProvider({\n children,\n initialSchema,\n}: PropsWithChildren<{ initialSchema?: JSONSchema7 }>) {\n const [schema, setSchema] = useState<JSONSchema7>(\n initialSchema ?? defaultSchema,\n );\n\n /**\n * Path represents the path to a nested property in the schema.\n * It should only contain property keys.\n * An empty path means the current schema is the root schema since\n * the path only represents nested properties.\n */\n const [path, setPath] = useState<string[]>([]);\n\n // NOTE: you *might* need to memoize your values\n // Learn more in http://kcd.im/optimize-context\n\n return (\n <SchemaContext.Provider value={{ schema, setSchema, path, setPath }}>\n {children}\n </SchemaContext.Provider>\n );\n}\n\nexport type PropertyAddError = OperationError & {\n status: \"error\";\n};\n\nexport interface PropertyAddSuccess {\n status: \"success\";\n property: JSONSchema7;\n}\n\nexport interface PropertyChangeSuccess {\n status: \"success\";\n property: JSONSchema7Definition;\n}\n\nfunction useSchema({\n onSchemaChange,\n}: {\n onSchemaChange?: (schema: JSONSchema7) => void;\n} = {}) {\n const context = useContext(SchemaContext);\n\n if (context === undefined) {\n throw new Error(\"useSchema must be used within a SchemaProvider\");\n }\n\n const { path, schema, setSchema } = context;\n\n /**\n * Navigates to the correct property schema of the latest key in the provided path.\n *\n * It will traverse both \"properties\" and \"items\" to find the correct property schema.\n *\n * It will only return a property schema if the provided path is valid i.e. it\n * correctly follows the schema's nesting structure.\n *\n * It will only return a parent schema if the provided path is valid i.e. it\n * correctly follows the schema's nesting structure.\n */\n const navigateToCorrectNesting = (\n providedSchema: JSONSchema7,\n providedPath: string[],\n ) => {\n let current = providedSchema;\n let propertySchema: JSONSchema7 | null = null;\n // Should be the schema of type \"object\" containing the property in its properties key\n let parentSchema: JSONSchema7 | null = null;\n\n for (const p of providedPath) {\n if (\n current.type === \"array\" &&\n current.items &&\n !Array.isArray(current.items) &&\n typeof current.items === \"object\" &&\n current.items.type === \"object\" &&\n typeof current.items.properties?.[p] === \"object\"\n ) {\n parentSchema = current.items;\n propertySchema = current.items.properties[p];\n current = current.items;\n } else if (\n current.type === \"object\" &&\n current.properties &&\n !Array.isArray(current.properties) &&\n typeof current.properties[p] === \"object\"\n ) {\n parentSchema = current;\n propertySchema = current.properties[p];\n current = current.properties[p];\n }\n }\n\n return { propertySchema, parentSchema };\n };\n\n /**\n * Gets the current schema of the latest key in the path.\n * If path is empty, it will return the root schema.\n *\n * It should always return the \"object\" schema of the current path.\n */\n const getCurrentSchema = (initialSchema?: JSONSchema7) => {\n // Gets the correct object schema if under nesting\n // Otherwise, return the root schema\n const { propertySchema } = navigateToCorrectNesting(\n initialSchema ?? schema,\n path,\n );\n\n if (propertySchema) {\n if (propertySchema.type === \"array\") {\n return propertySchema.items as JSONSchema7;\n }\n\n return propertySchema;\n }\n\n return initialSchema ?? schema;\n };\n\n /**\n * Gets the correct property schema of the latest key in the path.\n * If no path is provided, it will return null.\n */\n const getCurrentProperty = () => {\n const { propertySchema } = navigateToCorrectNesting(schema, path);\n\n return propertySchema;\n };\n\n /**\n * Change the key of a property in the schema. It expects\n * the find the key at the current path.\n */\n const handleKeyChange = (key: string, newKey: string) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to change\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n if (current.properties?.[key]) {\n //Important: maintain order as to not confuse users\n const newProperties = Object.entries(current.properties).map(\n ([k, val]) => {\n return [k === key ? newKey : k, val];\n },\n );\n\n current.properties = Object.fromEntries(\n newProperties,\n ) as JSONSchema7[\"properties\"];\n }\n\n if (current.required?.includes(key)) {\n current.required = current.required.map((item) =>\n item === key ? newKey : item,\n );\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n };\n\n const handlePropertyChange = (\n key: string,\n updates: Partial<JSONSchema7Definition> & { isRequired?: boolean },\n ): PropertyChangeSuccess | undefined => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to change\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Handle required field updates\n if (typeof updates === \"object\" && \"isRequired\" in updates) {\n if (current.type === \"object\") {\n if (!current.required) {\n current.required = [];\n }\n if (updates.isRequired) {\n if (!current.required.includes(key)) {\n current.required.push(key);\n }\n } else {\n current.required = current.required.filter((item) => item !== key);\n }\n }\n delete updates.isRequired;\n }\n\n let isUpdated = false;\n\n // Update the property\n if (current.type === \"object\" && current.properties) {\n const originalProperty = current.properties[key];\n // Ensure the property exists and is not a boolean\n if (typeof originalProperty !== \"boolean\" && originalProperty) {\n if (typeof updates !== \"boolean\") {\n //if updates changes the type of the property,\n //only the title, description, and default properties should remain\n //from the original property\n if (updates.type && updates.type !== originalProperty.type) {\n updates = {\n title: originalProperty.title,\n description: originalProperty.description,\n default: originalProperty.default,\n ...updates,\n };\n } else if (updates.enum) {\n //if the property is an enum, only the title and description should remain\n //from the original property\n delete updates.type;\n delete updates.items;\n delete updates.properties;\n updates = {\n title: originalProperty.title,\n description: originalProperty.description,\n ...updates,\n };\n } else {\n updates = { ...originalProperty, ...updates };\n }\n\n current.properties[key] = updates;\n }\n }\n isUpdated = true;\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n\n if (isUpdated) {\n return { status: \"success\", property: current.properties![key]! };\n }\n };\n\n /**\n * Adds a sibling property to the current schema.\n */\n const handleAddProperty = (\n key: string,\n propertyToAdd: JSONSchema7,\n isRequired: boolean,\n ) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to add\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Ensure the current schema has a properties object\n if (current.type !== \"object\") {\n current.type = \"object\";\n }\n if (!current.properties) {\n current.properties = {};\n }\n\n //Ensure there's no existing property with the same key\n if (current.properties[key]) {\n return {\n status: \"error\",\n code: \"key-exists\" as const,\n message: `Property with key ${key} already exists`,\n } satisfies PropertyAddError;\n }\n\n if (propertyToAdd.enum) {\n //ensure that only the enum property is present\n delete propertyToAdd.type;\n delete propertyToAdd.items;\n delete propertyToAdd.properties;\n }\n\n // Add the new property\n current.properties[key] = propertyToAdd;\n\n // Handle required field\n if (isRequired) {\n if (!current.required) {\n current.required = [];\n }\n if (!current.required.includes(key)) {\n current.required.push(key);\n }\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n\n return {\n status: \"success\" as const,\n property: current.properties[key],\n } satisfies PropertyAddSuccess;\n };\n\n const handleDeleteProperty = (key: string) => {\n const newSchema = clone(schema);\n\n // The current schema containing the property to delete\n const current: JSONSchema7 = getCurrentSchema(newSchema);\n\n // Handle required field updates\n if (current.type === \"object\") {\n if (current.required) {\n current.required = current.required.filter((item) => item !== key);\n }\n }\n\n // Delete the property\n if (current.type === \"object\" && current.properties) {\n delete current.properties[key];\n }\n\n setSchema(newSchema);\n onSchemaChange?.(newSchema);\n };\n\n const handleDuplicateProperty = (key: string) => {\n const currentProperties = getCurrentSchema().properties;\n if (\n !currentProperties ||\n isEmpty(currentProperties) ||\n typeof currentProperties[key] === \"boolean\"\n ) {\n return;\n }\n\n const propertyToDuplicate = currentProperties[key]!;\n const newKey = `${key}_copy`;\n const newProperty = clone(propertyToDuplicate);\n\n // Add the duplicated property\n return handleAddProperty(newKey, newProperty, isPropertyRequired(key));\n };\n\n const isPropertyRequired = (key: string) => {\n if (path.length) {\n const { propertySchema } = navigateToCorrectNesting(schema, path);\n\n if (\n propertySchema?.type === \"array\" &&\n propertySchema.items &&\n typeof propertySchema.items !== \"boolean\" &&\n !Array.isArray(propertySchema.items) &&\n propertySchema.items?.type === \"object\"\n ) {\n return Boolean(propertySchema.items?.required?.includes(key));\n } else {\n return Boolean(propertySchema?.required?.includes(key));\n }\n }\n\n return Boolean(schema?.required?.includes(key));\n };\n\n /**\n * Programatically get the current schema value\n */\n const getValue = () => {\n return schema;\n };\n\n return {\n ...context,\n getCurrentSchema,\n getCurrentProperty,\n handlePropertyChange,\n handleAddProperty,\n handleKeyChange,\n navigateToCorrectNesting,\n handleDeleteProperty,\n isPropertyRequired,\n getValue,\n handleDuplicateProperty,\n };\n}\n\nexport { SchemaProvider, useSchema };\n"],"names":["SchemaContext","createContext","defaultSchema","SchemaProvider","children","initialSchema","schema","setSchema","useState","path","setPath","jsx","useSchema","onSchemaChange","context","useContext","navigateToCorrectNesting","providedSchema","providedPath","current","propertySchema","parentSchema","p","getCurrentSchema","getCurrentProperty","handleKeyChange","key","newKey","newSchema","clone","newProperties","k","val","item","handlePropertyChange","updates","isUpdated","originalProperty","handleAddProperty","propertyToAdd","isRequired","handleDeleteProperty","handleDuplicateProperty","currentProperties","isEmpty","propertyToDuplicate","newProperty","isPropertyRequired"],"mappings":"mMAcaA,EAAgBC,gBAE3B,MAAS,EAELC,EAA6B,CACjC,QAAS,0CACT,KAAM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nDT,EAAQ,OAAS,UACfA,EAAQ,WACVA,EAAQ,SAAWA,EAAQ,SAAS,OAAQc,GAASA,IAASP,CAAG,GAKjEP,EAAQ,OAAS,UAAYA,EAAQ,YAChC,OAAAA,EAAQ,WAAWO,CAAG,EAG/BnB,EAAUqB,CAAS,EACnBf,IAAiBe,CAAS,CAC5B,EAEMc,EAA2BhB,GAAgB,CACzC,MAAAiB,EAAoBpB,IAAmB,WAE3C,GAAA,CAACoB,GACDC,EAAAA,EAAQD,CAAiB,GACzB,OAAOA,EAAkBjB,CAAG,GAAM,UAElC,OAGI,MAAAmB,EAAsBF,EAAkBjB,CAAG,EAC3CC,EAAS,GAAGD,CAAG,QACfoB,EAAcjB,IAAMgB,CAAmB,EAG7C,OAAOP,EAAkBX,EAAQmB,EAAaC,EAAmBrB,CAAG,CAAC,CACvE,EAEMqB,EAAsBrB,GAAgB,CAC1C,GAAIjB,EAAK,OAAQ,CACf,KAAM,CAAE,eAAAW,CAAmB,EAAAJ,EAAyBV,EAAQG,CAAI,EAEhE,OACEW,GAAgB,OAAS,SACzBA,EAAe,OACf,OAAOA,EAAe,OAAU,WAChC,CAAC,MAAM,QAAQA,EAAe,KAAK,GACnCA,EAAe,OAAO,OAAS,SAExB,EAAQA,EAAe,OAAO,UAAU,SAASM,CAAG,EAEpD,EAAQN,GAAgB,UAAU,SAASM,CAAG,CACvD,CAGF,MAAO,EAAQpB,GAAQ,UAAU,SAASoB,CAAG,CAC/C,EASO,MAAA,CACL,GAAGZ,EACH,iBAAAS,EACA,mBAAAC,EACA,qBAAAU,EACA,kBAAAI,EACA,gBAAAb,EACA,yBAAAT,EACA,qBAAAyB,EACA,mBAAAM,EACA,SAde,IACRzC,EAcP,wBAAAoC,CACF,CACF"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs51.js");/**
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs49.js");/**
2
2
  * @license lucide-react v0.477.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs51.js");/**
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs49.js");/**
2
2
  * @license lucide-react v0.477.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs51.js");/**
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs49.js");/**
2
2
  * @license lucide-react v0.477.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs51.js");/**
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs49.js");/**
2
2
  * @license lucide-react v0.477.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs51.js");/**
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs49.js");/**
2
2
  * @license lucide-react v0.477.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),se=require("./index.cjs2.js"),u=require("./index.cjs11.js"),d=require("./index.cjs12.js"),ae=require("./index.cjs13.js"),r=require("./index.cjs14.js"),L=require("./index.cjs15.js"),ce=require("./index.cjs10.js"),O=require("./index.cjs4.js"),oe=require("./index.cjs16.js"),a=require("./index.cjs17.js"),p=require("./index.cjs18.js"),de=require("./index.cjs19.js"),ue=require("ajv"),C=require("./index.cjs20.js"),he=require("./index.cjs21.js"),D=require("./index.cjs22.js"),me=require("./index.cjs23.js"),je=require("./index.cjs24.js"),xe=require("./index.cjs25.js"),ge=require("./index.cjs26.js"),be=require("./index.cjs27.js"),fe=i=>{const[k,m]=s.useState(!1),[F,f]=s.useState(!1),[U,j]=s.useState(!1),[x,v]=s.useState(),[A,P]=s.useState(),[N,q]=s.useState(),[g,b]=s.useState(null);O.usePluginSystem(i.plugins??[]);const{getCurrentSchema:Q,setPath:h,path:c,schema:B,handleAddProperty:H,handlePropertyChange:o,handleKeyChange:I,handleDeleteProperty:M,setSchema:_,isPropertyRequired:E,handleDuplicateProperty:G}=se.useSchema(),{getConstraintDefinitionsForType:J}=O.useConstraints();s.useEffect(()=>{if(i.initialSchema)try{de.validateSchema(i.initialSchema),_(ce.a(i.initialSchema)),b(null)}catch(t){t instanceof Error?b(t.message):t instanceof ue.ValidationError?b(`Schema validation error: ${t.message}`):b("Unknown schema validation error")}},[i.initialSchema]),s.useEffect(()=>{!g&&i.onSchemaChange&&i.onSchemaChange(B)},[B,g,i.onSchemaChange]);const W=Q(),w=t=>{h([...c,t])},T=()=>{h(c.slice(0,-1))},X=(t,n)=>{P(t),q(n),f(!0)},R=t=>{v(t),j(!0)},Y=()=>{x&&(M(x),v(void 0)),j(!1)},Z=()=>{v(void 0),j(!1)},z=t=>{const n=G(t);n?.status==="error"?i.onPropertyAddError?.(n):n?.status==="success"&&i.onPropertyAddSuccess?.(n)},ee=(...t)=>{const n=H(...t);n.status==="error"?i.onPropertyAddError?.(n):n.status==="success"&&i.onPropertyAddSuccess?.(n),m(!1)},K=i.propertyComponent,te=(t,n)=>K?e.jsx(K,{property:{key:t,schema:n,isRequired:E(t)},onPropertyChange:o,onKeyChange:I,onDelete:R,onDuplicate:z,onNavigate:n.type==="object"||n.type==="array"&&typeof n.items=="object"&&n.items.type==="object"?w:void 0},t):e.jsxs("div",{className:"flex flex-col md:grid grid-cols-(--my-autofit-grid) gap-4 md:items-center border p-2 rounded-md mb-2",children:[e.jsx("div",{className:"",children:e.jsx(C.DebouncedInput,{value:t,onDebounce:l=>I(t,l),placeholder:"Property Key","aria-label":`Property key for ${t}`,delay:500})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae.Switch,{checked:E(t),onCheckedChange:l=>o(t,{isRequired:l}),"aria-label":"Required"}),e.jsx(L.Label,{htmlFor:`required-${t}`,children:"Required"})]}),e.jsx("div",{className:"",children:e.jsxs(r.Select,{value:typeof n=="object"&&!Array.isArray(n.type)?n.type:void 0,onValueChange:l=>o(t,{type:l}),"aria-label":"Type",children:[e.jsx(r.SelectTrigger,{className:"w-full","aria-label":"Select type",children:e.jsx(r.SelectValue,{})}),e.jsxs(r.SelectContent,{children:[e.jsx(r.SelectItem,{value:"string",children:"string"}),e.jsx(r.SelectItem,{value:"number",children:"number"}),e.jsx(r.SelectItem,{value:"integer",children:"integer"}),e.jsx(r.SelectItem,{value:"boolean",children:"boolean"}),e.jsx(r.SelectItem,{value:"object",children:"object"}),e.jsx(r.SelectItem,{value:"array",children:"array"}),e.jsx(r.SelectItem,{value:"null",children:"null"}),e.jsx(r.SelectItem,{value:"enum",children:"enum"})]})]})}),e.jsx("div",{className:"",children:e.jsx(C.DebouncedInput,{value:typeof n=="object"?n.title:void 0,onDebounce:l=>o(t,{title:l}),placeholder:"Title"})}),e.jsx("div",{className:"",children:e.jsx(C.DebouncedInput,{value:typeof n=="object"?n.description:void 0,onDebounce:l=>o(t,{description:l}),placeholder:"Description"})}),e.jsxs("div",{className:"order-last md:order-none flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"sm",onClick:()=>R(t),"aria-label":"Delete",className:"block!",children:e.jsx(je.default,{size:16,className:"text-destructive"})}),e.jsx(u.Button,{variant:"outline",size:"sm",onClick:()=>z(t),"aria-label":"Duplicate",className:"block!",children:e.jsx(xe.default,{size:16})}),re(t,n),V(t,n)]}),ne(t,n)]},t),ne=(t,n)=>{if(typeof n!="object"||n.type!=="array")return null;const l=n.items,y=!Array.isArray(l)&&typeof l=="object"&&typeof l.type=="string"?l?.type:"string";return e.jsxs("div",{className:"col-span-full flex items-center gap-4 pl-8 mt-2 bg-gray-50 p-2 rounded-md",children:[e.jsx(L.Label,{children:"Items of type:"}),e.jsxs(r.Select,{value:y,onValueChange:$=>{const S={...typeof l=="object"?l:{},type:$};$==="object"&&(S.properties=S.properties??{}),o(t,{items:S})},children:[e.jsx(r.SelectTrigger,{className:"w-[200px]","aria-label":"Select items of type",children:e.jsx(r.SelectValue,{})}),e.jsxs(r.SelectContent,{children:[e.jsx(r.SelectItem,{value:"string",children:"string"}),e.jsx(r.SelectItem,{value:"number",children:"number"}),e.jsx(r.SelectItem,{value:"integer",children:"integer"}),e.jsx(r.SelectItem,{value:"boolean",children:"boolean"}),e.jsx(r.SelectItem,{value:"object",children:"object"}),e.jsx(r.SelectItem,{value:"array",children:"array"}),e.jsx(r.SelectItem,{value:"null",children:"null"})]})]}),V(t,l)]})},re=(t,n)=>{if(typeof n!="object")return null;const l=J(typeof n.type=="string"?n.type:""),y=Array.isArray(n?.enum);return l.length||y?e.jsx(u.Button,{variant:"outline",size:"sm",onClick:()=>X(t,n),"aria-label":"Edit constraints",children:e.jsx(ge.default,{size:16})}):null},V=(t,n)=>!Array.isArray(n)&&typeof n=="object"&&n?.type==="object"?e.jsxs(u.Button,{variant:"outline",size:"sm",onClick:()=>w(t),"aria-label":"Navigate",children:[e.jsx("span",{className:"sr-only",children:"Navigate"}),e.jsx(be.default,{size:16})]}):null,le=()=>{const t=i.navigationComponent;return t?e.jsx(t,{currentPath:c,onNavigateUp:T,onNavigateTo:h,isRootPath:c.length===0}):e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(u.Button,{variant:"outline",size:"sm",onClick:T,disabled:c.length===0,className:D.cn(i.backButtonClassName),children:"Back"}),e.jsx(d.Breadcrumb,{children:e.jsxs(d.BreadcrumbList,{children:[e.jsx(d.BreadcrumbItem,{children:e.jsx(d.BreadcrumbLink,{href:"#",onClick:()=>h([]),children:"Root"})}),c.map((n,l)=>e.jsxs(s.Fragment,{children:[e.jsx(d.BreadcrumbSeparator,{}),e.jsx(d.BreadcrumbItem,{children:e.jsx(d.BreadcrumbLink,{href:"#",onClick:()=>h(c.slice(0,l+1)),children:n})})]},`path-${l}`))]})})]})},ie=()=>{const t=i.addPropertyButtonComponent;return t?e.jsx(t,{onClick:()=>m(!0)}):e.jsxs(u.Button,{type:"button",className:D.cn("self-center",i.addPropertyButtonClassName),onClick:()=>{m(!0)},children:[e.jsx(me.default,{className:"h-4 w-4 mr-2"}),"Add Property"]})};return e.jsxs("div",{children:[g&&e.jsxs(p.Alert,{variant:"destructive",children:[e.jsx(p.AlertTitle,{children:"Schema Error"}),e.jsx(p.AlertDescription,{children:g})]}),le(),e.jsx("div",{className:D.cn("mt-6 overflow-x-hidden",i.propertiesListClassName),children:Object.entries(W.properties??{}).map(([t,n])=>typeof n=="boolean"?null:te(t,n))}),ie(),e.jsx(he.AddPropertyDialog,{open:k,onOpenChange:m,onSubmit:ee}),A&&N&&e.jsx(oe.EditPropertyDialog,{propertyKey:A,property:N,open:F,onOpenChange:f,onSubmit:t=>{o(...t),P(void 0),q(void 0),f(!1)}}),e.jsx(a.AlertDialog,{open:U,onOpenChange:j,children:e.jsxs(a.AlertDialogContent,{children:[e.jsxs(a.AlertDialogHeader,{children:[e.jsx(a.AlertDialogTitle,{children:"Are you sure?"}),e.jsxs(a.AlertDialogDescription,{children:["This action cannot be undone. This will permanently delete the property",x?` "${x}"`:""," from the schema."]})]}),e.jsxs(a.AlertDialogFooter,{children:[e.jsx(a.AlertDialogCancel,{onClick:Z,children:"Cancel"}),e.jsx(a.AlertDialogAction,{onClick:Y,children:"Delete"})]})]})})]})};exports.SchemaBuilder=fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),ie=require("./index.cjs2.js"),u=require("./index.cjs11.js"),d=require("./index.cjs12.js"),se=require("./index.cjs13.js"),r=require("./index.cjs14.js"),$=require("./index.cjs15.js"),ae=require("./index.cjs10.js"),L=require("./index.cjs4.js"),oe=require("./index.cjs16.js"),a=require("./index.cjs17.js"),S=require("./index.cjs18.js"),ce=require("./index.cjs19.js"),de=require("ajv"),p=require("./index.cjs20.js"),ue=require("./index.cjs21.js"),C=require("./index.cjs22.js"),he=require("./index.cjs23.js"),me=require("./index.cjs24.js"),je=require("./index.cjs25.js"),xe=require("./index.cjs26.js"),ge=require("./index.cjs27.js"),be=i=>{const[O,m]=s.useState(!1),[k,b]=s.useState(!1),[F,j]=s.useState(!1),[x,f]=s.useState(),[D,A]=s.useState(),[P,N]=s.useState(),[q,g]=s.useState(null);L.usePluginSystem(i.plugins??[]);const{getCurrentSchema:U,setPath:h,path:o,handleAddProperty:Q,handlePropertyChange:c,handleKeyChange:B,handleDeleteProperty:H,setSchema:M,isPropertyRequired:I,handleDuplicateProperty:_}=ie.useSchema({onSchemaChange:i.onSchemaChange}),{getConstraintDefinitionsForType:G}=L.useConstraints();s.useEffect(()=>{if(i.initialSchema)try{ce.validateSchema(i.initialSchema),M(ae.a(i.initialSchema)),g(null)}catch(t){t instanceof Error?g(t.message):t instanceof de.ValidationError?g(`Schema validation error: ${t.message}`):g("Unknown schema validation error")}},[i.initialSchema]);const J=U(),E=t=>{h([...o,t])},w=()=>{h(o.slice(0,-1))},W=(t,n)=>{A(t),N(n),b(!0)},T=t=>{f(t),j(!0)},X=()=>{x&&(H(x),f(void 0)),j(!1)},Y=()=>{f(void 0),j(!1)},R=t=>{const n=_(t);n?.status==="error"?i.onPropertyAddError?.(n):n?.status==="success"&&i.onPropertyAddSuccess?.(n)},Z=(...t)=>{const n=Q(...t);n.status==="error"?i.onPropertyAddError?.(n):n.status==="success"&&i.onPropertyAddSuccess?.(n),m(!1)},z=i.propertyComponent,ee=(t,n)=>z?e.jsx(z,{property:{key:t,schema:n,isRequired:I(t)},onPropertyChange:c,onKeyChange:B,onDelete:T,onDuplicate:R,onNavigate:n.type==="object"||n.type==="array"&&typeof n.items=="object"&&n.items.type==="object"?E:void 0},t):e.jsxs("div",{className:"flex flex-col md:grid grid-cols-(--my-autofit-grid) gap-4 md:items-center border p-2 rounded-md mb-2",children:[e.jsx("div",{className:"",children:e.jsx(p.DebouncedInput,{value:t,onDebounce:l=>B(t,l),placeholder:"Property Key","aria-label":`Property key for ${t}`,delay:500})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se.Switch,{checked:I(t),onCheckedChange:l=>c(t,{isRequired:l}),"aria-label":"Required"}),e.jsx($.Label,{htmlFor:`required-${t}`,children:"Required"})]}),e.jsx("div",{className:"",children:e.jsxs(r.Select,{value:typeof n=="object"&&!Array.isArray(n.type)?n.type:void 0,onValueChange:l=>c(t,{type:l}),"aria-label":"Type",children:[e.jsx(r.SelectTrigger,{className:"w-full","aria-label":"Select type",children:e.jsx(r.SelectValue,{})}),e.jsxs(r.SelectContent,{children:[e.jsx(r.SelectItem,{value:"string",children:"string"}),e.jsx(r.SelectItem,{value:"number",children:"number"}),e.jsx(r.SelectItem,{value:"integer",children:"integer"}),e.jsx(r.SelectItem,{value:"boolean",children:"boolean"}),e.jsx(r.SelectItem,{value:"object",children:"object"}),e.jsx(r.SelectItem,{value:"array",children:"array"}),e.jsx(r.SelectItem,{value:"null",children:"null"}),e.jsx(r.SelectItem,{value:"enum",children:"enum"})]})]})}),e.jsx("div",{className:"",children:e.jsx(p.DebouncedInput,{value:typeof n=="object"?n.title:void 0,onDebounce:l=>c(t,{title:l}),placeholder:"Title"})}),e.jsx("div",{className:"",children:e.jsx(p.DebouncedInput,{value:typeof n=="object"?n.description:void 0,onDebounce:l=>c(t,{description:l}),placeholder:"Description"})}),e.jsxs("div",{className:"order-last md:order-none flex gap-2",children:[e.jsx(u.Button,{variant:"outline",size:"sm",onClick:()=>T(t),"aria-label":"Delete",className:"block!",children:e.jsx(me.default,{size:16,className:"text-destructive"})}),e.jsx(u.Button,{variant:"outline",size:"sm",onClick:()=>R(t),"aria-label":"Duplicate",className:"block!",children:e.jsx(je.default,{size:16})}),ne(t,n),K(t,n)]}),te(t,n)]},t),te=(t,n)=>{if(typeof n!="object"||n.type!=="array")return null;const l=n.items,v=!Array.isArray(l)&&typeof l=="object"&&typeof l.type=="string"?l?.type:"string";return e.jsxs("div",{className:"col-span-full flex items-center gap-4 pl-8 mt-2 bg-gray-50 p-2 rounded-md",children:[e.jsx($.Label,{children:"Items of type:"}),e.jsxs(r.Select,{value:v,onValueChange:V=>{const y={...typeof l=="object"?l:{},type:V};V==="object"&&(y.properties=y.properties??{}),c(t,{items:y})},children:[e.jsx(r.SelectTrigger,{className:"w-[200px]","aria-label":"Select items of type",children:e.jsx(r.SelectValue,{})}),e.jsxs(r.SelectContent,{children:[e.jsx(r.SelectItem,{value:"string",children:"string"}),e.jsx(r.SelectItem,{value:"number",children:"number"}),e.jsx(r.SelectItem,{value:"integer",children:"integer"}),e.jsx(r.SelectItem,{value:"boolean",children:"boolean"}),e.jsx(r.SelectItem,{value:"object",children:"object"}),e.jsx(r.SelectItem,{value:"array",children:"array"}),e.jsx(r.SelectItem,{value:"null",children:"null"})]})]}),K(t,l)]})},ne=(t,n)=>{if(typeof n!="object")return null;const l=G(typeof n.type=="string"?n.type:""),v=Array.isArray(n?.enum);return l.length||v?e.jsx(u.Button,{variant:"outline",size:"sm",onClick:()=>W(t,n),"aria-label":"Edit constraints",children:e.jsx(xe.default,{size:16})}):null},K=(t,n)=>!Array.isArray(n)&&typeof n=="object"&&n?.type==="object"?e.jsxs(u.Button,{variant:"outline",size:"sm",onClick:()=>E(t),"aria-label":"Navigate",children:[e.jsx("span",{className:"sr-only",children:"Navigate"}),e.jsx(ge.default,{size:16})]}):null,re=()=>{const t=i.navigationComponent;return t?e.jsx(t,{currentPath:o,onNavigateUp:w,onNavigateTo:h,isRootPath:o.length===0}):e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(u.Button,{variant:"outline",size:"sm",onClick:w,disabled:o.length===0,className:C.cn(i.backButtonClassName),children:"Back"}),e.jsx(d.Breadcrumb,{children:e.jsxs(d.BreadcrumbList,{children:[e.jsx(d.BreadcrumbItem,{children:e.jsx(d.BreadcrumbLink,{href:"#",onClick:()=>h([]),children:"Root"})}),o.map((n,l)=>e.jsxs(s.Fragment,{children:[e.jsx(d.BreadcrumbSeparator,{}),e.jsx(d.BreadcrumbItem,{children:e.jsx(d.BreadcrumbLink,{href:"#",onClick:()=>h(o.slice(0,l+1)),children:n})})]},`path-${l}`))]})})]})},le=()=>{const t=i.addPropertyButtonComponent;return t?e.jsx(t,{onClick:()=>m(!0)}):e.jsxs(u.Button,{type:"button",className:C.cn("self-center",i.addPropertyButtonClassName),onClick:()=>{m(!0)},children:[e.jsx(he.default,{className:"h-4 w-4 mr-2"}),"Add Property"]})};return e.jsxs("div",{children:[q&&e.jsxs(S.Alert,{variant:"destructive",children:[e.jsx(S.AlertTitle,{children:"Schema Error"}),e.jsx(S.AlertDescription,{children:q})]}),re(),e.jsx("div",{className:C.cn("mt-6 overflow-x-hidden",i.propertiesListClassName),children:Object.entries(J.properties??{}).map(([t,n])=>typeof n=="boolean"?null:ee(t,n))}),le(),e.jsx(ue.AddPropertyDialog,{open:O,onOpenChange:m,onSubmit:Z}),D&&P&&e.jsx(oe.EditPropertyDialog,{propertyKey:D,property:P,open:k,onOpenChange:b,onSubmit:t=>{c(...t),A(void 0),N(void 0),b(!1)}}),e.jsx(a.AlertDialog,{open:F,onOpenChange:j,children:e.jsxs(a.AlertDialogContent,{children:[e.jsxs(a.AlertDialogHeader,{children:[e.jsx(a.AlertDialogTitle,{children:"Are you sure?"}),e.jsxs(a.AlertDialogDescription,{children:["This action cannot be undone. This will permanently delete the property",x?` "${x}"`:""," from the schema."]})]}),e.jsxs(a.AlertDialogFooter,{children:[e.jsx(a.AlertDialogCancel,{onClick:Y,children:"Cancel"}),e.jsx(a.AlertDialogAction,{onClick:X,children:"Delete"})]})]})})]})};exports.SchemaBuilder=be;
2
2
  //# sourceMappingURL=index.cjs3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs3.js","sources":["../src/packages/builder/schema-builder.tsx"],"sourcesContent":["import { useEffect, useState, Fragment } from \"react\";\nimport { PropertyAddError, PropertyAddSuccess, useSchema } from \"./context\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { Switch } from \"@/components/ui/switch\";\nimport { Bolt, ChevronRight, Copy, Plus, Trash2 } from \"lucide-react\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select\";\nimport { Label } from \"@/components/ui/label\";\nimport type { JSONSchema7 } from \"json-schema\";\nimport { clone } from \"remeda\";\nimport {\n BaseJSONSchemaPlugin,\n useConstraints,\n usePluginSystem,\n} from \"@/packages/constraints/context\";\nimport { EditPropertyDialog } from \"./edit-dialog\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"@/components/ui/alert-dialog\";\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\";\nimport { validateSchema } from \"./utils\";\nimport Ajv from \"ajv\";\nimport { DebouncedInput } from \"@/components/depounced-input\";\nimport { AddPropertyDialog, type AddPropertyDialogProps } from \"./add-dialog\";\nimport { cn } from \"@/lib/utils\";\n\n// PropertyComponent type definition for custom property components\nexport interface PropertyComponentProps {\n property: {\n key: string;\n schema: JSONSchema7;\n isRequired: boolean;\n };\n onPropertyChange: (key: string, changes: Partial<JSONSchema7>) => void;\n onKeyChange: (oldKey: string, newKey: string) => void;\n onDelete: (key: string) => void;\n onDuplicate?: (key: string) => void;\n onNavigate?: (key: string) => void;\n}\n\n// NavigationProps for custom navigation component\nexport interface NavigationProps {\n currentPath: string[];\n onNavigateUp: () => void;\n onNavigateTo: (newPath: string[]) => void;\n isRootPath: boolean;\n}\n\n// AddPropertyButtonProps for custom add property button\nexport interface AddPropertyButtonProps {\n onClick: () => void;\n}\n\ninterface SchemaBuilderProps {\n /** The schema to edit */\n initialSchema?: JSONSchema7;\n /** Constraint plugins to use */\n plugins?: BaseJSONSchemaPlugin[];\n /** Custom component to render properties */\n propertyComponent?: React.ComponentType<PropertyComponentProps>;\n /** Called when the schema changes */\n onSchemaChange?: (schema: JSONSchema7) => void;\n /** Called when a property is successfully added */\n onPropertyAddSuccess?: (props: PropertyAddSuccess) => void;\n /** Called when there's an error adding a property */\n onPropertyAddError?: (props: PropertyAddError) => void;\n /** Called when there's an error changing a property */\n onPropertyChangeError?: (prop: Error) => void;\n /** Called when a property is successfully changed */\n onPropertyChangeSuccess?: () => void;\n /** Class name for the navigation bar back button */\n backButtonClassName?: string;\n /** Class name for the properties list container */\n propertiesListClassName?: string;\n /** Class name for the add property button */\n addPropertyButtonClassName?: string;\n /** Custom navigation component */\n navigationComponent?: React.ComponentType<NavigationProps>;\n /** Custom add property button component */\n addPropertyButtonComponent?: React.ComponentType<AddPropertyButtonProps>;\n}\n\nexport const SchemaBuilder = (props: SchemaBuilderProps) => {\n // State\n const [showPropertyDialog, setShowPropertyDialog] = useState(false);\n const [showEditDialog, setShowEditDialog] = useState(false);\n const [showDeleteDialog, setShowDeleteDialog] = useState(false);\n const [deleteKey, setDeleteKey] = useState<string | undefined>();\n const [editingKey, setEditingKey] = useState<string | undefined>();\n const [editingProperty, setEditingProperty] = useState<\n JSONSchema7 | undefined\n >();\n const [schemaValidationError, setSchemaValidationError] = useState<\n string | null\n >(null);\n\n // Initialize the plugin system\n usePluginSystem(props.plugins ?? []);\n\n // Get schema context\n const {\n getCurrentSchema,\n setPath,\n path,\n schema,\n handleAddProperty,\n handlePropertyChange,\n handleKeyChange,\n handleDeleteProperty,\n setSchema,\n isPropertyRequired,\n handleDuplicateProperty,\n } = useSchema();\n\n // Get constraints context\n const { getConstraintDefinitionsForType } = useConstraints();\n\n // Set schema from props\n useEffect(() => {\n if (props.initialSchema) {\n try {\n // Validate the schema before setting it\n validateSchema(props.initialSchema);\n setSchema(clone(props.initialSchema));\n setSchemaValidationError(null);\n } catch (error) {\n if (error instanceof Error) {\n setSchemaValidationError(error.message);\n } else if (error instanceof Ajv.ValidationError) {\n setSchemaValidationError(`Schema validation error: ${error.message}`);\n } else {\n setSchemaValidationError(\"Unknown schema validation error\");\n }\n }\n }\n }, [props.initialSchema]);\n\n // Notify schema changes\n useEffect(() => {\n if (!schemaValidationError && props.onSchemaChange) {\n props.onSchemaChange(schema);\n }\n }, [schema, schemaValidationError, props.onSchemaChange]);\n\n const currentSchema = getCurrentSchema();\n\n // Navigation handlers\n const handleNavigateToProperty = (name: string) => {\n setPath([...path, name]);\n };\n\n const handleNavigateUp = () => {\n setPath(path.slice(0, -1));\n };\n\n // Property management handlers\n const handleEditProperty = (key: string, property: JSONSchema7) => {\n setEditingKey(key);\n setEditingProperty(property);\n setShowEditDialog(true);\n };\n\n const handleInitiateDelete = (key: string) => {\n setDeleteKey(key);\n setShowDeleteDialog(true);\n };\n\n const handleConfirmDelete = () => {\n if (deleteKey) {\n handleDeleteProperty(deleteKey);\n setDeleteKey(undefined);\n }\n setShowDeleteDialog(false);\n };\n\n const handleCancelDelete = () => {\n setDeleteKey(undefined);\n setShowDeleteDialog(false);\n };\n\n const handleDuplicate = (key: string) => {\n const result = handleDuplicateProperty(key);\n\n // Notify if needed\n if (result?.status === \"error\") {\n props.onPropertyAddError?.(result);\n } else if (result?.status === \"success\") {\n props.onPropertyAddSuccess?.(result);\n }\n };\n\n const onAddProperty: AddPropertyDialogProps[\"onSubmit\"] = (...vals) => {\n const result = handleAddProperty(...vals);\n\n if (result.status === \"error\") {\n props.onPropertyAddError?.(result);\n } else if (result.status === \"success\") {\n props.onPropertyAddSuccess?.(result);\n }\n setShowPropertyDialog(false);\n };\n\n // Custom property component or default renderer\n const PropertyComponent = props.propertyComponent;\n\n const renderProperty = (key: string, property: JSONSchema7) => {\n if (PropertyComponent) {\n return (\n <PropertyComponent\n key={key}\n property={{\n key,\n schema: property,\n isRequired: isPropertyRequired(key),\n }}\n onPropertyChange={handlePropertyChange}\n onKeyChange={handleKeyChange}\n onDelete={handleInitiateDelete}\n onDuplicate={handleDuplicate}\n onNavigate={\n property.type === \"object\" ||\n (property.type === \"array\" &&\n typeof property.items === \"object\" &&\n (property.items as JSONSchema7).type === \"object\")\n ? handleNavigateToProperty\n : undefined\n }\n />\n );\n }\n\n // Default property renderer\n return (\n <div\n key={key}\n className=\"flex flex-col md:grid grid-cols-(--my-autofit-grid) gap-4 md:items-center border p-2 rounded-md mb-2\"\n >\n <div className=\"\">\n <DebouncedInput\n value={key}\n onDebounce={(newVal) => handleKeyChange(key, newVal)}\n placeholder=\"Property Key\"\n aria-label={`Property key for ${key}`}\n delay={500}\n />\n </div>\n\n <div className=\"flex items-center gap-2\">\n <Switch\n checked={isPropertyRequired(key)}\n onCheckedChange={(checked) =>\n handlePropertyChange(key, { isRequired: checked })\n }\n aria-label=\"Required\"\n />\n <Label htmlFor={`required-${key}`}>Required</Label>\n </div>\n\n <div className=\"\">\n <Select\n value={\n typeof property === \"object\" && !Array.isArray(property.type)\n ? property.type\n : undefined\n }\n onValueChange={(value) =>\n handlePropertyChange(key, {\n type: value as JSONSchema7[\"type\"],\n })\n }\n aria-label=\"Type\"\n >\n <SelectTrigger className=\"w-full\" aria-label=\"Select type\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={\"string\" satisfies JSONSchema7[\"type\"]}>\n string\n </SelectItem>\n <SelectItem value={\"number\" satisfies JSONSchema7[\"type\"]}>\n number\n </SelectItem>\n <SelectItem value={\"integer\" satisfies JSONSchema7[\"type\"]}>\n integer\n </SelectItem>\n <SelectItem value={\"boolean\" satisfies JSONSchema7[\"type\"]}>\n boolean\n </SelectItem>\n <SelectItem value={\"object\" satisfies JSONSchema7[\"type\"]}>\n object\n </SelectItem>\n <SelectItem value={\"array\" satisfies JSONSchema7[\"type\"]}>\n array\n </SelectItem>\n <SelectItem value={\"null\" satisfies JSONSchema7[\"type\"]}>\n null\n </SelectItem>\n <SelectItem value={\"enum\"}>enum</SelectItem>\n </SelectContent>\n </Select>\n </div>\n\n <div className=\"\">\n <DebouncedInput\n value={typeof property === \"object\" ? property.title : undefined}\n onDebounce={(newVal) =>\n handlePropertyChange(key, { title: newVal })\n }\n placeholder=\"Title\"\n />\n </div>\n\n <div className=\"\">\n <DebouncedInput\n value={\n typeof property === \"object\" ? property.description : undefined\n }\n onDebounce={(newVal) =>\n handlePropertyChange(key, { description: newVal })\n }\n placeholder=\"Description\"\n />\n </div>\n\n <div className=\"order-last md:order-none flex gap-2\">\n {/* Delete button */}\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleInitiateDelete(key)}\n aria-label=\"Delete\"\n className=\"block!\"\n >\n <Trash2 size={16} className=\"text-destructive\" />\n </Button>\n\n {/* Duplicate button */}\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleDuplicate(key)}\n aria-label=\"Duplicate\"\n className=\"block!\"\n >\n <Copy size={16} />\n </Button>\n\n {/* Edit button if applicable */}\n {renderEditButton(key, property)}\n\n {/* Navigate button for objects/array items */}\n {renderNavigateButton(key, property)}\n </div>\n\n {/* Render array items configuration if needed */}\n {renderArrayItemsConfig(key, property)}\n </div>\n );\n };\n\n // Helper to render array items configuration\n const renderArrayItemsConfig = (key: string, property: JSONSchema7) => {\n if (typeof property !== \"object\" || property.type !== \"array\") {\n return null;\n }\n\n const items = property.items;\n const itemType =\n !Array.isArray(items) &&\n typeof items === \"object\" &&\n typeof items.type === \"string\"\n ? items?.type\n : \"string\";\n\n return (\n <div className=\"col-span-full flex items-center gap-4 pl-8 mt-2 bg-gray-50 p-2 rounded-md\">\n <Label>Items of type:</Label>\n <Select\n value={itemType as string}\n onValueChange={(value) => {\n const newItems: JSONSchema7 = {\n ...(typeof items === \"object\" ? items : {}),\n type: value as JSONSchema7[\"type\"],\n };\n\n if (value === \"object\") {\n // Initialize empty properties for object type\n newItems.properties = newItems.properties ?? {};\n }\n\n handlePropertyChange(key, { items: newItems });\n }}\n >\n <SelectTrigger\n className=\"w-[200px]\"\n aria-label=\"Select items of type\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={\"string\" satisfies JSONSchema7[\"type\"]}>\n string\n </SelectItem>\n <SelectItem value={\"number\" satisfies JSONSchema7[\"type\"]}>\n number\n </SelectItem>\n <SelectItem value={\"integer\" satisfies JSONSchema7[\"type\"]}>\n integer\n </SelectItem>\n <SelectItem value={\"boolean\" satisfies JSONSchema7[\"type\"]}>\n boolean\n </SelectItem>\n <SelectItem value={\"object\" satisfies JSONSchema7[\"type\"]}>\n object\n </SelectItem>\n <SelectItem value={\"array\" satisfies JSONSchema7[\"type\"]}>\n array\n </SelectItem>\n <SelectItem value={\"null\" satisfies JSONSchema7[\"type\"]}>\n null\n </SelectItem>\n </SelectContent>\n </Select>\n\n {/* Configure object button for array items of type object */}\n {renderNavigateButton(key, items)}\n </div>\n );\n };\n\n // Helper to render the edit constraint button when needed\n const renderEditButton = (key: string, property: JSONSchema7) => {\n if (typeof property !== \"object\") return null;\n\n // Check for constraints\n const availableConstraints = getConstraintDefinitionsForType(\n typeof property.type === \"string\" ? property.type : \"\",\n );\n\n // Check for enum\n const hasEnum = Array.isArray(property?.enum);\n\n if (availableConstraints.length || hasEnum) {\n return (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleEditProperty(key, property)}\n aria-label=\"Edit constraints\"\n >\n <Bolt size={16} />\n </Button>\n );\n }\n\n return null;\n };\n\n const renderNavigateButton = (key: string, items: JSONSchema7[\"items\"]) => {\n if (\n !Array.isArray(items) &&\n typeof items === \"object\" &&\n items?.type === \"object\"\n ) {\n return (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleNavigateToProperty(key)}\n aria-label=\"Navigate\"\n >\n <span className=\"sr-only\">Navigate</span>\n <ChevronRight size={16} />\n </Button>\n );\n }\n\n return null;\n };\n\n // Render navigation component\n const renderNavigation = () => {\n const NavigationComponent = props.navigationComponent;\n\n if (NavigationComponent) {\n return (\n <NavigationComponent\n currentPath={path}\n onNavigateUp={handleNavigateUp}\n onNavigateTo={setPath}\n isRootPath={path.length === 0}\n />\n );\n }\n\n return (\n <div className=\"flex items-center space-x-4\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleNavigateUp}\n disabled={path.length === 0}\n className={cn(props.backButtonClassName)}\n >\n Back\n </Button>\n <Breadcrumb>\n <BreadcrumbList>\n <BreadcrumbItem>\n <BreadcrumbLink href=\"#\" onClick={() => setPath([])}>\n Root\n </BreadcrumbLink>\n </BreadcrumbItem>\n {path.map((item, index) => (\n <Fragment key={`path-${index}`}>\n <BreadcrumbSeparator />\n <BreadcrumbItem>\n <BreadcrumbLink\n href=\"#\"\n onClick={() => setPath(path.slice(0, index + 1))}\n >\n {item}\n </BreadcrumbLink>\n </BreadcrumbItem>\n </Fragment>\n ))}\n </BreadcrumbList>\n </Breadcrumb>\n </div>\n );\n };\n\n // Render add property button\n const renderAddPropertyButton = () => {\n const AddPropertyButtonComponent = props.addPropertyButtonComponent;\n\n if (AddPropertyButtonComponent) {\n return (\n <AddPropertyButtonComponent\n onClick={() => setShowPropertyDialog(true)}\n />\n );\n }\n\n return (\n <Button\n type=\"button\"\n className={cn(\"self-center\", props.addPropertyButtonClassName)}\n onClick={() => {\n setShowPropertyDialog(true);\n }}\n >\n <Plus className=\"h-4 w-4 mr-2\" />\n Add Property\n </Button>\n );\n };\n\n return (\n <div>\n {/* Schema validation error */}\n {schemaValidationError && (\n <Alert variant=\"destructive\">\n <AlertTitle>Schema Error</AlertTitle>\n <AlertDescription>{schemaValidationError}</AlertDescription>\n </Alert>\n )}\n\n {/* Navigation bar */}\n {renderNavigation()}\n\n {/* Properties list */}\n <div\n className={cn(\"mt-6 overflow-x-hidden\", props.propertiesListClassName)}\n >\n {Object.entries(currentSchema.properties ?? {}).map(\n ([key, property]) => {\n if (typeof property === \"boolean\") {\n // We don't support editing boolean properties\n return null;\n }\n\n return renderProperty(key, property);\n },\n )}\n </div>\n\n {/* Add property button */}\n {renderAddPropertyButton()}\n\n {/* Add property dialog */}\n <AddPropertyDialog\n open={showPropertyDialog}\n onOpenChange={setShowPropertyDialog}\n onSubmit={onAddProperty}\n />\n\n {/* Edit property dialog */}\n {editingKey && editingProperty && (\n <EditPropertyDialog\n propertyKey={editingKey}\n property={editingProperty}\n open={showEditDialog}\n onOpenChange={setShowEditDialog}\n onSubmit={(params) => {\n handlePropertyChange(...params);\n setEditingKey(undefined);\n setEditingProperty(undefined);\n setShowEditDialog(false);\n }}\n />\n )}\n\n {/* Delete confirmation dialog */}\n <AlertDialog open={showDeleteDialog} onOpenChange={setShowDeleteDialog}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. This will permanently delete the\n property\n {deleteKey ? ` \"${deleteKey}\"` : \"\"} from the schema.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={handleCancelDelete}>\n Cancel\n </AlertDialogCancel>\n <AlertDialogAction onClick={handleConfirmDelete}>\n Delete\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"names":["SchemaBuilder","props","showPropertyDialog","setShowPropertyDialog","useState","showEditDialog","setShowEditDialog","showDeleteDialog","setShowDeleteDialog","deleteKey","setDeleteKey","editingKey","setEditingKey","editingProperty","setEditingProperty","schemaValidationError","setSchemaValidationError","usePluginSystem","getCurrentSchema","setPath","path","schema","handleAddProperty","handlePropertyChange","handleKeyChange","handleDeleteProperty","setSchema","isPropertyRequired","handleDuplicateProperty","useSchema","getConstraintDefinitionsForType","useConstraints","useEffect","validateSchema","clone","error","Ajv","currentSchema","handleNavigateToProperty","name","handleNavigateUp","handleEditProperty","key","property","handleInitiateDelete","handleConfirmDelete","handleCancelDelete","handleDuplicate","result","onAddProperty","vals","PropertyComponent","renderProperty","jsx","jsxs","DebouncedInput","newVal","Switch","checked","Label","Select","value","SelectTrigger","SelectValue","SelectContent","SelectItem","Button","Trash2","Copy","renderEditButton","renderNavigateButton","renderArrayItemsConfig","items","itemType","newItems","availableConstraints","hasEnum","Bolt","ChevronRight","renderNavigation","NavigationComponent","cn","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","item","index","Fragment","BreadcrumbSeparator","renderAddPropertyButton","AddPropertyButtonComponent","Plus","Alert","AlertTitle","AlertDescription","AddPropertyDialog","EditPropertyDialog","params","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction"],"mappings":"2vBAqGaA,GAAiBC,GAA8B,CAE1D,KAAM,CAACC,EAAoBC,CAAqB,EAAIC,EAAAA,SAAS,EAAK,EAC5D,CAACC,EAAgBC,CAAiB,EAAIF,EAAAA,SAAS,EAAK,EACpD,CAACG,EAAkBC,CAAmB,EAAIJ,EAAAA,SAAS,EAAK,EACxD,CAACK,EAAWC,CAAY,EAAIN,WAA6B,EACzD,CAACO,EAAYC,CAAa,EAAIR,WAA6B,EAC3D,CAACS,EAAiBC,CAAkB,EAAIV,WAE5C,EACI,CAACW,EAAuBC,CAAwB,EAAIZ,EAAAA,SAExD,IAAI,EAGUa,kBAAAhB,EAAM,SAAW,EAAE,EAG7B,KAAA,CAC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YAAA,CAAA,KAAM5F,EAAkB,aAAcC,EACjD,gBAAC4F,EACC,mBAAA,CAAA,SAAA,CAAA9C,OAAC+C,EAAAA,kBACC,CAAA,SAAA,CAAAhD,EAAAA,IAACiD,oBAAiB,SAAa,eAAA,CAAA,SAC9BC,EAAAA,uBAAuB,CAAA,SAAA,CAAA,0EAGrB9F,EAAY,KAAKA,CAAS,IAAM,GAAG,mBAAA,CACtC,CAAA,CAAA,EACF,SACC+F,EAAAA,kBACC,CAAA,SAAA,CAACnD,EAAA,IAAAoD,EAAA,kBAAA,CAAkB,QAAS3D,EAAoB,SAEhD,SAAA,EACCO,EAAA,IAAAqD,EAAA,kBAAA,CAAkB,QAAS7D,EAAqB,SAEjD,QAAA,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CACF,CACF,CAAA,CAAA,EACF,CAEJ"}
1
+ {"version":3,"file":"index.cjs3.js","sources":["../src/packages/builder/schema-builder.tsx"],"sourcesContent":["import { useEffect, useState, Fragment } from \"react\";\nimport { PropertyAddError, PropertyAddSuccess, useSchema } from \"./context\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbSeparator,\n} from \"@/components/ui/breadcrumb\";\nimport { Switch } from \"@/components/ui/switch\";\nimport { Bolt, ChevronRight, Copy, Plus, Trash2 } from \"lucide-react\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select\";\nimport { Label } from \"@/components/ui/label\";\nimport type { JSONSchema7 } from \"json-schema\";\nimport { clone } from \"remeda\";\nimport {\n BaseJSONSchemaPlugin,\n useConstraints,\n usePluginSystem,\n} from \"@/packages/constraints/context\";\nimport { EditPropertyDialog } from \"./edit-dialog\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"@/components/ui/alert-dialog\";\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\";\nimport { validateSchema } from \"./utils\";\nimport Ajv from \"ajv\";\nimport { DebouncedInput } from \"@/components/depounced-input\";\nimport { AddPropertyDialog, type AddPropertyDialogProps } from \"./add-dialog\";\nimport { cn } from \"@/lib/utils\";\n\n// PropertyComponent type definition for custom property components\nexport interface PropertyComponentProps {\n property: {\n key: string;\n schema: JSONSchema7;\n isRequired: boolean;\n };\n onPropertyChange: (key: string, changes: Partial<JSONSchema7>) => void;\n onKeyChange: (oldKey: string, newKey: string) => void;\n onDelete: (key: string) => void;\n onDuplicate?: (key: string) => void;\n onNavigate?: (key: string) => void;\n}\n\n// NavigationProps for custom navigation component\nexport interface NavigationProps {\n currentPath: string[];\n onNavigateUp: () => void;\n onNavigateTo: (newPath: string[]) => void;\n isRootPath: boolean;\n}\n\n// AddPropertyButtonProps for custom add property button\nexport interface AddPropertyButtonProps {\n onClick: () => void;\n}\n\ninterface SchemaBuilderProps {\n /** The schema to edit */\n initialSchema?: JSONSchema7;\n /** Constraint plugins to use */\n plugins?: BaseJSONSchemaPlugin[];\n /** Custom component to render properties */\n propertyComponent?: React.ComponentType<PropertyComponentProps>;\n /** Called when the schema changes */\n onSchemaChange?: (schema: JSONSchema7) => void;\n /** Called when a property is successfully added */\n onPropertyAddSuccess?: (props: PropertyAddSuccess) => void;\n /** Called when there's an error adding a property */\n onPropertyAddError?: (props: PropertyAddError) => void;\n /** Called when there's an error changing a property */\n onPropertyChangeError?: (prop: Error) => void;\n /** Called when a property is successfully changed */\n onPropertyChangeSuccess?: () => void;\n /** Class name for the navigation bar back button */\n backButtonClassName?: string;\n /** Class name for the properties list container */\n propertiesListClassName?: string;\n /** Class name for the add property button */\n addPropertyButtonClassName?: string;\n /** Custom navigation component */\n navigationComponent?: React.ComponentType<NavigationProps>;\n /** Custom add property button component */\n addPropertyButtonComponent?: React.ComponentType<AddPropertyButtonProps>;\n}\n\nexport const SchemaBuilder = (props: SchemaBuilderProps) => {\n // State\n const [showPropertyDialog, setShowPropertyDialog] = useState(false);\n const [showEditDialog, setShowEditDialog] = useState(false);\n const [showDeleteDialog, setShowDeleteDialog] = useState(false);\n const [deleteKey, setDeleteKey] = useState<string | undefined>();\n const [editingKey, setEditingKey] = useState<string | undefined>();\n const [editingProperty, setEditingProperty] = useState<\n JSONSchema7 | undefined\n >();\n const [schemaValidationError, setSchemaValidationError] = useState<\n string | null\n >(null);\n\n // Initialize the plugin system\n usePluginSystem(props.plugins ?? []);\n\n // Get schema context\n const {\n getCurrentSchema,\n setPath,\n path,\n handleAddProperty,\n handlePropertyChange,\n handleKeyChange,\n handleDeleteProperty,\n setSchema,\n isPropertyRequired,\n handleDuplicateProperty,\n } = useSchema({ onSchemaChange: props.onSchemaChange });\n\n // Get constraints context\n const { getConstraintDefinitionsForType } = useConstraints();\n\n // Set schema from props\n useEffect(() => {\n if (props.initialSchema) {\n try {\n // Validate the schema before setting it\n validateSchema(props.initialSchema);\n setSchema(clone(props.initialSchema));\n setSchemaValidationError(null);\n } catch (error) {\n if (error instanceof Error) {\n setSchemaValidationError(error.message);\n } else if (error instanceof Ajv.ValidationError) {\n setSchemaValidationError(`Schema validation error: ${error.message}`);\n } else {\n setSchemaValidationError(\"Unknown schema validation error\");\n }\n }\n }\n }, [props.initialSchema]);\n\n const currentSchema = getCurrentSchema();\n\n // Navigation handlers\n const handleNavigateToProperty = (name: string) => {\n setPath([...path, name]);\n };\n\n const handleNavigateUp = () => {\n setPath(path.slice(0, -1));\n };\n\n // Property management handlers\n const handleEditProperty = (key: string, property: JSONSchema7) => {\n setEditingKey(key);\n setEditingProperty(property);\n setShowEditDialog(true);\n };\n\n const handleInitiateDelete = (key: string) => {\n setDeleteKey(key);\n setShowDeleteDialog(true);\n };\n\n const handleConfirmDelete = () => {\n if (deleteKey) {\n handleDeleteProperty(deleteKey);\n setDeleteKey(undefined);\n }\n setShowDeleteDialog(false);\n };\n\n const handleCancelDelete = () => {\n setDeleteKey(undefined);\n setShowDeleteDialog(false);\n };\n\n const handleDuplicate = (key: string) => {\n const result = handleDuplicateProperty(key);\n\n // Notify if needed\n if (result?.status === \"error\") {\n props.onPropertyAddError?.(result);\n } else if (result?.status === \"success\") {\n props.onPropertyAddSuccess?.(result);\n }\n };\n\n const onAddProperty: AddPropertyDialogProps[\"onSubmit\"] = (...vals) => {\n const result = handleAddProperty(...vals);\n\n if (result.status === \"error\") {\n props.onPropertyAddError?.(result);\n } else if (result.status === \"success\") {\n props.onPropertyAddSuccess?.(result);\n }\n setShowPropertyDialog(false);\n };\n\n // Custom property component or default renderer\n const PropertyComponent = props.propertyComponent;\n\n const renderProperty = (key: string, property: JSONSchema7) => {\n if (PropertyComponent) {\n return (\n <PropertyComponent\n key={key}\n property={{\n key,\n schema: property,\n isRequired: isPropertyRequired(key),\n }}\n onPropertyChange={handlePropertyChange}\n onKeyChange={handleKeyChange}\n onDelete={handleInitiateDelete}\n onDuplicate={handleDuplicate}\n onNavigate={\n property.type === \"object\" ||\n (property.type === \"array\" &&\n typeof property.items === \"object\" &&\n (property.items as JSONSchema7).type === \"object\")\n ? handleNavigateToProperty\n : undefined\n }\n />\n );\n }\n\n // Default property renderer\n return (\n <div\n key={key}\n className=\"flex flex-col md:grid grid-cols-(--my-autofit-grid) gap-4 md:items-center border p-2 rounded-md mb-2\"\n >\n <div className=\"\">\n <DebouncedInput\n value={key}\n onDebounce={(newVal) => handleKeyChange(key, newVal)}\n placeholder=\"Property Key\"\n aria-label={`Property key for ${key}`}\n delay={500}\n />\n </div>\n\n <div className=\"flex items-center gap-2\">\n <Switch\n checked={isPropertyRequired(key)}\n onCheckedChange={(checked) =>\n handlePropertyChange(key, { isRequired: checked })\n }\n aria-label=\"Required\"\n />\n <Label htmlFor={`required-${key}`}>Required</Label>\n </div>\n\n <div className=\"\">\n <Select\n value={\n typeof property === \"object\" && !Array.isArray(property.type)\n ? property.type\n : undefined\n }\n onValueChange={(value) =>\n handlePropertyChange(key, {\n type: value as JSONSchema7[\"type\"],\n })\n }\n aria-label=\"Type\"\n >\n <SelectTrigger className=\"w-full\" aria-label=\"Select type\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={\"string\" satisfies JSONSchema7[\"type\"]}>\n string\n </SelectItem>\n <SelectItem value={\"number\" satisfies JSONSchema7[\"type\"]}>\n number\n </SelectItem>\n <SelectItem value={\"integer\" satisfies JSONSchema7[\"type\"]}>\n integer\n </SelectItem>\n <SelectItem value={\"boolean\" satisfies JSONSchema7[\"type\"]}>\n boolean\n </SelectItem>\n <SelectItem value={\"object\" satisfies JSONSchema7[\"type\"]}>\n object\n </SelectItem>\n <SelectItem value={\"array\" satisfies JSONSchema7[\"type\"]}>\n array\n </SelectItem>\n <SelectItem value={\"null\" satisfies JSONSchema7[\"type\"]}>\n null\n </SelectItem>\n <SelectItem value={\"enum\"}>enum</SelectItem>\n </SelectContent>\n </Select>\n </div>\n\n <div className=\"\">\n <DebouncedInput\n value={typeof property === \"object\" ? property.title : undefined}\n onDebounce={(newVal) =>\n handlePropertyChange(key, { title: newVal })\n }\n placeholder=\"Title\"\n />\n </div>\n\n <div className=\"\">\n <DebouncedInput\n value={\n typeof property === \"object\" ? property.description : undefined\n }\n onDebounce={(newVal) =>\n handlePropertyChange(key, { description: newVal })\n }\n placeholder=\"Description\"\n />\n </div>\n\n <div className=\"order-last md:order-none flex gap-2\">\n {/* Delete button */}\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleInitiateDelete(key)}\n aria-label=\"Delete\"\n className=\"block!\"\n >\n <Trash2 size={16} className=\"text-destructive\" />\n </Button>\n\n {/* Duplicate button */}\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleDuplicate(key)}\n aria-label=\"Duplicate\"\n className=\"block!\"\n >\n <Copy size={16} />\n </Button>\n\n {/* Edit button if applicable */}\n {renderEditButton(key, property)}\n\n {/* Navigate button for objects/array items */}\n {renderNavigateButton(key, property)}\n </div>\n\n {/* Render array items configuration if needed */}\n {renderArrayItemsConfig(key, property)}\n </div>\n );\n };\n\n // Helper to render array items configuration\n const renderArrayItemsConfig = (key: string, property: JSONSchema7) => {\n if (typeof property !== \"object\" || property.type !== \"array\") {\n return null;\n }\n\n const items = property.items;\n const itemType =\n !Array.isArray(items) &&\n typeof items === \"object\" &&\n typeof items.type === \"string\"\n ? items?.type\n : \"string\";\n\n return (\n <div className=\"col-span-full flex items-center gap-4 pl-8 mt-2 bg-gray-50 p-2 rounded-md\">\n <Label>Items of type:</Label>\n <Select\n value={itemType as string}\n onValueChange={(value) => {\n const newItems: JSONSchema7 = {\n ...(typeof items === \"object\" ? items : {}),\n type: value as JSONSchema7[\"type\"],\n };\n\n if (value === \"object\") {\n // Initialize empty properties for object type\n newItems.properties = newItems.properties ?? {};\n }\n\n handlePropertyChange(key, { items: newItems });\n }}\n >\n <SelectTrigger\n className=\"w-[200px]\"\n aria-label=\"Select items of type\"\n >\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value={\"string\" satisfies JSONSchema7[\"type\"]}>\n string\n </SelectItem>\n <SelectItem value={\"number\" satisfies JSONSchema7[\"type\"]}>\n number\n </SelectItem>\n <SelectItem value={\"integer\" satisfies JSONSchema7[\"type\"]}>\n integer\n </SelectItem>\n <SelectItem value={\"boolean\" satisfies JSONSchema7[\"type\"]}>\n boolean\n </SelectItem>\n <SelectItem value={\"object\" satisfies JSONSchema7[\"type\"]}>\n object\n </SelectItem>\n <SelectItem value={\"array\" satisfies JSONSchema7[\"type\"]}>\n array\n </SelectItem>\n <SelectItem value={\"null\" satisfies JSONSchema7[\"type\"]}>\n null\n </SelectItem>\n </SelectContent>\n </Select>\n\n {/* Configure object button for array items of type object */}\n {renderNavigateButton(key, items)}\n </div>\n );\n };\n\n // Helper to render the edit constraint button when needed\n const renderEditButton = (key: string, property: JSONSchema7) => {\n if (typeof property !== \"object\") return null;\n\n // Check for constraints\n const availableConstraints = getConstraintDefinitionsForType(\n typeof property.type === \"string\" ? property.type : \"\",\n );\n\n // Check for enum\n const hasEnum = Array.isArray(property?.enum);\n\n if (availableConstraints.length || hasEnum) {\n return (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleEditProperty(key, property)}\n aria-label=\"Edit constraints\"\n >\n <Bolt size={16} />\n </Button>\n );\n }\n\n return null;\n };\n\n const renderNavigateButton = (key: string, items: JSONSchema7[\"items\"]) => {\n if (\n !Array.isArray(items) &&\n typeof items === \"object\" &&\n items?.type === \"object\"\n ) {\n return (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => handleNavigateToProperty(key)}\n aria-label=\"Navigate\"\n >\n <span className=\"sr-only\">Navigate</span>\n <ChevronRight size={16} />\n </Button>\n );\n }\n\n return null;\n };\n\n // Render navigation component\n const renderNavigation = () => {\n const NavigationComponent = props.navigationComponent;\n\n if (NavigationComponent) {\n return (\n <NavigationComponent\n currentPath={path}\n onNavigateUp={handleNavigateUp}\n onNavigateTo={setPath}\n isRootPath={path.length === 0}\n />\n );\n }\n\n return (\n <div className=\"flex items-center space-x-4\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={handleNavigateUp}\n disabled={path.length === 0}\n className={cn(props.backButtonClassName)}\n >\n Back\n </Button>\n <Breadcrumb>\n <BreadcrumbList>\n <BreadcrumbItem>\n <BreadcrumbLink href=\"#\" onClick={() => setPath([])}>\n Root\n </BreadcrumbLink>\n </BreadcrumbItem>\n {path.map((item, index) => (\n <Fragment key={`path-${index}`}>\n <BreadcrumbSeparator />\n <BreadcrumbItem>\n <BreadcrumbLink\n href=\"#\"\n onClick={() => setPath(path.slice(0, index + 1))}\n >\n {item}\n </BreadcrumbLink>\n </BreadcrumbItem>\n </Fragment>\n ))}\n </BreadcrumbList>\n </Breadcrumb>\n </div>\n );\n };\n\n // Render add property button\n const renderAddPropertyButton = () => {\n const AddPropertyButtonComponent = props.addPropertyButtonComponent;\n\n if (AddPropertyButtonComponent) {\n return (\n <AddPropertyButtonComponent\n onClick={() => setShowPropertyDialog(true)}\n />\n );\n }\n\n return (\n <Button\n type=\"button\"\n className={cn(\"self-center\", props.addPropertyButtonClassName)}\n onClick={() => {\n setShowPropertyDialog(true);\n }}\n >\n <Plus className=\"h-4 w-4 mr-2\" />\n Add Property\n </Button>\n );\n };\n\n return (\n <div>\n {/* Schema validation error */}\n {schemaValidationError && (\n <Alert variant=\"destructive\">\n <AlertTitle>Schema Error</AlertTitle>\n <AlertDescription>{schemaValidationError}</AlertDescription>\n </Alert>\n )}\n\n {/* Navigation bar */}\n {renderNavigation()}\n\n {/* Properties list */}\n <div\n className={cn(\"mt-6 overflow-x-hidden\", props.propertiesListClassName)}\n >\n {Object.entries(currentSchema.properties ?? {}).map(\n ([key, property]) => {\n if (typeof property === \"boolean\") {\n // We don't support editing boolean properties\n return null;\n }\n\n return renderProperty(key, property);\n },\n )}\n </div>\n\n {/* Add property button */}\n {renderAddPropertyButton()}\n\n {/* Add property dialog */}\n <AddPropertyDialog\n open={showPropertyDialog}\n onOpenChange={setShowPropertyDialog}\n onSubmit={onAddProperty}\n />\n\n {/* Edit property dialog */}\n {editingKey && editingProperty && (\n <EditPropertyDialog\n propertyKey={editingKey}\n property={editingProperty}\n open={showEditDialog}\n onOpenChange={setShowEditDialog}\n onSubmit={(params) => {\n handlePropertyChange(...params);\n setEditingKey(undefined);\n setEditingProperty(undefined);\n setShowEditDialog(false);\n }}\n />\n )}\n\n {/* Delete confirmation dialog */}\n <AlertDialog open={showDeleteDialog} onOpenChange={setShowDeleteDialog}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Are you sure?</AlertDialogTitle>\n <AlertDialogDescription>\n This action cannot be undone. This will permanently delete the\n property\n {deleteKey ? ` \"${deleteKey}\"` : \"\"} from the schema.\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel onClick={handleCancelDelete}>\n Cancel\n </AlertDialogCancel>\n <AlertDialogAction onClick={handleConfirmDelete}>\n Delete\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </div>\n );\n};\n"],"names":["SchemaBuilder","props","showPropertyDialog","setShowPropertyDialog","useState","showEditDialog","setShowEditDialog","showDeleteDialog","setShowDeleteDialog","deleteKey","setDeleteKey","editingKey","setEditingKey","editingProperty","setEditingProperty","schemaValidationError","setSchemaValidationError","usePluginSystem","getCurrentSchema","setPath","path","handleAddProperty","handlePropertyChange","handleKeyChange","handleDeleteProperty","setSchema","isPropertyRequired","handleDuplicateProperty","useSchema","getConstraintDefinitionsForType","useConstraints","useEffect","validateSchema","clone","error","Ajv","currentSchema","handleNavigateToProperty","name","handleNavigateUp","handleEditProperty","key","property","handleInitiateDelete","handleConfirmDelete","handleCancelDelete","handleDuplicate","result","onAddProperty","vals","PropertyComponent","renderProperty","jsx","jsxs","DebouncedInput","newVal","Switch","checked","Label","Select","value","SelectTrigger","SelectValue","SelectContent","SelectItem","Button","Trash2","Copy","renderEditButton","renderNavigateButton","renderArrayItemsConfig","items","itemType","newItems","availableConstraints","hasEnum","Bolt","ChevronRight","renderNavigation","NavigationComponent","cn","Breadcrumb","BreadcrumbList","BreadcrumbItem","BreadcrumbLink","item","index","Fragment","BreadcrumbSeparator","renderAddPropertyButton","AddPropertyButtonComponent","Plus","Alert","AlertTitle","AlertDescription","AddPropertyDialog","EditPropertyDialog","params","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction"],"mappings":"2vBAqGaA,GAAiBC,GAA8B,CAE1D,KAAM,CAACC,EAAoBC,CAAqB,EAAIC,EAAAA,SAAS,EAAK,EAC5D,CAACC,EAAgBC,CAAiB,EAAIF,EAAAA,SAAS,EAAK,EACpD,CAACG,EAAkBC,CAAmB,EAAIJ,EAAAA,SAAS,EAAK,EACxD,CAACK,EAAWC,CAAY,EAAIN,WAA6B,EACzD,CAACO,EAAYC,CAAa,EAAIR,WAA6B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EAAkB,EAAK,CAAA,CACzB,CACF,QAID4F,EAAY,YAAA,CAAA,KAAM3F,EAAkB,aAAcC,EACjD,gBAAC2F,EACC,mBAAA,CAAA,SAAA,CAAA9C,OAAC+C,EAAAA,kBACC,CAAA,SAAA,CAAAhD,EAAAA,IAACiD,oBAAiB,SAAa,eAAA,CAAA,SAC9BC,EAAAA,uBAAuB,CAAA,SAAA,CAAA,0EAGrB7F,EAAY,KAAKA,CAAS,IAAM,GAAG,mBAAA,CACtC,CAAA,CAAA,EACF,SACC8F,EAAAA,kBACC,CAAA,SAAA,CAACnD,EAAA,IAAAoD,EAAA,kBAAA,CAAkB,QAAS3D,EAAoB,SAEhD,SAAA,EACCO,EAAA,IAAAqD,EAAA,kBAAA,CAAkB,QAAS7D,EAAqB,SAEjD,QAAA,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CACF,CACF,CAAA,CAAA,EACF,CAEJ"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs51.js");/**
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./index.cjs49.js");/**
2
2
  * @license lucide-react v0.477.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("./index.cjs63.js"),i=require("react/jsx-runtime");function c(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const l=c(n);var s="Label",o=l.forwardRef((t,r)=>i.jsx(u.Primitive.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));o.displayName=s;var f=o;exports.Label=o;exports.Root=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("./index.cjs55.js"),i=require("react/jsx-runtime");function c(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,a.get?a:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const l=c(n);var s="Label",o=l.forwardRef((t,r)=>i.jsx(u.Primitive.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));o.displayName=s;var f=o;exports.Label=o;exports.Root=f;
2
2
  //# sourceMappingURL=index.cjs31.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),m=require("./index.cjs58.js"),a=require("react/jsx-runtime");function y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const o=y(g);var p=o.forwardRef((e,t)=>{const{children:r,...n}=e,l=o.Children.toArray(r),i=l.find(b);if(i){const s=i.props.children,c=l.map(f=>f===i?o.Children.count(s)>1?o.Children.only(null):o.isValidElement(s)?s.props.children:null:f);return a.jsx(u,{...n,ref:t,children:o.isValidElement(s)?o.cloneElement(s,void 0,c):null})}return a.jsx(u,{...n,ref:t,children:r})});p.displayName="Slot";var u=o.forwardRef((e,t)=>{const{children:r,...n}=e;if(o.isValidElement(r)){const l=S(r),i=j(n,r.props);return r.type!==o.Fragment&&(i.ref=t?m.composeRefs(t,l):l),o.cloneElement(r,i)}return o.Children.count(r)>1?o.Children.only(null):null});u.displayName="SlotClone";var d=({children:e})=>a.jsx(a.Fragment,{children:e});function b(e){return o.isValidElement(e)&&e.type===d}function j(e,t){const r={...t};for(const n in t){const l=e[n],i=t[n];/^on[A-Z]/.test(n)?l&&i?r[n]=(...c)=>{i(...c),l(...c)}:l&&(r[n]=l):n==="style"?r[n]={...l,...i}:n==="className"&&(r[n]=[l,i].filter(Boolean).join(" "))}return{...e,...r}}function S(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}exports.Slot=p;exports.Slottable=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),m=require("./index.cjs57.js"),a=require("react/jsx-runtime");function y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const o=y(g);var p=o.forwardRef((e,t)=>{const{children:r,...n}=e,l=o.Children.toArray(r),i=l.find(b);if(i){const s=i.props.children,c=l.map(f=>f===i?o.Children.count(s)>1?o.Children.only(null):o.isValidElement(s)?s.props.children:null:f);return a.jsx(u,{...n,ref:t,children:o.isValidElement(s)?o.cloneElement(s,void 0,c):null})}return a.jsx(u,{...n,ref:t,children:r})});p.displayName="Slot";var u=o.forwardRef((e,t)=>{const{children:r,...n}=e;if(o.isValidElement(r)){const l=S(r),i=j(n,r.props);return r.type!==o.Fragment&&(i.ref=t?m.composeRefs(t,l):l),o.cloneElement(r,i)}return o.Children.count(r)>1?o.Children.only(null):null});u.displayName="SlotClone";var d=({children:e})=>a.jsx(a.Fragment,{children:e});function b(e){return o.isValidElement(e)&&e.type===d}function j(e,t){const r={...t};for(const n in t){const l=e[n],i=t[n];/^on[A-Z]/.test(n)?l&&i?r[n]=(...c)=>{i(...c),l(...c)}:l&&(r[n]=l):n==="style"?r[n]={...l,...i}:n==="className"&&(r[n]=[l,i].filter(Boolean).join(" "))}return{...e,...r}}function S(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}exports.Slot=p;exports.Slottable=d;
2
2
  //# sourceMappingURL=index.cjs34.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),_=require("./index.cjs57.js"),E=require("./index.cjs58.js"),O=require("./index.cjs59.js"),M=require("./index.cjs60.js"),$=require("./index.cjs61.js"),N=require("./index.cjs62.js"),C=require("./index.cjs63.js"),d=require("react/jsx-runtime");function H(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const s=H(T);var v="Switch",[I,z]=O.createContextScope(v),[B,D]=I(v),w=s.forwardRef((e,o)=>{const{__scopeSwitch:t,name:r,checked:c,defaultChecked:l,required:i,disabled:n,value:a="on",onCheckedChange:b,form:S,...p}=e,[u,y]=s.useState(null),j=E.useComposedRefs(o,f=>y(f)),m=s.useRef(!1),x=u?S||!!u.closest("form"):!0,[h=!1,R]=M.useControllableState({prop:c,defaultProp:l,onChange:b});return d.jsxs(B,{scope:t,checked:h,disabled:n,children:[d.jsx(C.Primitive.button,{type:"button",role:"switch","aria-checked":h,"aria-required":i,"data-state":g(h),"data-disabled":n?"":void 0,disabled:n,value:a,...p,ref:j,onClick:_.composeEventHandlers(e.onClick,f=>{R(q=>!q),x&&(m.current=f.isPropagationStopped(),m.current||f.stopPropagation())})}),x&&d.jsx(A,{control:u,bubbles:!m.current,name:r,value:a,checked:h,required:i,disabled:n,form:S,style:{transform:"translateX(-100%)"}})]})});w.displayName=v;var P="SwitchThumb",k=s.forwardRef((e,o)=>{const{__scopeSwitch:t,...r}=e,c=D(P,t);return d.jsx(C.Primitive.span,{"data-state":g(c.checked),"data-disabled":c.disabled?"":void 0,...r,ref:o})});k.displayName=P;var A=e=>{const{control:o,checked:t,bubbles:r=!0,...c}=e,l=s.useRef(null),i=$.usePrevious(t),n=N.useSize(o);return s.useEffect(()=>{const a=l.current,b=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(b,"checked").set;if(i!==t&&p){const u=new Event("click",{bubbles:r});p.call(a,t),a.dispatchEvent(u)}},[i,t,r]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...c,tabIndex:-1,ref:l,style:{...e.style,...n,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function g(e){return e?"checked":"unchecked"}var F=w,L=k;exports.Root=F;exports.Switch=w;exports.SwitchThumb=k;exports.Thumb=L;exports.createSwitchScope=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),_=require("./index.cjs56.js"),E=require("./index.cjs57.js"),O=require("./index.cjs58.js"),M=require("./index.cjs59.js"),$=require("./index.cjs60.js"),N=require("./index.cjs61.js"),C=require("./index.cjs55.js"),d=require("react/jsx-runtime");function H(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const s=H(T);var v="Switch",[I,z]=O.createContextScope(v),[B,D]=I(v),w=s.forwardRef((e,o)=>{const{__scopeSwitch:t,name:r,checked:c,defaultChecked:l,required:i,disabled:n,value:a="on",onCheckedChange:b,form:S,...p}=e,[u,y]=s.useState(null),j=E.useComposedRefs(o,f=>y(f)),m=s.useRef(!1),x=u?S||!!u.closest("form"):!0,[h=!1,R]=M.useControllableState({prop:c,defaultProp:l,onChange:b});return d.jsxs(B,{scope:t,checked:h,disabled:n,children:[d.jsx(C.Primitive.button,{type:"button",role:"switch","aria-checked":h,"aria-required":i,"data-state":g(h),"data-disabled":n?"":void 0,disabled:n,value:a,...p,ref:j,onClick:_.composeEventHandlers(e.onClick,f=>{R(q=>!q),x&&(m.current=f.isPropagationStopped(),m.current||f.stopPropagation())})}),x&&d.jsx(A,{control:u,bubbles:!m.current,name:r,value:a,checked:h,required:i,disabled:n,form:S,style:{transform:"translateX(-100%)"}})]})});w.displayName=v;var P="SwitchThumb",k=s.forwardRef((e,o)=>{const{__scopeSwitch:t,...r}=e,c=D(P,t);return d.jsx(C.Primitive.span,{"data-state":g(c.checked),"data-disabled":c.disabled?"":void 0,...r,ref:o})});k.displayName=P;var A=e=>{const{control:o,checked:t,bubbles:r=!0,...c}=e,l=s.useRef(null),i=$.usePrevious(t),n=N.useSize(o);return s.useEffect(()=>{const a=l.current,b=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(b,"checked").set;if(i!==t&&p){const u=new Event("click",{bubbles:r});p.call(a,t),a.dispatchEvent(u)}},[i,t,r]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...c,tabIndex:-1,ref:l,style:{...e.style,...n,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function g(e){return e?"checked":"unchecked"}var F=w,L=k;exports.Root=F;exports.Switch=w;exports.SwitchThumb=k;exports.Thumb=L;exports.createSwitchScope=z;
2
2
  //# sourceMappingURL=index.cjs36.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("react"),ct=require("react-dom"),Le=require("./index.cjs64.js"),E=require("./index.cjs57.js"),lt=require("./index.cjs65.js"),H=require("./index.cjs58.js"),it=require("./index.cjs59.js"),at=require("./index.cjs66.js"),dt=require("./index.cjs67.js"),ut=require("./index.cjs68.js"),pt=require("./index.cjs69.js"),Ie=require("./index.cjs70.js"),ee=require("./index.cjs71.js"),ft=require("./index.cjs72.js"),M=require("./index.cjs63.js"),mt=require("./index.cjs34.js"),ht=require("./index.cjs73.js"),ke=require("./index.cjs60.js"),$=require("./index.cjs74.js"),vt=require("./index.cjs61.js"),St=require("./index.cjs75.js"),gt=require("./index.cjs76.js"),xt=require("./index.cjs77.js"),d=require("react/jsx-runtime");function Ve(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(l,e,i.get?i:{enumerable:!0,get:()=>o[e]})}}return l.default=o,Object.freeze(l)}const t=Ve(st),Be=Ve(ct);var wt=[" ","Enter","ArrowUp","ArrowDown"],Ct=[" ","Enter"],se="Select",[ae,de,yt]=lt.createCollection(se),[te,It]=it.createContextScope(se,[yt,ee.createPopperScope]),ue=ee.createPopperScope(),[Tt,G]=te(se),[Pt,Et]=te(se),Te=o=>{const{__scopeSelect:l,children:e,open:i,defaultOpen:r,onOpenChange:u,value:n,defaultValue:s,onValueChange:c,dir:f,name:S,autoComplete:w,disabled:R,required:T,form:y}=o,a=ue(l),[h,g]=t.useState(null),[m,v]=t.useState(null),[F,O]=t.useState(!1),oe=at.useDirection(f),[b=!1,D]=ke.useControllableState({prop:i,defaultProp:r,onChange:u}),[W,Y]=ke.useControllableState({prop:n,defaultProp:s,onChange:c}),L=t.useRef(null),k=h?y||!!h.closest("form"):!0,[U,V]=t.useState(new Set),B=Array.from(U).map(_=>_.props.value).join(";");return d.jsx(ee.Root,{...a,children:d.jsxs(Tt,{required:T,scope:l,trigger:h,onTriggerChange:g,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:O,contentId:Ie.useId(),value:W,onValueChange:Y,open:b,onOpenChange:D,dir:oe,triggerPointerDownPosRef:L,disabled:R,children:[d.jsx(ae.Provider,{scope:l,children:d.jsx(Pt,{scope:o.__scopeSelect,onNativeOptionAdd:t.useCallback(_=>{V(j=>new Set(j).add(_))},[]),onNativeOptionRemove:t.useCallback(_=>{V(j=>{const q=new Set(j);return q.delete(_),q})},[]),children:e})}),k?d.jsxs(ot,{"aria-hidden":!0,required:T,tabIndex:-1,name:S,autoComplete:w,value:W,onChange:_=>Y(_.target.value),disabled:R,form:y,children:[W===void 0?d.jsx("option",{value:""}):null,Array.from(U)]},B):null]})})};Te.displayName=se;var qe="SelectTrigger",Pe=t.forwardRef((o,l)=>{const{__scopeSelect:e,disabled:i=!1,...r}=o,u=ue(e),n=G(qe,e),s=n.disabled||i,c=H.useComposedRefs(l,n.onTriggerChange),f=de(e),S=t.useRef("touch"),[w,R,T]=nt(a=>{const h=f().filter(v=>!v.disabled),g=h.find(v=>v.value===n.value),m=rt(h,a,g);m!==void 0&&n.onValueChange(m.value)}),y=a=>{s||(n.onOpenChange(!0),T()),a&&(n.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return d.jsx(ee.Anchor,{asChild:!0,...u,children:d.jsx(M.Primitive.button,{type:"button",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":tt(n.value)?"":void 0,...r,ref:c,onClick:E.composeEventHandlers(r.onClick,a=>{a.currentTarget.focus(),S.current!=="mouse"&&y(a)}),onPointerDown:E.composeEventHandlers(r.onPointerDown,a=>{S.current=a.pointerType;const h=a.target;h.hasPointerCapture(a.pointerId)&&h.releasePointerCapture(a.pointerId),a.button===0&&a.ctrlKey===!1&&a.pointerType==="mouse"&&(y(a),a.preventDefault())}),onKeyDown:E.composeEventHandlers(r.onKeyDown,a=>{const h=w.current!=="";!(a.ctrlKey||a.altKey||a.metaKey)&&a.key.length===1&&R(a.key),!(h&&a.key===" ")&&wt.includes(a.key)&&(y(),a.preventDefault())})})})});Pe.displayName=qe;var Fe="SelectValue",Ee=t.forwardRef((o,l)=>{const{__scopeSelect:e,className:i,style:r,children:u,placeholder:n="",...s}=o,c=G(Fe,e),{onValueNodeHasChildrenChange:f}=c,S=u!==void 0,w=H.useComposedRefs(l,c.onValueNodeChange);return $.useLayoutEffect(()=>{f(S)},[f,S]),d.jsx(M.Primitive.span,{...s,ref:w,style:{pointerEvents:"none"},children:tt(c.value)?d.jsx(d.Fragment,{children:n}):u})});Ee.displayName=Fe;var Rt="SelectIcon",Re=t.forwardRef((o,l)=>{const{__scopeSelect:e,children:i,...r}=o;return d.jsx(M.Primitive.span,{"aria-hidden":!0,...r,ref:l,children:i||"▼"})});Re.displayName=Rt;var bt="SelectPortal",be=o=>d.jsx(ft.Portal,{asChild:!0,...o});be.displayName=bt;var J="SelectContent",_e=t.forwardRef((o,l)=>{const e=G(J,o.__scopeSelect),[i,r]=t.useState();if($.useLayoutEffect(()=>{r(new DocumentFragment)},[]),!e.open){const u=i;return u?Be.createPortal(d.jsx(We,{scope:o.__scopeSelect,children:d.jsx(ae.Slot,{scope:o.__scopeSelect,children:d.jsx("div",{children:o.children})})}),u):null}return d.jsx(Ue,{...o,ref:l})});_e.displayName=J;var A=10,[We,z]=te(J),_t="SelectContentImpl",Ue=t.forwardRef((o,l)=>{const{__scopeSelect:e,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:u,onPointerDownOutside:n,side:s,sideOffset:c,align:f,alignOffset:S,arrowPadding:w,collisionBoundary:R,collisionPadding:T,sticky:y,hideWhenDetached:a,avoidCollisions:h,...g}=o,m=G(J,e),[v,F]=t.useState(null),[O,oe]=t.useState(null),b=H.useComposedRefs(l,p=>F(p)),[D,W]=t.useState(null),[Y,L]=t.useState(null),k=de(e),[U,V]=t.useState(!1),B=t.useRef(!1);t.useEffect(()=>{if(v)return gt.hideOthers(v)},[v]),ut.useFocusGuards();const _=t.useCallback(p=>{const[I,...N]=k().map(P=>P.ref.current),[x]=N.slice(-1),C=document.activeElement;for(const P of p)if(P===C||(P?.scrollIntoView({block:"nearest"}),P===I&&O&&(O.scrollTop=0),P===x&&O&&(O.scrollTop=O.scrollHeight),P?.focus(),document.activeElement!==C))return},[k,O]),j=t.useCallback(()=>_([D,v]),[_,D,v]);t.useEffect(()=>{U&&j()},[U,j]);const{onOpenChange:q,triggerPointerDownPosRef:K}=m;t.useEffect(()=>{if(v){let p={x:0,y:0};const I=x=>{p={x:Math.abs(Math.round(x.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(x.pageY)-(K.current?.y??0))}},N=x=>{p.x<=10&&p.y<=10?x.preventDefault():v.contains(x.target)||q(!1),document.removeEventListener("pointermove",I),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",N,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",N,{capture:!0})}}},[v,q,K]),t.useEffect(()=>{const p=()=>q(!1);return window.addEventListener("blur",p),window.addEventListener("resize",p),()=>{window.removeEventListener("blur",p),window.removeEventListener("resize",p)}},[q]);const[pe,ce]=nt(p=>{const I=k().filter(C=>!C.disabled),N=I.find(C=>C.ref.current===document.activeElement),x=rt(I,p,N);x&&setTimeout(()=>x.ref.current.focus())}),fe=t.useCallback((p,I,N)=>{const x=!B.current&&!N;(m.value!==void 0&&m.value===I||x)&&(W(p),x&&(B.current=!0))},[m.value]),me=t.useCallback(()=>v?.focus(),[v]),Q=t.useCallback((p,I,N)=>{const x=!B.current&&!N;(m.value!==void 0&&m.value===I||x)&&L(p)},[m.value]),le=i==="popper"?ge:Ke,ne=le===ge?{side:s,sideOffset:c,align:f,alignOffset:S,arrowPadding:w,collisionBoundary:R,collisionPadding:T,sticky:y,hideWhenDetached:a,avoidCollisions:h}:{};return d.jsx(We,{scope:e,content:v,viewport:O,onViewportChange:oe,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:Q,focusSelectedItem:j,selectedItemText:Y,position:i,isPositioned:U,searchRef:pe,children:d.jsx(xt.default,{as:mt.Slot,allowPinchZoom:!0,children:d.jsx(pt.FocusScope,{asChild:!0,trapped:m.open,onMountAutoFocus:p=>{p.preventDefault()},onUnmountAutoFocus:E.composeEventHandlers(r,p=>{m.trigger?.focus({preventScroll:!0}),p.preventDefault()}),children:d.jsx(dt.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:n,onFocusOutside:p=>p.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:p=>p.preventDefault(),...g,...ne,onPlaced:()=>V(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:E.composeEventHandlers(g.onKeyDown,p=>{const I=p.ctrlKey||p.altKey||p.metaKey;if(p.key==="Tab"&&p.preventDefault(),!I&&p.key.length===1&&ce(p.key),["ArrowUp","ArrowDown","Home","End"].includes(p.key)){let x=k().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(p.key)&&(x=x.slice().reverse()),["ArrowUp","ArrowDown"].includes(p.key)){const C=p.target,P=x.indexOf(C);x=x.slice(P+1)}setTimeout(()=>_(x)),p.preventDefault()}})})})})})})});Ue.displayName=_t;var Nt="SelectItemAlignedPosition",Ke=t.forwardRef((o,l)=>{const{__scopeSelect:e,onPlaced:i,...r}=o,u=G(J,e),n=z(J,e),[s,c]=t.useState(null),[f,S]=t.useState(null),w=H.useComposedRefs(l,b=>S(b)),R=de(e),T=t.useRef(!1),y=t.useRef(!0),{viewport:a,selectedItem:h,selectedItemText:g,focusSelectedItem:m}=n,v=t.useCallback(()=>{if(u.trigger&&u.valueNode&&s&&f&&a&&h&&g){const b=u.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),W=u.valueNode.getBoundingClientRect(),Y=g.getBoundingClientRect();if(u.dir!=="rtl"){const C=Y.left-D.left,P=W.left-C,X=b.left-P,Z=b.width+X,he=Math.max(Z,D.width),ve=window.innerWidth-A,Se=Le.clamp(P,[A,Math.max(A,ve-he)]);s.style.minWidth=Z+"px",s.style.left=Se+"px"}else{const C=D.right-Y.right,P=window.innerWidth-W.right-C,X=window.innerWidth-b.right-P,Z=b.width+X,he=Math.max(Z,D.width),ve=window.innerWidth-A,Se=Le.clamp(P,[A,Math.max(A,ve-he)]);s.style.minWidth=Z+"px",s.style.right=Se+"px"}const L=R(),k=window.innerHeight-A*2,U=a.scrollHeight,V=window.getComputedStyle(f),B=parseInt(V.borderTopWidth,10),_=parseInt(V.paddingTop,10),j=parseInt(V.borderBottomWidth,10),q=parseInt(V.paddingBottom,10),K=B+_+U+q+j,pe=Math.min(h.offsetHeight*5,K),ce=window.getComputedStyle(a),fe=parseInt(ce.paddingTop,10),me=parseInt(ce.paddingBottom,10),Q=b.top+b.height/2-A,le=k-Q,ne=h.offsetHeight/2,p=h.offsetTop+ne,I=B+_+p,N=K-I;if(I<=Q){const C=L.length>0&&h===L[L.length-1].ref.current;s.style.bottom="0px";const P=f.clientHeight-a.offsetTop-a.offsetHeight,X=Math.max(le,ne+(C?me:0)+P+j),Z=I+X;s.style.height=Z+"px"}else{const C=L.length>0&&h===L[0].ref.current;s.style.top="0px";const X=Math.max(Q,B+a.offsetTop+(C?fe:0)+ne)+N;s.style.height=X+"px",a.scrollTop=I-Q+a.offsetTop}s.style.margin=`${A}px 0`,s.style.minHeight=pe+"px",s.style.maxHeight=k+"px",i?.(),requestAnimationFrame(()=>T.current=!0)}},[R,u.trigger,u.valueNode,s,f,a,h,g,u.dir,i]);$.useLayoutEffect(()=>v(),[v]);const[F,O]=t.useState();$.useLayoutEffect(()=>{f&&O(window.getComputedStyle(f).zIndex)},[f]);const oe=t.useCallback(b=>{b&&y.current===!0&&(v(),m?.(),y.current=!1)},[v,m]);return d.jsx(Ot,{scope:e,contentWrapper:s,shouldExpandOnScrollRef:T,onScrollButtonChange:oe,children:d.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(M.Primitive.div,{...r,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Ke.displayName=Nt;var Mt="SelectPopperPosition",ge=t.forwardRef((o,l)=>{const{__scopeSelect:e,align:i="start",collisionPadding:r=A,...u}=o,n=ue(e);return d.jsx(ee.Content,{...n,...u,ref:l,align:i,collisionPadding:r,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ge.displayName=Mt;var[Ot,Ne]=te(J,{}),xe="SelectViewport",Me=t.forwardRef((o,l)=>{const{__scopeSelect:e,nonce:i,...r}=o,u=z(xe,e),n=Ne(xe,e),s=H.useComposedRefs(l,u.onViewportChange),c=t.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),d.jsx(ae.Slot,{scope:e,children:d.jsx(M.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E.composeEventHandlers(r.onScroll,f=>{const S=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:R}=n;if(R?.current&&w){const T=Math.abs(c.current-S.scrollTop);if(T>0){const y=window.innerHeight-A*2,a=parseFloat(w.style.minHeight),h=parseFloat(w.style.height),g=Math.max(a,h);if(g<y){const m=g+T,v=Math.min(y,m),F=m-v;w.style.height=v+"px",w.style.bottom==="0px"&&(S.scrollTop=F>0?F:0,w.style.justifyContent="flex-end")}}}c.current=S.scrollTop})})})]})});Me.displayName=xe;var $e="SelectGroup",[At,Dt]=te($e),Ge=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o,r=Ie.useId();return d.jsx(At,{scope:e,id:r,children:d.jsx(M.Primitive.div,{role:"group","aria-labelledby":r,...i,ref:l})})});Ge.displayName=$e;var ze="SelectLabel",Ye=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o,r=Dt(ze,e);return d.jsx(M.Primitive.div,{id:r.id,...i,ref:l})});Ye.displayName=ze;var ie="SelectItem",[jt,Xe]=te(ie),Oe=t.forwardRef((o,l)=>{const{__scopeSelect:e,value:i,disabled:r=!1,textValue:u,...n}=o,s=G(ie,e),c=z(ie,e),f=s.value===i,[S,w]=t.useState(u??""),[R,T]=t.useState(!1),y=H.useComposedRefs(l,m=>c.itemRefCallback?.(m,i,r)),a=Ie.useId(),h=t.useRef("touch"),g=()=>{r||(s.onValueChange(i),s.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(jt,{scope:e,value:i,disabled:r,textId:a,isSelected:f,onItemTextChange:t.useCallback(m=>{w(v=>v||(m?.textContent??"").trim())},[]),children:d.jsx(ae.ItemSlot,{scope:e,value:i,disabled:r,textValue:S,children:d.jsx(M.Primitive.div,{role:"option","aria-labelledby":a,"data-highlighted":R?"":void 0,"aria-selected":f&&R,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...n,ref:y,onFocus:E.composeEventHandlers(n.onFocus,()=>T(!0)),onBlur:E.composeEventHandlers(n.onBlur,()=>T(!1)),onClick:E.composeEventHandlers(n.onClick,()=>{h.current!=="mouse"&&g()}),onPointerUp:E.composeEventHandlers(n.onPointerUp,()=>{h.current==="mouse"&&g()}),onPointerDown:E.composeEventHandlers(n.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:E.composeEventHandlers(n.onPointerMove,m=>{h.current=m.pointerType,r?c.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E.composeEventHandlers(n.onPointerLeave,m=>{m.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:E.composeEventHandlers(n.onKeyDown,m=>{c.searchRef?.current!==""&&m.key===" "||(Ct.includes(m.key)&&g(),m.key===" "&&m.preventDefault())})})})})});Oe.displayName=ie;var re="SelectItemText",Ae=t.forwardRef((o,l)=>{const{__scopeSelect:e,className:i,style:r,...u}=o,n=G(re,e),s=z(re,e),c=Xe(re,e),f=Et(re,e),[S,w]=t.useState(null),R=H.useComposedRefs(l,g=>w(g),c.onItemTextChange,g=>s.itemTextRefCallback?.(g,c.value,c.disabled)),T=S?.textContent,y=t.useMemo(()=>d.jsx("option",{value:c.value,disabled:c.disabled,children:T},c.value),[c.disabled,c.value,T]),{onNativeOptionAdd:a,onNativeOptionRemove:h}=f;return $.useLayoutEffect(()=>(a(y),()=>h(y)),[a,h,y]),d.jsxs(d.Fragment,{children:[d.jsx(M.Primitive.span,{id:c.textId,...u,ref:R}),c.isSelected&&n.valueNode&&!n.valueNodeHasChildren?Be.createPortal(u.children,n.valueNode):null]})});Ae.displayName=re;var Ze="SelectItemIndicator",De=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o;return Xe(Ze,e).isSelected?d.jsx(M.Primitive.span,{"aria-hidden":!0,...i,ref:l}):null});De.displayName=Ze;var we="SelectScrollUpButton",je=t.forwardRef((o,l)=>{const e=z(we,o.__scopeSelect),i=Ne(we,o.__scopeSelect),[r,u]=t.useState(!1),n=H.useComposedRefs(l,i.onScrollButtonChange);return $.useLayoutEffect(()=>{if(e.viewport&&e.isPositioned){let s=function(){const f=c.scrollTop>0;u(f)};const c=e.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[e.viewport,e.isPositioned]),r?d.jsx(Je,{...o,ref:n,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=e;s&&c&&(s.scrollTop=s.scrollTop-c.offsetHeight)}}):null});je.displayName=we;var Ce="SelectScrollDownButton",He=t.forwardRef((o,l)=>{const e=z(Ce,o.__scopeSelect),i=Ne(Ce,o.__scopeSelect),[r,u]=t.useState(!1),n=H.useComposedRefs(l,i.onScrollButtonChange);return $.useLayoutEffect(()=>{if(e.viewport&&e.isPositioned){let s=function(){const f=c.scrollHeight-c.clientHeight,S=Math.ceil(c.scrollTop)<f;u(S)};const c=e.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[e.viewport,e.isPositioned]),r?d.jsx(Je,{...o,ref:n,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=e;s&&c&&(s.scrollTop=s.scrollTop+c.offsetHeight)}}):null});He.displayName=Ce;var Je=t.forwardRef((o,l)=>{const{__scopeSelect:e,onAutoScroll:i,...r}=o,u=z("SelectScrollButton",e),n=t.useRef(null),s=de(e),c=t.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return t.useEffect(()=>()=>c(),[c]),$.useLayoutEffect(()=>{s().find(S=>S.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),d.jsx(M.Primitive.div,{"aria-hidden":!0,...r,ref:l,style:{flexShrink:0,...r.style},onPointerDown:E.composeEventHandlers(r.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(i,50))}),onPointerMove:E.composeEventHandlers(r.onPointerMove,()=>{u.onItemLeave?.(),n.current===null&&(n.current=window.setInterval(i,50))}),onPointerLeave:E.composeEventHandlers(r.onPointerLeave,()=>{c()})})}),Ht="SelectSeparator",Qe=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o;return d.jsx(M.Primitive.div,{"aria-hidden":!0,...i,ref:l})});Qe.displayName=Ht;var ye="SelectArrow",et=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o,r=ue(e),u=G(ye,e),n=z(ye,e);return u.open&&n.position==="popper"?d.jsx(ee.Arrow,{...r,...i,ref:l}):null});et.displayName=ye;function tt(o){return o===""||o===void 0}var ot=t.forwardRef((o,l)=>{const{value:e,...i}=o,r=t.useRef(null),u=H.useComposedRefs(l,r),n=vt.usePrevious(e);return t.useEffect(()=>{const s=r.current,c=window.HTMLSelectElement.prototype,S=Object.getOwnPropertyDescriptor(c,"value").set;if(n!==e&&S){const w=new Event("change",{bubbles:!0});S.call(s,e),s.dispatchEvent(w)}},[n,e]),d.jsx(St.VisuallyHidden,{asChild:!0,children:d.jsx("select",{...i,ref:u,defaultValue:e})})});ot.displayName="BubbleSelect";function nt(o){const l=ht.useCallbackRef(o),e=t.useRef(""),i=t.useRef(0),r=t.useCallback(n=>{const s=e.current+n;l(s),function c(f){e.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>c(""),1e3))}(s)},[l]),u=t.useCallback(()=>{e.current="",window.clearTimeout(i.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(i.current),[]),[e,r,u]}function rt(o,l,e){const r=l.length>1&&Array.from(l).every(f=>f===l[0])?l[0]:l,u=e?o.indexOf(e):-1;let n=Lt(o,Math.max(u,0));r.length===1&&(n=n.filter(f=>f!==e));const c=n.find(f=>f.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function Lt(o,l){return o.map((e,i)=>o[(l+i)%o.length])}var kt=Te,Vt=Pe,Bt=Ee,qt=Re,Ft=be,Wt=_e,Ut=Me,Kt=Oe,$t=Ae,Gt=De,zt=je,Yt=He;exports.Content=Wt;exports.Icon=qt;exports.Item=Kt;exports.ItemIndicator=Gt;exports.ItemText=$t;exports.Portal=Ft;exports.Root=kt;exports.ScrollDownButton=Yt;exports.ScrollUpButton=zt;exports.Select=Te;exports.SelectArrow=et;exports.SelectContent=_e;exports.SelectGroup=Ge;exports.SelectIcon=Re;exports.SelectItem=Oe;exports.SelectItemIndicator=De;exports.SelectItemText=Ae;exports.SelectLabel=Ye;exports.SelectPortal=be;exports.SelectScrollDownButton=He;exports.SelectScrollUpButton=je;exports.SelectSeparator=Qe;exports.SelectTrigger=Pe;exports.SelectValue=Ee;exports.SelectViewport=Me;exports.Trigger=Vt;exports.Value=Bt;exports.Viewport=Ut;exports.createSelectScope=It;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("react"),ct=require("react-dom"),Le=require("./index.cjs62.js"),E=require("./index.cjs56.js"),lt=require("./index.cjs63.js"),H=require("./index.cjs57.js"),it=require("./index.cjs58.js"),at=require("./index.cjs64.js"),dt=require("./index.cjs65.js"),ut=require("./index.cjs66.js"),pt=require("./index.cjs67.js"),Ie=require("./index.cjs68.js"),ee=require("./index.cjs69.js"),ft=require("./index.cjs70.js"),M=require("./index.cjs55.js"),mt=require("./index.cjs34.js"),ht=require("./index.cjs71.js"),ke=require("./index.cjs59.js"),$=require("./index.cjs72.js"),vt=require("./index.cjs60.js"),St=require("./index.cjs73.js"),gt=require("./index.cjs74.js"),xt=require("./index.cjs75.js"),d=require("react/jsx-runtime");function Ve(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(l,e,i.get?i:{enumerable:!0,get:()=>o[e]})}}return l.default=o,Object.freeze(l)}const t=Ve(st),Be=Ve(ct);var wt=[" ","Enter","ArrowUp","ArrowDown"],Ct=[" ","Enter"],se="Select",[ae,de,yt]=lt.createCollection(se),[te,It]=it.createContextScope(se,[yt,ee.createPopperScope]),ue=ee.createPopperScope(),[Tt,G]=te(se),[Pt,Et]=te(se),Te=o=>{const{__scopeSelect:l,children:e,open:i,defaultOpen:r,onOpenChange:u,value:n,defaultValue:s,onValueChange:c,dir:f,name:S,autoComplete:w,disabled:R,required:T,form:y}=o,a=ue(l),[h,g]=t.useState(null),[m,v]=t.useState(null),[F,O]=t.useState(!1),oe=at.useDirection(f),[b=!1,D]=ke.useControllableState({prop:i,defaultProp:r,onChange:u}),[W,Y]=ke.useControllableState({prop:n,defaultProp:s,onChange:c}),L=t.useRef(null),k=h?y||!!h.closest("form"):!0,[U,V]=t.useState(new Set),B=Array.from(U).map(_=>_.props.value).join(";");return d.jsx(ee.Root,{...a,children:d.jsxs(Tt,{required:T,scope:l,trigger:h,onTriggerChange:g,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:O,contentId:Ie.useId(),value:W,onValueChange:Y,open:b,onOpenChange:D,dir:oe,triggerPointerDownPosRef:L,disabled:R,children:[d.jsx(ae.Provider,{scope:l,children:d.jsx(Pt,{scope:o.__scopeSelect,onNativeOptionAdd:t.useCallback(_=>{V(j=>new Set(j).add(_))},[]),onNativeOptionRemove:t.useCallback(_=>{V(j=>{const q=new Set(j);return q.delete(_),q})},[]),children:e})}),k?d.jsxs(ot,{"aria-hidden":!0,required:T,tabIndex:-1,name:S,autoComplete:w,value:W,onChange:_=>Y(_.target.value),disabled:R,form:y,children:[W===void 0?d.jsx("option",{value:""}):null,Array.from(U)]},B):null]})})};Te.displayName=se;var qe="SelectTrigger",Pe=t.forwardRef((o,l)=>{const{__scopeSelect:e,disabled:i=!1,...r}=o,u=ue(e),n=G(qe,e),s=n.disabled||i,c=H.useComposedRefs(l,n.onTriggerChange),f=de(e),S=t.useRef("touch"),[w,R,T]=nt(a=>{const h=f().filter(v=>!v.disabled),g=h.find(v=>v.value===n.value),m=rt(h,a,g);m!==void 0&&n.onValueChange(m.value)}),y=a=>{s||(n.onOpenChange(!0),T()),a&&(n.triggerPointerDownPosRef.current={x:Math.round(a.pageX),y:Math.round(a.pageY)})};return d.jsx(ee.Anchor,{asChild:!0,...u,children:d.jsx(M.Primitive.button,{type:"button",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":tt(n.value)?"":void 0,...r,ref:c,onClick:E.composeEventHandlers(r.onClick,a=>{a.currentTarget.focus(),S.current!=="mouse"&&y(a)}),onPointerDown:E.composeEventHandlers(r.onPointerDown,a=>{S.current=a.pointerType;const h=a.target;h.hasPointerCapture(a.pointerId)&&h.releasePointerCapture(a.pointerId),a.button===0&&a.ctrlKey===!1&&a.pointerType==="mouse"&&(y(a),a.preventDefault())}),onKeyDown:E.composeEventHandlers(r.onKeyDown,a=>{const h=w.current!=="";!(a.ctrlKey||a.altKey||a.metaKey)&&a.key.length===1&&R(a.key),!(h&&a.key===" ")&&wt.includes(a.key)&&(y(),a.preventDefault())})})})});Pe.displayName=qe;var Fe="SelectValue",Ee=t.forwardRef((o,l)=>{const{__scopeSelect:e,className:i,style:r,children:u,placeholder:n="",...s}=o,c=G(Fe,e),{onValueNodeHasChildrenChange:f}=c,S=u!==void 0,w=H.useComposedRefs(l,c.onValueNodeChange);return $.useLayoutEffect(()=>{f(S)},[f,S]),d.jsx(M.Primitive.span,{...s,ref:w,style:{pointerEvents:"none"},children:tt(c.value)?d.jsx(d.Fragment,{children:n}):u})});Ee.displayName=Fe;var Rt="SelectIcon",Re=t.forwardRef((o,l)=>{const{__scopeSelect:e,children:i,...r}=o;return d.jsx(M.Primitive.span,{"aria-hidden":!0,...r,ref:l,children:i||"▼"})});Re.displayName=Rt;var bt="SelectPortal",be=o=>d.jsx(ft.Portal,{asChild:!0,...o});be.displayName=bt;var J="SelectContent",_e=t.forwardRef((o,l)=>{const e=G(J,o.__scopeSelect),[i,r]=t.useState();if($.useLayoutEffect(()=>{r(new DocumentFragment)},[]),!e.open){const u=i;return u?Be.createPortal(d.jsx(We,{scope:o.__scopeSelect,children:d.jsx(ae.Slot,{scope:o.__scopeSelect,children:d.jsx("div",{children:o.children})})}),u):null}return d.jsx(Ue,{...o,ref:l})});_e.displayName=J;var A=10,[We,z]=te(J),_t="SelectContentImpl",Ue=t.forwardRef((o,l)=>{const{__scopeSelect:e,position:i="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:u,onPointerDownOutside:n,side:s,sideOffset:c,align:f,alignOffset:S,arrowPadding:w,collisionBoundary:R,collisionPadding:T,sticky:y,hideWhenDetached:a,avoidCollisions:h,...g}=o,m=G(J,e),[v,F]=t.useState(null),[O,oe]=t.useState(null),b=H.useComposedRefs(l,p=>F(p)),[D,W]=t.useState(null),[Y,L]=t.useState(null),k=de(e),[U,V]=t.useState(!1),B=t.useRef(!1);t.useEffect(()=>{if(v)return gt.hideOthers(v)},[v]),ut.useFocusGuards();const _=t.useCallback(p=>{const[I,...N]=k().map(P=>P.ref.current),[x]=N.slice(-1),C=document.activeElement;for(const P of p)if(P===C||(P?.scrollIntoView({block:"nearest"}),P===I&&O&&(O.scrollTop=0),P===x&&O&&(O.scrollTop=O.scrollHeight),P?.focus(),document.activeElement!==C))return},[k,O]),j=t.useCallback(()=>_([D,v]),[_,D,v]);t.useEffect(()=>{U&&j()},[U,j]);const{onOpenChange:q,triggerPointerDownPosRef:K}=m;t.useEffect(()=>{if(v){let p={x:0,y:0};const I=x=>{p={x:Math.abs(Math.round(x.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(x.pageY)-(K.current?.y??0))}},N=x=>{p.x<=10&&p.y<=10?x.preventDefault():v.contains(x.target)||q(!1),document.removeEventListener("pointermove",I),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",N,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",N,{capture:!0})}}},[v,q,K]),t.useEffect(()=>{const p=()=>q(!1);return window.addEventListener("blur",p),window.addEventListener("resize",p),()=>{window.removeEventListener("blur",p),window.removeEventListener("resize",p)}},[q]);const[pe,ce]=nt(p=>{const I=k().filter(C=>!C.disabled),N=I.find(C=>C.ref.current===document.activeElement),x=rt(I,p,N);x&&setTimeout(()=>x.ref.current.focus())}),fe=t.useCallback((p,I,N)=>{const x=!B.current&&!N;(m.value!==void 0&&m.value===I||x)&&(W(p),x&&(B.current=!0))},[m.value]),me=t.useCallback(()=>v?.focus(),[v]),Q=t.useCallback((p,I,N)=>{const x=!B.current&&!N;(m.value!==void 0&&m.value===I||x)&&L(p)},[m.value]),le=i==="popper"?ge:Ke,ne=le===ge?{side:s,sideOffset:c,align:f,alignOffset:S,arrowPadding:w,collisionBoundary:R,collisionPadding:T,sticky:y,hideWhenDetached:a,avoidCollisions:h}:{};return d.jsx(We,{scope:e,content:v,viewport:O,onViewportChange:oe,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:Q,focusSelectedItem:j,selectedItemText:Y,position:i,isPositioned:U,searchRef:pe,children:d.jsx(xt.default,{as:mt.Slot,allowPinchZoom:!0,children:d.jsx(pt.FocusScope,{asChild:!0,trapped:m.open,onMountAutoFocus:p=>{p.preventDefault()},onUnmountAutoFocus:E.composeEventHandlers(r,p=>{m.trigger?.focus({preventScroll:!0}),p.preventDefault()}),children:d.jsx(dt.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:n,onFocusOutside:p=>p.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:p=>p.preventDefault(),...g,...ne,onPlaced:()=>V(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:E.composeEventHandlers(g.onKeyDown,p=>{const I=p.ctrlKey||p.altKey||p.metaKey;if(p.key==="Tab"&&p.preventDefault(),!I&&p.key.length===1&&ce(p.key),["ArrowUp","ArrowDown","Home","End"].includes(p.key)){let x=k().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(p.key)&&(x=x.slice().reverse()),["ArrowUp","ArrowDown"].includes(p.key)){const C=p.target,P=x.indexOf(C);x=x.slice(P+1)}setTimeout(()=>_(x)),p.preventDefault()}})})})})})})});Ue.displayName=_t;var Nt="SelectItemAlignedPosition",Ke=t.forwardRef((o,l)=>{const{__scopeSelect:e,onPlaced:i,...r}=o,u=G(J,e),n=z(J,e),[s,c]=t.useState(null),[f,S]=t.useState(null),w=H.useComposedRefs(l,b=>S(b)),R=de(e),T=t.useRef(!1),y=t.useRef(!0),{viewport:a,selectedItem:h,selectedItemText:g,focusSelectedItem:m}=n,v=t.useCallback(()=>{if(u.trigger&&u.valueNode&&s&&f&&a&&h&&g){const b=u.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),W=u.valueNode.getBoundingClientRect(),Y=g.getBoundingClientRect();if(u.dir!=="rtl"){const C=Y.left-D.left,P=W.left-C,X=b.left-P,Z=b.width+X,he=Math.max(Z,D.width),ve=window.innerWidth-A,Se=Le.clamp(P,[A,Math.max(A,ve-he)]);s.style.minWidth=Z+"px",s.style.left=Se+"px"}else{const C=D.right-Y.right,P=window.innerWidth-W.right-C,X=window.innerWidth-b.right-P,Z=b.width+X,he=Math.max(Z,D.width),ve=window.innerWidth-A,Se=Le.clamp(P,[A,Math.max(A,ve-he)]);s.style.minWidth=Z+"px",s.style.right=Se+"px"}const L=R(),k=window.innerHeight-A*2,U=a.scrollHeight,V=window.getComputedStyle(f),B=parseInt(V.borderTopWidth,10),_=parseInt(V.paddingTop,10),j=parseInt(V.borderBottomWidth,10),q=parseInt(V.paddingBottom,10),K=B+_+U+q+j,pe=Math.min(h.offsetHeight*5,K),ce=window.getComputedStyle(a),fe=parseInt(ce.paddingTop,10),me=parseInt(ce.paddingBottom,10),Q=b.top+b.height/2-A,le=k-Q,ne=h.offsetHeight/2,p=h.offsetTop+ne,I=B+_+p,N=K-I;if(I<=Q){const C=L.length>0&&h===L[L.length-1].ref.current;s.style.bottom="0px";const P=f.clientHeight-a.offsetTop-a.offsetHeight,X=Math.max(le,ne+(C?me:0)+P+j),Z=I+X;s.style.height=Z+"px"}else{const C=L.length>0&&h===L[0].ref.current;s.style.top="0px";const X=Math.max(Q,B+a.offsetTop+(C?fe:0)+ne)+N;s.style.height=X+"px",a.scrollTop=I-Q+a.offsetTop}s.style.margin=`${A}px 0`,s.style.minHeight=pe+"px",s.style.maxHeight=k+"px",i?.(),requestAnimationFrame(()=>T.current=!0)}},[R,u.trigger,u.valueNode,s,f,a,h,g,u.dir,i]);$.useLayoutEffect(()=>v(),[v]);const[F,O]=t.useState();$.useLayoutEffect(()=>{f&&O(window.getComputedStyle(f).zIndex)},[f]);const oe=t.useCallback(b=>{b&&y.current===!0&&(v(),m?.(),y.current=!1)},[v,m]);return d.jsx(Ot,{scope:e,contentWrapper:s,shouldExpandOnScrollRef:T,onScrollButtonChange:oe,children:d.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(M.Primitive.div,{...r,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});Ke.displayName=Nt;var Mt="SelectPopperPosition",ge=t.forwardRef((o,l)=>{const{__scopeSelect:e,align:i="start",collisionPadding:r=A,...u}=o,n=ue(e);return d.jsx(ee.Content,{...n,...u,ref:l,align:i,collisionPadding:r,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ge.displayName=Mt;var[Ot,Ne]=te(J,{}),xe="SelectViewport",Me=t.forwardRef((o,l)=>{const{__scopeSelect:e,nonce:i,...r}=o,u=z(xe,e),n=Ne(xe,e),s=H.useComposedRefs(l,u.onViewportChange),c=t.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),d.jsx(ae.Slot,{scope:e,children:d.jsx(M.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:E.composeEventHandlers(r.onScroll,f=>{const S=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:R}=n;if(R?.current&&w){const T=Math.abs(c.current-S.scrollTop);if(T>0){const y=window.innerHeight-A*2,a=parseFloat(w.style.minHeight),h=parseFloat(w.style.height),g=Math.max(a,h);if(g<y){const m=g+T,v=Math.min(y,m),F=m-v;w.style.height=v+"px",w.style.bottom==="0px"&&(S.scrollTop=F>0?F:0,w.style.justifyContent="flex-end")}}}c.current=S.scrollTop})})})]})});Me.displayName=xe;var $e="SelectGroup",[At,Dt]=te($e),Ge=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o,r=Ie.useId();return d.jsx(At,{scope:e,id:r,children:d.jsx(M.Primitive.div,{role:"group","aria-labelledby":r,...i,ref:l})})});Ge.displayName=$e;var ze="SelectLabel",Ye=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o,r=Dt(ze,e);return d.jsx(M.Primitive.div,{id:r.id,...i,ref:l})});Ye.displayName=ze;var ie="SelectItem",[jt,Xe]=te(ie),Oe=t.forwardRef((o,l)=>{const{__scopeSelect:e,value:i,disabled:r=!1,textValue:u,...n}=o,s=G(ie,e),c=z(ie,e),f=s.value===i,[S,w]=t.useState(u??""),[R,T]=t.useState(!1),y=H.useComposedRefs(l,m=>c.itemRefCallback?.(m,i,r)),a=Ie.useId(),h=t.useRef("touch"),g=()=>{r||(s.onValueChange(i),s.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(jt,{scope:e,value:i,disabled:r,textId:a,isSelected:f,onItemTextChange:t.useCallback(m=>{w(v=>v||(m?.textContent??"").trim())},[]),children:d.jsx(ae.ItemSlot,{scope:e,value:i,disabled:r,textValue:S,children:d.jsx(M.Primitive.div,{role:"option","aria-labelledby":a,"data-highlighted":R?"":void 0,"aria-selected":f&&R,"data-state":f?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...n,ref:y,onFocus:E.composeEventHandlers(n.onFocus,()=>T(!0)),onBlur:E.composeEventHandlers(n.onBlur,()=>T(!1)),onClick:E.composeEventHandlers(n.onClick,()=>{h.current!=="mouse"&&g()}),onPointerUp:E.composeEventHandlers(n.onPointerUp,()=>{h.current==="mouse"&&g()}),onPointerDown:E.composeEventHandlers(n.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:E.composeEventHandlers(n.onPointerMove,m=>{h.current=m.pointerType,r?c.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:E.composeEventHandlers(n.onPointerLeave,m=>{m.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:E.composeEventHandlers(n.onKeyDown,m=>{c.searchRef?.current!==""&&m.key===" "||(Ct.includes(m.key)&&g(),m.key===" "&&m.preventDefault())})})})})});Oe.displayName=ie;var re="SelectItemText",Ae=t.forwardRef((o,l)=>{const{__scopeSelect:e,className:i,style:r,...u}=o,n=G(re,e),s=z(re,e),c=Xe(re,e),f=Et(re,e),[S,w]=t.useState(null),R=H.useComposedRefs(l,g=>w(g),c.onItemTextChange,g=>s.itemTextRefCallback?.(g,c.value,c.disabled)),T=S?.textContent,y=t.useMemo(()=>d.jsx("option",{value:c.value,disabled:c.disabled,children:T},c.value),[c.disabled,c.value,T]),{onNativeOptionAdd:a,onNativeOptionRemove:h}=f;return $.useLayoutEffect(()=>(a(y),()=>h(y)),[a,h,y]),d.jsxs(d.Fragment,{children:[d.jsx(M.Primitive.span,{id:c.textId,...u,ref:R}),c.isSelected&&n.valueNode&&!n.valueNodeHasChildren?Be.createPortal(u.children,n.valueNode):null]})});Ae.displayName=re;var Ze="SelectItemIndicator",De=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o;return Xe(Ze,e).isSelected?d.jsx(M.Primitive.span,{"aria-hidden":!0,...i,ref:l}):null});De.displayName=Ze;var we="SelectScrollUpButton",je=t.forwardRef((o,l)=>{const e=z(we,o.__scopeSelect),i=Ne(we,o.__scopeSelect),[r,u]=t.useState(!1),n=H.useComposedRefs(l,i.onScrollButtonChange);return $.useLayoutEffect(()=>{if(e.viewport&&e.isPositioned){let s=function(){const f=c.scrollTop>0;u(f)};const c=e.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[e.viewport,e.isPositioned]),r?d.jsx(Je,{...o,ref:n,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=e;s&&c&&(s.scrollTop=s.scrollTop-c.offsetHeight)}}):null});je.displayName=we;var Ce="SelectScrollDownButton",He=t.forwardRef((o,l)=>{const e=z(Ce,o.__scopeSelect),i=Ne(Ce,o.__scopeSelect),[r,u]=t.useState(!1),n=H.useComposedRefs(l,i.onScrollButtonChange);return $.useLayoutEffect(()=>{if(e.viewport&&e.isPositioned){let s=function(){const f=c.scrollHeight-c.clientHeight,S=Math.ceil(c.scrollTop)<f;u(S)};const c=e.viewport;return s(),c.addEventListener("scroll",s),()=>c.removeEventListener("scroll",s)}},[e.viewport,e.isPositioned]),r?d.jsx(Je,{...o,ref:n,onAutoScroll:()=>{const{viewport:s,selectedItem:c}=e;s&&c&&(s.scrollTop=s.scrollTop+c.offsetHeight)}}):null});He.displayName=Ce;var Je=t.forwardRef((o,l)=>{const{__scopeSelect:e,onAutoScroll:i,...r}=o,u=z("SelectScrollButton",e),n=t.useRef(null),s=de(e),c=t.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return t.useEffect(()=>()=>c(),[c]),$.useLayoutEffect(()=>{s().find(S=>S.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[s]),d.jsx(M.Primitive.div,{"aria-hidden":!0,...r,ref:l,style:{flexShrink:0,...r.style},onPointerDown:E.composeEventHandlers(r.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(i,50))}),onPointerMove:E.composeEventHandlers(r.onPointerMove,()=>{u.onItemLeave?.(),n.current===null&&(n.current=window.setInterval(i,50))}),onPointerLeave:E.composeEventHandlers(r.onPointerLeave,()=>{c()})})}),Ht="SelectSeparator",Qe=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o;return d.jsx(M.Primitive.div,{"aria-hidden":!0,...i,ref:l})});Qe.displayName=Ht;var ye="SelectArrow",et=t.forwardRef((o,l)=>{const{__scopeSelect:e,...i}=o,r=ue(e),u=G(ye,e),n=z(ye,e);return u.open&&n.position==="popper"?d.jsx(ee.Arrow,{...r,...i,ref:l}):null});et.displayName=ye;function tt(o){return o===""||o===void 0}var ot=t.forwardRef((o,l)=>{const{value:e,...i}=o,r=t.useRef(null),u=H.useComposedRefs(l,r),n=vt.usePrevious(e);return t.useEffect(()=>{const s=r.current,c=window.HTMLSelectElement.prototype,S=Object.getOwnPropertyDescriptor(c,"value").set;if(n!==e&&S){const w=new Event("change",{bubbles:!0});S.call(s,e),s.dispatchEvent(w)}},[n,e]),d.jsx(St.VisuallyHidden,{asChild:!0,children:d.jsx("select",{...i,ref:u,defaultValue:e})})});ot.displayName="BubbleSelect";function nt(o){const l=ht.useCallbackRef(o),e=t.useRef(""),i=t.useRef(0),r=t.useCallback(n=>{const s=e.current+n;l(s),function c(f){e.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>c(""),1e3))}(s)},[l]),u=t.useCallback(()=>{e.current="",window.clearTimeout(i.current)},[]);return t.useEffect(()=>()=>window.clearTimeout(i.current),[]),[e,r,u]}function rt(o,l,e){const r=l.length>1&&Array.from(l).every(f=>f===l[0])?l[0]:l,u=e?o.indexOf(e):-1;let n=Lt(o,Math.max(u,0));r.length===1&&(n=n.filter(f=>f!==e));const c=n.find(f=>f.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function Lt(o,l){return o.map((e,i)=>o[(l+i)%o.length])}var kt=Te,Vt=Pe,Bt=Ee,qt=Re,Ft=be,Wt=_e,Ut=Me,Kt=Oe,$t=Ae,Gt=De,zt=je,Yt=He;exports.Content=Wt;exports.Icon=qt;exports.Item=Kt;exports.ItemIndicator=Gt;exports.ItemText=$t;exports.Portal=Ft;exports.Root=kt;exports.ScrollDownButton=Yt;exports.ScrollUpButton=zt;exports.Select=Te;exports.SelectArrow=et;exports.SelectContent=_e;exports.SelectGroup=Ge;exports.SelectIcon=Re;exports.SelectItem=Oe;exports.SelectItemIndicator=De;exports.SelectItemText=Ae;exports.SelectLabel=Ye;exports.SelectPortal=be;exports.SelectScrollDownButton=He;exports.SelectScrollUpButton=je;exports.SelectSeparator=Qe;exports.SelectTrigger=Pe;exports.SelectValue=Ee;exports.SelectViewport=Me;exports.Trigger=Vt;exports.Value=Bt;exports.Viewport=Ut;exports.createSelectScope=It;
2
2
  //# sourceMappingURL=index.cjs37.js.map
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./index.cjs51.js");/**
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./index.cjs49.js");/**
2
2
  * @license lucide-react v0.477.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.