@valbuild/ui 0.48.1 → 0.49.0

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.
@@ -32479,16 +32479,16 @@ new Sym("()");
32479
32479
  var VAL_EXTENSION = "_type";
32480
32480
  var FILE_REF_PROP = "_ref";
32481
32481
  function convertFileSource(src) {
32482
- var _src$metadata2;
32482
+ var _src$metadata3, _src$metadata4;
32483
32483
  if (!src[FILE_REF_PROP].startsWith("/public")) {
32484
- var _src$metadata;
32484
+ var _src$metadata, _src$metadata2;
32485
32485
  return {
32486
- url: src[FILE_REF_PROP] + "?sha256=".concat((_src$metadata = src.metadata) === null || _src$metadata === void 0 ? void 0 : _src$metadata.sha256),
32486
+ url: src[FILE_REF_PROP] + ((_src$metadata = src.metadata) !== null && _src$metadata !== void 0 && _src$metadata.sha256 ? "?sha256=".concat((_src$metadata2 = src.metadata) === null || _src$metadata2 === void 0 ? void 0 : _src$metadata2.sha256) : ""),
32487
32487
  metadata: src.metadata
32488
32488
  };
32489
32489
  }
32490
32490
  return {
32491
- url: src[FILE_REF_PROP].slice("/public".length) + "?sha256=".concat((_src$metadata2 = src.metadata) === null || _src$metadata2 === void 0 ? void 0 : _src$metadata2.sha256),
32491
+ url: src[FILE_REF_PROP].slice("/public".length) + ((_src$metadata3 = src.metadata) !== null && _src$metadata3 !== void 0 && _src$metadata3.sha256 ? "?sha256=".concat((_src$metadata4 = src.metadata) === null || _src$metadata4 === void 0 ? void 0 : _src$metadata4.sha256) : ""),
32492
32492
  metadata: src.metadata
32493
32493
  };
32494
32494
  }
@@ -38187,6 +38187,21 @@ const ChevronDown = createLucideIcon("ChevronDown", [
38187
38187
  const ChevronLeft = createLucideIcon("ChevronLeft", [
38188
38188
  ["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
38189
38189
  ]);
38190
+ const Diff = createLucideIcon("Diff", [
38191
+ ["path", { d: "M12 3v14", key: "7cf3v8" }],
38192
+ ["path", { d: "M5 10h14", key: "elsbfy" }],
38193
+ ["path", { d: "M5 21h14", key: "11awu3" }]
38194
+ ]);
38195
+ const File = createLucideIcon("File", [
38196
+ [
38197
+ "path",
38198
+ {
38199
+ d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",
38200
+ key: "1nnpy2"
38201
+ }
38202
+ ],
38203
+ ["polyline", { points: "14 2 14 8 20 8", key: "1ew0cm" }]
38204
+ ]);
38190
38205
  const LogIn = createLucideIcon("LogIn", [
38191
38206
  ["path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4", key: "u53s6r" }],
38192
38207
  ["polyline", { points: "10 17 15 12 10 7", key: "1ail0h" }],
@@ -53925,7 +53940,701 @@ function _nonIterableSpread() {
53925
53940
  function _toConsumableArray(arr) {
53926
53941
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
53927
53942
  }
53928
- var MIME_TYPE_REGEX = /^data:(image\/(png|jpeg|jpg|gif|webp|bmp|tiff|ico|svg\+xml));base64,/;
53943
+ var EXT_TO_MIME_TYPES = {
53944
+ x3d: "application/vnd.hzn-3d-crossword",
53945
+ "3gp": "video/3gpp",
53946
+ "3g2": "video/3gpp2",
53947
+ mseq: "application/vnd.mseq",
53948
+ pwn: "application/vnd.3m.post-it-notes",
53949
+ plb: "application/vnd.3gpp.pic-bw-large",
53950
+ psb: "application/vnd.3gpp.pic-bw-small",
53951
+ pvb: "application/vnd.3gpp.pic-bw-var",
53952
+ tcap: "application/vnd.3gpp2.tcap",
53953
+ "7z": "application/x-7z-compressed",
53954
+ abw: "application/x-abiword",
53955
+ ace: "application/x-ace-compressed",
53956
+ acc: "application/vnd.americandynamics.acc",
53957
+ acu: "application/vnd.acucobol",
53958
+ atc: "application/vnd.acucorp",
53959
+ adp: "audio/adpcm",
53960
+ aab: "application/x-authorware-bin",
53961
+ aam: "application/x-authorware-map",
53962
+ aas: "application/x-authorware-seg",
53963
+ air: "application/vnd.adobe.air-application-installer-package+zip",
53964
+ swf: "application/x-shockwave-flash",
53965
+ fxp: "application/vnd.adobe.fxp",
53966
+ pdf: "application/pdf",
53967
+ ppd: "application/vnd.cups-ppd",
53968
+ dir: "application/x-director",
53969
+ xdp: "application/vnd.adobe.xdp+xml",
53970
+ xfdf: "application/vnd.adobe.xfdf",
53971
+ aac: "audio/x-aac",
53972
+ ahead: "application/vnd.ahead.space",
53973
+ azf: "application/vnd.airzip.filesecure.azf",
53974
+ azs: "application/vnd.airzip.filesecure.azs",
53975
+ azw: "application/vnd.amazon.ebook",
53976
+ ami: "application/vnd.amiga.ami",
53977
+ "N/A": "application/andrew-inset",
53978
+ apk: "application/vnd.android.package-archive",
53979
+ cii: "application/vnd.anser-web-certificate-issue-initiation",
53980
+ fti: "application/vnd.anser-web-funds-transfer-initiation",
53981
+ atx: "application/vnd.antix.game-component",
53982
+ dmg: "application/x-apple-diskimage",
53983
+ mpkg: "application/vnd.apple.installer+xml",
53984
+ aw: "application/applixware",
53985
+ mp3: "audio/mpeg",
53986
+ les: "application/vnd.hhe.lesson-player",
53987
+ swi: "application/vnd.aristanetworks.swi",
53988
+ s: "text/x-asm",
53989
+ atomcat: "application/atomcat+xml",
53990
+ atomsvc: "application/atomsvc+xml",
53991
+ atom: "application/atom+xml",
53992
+ ac: "application/pkix-attr-cert",
53993
+ aif: "audio/x-aiff",
53994
+ avi: "video/x-msvideo",
53995
+ aep: "application/vnd.audiograph",
53996
+ dxf: "image/vnd.dxf",
53997
+ dwf: "model/vnd.dwf",
53998
+ par: "text/plain-bas",
53999
+ bcpio: "application/x-bcpio",
54000
+ bin: "application/octet-stream",
54001
+ bmp: "image/bmp",
54002
+ torrent: "application/x-bittorrent",
54003
+ cod: "application/vnd.rim.cod",
54004
+ mpm: "application/vnd.blueice.multipass",
54005
+ bmi: "application/vnd.bmi",
54006
+ sh: "application/x-sh",
54007
+ btif: "image/prs.btif",
54008
+ rep: "application/vnd.businessobjects",
54009
+ bz: "application/x-bzip",
54010
+ bz2: "application/x-bzip2",
54011
+ csh: "application/x-csh",
54012
+ c: "text/x-c",
54013
+ cdxml: "application/vnd.chemdraw+xml",
54014
+ css: "text/css",
54015
+ cdx: "chemical/x-cdx",
54016
+ cml: "chemical/x-cml",
54017
+ csml: "chemical/x-csml",
54018
+ cdbcmsg: "application/vnd.contact.cmsg",
54019
+ cla: "application/vnd.claymore",
54020
+ c4g: "application/vnd.clonk.c4group",
54021
+ sub: "image/vnd.dvb.subtitle",
54022
+ cdmia: "application/cdmi-capability",
54023
+ cdmic: "application/cdmi-container",
54024
+ cdmid: "application/cdmi-domain",
54025
+ cdmio: "application/cdmi-object",
54026
+ cdmiq: "application/cdmi-queue",
54027
+ c11amc: "application/vnd.cluetrust.cartomobile-config",
54028
+ c11amz: "application/vnd.cluetrust.cartomobile-config-pkg",
54029
+ ras: "image/x-cmu-raster",
54030
+ dae: "model/vnd.collada+xml",
54031
+ csv: "text/csv",
54032
+ cpt: "application/mac-compactpro",
54033
+ wmlc: "application/vnd.wap.wmlc",
54034
+ cgm: "image/cgm",
54035
+ ice: "x-conference/x-cooltalk",
54036
+ cmx: "image/x-cmx",
54037
+ xar: "application/vnd.xara",
54038
+ cmc: "application/vnd.cosmocaller",
54039
+ cpio: "application/x-cpio",
54040
+ clkx: "application/vnd.crick.clicker",
54041
+ clkk: "application/vnd.crick.clicker.keyboard",
54042
+ clkp: "application/vnd.crick.clicker.palette",
54043
+ clkt: "application/vnd.crick.clicker.template",
54044
+ clkw: "application/vnd.crick.clicker.wordbank",
54045
+ wbs: "application/vnd.criticaltools.wbs+xml",
54046
+ cryptonote: "application/vnd.rig.cryptonote",
54047
+ cif: "chemical/x-cif",
54048
+ cmdf: "chemical/x-cmdf",
54049
+ cu: "application/cu-seeme",
54050
+ cww: "application/prs.cww",
54051
+ curl: "text/vnd.curl",
54052
+ dcurl: "text/vnd.curl.dcurl",
54053
+ mcurl: "text/vnd.curl.mcurl",
54054
+ scurl: "text/vnd.curl.scurl",
54055
+ car: "application/vnd.curl.car",
54056
+ pcurl: "application/vnd.curl.pcurl",
54057
+ cmp: "application/vnd.yellowriver-custom-menu",
54058
+ dssc: "application/dssc+der",
54059
+ xdssc: "application/dssc+xml",
54060
+ deb: "application/x-debian-package",
54061
+ uva: "audio/vnd.dece.audio",
54062
+ uvi: "image/vnd.dece.graphic",
54063
+ uvh: "video/vnd.dece.hd",
54064
+ uvm: "video/vnd.dece.mobile",
54065
+ uvu: "video/vnd.uvvu.mp4",
54066
+ uvp: "video/vnd.dece.pd",
54067
+ uvs: "video/vnd.dece.sd",
54068
+ uvv: "video/vnd.dece.video",
54069
+ dvi: "application/x-dvi",
54070
+ seed: "application/vnd.fdsn.seed",
54071
+ dtb: "application/x-dtbook+xml",
54072
+ res: "application/x-dtbresource+xml",
54073
+ ait: "application/vnd.dvb.ait",
54074
+ svc: "application/vnd.dvb.service",
54075
+ eol: "audio/vnd.digital-winds",
54076
+ djvu: "image/vnd.djvu",
54077
+ dtd: "application/xml-dtd",
54078
+ mlp: "application/vnd.dolby.mlp",
54079
+ wad: "application/x-doom",
54080
+ dpg: "application/vnd.dpgraph",
54081
+ dra: "audio/vnd.dra",
54082
+ dfac: "application/vnd.dreamfactory",
54083
+ dts: "audio/vnd.dts",
54084
+ dtshd: "audio/vnd.dts.hd",
54085
+ dwg: "image/vnd.dwg",
54086
+ geo: "application/vnd.dynageo",
54087
+ es: "application/ecmascript",
54088
+ mag: "application/vnd.ecowin.chart",
54089
+ mmr: "image/vnd.fujixerox.edmics-mmr",
54090
+ rlc: "image/vnd.fujixerox.edmics-rlc",
54091
+ exi: "application/exi",
54092
+ mgz: "application/vnd.proteus.magazine",
54093
+ epub: "application/epub+zip",
54094
+ eml: "message/rfc822",
54095
+ nml: "application/vnd.enliven",
54096
+ xpr: "application/vnd.is-xpr",
54097
+ xif: "image/vnd.xiff",
54098
+ xfdl: "application/vnd.xfdl",
54099
+ emma: "application/emma+xml",
54100
+ ez2: "application/vnd.ezpix-album",
54101
+ ez3: "application/vnd.ezpix-package",
54102
+ fst: "image/vnd.fst",
54103
+ fvt: "video/vnd.fvt",
54104
+ fbs: "image/vnd.fastbidsheet",
54105
+ fe_launch: "application/vnd.denovo.fcselayout-link",
54106
+ f4v: "video/x-f4v",
54107
+ flv: "video/x-flv",
54108
+ fpx: "image/vnd.fpx",
54109
+ npx: "image/vnd.net-fpx",
54110
+ flx: "text/vnd.fmi.flexstor",
54111
+ fli: "video/x-fli",
54112
+ ftc: "application/vnd.fluxtime.clip",
54113
+ fdf: "application/vnd.fdf",
54114
+ f: "text/x-fortran",
54115
+ mif: "application/vnd.mif",
54116
+ fm: "application/vnd.framemaker",
54117
+ fh: "image/x-freehand",
54118
+ fsc: "application/vnd.fsc.weblaunch",
54119
+ fnc: "application/vnd.frogans.fnc",
54120
+ ltf: "application/vnd.frogans.ltf",
54121
+ ddd: "application/vnd.fujixerox.ddd",
54122
+ xdw: "application/vnd.fujixerox.docuworks",
54123
+ xbd: "application/vnd.fujixerox.docuworks.binder",
54124
+ oas: "application/vnd.fujitsu.oasys",
54125
+ oa2: "application/vnd.fujitsu.oasys2",
54126
+ oa3: "application/vnd.fujitsu.oasys3",
54127
+ fg5: "application/vnd.fujitsu.oasysgp",
54128
+ bh2: "application/vnd.fujitsu.oasysprs",
54129
+ spl: "application/x-futuresplash",
54130
+ fzs: "application/vnd.fuzzysheet",
54131
+ g3: "image/g3fax",
54132
+ gmx: "application/vnd.gmx",
54133
+ gtw: "model/vnd.gtw",
54134
+ txd: "application/vnd.genomatix.tuxedo",
54135
+ ggb: "application/vnd.geogebra.file",
54136
+ ggt: "application/vnd.geogebra.tool",
54137
+ gdl: "model/vnd.gdl",
54138
+ gex: "application/vnd.geometry-explorer",
54139
+ gxt: "application/vnd.geonext",
54140
+ g2w: "application/vnd.geoplan",
54141
+ g3w: "application/vnd.geospace",
54142
+ gsf: "application/x-font-ghostscript",
54143
+ bdf: "application/x-font-bdf",
54144
+ gtar: "application/x-gtar",
54145
+ texinfo: "application/x-texinfo",
54146
+ gnumeric: "application/x-gnumeric",
54147
+ kml: "application/vnd.google-earth.kml+xml",
54148
+ kmz: "application/vnd.google-earth.kmz",
54149
+ gqf: "application/vnd.grafeq",
54150
+ gif: "image/gif",
54151
+ gv: "text/vnd.graphviz",
54152
+ gac: "application/vnd.groove-account",
54153
+ ghf: "application/vnd.groove-help",
54154
+ gim: "application/vnd.groove-identity-message",
54155
+ grv: "application/vnd.groove-injector",
54156
+ gtm: "application/vnd.groove-tool-message",
54157
+ tpl: "application/vnd.groove-tool-template",
54158
+ vcg: "application/vnd.groove-vcard",
54159
+ h261: "video/h261",
54160
+ h263: "video/h263",
54161
+ h264: "video/h264",
54162
+ hpid: "application/vnd.hp-hpid",
54163
+ hps: "application/vnd.hp-hps",
54164
+ hdf: "application/x-hdf",
54165
+ rip: "audio/vnd.rip",
54166
+ hbci: "application/vnd.hbci",
54167
+ jlt: "application/vnd.hp-jlyt",
54168
+ pcl: "application/vnd.hp-pcl",
54169
+ hpgl: "application/vnd.hp-hpgl",
54170
+ hvs: "application/vnd.yamaha.hv-script",
54171
+ hvd: "application/vnd.yamaha.hv-dic",
54172
+ hvp: "application/vnd.yamaha.hv-voice",
54173
+ "sfd-hdstx": "application/vnd.hydrostatix.sof-data",
54174
+ stk: "application/hyperstudio",
54175
+ hal: "application/vnd.hal+xml",
54176
+ html: "text/html",
54177
+ irm: "application/vnd.ibm.rights-management",
54178
+ sc: "application/vnd.ibm.secure-container",
54179
+ ics: "text/calendar",
54180
+ icc: "application/vnd.iccprofile",
54181
+ ico: "image/x-icon",
54182
+ igl: "application/vnd.igloader",
54183
+ ief: "image/ief",
54184
+ ivp: "application/vnd.immervision-ivp",
54185
+ ivu: "application/vnd.immervision-ivu",
54186
+ rif: "application/reginfo+xml",
54187
+ "3dml": "text/vnd.in3d.3dml",
54188
+ spot: "text/vnd.in3d.spot",
54189
+ igs: "model/iges",
54190
+ i2g: "application/vnd.intergeo",
54191
+ cdy: "application/vnd.cinderella",
54192
+ xpw: "application/vnd.intercon.formnet",
54193
+ fcs: "application/vnd.isac.fcs",
54194
+ ipfix: "application/ipfix",
54195
+ cer: "application/pkix-cert",
54196
+ pki: "application/pkixcmp",
54197
+ crl: "application/pkix-crl",
54198
+ pkipath: "application/pkix-pkipath",
54199
+ igm: "application/vnd.insors.igm",
54200
+ rcprofile: "application/vnd.ipunplugged.rcprofile",
54201
+ irp: "application/vnd.irepository.package+xml",
54202
+ jad: "text/vnd.sun.j2me.app-descriptor",
54203
+ jar: "application/java-archive",
54204
+ "class": "application/java-vm",
54205
+ jnlp: "application/x-java-jnlp-file",
54206
+ ser: "application/java-serialized-object",
54207
+ java: "text/x-java-source,java",
54208
+ js: "application/javascript",
54209
+ json: "application/json",
54210
+ joda: "application/vnd.joost.joda-archive",
54211
+ jpm: "video/jpm",
54212
+ jpeg: "image/jpeg",
54213
+ jpg: "image/jpeg",
54214
+ pjpeg: "image/pjpeg",
54215
+ jpgv: "video/jpeg",
54216
+ ktz: "application/vnd.kahootz",
54217
+ mmd: "application/vnd.chipnuts.karaoke-mmd",
54218
+ karbon: "application/vnd.kde.karbon",
54219
+ chrt: "application/vnd.kde.kchart",
54220
+ kfo: "application/vnd.kde.kformula",
54221
+ flw: "application/vnd.kde.kivio",
54222
+ kon: "application/vnd.kde.kontour",
54223
+ kpr: "application/vnd.kde.kpresenter",
54224
+ ksp: "application/vnd.kde.kspread",
54225
+ kwd: "application/vnd.kde.kword",
54226
+ htke: "application/vnd.kenameaapp",
54227
+ kia: "application/vnd.kidspiration",
54228
+ kne: "application/vnd.kinar",
54229
+ sse: "application/vnd.kodak-descriptor",
54230
+ lasxml: "application/vnd.las.las+xml",
54231
+ latex: "application/x-latex",
54232
+ lbd: "application/vnd.llamagraphics.life-balance.desktop",
54233
+ lbe: "application/vnd.llamagraphics.life-balance.exchange+xml",
54234
+ jam: "application/vnd.jam",
54235
+ "123": "application/vnd.lotus-1-2-3",
54236
+ apr: "application/vnd.lotus-approach",
54237
+ pre: "application/vnd.lotus-freelance",
54238
+ nsf: "application/vnd.lotus-notes",
54239
+ org: "application/vnd.lotus-organizer",
54240
+ scm: "application/vnd.lotus-screencam",
54241
+ lwp: "application/vnd.lotus-wordpro",
54242
+ lvp: "audio/vnd.lucent.voice",
54243
+ m3u: "audio/x-mpegurl",
54244
+ m4v: "video/x-m4v",
54245
+ hqx: "application/mac-binhex40",
54246
+ portpkg: "application/vnd.macports.portpkg",
54247
+ mgp: "application/vnd.osgeo.mapguide.package",
54248
+ mrc: "application/marc",
54249
+ mrcx: "application/marcxml+xml",
54250
+ mxf: "application/mxf",
54251
+ nbp: "application/vnd.wolfram.player",
54252
+ ma: "application/mathematica",
54253
+ mathml: "application/mathml+xml",
54254
+ mbox: "application/mbox",
54255
+ mc1: "application/vnd.medcalcdata",
54256
+ mscml: "application/mediaservercontrol+xml",
54257
+ cdkey: "application/vnd.mediastation.cdkey",
54258
+ mwf: "application/vnd.mfer",
54259
+ mfm: "application/vnd.mfmp",
54260
+ msh: "model/mesh",
54261
+ mads: "application/mads+xml",
54262
+ mets: "application/mets+xml",
54263
+ mods: "application/mods+xml",
54264
+ meta4: "application/metalink4+xml",
54265
+ mcd: "application/vnd.mcd",
54266
+ flo: "application/vnd.micrografx.flo",
54267
+ igx: "application/vnd.micrografx.igx",
54268
+ es3: "application/vnd.eszigno3+xml",
54269
+ mdb: "application/x-msaccess",
54270
+ asf: "video/x-ms-asf",
54271
+ exe: "application/x-msdownload",
54272
+ cil: "application/vnd.ms-artgalry",
54273
+ cab: "application/vnd.ms-cab-compressed",
54274
+ ims: "application/vnd.ms-ims",
54275
+ application: "application/x-ms-application",
54276
+ clp: "application/x-msclip",
54277
+ mdi: "image/vnd.ms-modi",
54278
+ eot: "application/vnd.ms-fontobject",
54279
+ xls: "application/vnd.ms-excel",
54280
+ xlam: "application/vnd.ms-excel.addin.macroenabled.12",
54281
+ xlsb: "application/vnd.ms-excel.sheet.binary.macroenabled.12",
54282
+ xltm: "application/vnd.ms-excel.template.macroenabled.12",
54283
+ xlsm: "application/vnd.ms-excel.sheet.macroenabled.12",
54284
+ chm: "application/vnd.ms-htmlhelp",
54285
+ crd: "application/x-mscardfile",
54286
+ lrm: "application/vnd.ms-lrm",
54287
+ mvb: "application/x-msmediaview",
54288
+ mny: "application/x-msmoney",
54289
+ pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
54290
+ sldx: "application/vnd.openxmlformats-officedocument.presentationml.slide",
54291
+ ppsx: "application/vnd.openxmlformats-officedocument.presentationml.slideshow",
54292
+ potx: "application/vnd.openxmlformats-officedocument.presentationml.template",
54293
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
54294
+ xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
54295
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
54296
+ dotx: "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
54297
+ obd: "application/x-msbinder",
54298
+ thmx: "application/vnd.ms-officetheme",
54299
+ onetoc: "application/onenote",
54300
+ pya: "audio/vnd.ms-playready.media.pya",
54301
+ pyv: "video/vnd.ms-playready.media.pyv",
54302
+ ppt: "application/vnd.ms-powerpoint",
54303
+ ppam: "application/vnd.ms-powerpoint.addin.macroenabled.12",
54304
+ sldm: "application/vnd.ms-powerpoint.slide.macroenabled.12",
54305
+ pptm: "application/vnd.ms-powerpoint.presentation.macroenabled.12",
54306
+ ppsm: "application/vnd.ms-powerpoint.slideshow.macroenabled.12",
54307
+ potm: "application/vnd.ms-powerpoint.template.macroenabled.12",
54308
+ mpp: "application/vnd.ms-project",
54309
+ pub: "application/x-mspublisher",
54310
+ scd: "application/x-msschedule",
54311
+ xap: "application/x-silverlight-app",
54312
+ stl: "application/vnd.ms-pki.stl",
54313
+ cat: "application/vnd.ms-pki.seccat",
54314
+ vsd: "application/vnd.visio",
54315
+ vsdx: "application/vnd.visio2013",
54316
+ wm: "video/x-ms-wm",
54317
+ wma: "audio/x-ms-wma",
54318
+ wax: "audio/x-ms-wax",
54319
+ wmx: "video/x-ms-wmx",
54320
+ wmd: "application/x-ms-wmd",
54321
+ wpl: "application/vnd.ms-wpl",
54322
+ wmz: "application/x-ms-wmz",
54323
+ wmv: "video/x-ms-wmv",
54324
+ wvx: "video/x-ms-wvx",
54325
+ wmf: "application/x-msmetafile",
54326
+ trm: "application/x-msterminal",
54327
+ doc: "application/msword",
54328
+ docm: "application/vnd.ms-word.document.macroenabled.12",
54329
+ dotm: "application/vnd.ms-word.template.macroenabled.12",
54330
+ wri: "application/x-mswrite",
54331
+ wps: "application/vnd.ms-works",
54332
+ xbap: "application/x-ms-xbap",
54333
+ xps: "application/vnd.ms-xpsdocument",
54334
+ mid: "audio/midi",
54335
+ mpy: "application/vnd.ibm.minipay",
54336
+ afp: "application/vnd.ibm.modcap",
54337
+ rms: "application/vnd.jcp.javame.midlet-rms",
54338
+ tmo: "application/vnd.tmobile-livetv",
54339
+ prc: "application/x-mobipocket-ebook",
54340
+ mbk: "application/vnd.mobius.mbk",
54341
+ dis: "application/vnd.mobius.dis",
54342
+ plc: "application/vnd.mobius.plc",
54343
+ mqy: "application/vnd.mobius.mqy",
54344
+ msl: "application/vnd.mobius.msl",
54345
+ txf: "application/vnd.mobius.txf",
54346
+ daf: "application/vnd.mobius.daf",
54347
+ fly: "text/vnd.fly",
54348
+ mpc: "application/vnd.mophun.certificate",
54349
+ mpn: "application/vnd.mophun.application",
54350
+ mj2: "video/mj2",
54351
+ mpga: "audio/mpeg",
54352
+ mxu: "video/vnd.mpegurl",
54353
+ mpeg: "video/mpeg",
54354
+ m21: "application/mp21",
54355
+ mp4a: "audio/mp4",
54356
+ mp4: "video/mp4",
54357
+ m3u8: "application/vnd.apple.mpegurl",
54358
+ mus: "application/vnd.musician",
54359
+ msty: "application/vnd.muvee.style",
54360
+ mxml: "application/xv+xml",
54361
+ ngdat: "application/vnd.nokia.n-gage.data",
54362
+ "n-gage": "application/vnd.nokia.n-gage.symbian.install",
54363
+ ncx: "application/x-dtbncx+xml",
54364
+ nc: "application/x-netcdf",
54365
+ nlu: "application/vnd.neurolanguage.nlu",
54366
+ dna: "application/vnd.dna",
54367
+ nnd: "application/vnd.noblenet-directory",
54368
+ nns: "application/vnd.noblenet-sealer",
54369
+ nnw: "application/vnd.noblenet-web",
54370
+ rpst: "application/vnd.nokia.radio-preset",
54371
+ rpss: "application/vnd.nokia.radio-presets",
54372
+ n3: "text/n3",
54373
+ edm: "application/vnd.novadigm.edm",
54374
+ edx: "application/vnd.novadigm.edx",
54375
+ ext: "application/vnd.novadigm.ext",
54376
+ gph: "application/vnd.flographit",
54377
+ ecelp4800: "audio/vnd.nuera.ecelp4800",
54378
+ ecelp7470: "audio/vnd.nuera.ecelp7470",
54379
+ ecelp9600: "audio/vnd.nuera.ecelp9600",
54380
+ oda: "application/oda",
54381
+ ogx: "application/ogg",
54382
+ oga: "audio/ogg",
54383
+ ogv: "video/ogg",
54384
+ dd2: "application/vnd.oma.dd2+xml",
54385
+ oth: "application/vnd.oasis.opendocument.text-web",
54386
+ opf: "application/oebps-package+xml",
54387
+ qbo: "application/vnd.intu.qbo",
54388
+ oxt: "application/vnd.openofficeorg.extension",
54389
+ osf: "application/vnd.yamaha.openscoreformat",
54390
+ weba: "audio/webm",
54391
+ webm: "video/webm",
54392
+ odc: "application/vnd.oasis.opendocument.chart",
54393
+ otc: "application/vnd.oasis.opendocument.chart-template",
54394
+ odb: "application/vnd.oasis.opendocument.database",
54395
+ odf: "application/vnd.oasis.opendocument.formula",
54396
+ odft: "application/vnd.oasis.opendocument.formula-template",
54397
+ odg: "application/vnd.oasis.opendocument.graphics",
54398
+ otg: "application/vnd.oasis.opendocument.graphics-template",
54399
+ odi: "application/vnd.oasis.opendocument.image",
54400
+ oti: "application/vnd.oasis.opendocument.image-template",
54401
+ odp: "application/vnd.oasis.opendocument.presentation",
54402
+ otp: "application/vnd.oasis.opendocument.presentation-template",
54403
+ ods: "application/vnd.oasis.opendocument.spreadsheet",
54404
+ ots: "application/vnd.oasis.opendocument.spreadsheet-template",
54405
+ odt: "application/vnd.oasis.opendocument.text",
54406
+ odm: "application/vnd.oasis.opendocument.text-master",
54407
+ ott: "application/vnd.oasis.opendocument.text-template",
54408
+ ktx: "image/ktx",
54409
+ sxc: "application/vnd.sun.xml.calc",
54410
+ stc: "application/vnd.sun.xml.calc.template",
54411
+ sxd: "application/vnd.sun.xml.draw",
54412
+ std: "application/vnd.sun.xml.draw.template",
54413
+ sxi: "application/vnd.sun.xml.impress",
54414
+ sti: "application/vnd.sun.xml.impress.template",
54415
+ sxm: "application/vnd.sun.xml.math",
54416
+ sxw: "application/vnd.sun.xml.writer",
54417
+ sxg: "application/vnd.sun.xml.writer.global",
54418
+ stw: "application/vnd.sun.xml.writer.template",
54419
+ otf: "application/x-font-otf",
54420
+ osfpvg: "application/vnd.yamaha.openscoreformat.osfpvg+xml",
54421
+ dp: "application/vnd.osgi.dp",
54422
+ pdb: "application/vnd.palm",
54423
+ p: "text/x-pascal",
54424
+ paw: "application/vnd.pawaafile",
54425
+ pclxl: "application/vnd.hp-pclxl",
54426
+ efif: "application/vnd.picsel",
54427
+ pcx: "image/x-pcx",
54428
+ psd: "image/vnd.adobe.photoshop",
54429
+ prf: "application/pics-rules",
54430
+ pic: "image/x-pict",
54431
+ chat: "application/x-chat",
54432
+ p10: "application/pkcs10",
54433
+ p12: "application/x-pkcs12",
54434
+ p7m: "application/pkcs7-mime",
54435
+ p7s: "application/pkcs7-signature",
54436
+ p7r: "application/x-pkcs7-certreqresp",
54437
+ p7b: "application/x-pkcs7-certificates",
54438
+ p8: "application/pkcs8",
54439
+ plf: "application/vnd.pocketlearn",
54440
+ pnm: "image/x-portable-anymap",
54441
+ pbm: "image/x-portable-bitmap",
54442
+ pcf: "application/x-font-pcf",
54443
+ pfr: "application/font-tdpfr",
54444
+ pgn: "application/x-chess-pgn",
54445
+ pgm: "image/x-portable-graymap",
54446
+ png: "image/png",
54447
+ ppm: "image/x-portable-pixmap",
54448
+ pskcxml: "application/pskc+xml",
54449
+ pml: "application/vnd.ctc-posml",
54450
+ ai: "application/postscript",
54451
+ pfa: "application/x-font-type1",
54452
+ pbd: "application/vnd.powerbuilder6",
54453
+ pgp: "application/pgp-signature",
54454
+ box: "application/vnd.previewsystems.box",
54455
+ ptid: "application/vnd.pvi.ptid1",
54456
+ pls: "application/pls+xml",
54457
+ str: "application/vnd.pg.format",
54458
+ ei6: "application/vnd.pg.osasli",
54459
+ dsc: "text/prs.lines.tag",
54460
+ psf: "application/x-font-linux-psf",
54461
+ qps: "application/vnd.publishare-delta-tree",
54462
+ wg: "application/vnd.pmi.widget",
54463
+ qxd: "application/vnd.quark.quarkxpress",
54464
+ esf: "application/vnd.epson.esf",
54465
+ msf: "application/vnd.epson.msf",
54466
+ ssf: "application/vnd.epson.ssf",
54467
+ qam: "application/vnd.epson.quickanime",
54468
+ qfx: "application/vnd.intu.qfx",
54469
+ qt: "video/quicktime",
54470
+ rar: "application/x-rar-compressed",
54471
+ ram: "audio/x-pn-realaudio",
54472
+ rmp: "audio/x-pn-realaudio-plugin",
54473
+ rsd: "application/rsd+xml",
54474
+ rm: "application/vnd.rn-realmedia",
54475
+ bed: "application/vnd.realvnc.bed",
54476
+ mxl: "application/vnd.recordare.musicxml",
54477
+ musicxml: "application/vnd.recordare.musicxml+xml",
54478
+ rnc: "application/relax-ng-compact-syntax",
54479
+ rdz: "application/vnd.data-vision.rdz",
54480
+ rdf: "application/rdf+xml",
54481
+ rp9: "application/vnd.cloanto.rp9",
54482
+ jisp: "application/vnd.jisp",
54483
+ rtf: "application/rtf",
54484
+ rtx: "text/richtext",
54485
+ link66: "application/vnd.route66.link66+xml",
54486
+ rss: "application/rss+xml",
54487
+ shf: "application/shf+xml",
54488
+ st: "application/vnd.sailingtracker.track",
54489
+ svg: "image/svg+xml",
54490
+ sus: "application/vnd.sus-calendar",
54491
+ sru: "application/sru+xml",
54492
+ setpay: "application/set-payment-initiation",
54493
+ setreg: "application/set-registration-initiation",
54494
+ sema: "application/vnd.sema",
54495
+ semd: "application/vnd.semd",
54496
+ semf: "application/vnd.semf",
54497
+ see: "application/vnd.seemail",
54498
+ snf: "application/x-font-snf",
54499
+ spq: "application/scvp-vp-request",
54500
+ spp: "application/scvp-vp-response",
54501
+ scq: "application/scvp-cv-request",
54502
+ scs: "application/scvp-cv-response",
54503
+ sdp: "application/sdp",
54504
+ etx: "text/x-setext",
54505
+ movie: "video/x-sgi-movie",
54506
+ ifm: "application/vnd.shana.informed.formdata",
54507
+ itp: "application/vnd.shana.informed.formtemplate",
54508
+ iif: "application/vnd.shana.informed.interchange",
54509
+ ipk: "application/vnd.shana.informed.package",
54510
+ tfi: "application/thraud+xml",
54511
+ shar: "application/x-shar",
54512
+ rgb: "image/x-rgb",
54513
+ slt: "application/vnd.epson.salt",
54514
+ aso: "application/vnd.accpac.simply.aso",
54515
+ imp: "application/vnd.accpac.simply.imp",
54516
+ twd: "application/vnd.simtech-mindmapper",
54517
+ csp: "application/vnd.commonspace",
54518
+ saf: "application/vnd.yamaha.smaf-audio",
54519
+ mmf: "application/vnd.smaf",
54520
+ spf: "application/vnd.yamaha.smaf-phrase",
54521
+ teacher: "application/vnd.smart.teacher",
54522
+ svd: "application/vnd.svd",
54523
+ rq: "application/sparql-query",
54524
+ srx: "application/sparql-results+xml",
54525
+ gram: "application/srgs",
54526
+ grxml: "application/srgs+xml",
54527
+ ssml: "application/ssml+xml",
54528
+ skp: "application/vnd.koan",
54529
+ sgml: "text/sgml",
54530
+ sdc: "application/vnd.stardivision.calc",
54531
+ sda: "application/vnd.stardivision.draw",
54532
+ sdd: "application/vnd.stardivision.impress",
54533
+ smf: "application/vnd.stardivision.math",
54534
+ sdw: "application/vnd.stardivision.writer",
54535
+ sgl: "application/vnd.stardivision.writer-global",
54536
+ sm: "application/vnd.stepmania.stepchart",
54537
+ sit: "application/x-stuffit",
54538
+ sitx: "application/x-stuffitx",
54539
+ sdkm: "application/vnd.solent.sdkm+xml",
54540
+ xo: "application/vnd.olpc-sugar",
54541
+ au: "audio/basic",
54542
+ wqd: "application/vnd.wqd",
54543
+ sis: "application/vnd.symbian.install",
54544
+ smi: "application/smil+xml",
54545
+ xsm: "application/vnd.syncml+xml",
54546
+ bdm: "application/vnd.syncml.dm+wbxml",
54547
+ xdm: "application/vnd.syncml.dm+xml",
54548
+ sv4cpio: "application/x-sv4cpio",
54549
+ sv4crc: "application/x-sv4crc",
54550
+ sbml: "application/sbml+xml",
54551
+ tsv: "text/tab-separated-values",
54552
+ tiff: "image/tiff",
54553
+ tao: "application/vnd.tao.intent-module-archive",
54554
+ tar: "application/x-tar",
54555
+ tcl: "application/x-tcl",
54556
+ tex: "application/x-tex",
54557
+ tfm: "application/x-tex-tfm",
54558
+ tei: "application/tei+xml",
54559
+ txt: "text/plain",
54560
+ dxp: "application/vnd.spotfire.dxp",
54561
+ sfs: "application/vnd.spotfire.sfs",
54562
+ tsd: "application/timestamped-data",
54563
+ tpt: "application/vnd.trid.tpt",
54564
+ mxs: "application/vnd.triscape.mxs",
54565
+ t: "text/troff",
54566
+ tra: "application/vnd.trueapp",
54567
+ ttf: "application/x-font-ttf",
54568
+ ttl: "text/turtle",
54569
+ umj: "application/vnd.umajin",
54570
+ uoml: "application/vnd.uoml+xml",
54571
+ unityweb: "application/vnd.unity",
54572
+ ufd: "application/vnd.ufdl",
54573
+ uri: "text/uri-list",
54574
+ utz: "application/vnd.uiq.theme",
54575
+ ustar: "application/x-ustar",
54576
+ uu: "text/x-uuencode",
54577
+ vcs: "text/x-vcalendar",
54578
+ vcf: "text/x-vcard",
54579
+ vcd: "application/x-cdlink",
54580
+ vsf: "application/vnd.vsf",
54581
+ wrl: "model/vrml",
54582
+ vcx: "application/vnd.vcx",
54583
+ mts: "model/vnd.mts",
54584
+ vtu: "model/vnd.vtu",
54585
+ vis: "application/vnd.visionary",
54586
+ viv: "video/vnd.vivo",
54587
+ ccxml: "application/ccxml+xml,",
54588
+ vxml: "application/voicexml+xml",
54589
+ src: "application/x-wais-source",
54590
+ wbxml: "application/vnd.wap.wbxml",
54591
+ wbmp: "image/vnd.wap.wbmp",
54592
+ wav: "audio/x-wav",
54593
+ davmount: "application/davmount+xml",
54594
+ woff: "application/x-font-woff",
54595
+ wspolicy: "application/wspolicy+xml",
54596
+ webp: "image/webp",
54597
+ wtb: "application/vnd.webturbo",
54598
+ wgt: "application/widget",
54599
+ hlp: "application/winhlp",
54600
+ wml: "text/vnd.wap.wml",
54601
+ wmls: "text/vnd.wap.wmlscript",
54602
+ wmlsc: "application/vnd.wap.wmlscriptc",
54603
+ wpd: "application/vnd.wordperfect",
54604
+ stf: "application/vnd.wt.stf",
54605
+ wsdl: "application/wsdl+xml",
54606
+ xbm: "image/x-xbitmap",
54607
+ xpm: "image/x-xpixmap",
54608
+ xwd: "image/x-xwindowdump",
54609
+ der: "application/x-x509-ca-cert",
54610
+ fig: "application/x-xfig",
54611
+ xhtml: "application/xhtml+xml",
54612
+ xml: "application/xml",
54613
+ xdf: "application/xcap-diff+xml",
54614
+ xenc: "application/xenc+xml",
54615
+ xer: "application/patch-ops-error+xml",
54616
+ rl: "application/resource-lists+xml",
54617
+ rs: "application/rls-services+xml",
54618
+ rld: "application/resource-lists-diff+xml",
54619
+ xslt: "application/xslt+xml",
54620
+ xop: "application/xop+xml",
54621
+ xpi: "application/x-xpinstall",
54622
+ xspf: "application/xspf+xml",
54623
+ xul: "application/vnd.mozilla.xul+xml",
54624
+ xyz: "chemical/x-xyz",
54625
+ yaml: "text/yaml",
54626
+ yang: "application/yang",
54627
+ yin: "application/yin+xml",
54628
+ zir: "application/vnd.zul",
54629
+ zip: "application/zip",
54630
+ zmm: "application/vnd.handheld-entertainment+xml",
54631
+ zaz: "application/vnd.zzazz.deck+xml"
54632
+ };
54633
+ var MIME_TYPES_TO_EXT = Object.fromEntries(Object.entries(EXT_TO_MIME_TYPES).map(function(_ref) {
54634
+ var _ref2 = _slicedToArray(_ref, 2), k = _ref2[0], v = _ref2[1];
54635
+ return [v, k];
54636
+ }));
54637
+ var MIME_TYPE_REGEX = /^data:(.*?);base64,/;
53929
54638
  function getMimeType(base64Url) {
53930
54639
  var match = MIME_TYPE_REGEX.exec(base64Url);
53931
54640
  if (match && match[1]) {
@@ -53934,16 +54643,11 @@ function getMimeType(base64Url) {
53934
54643
  return;
53935
54644
  }
53936
54645
  function mimeTypeToFileExt(mimeType) {
53937
- if (mimeType === "image/svg+xml") {
53938
- return "svg";
53939
- }
53940
- if (mimeType === "image/vnd.microsoft.icon") {
53941
- return "ico";
53942
- }
53943
- if (mimeType.startsWith("image/")) {
53944
- return mimeType.slice("image/".length);
54646
+ var recognizedMimeType = MIME_TYPES_TO_EXT[mimeType];
54647
+ if (recognizedMimeType) {
54648
+ return recognizedMimeType;
53945
54649
  }
53946
- return mimeType;
54650
+ return mimeType.split("/")[1];
53947
54651
  }
53948
54652
  var HeaderRegEx = /^h([\d+])$/;
53949
54653
  function lexicalToRichTextSource(node) {
@@ -54101,10 +54805,10 @@ function fromLexicalFormat(format) {
54101
54805
  return [];
54102
54806
  });
54103
54807
  }
54104
- var textEncoder$1 = new TextEncoder();
54808
+ var textEncoder$2 = new TextEncoder();
54105
54809
  function fromLexicalImageNode(node, files) {
54106
54810
  if (node.src.startsWith("data:")) {
54107
- var sha256 = Internal.getSHA256Hash(textEncoder$1.encode(node.src));
54811
+ var sha256 = Internal.getSHA256Hash(textEncoder$2.encode(node.src));
54108
54812
  var mimeType = getMimeType(node.src);
54109
54813
  if (mimeType === void 0) {
54110
54814
  throw new Error("Could not detect Mime Type for image: ".concat(node.src));
@@ -62591,7 +63295,7 @@ const Dropdown = ({
62591
63295
  ) });
62592
63296
  };
62593
63297
  const Dropdown$1 = Dropdown;
62594
- const textEncoder = new TextEncoder();
63298
+ const textEncoder$1 = new TextEncoder();
62595
63299
  function readImage(ev) {
62596
63300
  return new Promise((resolve, reject) => {
62597
63301
  var _a;
@@ -62602,7 +63306,7 @@ function readImage(ev) {
62602
63306
  if (typeof result2 === "string") {
62603
63307
  const image = new Image();
62604
63308
  image.addEventListener("load", () => {
62605
- const sha256 = Internal.getSHA256Hash(textEncoder.encode(result2));
63309
+ const sha256 = Internal.getSHA256Hash(textEncoder$1.encode(result2));
62606
63310
  if (image.naturalWidth && image.naturalHeight) {
62607
63311
  const mimeType = getMimeType(result2);
62608
63312
  resolve({
@@ -64205,7 +64909,7 @@ function ValMenu({
64205
64909
  api,
64206
64910
  patches,
64207
64911
  direction,
64208
- onCommit
64912
+ onClickPatches
64209
64913
  }) {
64210
64914
  const { theme: theme2, setTheme, editMode, setEditMode, session } = useValOverlayContext();
64211
64915
  if (session.status === "success" && session.data.mode === "unauthorized") {
@@ -64288,17 +64992,7 @@ function ValMenu({
64288
64992
  {
64289
64993
  onClick: () => {
64290
64994
  if (patchCount > 0) {
64291
- api.postCommit({ patches }).then((res) => {
64292
- if (result.isErr(res)) {
64293
- console.error(res.error);
64294
- alert("Could not commit patches: " + res.error.message);
64295
- } else {
64296
- console.log("Committed patches: ", res.value);
64297
- onCommit();
64298
- }
64299
- });
64300
- } else {
64301
- alert("No patches to commit");
64995
+ onClickPatches();
64302
64996
  }
64303
64997
  },
64304
64998
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative h-[24px] w-[24px] flex justify-center items-center", children: [
@@ -64315,32 +65009,24 @@ function SingleItemMenu({
64315
65009
  direction,
64316
65010
  children
64317
65011
  }) {
64318
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
64319
- "div",
64320
- {
64321
- className: classNames(
64322
- "flex items-start justify-center w-full h-full font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",
64323
- {
64324
- "flex-col items-start": direction === "vertical",
64325
- "flex-row items-center": direction === "horizontal"
64326
- }
64327
- ),
64328
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { className, href, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center px-2 gap-y-2", children }) })
64329
- }
64330
- );
65012
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(MenuContainer, { direction, border: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { className, href, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center px-2 gap-y-2", children }) }) });
64331
65013
  }
64332
65014
  function MenuContainer({
64333
65015
  children,
64334
- direction
65016
+ direction,
65017
+ border = true
64335
65018
  }) {
64336
65019
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
64337
65020
  "div",
64338
65021
  {
64339
65022
  className: classNames(
64340
- "flex justify-center w-full h-full px-2 py-2 font-sans border rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",
65023
+ "flex justify-center w-full h-full px-2 py-2 font-sans rounded-full gap-3 text-primary border-fill bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg drop-shadow-2xl",
64341
65024
  {
64342
65025
  "flex-col items-start": direction === "vertical",
64343
65026
  "flex-row items-center": direction === "horizontal"
65027
+ },
65028
+ {
65029
+ border
64344
65030
  }
64345
65031
  ),
64346
65032
  children
@@ -68176,6 +68862,7 @@ function useSession(api) {
68176
68862
  setSession({ status: "success", data: Session.parse(session2) });
68177
68863
  } else {
68178
68864
  if (res.error.statusCode === 401) {
68865
+ console.error("Unauthorized", res.error);
68179
68866
  setSession({
68180
68867
  status: "success",
68181
68868
  data: {
@@ -68284,23 +68971,6 @@ const Button = reactExports.forwardRef(
68284
68971
  }
68285
68972
  );
68286
68973
  Button.displayName = "Button";
68287
- const Input = reactExports.forwardRef(
68288
- ({ className: className2, type, ...props }, ref) => {
68289
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
68290
- "input",
68291
- {
68292
- type,
68293
- className: cn(
68294
- "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
68295
- className2
68296
- ),
68297
- ref,
68298
- ...props
68299
- }
68300
- );
68301
- }
68302
- );
68303
- Input.displayName = "Input";
68304
68974
  function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
68305
68975
  const PROVIDER_NAME = name + "CollectionProvider";
68306
68976
  const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
@@ -68376,6 +69046,608 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
68376
69046
  createCollectionScope
68377
69047
  ];
68378
69048
  }
69049
+ function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
69050
+ } }) {
69051
+ const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
69052
+ defaultProp,
69053
+ onChange
69054
+ });
69055
+ const isControlled = prop !== void 0;
69056
+ const value1 = isControlled ? prop : uncontrolledProp;
69057
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
69058
+ const setValue = reactExports.useCallback((nextValue) => {
69059
+ if (isControlled) {
69060
+ const setter = nextValue;
69061
+ const value = typeof nextValue === "function" ? setter(prop) : nextValue;
69062
+ if (value !== prop)
69063
+ handleChange(value);
69064
+ } else
69065
+ setUncontrolledProp(nextValue);
69066
+ }, [
69067
+ isControlled,
69068
+ prop,
69069
+ setUncontrolledProp,
69070
+ handleChange
69071
+ ]);
69072
+ return [
69073
+ value1,
69074
+ setValue
69075
+ ];
69076
+ }
69077
+ function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
69078
+ const uncontrolledState = reactExports.useState(defaultProp);
69079
+ const [value] = uncontrolledState;
69080
+ const prevValueRef = reactExports.useRef(value);
69081
+ const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
69082
+ reactExports.useEffect(() => {
69083
+ if (prevValueRef.current !== value) {
69084
+ handleChange(value);
69085
+ prevValueRef.current = value;
69086
+ }
69087
+ }, [
69088
+ value,
69089
+ prevValueRef,
69090
+ handleChange
69091
+ ]);
69092
+ return uncontrolledState;
69093
+ }
69094
+ const $1746a345f3d73bb7$var$useReactId = React$1["useId".toString()] || (() => void 0);
69095
+ let $1746a345f3d73bb7$var$count = 0;
69096
+ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
69097
+ const [id, setId] = reactExports.useState($1746a345f3d73bb7$var$useReactId());
69098
+ $9f79659886946c16$export$e5c5a5f917a5871c(() => {
69099
+ if (!deterministicId)
69100
+ setId(
69101
+ (reactId) => reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
69102
+ );
69103
+ }, [
69104
+ deterministicId
69105
+ ]);
69106
+ return deterministicId || (id ? `radix-${id}` : "");
69107
+ }
69108
+ const $409067139f391064$var$COLLAPSIBLE_NAME = "Collapsible";
69109
+ const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME);
69110
+ const [$409067139f391064$var$CollapsibleProvider, $409067139f391064$var$useCollapsibleContext] = $409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME);
69111
+ const $409067139f391064$export$6eb0f7ddcda6131f = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
69112
+ const { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;
69113
+ const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
69114
+ prop: openProp,
69115
+ defaultProp: defaultOpen,
69116
+ onChange: onOpenChange
69117
+ });
69118
+ return /* @__PURE__ */ reactExports.createElement($409067139f391064$var$CollapsibleProvider, {
69119
+ scope: __scopeCollapsible,
69120
+ disabled,
69121
+ contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
69122
+ open,
69123
+ onOpenToggle: reactExports.useCallback(
69124
+ () => setOpen(
69125
+ (prevOpen) => !prevOpen
69126
+ ),
69127
+ [
69128
+ setOpen
69129
+ ]
69130
+ )
69131
+ }, /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({
69132
+ "data-state": $409067139f391064$var$getState(open),
69133
+ "data-disabled": disabled ? "" : void 0
69134
+ }, collapsibleProps, {
69135
+ ref: forwardedRef
69136
+ })));
69137
+ });
69138
+ const $409067139f391064$var$TRIGGER_NAME = "CollapsibleTrigger";
69139
+ const $409067139f391064$export$c135dce7b15bbbdc = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
69140
+ const { __scopeCollapsible, ...triggerProps } = props;
69141
+ const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);
69142
+ return /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$6({
69143
+ type: "button",
69144
+ "aria-controls": context.contentId,
69145
+ "aria-expanded": context.open || false,
69146
+ "data-state": $409067139f391064$var$getState(context.open),
69147
+ "data-disabled": context.disabled ? "" : void 0,
69148
+ disabled: context.disabled
69149
+ }, triggerProps, {
69150
+ ref: forwardedRef,
69151
+ onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
69152
+ }));
69153
+ });
69154
+ const $409067139f391064$var$CONTENT_NAME = "CollapsibleContent";
69155
+ const $409067139f391064$export$aadde00976f34151 = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
69156
+ const { forceMount, ...contentProps } = props;
69157
+ const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);
69158
+ return /* @__PURE__ */ reactExports.createElement(
69159
+ $921a889cee6df7e8$export$99c2b779aa4e8b8b,
69160
+ {
69161
+ present: forceMount || context.open
69162
+ },
69163
+ ({ present }) => /* @__PURE__ */ reactExports.createElement($409067139f391064$var$CollapsibleContentImpl, _extends$6({}, contentProps, {
69164
+ ref: forwardedRef,
69165
+ present
69166
+ }))
69167
+ );
69168
+ });
69169
+ const $409067139f391064$var$CollapsibleContentImpl = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
69170
+ const { __scopeCollapsible, present, children, ...contentProps } = props;
69171
+ const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);
69172
+ const [isPresent, setIsPresent] = reactExports.useState(present);
69173
+ const ref = reactExports.useRef(null);
69174
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
69175
+ const heightRef = reactExports.useRef(0);
69176
+ const height = heightRef.current;
69177
+ const widthRef = reactExports.useRef(0);
69178
+ const width = widthRef.current;
69179
+ const isOpen = context.open || isPresent;
69180
+ const isMountAnimationPreventedRef = reactExports.useRef(isOpen);
69181
+ const originalStylesRef = reactExports.useRef();
69182
+ reactExports.useEffect(() => {
69183
+ const rAF = requestAnimationFrame(
69184
+ () => isMountAnimationPreventedRef.current = false
69185
+ );
69186
+ return () => cancelAnimationFrame(rAF);
69187
+ }, []);
69188
+ $9f79659886946c16$export$e5c5a5f917a5871c(() => {
69189
+ const node = ref.current;
69190
+ if (node) {
69191
+ originalStylesRef.current = originalStylesRef.current || {
69192
+ transitionDuration: node.style.transitionDuration,
69193
+ animationName: node.style.animationName
69194
+ };
69195
+ node.style.transitionDuration = "0s";
69196
+ node.style.animationName = "none";
69197
+ const rect = node.getBoundingClientRect();
69198
+ heightRef.current = rect.height;
69199
+ widthRef.current = rect.width;
69200
+ if (!isMountAnimationPreventedRef.current) {
69201
+ node.style.transitionDuration = originalStylesRef.current.transitionDuration;
69202
+ node.style.animationName = originalStylesRef.current.animationName;
69203
+ }
69204
+ setIsPresent(present);
69205
+ }
69206
+ }, [
69207
+ context.open,
69208
+ present
69209
+ ]);
69210
+ return /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({
69211
+ "data-state": $409067139f391064$var$getState(context.open),
69212
+ "data-disabled": context.disabled ? "" : void 0,
69213
+ id: context.contentId,
69214
+ hidden: !isOpen
69215
+ }, contentProps, {
69216
+ ref: composedRefs,
69217
+ style: {
69218
+ [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
69219
+ [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
69220
+ ...props.style
69221
+ }
69222
+ }), isOpen && children);
69223
+ });
69224
+ function $409067139f391064$var$getState(open) {
69225
+ return open ? "open" : "closed";
69226
+ }
69227
+ const $409067139f391064$export$be92b6f5f03c0fe9 = $409067139f391064$export$6eb0f7ddcda6131f;
69228
+ const $409067139f391064$export$41fb9f06171c75f4 = $409067139f391064$export$c135dce7b15bbbdc;
69229
+ const $409067139f391064$export$7c6e2c02157bb7d2 = $409067139f391064$export$aadde00976f34151;
69230
+ const $1bf158f521e1b1b4$var$ACCORDION_NAME = "Accordion";
69231
+ const $1bf158f521e1b1b4$var$ACCORDION_KEYS = [
69232
+ "Home",
69233
+ "End",
69234
+ "ArrowDown",
69235
+ "ArrowUp",
69236
+ "ArrowLeft",
69237
+ "ArrowRight"
69238
+ ];
69239
+ const [$1bf158f521e1b1b4$var$Collection, $1bf158f521e1b1b4$var$useCollection, $1bf158f521e1b1b4$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($1bf158f521e1b1b4$var$ACCORDION_NAME);
69240
+ const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($1bf158f521e1b1b4$var$ACCORDION_NAME, [
69241
+ $1bf158f521e1b1b4$var$createCollectionScope,
69242
+ $409067139f391064$export$952b32dcbe73087a
69243
+ ]);
69244
+ const $1bf158f521e1b1b4$var$useCollapsibleScope = $409067139f391064$export$952b32dcbe73087a();
69245
+ const $1bf158f521e1b1b4$export$a766cd26d0d69044 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69246
+ const { type, ...accordionProps } = props;
69247
+ const singleProps = accordionProps;
69248
+ const multipleProps = accordionProps;
69249
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.Provider, {
69250
+ scope: props.__scopeAccordion
69251
+ }, type === "multiple" ? /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplMultiple, _extends$6({}, multipleProps, {
69252
+ ref: forwardedRef
69253
+ })) : /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplSingle, _extends$6({}, singleProps, {
69254
+ ref: forwardedRef
69255
+ })));
69256
+ });
69257
+ $1bf158f521e1b1b4$export$a766cd26d0d69044.propTypes = {
69258
+ type(props) {
69259
+ const value = props.value || props.defaultValue;
69260
+ if (props.type && ![
69261
+ "single",
69262
+ "multiple"
69263
+ ].includes(props.type))
69264
+ return new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.");
69265
+ if (props.type === "multiple" && typeof value === "string")
69266
+ return new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.");
69267
+ if (props.type === "single" && Array.isArray(value))
69268
+ return new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.");
69269
+ return null;
69270
+ }
69271
+ };
69272
+ const [$1bf158f521e1b1b4$var$AccordionValueProvider, $1bf158f521e1b1b4$var$useAccordionValueContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
69273
+ const [$1bf158f521e1b1b4$var$AccordionCollapsibleProvider, $1bf158f521e1b1b4$var$useAccordionCollapsibleContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, {
69274
+ collapsible: false
69275
+ });
69276
+ const $1bf158f521e1b1b4$var$AccordionImplSingle = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69277
+ const { value: valueProp, defaultValue, onValueChange = () => {
69278
+ }, collapsible = false, ...accordionSingleProps } = props;
69279
+ const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
69280
+ prop: valueProp,
69281
+ defaultProp: defaultValue,
69282
+ onChange: onValueChange
69283
+ });
69284
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
69285
+ scope: props.__scopeAccordion,
69286
+ value: value ? [
69287
+ value
69288
+ ] : [],
69289
+ onItemOpen: setValue,
69290
+ onItemClose: React.useCallback(
69291
+ () => collapsible && setValue(""),
69292
+ [
69293
+ collapsible,
69294
+ setValue
69295
+ ]
69296
+ )
69297
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
69298
+ scope: props.__scopeAccordion,
69299
+ collapsible
69300
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends$6({}, accordionSingleProps, {
69301
+ ref: forwardedRef
69302
+ }))));
69303
+ });
69304
+ const $1bf158f521e1b1b4$var$AccordionImplMultiple = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69305
+ const { value: valueProp, defaultValue, onValueChange = () => {
69306
+ }, ...accordionMultipleProps } = props;
69307
+ const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
69308
+ prop: valueProp,
69309
+ defaultProp: defaultValue,
69310
+ onChange: onValueChange
69311
+ });
69312
+ const handleItemOpen = React.useCallback(
69313
+ (itemValue) => setValue(
69314
+ (prevValue = []) => [
69315
+ ...prevValue,
69316
+ itemValue
69317
+ ]
69318
+ ),
69319
+ [
69320
+ setValue
69321
+ ]
69322
+ );
69323
+ const handleItemClose = React.useCallback(
69324
+ (itemValue) => setValue(
69325
+ (prevValue = []) => prevValue.filter(
69326
+ (value) => value !== itemValue
69327
+ )
69328
+ ),
69329
+ [
69330
+ setValue
69331
+ ]
69332
+ );
69333
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
69334
+ scope: props.__scopeAccordion,
69335
+ value: value1,
69336
+ onItemOpen: handleItemOpen,
69337
+ onItemClose: handleItemClose
69338
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
69339
+ scope: props.__scopeAccordion,
69340
+ collapsible: true
69341
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends$6({}, accordionMultipleProps, {
69342
+ ref: forwardedRef
69343
+ }))));
69344
+ });
69345
+ const [$1bf158f521e1b1b4$var$AccordionImplProvider, $1bf158f521e1b1b4$var$useAccordionContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
69346
+ const $1bf158f521e1b1b4$var$AccordionImpl = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69347
+ const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
69348
+ const accordionRef = React.useRef(null);
69349
+ const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(accordionRef, forwardedRef);
69350
+ const getItems = $1bf158f521e1b1b4$var$useCollection(__scopeAccordion);
69351
+ const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
69352
+ const isDirectionLTR = direction === "ltr";
69353
+ const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
69354
+ var _triggerCollection$cl;
69355
+ if (!$1bf158f521e1b1b4$var$ACCORDION_KEYS.includes(event.key))
69356
+ return;
69357
+ const target = event.target;
69358
+ const triggerCollection = getItems().filter((item) => {
69359
+ var _item$ref$current;
69360
+ return !((_item$ref$current = item.ref.current) !== null && _item$ref$current !== void 0 && _item$ref$current.disabled);
69361
+ });
69362
+ const triggerIndex = triggerCollection.findIndex(
69363
+ (item) => item.ref.current === target
69364
+ );
69365
+ const triggerCount = triggerCollection.length;
69366
+ if (triggerIndex === -1)
69367
+ return;
69368
+ event.preventDefault();
69369
+ let nextIndex = triggerIndex;
69370
+ const homeIndex = 0;
69371
+ const endIndex = triggerCount - 1;
69372
+ const moveNext = () => {
69373
+ nextIndex = triggerIndex + 1;
69374
+ if (nextIndex > endIndex)
69375
+ nextIndex = homeIndex;
69376
+ };
69377
+ const movePrev = () => {
69378
+ nextIndex = triggerIndex - 1;
69379
+ if (nextIndex < homeIndex)
69380
+ nextIndex = endIndex;
69381
+ };
69382
+ switch (event.key) {
69383
+ case "Home":
69384
+ nextIndex = homeIndex;
69385
+ break;
69386
+ case "End":
69387
+ nextIndex = endIndex;
69388
+ break;
69389
+ case "ArrowRight":
69390
+ if (orientation === "horizontal") {
69391
+ if (isDirectionLTR)
69392
+ moveNext();
69393
+ else
69394
+ movePrev();
69395
+ }
69396
+ break;
69397
+ case "ArrowDown":
69398
+ if (orientation === "vertical")
69399
+ moveNext();
69400
+ break;
69401
+ case "ArrowLeft":
69402
+ if (orientation === "horizontal") {
69403
+ if (isDirectionLTR)
69404
+ movePrev();
69405
+ else
69406
+ moveNext();
69407
+ }
69408
+ break;
69409
+ case "ArrowUp":
69410
+ if (orientation === "vertical")
69411
+ movePrev();
69412
+ break;
69413
+ }
69414
+ const clampedIndex = nextIndex % triggerCount;
69415
+ (_triggerCollection$cl = triggerCollection[clampedIndex].ref.current) === null || _triggerCollection$cl === void 0 || _triggerCollection$cl.focus();
69416
+ });
69417
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplProvider, {
69418
+ scope: __scopeAccordion,
69419
+ disabled,
69420
+ direction: dir,
69421
+ orientation
69422
+ }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.Slot, {
69423
+ scope: __scopeAccordion
69424
+ }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({}, accordionProps, {
69425
+ "data-orientation": orientation,
69426
+ ref: composedRefs,
69427
+ onKeyDown: disabled ? void 0 : handleKeyDown
69428
+ }))));
69429
+ });
69430
+ const $1bf158f521e1b1b4$var$ITEM_NAME = "AccordionItem";
69431
+ const [$1bf158f521e1b1b4$var$AccordionItemProvider, $1bf158f521e1b1b4$var$useAccordionItemContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME);
69432
+ const $1bf158f521e1b1b4$export$d99097c13d4dac9f = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69433
+ const { __scopeAccordion, value, ...accordionItemProps } = props;
69434
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
69435
+ const valueContext = $1bf158f521e1b1b4$var$useAccordionValueContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
69436
+ const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
69437
+ const triggerId = $1746a345f3d73bb7$export$f680877a34711e37();
69438
+ const open1 = value && valueContext.value.includes(value) || false;
69439
+ const disabled = accordionContext.disabled || props.disabled;
69440
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionItemProvider, {
69441
+ scope: __scopeAccordion,
69442
+ open: open1,
69443
+ disabled,
69444
+ triggerId
69445
+ }, /* @__PURE__ */ React.createElement($409067139f391064$export$be92b6f5f03c0fe9, _extends$6({
69446
+ "data-orientation": accordionContext.orientation,
69447
+ "data-state": $1bf158f521e1b1b4$var$getState(open1)
69448
+ }, collapsibleScope, accordionItemProps, {
69449
+ ref: forwardedRef,
69450
+ disabled,
69451
+ open: open1,
69452
+ onOpenChange: (open) => {
69453
+ if (open)
69454
+ valueContext.onItemOpen(value);
69455
+ else
69456
+ valueContext.onItemClose(value);
69457
+ }
69458
+ })));
69459
+ });
69460
+ const $1bf158f521e1b1b4$var$HEADER_NAME = "AccordionHeader";
69461
+ const $1bf158f521e1b1b4$export$5e3e5deaaf81ee41 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69462
+ const { __scopeAccordion, ...headerProps } = props;
69463
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
69464
+ const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$HEADER_NAME, __scopeAccordion);
69465
+ return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h3, _extends$6({
69466
+ "data-orientation": accordionContext.orientation,
69467
+ "data-state": $1bf158f521e1b1b4$var$getState(itemContext.open),
69468
+ "data-disabled": itemContext.disabled ? "" : void 0
69469
+ }, headerProps, {
69470
+ ref: forwardedRef
69471
+ }));
69472
+ });
69473
+ const $1bf158f521e1b1b4$var$TRIGGER_NAME = "AccordionTrigger";
69474
+ const $1bf158f521e1b1b4$export$94e939b1f85bdd73 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69475
+ const { __scopeAccordion, ...triggerProps } = props;
69476
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
69477
+ const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
69478
+ const collapsibleContext = $1bf158f521e1b1b4$var$useAccordionCollapsibleContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
69479
+ const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
69480
+ return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.ItemSlot, {
69481
+ scope: __scopeAccordion
69482
+ }, /* @__PURE__ */ React.createElement($409067139f391064$export$41fb9f06171c75f4, _extends$6({
69483
+ "aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0,
69484
+ "data-orientation": accordionContext.orientation,
69485
+ id: itemContext.triggerId
69486
+ }, collapsibleScope, triggerProps, {
69487
+ ref: forwardedRef
69488
+ })));
69489
+ });
69490
+ const $1bf158f521e1b1b4$var$CONTENT_NAME = "AccordionContent";
69491
+ const $1bf158f521e1b1b4$export$985b9a77379b54a0 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
69492
+ const { __scopeAccordion, ...contentProps } = props;
69493
+ const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
69494
+ const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$CONTENT_NAME, __scopeAccordion);
69495
+ const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
69496
+ return /* @__PURE__ */ React.createElement($409067139f391064$export$7c6e2c02157bb7d2, _extends$6({
69497
+ role: "region",
69498
+ "aria-labelledby": itemContext.triggerId,
69499
+ "data-orientation": accordionContext.orientation
69500
+ }, collapsibleScope, contentProps, {
69501
+ ref: forwardedRef,
69502
+ style: {
69503
+ ["--radix-accordion-content-height"]: "var(--radix-collapsible-content-height)",
69504
+ ["--radix-accordion-content-width"]: "var(--radix-collapsible-content-width)",
69505
+ ...props.style
69506
+ }
69507
+ }));
69508
+ });
69509
+ function $1bf158f521e1b1b4$var$getState(open) {
69510
+ return open ? "open" : "closed";
69511
+ }
69512
+ const $1bf158f521e1b1b4$export$be92b6f5f03c0fe9 = $1bf158f521e1b1b4$export$a766cd26d0d69044;
69513
+ const $1bf158f521e1b1b4$export$6d08773d2e66f8f2 = $1bf158f521e1b1b4$export$d99097c13d4dac9f;
69514
+ const $1bf158f521e1b1b4$export$8b251419efc915eb = $1bf158f521e1b1b4$export$5e3e5deaaf81ee41;
69515
+ const $1bf158f521e1b1b4$export$41fb9f06171c75f4 = $1bf158f521e1b1b4$export$94e939b1f85bdd73;
69516
+ const $1bf158f521e1b1b4$export$7c6e2c02157bb7d2 = $1bf158f521e1b1b4$export$985b9a77379b54a0;
69517
+ const Accordion = $1bf158f521e1b1b4$export$be92b6f5f03c0fe9;
69518
+ const AccordionItem = reactExports.forwardRef(({ className: className2, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
69519
+ $1bf158f521e1b1b4$export$6d08773d2e66f8f2,
69520
+ {
69521
+ ref,
69522
+ className: cn("border-b", className2),
69523
+ ...props
69524
+ }
69525
+ ));
69526
+ AccordionItem.displayName = "AccordionItem";
69527
+ const AccordionTrigger = reactExports.forwardRef(({ className: className2, children, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx($1bf158f521e1b1b4$export$8b251419efc915eb, { className: "flex", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
69528
+ $1bf158f521e1b1b4$export$41fb9f06171c75f4,
69529
+ {
69530
+ ref,
69531
+ className: cn(
69532
+ "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
69533
+ className2
69534
+ ),
69535
+ ...props,
69536
+ children: [
69537
+ children,
69538
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 transition-transform duration-200 shrink-0" })
69539
+ ]
69540
+ }
69541
+ ) }));
69542
+ AccordionTrigger.displayName = $1bf158f521e1b1b4$export$41fb9f06171c75f4.displayName;
69543
+ const AccordionContent = reactExports.forwardRef(({ className: className2, children, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
69544
+ $1bf158f521e1b1b4$export$7c6e2c02157bb7d2,
69545
+ {
69546
+ ref,
69547
+ className: cn(
69548
+ "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
69549
+ className2
69550
+ ),
69551
+ ...props,
69552
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-0 pb-4", children })
69553
+ }
69554
+ ));
69555
+ AccordionContent.displayName = $1bf158f521e1b1b4$export$7c6e2c02157bb7d2.displayName;
69556
+ function ValPatches({
69557
+ api,
69558
+ patches: patchIdsByModule,
69559
+ onCommit,
69560
+ onCancel
69561
+ }) {
69562
+ const [loading, setLoading] = reactExports.useState(false);
69563
+ reactExports.useEffect(() => {
69564
+ const handler = (e) => {
69565
+ if (e.key === "Escape") {
69566
+ onCancel();
69567
+ }
69568
+ };
69569
+ window.addEventListener("keydown", handler);
69570
+ return () => window.removeEventListener("keydown", handler);
69571
+ }, []);
69572
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, { children: [
69573
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-end p-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onCancel, children: /* @__PURE__ */ jsxRuntimeExports.jsx(X$2, {}) }) }),
69574
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center justify-center h-full p-8 gap-y-5", children: [
69575
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "block font-sans text-xl font-bold", children: "Review changes" }),
69576
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: Object.entries(patchIdsByModule).map(([moduleId, patchIds]) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, { type: "single", collapsible: true, children: /* @__PURE__ */ jsxRuntimeExports.jsxs($1bf158f521e1b1b4$export$d99097c13d4dac9f, { value: moduleId, children: [
69577
+ /* @__PURE__ */ jsxRuntimeExports.jsxs($1bf158f521e1b1b4$export$94e939b1f85bdd73, { className: "grid grid-cols-[1fr_min-content] gap-x-2", children: [
69578
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: moduleId }),
69579
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex", children: [
69580
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Diff, { size: 14 }),
69581
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: patchIds.length }),
69582
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { size: 14 }) })
69583
+ ] })
69584
+ ] }),
69585
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Accordion, { type: "multiple", children: patchIds.map((patchId) => /* @__PURE__ */ jsxRuntimeExports.jsxs($1bf158f521e1b1b4$export$d99097c13d4dac9f, { value: patchId, children: [
69586
+ /* @__PURE__ */ jsxRuntimeExports.jsx($1bf158f521e1b1b4$export$94e939b1f85bdd73, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-x-5", children: [
69587
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Changed by: John Smith" }),
69588
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Changed at: 2024-01-04 13:25:00" }),
69589
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
69590
+ "img",
69591
+ {
69592
+ className: "h-[14px] w-[14px]",
69593
+ src: "https://randomuser.me/api/portraits/men/3.jpg"
69594
+ }
69595
+ ),
69596
+ /* @__PURE__ */ jsxRuntimeExports.jsx(X$2, { size: 14 }),
69597
+ /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { size: 14 })
69598
+ ] }) }),
69599
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AccordionContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: 'Changed to: "Foo bar"' }) })
69600
+ ] })) }) })
69601
+ ] }) }) }, moduleId)) }),
69602
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-x-4", children: [
69603
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "secondary", onClick: onCancel, children: "Cancel" }),
69604
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
69605
+ Button,
69606
+ {
69607
+ disabled: Object.keys(patchIdsByModule).length === 0 || loading,
69608
+ onClick: () => {
69609
+ setLoading(true);
69610
+ api.postCommit({ patches: patchIdsByModule }).then((res) => {
69611
+ if (result.isErr(res)) {
69612
+ console.error(res.error);
69613
+ alert("Could not commit patches: " + res.error.message);
69614
+ } else {
69615
+ console.log("Committed patches: ", res.value);
69616
+ onCommit();
69617
+ }
69618
+ }).finally(() => {
69619
+ setLoading(false);
69620
+ });
69621
+ },
69622
+ children: loading ? "Committing..." : "Commit"
69623
+ }
69624
+ )
69625
+ ] })
69626
+ ] })
69627
+ ] });
69628
+ }
69629
+ function Container({
69630
+ children
69631
+ }) {
69632
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-full w-full rounded-lg bg-gradient-to-br from-background/90 from-40% to-background backdrop-blur-lg text-primary drop-shadow-2xl", children });
69633
+ }
69634
+ const Input = reactExports.forwardRef(
69635
+ ({ className: className2, type, ...props }, ref) => {
69636
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
69637
+ "input",
69638
+ {
69639
+ type,
69640
+ className: cn(
69641
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
69642
+ className2
69643
+ ),
69644
+ ref,
69645
+ ...props
69646
+ }
69647
+ );
69648
+ }
69649
+ );
69650
+ Input.displayName = "Input";
68379
69651
  function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
68380
69652
  const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
68381
69653
  reactExports.useEffect(() => {
@@ -68872,20 +70144,6 @@ function $d3863c46a17e8a28$var$removeLinks(items) {
68872
70144
  (item) => item.tagName !== "A"
68873
70145
  );
68874
70146
  }
68875
- const $1746a345f3d73bb7$var$useReactId = React$1["useId".toString()] || (() => void 0);
68876
- let $1746a345f3d73bb7$var$count = 0;
68877
- function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
68878
- const [id, setId] = reactExports.useState($1746a345f3d73bb7$var$useReactId());
68879
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
68880
- if (!deterministicId)
68881
- setId(
68882
- (reactId) => reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
68883
- );
68884
- }, [
68885
- deterministicId
68886
- ]);
68887
- return deterministicId || (id ? `radix-${id}` : "");
68888
- }
68889
70147
  const sides = ["top", "right", "bottom", "left"];
68890
70148
  const min = Math.min;
68891
70149
  const max = Math.max;
@@ -70841,51 +72099,6 @@ const $f1701beae083dbae$export$602eac185826482c = /* @__PURE__ */ reactExports.f
70841
72099
  ref: forwardedRef
70842
72100
  })), container) : null;
70843
72101
  });
70844
- function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
70845
- } }) {
70846
- const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
70847
- defaultProp,
70848
- onChange
70849
- });
70850
- const isControlled = prop !== void 0;
70851
- const value1 = isControlled ? prop : uncontrolledProp;
70852
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
70853
- const setValue = reactExports.useCallback((nextValue) => {
70854
- if (isControlled) {
70855
- const setter = nextValue;
70856
- const value = typeof nextValue === "function" ? setter(prop) : nextValue;
70857
- if (value !== prop)
70858
- handleChange(value);
70859
- } else
70860
- setUncontrolledProp(nextValue);
70861
- }, [
70862
- isControlled,
70863
- prop,
70864
- setUncontrolledProp,
70865
- handleChange
70866
- ]);
70867
- return [
70868
- value1,
70869
- setValue
70870
- ];
70871
- }
70872
- function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
70873
- const uncontrolledState = reactExports.useState(defaultProp);
70874
- const [value] = uncontrolledState;
70875
- const prevValueRef = reactExports.useRef(value);
70876
- const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
70877
- reactExports.useEffect(() => {
70878
- if (prevValueRef.current !== value) {
70879
- handleChange(value);
70880
- prevValueRef.current = value;
70881
- }
70882
- }, [
70883
- value,
70884
- prevValueRef,
70885
- handleChange
70886
- ]);
70887
- return uncontrolledState;
70888
- }
70889
72102
  function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
70890
72103
  const ref = reactExports.useRef({
70891
72104
  value,
@@ -71229,7 +72442,7 @@ var RemoveScroll = reactExports.forwardRef(function(props, parentRef) {
71229
72442
  onWheelCapture: nothing,
71230
72443
  onTouchMoveCapture: nothing
71231
72444
  }), callbacks = _a[0], setCallbacks = _a[1];
71232
- var forwardProps = props.forwardProps, children = props.children, className2 = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
72445
+ var forwardProps = props.forwardProps, children = props.children, className2 = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container2 = _b === void 0 ? "div" : _b, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
71233
72446
  var SideCar2 = sideCar;
71234
72447
  var containerRef = useMergeRefs([ref, parentRef]);
71235
72448
  var containerProps = __assign(__assign({}, rest), callbacks);
@@ -71237,7 +72450,7 @@ var RemoveScroll = reactExports.forwardRef(function(props, parentRef) {
71237
72450
  reactExports.Fragment,
71238
72451
  null,
71239
72452
  enabled && reactExports.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref }),
71240
- forwardProps ? reactExports.cloneElement(reactExports.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : reactExports.createElement(Container, __assign({}, containerProps, { className: className2, ref: containerRef }), children)
72453
+ forwardProps ? reactExports.cloneElement(reactExports.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : reactExports.createElement(Container2, __assign({}, containerProps, { className: className2, ref: containerRef }), children)
71241
72454
  );
71242
72455
  });
71243
72456
  RemoveScroll.defaultProps = {
@@ -72778,6 +73991,17 @@ function ValFormField({
72778
73991
  }
72779
73992
  );
72780
73993
  }
73994
+ if ((typeof source === "object" || source === null) && (schema == null ? void 0 : schema.type) === "file") {
73995
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
73996
+ FileField,
73997
+ {
73998
+ path,
73999
+ registerPatchCallback,
74000
+ onSubmit,
74001
+ defaultValue: source
74002
+ }
74003
+ );
74004
+ }
72781
74005
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
72782
74006
  "Unsupported schema: ",
72783
74007
  schema.type,
@@ -72789,14 +74013,14 @@ function ValFormField({
72789
74013
  ")"
72790
74014
  ] });
72791
74015
  }
72792
- function createImagePatch(path, data, filename, metadata) {
74016
+ function createFilePatch(path, data, filename, metadata) {
72793
74017
  if (!data || !metadata) {
72794
74018
  return [];
72795
74019
  }
72796
74020
  const shaSuffix = metadata.sha256.slice(0, 5);
72797
74021
  const newFilePath = function() {
72798
74022
  const mimeType = getMimeType(data) ?? "unknown";
72799
- const newExt = mimeTypeToFileExt(mimeType);
74023
+ const newExt = mimeTypeToFileExt(mimeType) ?? "unknown";
72800
74024
  if (filename) {
72801
74025
  let cleanFilename = filename.split(".").slice(0, -1).join(".") || filename;
72802
74026
  const maybeShaSuffixPos = cleanFilename.lastIndexOf("_");
@@ -72829,7 +74053,7 @@ function createImagePatch(path, data, filename, metadata) {
72829
74053
  }
72830
74054
  ];
72831
74055
  }
72832
- function createImageMetadataPatch(path, metadata) {
74056
+ function createFileMetadataPatch(path, metadata) {
72833
74057
  const metadataPath = path + "/metadata";
72834
74058
  return [
72835
74059
  {
@@ -72839,6 +74063,150 @@ function createImageMetadataPatch(path, metadata) {
72839
74063
  }
72840
74064
  ];
72841
74065
  }
74066
+ const textEncoder = new TextEncoder();
74067
+ function readFile(ev) {
74068
+ return new Promise((resolve, reject) => {
74069
+ var _a;
74070
+ const file = (_a = ev.currentTarget.files) == null ? void 0 : _a[0];
74071
+ const reader = new FileReader();
74072
+ reader.addEventListener("load", () => {
74073
+ const result2 = reader.result;
74074
+ if (typeof result2 === "string") {
74075
+ const sha256 = Internal.getSHA256Hash(textEncoder.encode(result2));
74076
+ const mimeType = getMimeType(result2);
74077
+ resolve({
74078
+ src: result2,
74079
+ filename: file == null ? void 0 : file.name,
74080
+ sha256,
74081
+ mimeType,
74082
+ fileExt: mimeType && mimeTypeToFileExt(mimeType)
74083
+ });
74084
+ } else if (!result2) {
74085
+ reject({ message: "Empty result" });
74086
+ } else {
74087
+ reject({ message: "Unexpected file result type", result: result2 });
74088
+ }
74089
+ });
74090
+ if (file) {
74091
+ reader.readAsDataURL(file);
74092
+ }
74093
+ });
74094
+ }
74095
+ function FileField({
74096
+ path,
74097
+ defaultValue,
74098
+ onSubmit,
74099
+ registerPatchCallback
74100
+ }) {
74101
+ var _a, _b;
74102
+ const [data, setData] = reactExports.useState(
74103
+ null
74104
+ );
74105
+ const [loading, setLoading] = reactExports.useState(false);
74106
+ const [metadata, setMetadata] = reactExports.useState();
74107
+ const [url, setUrl] = reactExports.useState();
74108
+ reactExports.useEffect(() => {
74109
+ const url2 = defaultValue && Internal.convertFileSource(defaultValue).url;
74110
+ setUrl(url2);
74111
+ }, [defaultValue]);
74112
+ reactExports.useEffect(() => {
74113
+ if (registerPatchCallback) {
74114
+ registerPatchCallback(async (path2) => {
74115
+ return createFilePatch(
74116
+ path2,
74117
+ (data == null ? void 0 : data.src) ?? null,
74118
+ (data == null ? void 0 : data.filename) ?? null,
74119
+ metadata
74120
+ );
74121
+ });
74122
+ }
74123
+ }, [data, defaultValue]);
74124
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(FieldContainer, { children: [
74125
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-fit", children: [
74126
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
74127
+ "div",
74128
+ {
74129
+ className: "flex flex-col justify-start p-2 border border-b-0 rounded-sm rounded-b-none gap-y-4 bg-background text-foreground border-input",
74130
+ children: data || url ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex flex-col justify-center items-center min-h-[100px] min-w-[200px]", children: [
74131
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(File, {}) }),
74132
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: data == null ? void 0 : data.filename })
74133
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Select file below" })
74134
+ },
74135
+ path
74136
+ ),
74137
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 border border-t-0 rounded-b-sm bg-background border-input", children: [
74138
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
74139
+ "label",
74140
+ {
74141
+ htmlFor: `img_input:${path}`,
74142
+ className: "block px-1 py-2 text-sm text-center rounded-md cursor-pointer bg-primary text-background",
74143
+ children: "Update"
74144
+ }
74145
+ ),
74146
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
74147
+ "input",
74148
+ {
74149
+ hidden: true,
74150
+ id: `img_input:${path}`,
74151
+ type: "file",
74152
+ onChange: (ev) => {
74153
+ readFile(ev).then((res) => {
74154
+ setData({ src: res.src, filename: res.filename });
74155
+ if (res.mimeType) {
74156
+ setMetadata({
74157
+ sha256: res.sha256,
74158
+ mimeType: res.mimeType
74159
+ });
74160
+ } else {
74161
+ setMetadata(void 0);
74162
+ }
74163
+ }).catch((err2) => {
74164
+ console.error(err2.message);
74165
+ setData(null);
74166
+ setMetadata(void 0);
74167
+ });
74168
+ }
74169
+ }
74170
+ )
74171
+ ] })
74172
+ ] }),
74173
+ onSubmit && /* @__PURE__ */ jsxRuntimeExports.jsx(
74174
+ SubmitButton,
74175
+ {
74176
+ loading,
74177
+ enabled: !!data || ((_a = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _a.mimeType) !== (metadata == null ? void 0 : metadata.mimeType) || ((_b = defaultValue == null ? void 0 : defaultValue.metadata) == null ? void 0 : _b.sha256) !== (metadata == null ? void 0 : metadata.sha256),
74178
+ onClick: () => {
74179
+ if (data) {
74180
+ setLoading(true);
74181
+ onSubmit(
74182
+ (path2) => Promise.resolve(
74183
+ createFilePatch(
74184
+ path2,
74185
+ data.src,
74186
+ data.filename ?? null,
74187
+ metadata
74188
+ )
74189
+ )
74190
+ ).finally(() => {
74191
+ setLoading(false);
74192
+ setData(null);
74193
+ setMetadata(void 0);
74194
+ });
74195
+ } else if (metadata) {
74196
+ setLoading(true);
74197
+ onSubmit(
74198
+ (path2) => Promise.resolve(createFileMetadataPatch(path2, metadata))
74199
+ ).finally(() => {
74200
+ setLoading(false);
74201
+ setData(null);
74202
+ setMetadata(void 0);
74203
+ });
74204
+ }
74205
+ }
74206
+ }
74207
+ )
74208
+ ] });
74209
+ }
72842
74210
  function ImageField({
72843
74211
  path,
72844
74212
  defaultValue,
@@ -72859,7 +74227,7 @@ function ImageField({
72859
74227
  reactExports.useEffect(() => {
72860
74228
  if (registerPatchCallback) {
72861
74229
  registerPatchCallback(async (path2) => {
72862
- return createImagePatch(
74230
+ return createFilePatch(
72863
74231
  path2,
72864
74232
  (data == null ? void 0 : data.src) ?? null,
72865
74233
  (data == null ? void 0 : data.filename) ?? null,
@@ -72985,7 +74353,7 @@ function ImageField({
72985
74353
  setLoading(true);
72986
74354
  onSubmit(
72987
74355
  (path2) => Promise.resolve(
72988
- createImagePatch(
74356
+ createFilePatch(
72989
74357
  path2,
72990
74358
  data.src,
72991
74359
  data.filename ?? null,
@@ -73000,7 +74368,7 @@ function ImageField({
73000
74368
  } else if (metadata) {
73001
74369
  setLoading(true);
73002
74370
  onSubmit(
73003
- (path2) => Promise.resolve(createImageMetadataPatch(path2, metadata))
74371
+ (path2) => Promise.resolve(createFileMetadataPatch(path2, metadata))
73004
74372
  ).finally(() => {
73005
74373
  setLoading(false);
73006
74374
  setData(null);
@@ -77212,6 +78580,7 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77212
78580
  },
77213
78581
  []
77214
78582
  );
78583
+ const [patchModalOpen, setPatchModalOpen] = reactExports.useState(false);
77215
78584
  const allModuleIds = Object.entries(modules || {}).flatMap(
77216
78585
  ([moduleId, valModule]) => {
77217
78586
  if ((valModule == null ? void 0 : valModule.schema) && (valModule == null ? void 0 : valModule.source)) {
@@ -77246,13 +78615,26 @@ Showing stack trace of: 1. ${fatalErrors[0].message}`;
77246
78615
  className: "relative w-full h-[100] overflow-hidden font-serif antialiased bg-background text-primary",
77247
78616
  "data-mode": theme2,
77248
78617
  children: [
78618
+ patchModalOpen && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed z-5 top-[16px] left-[16px] w-[calc(100%-32px-50px-16px)] h-[calc(100svh-32px)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
78619
+ ValPatches,
78620
+ {
78621
+ patches,
78622
+ api,
78623
+ onCancel: () => {
78624
+ setPatchModalOpen(false);
78625
+ },
78626
+ onCommit: () => {
78627
+ setPatchResetId((patchResetId) => patchResetId + 1);
78628
+ }
78629
+ }
78630
+ ) }),
77249
78631
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed -translate-y-1/2 right-4 top-1/2 z-overlay", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77250
78632
  ValMenu,
77251
78633
  {
77252
78634
  direction: "vertical",
77253
78635
  api,
77254
78636
  patches,
77255
- onCommit: () => setPatchResetId((prev) => prev + 1)
78637
+ onClickPatches: () => setPatchModalOpen((prev) => !prev)
77256
78638
  }
77257
78639
  ) }),
77258
78640
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "val-fullscreen-hover", ref: hoverElemRef }),
@@ -78334,454 +79716,6 @@ function hasArrayChanged() {
78334
79716
  let b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
78335
79717
  return a.length !== b.length || a.some((item, index2) => !Object.is(item, b[index2]));
78336
79718
  }
78337
- const $409067139f391064$var$COLLAPSIBLE_NAME = "Collapsible";
78338
- const [$409067139f391064$var$createCollapsibleContext, $409067139f391064$export$952b32dcbe73087a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME);
78339
- const [$409067139f391064$var$CollapsibleProvider, $409067139f391064$var$useCollapsibleContext] = $409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME);
78340
- const $409067139f391064$export$6eb0f7ddcda6131f = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
78341
- const { __scopeCollapsible, open: openProp, defaultOpen, disabled, onOpenChange, ...collapsibleProps } = props;
78342
- const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
78343
- prop: openProp,
78344
- defaultProp: defaultOpen,
78345
- onChange: onOpenChange
78346
- });
78347
- return /* @__PURE__ */ reactExports.createElement($409067139f391064$var$CollapsibleProvider, {
78348
- scope: __scopeCollapsible,
78349
- disabled,
78350
- contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
78351
- open,
78352
- onOpenToggle: reactExports.useCallback(
78353
- () => setOpen(
78354
- (prevOpen) => !prevOpen
78355
- ),
78356
- [
78357
- setOpen
78358
- ]
78359
- )
78360
- }, /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({
78361
- "data-state": $409067139f391064$var$getState(open),
78362
- "data-disabled": disabled ? "" : void 0
78363
- }, collapsibleProps, {
78364
- ref: forwardedRef
78365
- })));
78366
- });
78367
- const $409067139f391064$var$TRIGGER_NAME = "CollapsibleTrigger";
78368
- const $409067139f391064$export$c135dce7b15bbbdc = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
78369
- const { __scopeCollapsible, ...triggerProps } = props;
78370
- const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME, __scopeCollapsible);
78371
- return /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends$6({
78372
- type: "button",
78373
- "aria-controls": context.contentId,
78374
- "aria-expanded": context.open || false,
78375
- "data-state": $409067139f391064$var$getState(context.open),
78376
- "data-disabled": context.disabled ? "" : void 0,
78377
- disabled: context.disabled
78378
- }, triggerProps, {
78379
- ref: forwardedRef,
78380
- onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, context.onOpenToggle)
78381
- }));
78382
- });
78383
- const $409067139f391064$var$CONTENT_NAME = "CollapsibleContent";
78384
- const $409067139f391064$export$aadde00976f34151 = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
78385
- const { forceMount, ...contentProps } = props;
78386
- const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, props.__scopeCollapsible);
78387
- return /* @__PURE__ */ reactExports.createElement(
78388
- $921a889cee6df7e8$export$99c2b779aa4e8b8b,
78389
- {
78390
- present: forceMount || context.open
78391
- },
78392
- ({ present }) => /* @__PURE__ */ reactExports.createElement($409067139f391064$var$CollapsibleContentImpl, _extends$6({}, contentProps, {
78393
- ref: forwardedRef,
78394
- present
78395
- }))
78396
- );
78397
- });
78398
- const $409067139f391064$var$CollapsibleContentImpl = /* @__PURE__ */ reactExports.forwardRef((props, forwardedRef) => {
78399
- const { __scopeCollapsible, present, children, ...contentProps } = props;
78400
- const context = $409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME, __scopeCollapsible);
78401
- const [isPresent, setIsPresent] = reactExports.useState(present);
78402
- const ref = reactExports.useRef(null);
78403
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
78404
- const heightRef = reactExports.useRef(0);
78405
- const height = heightRef.current;
78406
- const widthRef = reactExports.useRef(0);
78407
- const width = widthRef.current;
78408
- const isOpen = context.open || isPresent;
78409
- const isMountAnimationPreventedRef = reactExports.useRef(isOpen);
78410
- const originalStylesRef = reactExports.useRef();
78411
- reactExports.useEffect(() => {
78412
- const rAF = requestAnimationFrame(
78413
- () => isMountAnimationPreventedRef.current = false
78414
- );
78415
- return () => cancelAnimationFrame(rAF);
78416
- }, []);
78417
- $9f79659886946c16$export$e5c5a5f917a5871c(() => {
78418
- const node = ref.current;
78419
- if (node) {
78420
- originalStylesRef.current = originalStylesRef.current || {
78421
- transitionDuration: node.style.transitionDuration,
78422
- animationName: node.style.animationName
78423
- };
78424
- node.style.transitionDuration = "0s";
78425
- node.style.animationName = "none";
78426
- const rect = node.getBoundingClientRect();
78427
- heightRef.current = rect.height;
78428
- widthRef.current = rect.width;
78429
- if (!isMountAnimationPreventedRef.current) {
78430
- node.style.transitionDuration = originalStylesRef.current.transitionDuration;
78431
- node.style.animationName = originalStylesRef.current.animationName;
78432
- }
78433
- setIsPresent(present);
78434
- }
78435
- }, [
78436
- context.open,
78437
- present
78438
- ]);
78439
- return /* @__PURE__ */ reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({
78440
- "data-state": $409067139f391064$var$getState(context.open),
78441
- "data-disabled": context.disabled ? "" : void 0,
78442
- id: context.contentId,
78443
- hidden: !isOpen
78444
- }, contentProps, {
78445
- ref: composedRefs,
78446
- style: {
78447
- [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
78448
- [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
78449
- ...props.style
78450
- }
78451
- }), isOpen && children);
78452
- });
78453
- function $409067139f391064$var$getState(open) {
78454
- return open ? "open" : "closed";
78455
- }
78456
- const $409067139f391064$export$be92b6f5f03c0fe9 = $409067139f391064$export$6eb0f7ddcda6131f;
78457
- const $409067139f391064$export$41fb9f06171c75f4 = $409067139f391064$export$c135dce7b15bbbdc;
78458
- const $409067139f391064$export$7c6e2c02157bb7d2 = $409067139f391064$export$aadde00976f34151;
78459
- const $1bf158f521e1b1b4$var$ACCORDION_NAME = "Accordion";
78460
- const $1bf158f521e1b1b4$var$ACCORDION_KEYS = [
78461
- "Home",
78462
- "End",
78463
- "ArrowDown",
78464
- "ArrowUp",
78465
- "ArrowLeft",
78466
- "ArrowRight"
78467
- ];
78468
- const [$1bf158f521e1b1b4$var$Collection, $1bf158f521e1b1b4$var$useCollection, $1bf158f521e1b1b4$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($1bf158f521e1b1b4$var$ACCORDION_NAME);
78469
- const [$1bf158f521e1b1b4$var$createAccordionContext, $1bf158f521e1b1b4$export$9748edc328a73be1] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($1bf158f521e1b1b4$var$ACCORDION_NAME, [
78470
- $1bf158f521e1b1b4$var$createCollectionScope,
78471
- $409067139f391064$export$952b32dcbe73087a
78472
- ]);
78473
- const $1bf158f521e1b1b4$var$useCollapsibleScope = $409067139f391064$export$952b32dcbe73087a();
78474
- const $1bf158f521e1b1b4$export$a766cd26d0d69044 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78475
- const { type, ...accordionProps } = props;
78476
- const singleProps = accordionProps;
78477
- const multipleProps = accordionProps;
78478
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.Provider, {
78479
- scope: props.__scopeAccordion
78480
- }, type === "multiple" ? /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplMultiple, _extends$6({}, multipleProps, {
78481
- ref: forwardedRef
78482
- })) : /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplSingle, _extends$6({}, singleProps, {
78483
- ref: forwardedRef
78484
- })));
78485
- });
78486
- $1bf158f521e1b1b4$export$a766cd26d0d69044.propTypes = {
78487
- type(props) {
78488
- const value = props.value || props.defaultValue;
78489
- if (props.type && ![
78490
- "single",
78491
- "multiple"
78492
- ].includes(props.type))
78493
- return new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`.");
78494
- if (props.type === "multiple" && typeof value === "string")
78495
- return new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`.");
78496
- if (props.type === "single" && Array.isArray(value))
78497
- return new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`.");
78498
- return null;
78499
- }
78500
- };
78501
- const [$1bf158f521e1b1b4$var$AccordionValueProvider, $1bf158f521e1b1b4$var$useAccordionValueContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
78502
- const [$1bf158f521e1b1b4$var$AccordionCollapsibleProvider, $1bf158f521e1b1b4$var$useAccordionCollapsibleContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, {
78503
- collapsible: false
78504
- });
78505
- const $1bf158f521e1b1b4$var$AccordionImplSingle = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78506
- const { value: valueProp, defaultValue, onValueChange = () => {
78507
- }, collapsible = false, ...accordionSingleProps } = props;
78508
- const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
78509
- prop: valueProp,
78510
- defaultProp: defaultValue,
78511
- onChange: onValueChange
78512
- });
78513
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
78514
- scope: props.__scopeAccordion,
78515
- value: value ? [
78516
- value
78517
- ] : [],
78518
- onItemOpen: setValue,
78519
- onItemClose: React.useCallback(
78520
- () => collapsible && setValue(""),
78521
- [
78522
- collapsible,
78523
- setValue
78524
- ]
78525
- )
78526
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
78527
- scope: props.__scopeAccordion,
78528
- collapsible
78529
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends$6({}, accordionSingleProps, {
78530
- ref: forwardedRef
78531
- }))));
78532
- });
78533
- const $1bf158f521e1b1b4$var$AccordionImplMultiple = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78534
- const { value: valueProp, defaultValue, onValueChange = () => {
78535
- }, ...accordionMultipleProps } = props;
78536
- const [value1 = [], setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
78537
- prop: valueProp,
78538
- defaultProp: defaultValue,
78539
- onChange: onValueChange
78540
- });
78541
- const handleItemOpen = React.useCallback(
78542
- (itemValue) => setValue(
78543
- (prevValue = []) => [
78544
- ...prevValue,
78545
- itemValue
78546
- ]
78547
- ),
78548
- [
78549
- setValue
78550
- ]
78551
- );
78552
- const handleItemClose = React.useCallback(
78553
- (itemValue) => setValue(
78554
- (prevValue = []) => prevValue.filter(
78555
- (value) => value !== itemValue
78556
- )
78557
- ),
78558
- [
78559
- setValue
78560
- ]
78561
- );
78562
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionValueProvider, {
78563
- scope: props.__scopeAccordion,
78564
- value: value1,
78565
- onItemOpen: handleItemOpen,
78566
- onItemClose: handleItemClose
78567
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionCollapsibleProvider, {
78568
- scope: props.__scopeAccordion,
78569
- collapsible: true
78570
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImpl, _extends$6({}, accordionMultipleProps, {
78571
- ref: forwardedRef
78572
- }))));
78573
- });
78574
- const [$1bf158f521e1b1b4$var$AccordionImplProvider, $1bf158f521e1b1b4$var$useAccordionContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME);
78575
- const $1bf158f521e1b1b4$var$AccordionImpl = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78576
- const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
78577
- const accordionRef = React.useRef(null);
78578
- const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(accordionRef, forwardedRef);
78579
- const getItems = $1bf158f521e1b1b4$var$useCollection(__scopeAccordion);
78580
- const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
78581
- const isDirectionLTR = direction === "ltr";
78582
- const handleKeyDown = $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
78583
- var _triggerCollection$cl;
78584
- if (!$1bf158f521e1b1b4$var$ACCORDION_KEYS.includes(event.key))
78585
- return;
78586
- const target = event.target;
78587
- const triggerCollection = getItems().filter((item) => {
78588
- var _item$ref$current;
78589
- return !((_item$ref$current = item.ref.current) !== null && _item$ref$current !== void 0 && _item$ref$current.disabled);
78590
- });
78591
- const triggerIndex = triggerCollection.findIndex(
78592
- (item) => item.ref.current === target
78593
- );
78594
- const triggerCount = triggerCollection.length;
78595
- if (triggerIndex === -1)
78596
- return;
78597
- event.preventDefault();
78598
- let nextIndex = triggerIndex;
78599
- const homeIndex = 0;
78600
- const endIndex = triggerCount - 1;
78601
- const moveNext = () => {
78602
- nextIndex = triggerIndex + 1;
78603
- if (nextIndex > endIndex)
78604
- nextIndex = homeIndex;
78605
- };
78606
- const movePrev = () => {
78607
- nextIndex = triggerIndex - 1;
78608
- if (nextIndex < homeIndex)
78609
- nextIndex = endIndex;
78610
- };
78611
- switch (event.key) {
78612
- case "Home":
78613
- nextIndex = homeIndex;
78614
- break;
78615
- case "End":
78616
- nextIndex = endIndex;
78617
- break;
78618
- case "ArrowRight":
78619
- if (orientation === "horizontal") {
78620
- if (isDirectionLTR)
78621
- moveNext();
78622
- else
78623
- movePrev();
78624
- }
78625
- break;
78626
- case "ArrowDown":
78627
- if (orientation === "vertical")
78628
- moveNext();
78629
- break;
78630
- case "ArrowLeft":
78631
- if (orientation === "horizontal") {
78632
- if (isDirectionLTR)
78633
- movePrev();
78634
- else
78635
- moveNext();
78636
- }
78637
- break;
78638
- case "ArrowUp":
78639
- if (orientation === "vertical")
78640
- movePrev();
78641
- break;
78642
- }
78643
- const clampedIndex = nextIndex % triggerCount;
78644
- (_triggerCollection$cl = triggerCollection[clampedIndex].ref.current) === null || _triggerCollection$cl === void 0 || _triggerCollection$cl.focus();
78645
- });
78646
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionImplProvider, {
78647
- scope: __scopeAccordion,
78648
- disabled,
78649
- direction: dir,
78650
- orientation
78651
- }, /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.Slot, {
78652
- scope: __scopeAccordion
78653
- }, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends$6({}, accordionProps, {
78654
- "data-orientation": orientation,
78655
- ref: composedRefs,
78656
- onKeyDown: disabled ? void 0 : handleKeyDown
78657
- }))));
78658
- });
78659
- const $1bf158f521e1b1b4$var$ITEM_NAME = "AccordionItem";
78660
- const [$1bf158f521e1b1b4$var$AccordionItemProvider, $1bf158f521e1b1b4$var$useAccordionItemContext] = $1bf158f521e1b1b4$var$createAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME);
78661
- const $1bf158f521e1b1b4$export$d99097c13d4dac9f = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78662
- const { __scopeAccordion, value, ...accordionItemProps } = props;
78663
- const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
78664
- const valueContext = $1bf158f521e1b1b4$var$useAccordionValueContext($1bf158f521e1b1b4$var$ITEM_NAME, __scopeAccordion);
78665
- const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
78666
- const triggerId = $1746a345f3d73bb7$export$f680877a34711e37();
78667
- const open1 = value && valueContext.value.includes(value) || false;
78668
- const disabled = accordionContext.disabled || props.disabled;
78669
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$AccordionItemProvider, {
78670
- scope: __scopeAccordion,
78671
- open: open1,
78672
- disabled,
78673
- triggerId
78674
- }, /* @__PURE__ */ React.createElement($409067139f391064$export$be92b6f5f03c0fe9, _extends$6({
78675
- "data-orientation": accordionContext.orientation,
78676
- "data-state": $1bf158f521e1b1b4$var$getState(open1)
78677
- }, collapsibleScope, accordionItemProps, {
78678
- ref: forwardedRef,
78679
- disabled,
78680
- open: open1,
78681
- onOpenChange: (open) => {
78682
- if (open)
78683
- valueContext.onItemOpen(value);
78684
- else
78685
- valueContext.onItemClose(value);
78686
- }
78687
- })));
78688
- });
78689
- const $1bf158f521e1b1b4$var$HEADER_NAME = "AccordionHeader";
78690
- const $1bf158f521e1b1b4$export$5e3e5deaaf81ee41 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78691
- const { __scopeAccordion, ...headerProps } = props;
78692
- const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
78693
- const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$HEADER_NAME, __scopeAccordion);
78694
- return /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.h3, _extends$6({
78695
- "data-orientation": accordionContext.orientation,
78696
- "data-state": $1bf158f521e1b1b4$var$getState(itemContext.open),
78697
- "data-disabled": itemContext.disabled ? "" : void 0
78698
- }, headerProps, {
78699
- ref: forwardedRef
78700
- }));
78701
- });
78702
- const $1bf158f521e1b1b4$var$TRIGGER_NAME = "AccordionTrigger";
78703
- const $1bf158f521e1b1b4$export$94e939b1f85bdd73 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78704
- const { __scopeAccordion, ...triggerProps } = props;
78705
- const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
78706
- const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
78707
- const collapsibleContext = $1bf158f521e1b1b4$var$useAccordionCollapsibleContext($1bf158f521e1b1b4$var$TRIGGER_NAME, __scopeAccordion);
78708
- const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
78709
- return /* @__PURE__ */ React.createElement($1bf158f521e1b1b4$var$Collection.ItemSlot, {
78710
- scope: __scopeAccordion
78711
- }, /* @__PURE__ */ React.createElement($409067139f391064$export$41fb9f06171c75f4, _extends$6({
78712
- "aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0,
78713
- "data-orientation": accordionContext.orientation,
78714
- id: itemContext.triggerId
78715
- }, collapsibleScope, triggerProps, {
78716
- ref: forwardedRef
78717
- })));
78718
- });
78719
- const $1bf158f521e1b1b4$var$CONTENT_NAME = "AccordionContent";
78720
- const $1bf158f521e1b1b4$export$985b9a77379b54a0 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
78721
- const { __scopeAccordion, ...contentProps } = props;
78722
- const accordionContext = $1bf158f521e1b1b4$var$useAccordionContext($1bf158f521e1b1b4$var$ACCORDION_NAME, __scopeAccordion);
78723
- const itemContext = $1bf158f521e1b1b4$var$useAccordionItemContext($1bf158f521e1b1b4$var$CONTENT_NAME, __scopeAccordion);
78724
- const collapsibleScope = $1bf158f521e1b1b4$var$useCollapsibleScope(__scopeAccordion);
78725
- return /* @__PURE__ */ React.createElement($409067139f391064$export$7c6e2c02157bb7d2, _extends$6({
78726
- role: "region",
78727
- "aria-labelledby": itemContext.triggerId,
78728
- "data-orientation": accordionContext.orientation
78729
- }, collapsibleScope, contentProps, {
78730
- ref: forwardedRef,
78731
- style: {
78732
- ["--radix-accordion-content-height"]: "var(--radix-collapsible-content-height)",
78733
- ["--radix-accordion-content-width"]: "var(--radix-collapsible-content-width)",
78734
- ...props.style
78735
- }
78736
- }));
78737
- });
78738
- function $1bf158f521e1b1b4$var$getState(open) {
78739
- return open ? "open" : "closed";
78740
- }
78741
- const $1bf158f521e1b1b4$export$be92b6f5f03c0fe9 = $1bf158f521e1b1b4$export$a766cd26d0d69044;
78742
- const $1bf158f521e1b1b4$export$6d08773d2e66f8f2 = $1bf158f521e1b1b4$export$d99097c13d4dac9f;
78743
- const $1bf158f521e1b1b4$export$8b251419efc915eb = $1bf158f521e1b1b4$export$5e3e5deaaf81ee41;
78744
- const $1bf158f521e1b1b4$export$41fb9f06171c75f4 = $1bf158f521e1b1b4$export$94e939b1f85bdd73;
78745
- const $1bf158f521e1b1b4$export$7c6e2c02157bb7d2 = $1bf158f521e1b1b4$export$985b9a77379b54a0;
78746
- const Accordion = $1bf158f521e1b1b4$export$be92b6f5f03c0fe9;
78747
- const AccordionItem = reactExports.forwardRef(({ className: className2, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
78748
- $1bf158f521e1b1b4$export$6d08773d2e66f8f2,
78749
- {
78750
- ref,
78751
- className: cn("border-b", className2),
78752
- ...props
78753
- }
78754
- ));
78755
- AccordionItem.displayName = "AccordionItem";
78756
- const AccordionTrigger = reactExports.forwardRef(({ className: className2, children, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx($1bf158f521e1b1b4$export$8b251419efc915eb, { className: "flex", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
78757
- $1bf158f521e1b1b4$export$41fb9f06171c75f4,
78758
- {
78759
- ref,
78760
- className: cn(
78761
- "flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",
78762
- className2
78763
- ),
78764
- ...props,
78765
- children: [
78766
- children,
78767
- /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-4 h-4 transition-transform duration-200 shrink-0" })
78768
- ]
78769
- }
78770
- ) }));
78771
- AccordionTrigger.displayName = $1bf158f521e1b1b4$export$41fb9f06171c75f4.displayName;
78772
- const AccordionContent = reactExports.forwardRef(({ className: className2, children, ...props }, ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
78773
- $1bf158f521e1b1b4$export$7c6e2c02157bb7d2,
78774
- {
78775
- ref,
78776
- className: cn(
78777
- "overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
78778
- className2
78779
- ),
78780
- ...props,
78781
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-0 pb-4", children })
78782
- }
78783
- ));
78784
- AccordionContent.displayName = $1bf158f521e1b1b4$export$7c6e2c02157bb7d2.displayName;
78785
79719
  /**
78786
79720
  * React Router DOM v6.20.0
78787
79721
  *