@oneclick.dev/cms-core-modules 0.0.123 → 0.0.125
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/AppointmentListTable-CWzbwqR-.js +1 -0
- package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
- package/dist/ContentEditor-BlNbqkAz.js +324 -0
- package/dist/{ContentEditor-MDGolnIP.mjs → ContentEditor-D754iLJS.mjs} +7985 -26820
- package/dist/{Detail-Dk8E6_uF.mjs → Detail-BOxWQ1QQ.mjs} +15 -14
- package/dist/{Detail-Cn9Bk0u0.mjs → Detail-BfKW0uZE.mjs} +26 -25
- package/dist/Detail-DFVu2F38.mjs +11 -0
- package/dist/Detail-DJea_fCd.js +1 -0
- package/dist/Detail-DPJacXfm.js +1 -0
- package/dist/Detail-DSLZ7_bM.js +1 -0
- package/dist/Detail-DUGThL9Y.js +1 -0
- package/dist/{Detail-B_scnidb.mjs → Detail-D_LlEeHu.mjs} +35 -34
- package/dist/Editor-D4evcdhv.mjs +768 -0
- package/dist/Editor-gLLtuJbY.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-BjKpsqT9.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs +76 -0
- package/dist/Knowledge-B66vxz--.js +1 -0
- package/dist/Knowledge-BnMTTuJ7.mjs +742 -0
- package/dist/Overview-0hFXiuYo.js +1 -0
- package/dist/Overview-BE4uYPx0.mjs +745 -0
- package/dist/Overview-BTx5LF4J.js +1 -0
- package/dist/Overview-CCu2PHai.mjs +289 -0
- package/dist/Overview-CQRpFhbJ.mjs +286 -0
- package/dist/Overview-CTs7sX4d.js +1 -0
- package/dist/Overview-Cj89XXKN.js +1 -0
- package/dist/Overview-D2u-leeO.js +1 -0
- package/dist/Overview-D_2wozCG.mjs +1733 -0
- package/dist/Overview-D_c18mbR.mjs +248 -0
- package/dist/Overview-Dffo-zH4.mjs +11 -0
- package/dist/Overview-g4Rcj245.js +1 -0
- package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
- package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
- package/dist/TableDataWidget-BwqWFH4A.js +1 -0
- package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
- package/dist/TableOverviewCard-BPWCqo56.js +1 -0
- package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
- package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
- package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
- package/dist/TableView-CwhZ9YN2.js +4 -0
- package/dist/TableView-DX9PKS8N.mjs +9673 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
- package/dist/Test-CzmOmi53.mjs +447 -0
- package/dist/Test-USDtNFY1.js +1 -0
- package/dist/UserDetail-DpUL3mhk.mjs +1483 -0
- package/dist/UserDetail-KRIfxaYd.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
- package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
- package/dist/index-6hZ6MYY6.js +1 -0
- package/dist/index-BVmmicu3.mjs +14 -0
- package/dist/index-CQuN5rKx.js +1 -0
- package/dist/index-ChHD_1Cf.js +144 -0
- package/dist/index-CnDGeInm.js +1 -0
- package/dist/index-CqDTc5Ig.mjs +20 -0
- package/dist/index-CvV4nVWI.js +1 -0
- package/dist/index-CyvvAdt4.js +1 -0
- package/dist/index-DH2z0W_w.mjs +19012 -0
- package/dist/index-DIRD7t5_.mjs +20 -0
- package/dist/index-DZKzj48V.mjs +17 -0
- package/dist/index-OJuBYR60.mjs +57 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +480 -103
- package/dist/orders-C_sz8J9b.js +1 -0
- package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +2696 -605
- package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
- package/dist/src/appointments/index.d.ts +93 -3
- package/dist/src/appointments/reservation-summary.d.ts +48 -0
- package/dist/src/appointments/server.d.ts +1 -0
- package/dist/src/appointments/tools.d.ts +93 -3
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.d.ts +1 -1
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/resizeHistory.d.ts +9 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +3 -1
- package/dist/src/filezone/config.d.ts +31 -0
- package/dist/src/filezone/index.d.ts +43 -0
- package/dist/src/filezone/index.vue.d.ts +2 -0
- package/dist/src/filezone/metadata.d.ts +2 -0
- package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
- package/dist/src/filezone/permissions.d.ts +5 -0
- package/dist/src/filezone/routes.d.ts +5 -0
- package/dist/src/filezone/server.d.ts +36 -0
- package/dist/src/firebaseAuthManager/components/DeleteUserDialog.vue.d.ts +25 -0
- package/dist/src/firebaseAuthManager/components/ReasonActionDialog.vue.d.ts +23 -0
- package/dist/src/firebaseAuthManager/components/UserStatusBadge.vue.d.ts +5 -0
- package/dist/src/firebaseAuthManager/config.d.ts +151 -0
- package/dist/src/firebaseAuthManager/index.d.ts +163 -0
- package/dist/src/firebaseAuthManager/index.vue.d.ts +14 -0
- package/dist/src/firebaseAuthManager/metadata.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/Overview.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/UserDetail.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/permissions.d.ts +5 -0
- package/dist/src/firebaseAuthManager/routes.d.ts +5 -0
- package/dist/src/firebaseAuthManager/server.d.ts +162 -0
- package/dist/src/firebaseAuthManager/types.d.ts +84 -0
- package/dist/src/formBuilder/components/FormPreviewDialog.vue.d.ts +12 -0
- package/dist/src/formBuilder/components/FormStatusBadge.vue.d.ts +9 -0
- package/dist/src/formBuilder/config.d.ts +31 -0
- package/dist/src/formBuilder/index.d.ts +44 -0
- package/dist/src/formBuilder/index.vue.d.ts +14 -0
- package/dist/src/formBuilder/lib/forms.d.ts +11 -0
- package/dist/src/formBuilder/metadata.d.ts +2 -0
- package/dist/src/formBuilder/pages/Editor.vue.d.ts +2 -0
- package/dist/src/formBuilder/pages/Overview.vue.d.ts +2 -0
- package/dist/src/formBuilder/permissions.d.ts +5 -0
- package/dist/src/formBuilder/routes.d.ts +5 -0
- package/dist/src/formBuilder/server.d.ts +87 -0
- package/dist/src/formBuilder/tools.d.ts +1 -0
- package/dist/src/formBuilder/types.d.ts +46 -0
- package/dist/src/helpbot/composables/useHelpbotApi.d.ts +18 -0
- package/dist/src/helpbot/config.d.ts +17 -0
- package/dist/src/helpbot/index.d.ts +29 -0
- package/dist/src/helpbot/index.vue.d.ts +2 -0
- package/dist/src/helpbot/metadata.d.ts +2 -0
- package/dist/src/helpbot/pages/Knowledge.vue.d.ts +4 -0
- package/dist/src/helpbot/pages/Overview.vue.d.ts +2 -0
- package/dist/src/helpbot/pages/Test.vue.d.ts +4 -0
- package/dist/src/helpbot/permissions.d.ts +5 -0
- package/dist/src/helpbot/routes.d.ts +5 -0
- package/dist/src/helpbot/types.d.ts +42 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/mailTemplates/builder-types.d.ts +40 -0
- package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
- package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
- package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
- package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
- package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
- package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
- package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
- package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
- package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
- package/dist/src/mailTemplates/config.d.ts +10 -4
- package/dist/src/mailTemplates/defaults.d.ts +10 -0
- package/dist/src/mailTemplates/editor-state.d.ts +21 -0
- package/dist/src/mailTemplates/index.d.ts +11 -5
- package/dist/src/mailTemplates/index.vue.d.ts +2 -4
- package/dist/src/mailTemplates/metadata.d.ts +1 -1
- package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
- package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
- package/dist/src/mailTemplates/server.d.ts +23 -0
- package/dist/src/server-handlers.d.ts +6 -0
- package/dist/src/table/badge-filter-utils.d.ts +8 -0
- package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
- package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
- package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
- package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
- package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
- package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
- package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
- package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
- package/dist/src/table/composables/useTableClock.d.ts +4 -0
- package/dist/src/table/display-utils.d.ts +35 -0
- package/dist/src/table/row-value.d.ts +1 -0
- package/dist/src/table/stat-utils.d.ts +9 -0
- package/dist/src/table/tool-utils.d.ts +1 -1
- package/dist/src/table/types.d.ts +54 -1
- package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
- package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
- package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
- package/dist/src/whatsappBusiness/config.d.ts +51 -0
- package/dist/src/whatsappBusiness/connection.d.ts +77 -0
- package/dist/src/whatsappBusiness/index.d.ts +63 -0
- package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
- package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
- package/dist/src/whatsappBusiness/provider.d.ts +21 -0
- package/dist/src/whatsappBusiness/routes.d.ts +5 -0
- package/dist/src/whatsappBusiness/server.d.ts +14 -0
- package/dist/src/whatsappBusiness/templates.d.ts +94 -0
- package/dist/src/whatsappBusiness/types.d.ts +162 -0
- package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
- package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
- package/dist/types-9N-DKxNj.mjs +250 -0
- package/dist/types-B5MifmeF.mjs +2696 -0
- package/dist/types-Cem0vPo_.js +1 -0
- package/dist/types-D5dgTskW.js +1 -0
- package/dist/useHelpbotApi-BIIungOh.js +1 -0
- package/dist/useHelpbotApi-HC9JSiSn.mjs +229 -0
- package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
- package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
- package/dist/vee-validate-zod-CWZwNTWE.js +1 -0
- package/dist/vee-validate-zod-D0WaDgDZ.mjs +1780 -0
- package/package.json +2 -2
- package/src/appointments/tools.ts +52 -2
- package/src/formBuilder/tools.ts +1 -0
- package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
- package/dist/AppointmentListTable-Dieu9US_.js +0 -1
- package/dist/ContentEditor-C-Wm48ai.js +0 -467
- package/dist/Detail-BCUUNWvp.js +0 -1
- package/dist/Detail-Byk781b4.mjs +0 -26
- package/dist/Detail-DGg_xXZc.js +0 -1
- package/dist/Detail-Sc2qZdxj.js +0 -1
- package/dist/Detail-mvSGbnFU.js +0 -1
- package/dist/Overview-BDlBCUI_.js +0 -1
- package/dist/Overview-Su8ZUbMs.mjs +0 -26
- package/dist/TableDataWidget-7qvC3Egd.js +0 -1
- package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
- package/dist/TableOverviewCard-AFq-puJs.js +0 -1
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
- package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
- package/dist/TableView-BkwoKREo.js +0 -4
- package/dist/TableView-C4Zyp8d7.mjs +0 -8228
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
- package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
- package/dist/dateRangePresets-CPWqst_x.js +0 -1
- package/dist/orders-DUa2PVoa.js +0 -1
- package/dist/vee-validate-zod-SjDT8X35.mjs +0 -4404
- package/dist/vee-validate-zod-VCmLnrtQ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("lucide-vue-next"),x=require("@oneclick.dev/cms-kit"),S={class:"mx-auto flex w-full min-w-0 max-w-6xl flex-1 flex-col px-4 py-6 sm:px-6 sm:py-10 lg:px-8"},U={class:"flex flex-wrap items-start justify-between gap-4"},L={key:0,class:"mt-8 rounded-xl border border-dashed p-10 text-center"},j={key:0,role:"alert",class:"mt-6 flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive"},R={key:1,role:"status",class:"mt-6 rounded-lg border border-emerald-300/50 bg-emerald-50 p-3 text-sm text-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300"},A={class:"flex flex-col items-center text-center"},I={class:"flex size-11 items-center justify-center rounded-full bg-muted"},P=["disabled"],q={class:"mt-8 min-w-0"},K={class:"flex items-center justify-between border-b pb-4"},O={class:"min-w-0"},W=["title"],Y={class:"text-sm text-muted-foreground"},Z={key:0,role:"status",class:"flex items-center justify-center gap-2 py-16 text-sm text-muted-foreground"},G={key:1,class:"py-16 text-center text-sm text-muted-foreground"},H={key:2,class:"divide-y"},J={class:"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted"},Q={class:"min-w-0 flex-1"},X=["title","onClick"],ee=["title"],te={key:2,class:"mt-0.5 text-xs text-muted-foreground"},oe={key:0,class:"ml-auto flex shrink-0 gap-2"},le=["href","aria-label"],ne=["href","aria-label"],re={key:3,class:"border-t py-5 text-center"},ae=e.defineComponent({__name:"Overview",setup(se){const B=x.useModuleApi(),{moduleId:_}=x.useModuleRoute(),{hasPermission:$,isAdmin:D}=x.useModulePermissions();x.useModuleBreadcrumbs(()=>[]);const y=e.computed(()=>$("view-files")),g=e.computed(()=>D()),i=e.ref([]),a=e.ref(""),p=e.ref(null),s=e.ref(!1),d=e.ref(!1),f=e.ref(!1),b=e.ref(""),c=e.ref(""),v=e.ref(""),k=e.ref(null);function V(l,t){const n=l;return n?.data?.statusMessage||n?.message||t}async function u(l=!0){if(!y.value||s.value)return;s.value=!0,c.value="";const t=l?null:p.value;try{const n=new URLSearchParams;a.value&&n.set("folder",a.value),t&&n.set("cursor",t);const o=await B.get(`/files?${n}`);i.value=l?o.files:[...i.value,...o.files],p.value=o.nextCursor}catch(n){c.value=V(n,"Files could not be loaded.")}finally{s.value=!1}}async function N(l){if(!l||!g.value||d.value)return;const t=Array.from(l);if(!t.length)return;d.value=!0,c.value="",v.value="";let n=0;try{for(const[o,m]of t.entries()){if(!m.size||m.size>25*1024*1024)throw new Error(`${m.name} must be between 1 byte and 25 MB.`);b.value=`Uploading ${o+1} of ${t.length}…`;const E=new FormData;E.append("file",m),await B.post(`/files?folder=${encodeURIComponent(a.value)}`,{body:E}),n++}v.value=`${n} ${n===1?"file":"files"} uploaded.`}catch(o){c.value=`${n} of ${t.length} uploaded. ${V(o,"Upload failed.")}`}finally{k.value&&(k.value.value=""),b.value="",d.value=!1,n&&await u()}}function F(l){f.value=!1,l.preventDefault(),g.value&&N(l.dataTransfer?.files||null)}function h(l){a.value=l,i.value=[],p.value=null,u()}function w(l,t){return`/api/v1/modules/${encodeURIComponent(_)}/files/content?path=${encodeURIComponent(l.path)}${t?"&view=1":""}`}function z(l){return/^(application\/pdf|image\/(jpeg|png|gif|webp))$/.test(l.content_type||"")}function T(l){return l.directory?r.Folder:l.content_type?.startsWith("image/")?r.FileImage:l.content_type==="application/pdf"||l.content_type?.startsWith("text/")?r.FileText:r.File}function M(l){return l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(1)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function C(l){if(!l)return"";const t=new Date(l);return Number.isNaN(t.getTime())?"":t.toLocaleDateString()}return e.onMounted(()=>u()),(l,t)=>{const n=e.resolveComponent("Button");return e.openBlock(),e.createElementBlock("main",S,[e.createElementVNode("header",U,[t[8]||(t[8]=e.createElementVNode("div",null,[e.createElementVNode("h1",{class:"text-2xl font-semibold tracking-tight sm:text-3xl"},"File Zone"),e.createElementVNode("p",{class:"mt-2 text-sm leading-6 text-muted-foreground"},"Files shared with people who have access to this module.")],-1)),y.value?(e.openBlock(),e.createBlock(n,{key:0,variant:"outline",size:"sm",disabled:s.value||d.value,onClick:t[0]||(t[0]=o=>u())},{default:e.withCtx(()=>[e.createVNode(e.unref(r.RefreshCw),{class:e.normalizeClass(["size-4",{"animate-spin":s.value}])},null,8,["class"]),t[7]||(t[7]=e.createTextVNode(" Refresh ",-1))]),_:1},8,["disabled"])):e.createCommentVNode("",!0)]),y.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(e.unref(r.AlertCircle),{class:"mt-0.5 size-4 shrink-0"}),e.createTextVNode(e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("p",R,e.toDisplayString(v.value),1)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("section",{key:2,class:e.normalizeClass(["mt-7 rounded-xl border border-dashed p-6 sm:p-8",f.value?"border-primary bg-primary/5":"border-border"]),onDragover:t[3]||(t[3]=e.withModifiers(o=>f.value=!0,["prevent"])),onDragleave:t[4]||(t[4]=e.withModifiers(o=>f.value=!1,["prevent"])),onDrop:F},[e.createElementVNode("div",A,[e.createElementVNode("div",I,[e.createVNode(e.unref(r.UploadCloud),{class:"size-5 text-muted-foreground"})]),t[10]||(t[10]=e.createElementVNode("h2",{class:"mt-3 font-medium"},"Upload files for your team",-1)),t[11]||(t[11]=e.createElementVNode("p",{class:"mt-1 text-sm text-muted-foreground"},"Choose files or drop them here. Maximum 25 MB per file.",-1)),e.createElementVNode("input",{ref_key:"picker",ref:k,class:"sr-only",type:"file",multiple:"","aria-label":"Choose files to upload",disabled:d.value,onChange:t[1]||(t[1]=o=>N(o.target.files))},null,40,P),e.createVNode(n,{class:"mt-4",disabled:d.value,onClick:t[2]||(t[2]=o=>k.value?.click())},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createBlock(e.unref(r.Loader2),{key:0,class:"size-4 animate-spin"})):(e.openBlock(),e.createBlock(e.unref(r.UploadCloud),{key:1,class:"size-4"})),e.createTextVNode(" "+e.toDisplayString(b.value||"Choose files"),1)]),_:1},8,["disabled"])])],34)):e.createCommentVNode("",!0),e.createElementVNode("section",q,[e.createElementVNode("div",K,[e.createElementVNode("div",O,[t[12]||(t[12]=e.createElementVNode("h2",{class:"text-base font-semibold"},"Connected files",-1)),a.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"mt-1 text-sm text-primary hover:underline",onClick:t[5]||(t[5]=o=>h(a.value.split("/").slice(0,-1).join("/")))},"← Back to parent folder")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("p",{key:1,class:"truncate text-xs text-muted-foreground",title:a.value},e.toDisplayString(a.value),9,W)):e.createCommentVNode("",!0)]),e.createElementVNode("span",Y,e.toDisplayString(i.value.length)+" loaded",1)]),s.value&&!i.value.length?(e.openBlock(),e.createElementBlock("div",Z,[e.createVNode(e.unref(r.Loader2),{class:"size-4 animate-spin"}),t[13]||(t[13]=e.createTextVNode(" Loading files…",-1))])):!i.value.length&&!c.value?(e.openBlock(),e.createElementBlock("div",G,"This folder is empty.")):(e.openBlock(),e.createElementBlock("ul",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,o=>(e.openBlock(),e.createElementBlock("li",{key:o.path,class:"flex min-w-0 flex-wrap items-center gap-3 py-4 sm:flex-nowrap"},[e.createElementVNode("div",J,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(T(o)),{class:"size-5 text-muted-foreground"}))]),e.createElementVNode("div",Q,[o.directory?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"block max-w-full truncate text-left text-sm font-medium hover:underline",title:o.name,onClick:m=>h(o.path)},e.toDisplayString(o.name),9,X)):(e.openBlock(),e.createElementBlock("p",{key:1,class:"truncate text-sm font-medium",title:o.name},e.toDisplayString(o.name),9,ee)),o.directory?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("p",te,[e.createTextVNode(e.toDisplayString(M(o.size_bytes)),1),C(o.modified_at)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" · "+e.toDisplayString(C(o.modified_at)),1)],64)):e.createCommentVNode("",!0)]))]),o.directory?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",oe,[z(o)?(e.openBlock(),e.createBlock(n,{key:0,"as-child":"",variant:"outline",size:"sm"},{default:e.withCtx(()=>[e.createElementVNode("a",{href:w(o,!0),target:"_blank",rel:"noopener noreferrer","aria-label":`View ${o.name}`},[e.createVNode(e.unref(r.Eye),{class:"size-4"}),t[14]||(t[14]=e.createTextVNode(" View",-1))],8,le)]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(n,{"as-child":"",variant:"outline",size:"sm"},{default:e.withCtx(()=>[e.createElementVNode("a",{href:w(o,!1),"aria-label":`Download ${o.name}`},[e.createVNode(e.unref(r.Download),{class:"size-4"}),t[15]||(t[15]=e.createTextVNode(" Download",-1))],8,ne)]),_:2},1024)]))]))),128))])),p.value?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(n,{variant:"outline",disabled:s.value,onClick:t[6]||(t[6]=o=>u(!1))},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(e.unref(r.Loader2),{key:0,class:"size-4 animate-spin"})):e.createCommentVNode("",!0),t[16]||(t[16]=e.createTextVNode(" Load more",-1))]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock("section",L,[...t[9]||(t[9]=[e.createElementVNode("h2",{class:"font-medium"},"You cannot view these files",-1),e.createElementVNode("p",{class:"mt-2 text-sm text-muted-foreground"},"Ask an administrator for access and the View and download files permission.",-1)])]))])}}});exports.default=ae;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { defineComponent as G, computed as I, ref as i, onMounted as H, resolveComponent as J, openBlock as o, createElementBlock as a, createElementVNode as n, createBlock as g, withCtx as k, createVNode as d, unref as m, normalizeClass as T, createTextVNode as c, createCommentVNode as r, Fragment as D, toDisplayString as f, withModifiers as E, renderList as Q, resolveDynamicComponent as X } from "vue";
|
|
2
|
+
import { RefreshCw as ee, AlertCircle as te, UploadCloud as P, Loader2 as M, Eye as se, Download as oe, Folder as le, FileImage as ne, FileText as ae, File as re } from "lucide-vue-next";
|
|
3
|
+
import { useModuleApi as ie, useModuleRoute as ue, useModulePermissions as de, useModuleBreadcrumbs as me } from "@oneclick.dev/cms-kit";
|
|
4
|
+
const ce = { class: "mx-auto flex w-full min-w-0 max-w-6xl flex-1 flex-col px-4 py-6 sm:px-6 sm:py-10 lg:px-8" }, fe = { class: "flex flex-wrap items-start justify-between gap-4" }, pe = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "mt-8 rounded-xl border border-dashed p-10 text-center"
|
|
7
|
+
}, ve = {
|
|
8
|
+
key: 0,
|
|
9
|
+
role: "alert",
|
|
10
|
+
class: "mt-6 flex items-start gap-2 rounded-lg border border-destructive/30 bg-destructive/5 p-3 text-sm text-destructive"
|
|
11
|
+
}, xe = {
|
|
12
|
+
key: 1,
|
|
13
|
+
role: "status",
|
|
14
|
+
class: "mt-6 rounded-lg border border-emerald-300/50 bg-emerald-50 p-3 text-sm text-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300"
|
|
15
|
+
}, ye = { class: "flex flex-col items-center text-center" }, ge = { class: "flex size-11 items-center justify-center rounded-full bg-muted" }, be = ["disabled"], he = { class: "mt-8 min-w-0" }, ke = { class: "flex items-center justify-between border-b pb-4" }, we = { class: "min-w-0" }, _e = ["title"], $e = { class: "text-sm text-muted-foreground" }, Ce = {
|
|
16
|
+
key: 0,
|
|
17
|
+
role: "status",
|
|
18
|
+
class: "flex items-center justify-center gap-2 py-16 text-sm text-muted-foreground"
|
|
19
|
+
}, ze = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "py-16 text-center text-sm text-muted-foreground"
|
|
22
|
+
}, Fe = {
|
|
23
|
+
key: 2,
|
|
24
|
+
class: "divide-y"
|
|
25
|
+
}, Be = { class: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted" }, De = { class: "min-w-0 flex-1" }, Me = ["title", "onClick"], Ue = ["title"], Le = {
|
|
26
|
+
key: 2,
|
|
27
|
+
class: "mt-0.5 text-xs text-muted-foreground"
|
|
28
|
+
}, Ve = {
|
|
29
|
+
key: 0,
|
|
30
|
+
class: "ml-auto flex shrink-0 gap-2"
|
|
31
|
+
}, je = ["href", "aria-label"], Ne = ["href", "aria-label"], Re = {
|
|
32
|
+
key: 3,
|
|
33
|
+
class: "border-t py-5 text-center"
|
|
34
|
+
}, Pe = /* @__PURE__ */ G({
|
|
35
|
+
__name: "Overview",
|
|
36
|
+
setup(Ae) {
|
|
37
|
+
const U = ie(), { moduleId: S } = ue(), { hasPermission: W, isAdmin: K } = de();
|
|
38
|
+
me(() => []);
|
|
39
|
+
const z = I(() => W("view-files")), F = I(() => K()), v = i([]), u = i(""), w = i(null), p = i(!1), x = i(!1), _ = i(!1), B = i(""), y = i(""), $ = i(""), C = i(null);
|
|
40
|
+
function L(s, e) {
|
|
41
|
+
const l = s;
|
|
42
|
+
return l?.data?.statusMessage || l?.message || e;
|
|
43
|
+
}
|
|
44
|
+
async function b(s = !0) {
|
|
45
|
+
if (!z.value || p.value) return;
|
|
46
|
+
p.value = !0, y.value = "";
|
|
47
|
+
const e = s ? null : w.value;
|
|
48
|
+
try {
|
|
49
|
+
const l = new URLSearchParams();
|
|
50
|
+
u.value && l.set("folder", u.value), e && l.set("cursor", e);
|
|
51
|
+
const t = await U.get(`/files?${l}`);
|
|
52
|
+
v.value = s ? t.files : [...v.value, ...t.files], w.value = t.nextCursor;
|
|
53
|
+
} catch (l) {
|
|
54
|
+
y.value = L(l, "Files could not be loaded.");
|
|
55
|
+
} finally {
|
|
56
|
+
p.value = !1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function V(s) {
|
|
60
|
+
if (!s || !F.value || x.value) return;
|
|
61
|
+
const e = Array.from(s);
|
|
62
|
+
if (!e.length) return;
|
|
63
|
+
x.value = !0, y.value = "", $.value = "";
|
|
64
|
+
let l = 0;
|
|
65
|
+
try {
|
|
66
|
+
for (const [t, h] of e.entries()) {
|
|
67
|
+
if (!h.size || h.size > 25 * 1024 * 1024)
|
|
68
|
+
throw new Error(`${h.name} must be between 1 byte and 25 MB.`);
|
|
69
|
+
B.value = `Uploading ${t + 1} of ${e.length}…`;
|
|
70
|
+
const A = new FormData();
|
|
71
|
+
A.append("file", h), await U.post(`/files?folder=${encodeURIComponent(u.value)}`, { body: A }), l++;
|
|
72
|
+
}
|
|
73
|
+
$.value = `${l} ${l === 1 ? "file" : "files"} uploaded.`;
|
|
74
|
+
} catch (t) {
|
|
75
|
+
y.value = `${l} of ${e.length} uploaded. ${L(t, "Upload failed.")}`;
|
|
76
|
+
} finally {
|
|
77
|
+
C.value && (C.value.value = ""), B.value = "", x.value = !1, l && await b();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function O(s) {
|
|
81
|
+
_.value = !1, s.preventDefault(), F.value && V(s.dataTransfer?.files || null);
|
|
82
|
+
}
|
|
83
|
+
function j(s) {
|
|
84
|
+
u.value = s, v.value = [], w.value = null, b();
|
|
85
|
+
}
|
|
86
|
+
function N(s, e) {
|
|
87
|
+
return `/api/v1/modules/${encodeURIComponent(S)}/files/content?path=${encodeURIComponent(s.path)}${e ? "&view=1" : ""}`;
|
|
88
|
+
}
|
|
89
|
+
function Y(s) {
|
|
90
|
+
return /^(application\/pdf|image\/(jpeg|png|gif|webp))$/.test(s.content_type || "");
|
|
91
|
+
}
|
|
92
|
+
function Z(s) {
|
|
93
|
+
return s.directory ? le : s.content_type?.startsWith("image/") ? ne : s.content_type === "application/pdf" || s.content_type?.startsWith("text/") ? ae : re;
|
|
94
|
+
}
|
|
95
|
+
function q(s) {
|
|
96
|
+
return s < 1024 ? `${s} B` : s < 1024 * 1024 ? `${(s / 1024).toFixed(1)} KB` : `${(s / (1024 * 1024)).toFixed(1)} MB`;
|
|
97
|
+
}
|
|
98
|
+
function R(s) {
|
|
99
|
+
if (!s) return "";
|
|
100
|
+
const e = new Date(s);
|
|
101
|
+
return Number.isNaN(e.getTime()) ? "" : e.toLocaleDateString();
|
|
102
|
+
}
|
|
103
|
+
return H(() => b()), (s, e) => {
|
|
104
|
+
const l = J("Button");
|
|
105
|
+
return o(), a("main", ce, [
|
|
106
|
+
n("header", fe, [
|
|
107
|
+
e[8] || (e[8] = n("div", null, [
|
|
108
|
+
n("h1", { class: "text-2xl font-semibold tracking-tight sm:text-3xl" }, "File Zone"),
|
|
109
|
+
n("p", { class: "mt-2 text-sm leading-6 text-muted-foreground" }, "Files shared with people who have access to this module.")
|
|
110
|
+
], -1)),
|
|
111
|
+
z.value ? (o(), g(l, {
|
|
112
|
+
key: 0,
|
|
113
|
+
variant: "outline",
|
|
114
|
+
size: "sm",
|
|
115
|
+
disabled: p.value || x.value,
|
|
116
|
+
onClick: e[0] || (e[0] = (t) => b())
|
|
117
|
+
}, {
|
|
118
|
+
default: k(() => [
|
|
119
|
+
d(m(ee), {
|
|
120
|
+
class: T(["size-4", { "animate-spin": p.value }])
|
|
121
|
+
}, null, 8, ["class"]),
|
|
122
|
+
e[7] || (e[7] = c(" Refresh ", -1))
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
}, 8, ["disabled"])) : r("", !0)
|
|
126
|
+
]),
|
|
127
|
+
z.value ? (o(), a(D, { key: 1 }, [
|
|
128
|
+
y.value ? (o(), a("div", ve, [
|
|
129
|
+
d(m(te), { class: "mt-0.5 size-4 shrink-0" }),
|
|
130
|
+
c(f(y.value), 1)
|
|
131
|
+
])) : r("", !0),
|
|
132
|
+
$.value ? (o(), a("p", xe, f($.value), 1)) : r("", !0),
|
|
133
|
+
F.value ? (o(), a("section", {
|
|
134
|
+
key: 2,
|
|
135
|
+
class: T(["mt-7 rounded-xl border border-dashed p-6 sm:p-8", _.value ? "border-primary bg-primary/5" : "border-border"]),
|
|
136
|
+
onDragover: e[3] || (e[3] = E((t) => _.value = !0, ["prevent"])),
|
|
137
|
+
onDragleave: e[4] || (e[4] = E((t) => _.value = !1, ["prevent"])),
|
|
138
|
+
onDrop: O
|
|
139
|
+
}, [
|
|
140
|
+
n("div", ye, [
|
|
141
|
+
n("div", ge, [
|
|
142
|
+
d(m(P), { class: "size-5 text-muted-foreground" })
|
|
143
|
+
]),
|
|
144
|
+
e[10] || (e[10] = n("h2", { class: "mt-3 font-medium" }, "Upload files for your team", -1)),
|
|
145
|
+
e[11] || (e[11] = n("p", { class: "mt-1 text-sm text-muted-foreground" }, "Choose files or drop them here. Maximum 25 MB per file.", -1)),
|
|
146
|
+
n("input", {
|
|
147
|
+
ref_key: "picker",
|
|
148
|
+
ref: C,
|
|
149
|
+
class: "sr-only",
|
|
150
|
+
type: "file",
|
|
151
|
+
multiple: "",
|
|
152
|
+
"aria-label": "Choose files to upload",
|
|
153
|
+
disabled: x.value,
|
|
154
|
+
onChange: e[1] || (e[1] = (t) => V(t.target.files))
|
|
155
|
+
}, null, 40, be),
|
|
156
|
+
d(l, {
|
|
157
|
+
class: "mt-4",
|
|
158
|
+
disabled: x.value,
|
|
159
|
+
onClick: e[2] || (e[2] = (t) => C.value?.click())
|
|
160
|
+
}, {
|
|
161
|
+
default: k(() => [
|
|
162
|
+
x.value ? (o(), g(m(M), {
|
|
163
|
+
key: 0,
|
|
164
|
+
class: "size-4 animate-spin"
|
|
165
|
+
})) : (o(), g(m(P), {
|
|
166
|
+
key: 1,
|
|
167
|
+
class: "size-4"
|
|
168
|
+
})),
|
|
169
|
+
c(" " + f(B.value || "Choose files"), 1)
|
|
170
|
+
]),
|
|
171
|
+
_: 1
|
|
172
|
+
}, 8, ["disabled"])
|
|
173
|
+
])
|
|
174
|
+
], 34)) : r("", !0),
|
|
175
|
+
n("section", he, [
|
|
176
|
+
n("div", ke, [
|
|
177
|
+
n("div", we, [
|
|
178
|
+
e[12] || (e[12] = n("h2", { class: "text-base font-semibold" }, "Connected files", -1)),
|
|
179
|
+
u.value ? (o(), a("button", {
|
|
180
|
+
key: 0,
|
|
181
|
+
type: "button",
|
|
182
|
+
class: "mt-1 text-sm text-primary hover:underline",
|
|
183
|
+
onClick: e[5] || (e[5] = (t) => j(u.value.split("/").slice(0, -1).join("/")))
|
|
184
|
+
}, "← Back to parent folder")) : r("", !0),
|
|
185
|
+
u.value ? (o(), a("p", {
|
|
186
|
+
key: 1,
|
|
187
|
+
class: "truncate text-xs text-muted-foreground",
|
|
188
|
+
title: u.value
|
|
189
|
+
}, f(u.value), 9, _e)) : r("", !0)
|
|
190
|
+
]),
|
|
191
|
+
n("span", $e, f(v.value.length) + " loaded", 1)
|
|
192
|
+
]),
|
|
193
|
+
p.value && !v.value.length ? (o(), a("div", Ce, [
|
|
194
|
+
d(m(M), { class: "size-4 animate-spin" }),
|
|
195
|
+
e[13] || (e[13] = c(" Loading files…", -1))
|
|
196
|
+
])) : !v.value.length && !y.value ? (o(), a("div", ze, "This folder is empty.")) : (o(), a("ul", Fe, [
|
|
197
|
+
(o(!0), a(D, null, Q(v.value, (t) => (o(), a("li", {
|
|
198
|
+
key: t.path,
|
|
199
|
+
class: "flex min-w-0 flex-wrap items-center gap-3 py-4 sm:flex-nowrap"
|
|
200
|
+
}, [
|
|
201
|
+
n("div", Be, [
|
|
202
|
+
(o(), g(X(Z(t)), { class: "size-5 text-muted-foreground" }))
|
|
203
|
+
]),
|
|
204
|
+
n("div", De, [
|
|
205
|
+
t.directory ? (o(), a("button", {
|
|
206
|
+
key: 0,
|
|
207
|
+
type: "button",
|
|
208
|
+
class: "block max-w-full truncate text-left text-sm font-medium hover:underline",
|
|
209
|
+
title: t.name,
|
|
210
|
+
onClick: (h) => j(t.path)
|
|
211
|
+
}, f(t.name), 9, Me)) : (o(), a("p", {
|
|
212
|
+
key: 1,
|
|
213
|
+
class: "truncate text-sm font-medium",
|
|
214
|
+
title: t.name
|
|
215
|
+
}, f(t.name), 9, Ue)),
|
|
216
|
+
t.directory ? r("", !0) : (o(), a("p", Le, [
|
|
217
|
+
c(f(q(t.size_bytes)), 1),
|
|
218
|
+
R(t.modified_at) ? (o(), a(D, { key: 0 }, [
|
|
219
|
+
c(" · " + f(R(t.modified_at)), 1)
|
|
220
|
+
], 64)) : r("", !0)
|
|
221
|
+
]))
|
|
222
|
+
]),
|
|
223
|
+
t.directory ? r("", !0) : (o(), a("div", Ve, [
|
|
224
|
+
Y(t) ? (o(), g(l, {
|
|
225
|
+
key: 0,
|
|
226
|
+
"as-child": "",
|
|
227
|
+
variant: "outline",
|
|
228
|
+
size: "sm"
|
|
229
|
+
}, {
|
|
230
|
+
default: k(() => [
|
|
231
|
+
n("a", {
|
|
232
|
+
href: N(t, !0),
|
|
233
|
+
target: "_blank",
|
|
234
|
+
rel: "noopener noreferrer",
|
|
235
|
+
"aria-label": `View ${t.name}`
|
|
236
|
+
}, [
|
|
237
|
+
d(m(se), { class: "size-4" }),
|
|
238
|
+
e[14] || (e[14] = c(" View", -1))
|
|
239
|
+
], 8, je)
|
|
240
|
+
]),
|
|
241
|
+
_: 2
|
|
242
|
+
}, 1024)) : r("", !0),
|
|
243
|
+
d(l, {
|
|
244
|
+
"as-child": "",
|
|
245
|
+
variant: "outline",
|
|
246
|
+
size: "sm"
|
|
247
|
+
}, {
|
|
248
|
+
default: k(() => [
|
|
249
|
+
n("a", {
|
|
250
|
+
href: N(t, !1),
|
|
251
|
+
"aria-label": `Download ${t.name}`
|
|
252
|
+
}, [
|
|
253
|
+
d(m(oe), { class: "size-4" }),
|
|
254
|
+
e[15] || (e[15] = c(" Download", -1))
|
|
255
|
+
], 8, Ne)
|
|
256
|
+
]),
|
|
257
|
+
_: 2
|
|
258
|
+
}, 1024)
|
|
259
|
+
]))
|
|
260
|
+
]))), 128))
|
|
261
|
+
])),
|
|
262
|
+
w.value ? (o(), a("div", Re, [
|
|
263
|
+
d(l, {
|
|
264
|
+
variant: "outline",
|
|
265
|
+
disabled: p.value,
|
|
266
|
+
onClick: e[6] || (e[6] = (t) => b(!1))
|
|
267
|
+
}, {
|
|
268
|
+
default: k(() => [
|
|
269
|
+
p.value ? (o(), g(m(M), {
|
|
270
|
+
key: 0,
|
|
271
|
+
class: "size-4 animate-spin"
|
|
272
|
+
})) : r("", !0),
|
|
273
|
+
e[16] || (e[16] = c(" Load more", -1))
|
|
274
|
+
]),
|
|
275
|
+
_: 1
|
|
276
|
+
}, 8, ["disabled"])
|
|
277
|
+
])) : r("", !0)
|
|
278
|
+
])
|
|
279
|
+
], 64)) : (o(), a("section", pe, [...e[9] || (e[9] = [
|
|
280
|
+
n("h2", { class: "font-medium" }, "You cannot view these files", -1),
|
|
281
|
+
n("p", { class: "mt-2 text-sm text-muted-foreground" }, "Ask an administrator for access and the View and download files permission.", -1)
|
|
282
|
+
])]))
|
|
283
|
+
]);
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
export {
|
|
288
|
+
Pe as default
|
|
289
|
+
};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { defineComponent as Q, ref as v, computed as g, onMounted as Y, resolveComponent as f, openBlock as o, createElementBlock as r, createElementVNode as t, normalizeClass as R, createTextVNode as c, toDisplayString as i, unref as d, createCommentVNode as F, createBlock as y, withCtx as n, createVNode as s, Fragment as w, renderList as j } from "vue";
|
|
2
|
+
import { Plus as D, ShieldAlert as G, Search as J, AlertCircle as K, RefreshCw as W, FileText as X, ArrowRight as Z } from "lucide-vue-next";
|
|
3
|
+
import { useModule as ee, useModuleRoute as te, useModulePermissions as se, useModuleApi as le, useModuleBreadcrumbs as oe } from "@oneclick.dev/cms-kit";
|
|
4
|
+
import { _ as ae, f as ne, u as re, r as ie } from "./FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs";
|
|
5
|
+
const de = { class: "mx-auto flex w-full max-w-7xl flex-1 flex-col px-4 py-6 sm:px-6 sm:py-10 lg:px-8" }, ue = { class: "flex flex-col gap-5 sm:flex-row sm:items-start sm:justify-between" }, ce = { class: "max-w-2xl" }, me = { class: "flex flex-wrap items-center gap-2" }, fe = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "mt-1 text-xs text-muted-foreground"
|
|
8
|
+
}, pe = { class: "break-all rounded bg-muted px-1 py-0.5" }, xe = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "mt-10 flex flex-1 items-center justify-center rounded-xl border border-dashed p-8"
|
|
11
|
+
}, ve = { class: "max-w-md text-center" }, ge = { class: "mx-auto flex size-11 items-center justify-center rounded-full bg-muted" }, he = { class: "mt-8 flex flex-col gap-4 border-b pb-5 lg:flex-row lg:items-center lg:justify-between" }, be = {
|
|
12
|
+
class: "flex max-w-full gap-1 overflow-x-auto pb-1 lg:pb-0",
|
|
13
|
+
"aria-label": "Filter forms by status"
|
|
14
|
+
}, _e = { class: "rounded-full bg-background/80 px-1.5 py-0.5 text-[11px] text-muted-foreground" }, ye = { class: "relative w-full lg:w-80" }, we = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "grid gap-4 py-6 sm:grid-cols-2 xl:grid-cols-3",
|
|
17
|
+
"aria-label": "Loading forms"
|
|
18
|
+
}, ke = { class: "flex items-start justify-between gap-4" }, Ce = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "mt-6 rounded-xl border border-destructive/30 bg-destructive/5 p-6"
|
|
21
|
+
}, ze = { class: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between" }, Fe = { class: "flex items-start gap-3" }, je = { class: "mt-1 text-sm text-muted-foreground" }, Ne = {
|
|
22
|
+
key: 2,
|
|
23
|
+
class: "mt-6 flex min-h-80 items-center justify-center rounded-xl border border-dashed p-8"
|
|
24
|
+
}, Ve = { class: "max-w-md text-center" }, Be = { class: "mx-auto flex size-12 items-center justify-center rounded-full bg-muted" }, Se = { class: "mt-4 font-semibold" }, $e = { class: "mt-1 text-sm leading-6 text-muted-foreground" }, Te = {
|
|
25
|
+
key: 3,
|
|
26
|
+
class: "grid gap-4 py-6 sm:grid-cols-2 xl:grid-cols-3"
|
|
27
|
+
}, Ae = { class: "flex items-start justify-between gap-3" }, Le = { class: "w-fit max-w-full truncate rounded bg-muted px-2 py-1 text-xs text-muted-foreground" }, Me = { class: "line-clamp-3 text-sm leading-6 text-muted-foreground" }, Re = { class: "min-w-0 text-xs text-muted-foreground" }, De = { class: "truncate" }, Ie = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "mt-0.5"
|
|
30
|
+
}, Ee = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "mt-0.5"
|
|
33
|
+
}, Qe = /* @__PURE__ */ Q({
|
|
34
|
+
__name: "Overview",
|
|
35
|
+
setup(Pe) {
|
|
36
|
+
const { config: N } = ee(), { moduleId: I, navigateTo: k } = te(), { hasPermission: V } = se(), E = le();
|
|
37
|
+
oe(() => []);
|
|
38
|
+
const u = v([]), C = v(!1), h = v(""), b = v(""), x = v("all"), z = g(() => V("view-forms")), B = g(() => z.value && V("create-form")), _ = g(() => !!N.databaseIntegration), P = g(() => ({
|
|
39
|
+
all: u.value.length,
|
|
40
|
+
draft: u.value.filter((a) => a.status === "draft").length,
|
|
41
|
+
published: u.value.filter((a) => a.status === "published").length,
|
|
42
|
+
archived: u.value.filter((a) => a.status === "archived").length
|
|
43
|
+
})), S = g(() => {
|
|
44
|
+
const a = b.value.trim().toLocaleLowerCase();
|
|
45
|
+
return u.value.filter((e) => x.value !== "all" && e.status !== x.value ? !1 : a ? [e.name, e.key, e.description].some((m) => m?.toLocaleLowerCase().includes(a)) : !0);
|
|
46
|
+
});
|
|
47
|
+
async function $() {
|
|
48
|
+
if (z.value) {
|
|
49
|
+
C.value = !0, h.value = "";
|
|
50
|
+
try {
|
|
51
|
+
const a = await E.get("/forms");
|
|
52
|
+
u.value = re(a);
|
|
53
|
+
} catch (a) {
|
|
54
|
+
h.value = ie(a, "The forms could not be loaded from Firebase.");
|
|
55
|
+
} finally {
|
|
56
|
+
C.value = !1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function U(a) {
|
|
61
|
+
k(`forms/${encodeURIComponent(a.id)}`);
|
|
62
|
+
}
|
|
63
|
+
return Y($), (a, e) => {
|
|
64
|
+
const m = f("Button"), q = f("Input"), p = f("Skeleton"), T = f("CardHeader"), A = f("CardContent"), L = f("CardFooter"), M = f("Card"), H = f("CardTitle");
|
|
65
|
+
return o(), r("main", de, [
|
|
66
|
+
t("header", ue, [
|
|
67
|
+
t("div", ce, [
|
|
68
|
+
t("div", me, [
|
|
69
|
+
e[4] || (e[4] = t("h1", { class: "text-2xl font-semibold tracking-tight sm:text-3xl" }, "Forms", -1)),
|
|
70
|
+
t("span", {
|
|
71
|
+
class: R(["inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium", _.value ? "border-emerald-300/70 bg-emerald-50 text-emerald-800 dark:border-emerald-700/70 dark:bg-emerald-950/40 dark:text-emerald-300" : "border-destructive/30 bg-destructive/10 text-destructive"])
|
|
72
|
+
}, [
|
|
73
|
+
t("span", {
|
|
74
|
+
class: R(["size-1.5 rounded-full", _.value ? "bg-emerald-500" : "bg-destructive"])
|
|
75
|
+
}, null, 2),
|
|
76
|
+
c(" " + i(_.value ? "Firebase configured" : "Database not configured"), 1)
|
|
77
|
+
], 2)
|
|
78
|
+
]),
|
|
79
|
+
e[7] || (e[7] = t("p", { class: "mt-2 text-sm leading-6 text-muted-foreground sm:text-base" }, " Build drafts, preview their behavior, and publish exact revisions for your apps to load. ", -1)),
|
|
80
|
+
_.value ? (o(), r("p", fe, [
|
|
81
|
+
e[5] || (e[5] = c(" Definitions are stored in ", -1)),
|
|
82
|
+
t("code", pe, i(d(N).formsCollection) + "/" + i(d(I)) + "/forms", 1),
|
|
83
|
+
e[6] || (e[6] = c(". ", -1))
|
|
84
|
+
])) : F("", !0)
|
|
85
|
+
]),
|
|
86
|
+
B.value ? (o(), y(m, {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: "w-full shrink-0 sm:w-auto",
|
|
89
|
+
onClick: e[0] || (e[0] = (l) => d(k)("forms/new"))
|
|
90
|
+
}, {
|
|
91
|
+
default: n(() => [
|
|
92
|
+
s(d(D), { class: "size-4" }),
|
|
93
|
+
e[8] || (e[8] = c(" New form ", -1))
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
})) : F("", !0)
|
|
97
|
+
]),
|
|
98
|
+
z.value ? (o(), r(w, { key: 1 }, [
|
|
99
|
+
t("section", he, [
|
|
100
|
+
t("div", be, [
|
|
101
|
+
(o(), r(w, null, j(["all", "draft", "published", "archived"], (l) => s(m, {
|
|
102
|
+
key: l,
|
|
103
|
+
size: "sm",
|
|
104
|
+
variant: x.value === l ? "secondary" : "ghost",
|
|
105
|
+
class: "shrink-0 capitalize",
|
|
106
|
+
onClick: (O) => x.value = l
|
|
107
|
+
}, {
|
|
108
|
+
default: n(() => [
|
|
109
|
+
c(i(l) + " ", 1),
|
|
110
|
+
t("span", _e, i(P.value[l]), 1)
|
|
111
|
+
]),
|
|
112
|
+
_: 2
|
|
113
|
+
}, 1032, ["variant", "onClick"])), 64))
|
|
114
|
+
]),
|
|
115
|
+
t("div", ye, [
|
|
116
|
+
s(d(J), { class: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
117
|
+
s(q, {
|
|
118
|
+
modelValue: b.value,
|
|
119
|
+
"onUpdate:modelValue": e[1] || (e[1] = (l) => b.value = l),
|
|
120
|
+
type: "search",
|
|
121
|
+
placeholder: "Search by name, key, or description",
|
|
122
|
+
class: "pl-9",
|
|
123
|
+
"aria-label": "Search forms"
|
|
124
|
+
}, null, 8, ["modelValue"])
|
|
125
|
+
])
|
|
126
|
+
]),
|
|
127
|
+
C.value ? (o(), r("section", we, [
|
|
128
|
+
(o(), r(w, null, j(6, (l) => s(M, {
|
|
129
|
+
key: l,
|
|
130
|
+
class: "overflow-hidden"
|
|
131
|
+
}, {
|
|
132
|
+
default: n(() => [
|
|
133
|
+
s(T, { class: "gap-3" }, {
|
|
134
|
+
default: n(() => [
|
|
135
|
+
t("div", ke, [
|
|
136
|
+
s(p, { class: "h-5 w-2/3" }),
|
|
137
|
+
s(p, { class: "h-5 w-20 rounded-full" })
|
|
138
|
+
]),
|
|
139
|
+
s(p, { class: "h-4 w-2/5" })
|
|
140
|
+
]),
|
|
141
|
+
_: 1
|
|
142
|
+
}),
|
|
143
|
+
s(A, { class: "space-y-2" }, {
|
|
144
|
+
default: n(() => [
|
|
145
|
+
s(p, { class: "h-4 w-full" }),
|
|
146
|
+
s(p, { class: "h-4 w-4/5" })
|
|
147
|
+
]),
|
|
148
|
+
_: 1
|
|
149
|
+
}),
|
|
150
|
+
s(L, { class: "justify-between border-t pt-4" }, {
|
|
151
|
+
default: n(() => [
|
|
152
|
+
s(p, { class: "h-4 w-28" }),
|
|
153
|
+
s(p, { class: "size-8 rounded-md" })
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
})
|
|
157
|
+
]),
|
|
158
|
+
_: 1
|
|
159
|
+
})), 64))
|
|
160
|
+
])) : h.value ? (o(), r("section", Ce, [
|
|
161
|
+
t("div", ze, [
|
|
162
|
+
t("div", Fe, [
|
|
163
|
+
s(d(K), { class: "mt-0.5 size-5 shrink-0 text-destructive" }),
|
|
164
|
+
t("div", null, [
|
|
165
|
+
e[11] || (e[11] = t("h2", { class: "font-medium" }, "Could not load forms", -1)),
|
|
166
|
+
t("p", je, i(h.value), 1)
|
|
167
|
+
])
|
|
168
|
+
]),
|
|
169
|
+
s(m, {
|
|
170
|
+
variant: "outline",
|
|
171
|
+
class: "shrink-0",
|
|
172
|
+
onClick: $
|
|
173
|
+
}, {
|
|
174
|
+
default: n(() => [
|
|
175
|
+
s(d(W), { class: "size-4" }),
|
|
176
|
+
e[12] || (e[12] = c(" Try again ", -1))
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
})
|
|
180
|
+
])
|
|
181
|
+
])) : S.value.length === 0 ? (o(), r("section", Ne, [
|
|
182
|
+
t("div", Ve, [
|
|
183
|
+
t("div", Be, [
|
|
184
|
+
s(d(X), { class: "size-5 text-muted-foreground" })
|
|
185
|
+
]),
|
|
186
|
+
t("h2", Se, i(u.value.length === 0 ? "Create your first form" : "No forms match this view"), 1),
|
|
187
|
+
t("p", $e, i(u.value.length === 0 ? "Start with a blank draft, build its fields, then publish an immutable revision." : "Change the status filter or search query to find another form."), 1),
|
|
188
|
+
u.value.length === 0 && B.value ? (o(), y(m, {
|
|
189
|
+
key: 0,
|
|
190
|
+
class: "mt-5",
|
|
191
|
+
onClick: e[2] || (e[2] = (l) => d(k)("forms/new"))
|
|
192
|
+
}, {
|
|
193
|
+
default: n(() => [
|
|
194
|
+
s(d(D), { class: "size-4" }),
|
|
195
|
+
e[13] || (e[13] = c(" New form ", -1))
|
|
196
|
+
]),
|
|
197
|
+
_: 1
|
|
198
|
+
})) : u.value.length > 0 ? (o(), y(m, {
|
|
199
|
+
key: 1,
|
|
200
|
+
variant: "outline",
|
|
201
|
+
class: "mt-5",
|
|
202
|
+
onClick: e[3] || (e[3] = (l) => {
|
|
203
|
+
b.value = "", x.value = "all";
|
|
204
|
+
})
|
|
205
|
+
}, {
|
|
206
|
+
default: n(() => [...e[14] || (e[14] = [
|
|
207
|
+
c(" Clear filters ", -1)
|
|
208
|
+
])]),
|
|
209
|
+
_: 1
|
|
210
|
+
})) : F("", !0)
|
|
211
|
+
])
|
|
212
|
+
])) : (o(), r("section", Te, [
|
|
213
|
+
(o(!0), r(w, null, j(S.value, (l) => (o(), y(M, {
|
|
214
|
+
key: l.id,
|
|
215
|
+
class: "group flex min-h-56 flex-col transition-colors hover:border-foreground/20"
|
|
216
|
+
}, {
|
|
217
|
+
default: n(() => [
|
|
218
|
+
s(T, { class: "gap-3" }, {
|
|
219
|
+
default: n(() => [
|
|
220
|
+
t("div", Ae, [
|
|
221
|
+
s(H, {
|
|
222
|
+
class: "min-w-0 truncate text-base",
|
|
223
|
+
title: l.name
|
|
224
|
+
}, {
|
|
225
|
+
default: n(() => [
|
|
226
|
+
c(i(l.name), 1)
|
|
227
|
+
]),
|
|
228
|
+
_: 2
|
|
229
|
+
}, 1032, ["title"]),
|
|
230
|
+
s(ae, {
|
|
231
|
+
class: "shrink-0",
|
|
232
|
+
status: l.status,
|
|
233
|
+
"has-unpublished-changes": l.hasUnpublishedChanges
|
|
234
|
+
}, null, 8, ["status", "has-unpublished-changes"])
|
|
235
|
+
]),
|
|
236
|
+
t("code", Le, i(l.key), 1)
|
|
237
|
+
]),
|
|
238
|
+
_: 2
|
|
239
|
+
}, 1024),
|
|
240
|
+
s(A, { class: "flex-1" }, {
|
|
241
|
+
default: n(() => [
|
|
242
|
+
t("p", Me, i(l.description || "No description has been added."), 1)
|
|
243
|
+
]),
|
|
244
|
+
_: 2
|
|
245
|
+
}, 1024),
|
|
246
|
+
s(L, { class: "flex items-center justify-between gap-3 border-t pt-4" }, {
|
|
247
|
+
default: n(() => [
|
|
248
|
+
t("div", Re, [
|
|
249
|
+
t("p", De, "Updated " + i(d(ne)(l.updatedAt)), 1),
|
|
250
|
+
l.publishedRevision ? (o(), r("p", Ie, "Published revision " + i(l.publishedRevision), 1)) : (o(), r("p", Ee, "Not published"))
|
|
251
|
+
]),
|
|
252
|
+
s(m, {
|
|
253
|
+
size: "icon",
|
|
254
|
+
variant: "ghost",
|
|
255
|
+
class: "shrink-0",
|
|
256
|
+
"aria-label": `Open ${l.name}`,
|
|
257
|
+
onClick: (O) => U(l)
|
|
258
|
+
}, {
|
|
259
|
+
default: n(() => [
|
|
260
|
+
s(d(Z), { class: "size-4 transition-transform group-hover:translate-x-0.5" })
|
|
261
|
+
]),
|
|
262
|
+
_: 1
|
|
263
|
+
}, 8, ["aria-label", "onClick"])
|
|
264
|
+
]),
|
|
265
|
+
_: 2
|
|
266
|
+
}, 1024)
|
|
267
|
+
]),
|
|
268
|
+
_: 2
|
|
269
|
+
}, 1024))), 128))
|
|
270
|
+
]))
|
|
271
|
+
], 64)) : (o(), r("section", xe, [
|
|
272
|
+
t("div", ve, [
|
|
273
|
+
t("div", ge, [
|
|
274
|
+
s(d(G), { class: "size-5 text-muted-foreground" })
|
|
275
|
+
]),
|
|
276
|
+
e[9] || (e[9] = t("h2", { class: "mt-4 font-semibold" }, "You cannot view forms", -1)),
|
|
277
|
+
e[10] || (e[10] = t("p", { class: "mt-1 text-sm leading-6 text-muted-foreground" }, " Ask a project administrator for the View forms permission. ", -1))
|
|
278
|
+
])
|
|
279
|
+
]))
|
|
280
|
+
]);
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
export {
|
|
285
|
+
Qe as default
|
|
286
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("lucide-vue-next"),h=require("@oneclick.dev/cms-kit"),C=require("./useHelpbotApi-BIIungOh.js"),y={class:"mx-auto flex w-full max-w-7xl flex-col gap-6 py-6 @3xl:py-8"},E={class:"flex flex-col gap-4 @2xl:flex-row @2xl:items-start @2xl:justify-between"},B={class:"max-w-2xl"},S={class:"mb-2 flex items-center gap-2 text-sm font-medium text-primary"},z={class:"text-2xl font-semibold tracking-tight @2xl:text-3xl"},D={key:0,class:"flex items-start gap-3 rounded-xl border border-amber-500/30 bg-amber-500/5 px-4 py-3 text-sm",role:"status"},T={class:"mt-0.5 text-muted-foreground"},A={class:"flex flex-col gap-5 p-5 @2xl:flex-row @2xl:items-center @2xl:justify-between @3xl:p-6"},R={class:"flex min-w-0 items-start gap-4"},M={class:"grid size-11 shrink-0 place-items-center rounded-xl bg-muted"},j={class:"min-w-0"},F={class:"flex flex-wrap items-center gap-2"},L={class:"mt-1 text-sm leading-6 text-muted-foreground"},q={key:0,class:"mt-1 text-xs text-muted-foreground"},H={"aria-labelledby":"knowledge-summary-heading"},P={class:"grid gap-3 @xl:grid-cols-3"},K={class:"grid size-10 shrink-0 place-items-center rounded-lg bg-primary/10 text-primary"},O={class:"min-w-0"},W={class:"text-2xl font-semibold tabular-nums"},Y={class:"mt-0.5 text-sm font-medium"},I={class:"mt-1 text-xs leading-5 text-muted-foreground"},U={class:"grid gap-4 @2xl:grid-cols-2"},G={class:"flex items-start justify-between gap-4"},J={class:"grid size-10 place-items-center rounded-lg bg-primary/10 text-primary"},Q={class:"flex items-start justify-between gap-4"},X={class:"grid size-10 place-items-center rounded-lg bg-primary/10 text-primary"},Z={class:"rounded-xl border bg-muted/30 p-5"},$={class:"flex items-start gap-3"},ee=e.defineComponent({__name:"Overview",setup(te){h.useModuleBreadcrumbs(()=>[{text:"Overview"}]);const{config:N}=h.useModule(),{resolvePath:f}=h.useModuleRoute(),g=C.useHelpbotApi(),o=e.ref(null),u=e.ref(null),m=e.ref(null),x=e.ref(null),l=e.ref(!0),d=e.ref(""),v=e.ref(null),b=e.computed(()=>!!N.agentId),V=e.computed(()=>b.value&&o.value?.configured!==!1),c=e.computed(()=>V.value?d.value&&!o.value?{label:"Connection unavailable",description:"The helpbot could not be reached during the latest check.",icon:s.AlertCircle,iconClass:"text-destructive",badgeClass:"bg-destructive/10 text-destructive"}:o.value?.connected===!1?{label:"Connection needs attention",description:o.value.message||"Ask your agency to check the website helpbot connection.",icon:s.AlertCircle,iconClass:"text-destructive",badgeClass:"bg-destructive/10 text-destructive"}:o.value?.connected===!0?{label:"Connected",description:o.value.connectionName||"Your saved knowledge is connected to the website helpbot.",icon:s.CheckCircle2,iconClass:"text-emerald-600 dark:text-emerald-400",badgeClass:"bg-emerald-500/10 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300"}:{label:l.value?"Checking connection":"Connection checked",description:l.value?"Confirming that the website helpbot can reach its knowledge.":"The helpbot responded, but did not report a detailed connection state.",icon:l.value?s.Loader2:s.CheckCircle2,iconClass:l.value?"animate-spin text-muted-foreground":"text-emerald-600 dark:text-emerald-400",badgeClass:"bg-muted text-muted-foreground"}:{label:"Setup required",description:"Your agency still needs to assign the website helpbot.",icon:s.Settings2,iconClass:"text-amber-600 dark:text-amber-400",badgeClass:"bg-amber-500/10 text-amber-700 dark:bg-amber-500/15 dark:text-amber-300"}),_=e.computed(()=>[{label:"Saved answers",value:u.value,icon:s.BookOpen,description:"Short answers and business information"},{label:"PDF guides",value:m.value,icon:s.FileText,description:"Documents available to the helpbot"},{label:"Knowledge chunks",value:x.value,icon:s.Clock3,description:"Searchable sections across all knowledge"}]);async function w(){if(!b.value){l.value=!1;return}l.value=!0,d.value="";const[n,t,a]=await Promise.allSettled([g.getStatus(),g.listTexts(),g.listFiles()]);n.status==="fulfilled"&&(o.value=n.value),n.status==="fulfilled"?(u.value=n.value.sourceCounts.texts??(t.status==="fulfilled"?t.value.length:u.value),m.value=n.value.sourceCounts.pdfs??(a.status==="fulfilled"?a.value.length:m.value),x.value=n.value.sourceCounts.chunks??x.value):(t.status==="fulfilled"&&(u.value=t.value.length),a.status==="fulfilled"&&(m.value=a.value.length));const r=[n,t,a].filter(p=>p.status==="rejected");r.length&&(d.value=C.getHelpbotErrorMessage(r[0].reason,r.length===3?"The helpbot could not be reached.":"Some helpbot information could not be refreshed.")),v.value=new Date,l.value=!1}return e.onMounted(w),(n,t)=>{const a=e.resolveComponent("Button"),r=e.resolveComponent("NuxtLink"),p=e.resolveComponent("CardContent"),k=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("main",y,[e.createElementVNode("header",E,[e.createElementVNode("div",B,[e.createElementVNode("div",S,[e.createVNode(e.unref(s.Bot),{class:"size-4"}),t[0]||(t[0]=e.createTextVNode(" Website helpbot ",-1))]),e.createElementVNode("h1",z,e.toDisplayString(o.value?.helpbotName||"Helpbot overview"),1),t[1]||(t[1]=e.createElementVNode("p",{class:"mt-2 text-sm leading-6 text-muted-foreground"}," Keep the answers on your website accurate, then privately test what visitors will receive. ",-1))]),e.createVNode(a,{variant:"outline",class:"w-full @2xl:w-auto",disabled:l.value||!b.value,onClick:w},{default:e.withCtx(()=>[e.createVNode(e.unref(s.RefreshCw),{class:e.normalizeClass(["mr-2 size-4",{"animate-spin":l.value}])},null,8,["class"]),t[2]||(t[2]=e.createTextVNode(" Refresh ",-1))]),_:1},8,["disabled"])]),d.value?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(e.unref(s.AlertCircle),{class:"mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-400"}),e.createElementVNode("div",null,[t[3]||(t[3]=e.createElementVNode("p",{class:"font-medium"},"Latest refresh was incomplete",-1)),e.createElementVNode("p",T,e.toDisplayString(d.value),1)])])):e.createCommentVNode("",!0),e.createVNode(k,{class:"overflow-hidden"},{default:e.withCtx(()=>[e.createVNode(p,{class:"p-0"},{default:e.withCtx(()=>[e.createElementVNode("div",A,[e.createElementVNode("div",R,[e.createElementVNode("div",M,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value.icon),{class:e.normalizeClass(["size-5",c.value.iconClass])},null,8,["class"]))]),e.createElementVNode("div",j,[e.createElementVNode("div",F,[t[4]||(t[4]=e.createElementVNode("h2",{class:"font-semibold"},"Helpbot connection",-1)),e.createElementVNode("span",{class:e.normalizeClass(["rounded-full px-2.5 py-1 text-xs font-medium",c.value.badgeClass])},e.toDisplayString(c.value.label),3)]),e.createElementVNode("p",L,e.toDisplayString(c.value.description),1),v.value?(e.openBlock(),e.createElementBlock("p",q," Checked "+e.toDisplayString(v.value.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})),1)):e.createCommentVNode("",!0)])]),e.createVNode(r,{to:e.unref(f)("/knowledge"),class:"inline-flex h-10 w-full shrink-0 items-center justify-center rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground shadow-sm transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 @2xl:w-auto"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value?.permissions.canManageKnowledge?"Manage knowledge":"Review knowledge")+" ",1),e.createVNode(e.unref(s.ArrowRight),{class:"ml-2 size-4"})]),_:1},8,["to"])])]),_:1})]),_:1}),e.createElementVNode("section",H,[t[5]||(t[5]=e.createElementVNode("div",{class:"mb-3 flex items-center justify-between gap-3"},[e.createElementVNode("h2",{id:"knowledge-summary-heading",class:"text-sm font-semibold"}," Knowledge summary "),e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Live connection data")],-1)),e.createElementVNode("div",P,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,i=>(e.openBlock(),e.createBlock(k,{key:i.label},{default:e.withCtx(()=>[e.createVNode(p,{class:"flex items-start gap-4 p-5"},{default:e.withCtx(()=>[e.createElementVNode("div",K,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.icon),{class:"size-5"}))]),e.createElementVNode("div",O,[e.createElementVNode("p",W,[l.value&&i.value===null?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode("—")],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(i.value??"—"),1)],64))]),e.createElementVNode("p",Y,e.toDisplayString(i.label),1),e.createElementVNode("p",I,e.toDisplayString(i.description),1)])]),_:2},1024)]),_:2},1024))),128))])]),e.createElementVNode("div",U,[e.createVNode(r,{to:e.unref(f)("/knowledge"),class:"group rounded-xl border bg-card p-5 text-card-foreground shadow-sm transition-colors hover:border-primary/40"},{default:e.withCtx(()=>[e.createElementVNode("div",G,[e.createElementVNode("div",J,[e.createVNode(e.unref(s.BookOpen),{class:"size-5"})]),e.createVNode(e.unref(s.ArrowRight),{class:"size-4 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]),t[6]||(t[6]=e.createElementVNode("h2",{class:"mt-5 font-semibold"},"Knowledge",-1)),t[7]||(t[7]=e.createElementVNode("p",{class:"mt-1 text-sm leading-6 text-muted-foreground"}," Add clear business answers and PDF guides that the helpbot may use. ",-1))]),_:1},8,["to"]),o.value?.permissions.canTestHelpbot?(e.openBlock(),e.createBlock(r,{key:0,to:e.unref(f)("/test"),class:"group rounded-xl border bg-card p-5 text-card-foreground shadow-sm transition-colors hover:border-primary/40"},{default:e.withCtx(()=>[e.createElementVNode("div",Q,[e.createElementVNode("div",X,[e.createVNode(e.unref(s.MessagesSquare),{class:"size-5"})]),e.createVNode(e.unref(s.ArrowRight),{class:"size-4 text-muted-foreground transition-transform group-hover:translate-x-0.5"})]),t[8]||(t[8]=e.createElementVNode("h2",{class:"mt-5 font-semibold"},"Private test",-1)),t[9]||(t[9]=e.createElementVNode("p",{class:"mt-1 text-sm leading-6 text-muted-foreground"}," Ask visitor questions and check which saved sources support the reply. ",-1))]),_:1},8,["to"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Z,[e.createElementVNode("div",$,[e.createVNode(e.unref(s.RefreshCw),{class:"mt-0.5 size-4 shrink-0 text-primary"}),t[10]||(t[10]=e.createElementVNode("div",null,[e.createElementVNode("h2",{class:"text-sm font-semibold"},"How knowledge updates work"),e.createElementVNode("p",{class:"mt-1 text-sm leading-6 text-muted-foreground"}," When an answer or PDF changes, it is prepared again for the helpbot. The updated information becomes available after processing completes. Use the private test to verify important answers. ")],-1))])])])}}});exports.default=ee;
|