import{j as p}from"./document_model_editor-B0b9iLkL.js";import{a3 as l,_ as u,d as M,a8 as D,aS as f,aP as n,aT as S,g as y}from"./reactor_browser-CqcNBhxi.js";import{s as C}from"./design_system_connect-CyoiT4fi.js";import"./graphql-AKTCpY7l.js";import"./drive_explorer-C9ZlHrfH.js";import"./sentry_react-cODD7zWc.js";import"./react-DQSxOgtG.js";import"./sentry_browser-B4YoBIIG.js";import"./react/jsx-runtime-DldvXD6N.js";import"./document_model-BhnxVUEi.js";import"./zod-9j67vCAu.js";import"./design_system-D3L2kJJ3.js";import"./tailwind_merge-Dr4f9Rms.js";import"./react-dom-D6zQJsh6.js";import"./document_drive-CacD9AxC.js";import"./config-CU-aFfVJ.js";import"./design_system_ui-cfMsqDx9.js";const R=()=>{const t=l(),r=t?.type==="createDocument",a=r?t.documentType:void 0,e=u(a),[d]=M(),s=D(),m=f(),c=async o=>{if(n(),!d||!e)return;const i=await S(d.header.id,o||`New ${e.documentModel.global.name}`,e.documentModel.global.id,s?.id??m?.id);y(i)};return p.jsx(C,{open:r,onContinue:c,onOpenChange:o=>{if(!o)return n()}})};export{R as CreateDocumentModal};
