cross-seed 7.0.0-1 → 7.0.0-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Result.d.ts +27 -0
- package/dist/Result.js +64 -0
- package/dist/Result.js.map +1 -0
- package/dist/action.d.ts +34 -0
- package/dist/action.js +694 -0
- package/dist/action.js.map +1 -0
- package/dist/arr.d.ts +31 -0
- package/dist/arr.js +267 -0
- package/dist/arr.js.map +1 -0
- package/dist/auth.d.ts +3 -0
- package/dist/auth.js +28 -0
- package/dist/auth.js.map +1 -0
- package/dist/clients/Deluge.d.ts +153 -0
- package/dist/clients/Deluge.js +699 -0
- package/dist/clients/Deluge.js.map +1 -0
- package/dist/clients/QBittorrent.d.ts +218 -0
- package/dist/clients/QBittorrent.js +786 -0
- package/dist/clients/QBittorrent.js.map +1 -0
- package/dist/clients/RTorrent.d.ts +43 -0
- package/dist/clients/RTorrent.js +658 -0
- package/dist/clients/RTorrent.js.map +1 -0
- package/dist/clients/TorrentClient.d.ts +108 -0
- package/dist/clients/TorrentClient.js +342 -0
- package/dist/clients/TorrentClient.js.map +1 -0
- package/dist/clients/Transmission.d.ts +43 -0
- package/dist/clients/Transmission.js +405 -0
- package/dist/clients/Transmission.js.map +1 -0
- package/dist/cmd.d.ts +2 -0
- package/dist/cmd.js +128 -0
- package/dist/cmd.js.map +1 -0
- package/dist/configSchema.d.ts +1 -0
- package/dist/configSchema.js +2 -0
- package/dist/configSchema.js.map +1 -0
- package/dist/configuration.d.ts +63 -0
- package/dist/configuration.js +321 -0
- package/dist/configuration.js.map +1 -0
- package/dist/constants.d.ts +108 -0
- package/dist/constants.js +251 -0
- package/dist/constants.js.map +1 -0
- package/dist/dataFiles.d.ts +8 -0
- package/dist/dataFiles.js +223 -0
- package/dist/dataFiles.js.map +1 -0
- package/dist/db.d.ts +14 -0
- package/dist/db.js +287 -0
- package/dist/db.js.map +1 -0
- package/dist/dbConfig.d.ts +4 -0
- package/dist/dbConfig.js +67 -0
- package/dist/dbConfig.js.map +1 -0
- package/dist/decide.d.ts +25 -0
- package/dist/decide.js +553 -0
- package/dist/decide.js.map +1 -0
- package/dist/diagnostics/db.d.ts +21 -0
- package/dist/diagnostics/db.js +107 -0
- package/dist/diagnostics/db.js.map +1 -0
- package/dist/diff.d.ts +1 -0
- package/dist/diff.js +24 -0
- package/dist/diff.js.map +1 -0
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +7 -0
- package/dist/errors.js.map +1 -0
- package/dist/indexers.d.ts +105 -0
- package/dist/indexers.js +248 -0
- package/dist/indexers.js.map +1 -0
- package/dist/inject.d.ts +2 -0
- package/dist/inject.js +594 -0
- package/dist/inject.js.map +1 -0
- package/dist/jobs.d.ts +29 -0
- package/dist/jobs.js +151 -0
- package/dist/jobs.js.map +1 -0
- package/dist/logger.d.ts +29 -0
- package/dist/logger.js +157 -0
- package/dist/logger.js.map +1 -0
- package/dist/migrations/00-initialSchema.d.ts +9 -0
- package/dist/migrations/00-initialSchema.js +30 -0
- package/dist/migrations/00-initialSchema.js.map +1 -0
- package/dist/migrations/01-jobs.d.ts +9 -0
- package/dist/migrations/01-jobs.js +12 -0
- package/dist/migrations/01-jobs.js.map +1 -0
- package/dist/migrations/02-timestamps.d.ts +9 -0
- package/dist/migrations/02-timestamps.js +21 -0
- package/dist/migrations/02-timestamps.js.map +1 -0
- package/dist/migrations/03-rateLimits.d.ts +9 -0
- package/dist/migrations/03-rateLimits.js +14 -0
- package/dist/migrations/03-rateLimits.js.map +1 -0
- package/dist/migrations/04-auth.d.ts +9 -0
- package/dist/migrations/04-auth.js +13 -0
- package/dist/migrations/04-auth.js.map +1 -0
- package/dist/migrations/05-caps.d.ts +9 -0
- package/dist/migrations/05-caps.js +16 -0
- package/dist/migrations/05-caps.js.map +1 -0
- package/dist/migrations/06-uniqueDecisions.d.ts +9 -0
- package/dist/migrations/06-uniqueDecisions.js +29 -0
- package/dist/migrations/06-uniqueDecisions.js.map +1 -0
- package/dist/migrations/07-limits.d.ts +9 -0
- package/dist/migrations/07-limits.js +12 -0
- package/dist/migrations/07-limits.js.map +1 -0
- package/dist/migrations/08-rss.d.ts +9 -0
- package/dist/migrations/08-rss.js +15 -0
- package/dist/migrations/08-rss.js.map +1 -0
- package/dist/migrations/09-clientAndDataSearchees.d.ts +9 -0
- package/dist/migrations/09-clientAndDataSearchees.js +34 -0
- package/dist/migrations/09-clientAndDataSearchees.js.map +1 -0
- package/dist/migrations/10-indexerNameAudioBookCaps.d.ts +9 -0
- package/dist/migrations/10-indexerNameAudioBookCaps.js +18 -0
- package/dist/migrations/10-indexerNameAudioBookCaps.js.map +1 -0
- package/dist/migrations/11-trackers.d.ts +9 -0
- package/dist/migrations/11-trackers.js +38 -0
- package/dist/migrations/11-trackers.js.map +1 -0
- package/dist/migrations/12-user-auth.d.ts +9 -0
- package/dist/migrations/12-user-auth.js +22 -0
- package/dist/migrations/12-user-auth.js.map +1 -0
- package/dist/migrations/13-settings.d.ts +9 -0
- package/dist/migrations/13-settings.js +23 -0
- package/dist/migrations/13-settings.js.map +1 -0
- package/dist/migrations/14-indexer-enabled-flag.d.ts +9 -0
- package/dist/migrations/14-indexer-enabled-flag.js +12 -0
- package/dist/migrations/14-indexer-enabled-flag.js.map +1 -0
- package/dist/migrations/15-remove-url-unique-constraint.d.ts +9 -0
- package/dist/migrations/15-remove-url-unique-constraint.js +14 -0
- package/dist/migrations/15-remove-url-unique-constraint.js.map +1 -0
- package/dist/migrations/16-prune-inactive-indexers.d.ts +9 -0
- package/dist/migrations/16-prune-inactive-indexers.js +17 -0
- package/dist/migrations/16-prune-inactive-indexers.js.map +1 -0
- package/dist/migrations/migrations.d.ts +13 -0
- package/dist/migrations/migrations.js +41 -0
- package/dist/migrations/migrations.js.map +1 -0
- package/dist/parseTorrent.d.ts +53 -0
- package/dist/parseTorrent.js +128 -0
- package/dist/parseTorrent.js.map +1 -0
- package/dist/pipeline.d.ts +41 -0
- package/dist/pipeline.js +578 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/preFilter.d.ts +25 -0
- package/dist/preFilter.js +250 -0
- package/dist/preFilter.js.map +1 -0
- package/dist/problems/linking.d.ts +2 -0
- package/dist/problems/linking.js +80 -0
- package/dist/problems/linking.js.map +1 -0
- package/dist/problems/path.d.ts +22 -0
- package/dist/problems/path.js +96 -0
- package/dist/problems/path.js.map +1 -0
- package/dist/problems.d.ts +13 -0
- package/dist/problems.js +48 -0
- package/dist/problems.js.map +1 -0
- package/dist/pushNotifier.d.ts +19 -0
- package/dist/pushNotifier.js +137 -0
- package/dist/pushNotifier.js.map +1 -0
- package/dist/routes/baseApi.d.ts +2 -0
- package/dist/routes/baseApi.js +354 -0
- package/dist/routes/baseApi.js.map +1 -0
- package/dist/routes/indexerApi.d.ts +6 -0
- package/dist/routes/indexerApi.js +165 -0
- package/dist/routes/indexerApi.js.map +1 -0
- package/dist/routes/staticFrontendPlugin.d.ts +4 -0
- package/dist/routes/staticFrontendPlugin.js +61 -0
- package/dist/routes/staticFrontendPlugin.js.map +1 -0
- package/dist/runtimeConfig.d.ts +6 -0
- package/dist/runtimeConfig.js +27 -0
- package/dist/runtimeConfig.js.map +1 -0
- package/dist/searchee.d.ts +108 -0
- package/dist/searchee.js +690 -0
- package/dist/searchee.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +65 -0
- package/dist/server.js.map +1 -0
- package/dist/services/indexerService.d.ts +96 -0
- package/dist/services/indexerService.js +287 -0
- package/dist/services/indexerService.js.map +1 -0
- package/dist/sessionCookies.d.ts +5 -0
- package/dist/sessionCookies.js +27 -0
- package/dist/sessionCookies.js.map +1 -0
- package/dist/startup.d.ts +25 -0
- package/dist/startup.js +157 -0
- package/dist/startup.js.map +1 -0
- package/dist/torrent.d.ts +69 -0
- package/dist/torrent.js +641 -0
- package/dist/torrent.js.map +1 -0
- package/dist/torznab.d.ts +60 -0
- package/dist/torznab.js +711 -0
- package/dist/torznab.js.map +1 -0
- package/dist/trpc/fastifyAdapter.d.ts +2 -0
- package/dist/trpc/fastifyAdapter.js +9 -0
- package/dist/trpc/fastifyAdapter.js.map +1 -0
- package/dist/trpc/index.d.ts +49 -0
- package/dist/trpc/index.js +53 -0
- package/dist/trpc/index.js.map +1 -0
- package/dist/trpc/routers/auth.d.ts +43 -0
- package/dist/trpc/routers/auth.js +116 -0
- package/dist/trpc/routers/auth.js.map +1 -0
- package/dist/trpc/routers/clients.d.ts +21 -0
- package/dist/trpc/routers/clients.js +65 -0
- package/dist/trpc/routers/clients.js.map +1 -0
- package/dist/trpc/routers/health.d.ts +17 -0
- package/dist/trpc/routers/health.js +24 -0
- package/dist/trpc/routers/health.js.map +1 -0
- package/dist/trpc/routers/index.d.ts +394 -0
- package/dist/trpc/routers/index.js +23 -0
- package/dist/trpc/routers/index.js.map +1 -0
- package/dist/trpc/routers/indexers.d.ts +75 -0
- package/dist/trpc/routers/indexers.js +79 -0
- package/dist/trpc/routers/indexers.js.map +1 -0
- package/dist/trpc/routers/jobs.d.ts +33 -0
- package/dist/trpc/routers/jobs.js +84 -0
- package/dist/trpc/routers/jobs.js.map +1 -0
- package/dist/trpc/routers/logs.d.ts +27 -0
- package/dist/trpc/routers/logs.js +91 -0
- package/dist/trpc/routers/logs.js.map +1 -0
- package/dist/trpc/routers/searchees.d.ts +51 -0
- package/dist/trpc/routers/searchees.js +156 -0
- package/dist/trpc/routers/searchees.js.map +1 -0
- package/dist/trpc/routers/settings.d.ts +83 -0
- package/dist/trpc/routers/settings.js +92 -0
- package/dist/trpc/routers/settings.js.map +1 -0
- package/dist/trpc/routers/stats.d.ts +42 -0
- package/dist/trpc/routers/stats.js +102 -0
- package/dist/trpc/routers/stats.js.map +1 -0
- package/dist/userAuth.d.ts +21 -0
- package/dist/userAuth.js +86 -0
- package/dist/userAuth.js.map +1 -0
- package/dist/utils/authUtils.d.ts +10 -0
- package/dist/utils/authUtils.js +24 -0
- package/dist/utils/authUtils.js.map +1 -0
- package/dist/utils/logWatcher.d.ts +28 -0
- package/dist/utils/logWatcher.js +229 -0
- package/dist/utils/logWatcher.js.map +1 -0
- package/dist/utils/object.d.ts +1 -0
- package/dist/utils/object.js +4 -0
- package/dist/utils/object.js.map +1 -0
- package/dist/utils.d.ts +172 -0
- package/dist/utils.js +648 -0
- package/dist/utils.js.map +1 -0
- package/dist/webui/assets/{FieldInfo-Bxj_j8SJ.js → FieldInfo-sRlPRNSK.js} +1 -1
- package/dist/webui/assets/{Page-C3rteCZt.js → Page-B68mlTwU.js} +1 -1
- package/dist/webui/assets/{array-field-DVSC6nHP.js → array-field-BCFMrvoU.js} +1 -1
- package/dist/webui/assets/{badge-DTZMtS0e.js → badge-C5YCxEzP.js} +1 -1
- package/dist/webui/assets/check-NQsw6yBl.js +1 -0
- package/dist/webui/assets/{chevron-down-CRy8M0kJ.js → chevron-down-8PGvFYxV.js} +1 -1
- package/dist/webui/assets/{clients-CW8oEZoQ.js → clients-DnVpwApe.js} +1 -1
- package/dist/webui/assets/{connect-YBNsnjWT.js → connect-wMg2zyz6.js} +1 -1
- package/dist/webui/assets/debug-BrjwiEi2.js +1 -0
- package/dist/webui/assets/{directories-BSK28RgR.js → directories-CHpJCWNR.js} +1 -1
- package/dist/webui/assets/{duration-field-C6xoSlJg.js → duration-field-DIkKt3iw.js} +1 -1
- package/dist/webui/assets/{general-lJJxZhH7.js → general-uZrUIxbI.js} +1 -1
- package/dist/webui/assets/health-_MuvAyjo.js +1 -0
- package/dist/webui/assets/index-B41DM2T5.css +1 -0
- package/dist/webui/assets/{index-C2cH1Gst.js → index-BBzHsn7u.js} +1 -1
- package/dist/webui/assets/{index-Bi48hI2z.js → index-Ncy0-Qo7.js} +3 -3
- package/dist/webui/assets/index-pKWy6v1P.js +1 -0
- package/dist/webui/assets/{jobs-CxmNab9w.js → jobs-B8eat0YU.js} +1 -1
- package/dist/webui/assets/{library-vaj2W8sE.js → library-BB0jQ8zn.js} +1 -1
- package/dist/webui/assets/{loader-circle-M0gu1gZ-.js → loader-circle-Bz67bJa3.js} +1 -1
- package/dist/webui/assets/logs-CeP28848.js +1 -0
- package/dist/webui/assets/{search-2R5sIdT8.js → search-BRBIrqaX.js} +1 -1
- package/dist/webui/assets/{select-zHgqMzLj.js → select-GZr6C6eZ.js} +1 -1
- package/dist/webui/assets/{select-field-BCqNLDrJ.js → select-field-CvT0SYk8.js} +1 -1
- package/dist/webui/assets/settings-0ZdYY8g_.js +1 -0
- package/dist/webui/assets/{submit-button-BtcnyggQ.js → submit-button-D7DKHqAq.js} +1 -1
- package/dist/webui/assets/{switch-G0W3uJVN.js → switch-BeMrf8sh.js} +1 -1
- package/dist/webui/assets/{switch-field-IBd9ORNq.js → switch-field-qMXHRKhx.js} +1 -1
- package/dist/webui/assets/{table-DvgJU7Gh.js → table-qEFWauuw.js} +1 -1
- package/dist/webui/assets/{test-tube-BIwmoM45.js → test-tube-DhD6uWdp.js} +1 -1
- package/dist/webui/assets/{text-field-DruSbGhy.js → text-field-ZnKHDUks.js} +1 -1
- package/dist/webui/assets/{time-BSMZjmyW.js → time-BM9K_Fbp.js} +1 -1
- package/dist/webui/assets/{trackers-D-OpAe63.js → trackers-BjJuAdX3.js} +1 -1
- package/dist/webui/assets/{use-form-validation-context-BkAfWAh0.js → use-form-validation-context-D2oA54L_.js} +1 -1
- package/dist/webui/assets/{use-settings-form-submit-CDRh-E9U.js → use-settings-form-submit-CXwtE1sI.js} +2 -2
- package/dist/webui/assets/useQuery-DD10sbzn.js +1 -0
- package/dist/webui/index.html +2 -2
- package/node_modules/@cross-seed/shared/dist/configSchema.d.ts.map +1 -1
- package/node_modules/@cross-seed/shared/dist/configSchema.js.map +1 -1
- package/node_modules/@cross-seed/shared/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@cross-seed/shared/dist/utils.d.ts +3 -0
- package/node_modules/@cross-seed/shared/dist/utils.d.ts.map +1 -1
- package/node_modules/@cross-seed/shared/dist/utils.js +11 -0
- package/node_modules/@cross-seed/shared/dist/utils.js.map +1 -1
- package/node_modules/@cross-seed/shared/package.json +3 -1
- package/package.json +18 -59
- package/LICENSE +0 -201
- package/README.md +0 -33
- package/dist/webui/assets/check-Bu3ldi63.js +0 -1
- package/dist/webui/assets/debug-mz8-WYZj.js +0 -1
- package/dist/webui/assets/health-CXbsVrie.js +0 -1
- package/dist/webui/assets/index-C-Ul7GNg.css +0 -1
- package/dist/webui/assets/index-Cc5bDmJr.js +0 -1
- package/dist/webui/assets/logs-Cu9RyKS0.js +0 -1
- package/dist/webui/assets/settings-CMYjpTbZ.js +0 -1
- package/dist/webui/assets/useQuery-A4Hv_4uX.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,i as o,u as x,k as u,r as m}from"./index-Ncy0-Qo7.js";import{P as g}from"./Page-B68mlTwU.js";function s({title:n,value:t,description:r,className:i,trend:a}){return e.jsxs("div",{className:o("bg-card text-card-foreground rounded-lg border p-6 shadow-sm",i),children:[e.jsx("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:e.jsx("h3",{className:"text-sm font-medium tracking-tight",children:n})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"text-2xl font-bold",children:t}),a&&e.jsxs("div",{className:"text-muted-foreground text-xs",children:[e.jsxs("span",{className:o("font-medium",a.value>0?"text-green-600":"text-red-600"),children:[a.value>0?"+":"",a.value]})," ",a.label]})]}),r&&e.jsx("p",{className:"text-muted-foreground text-xs",children:r})]})}function v(){const n=x(),{data:t}=u(n.stats.getOverview.queryOptions()),r=m.useMemo(()=>t.queryCount!==t.totalSearchees,[t.queryCount,t.totalSearchees]),i=r,a=r?"lg:grid-cols-5":"lg:grid-cols-4",c=i?"lg:grid-cols-4":"lg:grid-cols-3",l=t.allIndexersHealthy?"Indexer Health":"Unhealthy Indexers",d=t.allIndexersHealthy?`All ${t.totalIndexers.toLocaleString()}`:t.unhealthyIndexers.toLocaleString(),h=t.allIndexersHealthy?"Indexers are all reporting healthy":`${t.unhealthyIndexers.toLocaleString()} of ${t.totalIndexers.toLocaleString()} indexers need attention`;return e.jsx(g,{breadcrumbs:["Dashboard"],children:e.jsx("div",{className:"main space-y-8",children:e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:`grid gap-4 md:grid-cols-2 ${a}`,children:[e.jsx(s,{title:"Total Searchees",value:t.totalSearchees.toLocaleString(),description:"Torrents being monitored"}),r&&e.jsx(s,{title:"Total Search Queries",value:t.queryCount.toLocaleString(),description:"Distinct estimated searches"}),e.jsx(s,{title:"Total Query-Indexer Pairs",value:t.queryIndexerCount.toLocaleString(),description:"Unique indexer searches"}),e.jsx(s,{title:"Total Snatches",value:t.snatchCount.toLocaleString(),description:"Unique infohash attempts"}),e.jsx(s,{title:"Total Matches",value:t.totalMatches.toLocaleString(),description:"Unique cross-seeds found"})]}),e.jsxs("div",{className:`grid gap-4 md:grid-cols-2 ${c}`,children:[e.jsx(s,{title:"Matches per Searchee",value:t.matchRate.toFixed(2),description:"Average matches per monitored torrent"}),i&&e.jsx(s,{title:"Matches per Query",value:t.matchesPerQuery.toFixed(2),description:"Matches per search estimate"}),e.jsx(s,{title:"Match Rate",value:`${(t.matchesPerQueryIndexer*100).toFixed(1)}%`,description:"of indexer searches find a match"}),e.jsx(s,{title:"Wasted Snatches",value:`${(t.wastedSnatchRate*100).toFixed(1)}%`,description:`${t.wastedSnatchCount.toLocaleString()} snatched but mismatched`})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(s,{title:l,value:d,description:h}),e.jsx(s,{title:"Recent Activity",value:t.recentMatches.toLocaleString(),description:"Matches in last 24h"})]})]})})})}export{v as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as j,u as f,r as N,k as v,l as b,j as e,B as S}from"./index-
|
|
1
|
+
import{c as j,u as f,r as N,k as v,l as b,j as e,B as S}from"./index-Ncy0-Qo7.js";import{B as i}from"./badge-C5YCxEzP.js";import{T,a as w,b as d,c as t,d as y,e as a}from"./table-qEFWauuw.js";import{f as m}from"./time-BM9K_Fbp.js";import{P as E}from"./Page-B68mlTwU.js";import{C as R}from"./check-NQsw6yBl.js";const C=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],B=j("Play",C);function _(){const o=f(),[u,c]=N.useState(new Set),{data:x}=v(o.jobs.getJobStatuses.queryOptions(void 0,{refetchInterval:5e3})),{mutate:h}=b(o.jobs.triggerJob.mutationOptions({onSuccess:(s,{name:n})=>{c(r=>new Set(r).add(n)),setTimeout(()=>{c(r=>{const l=new Set(r);return l.delete(n),l})},3e3)},onError:s=>{console.error("Failed to trigger job:",s.message)}})),g=s=>s.isActive?e.jsx(i,{variant:"default",className:"bg-blue-500",children:"Running"}):s.nextExecution==="now"?e.jsx(i,{variant:"secondary",children:"Ready"}):e.jsx(i,{variant:"outline",children:"Scheduled"}),p=s=>s.split(/(?=[A-Z])/).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ");return e.jsx(E,{children:e.jsx("div",{className:"overflow-x-auto rounded-lg border",children:e.jsxs(T,{children:[e.jsx(w,{className:"bg-muted sticky top-0 z-10",children:e.jsxs(d,{className:"border-b",children:[e.jsx(t,{children:"Name"}),e.jsx(t,{children:"Interval"}),e.jsx(t,{children:"Last Execution"}),e.jsx(t,{children:"Next Execution"}),e.jsx(t,{children:"Status"}),e.jsx(t,{className:"text-right",children:"Actions"})]})}),e.jsx(y,{children:x?.map(s=>e.jsxs(d,{children:[e.jsx(a,{className:"font-medium",children:p(s.name)}),e.jsx(a,{children:s.interval}),e.jsx(a,{children:s.lastExecution?m(s.lastExecution):"Never"}),e.jsx(a,{children:s.nextExecution==="now"?"Now":m(s.nextExecution)}),e.jsx(a,{children:g(s)}),e.jsx(a,{className:"text-right",children:e.jsx(S,{variant:"outline",size:"sm",disabled:s.isActive||!s.canRunNow,onClick:()=>h({name:s.name}),children:u.has(s.name)?e.jsxs(e.Fragment,{children:[e.jsx(R,{className:"mr-1 h-4 w-4 text-green-600"}),"Started"]}):e.jsxs(e.Fragment,{children:[e.jsx(B,{className:"mr-1 h-4 w-4"}),"Run"]})})})]},s.name))})]})})})}export{_ as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as D,r as m,j as e,b as te,P as ae,d as q,e as ne,f as X,g as O,h as re,i as oe,u as ce,k as ie,l as de,t as T,B as E,m as le,n as he}from"./index-Bi48hI2z.js";import{T as ue,a as me,b as A,c as z,d as pe,e as _}from"./table-DvgJU7Gh.js";import{P as xe,D as fe,a as be,b as ge,c as H,C as ke}from"./Page-C3rteCZt.js";import{f as Ce}from"./time-BSMZjmyW.js";import{u as je}from"./index-C2cH1Gst.js";import{C as ve}from"./check-Bu3ldi63.js";import{L as Ne}from"./loader-circle-M0gu1gZ-.js";import{C as ye}from"./chevron-down-CRy8M0kJ.js";const Se=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],we=D("ChevronLeft",Se);const Pe=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Ee=D("ChevronsLeft",Pe);const _e=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Ie=D("ChevronsRight",_e);var L="Checkbox",[Re]=te(L),[Me,F]=Re(L);function ze(t){const{__scopeCheckbox:n,checked:c,children:l,defaultChecked:d,disabled:r,form:g,name:o,onCheckedChange:h,required:k,value:C="on",internal_do_not_use_render:x}=t,[i,w]=ne({prop:c,defaultProp:d??!1,onChange:h,caller:L}),[j,v]=m.useState(null),[P,a]=m.useState(null),p=m.useRef(!1),I=j?!!g||!!j.closest("form"):!0,R={checked:i,disabled:r,setChecked:w,control:j,setControl:v,name:o,form:g,value:C,hasConsumerStoppedPropagationRef:p,required:k,defaultChecked:S(d)?!1:d,isFormControl:I,bubbleInput:P,setBubbleInput:a};return e.jsx(Me,{scope:n,...R,children:Be(x)?x(R):l})}var Q="CheckboxTrigger",Z=m.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:c,...l},d)=>{const{control:r,value:g,disabled:o,checked:h,required:k,setControl:C,setChecked:x,hasConsumerStoppedPropagationRef:i,isFormControl:w,bubbleInput:j}=F(Q,t),v=X(d,C),P=m.useRef(h);return m.useEffect(()=>{const a=r?.form;if(a){const p=()=>x(P.current);return a.addEventListener("reset",p),()=>a.removeEventListener("reset",p)}},[r,x]),e.jsx(q.button,{type:"button",role:"checkbox","aria-checked":S(h)?"mixed":h,"aria-required":k,"data-state":se(h),"data-disabled":o?"":void 0,disabled:o,value:g,...l,ref:v,onKeyDown:O(n,a=>{a.key==="Enter"&&a.preventDefault()}),onClick:O(c,a=>{x(p=>S(p)?!0:!p),j&&w&&(i.current=a.isPropagationStopped(),i.current||a.stopPropagation())})})});Z.displayName=Q;var J=m.forwardRef((t,n)=>{const{__scopeCheckbox:c,name:l,checked:d,defaultChecked:r,required:g,disabled:o,value:h,onCheckedChange:k,form:C,...x}=t;return e.jsx(ze,{__scopeCheckbox:c,checked:d,defaultChecked:r,disabled:o,required:g,onCheckedChange:k,name:l,form:C,value:h,internal_do_not_use_render:({isFormControl:i})=>e.jsxs(e.Fragment,{children:[e.jsx(Z,{...x,ref:n,__scopeCheckbox:c}),i&&e.jsx(ee,{__scopeCheckbox:c})]})})});J.displayName=L;var V="CheckboxIndicator",W=m.forwardRef((t,n)=>{const{__scopeCheckbox:c,forceMount:l,...d}=t,r=F(V,c);return e.jsx(ae,{present:l||S(r.checked)||r.checked===!0,children:e.jsx(q.span,{"data-state":se(r.checked),"data-disabled":r.disabled?"":void 0,...d,ref:n,style:{pointerEvents:"none",...t.style}})})});W.displayName=V;var Y="CheckboxBubbleInput",ee=m.forwardRef(({__scopeCheckbox:t,...n},c)=>{const{control:l,hasConsumerStoppedPropagationRef:d,checked:r,defaultChecked:g,required:o,disabled:h,name:k,value:C,form:x,bubbleInput:i,setBubbleInput:w}=F(Y,t),j=X(c,w),v=je(r),P=re(l);m.useEffect(()=>{const p=i;if(!p)return;const I=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(I,"checked").set,$=!d.current;if(v!==r&&N){const M=new Event("click",{bubbles:$});p.indeterminate=S(r),N.call(p,S(r)?!1:r),p.dispatchEvent(M)}},[i,v,r,d]);const a=m.useRef(S(r)?!1:r);return e.jsx(q.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??a.current,required:o,disabled:h,name:k,value:C,form:x,...n,tabIndex:-1,ref:j,style:{...n.style,...P,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ee.displayName=Y;function Be(t){return typeof t=="function"}function S(t){return t==="indeterminate"}function se(t){return S(t)?"indeterminate":t?"checked":"unchecked"}function K({className:t,...n}){return e.jsx(J,{"data-slot":"checkbox",className:oe("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:e.jsx(W,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:e.jsx(ve,{className:"size-3.5"})})})}function U(t){return t===!0}const y=25,B=20;function Oe(){const t=ce(),[n,c]=m.useState(0),[l,d]=m.useState(()=>new Map),r=m.useMemo(()=>({limit:y,offset:n*y}),[n]),g=ie(t.searchees.list.queryOptions(r)),{data:o,isFetching:h}=g;m.useEffect(()=>{if(n*y<o.total)return;if(o.total===0){c(0);return}const s=Math.max(0,Math.ceil(o.total/y)-1);s!==n&&c(s)},[o.total,n]);const k=Math.max(1,Math.ceil(o.total/y)),C=n>0,x=(n+1)*y<o.total,i=o.items,w=o.total===0?0:n*y+1,j=o.total===0?0:n*y+i.length,v=i.length>0&&i.every(s=>l.has(s.id)),P=i.some(s=>l.has(s.id)),a=l.size,p=s=>{d(f=>{const b=new Map(f);return s?i.forEach(u=>b.set(u.id,{id:u.id,name:u.name})):i.forEach(u=>b.delete(u.id)),b})},I=(s,f)=>{d(b=>{const u=new Map(b);return f?u.set(s.id,s):u.delete(s.id),u})},R=()=>d(new Map),N=de(t.searchees.bulkSearch.mutationOptions({onSuccess:s=>{const{attempted:f,totalFound:b,skipped:u}=s;f===0?T.info("No eligible items to search",{description:u>0?`${u} item${u===1?"":"s"} were skipped by filters.`:void 0}):T.success("Bulk search complete",{description:`${f} item${f===1?"":"s"} searched${u?` (${u} skipped)`:""}. Found ${b} match${b===1?"":"es"}.`}),R(),g.refetch()},onError:s=>{T.error("Bulk search failed",{description:s.message})}})),$=a===0||a>B||N.isPending,M=s=>{if(a===0)return;if(a>B){T.error(`Bulk search supports up to ${B} items at a time.`);return}const f=Array.from(l.values()).map(b=>b.name);N.mutate({names:f,force:s})},G=s=>s?Ce(s):"Never";return e.jsxs(xe,{children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Library"}),e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Showing ",w,"-",j," of ",o.total," items"]})]}),e.jsxs("div",{className:"bg-muted/30 text-muted-foreground flex flex-col gap-2 rounded-lg border px-3 py-2 text-sm lg:flex-row lg:items-center lg:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:a>0?`${a} item${a===1?"":"s"} selected`:"No items selected"}),e.jsxs(fe,{children:[e.jsx(be,{asChild:!0,children:e.jsxs(E,{variant:"outline",size:"sm",disabled:$,onClick:()=>M(!1),children:[N.isPending?e.jsx(Ne,{className:"mr-2 size-4 animate-spin"}):e.jsx(le,{className:"mr-2 size-4"}),"Search",e.jsx(ye,{className:"ml-1 size-4"})]})}),e.jsxs(ge,{align:"start",className:"w-40",children:[e.jsx(H,{disabled:N.isPending||a===0,onSelect:s=>{s.preventDefault(),M(!1)},children:"Search"}),e.jsx(H,{disabled:N.isPending||a===0,onSelect:s=>{s.preventDefault(),M(!0)},children:"Force search"})]})]})]}),e.jsx("div",{className:"bg-border hidden h-4 w-px lg:block"}),e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsxs("span",{children:["Page ",Math.min(n+1,k)," of ",k]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs(E,{variant:"outline",size:"icon",className:"hidden h-7 w-7 p-0 lg:flex",onClick:()=>c(0),disabled:!C||h,children:[e.jsx("span",{className:"sr-only",children:"Go to first page"}),e.jsx(Ee,{className:"size-4"})]}),e.jsxs(E,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>c(s=>Math.max(0,s-1)),disabled:!C||h,children:[e.jsx("span",{className:"sr-only",children:"Go to previous page"}),e.jsx(we,{className:"size-4"})]}),e.jsxs(E,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>c(s=>s+1),disabled:!x||h,children:[e.jsx("span",{className:"sr-only",children:"Go to next page"}),e.jsx(ke,{className:"size-4"})]}),e.jsxs(E,{variant:"outline",size:"icon",className:"hidden h-7 w-7 p-0 lg:flex",onClick:()=>c(k-1),disabled:!x||h,children:[e.jsx("span",{className:"sr-only",children:"Go to last page"}),e.jsx(Ie,{className:"size-4"})]})]})]}),a>B&&e.jsxs("span",{className:"text-destructive text-xs",children:["Bulk search is limited to ",B," items at a time."]})]})]}),e.jsx("div",{className:"overflow-x-auto rounded-lg border",children:e.jsxs(ue,{children:[e.jsx(me,{className:"bg-muted sticky top-0 z-10",children:e.jsxs(A,{className:"border-b",children:[e.jsx(z,{className:"w-10",children:e.jsx(K,{"aria-label":"Select all items on this page",checked:v?!0:P?"indeterminate":!1,onCheckedChange:s=>p(U(s))})}),e.jsx(z,{children:"Name"}),e.jsx(z,{children:"Indexers Searched"}),e.jsx(z,{children:"First Searched"}),e.jsx(z,{children:"Last Searched"})]})}),e.jsx(pe,{children:i.length===0?e.jsx(A,{children:e.jsx(_,{colSpan:5,className:"py-10 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"No items indexed yet."}),e.jsx("span",{className:"text-muted-foreground text-xs",children:"Add a torrent client to start building your library."}),e.jsx(E,{asChild:!0,size:"sm",children:e.jsx(he,{to:"/settings/clients",children:"Add torrent client"})})]})})}):i.map(s=>{const f=l.has(s.id);return e.jsxs(A,{"data-state":f?"selected":void 0,className:f?"bg-muted/60":void 0,children:[e.jsx(_,{children:e.jsx(K,{"aria-label":`Select ${s.name}`,checked:f,onCheckedChange:b=>I(s,U(b))})}),e.jsx(_,{className:"font-medium",children:s.name}),e.jsx(_,{children:s.indexerCount}),e.jsx(_,{children:G(s.firstSearchedAt)}),e.jsx(_,{children:G(s.lastSearchedAt)})]},s.id)})})]})})]})}export{Oe as component};
|
|
1
|
+
import{c as D,r as m,j as e,b as te,P as ae,d as q,e as ne,f as X,g as O,h as re,i as oe,u as ce,k as ie,l as de,t as T,B as E,m as le,n as he}from"./index-Ncy0-Qo7.js";import{T as ue,a as me,b as A,c as z,d as pe,e as _}from"./table-qEFWauuw.js";import{P as xe,D as fe,a as be,b as ge,c as H,C as ke}from"./Page-B68mlTwU.js";import{f as Ce}from"./time-BM9K_Fbp.js";import{u as je}from"./index-BBzHsn7u.js";import{C as ve}from"./check-NQsw6yBl.js";import{L as Ne}from"./loader-circle-Bz67bJa3.js";import{C as ye}from"./chevron-down-8PGvFYxV.js";const Se=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],we=D("ChevronLeft",Se);const Pe=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Ee=D("ChevronsLeft",Pe);const _e=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Ie=D("ChevronsRight",_e);var L="Checkbox",[Re]=te(L),[Me,F]=Re(L);function ze(t){const{__scopeCheckbox:n,checked:c,children:l,defaultChecked:d,disabled:r,form:g,name:o,onCheckedChange:h,required:k,value:C="on",internal_do_not_use_render:x}=t,[i,w]=ne({prop:c,defaultProp:d??!1,onChange:h,caller:L}),[j,v]=m.useState(null),[P,a]=m.useState(null),p=m.useRef(!1),I=j?!!g||!!j.closest("form"):!0,R={checked:i,disabled:r,setChecked:w,control:j,setControl:v,name:o,form:g,value:C,hasConsumerStoppedPropagationRef:p,required:k,defaultChecked:S(d)?!1:d,isFormControl:I,bubbleInput:P,setBubbleInput:a};return e.jsx(Me,{scope:n,...R,children:Be(x)?x(R):l})}var Q="CheckboxTrigger",Z=m.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:c,...l},d)=>{const{control:r,value:g,disabled:o,checked:h,required:k,setControl:C,setChecked:x,hasConsumerStoppedPropagationRef:i,isFormControl:w,bubbleInput:j}=F(Q,t),v=X(d,C),P=m.useRef(h);return m.useEffect(()=>{const a=r?.form;if(a){const p=()=>x(P.current);return a.addEventListener("reset",p),()=>a.removeEventListener("reset",p)}},[r,x]),e.jsx(q.button,{type:"button",role:"checkbox","aria-checked":S(h)?"mixed":h,"aria-required":k,"data-state":se(h),"data-disabled":o?"":void 0,disabled:o,value:g,...l,ref:v,onKeyDown:O(n,a=>{a.key==="Enter"&&a.preventDefault()}),onClick:O(c,a=>{x(p=>S(p)?!0:!p),j&&w&&(i.current=a.isPropagationStopped(),i.current||a.stopPropagation())})})});Z.displayName=Q;var J=m.forwardRef((t,n)=>{const{__scopeCheckbox:c,name:l,checked:d,defaultChecked:r,required:g,disabled:o,value:h,onCheckedChange:k,form:C,...x}=t;return e.jsx(ze,{__scopeCheckbox:c,checked:d,defaultChecked:r,disabled:o,required:g,onCheckedChange:k,name:l,form:C,value:h,internal_do_not_use_render:({isFormControl:i})=>e.jsxs(e.Fragment,{children:[e.jsx(Z,{...x,ref:n,__scopeCheckbox:c}),i&&e.jsx(ee,{__scopeCheckbox:c})]})})});J.displayName=L;var V="CheckboxIndicator",W=m.forwardRef((t,n)=>{const{__scopeCheckbox:c,forceMount:l,...d}=t,r=F(V,c);return e.jsx(ae,{present:l||S(r.checked)||r.checked===!0,children:e.jsx(q.span,{"data-state":se(r.checked),"data-disabled":r.disabled?"":void 0,...d,ref:n,style:{pointerEvents:"none",...t.style}})})});W.displayName=V;var Y="CheckboxBubbleInput",ee=m.forwardRef(({__scopeCheckbox:t,...n},c)=>{const{control:l,hasConsumerStoppedPropagationRef:d,checked:r,defaultChecked:g,required:o,disabled:h,name:k,value:C,form:x,bubbleInput:i,setBubbleInput:w}=F(Y,t),j=X(c,w),v=je(r),P=re(l);m.useEffect(()=>{const p=i;if(!p)return;const I=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(I,"checked").set,$=!d.current;if(v!==r&&N){const M=new Event("click",{bubbles:$});p.indeterminate=S(r),N.call(p,S(r)?!1:r),p.dispatchEvent(M)}},[i,v,r,d]);const a=m.useRef(S(r)?!1:r);return e.jsx(q.input,{type:"checkbox","aria-hidden":!0,defaultChecked:g??a.current,required:o,disabled:h,name:k,value:C,form:x,...n,tabIndex:-1,ref:j,style:{...n.style,...P,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ee.displayName=Y;function Be(t){return typeof t=="function"}function S(t){return t==="indeterminate"}function se(t){return S(t)?"indeterminate":t?"checked":"unchecked"}function K({className:t,...n}){return e.jsx(J,{"data-slot":"checkbox",className:oe("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:e.jsx(W,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:e.jsx(ve,{className:"size-3.5"})})})}function U(t){return t===!0}const y=25,B=20;function Oe(){const t=ce(),[n,c]=m.useState(0),[l,d]=m.useState(()=>new Map),r=m.useMemo(()=>({limit:y,offset:n*y}),[n]),g=ie(t.searchees.list.queryOptions(r)),{data:o,isFetching:h}=g;m.useEffect(()=>{if(n*y<o.total)return;if(o.total===0){c(0);return}const s=Math.max(0,Math.ceil(o.total/y)-1);s!==n&&c(s)},[o.total,n]);const k=Math.max(1,Math.ceil(o.total/y)),C=n>0,x=(n+1)*y<o.total,i=o.items,w=o.total===0?0:n*y+1,j=o.total===0?0:n*y+i.length,v=i.length>0&&i.every(s=>l.has(s.id)),P=i.some(s=>l.has(s.id)),a=l.size,p=s=>{d(f=>{const b=new Map(f);return s?i.forEach(u=>b.set(u.id,{id:u.id,name:u.name})):i.forEach(u=>b.delete(u.id)),b})},I=(s,f)=>{d(b=>{const u=new Map(b);return f?u.set(s.id,s):u.delete(s.id),u})},R=()=>d(new Map),N=de(t.searchees.bulkSearch.mutationOptions({onSuccess:s=>{const{attempted:f,totalFound:b,skipped:u}=s;f===0?T.info("No eligible items to search",{description:u>0?`${u} item${u===1?"":"s"} were skipped by filters.`:void 0}):T.success("Bulk search complete",{description:`${f} item${f===1?"":"s"} searched${u?` (${u} skipped)`:""}. Found ${b} match${b===1?"":"es"}.`}),R(),g.refetch()},onError:s=>{T.error("Bulk search failed",{description:s.message})}})),$=a===0||a>B||N.isPending,M=s=>{if(a===0)return;if(a>B){T.error(`Bulk search supports up to ${B} items at a time.`);return}const f=Array.from(l.values()).map(b=>b.name);N.mutate({names:f,force:s})},G=s=>s?Ce(s):"Never";return e.jsxs(xe,{children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Library"}),e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Showing ",w,"-",j," of ",o.total," items"]})]}),e.jsxs("div",{className:"bg-muted/30 text-muted-foreground flex flex-col gap-2 rounded-lg border px-3 py-2 text-sm lg:flex-row lg:items-center lg:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:a>0?`${a} item${a===1?"":"s"} selected`:"No items selected"}),e.jsxs(fe,{children:[e.jsx(be,{asChild:!0,children:e.jsxs(E,{variant:"outline",size:"sm",disabled:$,onClick:()=>M(!1),children:[N.isPending?e.jsx(Ne,{className:"mr-2 size-4 animate-spin"}):e.jsx(le,{className:"mr-2 size-4"}),"Search",e.jsx(ye,{className:"ml-1 size-4"})]})}),e.jsxs(ge,{align:"start",className:"w-40",children:[e.jsx(H,{disabled:N.isPending||a===0,onSelect:s=>{s.preventDefault(),M(!1)},children:"Search"}),e.jsx(H,{disabled:N.isPending||a===0,onSelect:s=>{s.preventDefault(),M(!0)},children:"Force search"})]})]})]}),e.jsx("div",{className:"bg-border hidden h-4 w-px lg:block"}),e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[e.jsxs("span",{children:["Page ",Math.min(n+1,k)," of ",k]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs(E,{variant:"outline",size:"icon",className:"hidden h-7 w-7 p-0 lg:flex",onClick:()=>c(0),disabled:!C||h,children:[e.jsx("span",{className:"sr-only",children:"Go to first page"}),e.jsx(Ee,{className:"size-4"})]}),e.jsxs(E,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>c(s=>Math.max(0,s-1)),disabled:!C||h,children:[e.jsx("span",{className:"sr-only",children:"Go to previous page"}),e.jsx(we,{className:"size-4"})]}),e.jsxs(E,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>c(s=>s+1),disabled:!x||h,children:[e.jsx("span",{className:"sr-only",children:"Go to next page"}),e.jsx(ke,{className:"size-4"})]}),e.jsxs(E,{variant:"outline",size:"icon",className:"hidden h-7 w-7 p-0 lg:flex",onClick:()=>c(k-1),disabled:!x||h,children:[e.jsx("span",{className:"sr-only",children:"Go to last page"}),e.jsx(Ie,{className:"size-4"})]})]})]}),a>B&&e.jsxs("span",{className:"text-destructive text-xs",children:["Bulk search is limited to ",B," items at a time."]})]})]}),e.jsx("div",{className:"overflow-x-auto rounded-lg border",children:e.jsxs(ue,{children:[e.jsx(me,{className:"bg-muted sticky top-0 z-10",children:e.jsxs(A,{className:"border-b",children:[e.jsx(z,{className:"w-10",children:e.jsx(K,{"aria-label":"Select all items on this page",checked:v?!0:P?"indeterminate":!1,onCheckedChange:s=>p(U(s))})}),e.jsx(z,{children:"Name"}),e.jsx(z,{children:"Indexers Searched"}),e.jsx(z,{children:"First Searched"}),e.jsx(z,{children:"Last Searched"})]})}),e.jsx(pe,{children:i.length===0?e.jsx(A,{children:e.jsx(_,{colSpan:5,className:"py-10 text-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"No items indexed yet."}),e.jsx("span",{className:"text-muted-foreground text-xs",children:"Add a torrent client to start building your library."}),e.jsx(E,{asChild:!0,size:"sm",children:e.jsx(he,{to:"/settings/clients",children:"Add torrent client"})})]})})}):i.map(s=>{const f=l.has(s.id);return e.jsxs(A,{"data-state":f?"selected":void 0,className:f?"bg-muted/60":void 0,children:[e.jsx(_,{children:e.jsx(K,{"aria-label":`Select ${s.name}`,checked:f,onCheckedChange:b=>I(s,U(b))})}),e.jsx(_,{className:"font-medium",children:s.name}),e.jsx(_,{children:s.indexerCount}),e.jsx(_,{children:G(s.firstSearchedAt)}),e.jsx(_,{children:G(s.lastSearchedAt)})]},s.id)})})]})})]})}export{Oe as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./index-
|
|
1
|
+
import{c as e}from"./index-Ncy0-Qo7.js";const o=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a=e("LoaderCircle",o);export{a as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as a,u as S,a as L,j as s,S as E,L as T}from"./index-Ncy0-Qo7.js";import{B as i}from"./badge-C5YCxEzP.js";import{S as R}from"./switch-BeMrf8sh.js";import{T as F,a as B,b as p,c,d as C,e as d}from"./table-qEFWauuw.js";import{f as k}from"./time-BM9K_Fbp.js";import{P as H}from"./Page-B68mlTwU.js";import"./index-BBzHsn7u.js";function M(){const[n,w]=a.useState([]),[b,g]=a.useState(!0),[o,v]=a.useState(new Set(["error","warn","info","verbose","debug"])),[l,j]=a.useState(()=>typeof window>"u"?!1:window.localStorage.getItem("logs:newest-first")==="true"),[m,f]=a.useState(new Set),N=S(),y=a.useRef(null);L(N.logs.subscribe.subscriptionOptions({limit:100},{enabled:!0,onData:e=>{w((t=[])=>[...t,e].slice(-500))},onError:e=>{console.error("Log subscription error:",e)}})),a.useEffect(()=>{const e=()=>{const t=window.innerHeight+window.scrollY,r=document.documentElement.scrollHeight,h=t>=r&&window.scrollY>0;g(h)};return window.addEventListener("scroll",e),e(),()=>window.removeEventListener("scroll",e)},[]),a.useLayoutEffect(()=>{b&&n.length>0&&window.scrollTo({top:document.documentElement.scrollHeight,behavior:"instant"})},[n,b]),a.useEffect(()=>{window.localStorage.setItem("logs:newest-first",String(l))},[l]);const u=a.useMemo(()=>{const e=new Set;return n.forEach(t=>{t.label&&e.add(t.label)}),Array.from(e).sort()},[n]);a.useEffect(()=>{f(e=>{const t=new Set(e);return u.forEach(r=>t.add(r)),t})},[u]);const x=a.useMemo(()=>{const e=n.filter(t=>{const r=o.has(t.level),h=!t.label||m.has(t.label);return r&&h});return l&&e.reverse(),e},[n,l,o,m]);return s.jsxs("div",{className:"w-full space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-stretch justify-between gap-4",children:[s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:["error","warn","info","verbose","debug"].map(e=>s.jsx(i,{variant:o.has(e)?"default":"outline",className:`hover:bg-muted cursor-pointer select-none ${e==="error"?o.has(e)?"bg-red-500 hover:bg-red-600":"border-red-200 text-red-500":e==="warn"?o.has(e)?"bg-yellow-500 hover:bg-yellow-600":"border-yellow-200 text-yellow-500":e==="info"?o.has(e)?"bg-blue-500 hover:bg-blue-600":"border-blue-200 text-blue-500":e==="verbose"?o.has(e)?"bg-gray-500 hover:bg-gray-600":"border-gray-200 text-gray-500":e==="debug"?o.has(e)?"bg-purple-500 hover:bg-purple-600":"border-purple-200 text-purple-500":""}`,onClick:()=>{v(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},children:e},e))}),s.jsx("div",{children:s.jsx(E,{orientation:"vertical",className:"h-6"})}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:u.map(e=>s.jsx(i,{variant:m.has(e)?"default":"outline",className:"hover:bg-muted cursor-pointer font-mono text-xs select-none",onClick:()=>{f(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},children:e},e))}),s.jsxs(T,{className:"ml-auto",children:[s.jsx("span",{className:"text-sm font-medium",children:"Show newest first"}),s.jsx(R,{checked:l,onCheckedChange:j})]})]}),x.length>0?s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(F,{ref:y,children:[s.jsx(B,{className:"bg-muted sticky top-0 z-10",children:s.jsxs(p,{className:"border-b",children:[s.jsx(c,{className:"w-32",children:"Time"}),s.jsx(c,{className:"w-24",children:"Level"}),s.jsx(c,{className:"w-32",children:"Label"}),s.jsx(c,{children:"Message"})]})}),s.jsx(C,{children:x.map((e,t)=>s.jsxs(p,{className:"hover:bg-muted/50 h-8",children:[s.jsx(d,{className:"font-mono text-xs",title:new Date(e.timestamp).toLocaleString(),children:k(e.timestamp)}),s.jsx(d,{className:"py-1",children:s.jsx(i,{variant:e.level==="error"?"destructive":e.level==="warn"?"secondary":e.level==="info"?"default":e.level==="debug"?"outline":"secondary",className:e.level==="warn"?"bg-yellow-100 text-yellow-800 hover:bg-yellow-100":e.level==="info"?"bg-blue-500 text-white hover:bg-blue-600":e.level==="verbose"?"bg-gray-500 text-white hover:bg-gray-600":e.level==="debug"?"bg-purple-500 text-white hover:bg-purple-600":"",children:e.level})}),s.jsx(d,{className:"py-1 font-medium",children:e.label&&s.jsx(i,{variant:"outline",className:"py-1 font-mono text-xs",children:e.label})}),s.jsx(d,{className:"py-1 font-mono text-xs",children:s.jsx("div",{className:"whitespace-pre-wrap",title:e.message,children:e.message})})]},`${e.timestamp}-${t}`))})]})}):s.jsxs("div",{className:"text-muted-foreground items-center justify-center py-16",children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx("div",{className:"h-2 w-2 animate-pulse rounded-full bg-green-500"}),s.jsx("span",{className:"text-sm font-medium",children:n.length===0?"Waiting for logs...":"No logs match current filters"})]}),n.length===0&&s.jsx("p",{className:"text-xs",children:"Real-time streaming from server logs"})]})]})}function q(){return s.jsx(H,{breadcrumbs:["Diagnostics","Logs"],children:s.jsx(M,{})})}export{q as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o,j as e}from"./index-
|
|
1
|
+
import{u as o,j as e}from"./index-Ncy0-Qo7.js";import{u as m,f as u,p,a as x,b as h,s as l,c as i,F as f,M as j}from"./use-settings-form-submit-CXwtE1sI.js";import{u as F}from"./useQuery-DD10sbzn.js";import{P as S}from"./Page-B68mlTwU.js";function v(){const t=o(),{isFieldRequired:r}=m(l),{data:n}=F(t.settings.get.queryOptions(void 0,{select:a=>{const c=u(a.config);return p(l,c,{includeUndefined:!0})}})),d=x(),s=h({...i,defaultValues:n??i.defaultValues,onSubmit:d,validators:{onSubmit:l}});return e.jsx(S,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Search & RSS Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage search and RSS options."})]}),e.jsx(f,{isFieldRequired:r,children:e.jsx("form",{className:"form flex flex-col gap-4",onSubmit:a=>{a.preventDefault(),a.stopPropagation(),s.handleSubmit()},noValidate:!0,children:e.jsxs("div",{className:"flex flex-wrap gap-6",children:[e.jsxs("fieldset",{className:"form-fieldset w-full gap-6",children:[e.jsx(s.AppField,{name:"delay",children:a=>e.jsx(a.TextField,{label:"Delay",type:"number"})}),e.jsx(s.AppField,{name:"matchMode",children:a=>e.jsx(a.SelectField,{label:"Match Mode",options:j})}),e.jsx(s.AppField,{name:"rssCadence",children:a=>e.jsx(a.DurationField,{label:"RSS Cadence"})}),e.jsx(s.AppField,{name:"searchCadence",children:a=>e.jsx(a.DurationField,{label:"Search Cadence"})}),e.jsx(s.AppField,{name:"searchTimeout",children:a=>e.jsx(a.DurationField,{label:"Search Timeout"})}),e.jsx(s.AppField,{name:"searchLimit",children:a=>e.jsx(a.TextField,{label:"Search Limit",type:"number"})}),e.jsx(s.AppField,{name:"excludeOlder",children:a=>e.jsx(a.DurationField,{label:"Exclude Older"})}),e.jsx(s.AppField,{name:"excludeRecentSearch",children:a=>e.jsx(a.DurationField,{label:"Exclude Recent Search"})})]}),e.jsx(s.AppForm,{children:e.jsx(s.SubmitButton,{})})]})})})]})})}export{v as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as ot,r as n,j as a,Z as nt,a2 as Ee,e as Te,a3 as rt,b as st,a0 as Ie,f as L,a4 as at,d as j,g as P,ag as $,a5 as lt,ah as _e,ai as it,a1 as ct,a6 as dt,a8 as ut,a9 as pt,aa as ft,ab as mt,ac as ht,ad as gt,i as te}from"./index-Bi48hI2z.js";import{u as vt,f as xt}from"./Page-C3rteCZt.js";import{u as St}from"./index-C2cH1Gst.js";import{C as Ne}from"./chevron-down-CRy8M0kJ.js";import{C as wt}from"./check-Bu3ldi63.js";const Ct=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],yt=ot("ChevronUp",Ct);function Pe(t,[o,e]){return Math.min(e,Math.max(o,t))}function It(t){const o=bt(t),e=n.forwardRef((s,r)=>{const{children:d,...l}=s,i=n.Children.toArray(d),c=i.find(Pt);if(c){const p=c.props.children,g=i.map(x=>x===c?n.Children.count(p)>1?n.Children.only(null):n.isValidElement(p)?p.props.children:null:x);return a.jsx(o,{...l,ref:r,children:n.isValidElement(p)?n.cloneElement(p,void 0,g):null})}return a.jsx(o,{...l,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function bt(t){const o=n.forwardRef((e,s)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const l=_t(r),i=Et(d,r.props);return r.type!==n.Fragment&&(i.ref=s?nt(s,l):l),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var Tt=Symbol("radix.slottable");function Pt(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Tt}function Et(t,o){const e={...o};for(const s in o){const r=t[s],d=o[s];/^on[A-Z]/.test(s)?r&&d?e[s]=(...i)=>{const c=d(...i);return r(...i),c}:r&&(e[s]=r):s==="style"?e[s]={...r,...d}:s==="className"&&(e[s]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function _t(t){let o=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=Object.getOwnPropertyDescriptor(t,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var Nt=[" ","Enter","ArrowUp","ArrowDown"],Rt=[" ","Enter"],J="Select",[ce,de,jt]=xt(J),[oe]=st(J,[jt,Ee]),ue=Ee(),[Mt,G]=oe(J),[At,Ot]=oe(J),Re=t=>{const{__scopeSelect:o,children:e,open:s,defaultOpen:r,onOpenChange:d,value:l,defaultValue:i,onValueChange:c,dir:p,name:g,autoComplete:x,disabled:E,required:b,form:y}=t,u=ue(o),[h,S]=n.useState(null),[m,v]=n.useState(null),[F,M]=n.useState(!1),ne=vt(p),[_,O]=Te({prop:s,defaultProp:r??!1,onChange:d,caller:J}),[U,Z]=Te({prop:l,defaultProp:i,onChange:c,caller:J}),k=n.useRef(null),V=h?y||!!h.closest("form"):!0,[z,B]=n.useState(new Set),H=Array.from(z).map(N=>N.props.value).join(";");return a.jsx(rt,{...u,children:a.jsxs(Mt,{required:b,scope:o,trigger:h,onTriggerChange:S,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:Z,open:_,onOpenChange:O,dir:ne,triggerPointerDownPosRef:k,disabled:E,children:[a.jsx(ce.Provider,{scope:o,children:a.jsx(At,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(N=>{B(D=>new Set(D).add(N))},[]),onNativeOptionRemove:n.useCallback(N=>{B(D=>{const W=new Set(D);return W.delete(N),W})},[]),children:e})}),V?a.jsxs(Je,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:x,value:U,onChange:N=>Z(N.target.value),disabled:E,form:y,children:[U===void 0?a.jsx("option",{value:""}):null,Array.from(z)]},H):null]})})};Re.displayName=J;var je="SelectTrigger",Me=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...r}=t,d=ue(e),l=G(je,e),i=l.disabled||s,c=L(o,l.onTriggerChange),p=de(e),g=n.useRef("touch"),[x,E,b]=et(u=>{const h=p().filter(v=>!v.disabled),S=h.find(v=>v.value===l.value),m=tt(h,u,S);m!==void 0&&l.onValueChange(m.value)}),y=u=>{i||(l.onOpenChange(!0),b()),u&&(l.triggerPointerDownPosRef.current={x:Math.round(u.pageX),y:Math.round(u.pageY)})};return a.jsx(at,{asChild:!0,...d,children:a.jsx(j.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Qe(l.value)?"":void 0,...r,ref:c,onClick:P(r.onClick,u=>{u.currentTarget.focus(),g.current!=="mouse"&&y(u)}),onPointerDown:P(r.onPointerDown,u=>{g.current=u.pointerType;const h=u.target;h.hasPointerCapture(u.pointerId)&&h.releasePointerCapture(u.pointerId),u.button===0&&u.ctrlKey===!1&&u.pointerType==="mouse"&&(y(u),u.preventDefault())}),onKeyDown:P(r.onKeyDown,u=>{const h=x.current!=="";!(u.ctrlKey||u.altKey||u.metaKey)&&u.key.length===1&&E(u.key),!(h&&u.key===" ")&&Nt.includes(u.key)&&(y(),u.preventDefault())})})})});Me.displayName=je;var Ae="SelectValue",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,children:d,placeholder:l="",...i}=t,c=G(Ae,e),{onValueNodeHasChildrenChange:p}=c,g=d!==void 0,x=L(o,c.onValueNodeChange);return $(()=>{p(g)},[p,g]),a.jsx(j.span,{...i,ref:x,style:{pointerEvents:"none"},children:Qe(c.value)?a.jsx(a.Fragment,{children:l}):d})});Oe.displayName=Ae;var Dt="SelectIcon",De=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...r}=t;return a.jsx(j.span,{"aria-hidden":!0,...r,ref:o,children:s||"▼"})});De.displayName=Dt;var Lt="SelectPortal",Le=t=>a.jsx(lt,{asChild:!0,...t});Le.displayName=Lt;var Q="SelectContent",ke=n.forwardRef((t,o)=>{const e=G(Q,t.__scopeSelect),[s,r]=n.useState();if($(()=>{r(new DocumentFragment)},[]),!e.open){const d=s;return d?_e.createPortal(a.jsx(Ve,{scope:t.__scopeSelect,children:a.jsx(ce.Slot,{scope:t.__scopeSelect,children:a.jsx("div",{children:t.children})})}),d):null}return a.jsx(Be,{...t,ref:o})});ke.displayName=Q;var A=10,[Ve,Y]=oe(Q),kt="SelectContentImpl",Vt=It("SelectContent.RemoveScroll"),Be=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:l,side:i,sideOffset:c,align:p,alignOffset:g,arrowPadding:x,collisionBoundary:E,collisionPadding:b,sticky:y,hideWhenDetached:u,avoidCollisions:h,...S}=t,m=G(Q,e),[v,F]=n.useState(null),[M,ne]=n.useState(null),_=L(o,f=>F(f)),[O,U]=n.useState(null),[Z,k]=n.useState(null),V=de(e),[z,B]=n.useState(!1),H=n.useRef(!1);n.useEffect(()=>{if(v)return dt(v)},[v]),ut();const N=n.useCallback(f=>{const[I,...R]=V().map(T=>T.ref.current),[w]=R.slice(-1),C=document.activeElement;for(const T of f)if(T===C||(T?.scrollIntoView({block:"nearest"}),T===I&&M&&(M.scrollTop=0),T===w&&M&&(M.scrollTop=M.scrollHeight),T?.focus(),document.activeElement!==C))return},[V,M]),D=n.useCallback(()=>N([O,v]),[N,O,v]);n.useEffect(()=>{z&&D()},[z,D]);const{onOpenChange:W,triggerPointerDownPosRef:K}=m;n.useEffect(()=>{if(v){let f={x:0,y:0};const I=w=>{f={x:Math.abs(Math.round(w.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(w.pageY)-(K.current?.y??0))}},R=w=>{f.x<=10&&f.y<=10?w.preventDefault():v.contains(w.target)||W(!1),document.removeEventListener("pointermove",I),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",R,{capture:!0})}}},[v,W,K]),n.useEffect(()=>{const f=()=>W(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[W]);const[pe,ae]=et(f=>{const I=V().filter(C=>!C.disabled),R=I.find(C=>C.ref.current===document.activeElement),w=tt(I,f,R);w&&setTimeout(()=>w.ref.current.focus())}),fe=n.useCallback((f,I,R)=>{const w=!H.current&&!R;(m.value!==void 0&&m.value===I||w)&&(U(f),w&&(H.current=!0))},[m.value]),me=n.useCallback(()=>v?.focus(),[v]),ee=n.useCallback((f,I,R)=>{const w=!H.current&&!R;(m.value!==void 0&&m.value===I||w)&&k(f)},[m.value]),le=s==="popper"?xe:He,re=le===xe?{side:i,sideOffset:c,align:p,alignOffset:g,arrowPadding:x,collisionBoundary:E,collisionPadding:b,sticky:y,hideWhenDetached:u,avoidCollisions:h}:{};return a.jsx(Ve,{scope:e,content:v,viewport:M,onViewportChange:ne,itemRefCallback:fe,selectedItem:O,onItemLeave:me,itemTextRefCallback:ee,focusSelectedItem:D,selectedItemText:Z,position:s,isPositioned:z,searchRef:pe,children:a.jsx(pt,{as:Vt,allowPinchZoom:!0,children:a.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:a.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:a.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...S,...re,onPlaced:()=>B(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:P(S.onKeyDown,f=>{const I=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!I&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let w=V().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(f.key)&&(w=w.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const C=f.target,T=w.indexOf(C);w=w.slice(T+1)}setTimeout(()=>N(w)),f.preventDefault()}})})})})})})});Be.displayName=kt;var Bt="SelectItemAlignedPosition",He=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:s,...r}=t,d=G(Q,e),l=Y(Q,e),[i,c]=n.useState(null),[p,g]=n.useState(null),x=L(o,_=>g(_)),E=de(e),b=n.useRef(!1),y=n.useRef(!0),{viewport:u,selectedItem:h,selectedItemText:S,focusSelectedItem:m}=l,v=n.useCallback(()=>{if(d.trigger&&d.valueNode&&i&&p&&u&&h&&S){const _=d.trigger.getBoundingClientRect(),O=p.getBoundingClientRect(),U=d.valueNode.getBoundingClientRect(),Z=S.getBoundingClientRect();if(d.dir!=="rtl"){const C=Z.left-O.left,T=U.left-C,q=_.left-T,X=_.width+q,he=Math.max(X,O.width),ge=window.innerWidth-A,ve=Pe(T,[A,Math.max(A,ge-he)]);i.style.minWidth=X+"px",i.style.left=ve+"px"}else{const C=O.right-Z.right,T=window.innerWidth-U.right-C,q=window.innerWidth-_.right-T,X=_.width+q,he=Math.max(X,O.width),ge=window.innerWidth-A,ve=Pe(T,[A,Math.max(A,ge-he)]);i.style.minWidth=X+"px",i.style.right=ve+"px"}const k=E(),V=window.innerHeight-A*2,z=u.scrollHeight,B=window.getComputedStyle(p),H=parseInt(B.borderTopWidth,10),N=parseInt(B.paddingTop,10),D=parseInt(B.borderBottomWidth,10),W=parseInt(B.paddingBottom,10),K=H+N+z+W+D,pe=Math.min(h.offsetHeight*5,K),ae=window.getComputedStyle(u),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),ee=_.top+_.height/2-A,le=V-ee,re=h.offsetHeight/2,f=h.offsetTop+re,I=H+N+f,R=K-I;if(I<=ee){const C=k.length>0&&h===k[k.length-1].ref.current;i.style.bottom="0px";const T=p.clientHeight-u.offsetTop-u.offsetHeight,q=Math.max(le,re+(C?me:0)+T+D),X=I+q;i.style.height=X+"px"}else{const C=k.length>0&&h===k[0].ref.current;i.style.top="0px";const q=Math.max(ee,H+u.offsetTop+(C?fe:0)+re)+R;i.style.height=q+"px",u.scrollTop=I-ee+u.offsetTop}i.style.margin=`${A}px 0`,i.style.minHeight=pe+"px",i.style.maxHeight=V+"px",s?.(),requestAnimationFrame(()=>b.current=!0)}},[E,d.trigger,d.valueNode,i,p,u,h,S,d.dir,s]);$(()=>v(),[v]);const[F,M]=n.useState();$(()=>{p&&M(window.getComputedStyle(p).zIndex)},[p]);const ne=n.useCallback(_=>{_&&y.current===!0&&(v(),m?.(),y.current=!1)},[v,m]);return a.jsx(Wt,{scope:e,contentWrapper:i,shouldExpandOnScrollRef:b,onScrollButtonChange:ne,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:a.jsx(j.div,{...r,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});He.displayName=Bt;var Ht="SelectPopperPosition",xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:s="start",collisionPadding:r=A,...d}=t,l=ue(e);return a.jsx(ht,{...l,...d,ref:o,align:s,collisionPadding:r,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xe.displayName=Ht;var[Wt,be]=oe(Q,{}),Se="SelectViewport",We=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:s,...r}=t,d=Y(Se,e),l=be(Se,e),i=L(o,d.onViewportChange),c=n.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),a.jsx(ce.Slot,{scope:e,children:a.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:P(r.onScroll,p=>{const g=p.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:E}=l;if(E?.current&&x){const b=Math.abs(c.current-g.scrollTop);if(b>0){const y=window.innerHeight-A*2,u=parseFloat(x.style.minHeight),h=parseFloat(x.style.height),S=Math.max(u,h);if(S<y){const m=S+b,v=Math.min(y,m),F=m-v;x.style.height=v+"px",x.style.bottom==="0px"&&(g.scrollTop=F>0?F:0,x.style.justifyContent="flex-end")}}}c.current=g.scrollTop})})})]})});We.displayName=Se;var Fe="SelectGroup",[Ft,Ut]=oe(Fe),zt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Ie();return a.jsx(Ft,{scope:e,id:r,children:a.jsx(j.div,{role:"group","aria-labelledby":r,...s,ref:o})})});zt.displayName=Fe;var Ue="SelectLabel",Kt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Ut(Ue,e);return a.jsx(j.div,{id:r.id,...s,ref:o})});Kt.displayName=Ue;var ie="SelectItem",[$t,ze]=oe(ie),Ke=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:s,disabled:r=!1,textValue:d,...l}=t,i=G(ie,e),c=Y(ie,e),p=i.value===s,[g,x]=n.useState(d??""),[E,b]=n.useState(!1),y=L(o,m=>c.itemRefCallback?.(m,s,r)),u=Ie(),h=n.useRef("touch"),S=()=>{r||(i.onValueChange(s),i.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx($t,{scope:e,value:s,disabled:r,textId:u,isSelected:p,onItemTextChange:n.useCallback(m=>{x(v=>v||(m?.textContent??"").trim())},[]),children:a.jsx(ce.ItemSlot,{scope:e,value:s,disabled:r,textValue:g,children:a.jsx(j.div,{role:"option","aria-labelledby":u,"data-highlighted":E?"":void 0,"aria-selected":p&&E,"data-state":p?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...l,ref:y,onFocus:P(l.onFocus,()=>b(!0)),onBlur:P(l.onBlur,()=>b(!1)),onClick:P(l.onClick,()=>{h.current!=="mouse"&&S()}),onPointerUp:P(l.onPointerUp,()=>{h.current==="mouse"&&S()}),onPointerDown:P(l.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:P(l.onPointerMove,m=>{h.current=m.pointerType,r?c.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(l.onPointerLeave,m=>{m.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(l.onKeyDown,m=>{c.searchRef?.current!==""&&m.key===" "||(Rt.includes(m.key)&&S(),m.key===" "&&m.preventDefault())})})})})});Ke.displayName=ie;var se="SelectItemText",$e=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,...d}=t,l=G(se,e),i=Y(se,e),c=ze(se,e),p=Ot(se,e),[g,x]=n.useState(null),E=L(o,S=>x(S),c.onItemTextChange,S=>i.itemTextRefCallback?.(S,c.value,c.disabled)),b=g?.textContent,y=n.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:b},c.value),[c.disabled,c.value,b]),{onNativeOptionAdd:u,onNativeOptionRemove:h}=p;return $(()=>(u(y),()=>h(y)),[u,h,y]),a.jsxs(a.Fragment,{children:[a.jsx(j.span,{id:c.textId,...d,ref:E}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren?_e.createPortal(d.children,l.valueNode):null]})});$e.displayName=se;var Ge="SelectItemIndicator",Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return ze(Ge,e).isSelected?a.jsx(j.span,{"aria-hidden":!0,...s,ref:o}):null});Ye.displayName=Ge;var we="SelectScrollUpButton",Ze=n.forwardRef((t,o)=>{const e=Y(we,t.__scopeSelect),s=be(we,t.__scopeSelect),[r,d]=n.useState(!1),l=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=c.scrollTop>0;d(p)};const c=e.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),r?a.jsx(Xe,{...t,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=e;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});Ze.displayName=we;var Ce="SelectScrollDownButton",qe=n.forwardRef((t,o)=>{const e=Y(Ce,t.__scopeSelect),s=be(Ce,t.__scopeSelect),[r,d]=n.useState(!1),l=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=c.scrollHeight-c.clientHeight,g=Math.ceil(c.scrollTop)<p;d(g)};const c=e.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),r?a.jsx(Xe,{...t,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=e;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});qe.displayName=Ce;var Xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:s,...r}=t,d=Y("SelectScrollButton",e),l=n.useRef(null),i=de(e),c=n.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),$(()=>{i().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),a.jsx(j.div,{"aria-hidden":!0,...r,ref:o,style:{flexShrink:0,...r.style},onPointerDown:P(r.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(s,50))}),onPointerMove:P(r.onPointerMove,()=>{d.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(s,50))}),onPointerLeave:P(r.onPointerLeave,()=>{c()})})}),Gt="SelectSeparator",Yt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return a.jsx(j.div,{"aria-hidden":!0,...s,ref:o})});Yt.displayName=Gt;var ye="SelectArrow",Zt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=ue(e),d=G(ye,e),l=Y(ye,e);return d.open&&l.position==="popper"?a.jsx(gt,{...r,...s,ref:o}):null});Zt.displayName=ye;var qt="SelectBubbleInput",Je=n.forwardRef(({__scopeSelect:t,value:o,...e},s)=>{const r=n.useRef(null),d=L(s,r),l=St(o);return n.useEffect(()=>{const i=r.current;if(!i)return;const c=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(c,"value").set;if(l!==o&&g){const x=new Event("change",{bubbles:!0});g.call(i,o),i.dispatchEvent(x)}},[l,o]),a.jsx(j.select,{...e,style:{...it,...e.style},ref:d,defaultValue:o})});Je.displayName=qt;function Qe(t){return t===""||t===void 0}function et(t){const o=ct(t),e=n.useRef(""),s=n.useRef(0),r=n.useCallback(l=>{const i=e.current+l;o(i),(function c(p){e.current=p,window.clearTimeout(s.current),p!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(i)},[o]),d=n.useCallback(()=>{e.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[e,r,d]}function tt(t,o,e){const r=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,d=e?t.indexOf(e):-1;let l=Xt(t,Math.max(d,0));r.length===1&&(l=l.filter(p=>p!==e));const c=l.find(p=>p.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function Xt(t,o){return t.map((e,s)=>t[(o+s)%t.length])}var Jt=Re,Qt=Me,eo=Oe,to=De,oo=Le,no=ke,ro=We,so=Ke,ao=$e,lo=Ye,io=Ze,co=qe;function xo({...t}){return a.jsx(Jt,{"data-slot":"select",...t})}function So({...t}){return a.jsx(eo,{"data-slot":"select-value",...t})}function wo({className:t,size:o="default",children:e,...s}){return a.jsxs(Qt,{"data-slot":"select-trigger","data-size":o,className:te("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s,children:[e,a.jsx(to,{asChild:!0,children:a.jsx(Ne,{className:"size-4 opacity-50"})})]})}function Co({className:t,children:o,position:e="popper",...s}){return a.jsx(oo,{children:a.jsxs(no,{"data-slot":"select-content",className:te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...s,children:[a.jsx(uo,{}),a.jsx(ro,{className:te("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),a.jsx(po,{})]})})}function yo({className:t,children:o,...e}){return a.jsxs(so,{"data-slot":"select-item",className:te("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...e,children:[a.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(lo,{children:a.jsx(wt,{className:"size-4"})})}),a.jsx(ao,{children:o})]})}function uo({className:t,...o}){return a.jsx(io,{"data-slot":"select-scroll-up-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:a.jsx(yt,{className:"size-4"})})}function po({className:t,...o}){return a.jsx(co,{"data-slot":"select-scroll-down-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:a.jsx(Ne,{className:"size-4"})})}export{xo as S,wo as a,So as b,Co as c,yo as d};
|
|
1
|
+
import{c as ot,r as n,j as a,Z as nt,a2 as Ee,e as Te,a3 as rt,b as st,a0 as Ie,f as L,a4 as at,d as j,g as P,ag as $,a5 as lt,ah as _e,ai as it,a1 as ct,a6 as dt,a8 as ut,a9 as pt,aa as ft,ab as mt,ac as ht,ad as gt,i as te}from"./index-Ncy0-Qo7.js";import{u as vt,f as xt}from"./Page-B68mlTwU.js";import{u as St}from"./index-BBzHsn7u.js";import{C as Ne}from"./chevron-down-8PGvFYxV.js";import{C as wt}from"./check-NQsw6yBl.js";const Ct=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],yt=ot("ChevronUp",Ct);function Pe(t,[o,e]){return Math.min(e,Math.max(o,t))}function It(t){const o=bt(t),e=n.forwardRef((s,r)=>{const{children:d,...l}=s,i=n.Children.toArray(d),c=i.find(Pt);if(c){const p=c.props.children,g=i.map(x=>x===c?n.Children.count(p)>1?n.Children.only(null):n.isValidElement(p)?p.props.children:null:x);return a.jsx(o,{...l,ref:r,children:n.isValidElement(p)?n.cloneElement(p,void 0,g):null})}return a.jsx(o,{...l,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function bt(t){const o=n.forwardRef((e,s)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const l=_t(r),i=Et(d,r.props);return r.type!==n.Fragment&&(i.ref=s?nt(s,l):l),n.cloneElement(r,i)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var Tt=Symbol("radix.slottable");function Pt(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Tt}function Et(t,o){const e={...o};for(const s in o){const r=t[s],d=o[s];/^on[A-Z]/.test(s)?r&&d?e[s]=(...i)=>{const c=d(...i);return r(...i),c}:r&&(e[s]=r):s==="style"?e[s]={...r,...d}:s==="className"&&(e[s]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function _t(t){let o=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=Object.getOwnPropertyDescriptor(t,"ref")?.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var Nt=[" ","Enter","ArrowUp","ArrowDown"],Rt=[" ","Enter"],J="Select",[ce,de,jt]=xt(J),[oe]=st(J,[jt,Ee]),ue=Ee(),[Mt,G]=oe(J),[At,Ot]=oe(J),Re=t=>{const{__scopeSelect:o,children:e,open:s,defaultOpen:r,onOpenChange:d,value:l,defaultValue:i,onValueChange:c,dir:p,name:g,autoComplete:x,disabled:E,required:b,form:y}=t,u=ue(o),[h,S]=n.useState(null),[m,v]=n.useState(null),[F,M]=n.useState(!1),ne=vt(p),[_,O]=Te({prop:s,defaultProp:r??!1,onChange:d,caller:J}),[U,Z]=Te({prop:l,defaultProp:i,onChange:c,caller:J}),k=n.useRef(null),V=h?y||!!h.closest("form"):!0,[z,B]=n.useState(new Set),H=Array.from(z).map(N=>N.props.value).join(";");return a.jsx(rt,{...u,children:a.jsxs(Mt,{required:b,scope:o,trigger:h,onTriggerChange:S,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:Ie(),value:U,onValueChange:Z,open:_,onOpenChange:O,dir:ne,triggerPointerDownPosRef:k,disabled:E,children:[a.jsx(ce.Provider,{scope:o,children:a.jsx(At,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(N=>{B(D=>new Set(D).add(N))},[]),onNativeOptionRemove:n.useCallback(N=>{B(D=>{const W=new Set(D);return W.delete(N),W})},[]),children:e})}),V?a.jsxs(Je,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:x,value:U,onChange:N=>Z(N.target.value),disabled:E,form:y,children:[U===void 0?a.jsx("option",{value:""}):null,Array.from(z)]},H):null]})})};Re.displayName=J;var je="SelectTrigger",Me=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...r}=t,d=ue(e),l=G(je,e),i=l.disabled||s,c=L(o,l.onTriggerChange),p=de(e),g=n.useRef("touch"),[x,E,b]=et(u=>{const h=p().filter(v=>!v.disabled),S=h.find(v=>v.value===l.value),m=tt(h,u,S);m!==void 0&&l.onValueChange(m.value)}),y=u=>{i||(l.onOpenChange(!0),b()),u&&(l.triggerPointerDownPosRef.current={x:Math.round(u.pageX),y:Math.round(u.pageY)})};return a.jsx(at,{asChild:!0,...d,children:a.jsx(j.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":Qe(l.value)?"":void 0,...r,ref:c,onClick:P(r.onClick,u=>{u.currentTarget.focus(),g.current!=="mouse"&&y(u)}),onPointerDown:P(r.onPointerDown,u=>{g.current=u.pointerType;const h=u.target;h.hasPointerCapture(u.pointerId)&&h.releasePointerCapture(u.pointerId),u.button===0&&u.ctrlKey===!1&&u.pointerType==="mouse"&&(y(u),u.preventDefault())}),onKeyDown:P(r.onKeyDown,u=>{const h=x.current!=="";!(u.ctrlKey||u.altKey||u.metaKey)&&u.key.length===1&&E(u.key),!(h&&u.key===" ")&&Nt.includes(u.key)&&(y(),u.preventDefault())})})})});Me.displayName=je;var Ae="SelectValue",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,children:d,placeholder:l="",...i}=t,c=G(Ae,e),{onValueNodeHasChildrenChange:p}=c,g=d!==void 0,x=L(o,c.onValueNodeChange);return $(()=>{p(g)},[p,g]),a.jsx(j.span,{...i,ref:x,style:{pointerEvents:"none"},children:Qe(c.value)?a.jsx(a.Fragment,{children:l}):d})});Oe.displayName=Ae;var Dt="SelectIcon",De=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...r}=t;return a.jsx(j.span,{"aria-hidden":!0,...r,ref:o,children:s||"▼"})});De.displayName=Dt;var Lt="SelectPortal",Le=t=>a.jsx(lt,{asChild:!0,...t});Le.displayName=Lt;var Q="SelectContent",ke=n.forwardRef((t,o)=>{const e=G(Q,t.__scopeSelect),[s,r]=n.useState();if($(()=>{r(new DocumentFragment)},[]),!e.open){const d=s;return d?_e.createPortal(a.jsx(Ve,{scope:t.__scopeSelect,children:a.jsx(ce.Slot,{scope:t.__scopeSelect,children:a.jsx("div",{children:t.children})})}),d):null}return a.jsx(Be,{...t,ref:o})});ke.displayName=Q;var A=10,[Ve,Y]=oe(Q),kt="SelectContentImpl",Vt=It("SelectContent.RemoveScroll"),Be=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:l,side:i,sideOffset:c,align:p,alignOffset:g,arrowPadding:x,collisionBoundary:E,collisionPadding:b,sticky:y,hideWhenDetached:u,avoidCollisions:h,...S}=t,m=G(Q,e),[v,F]=n.useState(null),[M,ne]=n.useState(null),_=L(o,f=>F(f)),[O,U]=n.useState(null),[Z,k]=n.useState(null),V=de(e),[z,B]=n.useState(!1),H=n.useRef(!1);n.useEffect(()=>{if(v)return dt(v)},[v]),ut();const N=n.useCallback(f=>{const[I,...R]=V().map(T=>T.ref.current),[w]=R.slice(-1),C=document.activeElement;for(const T of f)if(T===C||(T?.scrollIntoView({block:"nearest"}),T===I&&M&&(M.scrollTop=0),T===w&&M&&(M.scrollTop=M.scrollHeight),T?.focus(),document.activeElement!==C))return},[V,M]),D=n.useCallback(()=>N([O,v]),[N,O,v]);n.useEffect(()=>{z&&D()},[z,D]);const{onOpenChange:W,triggerPointerDownPosRef:K}=m;n.useEffect(()=>{if(v){let f={x:0,y:0};const I=w=>{f={x:Math.abs(Math.round(w.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(w.pageY)-(K.current?.y??0))}},R=w=>{f.x<=10&&f.y<=10?w.preventDefault():v.contains(w.target)||W(!1),document.removeEventListener("pointermove",I),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",R,{capture:!0})}}},[v,W,K]),n.useEffect(()=>{const f=()=>W(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[W]);const[pe,ae]=et(f=>{const I=V().filter(C=>!C.disabled),R=I.find(C=>C.ref.current===document.activeElement),w=tt(I,f,R);w&&setTimeout(()=>w.ref.current.focus())}),fe=n.useCallback((f,I,R)=>{const w=!H.current&&!R;(m.value!==void 0&&m.value===I||w)&&(U(f),w&&(H.current=!0))},[m.value]),me=n.useCallback(()=>v?.focus(),[v]),ee=n.useCallback((f,I,R)=>{const w=!H.current&&!R;(m.value!==void 0&&m.value===I||w)&&k(f)},[m.value]),le=s==="popper"?xe:He,re=le===xe?{side:i,sideOffset:c,align:p,alignOffset:g,arrowPadding:x,collisionBoundary:E,collisionPadding:b,sticky:y,hideWhenDetached:u,avoidCollisions:h}:{};return a.jsx(Ve,{scope:e,content:v,viewport:M,onViewportChange:ne,itemRefCallback:fe,selectedItem:O,onItemLeave:me,itemTextRefCallback:ee,focusSelectedItem:D,selectedItemText:Z,position:s,isPositioned:z,searchRef:pe,children:a.jsx(pt,{as:Vt,allowPinchZoom:!0,children:a.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(r,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:a.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:a.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...S,...re,onPlaced:()=>B(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:P(S.onKeyDown,f=>{const I=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!I&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let w=V().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(f.key)&&(w=w.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const C=f.target,T=w.indexOf(C);w=w.slice(T+1)}setTimeout(()=>N(w)),f.preventDefault()}})})})})})})});Be.displayName=kt;var Bt="SelectItemAlignedPosition",He=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:s,...r}=t,d=G(Q,e),l=Y(Q,e),[i,c]=n.useState(null),[p,g]=n.useState(null),x=L(o,_=>g(_)),E=de(e),b=n.useRef(!1),y=n.useRef(!0),{viewport:u,selectedItem:h,selectedItemText:S,focusSelectedItem:m}=l,v=n.useCallback(()=>{if(d.trigger&&d.valueNode&&i&&p&&u&&h&&S){const _=d.trigger.getBoundingClientRect(),O=p.getBoundingClientRect(),U=d.valueNode.getBoundingClientRect(),Z=S.getBoundingClientRect();if(d.dir!=="rtl"){const C=Z.left-O.left,T=U.left-C,q=_.left-T,X=_.width+q,he=Math.max(X,O.width),ge=window.innerWidth-A,ve=Pe(T,[A,Math.max(A,ge-he)]);i.style.minWidth=X+"px",i.style.left=ve+"px"}else{const C=O.right-Z.right,T=window.innerWidth-U.right-C,q=window.innerWidth-_.right-T,X=_.width+q,he=Math.max(X,O.width),ge=window.innerWidth-A,ve=Pe(T,[A,Math.max(A,ge-he)]);i.style.minWidth=X+"px",i.style.right=ve+"px"}const k=E(),V=window.innerHeight-A*2,z=u.scrollHeight,B=window.getComputedStyle(p),H=parseInt(B.borderTopWidth,10),N=parseInt(B.paddingTop,10),D=parseInt(B.borderBottomWidth,10),W=parseInt(B.paddingBottom,10),K=H+N+z+W+D,pe=Math.min(h.offsetHeight*5,K),ae=window.getComputedStyle(u),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),ee=_.top+_.height/2-A,le=V-ee,re=h.offsetHeight/2,f=h.offsetTop+re,I=H+N+f,R=K-I;if(I<=ee){const C=k.length>0&&h===k[k.length-1].ref.current;i.style.bottom="0px";const T=p.clientHeight-u.offsetTop-u.offsetHeight,q=Math.max(le,re+(C?me:0)+T+D),X=I+q;i.style.height=X+"px"}else{const C=k.length>0&&h===k[0].ref.current;i.style.top="0px";const q=Math.max(ee,H+u.offsetTop+(C?fe:0)+re)+R;i.style.height=q+"px",u.scrollTop=I-ee+u.offsetTop}i.style.margin=`${A}px 0`,i.style.minHeight=pe+"px",i.style.maxHeight=V+"px",s?.(),requestAnimationFrame(()=>b.current=!0)}},[E,d.trigger,d.valueNode,i,p,u,h,S,d.dir,s]);$(()=>v(),[v]);const[F,M]=n.useState();$(()=>{p&&M(window.getComputedStyle(p).zIndex)},[p]);const ne=n.useCallback(_=>{_&&y.current===!0&&(v(),m?.(),y.current=!1)},[v,m]);return a.jsx(Wt,{scope:e,contentWrapper:i,shouldExpandOnScrollRef:b,onScrollButtonChange:ne,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:a.jsx(j.div,{...r,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});He.displayName=Bt;var Ht="SelectPopperPosition",xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:s="start",collisionPadding:r=A,...d}=t,l=ue(e);return a.jsx(ht,{...l,...d,ref:o,align:s,collisionPadding:r,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xe.displayName=Ht;var[Wt,be]=oe(Q,{}),Se="SelectViewport",We=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:s,...r}=t,d=Y(Se,e),l=be(Se,e),i=L(o,d.onViewportChange),c=n.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),a.jsx(ce.Slot,{scope:e,children:a.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:P(r.onScroll,p=>{const g=p.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:E}=l;if(E?.current&&x){const b=Math.abs(c.current-g.scrollTop);if(b>0){const y=window.innerHeight-A*2,u=parseFloat(x.style.minHeight),h=parseFloat(x.style.height),S=Math.max(u,h);if(S<y){const m=S+b,v=Math.min(y,m),F=m-v;x.style.height=v+"px",x.style.bottom==="0px"&&(g.scrollTop=F>0?F:0,x.style.justifyContent="flex-end")}}}c.current=g.scrollTop})})})]})});We.displayName=Se;var Fe="SelectGroup",[Ft,Ut]=oe(Fe),zt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Ie();return a.jsx(Ft,{scope:e,id:r,children:a.jsx(j.div,{role:"group","aria-labelledby":r,...s,ref:o})})});zt.displayName=Fe;var Ue="SelectLabel",Kt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=Ut(Ue,e);return a.jsx(j.div,{id:r.id,...s,ref:o})});Kt.displayName=Ue;var ie="SelectItem",[$t,ze]=oe(ie),Ke=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:s,disabled:r=!1,textValue:d,...l}=t,i=G(ie,e),c=Y(ie,e),p=i.value===s,[g,x]=n.useState(d??""),[E,b]=n.useState(!1),y=L(o,m=>c.itemRefCallback?.(m,s,r)),u=Ie(),h=n.useRef("touch"),S=()=>{r||(i.onValueChange(s),i.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx($t,{scope:e,value:s,disabled:r,textId:u,isSelected:p,onItemTextChange:n.useCallback(m=>{x(v=>v||(m?.textContent??"").trim())},[]),children:a.jsx(ce.ItemSlot,{scope:e,value:s,disabled:r,textValue:g,children:a.jsx(j.div,{role:"option","aria-labelledby":u,"data-highlighted":E?"":void 0,"aria-selected":p&&E,"data-state":p?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...l,ref:y,onFocus:P(l.onFocus,()=>b(!0)),onBlur:P(l.onBlur,()=>b(!1)),onClick:P(l.onClick,()=>{h.current!=="mouse"&&S()}),onPointerUp:P(l.onPointerUp,()=>{h.current==="mouse"&&S()}),onPointerDown:P(l.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:P(l.onPointerMove,m=>{h.current=m.pointerType,r?c.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(l.onPointerLeave,m=>{m.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:P(l.onKeyDown,m=>{c.searchRef?.current!==""&&m.key===" "||(Rt.includes(m.key)&&S(),m.key===" "&&m.preventDefault())})})})})});Ke.displayName=ie;var se="SelectItemText",$e=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,...d}=t,l=G(se,e),i=Y(se,e),c=ze(se,e),p=Ot(se,e),[g,x]=n.useState(null),E=L(o,S=>x(S),c.onItemTextChange,S=>i.itemTextRefCallback?.(S,c.value,c.disabled)),b=g?.textContent,y=n.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:b},c.value),[c.disabled,c.value,b]),{onNativeOptionAdd:u,onNativeOptionRemove:h}=p;return $(()=>(u(y),()=>h(y)),[u,h,y]),a.jsxs(a.Fragment,{children:[a.jsx(j.span,{id:c.textId,...d,ref:E}),c.isSelected&&l.valueNode&&!l.valueNodeHasChildren?_e.createPortal(d.children,l.valueNode):null]})});$e.displayName=se;var Ge="SelectItemIndicator",Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return ze(Ge,e).isSelected?a.jsx(j.span,{"aria-hidden":!0,...s,ref:o}):null});Ye.displayName=Ge;var we="SelectScrollUpButton",Ze=n.forwardRef((t,o)=>{const e=Y(we,t.__scopeSelect),s=be(we,t.__scopeSelect),[r,d]=n.useState(!1),l=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=c.scrollTop>0;d(p)};const c=e.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),r?a.jsx(Xe,{...t,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=e;i&&c&&(i.scrollTop=i.scrollTop-c.offsetHeight)}}):null});Ze.displayName=we;var Ce="SelectScrollDownButton",qe=n.forwardRef((t,o)=>{const e=Y(Ce,t.__scopeSelect),s=be(Ce,t.__scopeSelect),[r,d]=n.useState(!1),l=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let i=function(){const p=c.scrollHeight-c.clientHeight,g=Math.ceil(c.scrollTop)<p;d(g)};const c=e.viewport;return i(),c.addEventListener("scroll",i),()=>c.removeEventListener("scroll",i)}},[e.viewport,e.isPositioned]),r?a.jsx(Xe,{...t,ref:l,onAutoScroll:()=>{const{viewport:i,selectedItem:c}=e;i&&c&&(i.scrollTop=i.scrollTop+c.offsetHeight)}}):null});qe.displayName=Ce;var Xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:s,...r}=t,d=Y("SelectScrollButton",e),l=n.useRef(null),i=de(e),c=n.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),$(()=>{i().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[i]),a.jsx(j.div,{"aria-hidden":!0,...r,ref:o,style:{flexShrink:0,...r.style},onPointerDown:P(r.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(s,50))}),onPointerMove:P(r.onPointerMove,()=>{d.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(s,50))}),onPointerLeave:P(r.onPointerLeave,()=>{c()})})}),Gt="SelectSeparator",Yt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return a.jsx(j.div,{"aria-hidden":!0,...s,ref:o})});Yt.displayName=Gt;var ye="SelectArrow",Zt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=ue(e),d=G(ye,e),l=Y(ye,e);return d.open&&l.position==="popper"?a.jsx(gt,{...r,...s,ref:o}):null});Zt.displayName=ye;var qt="SelectBubbleInput",Je=n.forwardRef(({__scopeSelect:t,value:o,...e},s)=>{const r=n.useRef(null),d=L(s,r),l=St(o);return n.useEffect(()=>{const i=r.current;if(!i)return;const c=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(c,"value").set;if(l!==o&&g){const x=new Event("change",{bubbles:!0});g.call(i,o),i.dispatchEvent(x)}},[l,o]),a.jsx(j.select,{...e,style:{...it,...e.style},ref:d,defaultValue:o})});Je.displayName=qt;function Qe(t){return t===""||t===void 0}function et(t){const o=ct(t),e=n.useRef(""),s=n.useRef(0),r=n.useCallback(l=>{const i=e.current+l;o(i),(function c(p){e.current=p,window.clearTimeout(s.current),p!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(i)},[o]),d=n.useCallback(()=>{e.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[e,r,d]}function tt(t,o,e){const r=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,d=e?t.indexOf(e):-1;let l=Xt(t,Math.max(d,0));r.length===1&&(l=l.filter(p=>p!==e));const c=l.find(p=>p.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function Xt(t,o){return t.map((e,s)=>t[(o+s)%t.length])}var Jt=Re,Qt=Me,eo=Oe,to=De,oo=Le,no=ke,ro=We,so=Ke,ao=$e,lo=Ye,io=Ze,co=qe;function xo({...t}){return a.jsx(Jt,{"data-slot":"select",...t})}function So({...t}){return a.jsx(eo,{"data-slot":"select-value",...t})}function wo({className:t,size:o="default",children:e,...s}){return a.jsxs(Qt,{"data-slot":"select-trigger","data-size":o,className:te("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...s,children:[e,a.jsx(to,{asChild:!0,children:a.jsx(Ne,{className:"size-4 opacity-50"})})]})}function Co({className:t,children:o,position:e="popper",...s}){return a.jsx(oo,{children:a.jsxs(no,{"data-slot":"select-content",className:te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...s,children:[a.jsx(uo,{}),a.jsx(ro,{className:te("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),a.jsx(po,{})]})})}function yo({className:t,children:o,...e}){return a.jsxs(so,{"data-slot":"select-item",className:te("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...e,children:[a.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(lo,{children:a.jsx(wt,{className:"size-4"})})}),a.jsx(ao,{children:o})]})}function uo({className:t,...o}){return a.jsx(io,{"data-slot":"select-scroll-up-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:a.jsx(yt,{className:"size-4"})})}function po({className:t,...o}){return a.jsx(co,{"data-slot":"select-scroll-down-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:a.jsx(Ne,{className:"size-4"})})}export{xo as S,wo as a,So as b,Co as c,yo as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,i,L as m}from"./index-
|
|
1
|
+
import{j as e,i,L as m}from"./index-Ncy0-Qo7.js";import{m as n}from"./use-settings-form-submit-CXwtE1sI.js";import{F as c}from"./FieldInfo-sRlPRNSK.js";import{S as d,a as u,b as f,c as h,d as p}from"./select-GZr6C6eZ.js";import{u as x,R as j}from"./use-form-validation-context-D2oA54L_.js";import"./Page-B68mlTwU.js";import"./index-BBzHsn7u.js";import"./chevron-down-8PGvFYxV.js";import"./check-NQsw6yBl.js";function R({className:t,label:l,options:r}){const a=n(),{isFieldRequired:o}=x();return e.jsxs("div",{className:i("space-y-3",t),children:[e.jsxs(m,{htmlFor:a.name,className:"block w-full",children:[l,o(a.name)&&e.jsx(j,{})]}),e.jsxs(d,{name:a.name,defaultValue:a.state.value,onValueChange:s=>a.handleChange(s),children:[e.jsx(u,{className:"w-full shadow-none",children:e.jsx(f,{placeholder:"Select a link type"})}),e.jsx(h,{children:Object.values(r).map(s=>e.jsx(p,{value:s.toLowerCase(),className:"hover:bg-accent/50",children:s.toLowerCase()},s.toLowerCase()))})]},`${a.name}-${a.state.value}`),e.jsx(c,{fieldMeta:a.state.meta})]})}export{R as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,O as o}from"./index-Ncy0-Qo7.js";function e(){return t.jsx(o,{})}export{e as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,B as d,i as x}from"./index-
|
|
1
|
+
import{j as s,B as d,i as x}from"./index-Ncy0-Qo7.js";import{o as p}from"./use-settings-form-submit-CXwtE1sI.js";import{L as u}from"./loader-circle-Bz67bJa3.js";function g({label:m,actionLabel:a,size:t="md"}){const o=p();return s.jsx(s.Fragment,{children:s.jsx(o.Subscribe,{selector:e=>[e.canSubmit,e.isSubmitting,e.errors,e.fieldMeta],children:([e,i,n,c])=>s.jsxs("div",{className:"form__submit bg-background sticky right-0 bottom-0 left-0 w-full pt-4",children:[s.jsx(d,{type:"submit",className:x("w-full rounded-md transition-colors duration-150",{"opacity-70":i,"px-4 py-6":t==="lg","px-4 py-2":t==="md","px-2 py-1":t==="sm"}),disabled:!e||i,children:i?s.jsxs(s.Fragment,{children:[s.jsx(u,{className:"size-4 animate-spin"})," ",a??"Saving..."]}):s.jsx(s.Fragment,{children:m??"Save"})}),Object.keys(n).length>0&&s.jsxs("div",{className:"mt-4 rounded-md bg-red-50 p-4 text-sm text-red-700",children:[s.jsx("h4",{className:"font-medium",children:"Please fix the following errors:"}),s.jsxs("ul",{className:"mt-2 list-disc pl-5",children:[JSON.stringify(c),Object.entries(n).map(([l,r])=>s.jsxs("li",{children:[l,":"," ",typeof r=="string"?r:JSON.stringify(r)]},l))]})]})]})})})}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,f as C,e as T,j as o,b as I,d as y,g as M,h as H,i as S}from"./index-
|
|
1
|
+
import{r as s,f as C,e as T,j as o,b as I,d as y,g as M,h as H,i as S}from"./index-Ncy0-Qo7.js";import{u as z}from"./index-BBzHsn7u.js";var b="Switch",[A]=I(b),[U,q]=A(b),P=s.forwardRef((e,r)=>{const{__scopeSwitch:t,name:n,checked:a,defaultChecked:m,required:d,disabled:c,value:u="on",onCheckedChange:k,form:i,...w}=e,[l,p]=s.useState(null),v=C(r,f=>p(f)),g=s.useRef(!1),x=l?i||!!l.closest("form"):!0,[h,N]=T({prop:a,defaultProp:m??!1,onChange:k,caller:b});return o.jsxs(U,{scope:t,checked:h,disabled:c,children:[o.jsx(y.button,{type:"button",role:"switch","aria-checked":h,"aria-required":d,"data-state":_(h),"data-disabled":c?"":void 0,disabled:c,value:u,...w,ref:v,onClick:M(e.onClick,f=>{N(B=>!B),x&&(g.current=f.isPropagationStopped(),g.current||f.stopPropagation())})}),x&&o.jsx(j,{control:l,bubbles:!g.current,name:n,value:u,checked:h,required:d,disabled:c,form:i,style:{transform:"translateX(-100%)"}})]})});P.displayName=b;var E="SwitchThumb",R=s.forwardRef((e,r)=>{const{__scopeSwitch:t,...n}=e,a=q(E,t);return o.jsx(y.span,{"data-state":_(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:r})});R.displayName=E;var L="SwitchBubbleInput",j=s.forwardRef(({__scopeSwitch:e,control:r,checked:t,bubbles:n=!0,...a},m)=>{const d=s.useRef(null),c=C(d,m),u=z(t),k=H(r);return s.useEffect(()=>{const i=d.current;if(!i)return;const w=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&p){const v=new Event("click",{bubbles:n});p.call(i,t),i.dispatchEvent(v)}},[u,t,n]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:t,...a,tabIndex:-1,ref:c,style:{...a.style,...k,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});j.displayName=L;function _(e){return e?"checked":"unchecked"}var O=P,D=R;function X({className:e,...r}){return o.jsx(O,{"data-slot":"switch",className:S("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:o.jsx(D,{"data-slot":"switch-thumb",className:S("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}export{X as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,i,L as m}from"./index-
|
|
1
|
+
import{j as s,i,L as m}from"./index-Ncy0-Qo7.js";import{m as r}from"./use-settings-form-submit-CXwtE1sI.js";import{S as n}from"./switch-BeMrf8sh.js";import"./index-BBzHsn7u.js";const h=({className:t,label:a})=>{const e=r();return s.jsxs("div",{className:i("form-field__switch flex items-center",t),children:[s.jsx(m,{htmlFor:e.name,className:"mr-3",children:a}),s.jsx(n,{id:e.name,checked:e.state.value,onCheckedChange:e.handleChange})]})};export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,i as l}from"./index-
|
|
1
|
+
import{j as t,i as l}from"./index-Ncy0-Qo7.js";function o({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function r({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function n({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function d({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...e})}function c({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}function b({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}export{o as T,r as a,d as b,c,n as d,b as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./index-
|
|
1
|
+
import{c}from"./index-Ncy0-Qo7.js";const e=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],l=c("Ellipsis",e);const s=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],i=c("Eye",s);const o=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],y=c("Pencil",o);const a=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],d=c("Plus",a);const t=[["path",{d:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5c-1.4 0-2.5-1.1-2.5-2.5V2",key:"125lnx"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14.5 16h-5",key:"1ox875"}]],h=c("TestTube",t);export{l as E,y as P,h as T,i as a,d as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as a,i as o,L as m,J as d}from"./index-
|
|
1
|
+
import{j as a,i as o,L as m,J as d}from"./index-Ncy0-Qo7.js";import{m as u}from"./use-settings-form-submit-CXwtE1sI.js";import{F as c}from"./FieldInfo-sRlPRNSK.js";import{u as f,R as x}from"./use-form-validation-context-D2oA54L_.js";const v=({className:s,label:t,hideLabel:l=!1,...i})=>{const e=u(),{isFieldRequired:n}=f();return a.jsxs("div",{className:o("space-y-3",s),children:[!l&&a.jsxs(m,{htmlFor:e.name,className:"block w-full",children:[t,n(e.name)&&a.jsx(x,{})]}),a.jsx(d,{type:"text",className:"form-input",name:e.name,id:e.name,value:e.state.value??"","aria-invalid":e.state.meta.isTouched&&e.state.meta.errors?.length>0,onBlur:e.handleBlur,onChange:r=>e.handleChange(r.target.value),...i}),a.jsx(c,{fieldMeta:e.state.meta})]})};export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as v}from"./index-
|
|
1
|
+
import{o as v}from"./index-Ncy0-Qo7.js";var h,l;function M(){if(l)return h;l=1;var t=1e3,a=t*60,i=a*60,s=i*24,f=s*7,m=s*365.25;h=function(e,r){r=r||{};var n=typeof e;if(n==="string"&&e.length>0)return c(e);if(n==="number"&&isFinite(e))return r.long?g(e):u(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var n=parseFloat(r[1]),d=(r[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return n*m;case"weeks":case"week":case"w":return n*f;case"days":case"day":case"d":return n*s;case"hours":case"hour":case"hrs":case"hr":case"h":return n*i;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function u(e){var r=Math.abs(e);return r>=s?Math.round(e/s)+"d":r>=i?Math.round(e/i)+"h":r>=a?Math.round(e/a)+"m":r>=t?Math.round(e/t)+"s":e+"ms"}function g(e){var r=Math.abs(e);return r>=s?o(e,r,s,"day"):r>=i?o(e,r,i,"hour"):r>=a?o(e,r,a,"minute"):r>=t?o(e,r,t,"second"):e+" ms"}function o(e,r,n,d){var w=r>=n*1.5;return Math.round(e/n)+" "+d+(w?"s":"")}return h}var p=M();const y=v(p);function D(t){const a=typeof t=="string"?new Date(t):new Date(t),s=new Date().getTime()-a.getTime();if(Math.abs(s)>y("7d"))return a.toLocaleDateString("en",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});const f=y(Math.ceil(s/1e3)*1e3,{long:!0}),[m,c]=f.split(" "),u=new Intl.RelativeTimeFormat("en",{numeric:"auto"});return c==="ms"?u.format(0,"second"):u.format(-parseInt(m),c)}export{D as f};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as z,j as e,r as o,p as Y,R as Re,f as J,W as Me,b as Pe,C as _e,g as Ie,T as $e,D as Le,q as X,s as Fe,v as Ue,w as qe,i as y,x as Z,u as G,l as C,t as d,y as ee,z as se,A as te,E as ae,F as re,L as j,B as b,G as ne,H as le,I as ie,J as V,k as Ve}from"./index-
|
|
1
|
+
import{c as z,j as e,r as o,p as Y,R as Re,f as J,W as Me,b as Pe,C as _e,g as Ie,T as $e,D as Le,q as X,s as Fe,v as Ue,w as qe,i as y,x as Z,u as G,l as C,t as d,y as ee,z as se,A as te,E as ae,F as re,L as j,B as b,G as ne,H as le,I as ie,J as V,k as Ve}from"./index-Ncy0-Qo7.js";import{S as Be,a as Ke,b as ze,c as Ge,d as He}from"./select-GZr6C6eZ.js";import{B as h}from"./badge-C5YCxEzP.js";import{T as Qe,a as We,b as B,c as I,d as Ye,e as k}from"./table-qEFWauuw.js";import{P as Je,D as Xe,a as Ze,b as es,d as ss,c as $,e as ts}from"./Page-B68mlTwU.js";import{L as K}from"./loader-circle-Bz67bJa3.js";import{T as H,P as oe,E as as,a as rs,b as ns}from"./test-tube-DhD6uWdp.js";import{S as ls}from"./switch-BeMrf8sh.js";import"./index-BBzHsn7u.js";import"./chevron-down-8PGvFYxV.js";import"./check-NQsw6yBl.js";const is=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]],os=z("GitMerge",is);const cs=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]],ds=z("ToggleLeft",cs);const us=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]],ms=z("ToggleRight",us);var gs=Symbol("radix.slottable");function hs(t){const r=({children:a})=>e.jsx(e.Fragment,{children:a});return r.displayName=`${t}.Slottable`,r.__radixId=gs,r}var ce="AlertDialog",[ps]=Pe(ce,[Y]),v=Y(),de=t=>{const{__scopeAlertDialog:r,...a}=t,n=v(r);return e.jsx(Re,{...n,...a,modal:!0})};de.displayName=ce;var xs="AlertDialogTrigger",fs=o.forwardRef((t,r)=>{const{__scopeAlertDialog:a,...n}=t,l=v(a);return e.jsx(qe,{...l,...n,ref:r})});fs.displayName=xs;var js="AlertDialogPortal",ue=t=>{const{__scopeAlertDialog:r,...a}=t,n=v(r);return e.jsx(Fe,{...n,...a})};ue.displayName=js;var vs="AlertDialogOverlay",me=o.forwardRef((t,r)=>{const{__scopeAlertDialog:a,...n}=t,l=v(a);return e.jsx(Ue,{...l,...n,ref:r})});me.displayName=vs;var E="AlertDialogContent",[Ns,bs]=ps(E),ys=hs("AlertDialogContent"),ge=o.forwardRef((t,r)=>{const{__scopeAlertDialog:a,children:n,...l}=t,p=v(a),u=o.useRef(null),x=J(r,u),m=o.useRef(null);return e.jsx(Me,{contentName:E,titleName:he,docsSlug:"alert-dialog",children:e.jsx(Ns,{scope:a,cancelRef:m,children:e.jsxs(_e,{role:"alertdialog",...p,...l,ref:x,onOpenAutoFocus:Ie(l.onOpenAutoFocus,c=>{c.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[e.jsx(ys,{children:n}),e.jsx(Cs,{contentRef:u})]})})})});ge.displayName=E;var he="AlertDialogTitle",pe=o.forwardRef((t,r)=>{const{__scopeAlertDialog:a,...n}=t,l=v(a);return e.jsx($e,{...l,...n,ref:r})});pe.displayName=he;var xe="AlertDialogDescription",fe=o.forwardRef((t,r)=>{const{__scopeAlertDialog:a,...n}=t,l=v(a);return e.jsx(Le,{...l,...n,ref:r})});fe.displayName=xe;var Ss="AlertDialogAction",je=o.forwardRef((t,r)=>{const{__scopeAlertDialog:a,...n}=t,l=v(a);return e.jsx(X,{...l,...n,ref:r})});je.displayName=Ss;var ve="AlertDialogCancel",Ne=o.forwardRef((t,r)=>{const{__scopeAlertDialog:a,...n}=t,{cancelRef:l}=bs(ve,a),p=v(a),u=J(r,l);return e.jsx(X,{...p,...n,ref:u})});Ne.displayName=ve;var Cs=({contentRef:t})=>{const r=`\`${E}\` requires a description for the component to be accessible for screen reader users.
|
|
2
2
|
|
|
3
3
|
You can add a description to the \`${E}\` by passing a \`${xe}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,r as o}from"./index-
|
|
1
|
+
import{j as r,r as o}from"./index-Ncy0-Qo7.js";import{n as e}from"./use-settings-form-submit-CXwtE1sI.js";function a(){return r.jsx("span",{className:"text-red-500",title:"Required",children:"*"})}const s=()=>{const t=o.useContext(e);if(!t)throw new Error("useFormValidation must be used within a FormValidationProvider");return t};export{a as R,s as u};
|