@kizenapps/cli 0.9.0 → 0.10.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.
- package/dist/index.js +101 -33
- package/dist/index.js.map +1 -1
- package/dist/viewer/assets/AppDetailPage-ObugMPkn.js +1 -0
- package/dist/viewer/assets/BootstrapContext-CEWgv2oI.js +1 -0
- package/dist/viewer/assets/Card-BSwG5koM.js +1 -0
- package/dist/viewer/assets/ConfigurationPage-SnFNzZgJ.js +1 -0
- package/dist/viewer/assets/CredentialsContext-BLZX6RwF.js +1 -0
- package/dist/viewer/assets/DevSidebar-BiROAoKF.js +1 -0
- package/dist/viewer/assets/SandboxPage-BFVVe-i3.js +1 -0
- package/dist/viewer/assets/SidebarContext-Byo6PYOF.js +1 -0
- package/dist/viewer/assets/VersionsPage-DOd2Hv8M.js +1 -0
- package/dist/viewer/assets/configStorage-Bb-A9Nvj.js +14 -0
- package/dist/viewer/assets/{fa-core-BU3ZZt7W.js → fa-core-mHW_3JUd.js} +1 -1
- package/dist/viewer/assets/index-B-4D4w_w.js +5 -0
- package/dist/viewer/assets/index-D6Un_G7k.css +2 -0
- package/dist/viewer/assets/{react-C90crogl.js → react-D_K8ni3_.js} +1 -1
- package/dist/viewer/assets/validIcons-TcFXfn-E.js +1 -0
- package/dist/viewer/index.html +8 -5
- package/package.json +5 -1
- package/dist/chromium-extension/manifest.json +0 -17
- package/dist/chromium-extension/rules.json +0 -17
- package/dist/chunk-4OYGMEFM.js +0 -3675
- package/dist/chunk-4OYGMEFM.js.map +0 -1
- package/dist/chunk-4Z6S6LWP.js +0 -6134
- package/dist/chunk-4Z6S6LWP.js.map +0 -1
- package/dist/chunk-5WPGAZLP.js +0 -6136
- package/dist/chunk-5WPGAZLP.js.map +0 -1
- package/dist/chunk-6XGFZ4W5.js +0 -3673
- package/dist/chunk-6XGFZ4W5.js.map +0 -1
- package/dist/chunk-HJPLDI45.js +0 -6134
- package/dist/chunk-HJPLDI45.js.map +0 -1
- package/dist/chunk-KMKDY2I6.js +0 -46
- package/dist/chunk-KMKDY2I6.js.map +0 -1
- package/dist/chunk-LSHHXCC6.js +0 -3639
- package/dist/chunk-LSHHXCC6.js.map +0 -1
- package/dist/chunk-NNDSADQG.js +0 -3641
- package/dist/chunk-NNDSADQG.js.map +0 -1
- package/dist/chunk-SEGVTWSK.js +0 -44
- package/dist/chunk-SEGVTWSK.js.map +0 -1
- package/dist/chunk-ZWE3DS7E.js +0 -39
- package/dist/chunk-ZWE3DS7E.js.map +0 -1
- package/dist/devtools-HNR7DD7Q.js +0 -68
- package/dist/devtools-HNR7DD7Q.js.map +0 -1
- package/dist/devtools-HW3UQAHH.js +0 -69
- package/dist/devtools-HW3UQAHH.js.map +0 -1
- package/dist/devtools-KXIXZGBY.js +0 -64
- package/dist/devtools-KXIXZGBY.js.map +0 -1
- package/dist/devtools-PDXM3L35.js +0 -67
- package/dist/devtools-PDXM3L35.js.map +0 -1
- package/dist/devtools-SDEASRYI.js +0 -66
- package/dist/devtools-SDEASRYI.js.map +0 -1
- package/dist/devtools-XBEEGBQ4.js +0 -66
- package/dist/devtools-XBEEGBQ4.js.map +0 -1
- package/dist/dist-4P5P64FK.js +0 -8474
- package/dist/dist-4P5P64FK.js.map +0 -1
- package/dist/dist-AVHDSU4X.js +0 -137
- package/dist/dist-AVHDSU4X.js.map +0 -1
- package/dist/dist-C3F6UOWF.js +0 -8472
- package/dist/dist-C3F6UOWF.js.map +0 -1
- package/dist/dist-NUJOSN7W.js +0 -8472
- package/dist/dist-NUJOSN7W.js.map +0 -1
- package/dist/dist-QHDMIBVE.js +0 -135
- package/dist/dist-QHDMIBVE.js.map +0 -1
- package/dist/dist-ZIZQOSY3.js +0 -135
- package/dist/dist-ZIZQOSY3.js.map +0 -1
- package/dist/electron/icon.png +0 -0
- package/dist/electron/main.js +0 -201
- package/dist/electron/main.js.map +0 -1
- package/dist/electron/preload.cjs +0 -9
- package/dist/gzip-size-K37OQCQ2.js +0 -137
- package/dist/gzip-size-K37OQCQ2.js.map +0 -1
- package/dist/gzip-size-QRGIYYEQ.js +0 -137
- package/dist/gzip-size-QRGIYYEQ.js.map +0 -1
- package/dist/gzip-size-SHZBT5GU.js +0 -139
- package/dist/gzip-size-SHZBT5GU.js.map +0 -1
- package/dist/nwjs/shell/icon.png +0 -0
- package/dist/nwjs/shell/index.html +0 -200
- package/dist/nwjs/shell/package.json +0 -16
- package/dist/viewer/assets/fa-core-DAYjf9Yn.js +0 -558
- package/dist/viewer/assets/fa-core-Ff8SZmm_.js +0 -558
- package/dist/viewer/assets/index-47Vh9MH0.js +0 -17
- package/dist/viewer/assets/index-6uunWX8M.js +0 -17
- package/dist/viewer/assets/index-B48OpZHg.js +0 -17
- package/dist/viewer/assets/index-BFfw7eD7.js +0 -17
- package/dist/viewer/assets/index-BFyUUb06.js +0 -17
- package/dist/viewer/assets/index-BL-Yu7Bf.js +0 -17
- package/dist/viewer/assets/index-BUmv8vz7.js +0 -17
- package/dist/viewer/assets/index-BZ4HmEz8.js +0 -17
- package/dist/viewer/assets/index-BZIXccTd.js +0 -17
- package/dist/viewer/assets/index-Bk9hnfnO.js +0 -17
- package/dist/viewer/assets/index-C0SIHm9A.js +0 -17
- package/dist/viewer/assets/index-CDd-WK6Y.js +0 -17
- package/dist/viewer/assets/index-CDxQqP40.js +0 -17
- package/dist/viewer/assets/index-CGJzvpL5.js +0 -17
- package/dist/viewer/assets/index-CIarX3Lt.js +0 -17
- package/dist/viewer/assets/index-CIfVP45E.js +0 -17
- package/dist/viewer/assets/index-CJeb7uFu.css +0 -2
- package/dist/viewer/assets/index-CbwLb2S_.js +0 -17
- package/dist/viewer/assets/index-CsfWgoID.js +0 -17
- package/dist/viewer/assets/index-CvWmkIY5.js +0 -17
- package/dist/viewer/assets/index-Cy-weKfG.css +0 -2
- package/dist/viewer/assets/index-Cym12l2M.js +0 -17
- package/dist/viewer/assets/index-D0W0oANg.js +0 -17
- package/dist/viewer/assets/index-DCPtqd3W.js +0 -17
- package/dist/viewer/assets/index-DF_zYdLw.js +0 -17
- package/dist/viewer/assets/index-DGqxQcUx.js +0 -17
- package/dist/viewer/assets/index-DK0OVb7V.js +0 -17
- package/dist/viewer/assets/index-DKjVFdzw.js +0 -17
- package/dist/viewer/assets/index-DLhj0I_2.js +0 -17
- package/dist/viewer/assets/index-DPS_ZjbM.js +0 -17
- package/dist/viewer/assets/index-DSbHkhcS.js +0 -17
- package/dist/viewer/assets/index-DTbmNtEU.js +0 -17
- package/dist/viewer/assets/index-DUYd6RpI.js +0 -17
- package/dist/viewer/assets/index-DZwYe1wZ.css +0 -2
- package/dist/viewer/assets/index-DkRokbYc.js +0 -17
- package/dist/viewer/assets/index-DtOWzkR5.js +0 -17
- package/dist/viewer/assets/index-DuvXujkm.js +0 -17
- package/dist/viewer/assets/index-Dv0mX-oM.js +0 -17
- package/dist/viewer/assets/index-DyXisBY9.css +0 -2
- package/dist/viewer/assets/index-Nm1xKWTO.js +0 -17
- package/dist/viewer/assets/index-ZBdAq6dF.js +0 -17
- package/dist/viewer/assets/index-ZOxL_JJZ.js +0 -17
- package/dist/viewer/assets/index-kMMOwjlY.js +0 -17
- package/dist/viewer/assets/index-ov2oU6RI.js +0 -17
- package/dist/viewer/assets/index-uF6u0kT8.js +0 -17
- package/dist/viewer/assets/index-xbDHMSaa.css +0 -2
- package/dist/viewer/assets/react-D7PmSb6e.js +0 -9
- package/dist/viewer/assets/react-DIjeYlvh.js +0 -9
- /package/dist/viewer/assets/{fa-pro-icons-D4afj0tU.js → fa-pro-icons-CIQGXozY.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,D as t,O as n,T as r,c as i,d as a,f as o,l as s,n as c,v as l,x as u}from"./fa-core-mHW_3JUd.js";import{n as d,r as f,t as p,z as m}from"./Card-BSwG5koM.js";import{i as h,n as g,r as _,t as v}from"./validIcons-TcFXfn-E.js";var y=n(),b=()=>{let{apiName:n}=m({strict:!1}),{data:b,isLoading:x,isError:S}=f(d);if(x)return(0,y.jsx)(p,{children:(0,y.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})});if(S)return(0,y.jsx)(p,{children:(0,y.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json.`})});let C=b?.find(e=>e.api_name===n);if(!C)return(0,y.jsx)(p,{children:(0,y.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`No app found with api_name`,` `,(0,y.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:n}),`.`]})});let{floating_frames:w,data_adornments:T,routable_pages:E,toolbar_items:D,js_action_templates:O,route_scripts:k,object_settings_menu_items:A,automation_action_configs:j,calendar_sources:M}=C.artifacts,N=w.length>0||T.length>0||E.length>0||D.length>0||O.length>0||k.length>0||A.length>0||j.length>0||M.length>0,P=C.setup_assistant?.fields??[],F=C.user_setup_assistant?.fields??[];return(0,y.jsxs)(`div`,{className:`space-y-4 text-[13px]`,children:[(0,y.jsx)(p,{children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h1`,{className:`text-lg font-bold leading-tight text-neutral-900`,children:C.name}),(0,y.jsx)(`p`,{className:`mt-0.5 font-mono text-[11px] text-neutral-400`,children:C.api_name})]}),C.description&&(0,y.jsx)(`p`,{className:`text-[13px] leading-relaxed text-neutral-600`,children:C.description}),(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[C.version&&(0,y.jsxs)(`span`,{className:`rounded bg-neutral-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-neutral-600`,children:[`v`,C.version]}),C.engine&&(0,y.jsxs)(`span`,{className:`rounded bg-blue-50 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-blue-600`,children:[`engine: `,C.engine]}),(0,y.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${C.published?`bg-green-100 text-green-700`:`bg-neutral-100 text-neutral-500`}`,children:C.published?`published`:`unpublished`}),C.release_environments?.map(e=>(0,y.jsx)(`span`,{className:`rounded bg-violet-50 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-violet-600`,children:e},e)),C.block_loading_for_setup&&(0,y.jsx)(`span`,{className:`rounded bg-amber-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-amber-700`,children:`blocks app loading`}),C.developer_business_id&&(typeof C.developer_business_id==`string`?(0,y.jsxs)(`span`,{className:`rounded bg-neutral-100 px-2 py-0.5 font-mono text-[11px] tracking-wide text-neutral-500`,children:[`biz: `,C.developer_business_id]}):Object.entries(C.developer_business_id).map(([e,t])=>(0,y.jsxs)(`span`,{className:`rounded bg-neutral-100 px-2 py-0.5 font-mono text-[11px] tracking-wide text-neutral-500`,children:[`biz (`,e,`): `,t]},e)))]})]})}),N?(0,y.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[w.length>0&&(0,y.jsxs)(p,{children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,y.jsx)(t,{icon:r,className:`text-[12px] text-neutral-400`}),(0,y.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Floating Frames`}),(0,y.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:w.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:w.map((e,t)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,y.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.default_position&&(0,y.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:e.default_position})]},t))})]}),T.length>0&&(0,y.jsxs)(p,{children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,y.jsx)(t,{icon:u,className:`text-[12px] text-neutral-400`}),(0,y.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Data Adornments`}),(0,y.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:T.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:T.map((e,n)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[e.config.color&&(0,y.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.config.color}}),e.config.icon&&(h[e.config.icon]?(0,y.jsx)(t,{icon:h[e.config.icon],className:`shrink-0 text-[12px] text-neutral-500`}):(0,y.jsx)(`span`,{className:`shrink-0 rounded px-1 font-mono text-[10px] ${v.has(e.config.icon)||_.has(e.config.icon)?`bg-neutral-100 text-neutral-400`:`bg-amber-100 text-amber-600`}`,children:e.config.icon})),(0,y.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:e.config.tooltip||e.field_type}),(0,y.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.field_type})]},n))})]}),E.length>0&&(0,y.jsxs)(p,{children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,y.jsx)(t,{icon:a,className:`text-[12px] text-neutral-400`}),(0,y.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Routable Pages`}),(0,y.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:E.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:E.map((e,t)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,y.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.iframe_url&&(0,y.jsx)(`span`,{className:`shrink-0 rounded bg-purple-100 px-1.5 py-0.5 text-[10px] font-semibold text-purple-600`,children:`iframe`})]},t))})]}),D.length>0&&(0,y.jsxs)(p,{children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,y.jsx)(t,{icon:e,className:`text-[12px] text-neutral-400`}),(0,y.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Toolbar Items`}),(0,y.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:D.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:D.map((e,n)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[e.color&&(0,y.jsx)(`span`,{className:`h-3 w-4 shrink-0 rounded-sm border border-black/10`,style:{backgroundColor:e.color}}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.label}),(0,y.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.icon&&(h[e.icon]?(0,y.jsx)(t,{icon:h[e.icon],className:`shrink-0 text-[12px] text-neutral-400`}):(0,y.jsx)(`span`,{className:`shrink-0 rounded px-1 font-mono text-[10px] ${v.has(e.icon)||_.has(e.icon)?`bg-neutral-100 text-neutral-400`:`bg-amber-100 text-amber-600`}`,children:e.icon}))]},n))})]}),O.length>0&&(0,y.jsxs)(p,{children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,y.jsx)(t,{icon:i,className:`text-[12px] text-neutral-400`}),(0,y.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`JS Action Templates`}),(0,y.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:O.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:O.map((e,t)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,y.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.hint_object_name&&(0,y.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:e.hint_object_name})]},t))})]}),k.length>0&&(0,y.jsxs)(p,{children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,y.jsx)(t,{icon:s,className:`text-[12px] text-neutral-400`}),(0,y.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Route Scripts`}),(0,y.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:k.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:k.map((e,t)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name||e.api_name}),e.name&&(0,y.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]}),e.routes.length>0&&(0,y.jsxs)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 text-[10px] text-neutral-500`,children:[e.routes.length,` route`,e.routes.length===1?``:`s`]})]},t))})]}),A.length>0&&(0,y.jsxs)(p,{children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,y.jsx)(t,{icon:o,className:`text-[12px] text-neutral-400`}),(0,y.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Object Settings`}),(0,y.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:A.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:A.map((e,t)=>(0,y.jsx)(`div`,{className:`flex items-center gap-2 py-1.5`,children:(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.label}),(0,y.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]})},t))})]}),j.length>0&&(0,y.jsxs)(p,{children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,y.jsx)(t,{icon:l,className:`text-[12px] text-neutral-400`}),(0,y.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Automation Actions`}),(0,y.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:j.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:j.map((e,t)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,y.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.action_step_api_name})]}),e.action_type&&(0,y.jsx)(`span`,{className:`shrink-0 rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-semibold text-blue-600`,children:e.action_type})]},t))})]}),M.length>0&&(0,y.jsxs)(p,{children:[(0,y.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,y.jsx)(t,{icon:c,className:`text-[12px] text-neutral-400`}),(0,y.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Calendar Sources`}),(0,y.jsx)(`span`,{className:`ml-auto rounded bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold text-neutral-500`,children:M.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:M.map((e,t)=>(0,y.jsx)(`div`,{className:`flex items-center gap-2 py-1.5`,children:(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`truncate text-neutral-900`,children:e.name}),(0,y.jsx)(`div`,{className:`truncate font-mono text-[11px] text-neutral-400`,children:e.api_name})]})},t))})]})]}):(0,y.jsx)(p,{children:(0,y.jsx)(`p`,{className:`text-[13px] text-neutral-400`,children:`No plugin assets defined.`})}),(P.length>0||F.length>0)&&(0,y.jsxs)(p,{children:[(0,y.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Setup Assistant`}),P.length>0&&(0,y.jsxs)(`div`,{className:`mb-3`,children:[(0,y.jsx)(`div`,{className:`mb-1 text-[11px] text-neutral-400`,children:`Admin setup fields`}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:P.map((e,t)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:e.label??e.key}),(0,y.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.type})]},t))})]}),F.length>0&&(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`mb-1 text-[11px] text-neutral-400`,children:`User setup fields`}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:F.map((e,t)=>(0,y.jsxs)(`div`,{className:`flex items-center gap-2 py-1.5`,children:[(0,y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-neutral-900`,children:e.label??e.key}),(0,y.jsx)(`span`,{className:`shrink-0 rounded bg-neutral-100 px-1.5 py-0.5 font-mono text-[10px] text-neutral-500`,children:e.type})]},t))})]})]}),C.releaseNotes&&(0,y.jsxs)(p,{children:[(0,y.jsx)(`div`,{className:`mb-3 text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Release Notes`}),(0,y.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-[12px] leading-relaxed text-neutral-700`,children:C.releaseNotes})]}),(0,y.jsx)(p,{children:(0,y.jsxs)(`details`,{children:[(0,y.jsxs)(`summary`,{className:`cursor-pointer select-none text-[11px] font-semibold uppercase tracking-widest text-neutral-400`,children:[`Icon Reference (`,g.length,` icons)`]}),(0,y.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-1`,children:g.map(e=>(0,y.jsxs)(`div`,{className:`flex w-32 items-center gap-1.5 rounded px-1.5 py-1 hover:bg-black/5`,title:e,children:[h[e]?(0,y.jsx)(t,{icon:h[e],className:`w-3.5 shrink-0 text-[13px] text-neutral-500`}):_.has(e)?(0,y.jsx)(`span`,{className:`w-3.5 shrink-0 text-center font-mono text-[9px] text-neutral-400`,children:`K`}):null,(0,y.jsx)(`span`,{className:`truncate font-mono text-[10px] text-neutral-500`,children:e})]},e))})]})})]})};export{b as AppDetailPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{k as t}from"./fa-core-mHW_3JUd.js";import{A as n,C as r,D as i,E as a,I as o,L as s,N as c,O as l,R as u,S as d,T as f,_ as p,b as m,g as h,j as g,k as _,v,w as y,x as b,y as x}from"./Card-BSwG5koM.js";import{r as S}from"./CredentialsContext-BLZX6RwF.js";function C(e){return{onFetch:(t,n)=>{let i=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],s=t.state.data?.pageParams||[],c={pages:[],pageParams:[]},l=0,u=async()=>{let n=!1,u=e=>{b(e,()=>t.signal,()=>n=!0)},f=y(t.options,t.fetchOptions),p=async(e,i,a)=>{if(n)return Promise.reject();if(i==null&&e.pages.length)return Promise.resolve(e);let o=await f((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:a?`backward`:`forward`,meta:t.options.meta};return u(e),e})()),{maxPages:s}=t.options,c=a?r:d;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,i,s)}};if(a&&o.length){let e=a===`backward`,t=e?T:w,n={pages:o,pageParams:s};c=await p(n,t(i,n),e)}else{let t=e??o.length;do{let e=l===0?s[0]??i.initialPageParam:w(i,c);if(l>0&&e==null)break;c=await p(c,e),l++}while(l<t)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function w(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function T(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var E=class extends p{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||D(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=v({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),m.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function D(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var O=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new E({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=k(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=k(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=k(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=k(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){m.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>l(t,e))}findAll(e={}){return this.getAll().filter(t=>l(e,t))}notify(e){m.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return m.batch(()=>Promise.all(e.map(e=>e.continue().catch(n))))}};function k(e){return e.options.scope?.id}var A=class extends u{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,a=t.queryHash??i(r,t),o=this.get(a);return o||(o=new h({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){m.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>_(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>_(e,t)):t}notify(e){m.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){m.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){m.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},j=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new A,this.#t=e.mutationCache||new O,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=s.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=x.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(c(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=f(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return m.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;m.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return m.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t},i=m.batch(()=>this.#e.findAll(e).map(e=>e.cancel(r)));return Promise.all(i).then(n).catch(n)}invalidateQueries(e,t={}){return m.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0},i=m.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(i).then(n)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(c(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n).catch(n)}fetchInfiniteQuery(e){return e.behavior=C(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n).catch(n)}ensureInfiniteQueryData(e){return e.behavior=C(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return x.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(a(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{g(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(a(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{g(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=i(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===o&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},M=e(t(),1),N={go:`https://app.go.kizen.com/api`,fmo:`https://app.fmo.kizen.com/api`,staging:`https://staging.kizen.dev/api`,integration:`https://integration.kizen.dev/api`,test1:`https://test1.kizen.dev/api`},P={go:`https://go.kizen.com`,fmo:`https://fmo.kizen.com`,staging:`https://v2.staging.kizen.com`,integration:`https://v2.integration.kizen.dev`,test1:`https://test1.kizen.dev`};function F(){let{apiKey:e,userId:t,businessId:n,environment:r}=S(),i=N[r];return(0,M.useCallback)((r,a={})=>fetch(`/api/proxy${r}`,{...a,headers:{"x-proxy-target":i,"X-API-KEY":e,"X-USER-ID":t,"X-BUSINESS-ID":n,...a.headers}}),[i,e,t,n])}var I=(0,M.createContext)(void 0),L=()=>(0,M.useContext)(I);export{F as a,N as i,L as n,j as o,P as r,D as s,I as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./rolldown-runtime-DF2fYuay.js";import{O as n,k as r}from"./fa-core-mHW_3JUd.js";function i(e){return e[e.length-1]}function a(e){return typeof e==`function`}function o(e,t){return a(e)?e(t):e}var s=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,l=()=>Object.create(null),u=(e,t)=>d(e,t,l);function d(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=h(e)&&h(i);if(!a&&!(p(e)&&p(i)))return i;let o=a?e:f(e);if(!o)return i;let c=a?i:f(i);if(!c)return i;let l=o.length,u=c.length,m=a?Array(u):n(),g=0;for(let t=0;t<u;t++){let o=a?t:c[t],u=e[o],f=i[o];if(u===f){m[o]=u,(a?t<l:s.call(e,o))&&g++;continue}if(u===null||f===null||typeof u!=`object`||typeof f!=`object`){m[o]=f;continue}let p=d(u,f,n,r+1);m[o]=p,p===u&&g++}return l===u&&g===l?e:m}function f(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!c.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!c.call(e,t))return!1;r.push(t)}return r}function p(e){if(!m(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!m(n)||!n.hasOwnProperty(`isPrototypeOf`))}function m(e){return Object.prototype.toString.call(e)===`[object Object]`}function h(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!g(e[r],t[r],n))return!1;return!0}if(p(e)&&p(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!g(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!g(e[o],t[o],n)))return!1;return i===a}return!1}function _(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function v(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function y(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function b(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return y(t)}var x=[`http:`,`https:`,`mailto:`,`tel:`];function ee(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function te(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=b(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=b(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function ne(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function re(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ie(){throw Error(`Invariant failed`)}var S=e(r(),1),C=S.createContext(null);function w(e){return S.useContext(C)}var ae=S.createContext(void 0),oe=S.createContext(void 0),se=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ce=t(((e,t)=>{t.exports=se()})),le=t((e=>{var t=r(),n=ce();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),ue=t(((e,t)=>{t.exports=le()}))();function de(e,t){return e===t}function fe(e,t,n=de){let r=(0,S.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,S.useCallback)(()=>e?.get(),[e]);return(0,ue.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var pe={state:void 0,get:()=>void 0,subscribe:()=>()=>{}};function T(e){let t=w(),n=S.useContext(e.from?oe:ae),r=e.from??n,i=r?e.from?t.stores.getMatchStoreByRouteId(r):t.stores.activeMatchStoresById.get(r):void 0,a=S.useRef(void 0);return fe(i??pe,n=>{if((e.shouldThrow??!0)&&!n&&ie(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=d(a.current,r);return a.current=e,e}return r})}function me(e){return T({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}var E=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},D=new class extends E{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},he={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},O=new class{#e=he;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ge(e){setTimeout(e,0)}var _e=typeof window>`u`||`Deno`in globalThis;function k(){}function ve(e,t){return typeof e==`function`?e(t):e}function A(e){return typeof e==`number`&&e>=0&&e!==1/0}function j(e,t){return Math.max(e+(t||0)-Date.now(),0)}function M(e,t){return typeof e==`function`?e(t):e}function N(e,t){return typeof e==`function`?e(t):e}function ye(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==xe(o,t.options))return!1}else if(!F(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function be(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(P(t.options.mutationKey)!==P(a))return!1}else if(!F(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function xe(e,t){return(t?.queryKeyHashFn||P)(e)}function P(e){return JSON.stringify(e,(e,t)=>z(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function F(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>F(e[n],t[n])):!1}var Se=Object.prototype.hasOwnProperty;function I(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=R(e)&&R(t);if(!r&&!(z(e)&&z(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Se.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=I(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function L(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function R(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function z(e){if(!Ce(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ce(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ce(e){return Object.prototype.toString.call(e)===`[object Object]`}function we(e){return new Promise(t=>{O.setTimeout(t,e)})}function B(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:I(e,t)}function Te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ee(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var V=Symbol();function H(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===V?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function U(e,t){return typeof e==`function`?e(...t):!!e}function De(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var W=(()=>{let e=()=>_e;return{isServer(){return e()},setIsServer(t){e=t}}})();function G(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Oe=ge;function ke(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Oe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var K=ke(),q=new class extends E{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Ae(e){return Math.min(1e3*2**e,3e4)}function je(e){return(e??`online`)===`online`?q.isOnline():!0}var J=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Me(e){let t=!1,n=0,r,i=G(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new J(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>D.isFocused()&&(e.networkMode===`always`||q.isOnline())&&e.canRun(),u=()=>je(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(W.isServer()?0:3),o=e.retryDelay??Ae,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),we(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Ne=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),A(this.gcTime)&&(this.#e=O.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(W.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(O.clearTimeout(this.#e),this.#e=void 0)}},Pe=class extends Ne{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Le(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Le(this.options);e.data!==void 0&&(this.setState(Ie(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=B(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(k).catch(k):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>N(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===V||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>M(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!j(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=H(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Me({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof J&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof J){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Fe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ie(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),K.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Fe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:je(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ie(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Le(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Re=class extends E{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=G(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Be(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Y(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Y(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof N(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!L(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ve(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||N(this.options.enabled,this.#t)!==N(t.enabled,this.#t)||M(this.options.staleTime,this.#t)!==M(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||N(this.options.enabled,this.#t)!==N(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return He(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(k)),t}#g(){this.#b();let e=M(this.options.staleTime,this.#t);if(W.isServer()||this.#r.isStale||!A(e))return;let t=j(this.#r.dataUpdatedAt,e)+1;this.#d=O.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(W.isServer()||N(this.options.enabled,this.#t)===!1||!A(this.#p)||this.#p===0)&&(this.#f=O.setInterval(()=>{(this.options.refetchIntervalInBackground||D.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(O.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(O.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Be(e,t),o=i&&Ve(e,n,t,r);(a||o)&&(l={...l,...Fe(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=B(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=B(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:X(e,t),refetch:this.refetch,promise:this.#o,isEnabled:N(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=G())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!L(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){K.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function ze(e,t){return N(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function Be(e,t){return ze(e,t)||e.state.data!==void 0&&Y(e,t,t.refetchOnMount)}function Y(e,t,n){if(N(t.enabled,e)!==!1&&M(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&X(e,t)}return!1}function Ve(e,t,n,r){return(e!==t||N(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&X(e,n)}function X(e,t){return N(t.enabled,e)!==!1&&e.isStaleByTime(M(t.staleTime,e))}function He(e,t){return!L(e.getCurrentResult(),t)}var Ue=n(),Z=S.createContext(void 0),Q=e=>{let t=S.useContext(Z);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},We=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Ue.jsx)(Z.Provider,{value:e,children:t})),Ge=S.createContext(!1),Ke=()=>S.useContext(Ge);Ge.Provider;function qe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Je=S.createContext(qe()),Ye=()=>S.useContext(Je),Xe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?U(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ze=e=>{S.useEffect(()=>{e.clearReset()},[e])},Qe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||U(n,[e.error,r])),$e=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},et=(e,t)=>e.isLoading&&e.isFetching&&!t,tt=(e,t)=>e?.suspense&&t.isPending,$=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function nt(e,t,n){let r=Ke(),i=Ye(),a=Q(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,$e(o),Xe(o,i,s),Ze(i);let c=!a.getQueryCache().get(o.queryHash),[l]=S.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(e=>{let t=d?l.subscribe(K.batchCalls(e)):k;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),S.useEffect(()=>{l.setOptions(o)},[o,l]),tt(o,u))throw $(o,l,i);if(Qe({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!W.isServer()&&et(u,r)&&(c?$(o,l,i):s?.promise)?.catch(k).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function rt(e,t){return nt(e,Re,t)}var it={queryKey:[`bundle`],queryFn:async()=>{let e=await fetch(`/api/bundle`);if(!e.ok)throw Error(`Failed to fetch bundle.json`);return e.json()}},at=({children:e,className:t=``})=>(0,Ue.jsx)(`div`,{className:`rounded-xl bg-white p-5 shadow-sm ${t}`,children:e});export{ee as $,k as A,T as B,Ee as C,xe as D,P as E,U as F,ie as G,ae as H,V as I,_ as J,x as K,D as L,I as M,M as N,be as O,L as P,o as Q,E as R,Te as S,ve as T,w as U,fe as V,C as W,g as X,te as Y,ne as Z,Ne as _,$ as a,K as b,Qe as c,Ke as d,p as et,Z as f,Pe as g,Re as h,$e as i,d as it,F as j,ye as k,Ze as l,Q as m,it as n,i as nt,tt as o,We as p,re as q,rt as r,u as rt,Xe as s,at as t,v as tt,Ye as u,Me as v,H as w,De as x,q as y,me as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{D as t,O as n,b as r,k as i}from"./fa-core-mHW_3JUd.js";import{n as a,r as o,t as s,z as c}from"./Card-BSwG5koM.js";import{a as l,i as u,n as d}from"./BootstrapContext-CEWgv2oI.js";import{_ as f,a as p,b as m,c as h,i as g,l as _,n as v,o as y,r as b,s as x,t as S,u as C,v as w,y as T}from"./configStorage-Bb-A9Nvj.js";import{r as E}from"./CredentialsContext-BLZX6RwF.js";var D=e(i(),1),O=n(),k=({field:e,disabled:t=!1})=>{let{state:n,setState:r,evaluateExpression:i,shouldHideField:a,getFieldErrorState:o,registerFieldResetter:s,afterFieldChange:c,disabledKeys:l}=f(),u=n[e.key]?.value??e.default??!1,d=u===!0||u===`true`,p=l.includes(e.key)||t,m=(0,D.useCallback)(t=>{r(n=>({...n,[e.key]:{type:`boolean`,value:t}})),c(e.key)},[e.key,r,c]);if((0,D.useEffect)(()=>{s(e.key,()=>{m(void 0)})},[e.key,s,m]),(0,D.useEffect)(()=>{e.when&&i(e.when,e.key)},[e.when,i,e.key]),a(e.key))return null;let h=o(e.key);return(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>{m(e.target.checked)},disabled:p,className:`h-3.5 w-3.5 cursor-pointer accent-blue-600`}),(0,O.jsxs)(`span`,{className:`text-[13px] ${p?`text-neutral-400`:`text-neutral-700`}`,children:[e.label,e.required&&(0,O.jsx)(`span`,{className:`text-red-500 ml-0.5`,children:`*`})]}),e.tooltip&&(0,O.jsx)(`span`,{className:`text-[11px] text-neutral-400`,title:e.tooltip,children:`?`})]}),h?.showMessage&&h.message&&(0,O.jsx)(`span`,{className:`text-[11px] text-red-500`,children:h.message})]})},A=({field:e,pluginApiName:t,disabled:n=!1})=>{let{evaluateExpression:r,shouldHideField:i}=f(),a=e.columns??1;return(0,D.useEffect)(()=>{e.when&&r(e.when,e.key)},[e.when,r,e.key]),i(e.key)?null:(0,O.jsxs)(`div`,{children:[e.label&&(0,O.jsx)(`h3`,{className:`text-[14px] font-semibold text-neutral-800 mb-3 mt-4`,children:e.label}),(0,O.jsx)(`div`,{className:`gap-4`,style:{display:`grid`,gridTemplateColumns:`repeat(${String(a)}, 1fr)`},children:e.fields?.map(e=>(0,O.jsx)(N,{field:e,pluginApiName:t,disabled:n},e.key))})]})},j=({field:e})=>e.label?(0,O.jsxs)(`label`,{className:`text-[12px] font-medium text-neutral-600`,children:[e.label,e.required&&(0,O.jsx)(`span`,{className:`text-red-500 ml-0.5`,children:`*`}),e.tooltip&&(0,O.jsx)(`span`,{className:`ml-1 text-neutral-400 cursor-help`,title:e.tooltip,children:`?`})]}):null,M={container:A,custom_object:({field:e,disabled:t=!1})=>{let{state:n,setState:r,getNestedFields:i,reInferFieldsForObject:a,evaluateExpression:o,shouldHideField:s,shouldDisableField:c,getFieldErrorState:u,registerFieldResetter:p,afterFieldChange:m,disabledKeys:g}=f(),_=n[e.key]?.value,v=g.includes(e.key)||t,y=c(e.key)||v,[b,x]=(0,D.useState)(_?.objectName??``),[S,C]=(0,D.useState)([]),[w,T]=(0,D.useState)(!1),E=(0,D.useRef)(null),k=l(),A=d(),M=(0,D.useCallback)(async e=>{T(!0);try{let t=new URLSearchParams({page_size:`20`});e&&t.set(`search`,e);let n=await(await k(`/custom-objects?${t.toString()}`)).json(),r=(Array.isArray(n)?n:n.results??[]).map(e=>({id:e.id,label:e.object_name})),i=A?.business.client_object;i?.access&&(!e||i.object_name.toLowerCase().includes(e.toLowerCase()))&&r.unshift({id:i.id,label:i.object_name}),C(r)}catch{C([])}finally{T(!1)}},[k,A]),N=(0,D.useCallback)(t=>{x(t),_&&(r(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key))),m(e.key)),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{M(t)},300)},[_,e.key,r,m,M]),P=(0,D.useCallback)((t,n)=>{x(n),r(r=>({...r,[e.key]:{type:`custom_object`,value:{id:t,objectName:n}}}));let o=i().filter(t=>t.object_id?.includes(e.key));for(let e of o)r(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key)));a(e.key),m(e.key)},[e.key,r,i,a,m]);if((0,D.useEffect)(()=>{p(e.key,()=>{r(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key))),x(``)})},[e.key,p,r]),(0,D.useEffect)(()=>{e.when&&o(e.when,e.key)},[e.when,o,e.key]),s(e.key))return null;let F=u(e.key);return(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsx)(j,{field:e}),(0,O.jsxs)(`div`,{className:`relative`,children:[(0,O.jsx)(h,{value:b,onChange:N,onSelect:P,options:S,loading:w,placeholder:e.placeholder??`Search for an object...`,disabled:y}),_&&(0,O.jsx)(`button`,{type:`button`,onClick:()=>{r(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key))),x(``),m(e.key)},disabled:y,className:`absolute right-2 top-1/2 -translate-y-1/2 text-[11px] text-neutral-400 hover:text-neutral-600`,"aria-label":`Clear selection`,children:`×`})]}),F?.showMessage&&F.message&&(0,O.jsx)(`span`,{className:`text-[11px] text-red-500`,children:F.message})]})},field:({field:e,disabled:t=!1})=>{let{interpolateValue:n,state:r,setState:i,evaluateExpression:a,shouldHideField:o,getFieldErrorState:s,registerFieldResetter:c,afterFieldChange:u,disabledKeys:d}=f(),p=d.includes(e.key)||t,m=n(e.object_id??``),[h,g]=(0,D.useState)([]),[_,v]=(0,D.useState)(``),[y,b]=(0,D.useState)(!1),[x,S]=(0,D.useState)(null),C=l();(0,D.useEffect)(()=>{!m||m===x||o(e.key)||(async()=>{b(!0);try{v((await(await C(`/custom-objects/${m}`)).json()).object_name??``);let e=await(await C(`/custom-objects/${m}/fields`)).json();g((Array.isArray(e)?e:e.results??[]).map(e=>({label:e.display_name,value:e.id}))),S(m)}catch{g([])}finally{b(!1)}})()},[m,x,C,e.key,o]);let w=r[e.key]?.value,T=(0,D.useCallback)(t=>{i(n=>({...n,[e.key]:{type:`field`,value:t,associatedObject:{id:m,name:_}}})),u(e.key)},[e.key,i,m,_,u]);if((0,D.useEffect)(()=>{c(e.key,()=>{i(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key)))})},[e.key,c,i]),(0,D.useEffect)(()=>{e.when&&a(e.when,e.key)},[e.when,a,e.key]),o(e.key))return null;let E=s(e.key),k=!m||p;if(e.allow_multiple){let t=Array.isArray(w)?w:[];return(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsx)(j,{field:e}),(0,O.jsx)(`div`,{className:`rounded border p-2 text-[13px] ${E?.error?`border-red-300`:`border-black/10`} ${k?`bg-neutral-50`:`bg-white`}`,children:y?(0,O.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`Loading fields...`}):m?h.length===0?(0,O.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`No fields available`}):(0,O.jsx)(`div`,{className:`flex flex-col gap-1 max-h-48 overflow-y-auto`,children:h.map(e=>{let n=t.some(t=>t.value===e.value);return(0,O.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:n,disabled:k,onChange:()=>{T(n?t.filter(t=>t.value!==e.value):[...t,e])},className:`h-3 w-3 accent-blue-600`}),(0,O.jsx)(`span`,{className:`text-[12px]`,children:e.label})]},e.value)})}):(0,O.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`Select an object first`})}),E?.showMessage&&E.message&&(0,O.jsx)(`span`,{className:`text-[11px] text-red-500`,children:E.message})]})}let A=w&&!Array.isArray(w)?w.value:``;return(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsx)(j,{field:e}),y?(0,O.jsx)(`div`,{className:`w-full rounded border border-black/10 px-2 py-1.5 text-[12px] text-neutral-400 bg-neutral-50`,children:`Loading fields...`}):(0,O.jsxs)(`select`,{value:A,onChange:e=>{let t=h.find(t=>t.value===e.target.value);t&&T(t)},disabled:k,className:`w-full rounded border px-2 py-1.5 text-[13px] font-mono focus:outline-none focus:ring-1 ${E?.error?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`} ${k?`bg-neutral-50 text-neutral-400`:`bg-white`}`,children:[(0,O.jsx)(`option`,{value:``,children:m?`Choose a field`:`Select an object first`}),h.map(e=>(0,O.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),E?.showMessage&&E.message&&(0,O.jsx)(`span`,{className:`text-[11px] text-red-500`,children:E.message})]})},text:({field:e,disabled:t=!1})=>{let{state:n,setState:r,evaluateExpression:i,shouldHideField:a,getFieldErrorState:o,registerFieldResetter:s,afterFieldChange:c,disabledKeys:l}=f(),[u,d]=(0,D.useState)(n[e.key]?.value??e.default??``),p=l.includes(e.key)||t,m=(0,D.useCallback)(t=>{r(n=>({...n,[e.key]:{type:`text`,value:t}})),c(e.key)},[e.key,r,c]);if((0,D.useEffect)(()=>{s(e.key,()=>{d(``),m(``)})},[e.key,s,m]),(0,D.useEffect)(()=>{let e=setTimeout(()=>{m(u)},300);return()=>{clearTimeout(e)}},[u,m]),(0,D.useEffect)(()=>{e.when&&i(e.when,e.key)},[e.when,i,e.key]),a(e.key))return null;let h=o(e.key);return(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsx)(j,{field:e}),(0,O.jsx)(`input`,{type:`text`,value:u,onChange:e=>{d(e.target.value)},placeholder:e.placeholder??e.default??`Enter text`,disabled:p,className:`rounded border px-2 py-1.5 text-[13px] font-mono focus:outline-none focus:ring-1 ${h?.error?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`} ${p?`bg-neutral-50 text-neutral-400`:`bg-white`}`}),h?.showMessage&&h.message&&(0,O.jsx)(`span`,{className:`text-[11px] text-red-500`,children:h.message})]})},description:({field:e})=>{let{evaluateExpression:t,shouldHideField:n}=f();return(0,D.useEffect)(()=>{e.when&&t(e.when,e.key)},[e.when,t,e.key]),n(e.key)?null:(0,O.jsx)(`div`,{className:`text-[13px] text-neutral-500 leading-relaxed`,children:e.content})},number:({field:e,disabled:t=!1})=>{let{state:n,setState:r,evaluateExpression:i,shouldHideField:a,getFieldErrorState:o,registerFieldResetter:s,afterFieldChange:c,disabledKeys:l}=f(),u=n[e.key]?.value??e.default??``,[d,p]=(0,D.useState)(String(u)),m=l.includes(e.key)||t,h=(0,D.useCallback)(t=>{r(n=>({...n,[e.key]:{type:`number`,value:t}})),c(e.key)},[e.key,r,c]);if((0,D.useEffect)(()=>{s(e.key,()=>{p(``),h(``)})},[e.key,s,h]),(0,D.useEffect)(()=>{let e=setTimeout(()=>{h(d)},300);return()=>{clearTimeout(e)}},[d,h]),(0,D.useEffect)(()=>{e.when&&i(e.when,e.key)},[e.when,i,e.key]),a(e.key))return null;let g=o(e.key);return(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsx)(j,{field:e}),(0,O.jsx)(`input`,{type:`number`,value:d,onChange:e=>{p(e.target.value)},placeholder:e.placeholder??e.default??`Enter a number`,disabled:m,className:`rounded border px-2 py-1.5 text-[13px] font-mono focus:outline-none focus:ring-1 ${g?.error?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`} ${m?`bg-neutral-50 text-neutral-400`:`bg-white`}`}),g?.showMessage&&g.message&&(0,O.jsx)(`span`,{className:`text-[11px] text-red-500`,children:g.message})]})},select:({field:e,pluginApiName:t,disabled:n=!1})=>{let{state:r,setState:i,evaluateExpression:a,shouldHideField:o,getFieldErrorState:s,inferencePending:c,initialExpressionsPending:u,expressionsIdle:d,afterFieldChange:p,registerFieldResetter:h,disabledKeys:g}=f(),_=!c&&!u&&d,[v,y]=(0,D.useState)([]),[b,x]=(0,D.useState)(!1),S=(0,D.useRef)(null),C=!!(e.getFetchUrl??e.optionMapper),E=r[e.key]?.value,k=g.includes(e.key)||n,A=l(),M=(0,D.useCallback)(t=>{i(n=>({...n,[e.key]:{type:`select`,value:t}})),p(e.key)},[p,e.key,i]);(0,D.useEffect)(()=>{h(e.key,()=>{i(t=>Object.fromEntries(Object.entries(t).filter(([t])=>t!==e.key)))})},[e.key,h,i]),(0,D.useEffect)(()=>{e.when&&a(e.when,e.key)},[e.when,a,e.key]);let N=(0,D.useMemo)(()=>JSON.stringify(r),[r]);if((0,D.useEffect)(()=>{!C||!_||o(e.key)||S.current===N||(async()=>{x(!0),S.current=N;try{let n={__kizen_state:{value:{...r,pluginApiName:t}}},i;if(e.getFetchUrl){let t=await m(e.getFetchUrl,n);if(t){let r=e.fetchMethod??`GET`,a={"Content-Type":`application/json`},o=null;if(e.getHeaders&&(a=await w(e.getHeaders,n)),r===`POST`&&e.getBody){let t=await w(e.getBody,n);o=JSON.stringify(t)}if(t.startsWith(`/`))i={data:await(await A(t,{method:r,headers:a,...o!=null&&{body:o}})).json()};else{let e=await fetch(t,{method:r,headers:a,...o!=null&&{body:o}});e.ok&&(i=await e.json())}}}if(e.optionMapper){let n=await T(e.optionMapper,{__kizen_state:{value:{...r,result:i,pluginApiName:t}}});y(structuredClone(n))}else Array.isArray(i)&&y(i)}catch{y([])}finally{x(!1)}})()},[C,_,N,r,e,t,A,o]),o(e.key))return null;let P=s(e.key),F=C?v:e.options??[];if(e.allow_multiple){let t=Array.isArray(E)?E:[];return(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsx)(j,{field:e}),(0,O.jsx)(`div`,{className:`rounded border p-2 text-[13px] ${P?.error?`border-red-300`:`border-black/10`} ${k?`bg-neutral-50`:`bg-white`}`,children:b?(0,O.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`Loading options...`}):F.length===0?(0,O.jsx)(`span`,{className:`text-neutral-400 text-[12px]`,children:`No options available`}):(0,O.jsx)(`div`,{className:`flex flex-col gap-1 max-h-48 overflow-y-auto`,children:F.map(e=>{let n=t.some(t=>t.value===e.value);return(0,O.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:n,disabled:k,onChange:()=>{M(n?t.filter(t=>t.value!==e.value):[...t,e])},className:`h-3 w-3 accent-blue-600`}),(0,O.jsx)(`span`,{className:`text-[12px]`,children:e.label})]},e.value)})})}),P?.showMessage&&P.message&&(0,O.jsx)(`span`,{className:`text-[11px] text-red-500`,children:P.message})]})}let I=E&&!Array.isArray(E)?E.value:``;return(0,O.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,O.jsx)(j,{field:e}),b?(0,O.jsx)(`div`,{className:`w-full rounded border border-black/10 px-2 py-1.5 text-[12px] text-neutral-400 bg-neutral-50`,children:`Loading options...`}):(0,O.jsxs)(`select`,{value:I,onChange:e=>{let t=F.find(t=>t.value===e.target.value);t&&M(t)},disabled:k,className:`w-full rounded border px-2 py-1.5 text-[13px] font-mono focus:outline-none focus:ring-1 ${P?.error?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`} ${k?`bg-neutral-50 text-neutral-400`:`bg-white`}`,children:[(0,O.jsx)(`option`,{value:``,children:e.placeholder??`Choose an option`}),F.map(e=>(0,O.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),P?.showMessage&&P.message&&(0,O.jsx)(`span`,{className:`text-[11px] text-red-500`,children:P.message})]})},boolean:k},N=({field:e,pluginApiName:t,disabled:n=!1})=>{let r=M[e.type];return(0,O.jsx)(r,{field:e,pluginApiName:t,disabled:n})},P=({apiName:e})=>{let t=b(e),[n,r]=(0,D.useState)(t?.__kizen_clean_config?JSON.stringify(t.__kizen_clean_config,null,2):`{}`),[i,a]=(0,D.useState)(null),[o,s]=(0,D.useState)(!1);return(0,O.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,O.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,O.jsx)(`p`,{className:`text-[13px] text-neutral-500 m-0`,children:`No setup assistant defined. Enter configuration as JSON.`})}),(0,O.jsx)(`textarea`,{value:n,onChange:e=>{r(e.target.value),a(null),s(!1)},spellCheck:!1,className:`w-full min-h-[300px] rounded border p-3 text-[13px] font-mono leading-relaxed focus:outline-none focus:ring-1 ${i?`border-red-300 focus:ring-red-400`:`border-black/10 focus:ring-blue-400`}`}),i&&(0,O.jsxs)(`span`,{className:`text-[12px] text-red-500`,children:[`Parse error: `,i]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(`button`,{onClick:()=>{try{y(e,JSON.parse(n)),a(null),s(!0),setTimeout(()=>{s(!1)},2e3)}catch(e){a(e instanceof Error?e.message:`Invalid JSON`),s(!1)}},className:`rounded bg-blue-600 px-4 py-1.5 text-[13px] font-medium text-white hover:bg-blue-700 active:bg-blue-800`,children:`Save Configuration`}),(0,O.jsx)(`button`,{onClick:()=>{S(e),r(`{}`),a(null),s(!1)},className:`rounded border border-black/10 px-4 py-1.5 text-[13px] font-medium text-neutral-600 hover:bg-neutral-50 active:bg-neutral-100`,children:`Reset`}),o&&(0,O.jsx)(`span`,{className:`text-[12px] text-green-600 font-medium`,children:`Saved`})]})]})},F=({config:e,apiName:t,loadFn:n,saveFn:r,clearFn:i})=>{let a=n(t)?.__kizen_setup_assistant_values,o=(0,D.useRef)({}),[s,c]=(0,D.useState)(!1),u=l(),f=d(),p=(0,D.useCallback)(async e=>{try{let t=await(await u(`/api/custom-objects?filters=${encodeURIComponent(JSON.stringify({api_name:e}))}`)).json(),n=Array.isArray(t)?t:t.results;if(n&&n.length>0)return n}catch{}let t=f?.business.client_object;if(t?.access&&t.name===e)return[{id:t.id,object_name:t.object_name}]},[u,f]),m=(0,D.useCallback)(async e=>{try{let[t,n]=await Promise.all([u(`/api/custom-objects/${e}`),u(`/api/custom-objects/${e}/fields`)]),r=await t.json(),i=await n.json(),a=Array.isArray(i)?i:i.results??[];return{id:e,objectName:r.object_name??``,fields:a.map(e=>({id:e.id,name:e.name,displayName:e.display_name}))}}catch{return{id:e,objectName:``,fields:[]}}},[u]),h=(0,D.useCallback)(e=>{o.current=e},[]);return(0,O.jsx)(C,{config:e,value:a,onStateChange:h,disabledKeys:[],getObjectByAPIName:p,getCustomObjectDetails:m,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.fields?.map(e=>(0,O.jsx)(N,{field:e,pluginApiName:t},e.key)),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 mt-2`,children:[(0,O.jsx)(`button`,{onClick:()=>{let n=o.current;r(t,n,e),c(!0),setTimeout(()=>{c(!1)},2e3)},className:`rounded bg-blue-600 px-4 py-1.5 text-[13px] font-medium text-white hover:bg-blue-700 active:bg-blue-800`,children:`Save Configuration`}),(0,O.jsx)(`button`,{onClick:()=>{i(t),window.location.reload()},className:`rounded border border-black/10 px-4 py-1.5 text-[13px] font-medium text-neutral-600 hover:bg-neutral-50 active:bg-neutral-100`,children:`Reset`}),s&&(0,O.jsx)(`span`,{className:`text-[12px] text-green-600 font-medium`,children:`Saved`})]})]})})},I=({config:e,apiName:n,loadFn:i,saveFn:a,clearFn:o})=>{let s=d(),c=l(),{environment:f}=E(),p=u[f],[m,h]=(0,D.useState)(!1),[g,v]=(0,D.useState)(!1);return s?(0,O.jsx)(_,{appPath:p,user:{id:s.team.user,crm_client_id:``},business:s.business,clientObject:s.business.client_object?{id:s.business.client_object.id,objectName:s.business.client_object.object_name}:void 0,teamMember:s.team,onNavigate:()=>{},performFileUpload:()=>Promise.resolve({url:``}),monitoringExceptionHelper:()=>{},performRequest:async(e,t,n,r)=>{let i=n?.headers,a=r instanceof FormData||r instanceof Blob,o=r!=null&&!a?{"Content-Type":`application/json`,...i}:i,s=await c(t,{method:e.toUpperCase(),...r!=null&&{body:a?r:JSON.stringify(r)},...o!=null&&{headers:o}});return s.status===204||s.headers.get(`content-length`)===`0`?{data:{}}:{data:await s.json()}},modal:{showing:m,show:g,showPrompt:()=>{h(!0),v(!0)},onConfirm:()=>{h(!1),v(!1)},onHide:()=>{h(!1),v(!1)}},showToast:()=>{},clearToasts:()=>{},children:()=>(0,O.jsx)(F,{config:e,apiName:n,loadFn:i,saveFn:a,clearFn:o})}):(0,O.jsx)(t,{icon:r,className:`animate-spin text-neutral-400`})},L=()=>{let{apiName:e}=c({strict:!1}),{data:t,isLoading:n,isError:r}=o(a);if(n)return(0,O.jsx)(s,{children:(0,O.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})});if(r)return(0,O.jsx)(s,{children:(0,O.jsx)(`p`,{className:`m-0 text-[13px] text-red-700`,children:`Could not load bundle.json.`})});let i=t?.find(t=>t.api_name===e);if(!i)return(0,O.jsx)(s,{children:(0,O.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`No app found with api_name`,` `,(0,O.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 py-0.5`,children:e}),`.`]})});let l=i.base_config,u=l?.setup_assistant,d=l?.user_setup_assistant,f=(u?.fields?.length??0)>0,m=(d?.fields?.length??0)>0;return!f&&!m?(0,O.jsx)(s,{children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{className:`text-[15px] font-bold text-neutral-900 m-0`,children:`Configuration`}),(0,O.jsx)(`p`,{className:`text-[12px] text-neutral-400 m-0 mt-1`,children:`Enter plugin configuration as JSON.`})]}),(0,O.jsx)(P,{apiName:e??``})]})}):(0,O.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-start`,children:[f&&u&&(0,O.jsx)(s,{className:`lg:flex-1 lg:min-w-0`,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{className:`text-[15px] font-bold text-neutral-900 m-0`,children:`Business Configuration`}),(0,O.jsxs)(`p`,{className:`text-[12px] text-neutral-400 m-0 mt-1`,children:[`Configure the business-level setup assistant fields. These values are shared across the whole business and exposed to plugin scripts at`,` `,(0,O.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 font-mono text-[11px]`,children:`this.config`}),`.`]})]}),(0,O.jsx)(I,{config:u,apiName:e??``,loadFn:b,saveFn:p,clearFn:S})]})}),m&&d&&(0,O.jsx)(s,{className:`lg:flex-1 lg:min-w-0`,children:(0,O.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{className:`text-[15px] font-bold text-neutral-900 m-0`,children:`User Configuration`}),(0,O.jsxs)(`p`,{className:`text-[12px] text-neutral-400 m-0 mt-1`,children:[`Configure the per-user setup assistant fields. These values are scoped to the logged-in user and exposed to plugin scripts at`,` `,(0,O.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 font-mono text-[11px]`,children:`this.userConfig`}),`.`]})]}),(0,O.jsx)(I,{config:d,apiName:e??``,loadFn:g,saveFn:x,clearFn:v})]})})]})};export{L as ConfigurationPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{k as t}from"./fa-core-mHW_3JUd.js";var n=e(t(),1),r=[`go`,`fmo`,`staging`,`integration`,`test1`],i=(0,n.createContext)({apiKey:``,userId:``,businessId:``,environment:`go`}),a=()=>(0,n.useContext)(i);export{r as n,a as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{D as t,E as n,O as r,a as i,k as a,r as o}from"./fa-core-mHW_3JUd.js";import{n as s}from"./CredentialsContext-BLZX6RwF.js";var c=e(a(),1),l=r(),u=`integration:route-change`,d=`w-full rounded bg-neutral-800 border border-neutral-700 px-2 py-1 text-[12px] font-mono text-neutral-200 focus:outline-none focus:border-neutral-500`,f=`block text-[11px] font-semibold uppercase tracking-widest text-neutral-600 mb-1`;function p(e){return e.toTimeString().slice(0,8)}var m=()=>{let[e,t]=(0,c.useState)(`/`),[n,r]=(0,c.useState)(``),[i,a]=(0,c.useState)(``),[o,s]=(0,c.useState)([]),m=(0,c.useRef)(null);(0,c.useEffect)(()=>{m.current?.scrollIntoView({behavior:`smooth`})},[o]),(0,c.useEffect)(()=>{let e=e=>{let t=e;s(e=>[...e,{time:new Date,location:t.detail.location}].slice(-50))};return window.addEventListener(u,e),()=>{window.removeEventListener(u,e)}},[]);let h=()=>{let t=n&&!n.startsWith(`?`)?`?${n}`:n,r=i&&!i.startsWith(`#`)?`#${i}`:i,a={host:window.location.host,origin:window.location.origin,port:window.location.port,protocol:window.location.protocol,pathname:e,search:t,hash:r,href:`${window.location.origin}${e}${t}${r}`};window.dispatchEvent(new CustomEvent(u,{detail:{location:a}}))},g=e=>{e.key===`Enter`&&h()};return(0,l.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 pb-3`,children:[(0,l.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`label`,{className:f,children:`Search`}),(0,l.jsx)(`input`,{type:`text`,className:d,value:n,onChange:e=>{r(e.target.value)},onKeyDown:g,placeholder:`?tab=notes`,spellCheck:!1})]}),(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`label`,{className:f,children:`Hash`}),(0,l.jsx)(`input`,{type:`text`,className:d,value:i,onChange:e=>{a(e.target.value)},onKeyDown:g,placeholder:`#section`,spellCheck:!1})]})]}),(0,l.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`label`,{className:f,children:`Pathname`}),(0,l.jsx)(`input`,{type:`text`,className:d,value:e,onChange:e=>{t(e.target.value)},onKeyDown:g,placeholder:`/client/abc-123/overview`,spellCheck:!1})]}),(0,l.jsx)(`button`,{onClick:h,className:`rounded bg-neutral-700 px-3 py-1.5 text-[12px] font-semibold text-neutral-200 hover:bg-neutral-600 active:bg-neutral-500`,children:`Dispatch`})]})]}),(0,l.jsxs)(`div`,{className:`flex flex-col border-t border-neutral-800 pt-2`,children:[(0,l.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,l.jsx)(`span`,{className:`text-[11px] font-semibold uppercase tracking-widest text-neutral-500`,children:`Navigation Event Stream`}),o.length>0&&(0,l.jsx)(`button`,{onClick:()=>{s([])},className:`text-[11px] text-neutral-600 hover:text-neutral-300`,children:`clear`})]}),(0,l.jsxs)(`div`,{className:`max-h-40 overflow-y-auto`,children:[o.length===0?(0,l.jsx)(`p`,{className:`text-[12px] text-neutral-600`,children:`No events yet.`}):o.map((e,t)=>(0,l.jsxs)(`div`,{className:`px-2 py-0.5 font-mono text-[11px] leading-5 ${t%2==0?`bg-neutral-900`:`bg-neutral-800/40`}`,children:[(0,l.jsx)(`span`,{className:`text-neutral-600`,children:p(e.time)}),(0,l.jsx)(`span`,{className:`ml-2 text-neutral-300`,children:e.location.pathname}),e.location.search&&(0,l.jsx)(`span`,{className:`text-neutral-500`,children:e.location.search}),e.location.hash&&(0,l.jsx)(`span`,{className:`text-neutral-500`,children:e.location.hash})]},t)),(0,l.jsx)(`div`,{ref:m})]})]})]})},h=`w-full rounded bg-neutral-800 border border-neutral-700 px-2 py-1 text-[12px] font-mono text-neutral-200 focus:outline-none focus:border-neutral-500`,g=`block text-[11px] font-semibold uppercase tracking-widest text-neutral-600 mb-1`,_=`text-[11px] font-semibold uppercase tracking-widest text-neutral-500`,v={log:`text-neutral-400`,info:`text-blue-400`,warn:`text-yellow-400`,error:`text-red-400`};function y(e){if(typeof e==`string`)return e;if(e===null)return`null`;if(e===void 0)return`undefined`;try{return JSON.stringify(e)}catch{return`[unserializable]`}}var b=({logs:e,height:t})=>{let n=(0,c.useRef)(null);return(0,c.useEffect)(()=>{n.current?.scrollIntoView({behavior:`smooth`})},[e]),(0,l.jsxs)(`div`,{className:`${t} overflow-x-auto overflow-y-auto pb-4`,children:[e.length===0?(0,l.jsx)(`p`,{className:`px-4 text-[12px] text-neutral-600`,children:`No output yet.`}):e.map((e,t)=>(0,l.jsx)(`div`,{className:`whitespace-pre px-4 text-[12px] leading-5 ${v[e.level]} ${t%2==0?`bg-neutral-900`:`bg-neutral-800/40`}`,children:e.args.map(y).join(` `)},t)),(0,l.jsx)(`div`,{ref:n})]})},x=({logs:e,height:t})=>{let n=(0,c.useRef)(null);return(0,c.useEffect)(()=>{n.current?.scrollIntoView({behavior:`smooth`})},[e]),(0,l.jsxs)(`div`,{className:`${t} overflow-x-auto overflow-y-auto pb-4`,children:[e.length===0?(0,l.jsx)(`p`,{className:`px-4 text-[12px] text-neutral-600`,children:`No output yet.`}):e.map((e,t)=>(0,l.jsx)(`div`,{className:`whitespace-pre px-4 text-[12px] leading-5 text-neutral-500`,children:e},t)),(0,l.jsx)(`div`,{ref:n})]})};function S(e){switch(e.toUpperCase()){case`GET`:return`bg-blue-900/60 text-blue-300`;case`POST`:return`bg-green-900/60 text-green-300`;case`PUT`:return`bg-amber-900/60 text-amber-300`;case`PATCH`:return`bg-orange-900/60 text-orange-300`;case`DELETE`:return`bg-red-900/60 text-red-300`;default:return`bg-neutral-800 text-neutral-400`}}function C(e){return e===0?`bg-neutral-800 text-neutral-400`:e<300?`bg-green-900/60 text-green-300`:e<400?`bg-yellow-900/60 text-yellow-300`:e<500?`bg-orange-900/60 text-orange-300`:`bg-red-900/60 text-red-300`}var w=({logs:e,height:t})=>{let n=(0,c.useRef)(null),[r,i]=(0,c.useState)(null);return(0,c.useEffect)(()=>{n.current?.scrollIntoView({behavior:`smooth`})},[e]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`${t} overflow-x-auto overflow-y-auto pb-4`,children:[e.length===0?(0,l.jsx)(`p`,{className:`px-4 text-[12px] text-neutral-600`,children:`No output yet.`}):e.map((e,t)=>(0,l.jsx)(`div`,{className:`flex items-center gap-1.5 px-3 py-0.5 text-[11px] ${t%2==0?`bg-neutral-900`:`bg-neutral-800/40`}`,children:e.kind===`info`?(0,l.jsx)(`span`,{className:`text-neutral-500`,children:e.message}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`span`,{className:`w-12 shrink-0 rounded text-center font-mono font-semibold ${S(e.method)}`,children:e.method}),(0,l.jsx)(`span`,{className:`w-8 shrink-0 rounded text-center font-mono font-semibold ${C(e.status)}`,children:e.status===0?`ERR`:e.status}),(0,l.jsx)(`span`,{className:`w-14 shrink-0 rounded text-center font-mono font-semibold ${e.fromCache?`bg-violet-900/60 text-violet-300`:`bg-neutral-800 text-neutral-400`}`,children:e.fromCache?`cache`:`network`}),(0,l.jsx)(`span`,{className:`min-w-0 truncate cursor-default font-mono text-neutral-400`,onMouseEnter:t=>{let n=t.currentTarget.getBoundingClientRect();i({text:e.url,x:n.left,y:n.top})},onMouseLeave:()=>{i(null)},children:e.url})]})},t)),(0,l.jsx)(`div`,{ref:n})]}),r&&(0,l.jsx)(`div`,{className:`pointer-events-none fixed z-50 max-w-xs break-all rounded bg-neutral-700 px-2 py-1 text-[11px] text-neutral-100 shadow-lg`,style:{left:r.x,top:r.y,transform:`translateY(calc(-100% - 4px))`},children:r.text})]})},T=({onClose:e,buildLogs:r,proxyLogs:a,consoleLogs:u,onClearConsole:d,credentials:f,onCredentialsChange:p,width:v=416,onWidthChange:y})=>{let[S,C]=(0,c.useState)(()=>{let e=localStorage.getItem(`devtools-creds-open`);return e===null?!(f.apiKey&&f.userId&&f.businessId):e!==`false`}),[T,E]=(0,c.useState)([]),[D,O]=(0,c.useState)(void 0),k=(0,c.useCallback)(async()=>{try{let e=await fetch(`/api/credential-profiles`);if(!e.ok)return;let t=await e.json();E(t.profiles),O(t.active)}catch{}},[]);(0,c.useEffect)(()=>{k()},[k]);let A=(0,c.useCallback)(async e=>{let t=e===``?void 0:e;try{await fetch(`/api/credentials/switch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({profile:t})}),await fetch(`/api/proxy-cache/clear`),O(t)}catch{}},[]),[j,M]=(0,c.useState)(()=>localStorage.getItem(`devtools-routes-open`)!==`false`),[N,P]=(0,c.useState)(()=>localStorage.getItem(`devtools-console-open`)!==`false`),[F,I]=(0,c.useState)(()=>localStorage.getItem(`devtools-proxy-open`)!==`false`),[L,R]=(0,c.useState)(()=>localStorage.getItem(`devtools-build-open`)!==`false`),z=(e,t)=>{t(t=>{let n=!t;return localStorage.setItem(e,String(n)),n})},B=(0,c.useRef)(!1),V=(0,c.useCallback)(e=>{e.preventDefault(),B.current=!0;let t=e=>{if(!B.current)return;let t=Math.min(800,Math.max(280,window.innerWidth-e.clientX));y?.(t)},n=()=>{B.current=!1,document.removeEventListener(`mousemove`,t),document.removeEventListener(`mouseup`,n)};document.addEventListener(`mousemove`,t),document.addEventListener(`mouseup`,n)},[y]);return(0,l.jsxs)(`aside`,{className:`relative flex shrink-0 flex-col border-l border-neutral-800 bg-neutral-900 text-neutral-100`,style:{width:v},children:[(0,l.jsx)(`div`,{onMouseDown:V,className:`absolute left-0 top-0 z-10 h-full w-1 cursor-col-resize transition-colors hover:bg-neutral-600`}),(0,l.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-3`,children:[(0,l.jsx)(`span`,{className:`text-[12px] font-semibold uppercase tracking-widest text-neutral-400`,children:`Dev Tools`}),(0,l.jsx)(`button`,{onClick:e,className:`text-neutral-500 hover:text-neutral-200`,"aria-label":`Close dev tools`,children:(0,l.jsx)(t,{icon:n,size:`sm`})})]}),(0,l.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:[(0,l.jsxs)(`div`,{className:`flex flex-1 flex-col min-h-0`,children:[(0,l.jsxs)(`div`,{className:`flex shrink-0 flex-col border-b border-neutral-800`,children:[(0,l.jsxs)(`button`,{className:`flex items-center justify-between px-4 py-2 hover:bg-neutral-800/50`,onClick:()=>{z(`devtools-creds-open`,C),k()},children:[(0,l.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:_,children:`Credentials`}),!S&&(0,l.jsx)(`span`,{className:`text-[11px] font-mono text-neutral-400`,children:f.environment})]}),(0,l.jsx)(t,{icon:S?o:i,className:`text-neutral-600`,size:`xs`})]}),S&&(0,l.jsxs)(`div`,{className:`flex flex-col gap-2 px-4 pb-3`,children:[T.length>1&&(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`label`,{className:g,children:`Profile`}),(0,l.jsx)(`select`,{className:h,value:D??``,onChange:e=>{A(e.target.value)},children:T.map(e=>(0,l.jsx)(`option`,{value:e.isDefault?``:e.name,children:e.isDefault?`Default`:e.name},e.name))})]}),(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`label`,{className:g,children:`Environment`}),(0,l.jsx)(`select`,{className:h,value:f.environment,onChange:e=>{p({...f,environment:e.target.value})},children:s.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))})]}),(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`label`,{className:g,children:`Business ID`}),(0,l.jsx)(`input`,{type:`text`,className:h,value:f.businessId,onChange:e=>{p({...f,businessId:e.target.value})},placeholder:`x-business-id`,autoComplete:`off`})]})]}),(0,l.jsxs)(`div`,{className:`flex gap-2`,children:[(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`label`,{className:g,children:`User ID`}),(0,l.jsx)(`input`,{type:`text`,className:h,value:f.userId,onChange:e=>{p({...f,userId:e.target.value})},placeholder:`x-user-id`,autoComplete:`off`})]}),(0,l.jsxs)(`div`,{className:`flex-1`,children:[(0,l.jsx)(`label`,{className:g,children:`API Key`}),(0,l.jsx)(`input`,{type:`password`,className:h,value:f.apiKey,onChange:e=>{p({...f,apiKey:e.target.value})},placeholder:`x-api-key`,autoComplete:`off`})]})]})]})]}),(0,l.jsxs)(`div`,{className:`flex shrink-0 flex-col border-t border-neutral-800 overflow-hidden`,children:[(0,l.jsxs)(`button`,{className:`flex items-center justify-between px-4 py-2 hover:bg-neutral-800/50`,onClick:()=>{z(`devtools-routes-open`,M)},children:[(0,l.jsx)(`span`,{className:_,children:`Routes`}),(0,l.jsx)(t,{icon:j?o:i,className:`text-neutral-600`,size:`xs`})]}),j&&(0,l.jsx)(m,{})]}),(0,l.jsxs)(`div`,{className:`flex shrink-0 flex-col border-t border-neutral-800`,children:[(0,l.jsxs)(`div`,{className:`flex items-center px-4 py-2`,children:[(0,l.jsxs)(`button`,{className:`flex flex-1 items-center gap-2 hover:opacity-70`,onClick:()=>{z(`devtools-console-open`,P)},children:[(0,l.jsx)(`span`,{className:_,children:`Browser Console`}),(0,l.jsx)(t,{icon:N?o:i,className:`text-neutral-600`,size:`xs`})]}),N&&u.length>0&&(0,l.jsx)(`button`,{onClick:d,className:`text-[11px] text-neutral-600 hover:text-neutral-300`,children:`clear`})]}),N&&(0,l.jsx)(b,{logs:u,height:`min-h-32 max-h-64`})]}),(0,l.jsxs)(`div`,{className:`flex flex-1 flex-col min-h-0 border-t border-neutral-800`,children:[(0,l.jsxs)(`div`,{className:`flex items-center px-4 py-2`,children:[(0,l.jsxs)(`button`,{className:`flex flex-1 items-center gap-2 hover:opacity-70`,onClick:()=>{z(`devtools-proxy-open`,I)},children:[(0,l.jsx)(`span`,{className:_,children:`Network Requests`}),(0,l.jsx)(t,{icon:F?o:i,className:`text-neutral-600`,size:`xs`})]}),F&&(0,l.jsx)(`button`,{onClick:()=>{fetch(`/api/proxy-cache/clear`)},className:`text-[11px] text-neutral-600 hover:text-neutral-300`,children:`clear cache`})]}),F&&(0,l.jsx)(w,{logs:a,height:`flex-1 min-h-0`})]})]}),(0,l.jsxs)(`div`,{className:`flex flex-col border-t border-neutral-800`,children:[(0,l.jsxs)(`button`,{className:`flex items-center justify-between px-4 py-2 hover:bg-neutral-800/50`,onClick:()=>{z(`devtools-build-open`,R)},children:[(0,l.jsx)(`span`,{className:_,children:`Build Log`}),(0,l.jsx)(t,{icon:L?o:i,className:`text-neutral-600`,size:`xs`})]}),L&&(0,l.jsx)(x,{logs:r,height:`max-h-[60px]`})]})]})]})};export{T as DevSidebar};
|