@protobase/ui 0.44.4 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,n as r,t as i}from"./react-CR5VJ85Q.js";import{J as a,ht as o,t as s}from"./app-By06l4Sd.js";import{c}from"./preload-helper-C24C2MCK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=t(n(),1),u=r(),d=e({default:()=>f}),f={},p=`protobase-api-origin`,m=e=>[...e.split(`,`).map(e=>e.trim()).filter(e=>e&&!/^maximum-scale\s*=/.test(e)),`maximum-scale=1`].join(`, `),h=e=>{let t=e.querySelector(`meta[name="viewport"]`);t&&t.setAttribute(`content`,m(t.getAttribute(`content`)??``))},g=e=>{if(e.length===0)return;if(e.length>1)throw Error(`The page has ${e.length} ${p} meta tags; it may have one`);let t=e[0],n=URL.canParse(t)?new URL(t):void 0;if(!n||n.protocol!==`http:`&&n.protocol!==`https:`||n.origin!==t)throw Error(`The page's ${p} meta tag holds "${t}", which is not an http or https origin such as https://shop.example.com`);return t},_=()=>g([...document.querySelectorAll(`meta[name="${p}"]`)].map(e=>e.content)),v=t(i(),1),y=document.getElementById(`root`);if(!y)throw Error(`index.html needs an element with id "root"`);var b=o(window);b&&h(document),(0,u.createRoot)(y).render((0,v.jsx)(l.StrictMode,{children:(0,v.jsx)(s,{baseUrl:`${_()??``}/api/v1`,ui:a(d),locale:c(),nativeBridge:b})}));
2
- //# debugId=3b92a39f-8b24-4a75-b965-959ccd2377fd
1
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,n as r,t as i}from"./react-CR5VJ85Q.js";import{J as a,ht as o,t as s}from"./app-CZ9ojEc2.js";import{c}from"./preload-helper-C24C2MCK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=t(n(),1),u=r(),d=e({default:()=>f}),f={},p=`protobase-api-origin`,m=e=>[...e.split(`,`).map(e=>e.trim()).filter(e=>e&&!/^maximum-scale\s*=/.test(e)),`maximum-scale=1`].join(`, `),h=e=>{let t=e.querySelector(`meta[name="viewport"]`);t&&t.setAttribute(`content`,m(t.getAttribute(`content`)??``))},g=e=>{if(e.length===0)return;if(e.length>1)throw Error(`The page has ${e.length} ${p} meta tags; it may have one`);let t=e[0],n=URL.canParse(t)?new URL(t):void 0;if(!n||n.protocol!==`http:`&&n.protocol!==`https:`||n.origin!==t)throw Error(`The page's ${p} meta tag holds "${t}", which is not an http or https origin such as https://shop.example.com`);return t},_=()=>g([...document.querySelectorAll(`meta[name="${p}"]`)].map(e=>e.content)),v=t(i(),1),y=document.getElementById(`root`);if(!y)throw Error(`index.html needs an element with id "root"`);var b=o(window);b&&h(document),(0,u.createRoot)(y).render((0,v.jsx)(l.StrictMode,{children:(0,v.jsx)(s,{baseUrl:`${_()??``}/api/v1`,ui:a(d),locale:c(),nativeBridge:b})}));
2
+ //# debugId=622295e4-034a-4156-b914-4a4a5864f293
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-CR5VJ85Q.js";import{mt as r,o as i}from"./app-By06l4Sd.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./maplibre-BlwO7zTh.js";import{t as p}from"./cn-Bi0ZEjD9.js";var m=e(t(),1),h=512,g=85.051129,_=16,v=Array.from({length:23},(e,t)=>t),y=e=>e.type===`LineString`?e.coordinates:e.type===`MultiPolygon`?e.coordinates.flat(2):e.coordinates.flat(),b=e=>{let t=Math.max(-85.051129,Math.min(g,e))*Math.PI/180;return .5-Math.log(Math.tan(Math.PI/4+t/2))/(2*Math.PI)},x=e=>{let t=y(e),n=t.map(([e])=>e),r=t.map(([,e])=>b(e)),i=(Math.max(...n)-Math.min(...n))/360*h,a=(Math.max(...r)-Math.min(...r))*h;return Math.max(i,a)},S=(e,t)=>{let n=e.flatMap(e=>{if(!e.area)return[];let n=e.area.type===`LineString`||e.area.type===`MultiLineString`?`line`:`polygon`;return[{type:`Feature`,geometry:e.area,properties:{key:e.key,kind:n,span:x(e.area),chosen:t?.includes(e.key)??!1}}]});return{type:`FeatureCollection`,features:[...n.filter(e=>!e.properties.chosen),...n.filter(e=>e.properties.chosen)]}},C=e=>[`interpolate`,[`linear`],[`zoom`],...v.flatMap(t=>[t,[`*`,e,[`min`,1,[`max`,0,[`/`,[`-`,[`*`,[`get`,`span`],2**t],_],32]]]]])],w=e(n(),1),T=`position-area-fills`,E=[`==`,[`get`,`kind`],`polygon`],D=[`==`,[`get`,`kind`],`line`],O=(e,t)=>[`case`,[`get`,`chosen`],e,t],k=({points:e,selected:t,colors:n})=>{let r=S(e,t);if(r.features.length===0)return null;let i=[`case`,[`get`,`chosen`],n.chosen,n.area];return(0,w.jsxs)(s,{id:`position-areas`,type:`geojson`,data:r,children:[(0,w.jsx)(u,{id:T,type:`fill`,filter:E,paint:{"fill-color":i,"fill-opacity":C(O(.15,.1))}}),(0,w.jsx)(u,{id:`position-area-outlines`,type:`line`,filter:E,paint:{"line-color":i,"line-width":1.5,"line-dasharray":[3,2],"line-opacity":C(.8)}}),(0,w.jsx)(u,{id:`position-area-lines`,type:`line`,filter:D,layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-color":i,"line-width":6,"line-opacity":C(O(.6,.35))}})]})},A=(e,t)=>{let n=document.createElement(`span`);n.style.color=`var(${t})`,e.append(n);let r=getComputedStyle(n).color;n.remove();let i=document.createElement(`canvas`);i.width=1,i.height=1;let a=i.getContext(`2d`,{willReadFrequently:!0});if(!a)return r;a.fillStyle=r,a.fillRect(0,0,1,1);let[o,s,c,l]=a.getImageData(0,0,1,1).data;return`rgba(${o}, ${s}, ${c}, ${l/255})`},j=28,M={padding:48,maxZoom:15,duration:0},N={padding:48,maxZoom:16,duration:300},P=32,F=()=>r(`compact`,e=>new Intl.NumberFormat(e,{notation:`compact`,maximumFractionDigits:1})),I=e=>[[e.west,e.south],[e.east,e.north]],L=({style:e,layers:t,initial:n,points:r,buckets:s,fit:u,onFitted:h,onMove:g,selected:_,covered:v,onSelect:y,onClear:b,markerLabel:x,bucketLabel:S})=>{let C=(0,m.useRef)(null),[E,D]=(0,m.useState)([]),[O,L]=(0,m.useState)(),R=new globalThis.Map(r.map(e=>[e.key,e])),z=r.map(e=>e.key).join(`,`),B=u&&JSON.stringify(u),V=()=>{let e=C.current?.getMap();e&&D(i(r.map(t=>({key:t.key,...e.project([t.longitude,t.latitude])})),j))},H=()=>{let e=C.current?.getMap();if(!e)return;let t=e.getBounds(),n=e.getCenter();g({bounds:{south:t.getSouth(),west:t.getWest(),north:t.getNorth(),east:t.getEast()},zoom:e.getZoom()},{latitude:n.lat,longitude:n.lng,zoom:e.getZoom()})},U=()=>{let e=C.current?.getMap();e&&u&&(e.fitBounds(I(u),M),h(),H())};(0,m.useEffect)(V,[z]),(0,m.useEffect)(U,[B]);let W=E.find(e=>_!==void 0&&e.keys.some(e=>_.includes(e)))?.at;return(0,m.useEffect)(()=>{let e=C.current?.getMap(),t=W===void 0?void 0:R.get(W);if(!e||!t||v===0)return;let{y:n}=e.project([t.longitude,t.latitude]),r=e.getContainer().clientHeight-v;n>P&&n<r||e.easeTo({center:[t.longitude,t.latitude],offset:[0,(P-v)/2],duration:300})},[W,v]),(0,w.jsxs)(d,{ref:C,mapLib:f,mapStyle:e,initialViewState:n??{latitude:0,longitude:0,zoom:1},style:{width:`100%`,height:`100%`},onLoad:()=>{let e=C.current.getMap().getContainer();L({area:A(e,`--primary`),chosen:A(e,`--foreground`)}),V(),u?U():H()},onZoomEnd:V,onMoveEnd:H,onClick:b,children:[(0,w.jsx)(a,{showCompass:!1}),(0,w.jsx)(c,{layers:t,below:T}),O&&(0,w.jsx)(k,{points:r,selected:_,colors:O}),s.map(e=>(0,w.jsx)(l,{latitude:e.latitude,longitude:e.longitude,anchor:`center`,children:(0,w.jsx)(`button`,{type:`button`,"aria-label":S(e.count),className:`flex size-10 cursor-pointer items-center justify-center rounded-full border-2 border-background bg-primary text-xs font-semibold text-primary-foreground tabular-nums shadow`,onClick:t=>{t.stopPropagation(),C.current?.getMap().fitBounds(I(e.bounds),N)},children:F().format(e.count)})},`${e.latitude},${e.longitude}`)),E.map(e=>{let t=R.get(e.at);if(!t)return null;let n=_!==void 0&&e.keys.some(e=>_.includes(e)),r=e.keys.every(e=>R.get(e)?.approximate);return(0,w.jsx)(l,{latitude:t.latitude,longitude:t.longitude,anchor:`bottom`,style:{zIndex:+!!n},children:(0,w.jsxs)(`button`,{type:`button`,"aria-label":x(e.keys),"aria-pressed":n,className:`relative block cursor-pointer`,onClick:t=>{t.stopPropagation(),y(e.keys)},children:[(0,w.jsx)(o,{"aria-hidden":!0,"data-approximate":r||void 0,className:p(`size-8 drop-shadow`,r?n?`fill-background text-foreground`:`fill-background text-primary`:n?`fill-foreground text-background`:`fill-primary text-primary-foreground`),strokeWidth:r?2:1.5,strokeDasharray:r?`3 2`:void 0}),e.keys.length>1&&(0,w.jsx)(`span`,{className:`absolute -right-2 -top-1 min-w-5 rounded-full border border-background bg-foreground px-1 text-center text-[11px] font-medium leading-4 text-background tabular-nums`,children:e.keys.length})]})},e.at)})]})};export{L as RecordsMap};
2
- //# debugId=8f8cd404-2daa-4d10-85e8-53e95fd70a6b
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-CR5VJ85Q.js";import{mt as r,o as i}from"./app-CZ9ojEc2.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./maplibre-BlwO7zTh.js";import{t as p}from"./cn-Bi0ZEjD9.js";var m=e(t(),1),h=512,g=85.051129,_=16,v=Array.from({length:23},(e,t)=>t),y=e=>e.type===`LineString`?e.coordinates:e.type===`MultiPolygon`?e.coordinates.flat(2):e.coordinates.flat(),b=e=>{let t=Math.max(-85.051129,Math.min(g,e))*Math.PI/180;return .5-Math.log(Math.tan(Math.PI/4+t/2))/(2*Math.PI)},x=e=>{let t=y(e),n=t.map(([e])=>e),r=t.map(([,e])=>b(e)),i=(Math.max(...n)-Math.min(...n))/360*h,a=(Math.max(...r)-Math.min(...r))*h;return Math.max(i,a)},S=(e,t)=>{let n=e.flatMap(e=>{if(!e.area)return[];let n=e.area.type===`LineString`||e.area.type===`MultiLineString`?`line`:`polygon`;return[{type:`Feature`,geometry:e.area,properties:{key:e.key,kind:n,span:x(e.area),chosen:t?.includes(e.key)??!1}}]});return{type:`FeatureCollection`,features:[...n.filter(e=>!e.properties.chosen),...n.filter(e=>e.properties.chosen)]}},C=e=>[`interpolate`,[`linear`],[`zoom`],...v.flatMap(t=>[t,[`*`,e,[`min`,1,[`max`,0,[`/`,[`-`,[`*`,[`get`,`span`],2**t],_],32]]]]])],w=e(n(),1),T=`position-area-fills`,E=[`==`,[`get`,`kind`],`polygon`],D=[`==`,[`get`,`kind`],`line`],O=(e,t)=>[`case`,[`get`,`chosen`],e,t],k=({points:e,selected:t,colors:n})=>{let r=S(e,t);if(r.features.length===0)return null;let i=[`case`,[`get`,`chosen`],n.chosen,n.area];return(0,w.jsxs)(s,{id:`position-areas`,type:`geojson`,data:r,children:[(0,w.jsx)(u,{id:T,type:`fill`,filter:E,paint:{"fill-color":i,"fill-opacity":C(O(.15,.1))}}),(0,w.jsx)(u,{id:`position-area-outlines`,type:`line`,filter:E,paint:{"line-color":i,"line-width":1.5,"line-dasharray":[3,2],"line-opacity":C(.8)}}),(0,w.jsx)(u,{id:`position-area-lines`,type:`line`,filter:D,layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-color":i,"line-width":6,"line-opacity":C(O(.6,.35))}})]})},A=(e,t)=>{let n=document.createElement(`span`);n.style.color=`var(${t})`,e.append(n);let r=getComputedStyle(n).color;n.remove();let i=document.createElement(`canvas`);i.width=1,i.height=1;let a=i.getContext(`2d`,{willReadFrequently:!0});if(!a)return r;a.fillStyle=r,a.fillRect(0,0,1,1);let[o,s,c,l]=a.getImageData(0,0,1,1).data;return`rgba(${o}, ${s}, ${c}, ${l/255})`},j=28,M={padding:48,maxZoom:15,duration:0},N={padding:48,maxZoom:16,duration:300},P=32,F=()=>r(`compact`,e=>new Intl.NumberFormat(e,{notation:`compact`,maximumFractionDigits:1})),I=e=>[[e.west,e.south],[e.east,e.north]],L=({style:e,layers:t,initial:n,points:r,buckets:s,fit:u,onFitted:h,onMove:g,selected:_,covered:v,onSelect:y,onClear:b,markerLabel:x,bucketLabel:S})=>{let C=(0,m.useRef)(null),[E,D]=(0,m.useState)([]),[O,L]=(0,m.useState)(),R=new globalThis.Map(r.map(e=>[e.key,e])),z=r.map(e=>e.key).join(`,`),B=u&&JSON.stringify(u),V=()=>{let e=C.current?.getMap();e&&D(i(r.map(t=>({key:t.key,...e.project([t.longitude,t.latitude])})),j))},H=()=>{let e=C.current?.getMap();if(!e)return;let t=e.getBounds(),n=e.getCenter();g({bounds:{south:t.getSouth(),west:t.getWest(),north:t.getNorth(),east:t.getEast()},zoom:e.getZoom()},{latitude:n.lat,longitude:n.lng,zoom:e.getZoom()})},U=()=>{let e=C.current?.getMap();e&&u&&(e.fitBounds(I(u),M),h(),H())};(0,m.useEffect)(V,[z]),(0,m.useEffect)(U,[B]);let W=E.find(e=>_!==void 0&&e.keys.some(e=>_.includes(e)))?.at;return(0,m.useEffect)(()=>{let e=C.current?.getMap(),t=W===void 0?void 0:R.get(W);if(!e||!t||v===0)return;let{y:n}=e.project([t.longitude,t.latitude]),r=e.getContainer().clientHeight-v;n>P&&n<r||e.easeTo({center:[t.longitude,t.latitude],offset:[0,(P-v)/2],duration:300})},[W,v]),(0,w.jsxs)(d,{ref:C,mapLib:f,mapStyle:e,initialViewState:n??{latitude:0,longitude:0,zoom:1},style:{width:`100%`,height:`100%`},onLoad:()=>{let e=C.current.getMap().getContainer();L({area:A(e,`--primary`),chosen:A(e,`--foreground`)}),V(),u?U():H()},onZoomEnd:V,onMoveEnd:H,onClick:b,children:[(0,w.jsx)(a,{showCompass:!1}),(0,w.jsx)(c,{layers:t,below:T}),O&&(0,w.jsx)(k,{points:r,selected:_,colors:O}),s.map(e=>(0,w.jsx)(l,{latitude:e.latitude,longitude:e.longitude,anchor:`center`,children:(0,w.jsx)(`button`,{type:`button`,"aria-label":S(e.count),className:`flex size-10 cursor-pointer items-center justify-center rounded-full border-2 border-background bg-primary text-xs font-semibold text-primary-foreground tabular-nums shadow`,onClick:t=>{t.stopPropagation(),C.current?.getMap().fitBounds(I(e.bounds),N)},children:F().format(e.count)})},`${e.latitude},${e.longitude}`)),E.map(e=>{let t=R.get(e.at);if(!t)return null;let n=_!==void 0&&e.keys.some(e=>_.includes(e)),r=e.keys.every(e=>R.get(e)?.approximate);return(0,w.jsx)(l,{latitude:t.latitude,longitude:t.longitude,anchor:`bottom`,style:{zIndex:+!!n},children:(0,w.jsxs)(`button`,{type:`button`,"aria-label":x(e.keys),"aria-pressed":n,className:`relative block cursor-pointer`,onClick:t=>{t.stopPropagation(),y(e.keys)},children:[(0,w.jsx)(o,{"aria-hidden":!0,"data-approximate":r||void 0,className:p(`size-8 drop-shadow`,r?n?`fill-background text-foreground`:`fill-background text-primary`:n?`fill-foreground text-background`:`fill-primary text-primary-foreground`),strokeWidth:r?2:1.5,strokeDasharray:r?`3 2`:void 0}),e.keys.length>1&&(0,w.jsx)(`span`,{className:`absolute -right-2 -top-1 min-w-5 rounded-full border border-background bg-foreground px-1 text-center text-[11px] font-medium leading-4 text-background tabular-nums`,children:e.keys.length})]})},e.at)})]})};export{L as RecordsMap};
2
+ //# debugId=efc079da-2afb-47a5-96d6-d8c79b0be4e1
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-CR5VJ85Q.js";import{B as r,K as i,W as a}from"./vendor-C4-Hop1T.js";import{$ as o,A as s,B as c,C as l,D as u,E as d,F as f,G as p,H as m,I as h,J as g,K as ee,L as te,M as ne,N as re,O as _,P as v,Q as y,R as b,S as x,T as S,U as C,V as w,W as T,X as E,Y as D,Z as O,_ as k,_t as A,a as j,at as M,b as N,c as P,ct as F,d as I,dt as L,et as R,f as z,ft as B,g as V,gt as H,h as U,i as W,it as G,j as K,k as q,l as J,lt as Y,m as X,n as ie,nt as ae,ot as oe,p as se,pt as ce,q as le,r as ue,rt as de,s as fe,st as pe,t as me,tt as he,u as ge,ut as _e,v as ve,vt as ye,w as be,x as xe,y as Se,yt as Z,z as Ce}from"./app-By06l4Sd.js";import{r as we}from"./preload-helper-C24C2MCK.js";import{t as Q}from"./cn-Bi0ZEjD9.js";var $=e(n(),1),Te=({row:e,resource:t,recordKey:n,...r})=>{let i=P(),a=X(),o=t??i?.resource??a?.model.name;if(o===void 0)throw Error(`RecordLink needs a resource outside a list display or a record`);return(0,$.jsx)(b,{to:{kind:`record`,resource:o,key:e?e.key:n},...r})},Ee=({name:e,label:t,options:n,value:r,onChange:i})=>(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":t,className:`flex flex-col gap-2`,children:n.map(t=>(0,$.jsxs)(`label`,{className:Q(`block rounded-lg border p-3 transition-colors has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-primary`,t.disabled?`cursor-default bg-background opacity-60`:t.value===r?`cursor-pointer border-primary bg-primary-soft`:`cursor-pointer bg-background hover:bg-surface`),children:[(0,$.jsx)(`input`,{type:`radio`,name:e,value:t.value,checked:t.value===r,disabled:t.disabled,onChange:()=>i(t.value),className:`sr-only`}),(0,$.jsx)(`span`,{className:Q(`block font-medium`,t.value===r&&`text-primary-text`),children:t.label}),t.description&&(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:t.description})]},t.value))}),De=(e,t,n)=>{let o=M(),s=i(),c=[...new Set(n)].sort();return r({queryKey:pe.pickedLabels(e.name,c.join(`,`)),enabled:c.length>0,placeholderData:a,queryFn:()=>ge(s,o,e,c,t)}).data??new Map},Oe=e(t(),1),ke=e=>{let{resources:t,views:n}=ae(),r=t[e.resource];if(!r)throw Error(`RecordPicker: the app has no resource named "${e.resource}"`);if(r.primaryKey.length!==1)throw Error(`RecordPicker: "${e.resource}" has a composite key, which a picker cannot name`);let i=n[e.resource],a=e.multiple?e.value:e.value===void 0?[]:[e.value],[o,s]=(0,Oe.useState)({}),c=De(r,i,a),l=e=>o[e]??c.get(e)??e,u=(e,t)=>s(n=>({...n,[e]:t}));if(!e.multiple){let{value:t,onChange:n}=e;return(0,$.jsx)(f,{target:r,view:i,value:t??``,label:t===void 0?void 0:l(t),invalid:e.invalid,onChange:(e,t)=>{u(e,t),n(e)}})}let{value:d,onChange:p}=e;return(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(f,{target:r,view:i,value:``,chosen:d,several:!0,invalid:e.invalid,onChange:(e,t)=>{u(e,t),p(d.includes(e)?d.filter(t=>t!==e):[...d,e])}}),d.length>0&&(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:d.map(e=>(0,$.jsx)(J,{label:l(e),onRemove:()=>p(d.filter(t=>t!==e))},e))})]})};export{u as ActionCard,U as ActionInputError,G as ApiProvider,me as App,b as AppLink,ve as AssistantDock,O as AuthLayout,B as Button,K as ChatMessage,s as ChatThread,Ee as Choices,D as CodeForm,S as CompactTable,q as Composer,L as Dialog,x as DiffView,w as Field,d as FieldList,W as Form,A as Input,Z as LogoMark,ne as Markdown,j as MenuSelect,_e as OtpInput,N as PartView,Te as RecordLink,ke as RecordPicker,E as ResendCodeButton,Y as ResponsiveDialog,c as Section,we as Segmented,_ as SidePanel,F as SignInPrompt,H as Spinner,xe as StepList,te as Textarea,y as allowDelayMs,ce as buttonClass,re as definePlugin,v as defineUi,l as diffStats,ie as isConflict,o as isFramed,le as mergeUi,be as parseDiff,T as pluginApi,p as protobaseVersion,g as uiFromModule,C as useApiToken,Ce as useAppAddress,R as useArmedAfterFocus,k as useAssistant,V as useAssistantClient,Se as useBackendData,M as useClient,I as useFacets,ye as useFieldControl,he as useGuardedPress,z as useHistogram,X as useLayoutRecord,h as useList,fe as useListDisplay,de as useMeta,ee as usePlugin,m as useRecord,oe as useResourceClient,se as useSeries,ue as useUpdateRecord};
2
- //# debugId=22017b67-ef23-4422-9890-66d818054903
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-CR5VJ85Q.js";import{B as r,K as i,W as a}from"./vendor-C4-Hop1T.js";import{$ as o,A as s,B as c,C as l,D as u,E as d,F as f,G as p,H as m,I as h,J as g,K as ee,L as te,M as ne,N as re,O as _,P as v,Q as y,R as b,S as x,T as S,U as C,V as w,W as T,X as E,Y as D,Z as O,_ as k,_t as A,a as j,at as M,b as N,c as P,ct as F,d as I,dt as L,et as R,f as z,ft as B,g as V,gt as H,h as U,i as W,it as G,j as K,k as q,l as J,lt as Y,m as X,n as ie,nt as ae,ot as oe,p as se,pt as ce,q as le,r as ue,rt as de,s as fe,st as pe,t as me,tt as he,u as ge,ut as _e,v as ve,vt as ye,w as be,x as xe,y as Se,yt as Z,z as Ce}from"./app-CZ9ojEc2.js";import{r as we}from"./preload-helper-C24C2MCK.js";import{t as Q}from"./cn-Bi0ZEjD9.js";var $=e(n(),1),Te=({row:e,resource:t,recordKey:n,...r})=>{let i=P(),a=X(),o=t??i?.resource??a?.model.name;if(o===void 0)throw Error(`RecordLink needs a resource outside a list display or a record`);return(0,$.jsx)(b,{to:{kind:`record`,resource:o,key:e?e.key:n},...r})},Ee=({name:e,label:t,options:n,value:r,onChange:i})=>(0,$.jsx)(`div`,{role:`radiogroup`,"aria-label":t,className:`flex flex-col gap-2`,children:n.map(t=>(0,$.jsxs)(`label`,{className:Q(`block rounded-lg border p-3 transition-colors has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-primary`,t.disabled?`cursor-default bg-background opacity-60`:t.value===r?`cursor-pointer border-primary bg-primary-soft`:`cursor-pointer bg-background hover:bg-surface`),children:[(0,$.jsx)(`input`,{type:`radio`,name:e,value:t.value,checked:t.value===r,disabled:t.disabled,onChange:()=>i(t.value),className:`sr-only`}),(0,$.jsx)(`span`,{className:Q(`block font-medium`,t.value===r&&`text-primary-text`),children:t.label}),t.description&&(0,$.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:t.description})]},t.value))}),De=(e,t,n)=>{let o=M(),s=i(),c=[...new Set(n)].sort();return r({queryKey:pe.pickedLabels(e.name,c.join(`,`)),enabled:c.length>0,placeholderData:a,queryFn:()=>ge(s,o,e,c,t)}).data??new Map},Oe=e(t(),1),ke=e=>{let{resources:t,views:n}=ae(),r=t[e.resource];if(!r)throw Error(`RecordPicker: the app has no resource named "${e.resource}"`);if(r.primaryKey.length!==1)throw Error(`RecordPicker: "${e.resource}" has a composite key, which a picker cannot name`);let i=n[e.resource],a=e.multiple?e.value:e.value===void 0?[]:[e.value],[o,s]=(0,Oe.useState)({}),c=De(r,i,a),l=e=>o[e]??c.get(e)??e,u=(e,t)=>s(n=>({...n,[e]:t}));if(!e.multiple){let{value:t,onChange:n}=e;return(0,$.jsx)(f,{target:r,view:i,value:t??``,label:t===void 0?void 0:l(t),invalid:e.invalid,onChange:(e,t)=>{u(e,t),n(e)}})}let{value:d,onChange:p}=e;return(0,$.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,$.jsx)(f,{target:r,view:i,value:``,chosen:d,several:!0,invalid:e.invalid,onChange:(e,t)=>{u(e,t),p(d.includes(e)?d.filter(t=>t!==e):[...d,e])}}),d.length>0&&(0,$.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:d.map(e=>(0,$.jsx)(J,{label:l(e),onRemove:()=>p(d.filter(t=>t!==e))},e))})]})};export{u as ActionCard,U as ActionInputError,G as ApiProvider,me as App,b as AppLink,ve as AssistantDock,O as AuthLayout,B as Button,K as ChatMessage,s as ChatThread,Ee as Choices,D as CodeForm,S as CompactTable,q as Composer,L as Dialog,x as DiffView,w as Field,d as FieldList,W as Form,A as Input,Z as LogoMark,ne as Markdown,j as MenuSelect,_e as OtpInput,N as PartView,Te as RecordLink,ke as RecordPicker,E as ResendCodeButton,Y as ResponsiveDialog,c as Section,we as Segmented,_ as SidePanel,F as SignInPrompt,H as Spinner,xe as StepList,te as Textarea,y as allowDelayMs,ce as buttonClass,re as definePlugin,v as defineUi,l as diffStats,ie as isConflict,o as isFramed,le as mergeUi,be as parseDiff,T as pluginApi,p as protobaseVersion,g as uiFromModule,C as useApiToken,Ce as useAppAddress,R as useArmedAfterFocus,k as useAssistant,V as useAssistantClient,Se as useBackendData,M as useClient,I as useFacets,ye as useFieldControl,he as useGuardedPress,z as useHistogram,X as useLayoutRecord,h as useList,fe as useListDisplay,de as useMeta,ee as usePlugin,m as useRecord,oe as useResourceClient,se as useSeries,ue as useUpdateRecord};
2
+ //# debugId=68faf842-f1dd-475a-88e8-42b507c00291
@@ -18,14 +18,14 @@
18
18
  }
19
19
  document.documentElement.dataset.theme = stored === 'light' || stored === 'dark' ? stored : matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
20
20
  </script>
21
- <script type="importmap">{"imports":{"react":"/assets/shared-react-CuZpzdyh.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-Csr2Kx2w.js","react-dom":"/assets/shared-react-dom-BNlY7-7i.js","@protobase/ui":"/assets/shared-protobase-ui-iAXtn7yM.js"}}</script>
22
- <script type="module" crossorigin src="/assets/index-7kqOfiyQ.js"></script>
21
+ <script type="importmap">{"imports":{"react":"/assets/shared-react-CuZpzdyh.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-Csr2Kx2w.js","react-dom":"/assets/shared-react-dom-BNlY7-7i.js","@protobase/ui":"/assets/shared-protobase-ui-Bo-vhC8d.js"}}</script>
22
+ <script type="module" crossorigin src="/assets/index-BiIpXkA0.js"></script>
23
23
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/react-CR5VJ85Q.js">
25
25
  <link rel="modulepreload" crossorigin href="/assets/vendor-C4-Hop1T.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/cn-Bi0ZEjD9.js">
27
27
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-C24C2MCK.js">
28
- <link rel="modulepreload" crossorigin href="/assets/app-By06l4Sd.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/app-CZ9ojEc2.js">
29
29
  <link rel="stylesheet" crossorigin href="/assets/app-GUjJKojE.css">
30
30
  <link rel="stylesheet" crossorigin href="/assets/index-DGJkc-U0.css">
31
31
  <link rel="stylesheet" href="/protobase.theme.css">
@@ -1,5 +1,5 @@
1
1
  {
2
- "protobase": "0.44.4",
2
+ "protobase": "0.45.0",
3
3
  "pluginApi": 1,
4
4
  "paths": [
5
5
  "/index.html",
@@ -1,5 +1,5 @@
1
- const cacheName = "protobase-shell-61849c0fdbbff2fc"
2
- const precache = ["/index.html","/assets/shared-react-CuZpzdyh.js","/assets/shared-react-jsx-runtime-Csr2Kx2w.js","/assets/shared-react-dom-BNlY7-7i.js","/assets/shared-protobase-ui-iAXtn7yM.js","/assets/index-7kqOfiyQ.js","/assets/rolldown-runtime-hePW80VL.js","/assets/react-CR5VJ85Q.js","/assets/vendor-C4-Hop1T.js","/assets/cn-Bi0ZEjD9.js","/assets/preload-helper-C24C2MCK.js","/assets/app-By06l4Sd.js","/assets/app-GUjJKojE.css","/assets/index-DGJkc-U0.css","/protobase.theme.css","/protobase.favicon.svg"]
1
+ const cacheName = "protobase-shell-d20d9f48e93ddf8c"
2
+ const precache = ["/index.html","/assets/shared-react-CuZpzdyh.js","/assets/shared-react-jsx-runtime-Csr2Kx2w.js","/assets/shared-react-dom-BNlY7-7i.js","/assets/shared-protobase-ui-Bo-vhC8d.js","/assets/index-BiIpXkA0.js","/assets/rolldown-runtime-hePW80VL.js","/assets/react-CR5VJ85Q.js","/assets/vendor-C4-Hop1T.js","/assets/cn-Bi0ZEjD9.js","/assets/preload-helper-C24C2MCK.js","/assets/app-CZ9ojEc2.js","/assets/app-GUjJKojE.css","/assets/index-DGJkc-U0.css","/protobase.theme.css","/protobase.favicon.svg"]
3
3
  const revalidated = ["/protobase.theme.css","/protobase.favicon.svg"]
4
4
 
5
5
  const fromCache = (request) =>