@kizenapps/cli 0.10.0 → 0.11.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.
Files changed (44) hide show
  1. package/dist/chunk-4Z6S6LWP.js +6134 -0
  2. package/dist/chunk-4Z6S6LWP.js.map +1 -0
  3. package/dist/chunk-HJPLDI45.js +6134 -0
  4. package/dist/chunk-HJPLDI45.js.map +1 -0
  5. package/dist/chunk-LSHHXCC6.js +3639 -0
  6. package/dist/chunk-LSHHXCC6.js.map +1 -0
  7. package/dist/chunk-SEGVTWSK.js +44 -0
  8. package/dist/chunk-SEGVTWSK.js.map +1 -0
  9. package/dist/chunk-ZWE3DS7E.js +39 -0
  10. package/dist/chunk-ZWE3DS7E.js.map +1 -0
  11. package/dist/devtools-LZRAH4XS.js +90 -0
  12. package/dist/devtools-LZRAH4XS.js.map +1 -0
  13. package/dist/dist-C3F6UOWF.js +8472 -0
  14. package/dist/dist-C3F6UOWF.js.map +1 -0
  15. package/dist/dist-NUJOSN7W.js +8472 -0
  16. package/dist/dist-NUJOSN7W.js.map +1 -0
  17. package/dist/dist-QHDMIBVE.js +135 -0
  18. package/dist/dist-QHDMIBVE.js.map +1 -0
  19. package/dist/dist-ZIZQOSY3.js +135 -0
  20. package/dist/dist-ZIZQOSY3.js.map +1 -0
  21. package/dist/gzip-size-K37OQCQ2.js +137 -0
  22. package/dist/gzip-size-K37OQCQ2.js.map +1 -0
  23. package/dist/gzip-size-QRGIYYEQ.js +137 -0
  24. package/dist/gzip-size-QRGIYYEQ.js.map +1 -0
  25. package/dist/index.js +575 -552
  26. package/dist/index.js.map +1 -1
  27. package/dist/viewer/assets/AppDetailPage-BJrg5Wsz.js +1 -0
  28. package/dist/viewer/assets/{BootstrapContext-CEWgv2oI.js → BootstrapContext-D3lhzWap.js} +1 -1
  29. package/dist/viewer/assets/Card-CPMAuqAb.js +1 -0
  30. package/dist/viewer/assets/ConfigurationPage-D8I8rWjF.js +1 -0
  31. package/dist/viewer/assets/SandboxPage-ByixszHi.js +1 -0
  32. package/dist/viewer/assets/{VersionsPage-DOd2Hv8M.js → VersionsPage-BKul6bXI.js} +1 -1
  33. package/dist/viewer/assets/index-BoSQQwMQ.css +2 -0
  34. package/dist/viewer/assets/index-Bomh3C3X.js +5 -0
  35. package/dist/viewer/assets/useObjectLookups-Cx6A7PGj.js +14 -0
  36. package/dist/viewer/index.html +4 -4
  37. package/package.json +10 -10
  38. package/dist/viewer/assets/AppDetailPage-ObugMPkn.js +0 -1
  39. package/dist/viewer/assets/Card-BSwG5koM.js +0 -1
  40. package/dist/viewer/assets/ConfigurationPage-SnFNzZgJ.js +0 -1
  41. package/dist/viewer/assets/SandboxPage-BFVVe-i3.js +0 -1
  42. package/dist/viewer/assets/configStorage-Bb-A9Nvj.js +0 -14
  43. package/dist/viewer/assets/index-B-4D4w_w.js +0 -5
  44. package/dist/viewer/assets/index-D6Un_G7k.css +0 -2
@@ -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-CPMAuqAb.js";import{i as h,n as g,r as _,t as v}from"./validIcons-TcFXfn-E.js";var y=n();function b(e){return e<1024?`${String(e)} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}var x=()=>{let{apiName:n}=m({strict:!1}),{data:x,isLoading:S,isError:C}=f(d);if(S)return(0,y.jsx)(p,{children:(0,y.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})});if(C)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 w=x?.find(e=>e.api_name===n);if(!w)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:T,data_adornments:E,routable_pages:D,toolbar_items:O,js_action_templates:k,route_scripts:A,object_settings_menu_items:j,automation_action_configs:M,calendar_sources:N}=w.artifacts,P=T.length>0||E.length>0||D.length>0||O.length>0||k.length>0||A.length>0||j.length>0||M.length>0||N.length>0,F=x?new TextEncoder().encode(JSON.stringify(x,null,2)).length:null,I=w.setup_assistant?.fields??[],L=w.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:w.name}),(0,y.jsx)(`p`,{className:`mt-0.5 font-mono text-[11px] text-neutral-400`,children:w.api_name})]}),w.description&&(0,y.jsx)(`p`,{className:`text-[13px] leading-relaxed text-neutral-600`,children:w.description}),(0,y.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[w.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`,w.version]}),w.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: `,w.engine]}),(0,y.jsx)(`span`,{className:`rounded px-2 py-0.5 text-[11px] font-semibold tracking-wide ${w.published?`bg-green-100 text-green-700`:`bg-neutral-100 text-neutral-500`}`,children:w.published?`published`:`unpublished`}),w.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)),w.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`}),w.developer_business_id&&(typeof w.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: `,w.developer_business_id]}):Object.entries(w.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))),F!==null&&(0,y.jsxs)(`span`,{className:`rounded bg-neutral-100 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-neutral-600`,children:[`bundle: `,b(F)]})]})]})}),P?(0,y.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[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: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:T.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:T.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))})]}),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: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:E.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:E.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))})]}),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: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:D.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:D.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))})]}),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: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:O.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:O.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))})]}),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: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: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}),(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))})]}),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: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:A.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:A.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))})]}),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: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:j.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:j.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))})]}),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: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:M.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:M.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))})]}),N.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:N.length})]}),(0,y.jsx)(`div`,{className:`divide-y divide-black/5`,children:N.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.`})}),(I.length>0||L.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`}),I.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:I.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))})]}),L.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:L.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))})]})]}),w.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:w.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{x as AppDetailPage};
@@ -1 +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};
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-CPMAuqAb.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={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function T(e){let t=w(),n=S.useContext(e.from?oe:ae),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.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-CPMAuqAb.js";import{a as l,i as u,n as d}from"./BootstrapContext-D3lhzWap.js";import{a as f,c as p,f as m,i as h,l as g,n as _,o as v,p as y,r as b,s as x,t as S}from"./useObjectLookups-Cx6A7PGj.js";import{r as C}from"./CredentialsContext-BLZX6RwF.js";var w=e(i(),1),T=n(),E=({apiName:e})=>{let t=h(e),[n,r]=(0,w.useState)(t?.__kizen_clean_config?JSON.stringify(t.__kizen_clean_config,null,2):`{}`),[i,a]=(0,w.useState)(null),[o,s]=(0,w.useState)(!1);return(0,T.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,T.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,T.jsx)(`p`,{className:`text-[13px] text-neutral-500 m-0`,children:`No setup assistant defined. Enter configuration as JSON.`})}),(0,T.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,T.jsxs)(`span`,{className:`text-[12px] text-red-500`,children:[`Parse error: `,i]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`button`,{onClick:()=>{try{x(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,T.jsx)(`button`,{onClick:()=>{_(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,T.jsx)(`span`,{className:`text-[12px] text-green-600 font-medium`,children:`Saved`})]})]})},D=({config:e,apiName:t,loadFn:n,saveFn:r,clearFn:i})=>{let a=n(t)?.__kizen_setup_assistant_values,o=(0,w.useRef)({}),[s,c]=(0,w.useState)(!1),{getObjectByAPIName:l,getCustomObjectDetails:u}=S(),d=(0,w.useCallback)(e=>{o.current=e},[]);return(0,T.jsx)(y,{config:e,value:a,onStateChange:d,disabledKeys:[],getObjectByAPIName:l,getCustomObjectDetails:u,children:(0,T.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.fields?.map(e=>(0,T.jsx)(g,{field:e,pluginApiName:t},e.key)),(0,T.jsxs)(`div`,{className:`flex items-center gap-2 mt-2`,children:[(0,T.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,T.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,T.jsx)(`span`,{className:`text-[12px] text-green-600 font-medium`,children:`Saved`})]})]})})},O=({config:e,apiName:n,loadFn:i,saveFn:a,clearFn:o})=>{let s=d(),c=l(),{environment:f}=C(),p=u[f],[h,g]=(0,w.useState)(!1),[_,v]=(0,w.useState)(!1);return s?(0,T.jsx)(m,{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:h,show:_,showPrompt:()=>{g(!0),v(!0)},onConfirm:()=>{g(!1),v(!1)},onHide:()=>{g(!1),v(!1)}},showToast:()=>{},clearToasts:()=>{},children:()=>(0,T.jsx)(D,{config:e,apiName:n,loadFn:i,saveFn:a,clearFn:o})}):(0,T.jsx)(t,{icon:r,className:`animate-spin text-neutral-400`})},k=()=>{let{apiName:e}=c({strict:!1}),{data:t,isLoading:n,isError:r}=o(a);if(n)return(0,T.jsx)(s,{children:(0,T.jsx)(`p`,{className:`m-0 text-[13px] text-neutral-400`,children:`Fetching bundle.json…`})});if(r)return(0,T.jsx)(s,{children:(0,T.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,T.jsx)(s,{children:(0,T.jsxs)(`p`,{className:`m-0 text-[13px] text-neutral-500`,children:[`No app found with api_name`,` `,(0,T.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,m=(u?.fields?.length??0)>0,g=(d?.fields?.length??0)>0;return!m&&!g?(0,T.jsx)(s,{children:(0,T.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h2`,{className:`text-[15px] font-bold text-neutral-900 m-0`,children:`Configuration`}),(0,T.jsx)(`p`,{className:`text-[12px] text-neutral-400 m-0 mt-1`,children:`Enter plugin configuration as JSON.`})]}),(0,T.jsx)(E,{apiName:e??``})]})}):(0,T.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-start`,children:[m&&u&&(0,T.jsx)(s,{className:`lg:flex-1 lg:min-w-0`,children:(0,T.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h2`,{className:`text-[15px] font-bold text-neutral-900 m-0`,children:`Business Configuration`}),(0,T.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,T.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 font-mono text-[11px]`,children:`this.config`}),`.`]})]}),(0,T.jsx)(O,{config:u,apiName:e??``,loadFn:h,saveFn:v,clearFn:_})]})}),g&&d&&(0,T.jsx)(s,{className:`lg:flex-1 lg:min-w-0`,children:(0,T.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h2`,{className:`text-[15px] font-bold text-neutral-900 m-0`,children:`User Configuration`}),(0,T.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,T.jsx)(`code`,{className:`rounded bg-neutral-100 px-1 font-mono text-[11px]`,children:`this.userConfig`}),`.`]})]}),(0,T.jsx)(O,{config:d,apiName:e??``,loadFn:f,saveFn:p,clearFn:b})]})})]})};export{k as ConfigurationPage};