@wpic/ui 0.9.14 → 0.9.15

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.9.15
2
+
3
+ - WTable: add opt-in `columnDividers` to draw vertical rules between cells in the row divider colour, in light and dark themes.
4
+
1
5
  ## 0.9.14
2
6
 
3
7
  - Align plain spreadsheet inputs and selects with cell padding. Remove overlapping mouse focus rings while retaining keyboard focus. Keep disabled plain controls transparent.
package/COMPONENTS.md CHANGED
@@ -656,6 +656,7 @@ pageSize?: number
656
656
  searchPlaceholder?: string
657
657
  rowClickable?: boolean
658
658
  showHeader?: boolean
659
+ columnDividers?: boolean // vertical rules between cells, in the row divider colour; default false
659
660
  ```
660
661
 
661
662
  **Emits:**
@@ -41,6 +41,8 @@ type __VLS_Props = {
41
41
  padding (falling back to md), or sm when `compact`. */
42
42
  padding?: 'sm' | 'md' | 'lg';
43
43
  showFooter?: boolean;
44
+ /** Draw a vertical rule between adjacent cells, in the row divider colour. */
45
+ columnDividers?: boolean;
44
46
  };
45
47
  declare function toggleSort(field: string): void;
46
48
  declare var __VLS_4: {}, __VLS_18: string, __VLS_19: {
@@ -93,6 +95,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
93
95
  rowKey: string;
94
96
  flushEdges: boolean;
95
97
  showFooter: boolean;
98
+ columnDividers: boolean;
96
99
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
97
100
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
98
101
  export default _default;
package/dist/wpic-ui.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("lucide-vue-next"),n1=require("@floating-ui/vue"),p0=require("pinia"),C2=require("@tiptap/vue-3"),d0=require("@tiptap/extension-document"),w0=require("@tiptap/extension-paragraph"),u0=require("@tiptap/extension-text"),m0=require("@tiptap/extension-character-count");var T1=typeof document<"u"?document.currentScript:null;const h0={key:0,class:"wpic:absolute wpic:inset-0 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-[inherit]","aria-hidden":"true"},F1=e.defineComponent({__name:"WButton",props:{variant:{},size:{},loading:{type:Boolean},disabled:{type:Boolean},active:{type:Boolean},icon:{type:[Object,Function]},href:{}},emits:["click"],setup(n,{emit:p}){const t=n,a=p;return(r,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.href?"a":"button"),{href:n.href,disabled:n.disabled||n.loading,"data-variant":t.variant??"primary","data-size":t.size??"md","data-active":n.active?"true":void 0,onClick:c[0]||(c[0]=i=>a("click",i)),class:e.normalizeClass(["wpic-button","wpic:relative wpic:inline-flex wpic:items-center wpic:justify-center wpic:font-medium wpic:transition-all wpic:duration-150 wpic:cursor-pointer wpic:select-none","wpic:focus-visible:outline-none wpic:focus-visible:ring-2 wpic:focus-visible:ring-indigo-500/50 wpic:focus-visible:ring-offset-1","wpic:active:scale-[0.98]",n.disabled||n.loading?"wpic:opacity-40 wpic:cursor-not-allowed wpic:pointer-events-none":"",n.active?"wpic-button--active":"",(t.size??"md")==="sm"?"wpic:h-8 wpic:touch-manipulation wpic:px-2.5 wpic:gap-1.5 wpic:rounded-md wpic:text-sm":"",(t.size??"md")==="md"?(t.variant==="subtle"?"wpic:h-11":"wpic:h-9")+" wpic:px-3.5 wpic:gap-2 wpic:rounded-lg":"",(t.size??"md")==="lg"?(t.variant==="subtle"?"wpic:h-12":"wpic:h-11")+" wpic:px-4 wpic:gap-2 wpic:rounded-lg":"",(t.size??"md")==="xs"?"wpic:h-5 wpic:w-5 wpic:p-0 wpic:rounded-full wpic:text-xs":"",(t.variant??"primary")==="primary"?"wpic-btn-primary wpic:text-white":"",(t.variant??"primary")==="secondary"?"wpic:bg-zinc-100 wpic:hover:bg-zinc-200 wpic:text-zinc-700 wpic:dark:bg-zinc-800 wpic:dark:hover:bg-zinc-700 wpic:dark:text-zinc-200":"",(t.variant??"primary")==="subtle"?"wpic:bg-zinc-100 wpic:border wpic:border-zinc-100 wpic:hover:bg-zinc-200/70 wpic:text-zinc-700 wpic:dark:bg-zinc-800 wpic:dark:border-zinc-800 wpic:dark:hover:bg-zinc-700 wpic:dark:text-zinc-200":"",(t.variant??"primary")==="destructive"?"wpic:bg-red-500 wpic:hover:bg-red-600 wpic:text-white":"",(t.variant??"primary")==="ghost"?"wpic:bg-transparent wpic:hover:bg-zinc-100 wpic:text-zinc-600 wpic:hover:text-zinc-900 wpic:dark:hover:bg-zinc-800 wpic:dark:text-zinc-400 wpic:dark:hover:text-zinc-100":"",t.variant==="ghost-transparent"?"wpic:bg-transparent wpic:hover:bg-[#80808026] wpic:text-inherit":"",t.variant==="ghost-transparent"&&!n.disabled&&!n.loading?"wpic:opacity-60 wpic:hover:opacity-100 wpic:focus-visible:opacity-100":"",(t.variant??"primary")==="outline"?"wpic:bg-transparent wpic:border wpic:border-zinc-200 wpic:hover:bg-zinc-50 wpic:text-zinc-700 wpic:dark:border-zinc-800 wpic:dark:hover:bg-zinc-800 wpic:dark:text-zinc-300":""])},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(["wpic:inline-flex wpic:items-center wpic:justify-center wpic:gap-[inherit]",n.loading?"wpic:invisible":""])},[n.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.icon),{key:0,size:(t.size??"md")==="xs"?10:(t.size??"md")==="sm"?12:((t.size??"md")==="lg",15)},null,8,["size"])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default")],2),n.loading?(e.openBlock(),e.createElementBlock("span",h0,[e.createVNode(e.unref(b.Loader2),{size:(t.size??"md")==="xs"?10:(t.size??"md")==="sm"?13:(t.size??"md")==="lg"?17:15,class:"wpic:animate-spin"},null,8,["size"])])):e.createCommentVNode("",!0)]),_:3},8,["href","disabled","data-variant","data-size","data-active","class"]))}}),f0={class:"wpic-button-group wpic:inline-flex"},x2=e.defineComponent({__name:"WButtonGroup",setup(n){return(p,t)=>(e.openBlock(),e.createElementBlock("div",f0,[e.renderSlot(p.$slots,"default")]))}}),v0={class:"wpic-filter wpic:flex wpic:items-center wpic:gap-1"},b0=["onClick"],g0=e.defineComponent({__name:"WFilter",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(n){return(p,t)=>(e.openBlock(),e.createElementBlock("div",v0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options,(a,r)=>(e.openBlock(),e.createElementBlock("button",{key:r,type:"button",onClick:c=>p.$emit("update:modelValue",a.value),class:e.normalizeClass(["wpic:px-2.5 wpic:py-1 wpic:text-base wpic:font-medium wpic:rounded-full wpic:transition-all wpic:duration-150 wpic:cursor-pointer wpic:whitespace-nowrap",n.modelValue===a.value?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:border wpic:border-zinc-300 wpic:dark:border-zinc-600":"wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:hover:text-zinc-600 wpic:dark:hover:text-zinc-300 wpic:border wpic:border-transparent"])},e.toDisplayString(a.label),11,b0))),128))]))}}),C0={class:"wpic-form-label wpic:block wpic:mb-1 wpic:font-medium wpic:text-zinc-600 wpic:dark:text-zinc-400"},k0={key:0,class:"wpic:ml-0.5",style:{color:"#EF4444"}},i2=e.defineComponent({__name:"WFormLabel",props:{required:{type:Boolean}},setup(n){return(p,t)=>(e.openBlock(),e.createElementBlock("label",C0,[e.renderSlot(p.$slots,"default"),n.required?(e.openBlock(),e.createElementBlock("span",k0,"*")):e.createCommentVNode("",!0)]))}}),z0={class:"wpic:relative wpic:flex wpic:items-center wpic:w-full"},y0=["data-size","data-variant","type","placeholder","disabled","required"],x0={key:2,class:"wpic:pointer-events-none wpic:absolute wpic:right-2.5 wpic:text-zinc-400 wpic:dark:text-zinc-500"},a2=e.defineComponent({inheritAttrs:!1,__name:"WInput",props:e.mergeModels({icon:{type:[Object,Function]},label:{},placeholder:{},required:{type:Boolean},type:{},disabled:{type:Boolean},size:{},clearable:{type:Boolean},loading:{type:Boolean},variant:{},prepend:{},append:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const p=e.useModel(n,"modelValue"),t=n,a=e.useSlots(),r=e.computed(()=>t.prepend!==void 0||!!a.prepend),c=e.computed(()=>t.append!==void 0||!!a.append),i=e.computed(()=>{if(t.icon)return t.icon;if(t.type==="date")return b.Calendar;if(t.type==="money")return b.DollarSign}),w=e.computed(()=>({sm:12,md:13,lg:14,xl:16})[t.size??"md"]),u=e.computed(()=>t.type==="money"?"number":t.type??"text"),f=e.ref(),l=e.ref(),M=e.ref(0);let z;e.watch(l,g=>{z?.disconnect(),M.value=g?.getBoundingClientRect().width??0,g&&(z=new ResizeObserver(()=>{M.value=g.getBoundingClientRect().width}),z.observe(g))},{flush:"post"}),e.onBeforeUnmount(()=>z?.disconnect());function S(){t.type==="date"&&f.value?.showPicker()}if(typeof document<"u"){const g="winput-date-no-picker";if(!document.getElementById(g)){const m=document.createElement("style");m.id=g,m.textContent='input[type="date"]::-webkit-calendar-picker-indicator { display: none; }',document.head.appendChild(m)}const v="winput-number-no-spinner";if(!document.getElementById(v)){const m=document.createElement("style");m.id=v,m.textContent="input.winput-number::-webkit-outer-spin-button, input.winput-number::-webkit-inner-spin-button { display: none; } input.winput-number { -moz-appearance: textfield; }",document.head.appendChild(m)}}return(g,v)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps(g.$attrs,{class:"wpic:w-full"}),[t.label?(e.openBlock(),e.createBlock(i2,{key:0,required:t.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["required"])):e.createCommentVNode("",!0),e.createElementVNode("div",z0,[i.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{key:0,size:w.value,class:e.normalizeClass(["wpic:absolute wpic:shrink-0 wpic:text-zinc-400 wpic:dark:text-zinc-500",[t.size==="xl"?"wpic:left-4":"wpic:left-2.5",t.type==="date"?"wpic:cursor-pointer":"wpic:pointer-events-none"]]),onClick:S},null,8,["size","class"])):r.value?(e.openBlock(),e.createElementBlock("span",{key:1,ref_key:"prependRef",ref:l,class:"wpic:pointer-events-none wpic:absolute wpic:left-2.5 wpic:text-zinc-400 wpic:dark:text-zinc-500"},[e.renderSlot(g.$slots,"prepend",{},()=>[e.createTextVNode(e.toDisplayString(t.prepend),1)])],512)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:f,class:e.normalizeClass(["wpic-control",["wpic:w-full wpic:rounded-lg wpic:outline-none wpic:transition-colors",t.size==="sm"?"wpic:text-sm":"wpic:text-base",u.value==="number"?"winput-number":"",t.size==="sm"?"wpic:h-8":t.size==="lg"?"wpic:h-11":t.size==="xl"?"wpic:h-14":"wpic:h-9",i.value||r.value?t.size==="xl"?"wpic:pl-11":"wpic:pl-9":t.size==="xl"?"wpic:pl-4":"wpic:pl-2.5",c.value&&(t.clearable&&p.value||t.loading)?"wpic:pr-14":c.value?"wpic:pr-9":t.clearable&&p.value||t.loading?t.size==="xl"?"wpic:pr-10":"wpic:pr-7":t.size==="xl"?"wpic:pr-4":"wpic:pr-2.5",t.variant==="plain"?"wpic:bg-transparent wpic:border-0 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:focus-visible:ring-1 wpic:focus-visible:ring-current wpic:disabled:opacity-60 wpic:disabled:cursor-not-allowed":t.disabled?(t.variant??"default")==="subtle"?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:cursor-not-allowed wpic:opacity-60":"wpic:bg-zinc-50 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:cursor-not-allowed wpic:opacity-60":(t.variant??"default")==="subtle"?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic:cursor-text wpic:hover:bg-zinc-200/70 wpic:dark:hover:bg-zinc-700":"wpic:bg-white wpic:dark:bg-zinc-900 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic-input-field wpic:cursor-text"]]),style:e.normalizeStyle(r.value&&!i.value?{paddingLeft:`calc(${M.value}px + 1.25rem)`}:void 0),"data-size":t.size??"md","data-variant":t.variant??"default","onUpdate:modelValue":v[0]||(v[0]=m=>p.value=m),type:u.value,placeholder:t.placeholder??"",disabled:t.disabled,required:t.required},null,14,y0),[[e.vModelDynamic,p.value]]),c.value?(e.openBlock(),e.createElementBlock("span",x0,[e.renderSlot(g.$slots,"append",{},()=>[e.createTextVNode(e.toDisplayString(t.append),1)])])):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(e.unref(b.Loader2),{key:3,size:t.size==="xl"?14:11,class:e.normalizeClass(["wpic:absolute wpic:animate-spin wpic:text-zinc-400 wpic:dark:text-zinc-500",c.value?"wpic:right-8":t.size==="xl"?"wpic:right-4":"wpic:right-2"])},null,8,["size","class"])):t.clearable&&p.value?(e.openBlock(),e.createElementBlock("button",{key:4,type:"button",onClick:v[1]||(v[1]=m=>p.value=""),class:e.normalizeClass(["wpic:absolute wpic:flex wpic:items-center wpic:justify-center wpic:text-zinc-400 wpic:hover:text-zinc-600 wpic:dark:hover:text-zinc-300 wpic:transition-colors wpic:cursor-pointer",c.value?"wpic:right-8":t.size==="xl"?"wpic:right-4":"wpic:right-2"])},[e.createVNode(e.unref(b.X),{size:t.size==="xl"?14:11},null,8,["size"])],2)):e.createCommentVNode("",!0)])],16))}}),B0=["disabled"],c2=e.defineComponent({__name:"WCheckbox",props:e.mergeModels({disabled:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const p=e.useModel(n,"modelValue");return(t,a)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["wpic-checkbox wpic:relative wpic:inline-flex wpic:items-center wpic:gap-2 wpic:select-none",n.disabled?"wpic:cursor-not-allowed wpic:opacity-50":"wpic:cursor-pointer"])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=r=>p.value=r),disabled:n.disabled,class:"wpic:peer wpic:sr-only"},null,8,B0),[[e.vModelCheckbox,p.value]]),e.createElementVNode("span",{class:e.normalizeClass(["wpic-checkbox-box",["wpic:flex wpic:h-4 wpic:w-4 wpic:shrink-0 wpic:items-center wpic:justify-center wpic:rounded-[4px] wpic:border wpic:transition-all wpic:duration-150","wpic:peer-focus-visible:ring-2 wpic:peer-focus-visible:ring-zinc-400/40 wpic:peer-focus-visible:ring-offset-1 wpic:peer-focus-visible:ring-offset-white wpic:dark:peer-focus-visible:ring-offset-zinc-950",p.value?"wpic:border-zinc-900 wpic:bg-zinc-900 wpic:text-white wpic:dark:border-zinc-100 wpic:dark:bg-zinc-100 wpic:dark:text-zinc-950":"wpic:border-zinc-300 wpic:bg-white wpic:text-transparent wpic:shadow-sm wpic:hover:border-zinc-400 wpic:dark:border-zinc-700 wpic:dark:bg-zinc-900 wpic:dark:hover:border-zinc-500"]])},[e.createVNode(e.unref(b.Check),{size:11,"stroke-width":"2.6"})],2),e.renderSlot(t.$slots,"default")],2))}}),O1=e.defineComponent({__name:"WSpinner",props:{size:{default:"md"},tone:{default:"muted"}},setup(n){const p=n,t={sm:"wpic:h-4 wpic:w-4 wpic:border-2",md:"wpic:h-5 wpic:w-5 wpic:border-2",lg:"wpic:h-7 wpic:w-7 wpic:border-[3px]"};return(a,r)=>(e.openBlock(),e.createElementBlock("span",{role:"status","aria-live":"polite","aria-label":"Loading",class:e.normalizeClass(["wpic-spinner","wpic:inline-block wpic:shrink-0 wpic:animate-spin wpic:rounded-full wpic:border-current wpic:border-t-transparent",t[p.size],p.tone==="muted"?"wpic:text-zinc-300 wpic:dark:text-zinc-700":"wpic:text-[var(--wpic-primary,#6366f1)]"])},null,2))}}),M0={key:0,class:"wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:whitespace-nowrap wpic:shrink-0"},V0={key:1,role:"status","aria-live":"polite",class:"wpic:flex wpic:items-center wpic:justify-center wpic:py-12 wpic:gap-3 wpic:text-base wpic:text-zinc-400 wpic:dark:text-zinc-500"},E0={class:"wpic-table__scroll",style:{"overflow-x":"auto"}},N0={class:"wpic:w-full wpic:border-collapse"},S0={key:0,style:{width:"36px"}},L0={key:1,style:{width:"32px"}},D0={key:0},F0={class:"wpic-table__header wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},$0=["onClick"],T0={key:1},A0={key:0,class:"wpic-table__summary wpic-table__divider wpic:border-b wpic:border-zinc-200 wpic:font-medium wpic:dark:border-zinc-700"},H0={key:0},P0={key:1},j0=["onClick"],W0=["onClick"],R0={key:0,class:"wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},I0=["colspan"],Z0={key:2},U0=["colspan"],K0={class:"wpic:flex wpic:flex-col wpic:items-center wpic:gap-2"},O0={class:"wpic:tabular-nums wpic:text-zinc-400 wpic:dark:text-zinc-500"},q0={key:0,class:"wpic:flex wpic:items-center wpic:gap-0.5"},Y0=["aria-label","disabled"],Q0={key:0,class:"wpic:w-6 wpic:text-center wpic:text-base wpic:select-none wpic:text-zinc-400 wpic:dark:text-zinc-500"},J0=["onClick"],X0=["aria-label","disabled"],G0=e.defineComponent({__name:"WTable",props:{data:{},columns:{},loading:{type:Boolean},loadingSpinner:{type:Boolean,default:!0},labels:{},emptyText:{},pageSize:{},serverTotal:{},serverPage:{},searchPlaceholder:{default:"Search…"},rowClickable:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},expandable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectedKeys:{},rowKey:{default:"id"},flushEdges:{type:Boolean,default:!1},rowClass:{},rowStyle:{},summaryRow:{},compact:{type:Boolean},padding:{},showFooter:{type:Boolean,default:!0}},emits:["row-click","update:selectedKeys","row-select","update:serverPage"],setup(n,{expose:p,emit:t}){const a=n,r=t,c=e.ref(new Set);function i(E){c.value.has(E)?c.value.delete(E):c.value.add(E)}const w=e.useSlots(),u=e.computed(()=>a.pageSize??25),f=e.ref(null),l=e.ref("asc");function M(E){f.value===E?l.value=l.value==="asc"?"desc":"asc":(f.value=E,l.value="asc")}const z=e.ref(""),S=e.computed(()=>a.columns.some(E=>E.searchable)),g=e.computed(()=>{let E=a.data??[];const J=z.value.trim().toLowerCase();if(J){const k=a.columns.filter($=>$.searchable).map($=>$.field);E=E.filter($=>k.some(Z=>String($[Z]??"").toLowerCase().includes(J)))}if(f.value){const k=f.value;E=[...E].sort(($,Z)=>{const e1=$[k]??"",r1=Z[k]??"",u1=typeof e1=="number"&&typeof r1=="number"?e1-r1:String(e1).toLowerCase().localeCompare(String(r1).toLowerCase());return l.value==="asc"?u1:-u1})}return E}),v=e.ref(1),m=e.computed(()=>a.serverTotal!==void 0),F=e.computed({get:()=>m.value?a.serverPage??1:v.value,set:E=>{m.value?r("update:serverPage",E):v.value=E}}),q=e.computed(()=>m.value?a.serverTotal??0:g.value.length),t1=e.computed(()=>Math.max(1,Math.ceil(q.value/u.value)));e.watch([z,()=>a.data],()=>{m.value||(F.value=1),c.value.clear()});const G=e.computed(()=>{if(m.value)return g.value;const E=(F.value-1)*u.value;return g.value.slice(E,E+u.value)});function P(E,J){const k=E[a.rowKey];return typeof k=="string"||typeof k=="number"?k:`${F.value}:${J}`}const L=e.computed(()=>new Set(a.selectedKeys??[])),V=e.computed(()=>G.value.map(P)),N=e.computed(()=>a.selectable&&V.value.length>0&&V.value.every(E=>L.value.has(E)));function B(E,J,k){const $=P(E,J),Z=new Set(a.selectedKeys??[]),e1=k===!0;e1?Z.add($):Z.delete($),r("update:selectedKeys",[...Z]),r("row-select",E,e1)}function U(E){const J=new Set(a.selectedKeys??[]),k=E===!0;for(const $ of V.value)k?J.add($):J.delete($);r("update:selectedKeys",[...J])}const K=e.computed(()=>q.value===0?0:(F.value-1)*u.value+1),l1=e.computed(()=>Math.min(F.value*u.value,q.value)),j=e.computed(()=>{const E=t1.value;if(E<=7)return Array.from({length:E},(e1,r1)=>r1+1);const J=F.value,k=[],$=new Set([1,E,J-1,J,J+1].filter(e1=>e1>=1&&e1<=E));let Z=0;for(const e1 of[...$].sort((r1,u1)=>r1-u1))e1-Z>1&&k.push("…"),k.push(e1),Z=e1;return k}),Q=e.computed(()=>a.padding?`wpic-table--padding-${a.padding}`:a.compact?"wpic-table--padding-sm":"wpic-table--padding-inherit"),W=E=>E==="right"?"wpic:text-right":E==="center"?"wpic:text-center":"wpic:text-left",c1=(E,J)=>[J,a.flushEdges&&E===0&&!a.expandable&&!a.selectable?"wpic:pl-0":"wpic-table__pad-l",a.flushEdges&&E===a.columns.length-1?"wpic:pr-0":"wpic-table__pad-r"],s1=E=>({...E.width?{width:E.width}:{},...E.minWidth?{minWidth:E.minWidth}:{}});return p({filteredCount:e.computed(()=>g.value.length),searchQuery:z}),(E,J)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wpic-table",Q.value])},[(S.value||e.unref(w).toolbar)&&!n.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wpic:flex wpic:items-center wpic:gap-2 wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic-table__pad-x",n.compact?"wpic:py-1":"wpic:py-2"])},[S.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(a2,{modelValue:z.value,"onUpdate:modelValue":J[0]||(J[0]=k=>z.value=k),placeholder:n.searchPlaceholder,icon:e.unref(b.Search),class:"wpic:flex-1"},null,8,["modelValue","placeholder","icon"]),z.value?(e.openBlock(),e.createElementBlock("span",M0,e.toDisplayString(g.value.length)+" "+e.toDisplayString(n.labels?.results??"results"),1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(E.$slots,"toolbar")],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("div",V0,[n.loadingSpinner?(e.openBlock(),e.createBlock(O1,{key:0,tone:"muted"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(n.labels?.loading??"Loading…"),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",E0,[e.createElementVNode("table",N0,[e.createElementVNode("colgroup",null,[n.selectable?(e.openBlock(),e.createElementBlock("col",S0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("col",L0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,k=>(e.openBlock(),e.createElementBlock("col",{key:k.field,style:e.normalizeStyle(s1(k))},null,4))),128))]),a.showHeader!==!1?(e.openBlock(),e.createElementBlock("thead",D0,[e.createElementVNode("tr",F0,[n.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["wpic:w-9 wpic:pr-2",n.compact?"wpic:py-1.5":"wpic:py-3",n.flushEdges?"wpic:pl-0":"wpic:pl-2"])},[e.createVNode(c2,{"model-value":N.value,onClick:J[1]||(J[1]=e.withModifiers(()=>{},["stop"])),"onUpdate:modelValue":U},null,8,["model-value"])],2)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(["wpic:w-8 wpic:pr-2",n.compact?"wpic:py-1.5":"wpic:py-3",n.flushEdges&&!n.selectable?"wpic:pl-0":"wpic:pl-2"])},null,2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(k,$)=>(e.openBlock(),e.createElementBlock("th",{key:k.field,class:e.normalizeClass([c1($,n.compact?"wpic:py-1.5":"wpic:py-3"),"wpic:whitespace-nowrap wpic:text-zinc-500 wpic:dark:text-zinc-300 wpic:font-medium",W(k.align),$===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10":""]),style:e.normalizeStyle({...s1(k)})},[e.renderSlot(E.$slots,"th-"+k.field,{col:k,sortField:f.value,sortDir:l.value,toggleSort:M},()=>[k.sortable?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:Z=>M(k.field),class:e.normalizeClass(["wpic:inline-flex wpic:items-center wpic:gap-1 wpic:cursor-pointer wpic:transition-colors wpic:whitespace-nowrap",k.align==="right"?"wpic:ml-auto":""]),style:{color:"inherit"}},[e.createTextVNode(e.toDisplayString(k.label)+" ",1),f.value===k.field&&l.value==="asc"?(e.openBlock(),e.createBlock(e.unref(b.ChevronUp),{key:0,size:11,style:{color:"#5E6AD2"}})):f.value===k.field&&l.value==="desc"?(e.openBlock(),e.createBlock(e.unref(b.ChevronDown),{key:1,size:11,style:{color:"#5E6AD2"}})):(e.openBlock(),e.createBlock(e.unref(b.ChevronsUpDown),{key:2,size:10,style:{opacity:"0.3"}}))],10,$0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(k.label),1)],64))])],6))),128))])])):e.createCommentVNode("",!0),n.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tbody",T0,[n.summaryRow?(e.openBlock(),e.createElementBlock("tr",A0,[n.selectable?(e.openBlock(),e.createElementBlock("td",H0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("td",P0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(k,$)=>(e.openBlock(),e.createElementBlock("td",{key:k.field,class:e.normalizeClass([c1($,n.compact?"wpic:py-1":"wpic:py-2.5"),W(k.align),$===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10 wpic:text-zinc-900 wpic:dark:text-zinc-100":"wpic:text-zinc-700 wpic:dark:text-zinc-200"])},[e.renderSlot(E.$slots,"summary-"+k.field,{row:n.summaryRow,value:n.summaryRow[k.field]},()=>[e.createTextVNode(e.toDisplayString(n.summaryRow[k.field]??"—"),1)])],2))),128))])):e.createCommentVNode("",!0),G.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(G.value,(k,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:$},[e.createElementVNode("tr",{class:e.normalizeClass(["wpic-table__row wpic:group wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800",[n.expandable&&c.value.has($)?"wpic:border-b-0":"",n.rowClass?.(k)]]),style:e.normalizeStyle({cursor:n.rowClickable||n.expandable?"pointer":"default",...n.rowStyle?.(k)??{}}),onClick:Z=>n.expandable?i($):n.rowClickable&&r("row-click",k)},[n.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["wpic:w-9 wpic:pr-2",n.compact?"wpic:py-1":"wpic:py-2.5",n.flushEdges?"wpic:pl-0":"wpic:pl-2"]),onClick:J[2]||(J[2]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(c2,{"model-value":L.value.has(P(k,$)),"onUpdate:modelValue":Z=>B(k,$,Z)},null,8,["model-value","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(["wpic:w-8 wpic:pr-1 wpic:text-zinc-400 wpic:dark:text-zinc-500",n.compact?"wpic:py-1":"wpic:py-2.5",n.flushEdges&&!n.selectable?"wpic:pl-0":"wpic:pl-3"])},[c.value.has($)?(e.openBlock(),e.createBlock(e.unref(b.ChevronDown),{key:0,size:13,style:{transition:"transform .15s"}})):(e.openBlock(),e.createBlock(e.unref(b.ChevronRight),{key:1,size:13,style:{transition:"transform .15s"}}))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(Z,e1)=>(e.openBlock(),e.createElementBlock("td",{key:Z.field,class:e.normalizeClass([c1(e1,n.compact?"wpic:py-1":"wpic:py-2.5"),W(Z.align),e1===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:font-medium":"wpic:text-zinc-700 wpic:dark:text-zinc-200"]),onClick:r1=>n.expandable?(n.rowClickable&&r("row-click",k),r1.stopPropagation()):void 0},[e.renderSlot(E.$slots,Z.field,{row:k,value:k[Z.field]},()=>[e.createTextVNode(e.toDisplayString(k[Z.field]??"—"),1)])],10,W0))),128))],14,j0),n.expandable&&c.value.has($)?(e.openBlock(),e.createElementBlock("tr",R0,[e.createElementVNode("td",{colspan:n.columns.length+(n.expandable?1:0)+(n.selectable?1:0),class:"wpic-table__pad-x wpic:pb-3 wpic:pt-0"},[e.renderSlot(E.$slots,"expand",{row:k})],8,I0)])):e.createCommentVNode("",!0)],64))),128)):(e.openBlock(),e.createElementBlock("tr",Z0,[e.createElementVNode("td",{colspan:n.columns.length+(n.expandable?1:0)+(n.selectable?1:0),class:"wpic:py-16 wpic:text-center wpic:text-zinc-400 wpic:dark:text-zinc-500"},[e.createElementVNode("div",K0,[e.renderSlot(E.$slots,"empty-icon"),e.createTextVNode(" "+e.toDisplayString(n.emptyText??"No data"),1)])],8,U0)]))]))])]),n.showFooter&&q.value>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wpic:flex wpic:items-center wpic:justify-between wpic-table__divider wpic:border-t wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic-table__pad-x",n.compact?"wpic:py-1":"wpic:py-2.5"])},[e.createElementVNode("span",O0,[t1.value>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(K.value)+"–"+e.toDisplayString(l1.value)+" "+e.toDisplayString(n.labels?.of??"of")+" "+e.toDisplayString(q.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(q.value)+" "+e.toDisplayString(q.value===1?n.labels?.item??"item":n.labels?.items??"items"),1)],64))]),t1.value>1?(e.openBlock(),e.createElementBlock("div",q0,[e.createElementVNode("button",{"aria-label":n.labels?.previous??"Previous page",onClick:J[3]||(J[3]=k=>F.value--),disabled:F.value===1,class:"wpic:h-7 wpic:w-7 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition-colors wpic:cursor-pointer wpic:disabled:opacity-30 wpic:hover:bg-zinc-50 wpic:dark:hover:bg-zinc-800/50 wpic:text-zinc-400"},[e.createVNode(e.unref(b.ChevronLeft),{size:13})],8,Y0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,k=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:k},[k==="…"?(e.openBlock(),e.createElementBlock("span",Q0,"…")):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:$=>F.value=k,class:e.normalizeClass(["wpic:h-7 wpic:min-w-7 wpic:px-2 wpic:rounded-md wpic:text-sm wpic:font-medium wpic:transition-colors wpic:cursor-pointer",F.value===k?"":"wpic:text-zinc-700 wpic:dark:text-zinc-200 wpic:hover:bg-zinc-100 wpic:dark:hover:bg-zinc-700"]),style:e.normalizeStyle(F.value===k?"background:rgba(94,106,210,0.1);color:#5E6AD2":void 0)},e.toDisplayString(k),15,J0))],64))),128)),e.createElementVNode("button",{"aria-label":n.labels?.next??"Next page",onClick:J[4]||(J[4]=k=>F.value++),disabled:F.value===t1.value,class:"wpic:h-7 wpic:w-7 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition-colors wpic:cursor-pointer wpic:disabled:opacity-30 wpic:hover:bg-zinc-50 wpic:dark:hover:bg-zinc-800/50 wpic:text-zinc-400"},[e.createVNode(e.unref(b.ChevronRight),{size:13})],8,X0)])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))],2))}}),_0={key:0,class:"w-spreadsheet-frame__heading"},e3={key:1,class:"w-spreadsheet-frame__status"},n3=["title","aria-label"],t3={key:1,class:"wpic:flex wpic:min-h-64 wpic:items-center wpic:justify-center wpic:gap-3 wpic:text-zinc-400 wpic:dark:text-zinc-500"},c3={key:0,class:"w-spreadsheet__row-axis-col"},l3={key:0},i3={key:0,class:"w-spreadsheet__corner"},a3={key:0,class:"w-spreadsheet__axis"},o3=["colspan","title","tabindex","onClick","onKeydown","onPointerenter","onPointerdown"],r3={key:0,class:"w-spreadsheet__editor"},s3=["type","value","min","placeholder","onInput"],p3=["onPointerdown"],d3=e.defineComponent({__name:"WSpreadsheet",props:{appearance:{},columns:{},rows:{},showAxes:{type:Boolean,default:!0},showColumnLetters:{type:Boolean,default:!0},showRowNumbers:{type:Boolean,default:!0},minWidth:{default:"960px"},maxHeight:{default:"68vh"},sortable:{type:Boolean},expandable:{type:Boolean},showExpandButton:{type:Boolean},actionsOnHover:{type:Boolean},downloadable:{type:Boolean},showDownloadButton:{type:Boolean},downloadFilename:{},fillHandle:{type:Boolean},expanded:{type:Boolean},downloadRequest:{},loading:{type:Boolean}},emits:["update:expanded","cell-change"],setup(n,{expose:p,emit:t}){const a=n,r=t,c=e.computed(()=>a.showAxes&&a.showColumnLetters),i=e.computed(()=>a.showAxes&&a.showRowNumbers),w=e.computed(()=>a.columns.some(x=>x.sticky)),u=e.ref(null),f=e.ref("asc"),l=e.ref(a.expanded??!1),M=e.ref(null),z=e.ref(null),S=e.ref(null),g=e.ref(null),v=e.ref(null);function m(){if(!a.downloadable)return;const x=D=>`"${String(D??"").replace(/"/g,'""')}"`,A=L.value.map(D=>a.columns.map(H=>x(G(D,H.key))).join(",")).join(`\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("lucide-vue-next"),n1=require("@floating-ui/vue"),p0=require("pinia"),C2=require("@tiptap/vue-3"),d0=require("@tiptap/extension-document"),w0=require("@tiptap/extension-paragraph"),u0=require("@tiptap/extension-text"),m0=require("@tiptap/extension-character-count");var T1=typeof document<"u"?document.currentScript:null;const h0={key:0,class:"wpic:absolute wpic:inset-0 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-[inherit]","aria-hidden":"true"},F1=e.defineComponent({__name:"WButton",props:{variant:{},size:{},loading:{type:Boolean},disabled:{type:Boolean},active:{type:Boolean},icon:{type:[Object,Function]},href:{}},emits:["click"],setup(n,{emit:p}){const t=n,a=p;return(r,c)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.href?"a":"button"),{href:n.href,disabled:n.disabled||n.loading,"data-variant":t.variant??"primary","data-size":t.size??"md","data-active":n.active?"true":void 0,onClick:c[0]||(c[0]=i=>a("click",i)),class:e.normalizeClass(["wpic-button","wpic:relative wpic:inline-flex wpic:items-center wpic:justify-center wpic:font-medium wpic:transition-all wpic:duration-150 wpic:cursor-pointer wpic:select-none","wpic:focus-visible:outline-none wpic:focus-visible:ring-2 wpic:focus-visible:ring-indigo-500/50 wpic:focus-visible:ring-offset-1","wpic:active:scale-[0.98]",n.disabled||n.loading?"wpic:opacity-40 wpic:cursor-not-allowed wpic:pointer-events-none":"",n.active?"wpic-button--active":"",(t.size??"md")==="sm"?"wpic:h-8 wpic:touch-manipulation wpic:px-2.5 wpic:gap-1.5 wpic:rounded-md wpic:text-sm":"",(t.size??"md")==="md"?(t.variant==="subtle"?"wpic:h-11":"wpic:h-9")+" wpic:px-3.5 wpic:gap-2 wpic:rounded-lg":"",(t.size??"md")==="lg"?(t.variant==="subtle"?"wpic:h-12":"wpic:h-11")+" wpic:px-4 wpic:gap-2 wpic:rounded-lg":"",(t.size??"md")==="xs"?"wpic:h-5 wpic:w-5 wpic:p-0 wpic:rounded-full wpic:text-xs":"",(t.variant??"primary")==="primary"?"wpic-btn-primary wpic:text-white":"",(t.variant??"primary")==="secondary"?"wpic:bg-zinc-100 wpic:hover:bg-zinc-200 wpic:text-zinc-700 wpic:dark:bg-zinc-800 wpic:dark:hover:bg-zinc-700 wpic:dark:text-zinc-200":"",(t.variant??"primary")==="subtle"?"wpic:bg-zinc-100 wpic:border wpic:border-zinc-100 wpic:hover:bg-zinc-200/70 wpic:text-zinc-700 wpic:dark:bg-zinc-800 wpic:dark:border-zinc-800 wpic:dark:hover:bg-zinc-700 wpic:dark:text-zinc-200":"",(t.variant??"primary")==="destructive"?"wpic:bg-red-500 wpic:hover:bg-red-600 wpic:text-white":"",(t.variant??"primary")==="ghost"?"wpic:bg-transparent wpic:hover:bg-zinc-100 wpic:text-zinc-600 wpic:hover:text-zinc-900 wpic:dark:hover:bg-zinc-800 wpic:dark:text-zinc-400 wpic:dark:hover:text-zinc-100":"",t.variant==="ghost-transparent"?"wpic:bg-transparent wpic:hover:bg-[#80808026] wpic:text-inherit":"",t.variant==="ghost-transparent"&&!n.disabled&&!n.loading?"wpic:opacity-60 wpic:hover:opacity-100 wpic:focus-visible:opacity-100":"",(t.variant??"primary")==="outline"?"wpic:bg-transparent wpic:border wpic:border-zinc-200 wpic:hover:bg-zinc-50 wpic:text-zinc-700 wpic:dark:border-zinc-800 wpic:dark:hover:bg-zinc-800 wpic:dark:text-zinc-300":""])},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(["wpic:inline-flex wpic:items-center wpic:justify-center wpic:gap-[inherit]",n.loading?"wpic:invisible":""])},[n.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.icon),{key:0,size:(t.size??"md")==="xs"?10:(t.size??"md")==="sm"?12:((t.size??"md")==="lg",15)},null,8,["size"])):e.createCommentVNode("",!0),e.renderSlot(r.$slots,"default")],2),n.loading?(e.openBlock(),e.createElementBlock("span",h0,[e.createVNode(e.unref(b.Loader2),{size:(t.size??"md")==="xs"?10:(t.size??"md")==="sm"?13:(t.size??"md")==="lg"?17:15,class:"wpic:animate-spin"},null,8,["size"])])):e.createCommentVNode("",!0)]),_:3},8,["href","disabled","data-variant","data-size","data-active","class"]))}}),f0={class:"wpic-button-group wpic:inline-flex"},x2=e.defineComponent({__name:"WButtonGroup",setup(n){return(p,t)=>(e.openBlock(),e.createElementBlock("div",f0,[e.renderSlot(p.$slots,"default")]))}}),v0={class:"wpic-filter wpic:flex wpic:items-center wpic:gap-1"},b0=["onClick"],g0=e.defineComponent({__name:"WFilter",props:{options:{},modelValue:{}},emits:["update:modelValue"],setup(n){return(p,t)=>(e.openBlock(),e.createElementBlock("div",v0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.options,(a,r)=>(e.openBlock(),e.createElementBlock("button",{key:r,type:"button",onClick:c=>p.$emit("update:modelValue",a.value),class:e.normalizeClass(["wpic:px-2.5 wpic:py-1 wpic:text-base wpic:font-medium wpic:rounded-full wpic:transition-all wpic:duration-150 wpic:cursor-pointer wpic:whitespace-nowrap",n.modelValue===a.value?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:border wpic:border-zinc-300 wpic:dark:border-zinc-600":"wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:hover:text-zinc-600 wpic:dark:hover:text-zinc-300 wpic:border wpic:border-transparent"])},e.toDisplayString(a.label),11,b0))),128))]))}}),C0={class:"wpic-form-label wpic:block wpic:mb-1 wpic:font-medium wpic:text-zinc-600 wpic:dark:text-zinc-400"},k0={key:0,class:"wpic:ml-0.5",style:{color:"#EF4444"}},i2=e.defineComponent({__name:"WFormLabel",props:{required:{type:Boolean}},setup(n){return(p,t)=>(e.openBlock(),e.createElementBlock("label",C0,[e.renderSlot(p.$slots,"default"),n.required?(e.openBlock(),e.createElementBlock("span",k0,"*")):e.createCommentVNode("",!0)]))}}),z0={class:"wpic:relative wpic:flex wpic:items-center wpic:w-full"},y0=["data-size","data-variant","type","placeholder","disabled","required"],x0={key:2,class:"wpic:pointer-events-none wpic:absolute wpic:right-2.5 wpic:text-zinc-400 wpic:dark:text-zinc-500"},a2=e.defineComponent({inheritAttrs:!1,__name:"WInput",props:e.mergeModels({icon:{type:[Object,Function]},label:{},placeholder:{},required:{type:Boolean},type:{},disabled:{type:Boolean},size:{},clearable:{type:Boolean},loading:{type:Boolean},variant:{},prepend:{},append:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const p=e.useModel(n,"modelValue"),t=n,a=e.useSlots(),r=e.computed(()=>t.prepend!==void 0||!!a.prepend),c=e.computed(()=>t.append!==void 0||!!a.append),i=e.computed(()=>{if(t.icon)return t.icon;if(t.type==="date")return b.Calendar;if(t.type==="money")return b.DollarSign}),w=e.computed(()=>({sm:12,md:13,lg:14,xl:16})[t.size??"md"]),u=e.computed(()=>t.type==="money"?"number":t.type??"text"),f=e.ref(),l=e.ref(),M=e.ref(0);let z;e.watch(l,g=>{z?.disconnect(),M.value=g?.getBoundingClientRect().width??0,g&&(z=new ResizeObserver(()=>{M.value=g.getBoundingClientRect().width}),z.observe(g))},{flush:"post"}),e.onBeforeUnmount(()=>z?.disconnect());function S(){t.type==="date"&&f.value?.showPicker()}if(typeof document<"u"){const g="winput-date-no-picker";if(!document.getElementById(g)){const m=document.createElement("style");m.id=g,m.textContent='input[type="date"]::-webkit-calendar-picker-indicator { display: none; }',document.head.appendChild(m)}const v="winput-number-no-spinner";if(!document.getElementById(v)){const m=document.createElement("style");m.id=v,m.textContent="input.winput-number::-webkit-outer-spin-button, input.winput-number::-webkit-inner-spin-button { display: none; } input.winput-number { -moz-appearance: textfield; }",document.head.appendChild(m)}}return(g,v)=>(e.openBlock(),e.createElementBlock("div",e.mergeProps(g.$attrs,{class:"wpic:w-full"}),[t.label?(e.openBlock(),e.createBlock(i2,{key:0,required:t.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["required"])):e.createCommentVNode("",!0),e.createElementVNode("div",z0,[i.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value),{key:0,size:w.value,class:e.normalizeClass(["wpic:absolute wpic:shrink-0 wpic:text-zinc-400 wpic:dark:text-zinc-500",[t.size==="xl"?"wpic:left-4":"wpic:left-2.5",t.type==="date"?"wpic:cursor-pointer":"wpic:pointer-events-none"]]),onClick:S},null,8,["size","class"])):r.value?(e.openBlock(),e.createElementBlock("span",{key:1,ref_key:"prependRef",ref:l,class:"wpic:pointer-events-none wpic:absolute wpic:left-2.5 wpic:text-zinc-400 wpic:dark:text-zinc-500"},[e.renderSlot(g.$slots,"prepend",{},()=>[e.createTextVNode(e.toDisplayString(t.prepend),1)])],512)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:f,class:e.normalizeClass(["wpic-control",["wpic:w-full wpic:rounded-lg wpic:outline-none wpic:transition-colors",t.size==="sm"?"wpic:text-sm":"wpic:text-base",u.value==="number"?"winput-number":"",t.size==="sm"?"wpic:h-8":t.size==="lg"?"wpic:h-11":t.size==="xl"?"wpic:h-14":"wpic:h-9",i.value||r.value?t.size==="xl"?"wpic:pl-11":"wpic:pl-9":t.size==="xl"?"wpic:pl-4":"wpic:pl-2.5",c.value&&(t.clearable&&p.value||t.loading)?"wpic:pr-14":c.value?"wpic:pr-9":t.clearable&&p.value||t.loading?t.size==="xl"?"wpic:pr-10":"wpic:pr-7":t.size==="xl"?"wpic:pr-4":"wpic:pr-2.5",t.variant==="plain"?"wpic:bg-transparent wpic:border-0 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:focus-visible:ring-1 wpic:focus-visible:ring-current wpic:disabled:opacity-60 wpic:disabled:cursor-not-allowed":t.disabled?(t.variant??"default")==="subtle"?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:cursor-not-allowed wpic:opacity-60":"wpic:bg-zinc-50 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:cursor-not-allowed wpic:opacity-60":(t.variant??"default")==="subtle"?"wpic:bg-zinc-100 wpic:dark:bg-zinc-800 wpic:border wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic:cursor-text wpic:hover:bg-zinc-200/70 wpic:dark:hover:bg-zinc-700":"wpic:bg-white wpic:dark:bg-zinc-900 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:placeholder:text-zinc-400 wpic:dark:placeholder:text-zinc-500 wpic-input-field wpic:cursor-text"]]),style:e.normalizeStyle(r.value&&!i.value?{paddingLeft:`calc(${M.value}px + 1.25rem)`}:void 0),"data-size":t.size??"md","data-variant":t.variant??"default","onUpdate:modelValue":v[0]||(v[0]=m=>p.value=m),type:u.value,placeholder:t.placeholder??"",disabled:t.disabled,required:t.required},null,14,y0),[[e.vModelDynamic,p.value]]),c.value?(e.openBlock(),e.createElementBlock("span",x0,[e.renderSlot(g.$slots,"append",{},()=>[e.createTextVNode(e.toDisplayString(t.append),1)])])):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createBlock(e.unref(b.Loader2),{key:3,size:t.size==="xl"?14:11,class:e.normalizeClass(["wpic:absolute wpic:animate-spin wpic:text-zinc-400 wpic:dark:text-zinc-500",c.value?"wpic:right-8":t.size==="xl"?"wpic:right-4":"wpic:right-2"])},null,8,["size","class"])):t.clearable&&p.value?(e.openBlock(),e.createElementBlock("button",{key:4,type:"button",onClick:v[1]||(v[1]=m=>p.value=""),class:e.normalizeClass(["wpic:absolute wpic:flex wpic:items-center wpic:justify-center wpic:text-zinc-400 wpic:hover:text-zinc-600 wpic:dark:hover:text-zinc-300 wpic:transition-colors wpic:cursor-pointer",c.value?"wpic:right-8":t.size==="xl"?"wpic:right-4":"wpic:right-2"])},[e.createVNode(e.unref(b.X),{size:t.size==="xl"?14:11},null,8,["size"])],2)):e.createCommentVNode("",!0)])],16))}}),B0=["disabled"],c2=e.defineComponent({__name:"WCheckbox",props:e.mergeModels({disabled:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const p=e.useModel(n,"modelValue");return(t,a)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["wpic-checkbox wpic:relative wpic:inline-flex wpic:items-center wpic:gap-2 wpic:select-none",n.disabled?"wpic:cursor-not-allowed wpic:opacity-50":"wpic:cursor-pointer"])},[e.withDirectives(e.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":a[0]||(a[0]=r=>p.value=r),disabled:n.disabled,class:"wpic:peer wpic:sr-only"},null,8,B0),[[e.vModelCheckbox,p.value]]),e.createElementVNode("span",{class:e.normalizeClass(["wpic-checkbox-box",["wpic:flex wpic:h-4 wpic:w-4 wpic:shrink-0 wpic:items-center wpic:justify-center wpic:rounded-[4px] wpic:border wpic:transition-all wpic:duration-150","wpic:peer-focus-visible:ring-2 wpic:peer-focus-visible:ring-zinc-400/40 wpic:peer-focus-visible:ring-offset-1 wpic:peer-focus-visible:ring-offset-white wpic:dark:peer-focus-visible:ring-offset-zinc-950",p.value?"wpic:border-zinc-900 wpic:bg-zinc-900 wpic:text-white wpic:dark:border-zinc-100 wpic:dark:bg-zinc-100 wpic:dark:text-zinc-950":"wpic:border-zinc-300 wpic:bg-white wpic:text-transparent wpic:shadow-sm wpic:hover:border-zinc-400 wpic:dark:border-zinc-700 wpic:dark:bg-zinc-900 wpic:dark:hover:border-zinc-500"]])},[e.createVNode(e.unref(b.Check),{size:11,"stroke-width":"2.6"})],2),e.renderSlot(t.$slots,"default")],2))}}),O1=e.defineComponent({__name:"WSpinner",props:{size:{default:"md"},tone:{default:"muted"}},setup(n){const p=n,t={sm:"wpic:h-4 wpic:w-4 wpic:border-2",md:"wpic:h-5 wpic:w-5 wpic:border-2",lg:"wpic:h-7 wpic:w-7 wpic:border-[3px]"};return(a,r)=>(e.openBlock(),e.createElementBlock("span",{role:"status","aria-live":"polite","aria-label":"Loading",class:e.normalizeClass(["wpic-spinner","wpic:inline-block wpic:shrink-0 wpic:animate-spin wpic:rounded-full wpic:border-current wpic:border-t-transparent",t[p.size],p.tone==="muted"?"wpic:text-zinc-300 wpic:dark:text-zinc-700":"wpic:text-[var(--wpic-primary,#6366f1)]"])},null,2))}}),M0={key:0,class:"wpic:text-zinc-400 wpic:dark:text-zinc-500 wpic:whitespace-nowrap wpic:shrink-0"},V0={key:1,role:"status","aria-live":"polite",class:"wpic:flex wpic:items-center wpic:justify-center wpic:py-12 wpic:gap-3 wpic:text-base wpic:text-zinc-400 wpic:dark:text-zinc-500"},E0={class:"wpic-table__scroll",style:{"overflow-x":"auto"}},N0={class:"wpic:w-full wpic:border-collapse"},S0={key:0,style:{width:"36px"}},L0={key:1,style:{width:"32px"}},D0={key:0},F0={class:"wpic-table__header wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},$0=["onClick"],T0={key:1},A0={key:0,class:"wpic-table__summary wpic-table__divider wpic:border-b wpic:border-zinc-200 wpic:font-medium wpic:dark:border-zinc-700"},H0={key:0},P0={key:1},j0=["onClick"],W0=["onClick"],R0={key:0,class:"wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},I0=["colspan"],Z0={key:2},U0=["colspan"],K0={class:"wpic:flex wpic:flex-col wpic:items-center wpic:gap-2"},O0={class:"wpic:tabular-nums wpic:text-zinc-400 wpic:dark:text-zinc-500"},q0={key:0,class:"wpic:flex wpic:items-center wpic:gap-0.5"},Y0=["aria-label","disabled"],Q0={key:0,class:"wpic:w-6 wpic:text-center wpic:text-base wpic:select-none wpic:text-zinc-400 wpic:dark:text-zinc-500"},J0=["onClick"],X0=["aria-label","disabled"],G0=e.defineComponent({__name:"WTable",props:{data:{},columns:{},loading:{type:Boolean},loadingSpinner:{type:Boolean,default:!0},labels:{},emptyText:{},pageSize:{},serverTotal:{},serverPage:{},searchPlaceholder:{default:"Search…"},rowClickable:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},expandable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectedKeys:{},rowKey:{default:"id"},flushEdges:{type:Boolean,default:!1},rowClass:{},rowStyle:{},summaryRow:{},compact:{type:Boolean},padding:{},showFooter:{type:Boolean,default:!0},columnDividers:{type:Boolean,default:!1}},emits:["row-click","update:selectedKeys","row-select","update:serverPage"],setup(n,{expose:p,emit:t}){const a=n,r=t,c=e.ref(new Set);function i(E){c.value.has(E)?c.value.delete(E):c.value.add(E)}const w=e.useSlots(),u=e.computed(()=>a.pageSize??25),f=e.ref(null),l=e.ref("asc");function M(E){f.value===E?l.value=l.value==="asc"?"desc":"asc":(f.value=E,l.value="asc")}const z=e.ref(""),S=e.computed(()=>a.columns.some(E=>E.searchable)),g=e.computed(()=>{let E=a.data??[];const J=z.value.trim().toLowerCase();if(J){const k=a.columns.filter($=>$.searchable).map($=>$.field);E=E.filter($=>k.some(Z=>String($[Z]??"").toLowerCase().includes(J)))}if(f.value){const k=f.value;E=[...E].sort(($,Z)=>{const e1=$[k]??"",r1=Z[k]??"",u1=typeof e1=="number"&&typeof r1=="number"?e1-r1:String(e1).toLowerCase().localeCompare(String(r1).toLowerCase());return l.value==="asc"?u1:-u1})}return E}),v=e.ref(1),m=e.computed(()=>a.serverTotal!==void 0),F=e.computed({get:()=>m.value?a.serverPage??1:v.value,set:E=>{m.value?r("update:serverPage",E):v.value=E}}),q=e.computed(()=>m.value?a.serverTotal??0:g.value.length),t1=e.computed(()=>Math.max(1,Math.ceil(q.value/u.value)));e.watch([z,()=>a.data],()=>{m.value||(F.value=1),c.value.clear()});const G=e.computed(()=>{if(m.value)return g.value;const E=(F.value-1)*u.value;return g.value.slice(E,E+u.value)});function P(E,J){const k=E[a.rowKey];return typeof k=="string"||typeof k=="number"?k:`${F.value}:${J}`}const L=e.computed(()=>new Set(a.selectedKeys??[])),V=e.computed(()=>G.value.map(P)),N=e.computed(()=>a.selectable&&V.value.length>0&&V.value.every(E=>L.value.has(E)));function B(E,J,k){const $=P(E,J),Z=new Set(a.selectedKeys??[]),e1=k===!0;e1?Z.add($):Z.delete($),r("update:selectedKeys",[...Z]),r("row-select",E,e1)}function U(E){const J=new Set(a.selectedKeys??[]),k=E===!0;for(const $ of V.value)k?J.add($):J.delete($);r("update:selectedKeys",[...J])}const K=e.computed(()=>q.value===0?0:(F.value-1)*u.value+1),l1=e.computed(()=>Math.min(F.value*u.value,q.value)),j=e.computed(()=>{const E=t1.value;if(E<=7)return Array.from({length:E},(e1,r1)=>r1+1);const J=F.value,k=[],$=new Set([1,E,J-1,J,J+1].filter(e1=>e1>=1&&e1<=E));let Z=0;for(const e1 of[...$].sort((r1,u1)=>r1-u1))e1-Z>1&&k.push("…"),k.push(e1),Z=e1;return k}),Q=e.computed(()=>a.padding?`wpic-table--padding-${a.padding}`:a.compact?"wpic-table--padding-sm":"wpic-table--padding-inherit"),W=E=>E==="right"?"wpic:text-right":E==="center"?"wpic:text-center":"wpic:text-left",c1=(E,J)=>[J,a.flushEdges&&E===0&&!a.expandable&&!a.selectable?"wpic:pl-0":"wpic-table__pad-l",a.flushEdges&&E===a.columns.length-1?"wpic:pr-0":"wpic-table__pad-r"],s1=E=>({...E.width?{width:E.width}:{},...E.minWidth?{minWidth:E.minWidth}:{}});return p({filteredCount:e.computed(()=>g.value.length),searchQuery:z}),(E,J)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["wpic-table",[Q.value,{"wpic-table--column-dividers":n.columnDividers}]])},[(S.value||e.unref(w).toolbar)&&!n.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wpic:flex wpic:items-center wpic:gap-2 wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic-table__pad-x",n.compact?"wpic:py-1":"wpic:py-2"])},[S.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(a2,{modelValue:z.value,"onUpdate:modelValue":J[0]||(J[0]=k=>z.value=k),placeholder:n.searchPlaceholder,icon:e.unref(b.Search),class:"wpic:flex-1"},null,8,["modelValue","placeholder","icon"]),z.value?(e.openBlock(),e.createElementBlock("span",M0,e.toDisplayString(g.value.length)+" "+e.toDisplayString(n.labels?.results??"results"),1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),e.renderSlot(E.$slots,"toolbar")],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("div",V0,[n.loadingSpinner?(e.openBlock(),e.createBlock(O1,{key:0,tone:"muted"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(n.labels?.loading??"Loading…"),1)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",E0,[e.createElementVNode("table",N0,[e.createElementVNode("colgroup",null,[n.selectable?(e.openBlock(),e.createElementBlock("col",S0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("col",L0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,k=>(e.openBlock(),e.createElementBlock("col",{key:k.field,style:e.normalizeStyle(s1(k))},null,4))),128))]),a.showHeader!==!1?(e.openBlock(),e.createElementBlock("thead",D0,[e.createElementVNode("tr",F0,[n.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(["wpic:w-9 wpic:pr-2",n.compact?"wpic:py-1.5":"wpic:py-3",n.flushEdges?"wpic:pl-0":"wpic:pl-2"])},[e.createVNode(c2,{"model-value":N.value,onClick:J[1]||(J[1]=e.withModifiers(()=>{},["stop"])),"onUpdate:modelValue":U},null,8,["model-value"])],2)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(["wpic:w-8 wpic:pr-2",n.compact?"wpic:py-1.5":"wpic:py-3",n.flushEdges&&!n.selectable?"wpic:pl-0":"wpic:pl-2"])},null,2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(k,$)=>(e.openBlock(),e.createElementBlock("th",{key:k.field,class:e.normalizeClass([c1($,n.compact?"wpic:py-1.5":"wpic:py-3"),"wpic:whitespace-nowrap wpic:text-zinc-500 wpic:dark:text-zinc-300 wpic:font-medium",W(k.align),$===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10":""]),style:e.normalizeStyle({...s1(k)})},[e.renderSlot(E.$slots,"th-"+k.field,{col:k,sortField:f.value,sortDir:l.value,toggleSort:M},()=>[k.sortable?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:Z=>M(k.field),class:e.normalizeClass(["wpic:inline-flex wpic:items-center wpic:gap-1 wpic:cursor-pointer wpic:transition-colors wpic:whitespace-nowrap",k.align==="right"?"wpic:ml-auto":""]),style:{color:"inherit"}},[e.createTextVNode(e.toDisplayString(k.label)+" ",1),f.value===k.field&&l.value==="asc"?(e.openBlock(),e.createBlock(e.unref(b.ChevronUp),{key:0,size:11,style:{color:"#5E6AD2"}})):f.value===k.field&&l.value==="desc"?(e.openBlock(),e.createBlock(e.unref(b.ChevronDown),{key:1,size:11,style:{color:"#5E6AD2"}})):(e.openBlock(),e.createBlock(e.unref(b.ChevronsUpDown),{key:2,size:10,style:{opacity:"0.3"}}))],10,$0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(k.label),1)],64))])],6))),128))])])):e.createCommentVNode("",!0),n.loading?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tbody",T0,[n.summaryRow?(e.openBlock(),e.createElementBlock("tr",A0,[n.selectable?(e.openBlock(),e.createElementBlock("td",H0)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("td",P0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(k,$)=>(e.openBlock(),e.createElementBlock("td",{key:k.field,class:e.normalizeClass([c1($,n.compact?"wpic:py-1":"wpic:py-2.5"),W(k.align),$===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10 wpic:text-zinc-900 wpic:dark:text-zinc-100":"wpic:text-zinc-700 wpic:dark:text-zinc-200"])},[e.renderSlot(E.$slots,"summary-"+k.field,{row:n.summaryRow,value:n.summaryRow[k.field]},()=>[e.createTextVNode(e.toDisplayString(n.summaryRow[k.field]??"—"),1)])],2))),128))])):e.createCommentVNode("",!0),G.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(G.value,(k,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:$},[e.createElementVNode("tr",{class:e.normalizeClass(["wpic-table__row wpic:group wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800",[n.expandable&&c.value.has($)?"wpic:border-b-0":"",n.rowClass?.(k)]]),style:e.normalizeStyle({cursor:n.rowClickable||n.expandable?"pointer":"default",...n.rowStyle?.(k)??{}}),onClick:Z=>n.expandable?i($):n.rowClickable&&r("row-click",k)},[n.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(["wpic:w-9 wpic:pr-2",n.compact?"wpic:py-1":"wpic:py-2.5",n.flushEdges?"wpic:pl-0":"wpic:pl-2"]),onClick:J[2]||(J[2]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(c2,{"model-value":L.value.has(P(k,$)),"onUpdate:modelValue":Z=>B(k,$,Z)},null,8,["model-value","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0),n.expandable?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(["wpic:w-8 wpic:pr-1 wpic:text-zinc-400 wpic:dark:text-zinc-500",n.compact?"wpic:py-1":"wpic:py-2.5",n.flushEdges&&!n.selectable?"wpic:pl-0":"wpic:pl-3"])},[c.value.has($)?(e.openBlock(),e.createBlock(e.unref(b.ChevronDown),{key:0,size:13,style:{transition:"transform .15s"}})):(e.openBlock(),e.createBlock(e.unref(b.ChevronRight),{key:1,size:13,style:{transition:"transform .15s"}}))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(Z,e1)=>(e.openBlock(),e.createElementBlock("td",{key:Z.field,class:e.normalizeClass([c1(e1,n.compact?"wpic:py-1":"wpic:py-2.5"),W(Z.align),e1===0&&!n.expandable&&!n.selectable?"wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10 wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:font-medium":"wpic:text-zinc-700 wpic:dark:text-zinc-200"]),onClick:r1=>n.expandable?(n.rowClickable&&r("row-click",k),r1.stopPropagation()):void 0},[e.renderSlot(E.$slots,Z.field,{row:k,value:k[Z.field]},()=>[e.createTextVNode(e.toDisplayString(k[Z.field]??"—"),1)])],10,W0))),128))],14,j0),n.expandable&&c.value.has($)?(e.openBlock(),e.createElementBlock("tr",R0,[e.createElementVNode("td",{colspan:n.columns.length+(n.expandable?1:0)+(n.selectable?1:0),class:"wpic-table__pad-x wpic:pb-3 wpic:pt-0"},[e.renderSlot(E.$slots,"expand",{row:k})],8,I0)])):e.createCommentVNode("",!0)],64))),128)):(e.openBlock(),e.createElementBlock("tr",Z0,[e.createElementVNode("td",{colspan:n.columns.length+(n.expandable?1:0)+(n.selectable?1:0),class:"wpic:py-16 wpic:text-center wpic:text-zinc-400 wpic:dark:text-zinc-500"},[e.createElementVNode("div",K0,[e.renderSlot(E.$slots,"empty-icon"),e.createTextVNode(" "+e.toDisplayString(n.emptyText??"No data"),1)])],8,U0)]))]))])]),n.showFooter&&q.value>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["wpic:flex wpic:items-center wpic:justify-between wpic-table__divider wpic:border-t wpic:border-zinc-100 wpic:dark:border-zinc-800 wpic-table__pad-x",n.compact?"wpic:py-1":"wpic:py-2.5"])},[e.createElementVNode("span",O0,[t1.value>1?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(K.value)+"–"+e.toDisplayString(l1.value)+" "+e.toDisplayString(n.labels?.of??"of")+" "+e.toDisplayString(q.value),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(q.value)+" "+e.toDisplayString(q.value===1?n.labels?.item??"item":n.labels?.items??"items"),1)],64))]),t1.value>1?(e.openBlock(),e.createElementBlock("div",q0,[e.createElementVNode("button",{"aria-label":n.labels?.previous??"Previous page",onClick:J[3]||(J[3]=k=>F.value--),disabled:F.value===1,class:"wpic:h-7 wpic:w-7 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition-colors wpic:cursor-pointer wpic:disabled:opacity-30 wpic:hover:bg-zinc-50 wpic:dark:hover:bg-zinc-800/50 wpic:text-zinc-400"},[e.createVNode(e.unref(b.ChevronLeft),{size:13})],8,Y0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,k=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:k},[k==="…"?(e.openBlock(),e.createElementBlock("span",Q0,"…")):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:$=>F.value=k,class:e.normalizeClass(["wpic:h-7 wpic:min-w-7 wpic:px-2 wpic:rounded-md wpic:text-sm wpic:font-medium wpic:transition-colors wpic:cursor-pointer",F.value===k?"":"wpic:text-zinc-700 wpic:dark:text-zinc-200 wpic:hover:bg-zinc-100 wpic:dark:hover:bg-zinc-700"]),style:e.normalizeStyle(F.value===k?"background:rgba(94,106,210,0.1);color:#5E6AD2":void 0)},e.toDisplayString(k),15,J0))],64))),128)),e.createElementVNode("button",{"aria-label":n.labels?.next??"Next page",onClick:J[4]||(J[4]=k=>F.value++),disabled:F.value===t1.value,class:"wpic:h-7 wpic:w-7 wpic:flex wpic:items-center wpic:justify-center wpic:rounded-md wpic:transition-colors wpic:cursor-pointer wpic:disabled:opacity-30 wpic:hover:bg-zinc-50 wpic:dark:hover:bg-zinc-800/50 wpic:text-zinc-400"},[e.createVNode(e.unref(b.ChevronRight),{size:13})],8,X0)])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],64))],2))}}),_0={key:0,class:"w-spreadsheet-frame__heading"},e3={key:1,class:"w-spreadsheet-frame__status"},n3=["title","aria-label"],t3={key:1,class:"wpic:flex wpic:min-h-64 wpic:items-center wpic:justify-center wpic:gap-3 wpic:text-zinc-400 wpic:dark:text-zinc-500"},c3={key:0,class:"w-spreadsheet__row-axis-col"},l3={key:0},i3={key:0,class:"w-spreadsheet__corner"},a3={key:0,class:"w-spreadsheet__axis"},o3=["colspan","title","tabindex","onClick","onKeydown","onPointerenter","onPointerdown"],r3={key:0,class:"w-spreadsheet__editor"},s3=["type","value","min","placeholder","onInput"],p3=["onPointerdown"],d3=e.defineComponent({__name:"WSpreadsheet",props:{appearance:{},columns:{},rows:{},showAxes:{type:Boolean,default:!0},showColumnLetters:{type:Boolean,default:!0},showRowNumbers:{type:Boolean,default:!0},minWidth:{default:"960px"},maxHeight:{default:"68vh"},sortable:{type:Boolean},expandable:{type:Boolean},showExpandButton:{type:Boolean},actionsOnHover:{type:Boolean},downloadable:{type:Boolean},showDownloadButton:{type:Boolean},downloadFilename:{},fillHandle:{type:Boolean},expanded:{type:Boolean},downloadRequest:{},loading:{type:Boolean}},emits:["update:expanded","cell-change"],setup(n,{expose:p,emit:t}){const a=n,r=t,c=e.computed(()=>a.showAxes&&a.showColumnLetters),i=e.computed(()=>a.showAxes&&a.showRowNumbers),w=e.computed(()=>a.columns.some(x=>x.sticky)),u=e.ref(null),f=e.ref("asc"),l=e.ref(a.expanded??!1),M=e.ref(null),z=e.ref(null),S=e.ref(null),g=e.ref(null),v=e.ref(null);function m(){if(!a.downloadable)return;const x=D=>`"${String(D??"").replace(/"/g,'""')}"`,A=L.value.map(D=>a.columns.map(H=>x(G(D,H.key))).join(",")).join(`\r
2
2
  `),T=new Blob([`\uFEFF${A}`],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(T),Y=document.createElement("a");Y.href=X,Y.download=a.downloadFilename||"spreadsheet.csv",Y.click(),URL.revokeObjectURL(X)}function F(x,A=!0){if(l.value===x)return;const T=performance.now();console.debug(`[WSpreadsheet] ${x?"expand":"minimize"} requested`),l.value=x,A&&r("update:expanded",x),requestAnimationFrame(()=>requestAnimationFrame(()=>{console.debug(`[WSpreadsheet] ${x?"expand":"minimize"} painted in ${(performance.now()-T).toFixed(1)}ms`)}))}e.watch(()=>a.expanded,x=>{x!=null&&F(x,!1)}),e.watch(()=>a.downloadRequest,(x,A)=>{x!=null&&x!==A&&m()}),p({expand:()=>{a.expandable&&F(!0)},collapse:()=>{F(!1)},toggleExpanded:()=>{a.expandable&&F(!l.value)},download:m});function q(x){x.key==="Escape"&&l.value&&F(!1)}function t1(x){if(x.target?.closest(".w-spreadsheet__cell")?.querySelector(".w-spreadsheet__input"))return;g.value=null,v.value=null;const X=document.activeElement;X&&M.value?.contains(X)&&X.blur()}e.onMounted(()=>{document.addEventListener("keydown",q),document.addEventListener("pointerdown",t1)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",q),document.removeEventListener("pointerdown",t1),window.removeEventListener("pointerup",$)});function G(x,A){return x.cells.find(T=>T.key===A)?.value??""}function P(x){if(typeof x=="number")return x;const A=String(x).trim().replace(/[\s,]/g,"");return A!==""&&/^-?\d+(\.\d+)?$/.test(A)?Number(A):String(x).toLocaleLowerCase()}const L=e.computed(()=>{if(!u.value)return a.rows;const x=a.rows.filter(X=>X.sortable!==!1),A=f.value==="asc"?1:-1;x.sort((X,Y)=>{const D=P(G(X,u.value)),H=P(G(Y,u.value));return typeof D=="number"&&typeof H=="number"?(D-H)*A:String(D).localeCompare(String(H),void 0,{numeric:!0})*A});let T=0;return a.rows.map(X=>X.sortable===!1?X:x[T++])});function V(x){const A=a.columns.find(T=>T.key===x.key);return!!(a.sortable&&x.variant==="header"&&A?.sortable!==!1)}function N(x){V(x)&&(u.value===x.key?f.value=f.value==="asc"?"desc":"asc":(u.value=x.key,f.value="asc"))}function B(x,A){return x.cells.slice(0,A).reduce((T,X)=>T+(X.colspan||1),0)}function U(x,A){return!!a.columns[B(x,A)]?.sticky}function K(x,A){const T=B(x,A);return!!(a.columns[T]?.sticky&&!a.columns.slice(0,T).some(X=>X.sticky))}function l1(x,A){const T=B(x,A);if(!a.columns[T]?.sticky)return;const X=a.columns.slice(0,T).map(Y=>Y.width||"0px");return{left:X.length?`calc(${X.join(" + ")})`:"0px"}}function j(x,A){return`${x.key}\0${A.key}`}function Q(x,A){!A.editable||z.value||(g.value={rowKey:x.key,cellKey:A.key},v.value=null)}function W(x,A){return g.value?.rowKey===x.key&&g.value?.cellKey===A.key}function c1(x,A,T){const X=L.value[x];!a.fillHandle||!T.editable||!X||!W(X,T)||(v.value=null,z.value={row:x,cell:A,value:String(T.value??"")},S.value={row:x,cell:A},window.addEventListener("pointerup",$,{once:!0}))}function s1(x,A){z.value&&(S.value={row:x,cell:A})}function E(x,A){if(!z.value||!S.value)return!1;const T=Math.min(z.value.row,S.value.row),X=Math.max(z.value.row,S.value.row),Y=Math.min(z.value.cell,S.value.cell),D=Math.max(z.value.cell,S.value.cell);return x>=T&&x<=X&&A>=Y&&A<=D}function J(x,A){if(!E(x,A)||!z.value||!S.value)return{};const T=Math.min(z.value.row,S.value.row),X=Math.max(z.value.row,S.value.row),Y=Math.min(z.value.cell,S.value.cell),D=Math.max(z.value.cell,S.value.cell);return{"w-spreadsheet__cell--fill-range":!0,"w-spreadsheet__cell--fill-top":x===T,"w-spreadsheet__cell--fill-bottom":x===X,"w-spreadsheet__cell--fill-left":A===Y,"w-spreadsheet__cell--fill-right":A===D}}function k(x,A){const T=j(x,A);return{"w-spreadsheet__cell--fill-completed":!!v.value?.cells.has(T),"w-spreadsheet__cell--fill-source":v.value?.source===T}}function $(){if(!z.value||!S.value)return;const x=z.value,A=S.value,T=Math.min(x.row,A.row),X=Math.max(x.row,A.row),Y=Math.min(x.cell,A.cell),D=Math.max(x.cell,A.cell),H=new Set,R=L.value[x.row],i1=R?.cells[x.cell];for(let m1=T;m1<=X;m1++){const y1=L.value[m1];if(y1)for(let M1=Y;M1<=D;M1++){const x1=y1.cells[M1];x1?.editable&&(H.add(j(y1,x1)),r("cell-change",{rowKey:y1.key,cellKey:x1.key,value:x.value,row:y1,cell:x1}))}}z.value=null,S.value=null,v.value=R&&i1?{cells:H,source:j(R,i1)}:null}function Z(x){let A=x+1,T="";for(;A>0;)A-=1,T=String.fromCharCode(65+A%26)+T,A=Math.floor(A/26);return T}function e1(x){return[`w-spreadsheet__cell--${x.variant||"default"}`,`w-spreadsheet__cell--${x.align||"left"}`,`w-spreadsheet__cell--tone-${x.tone||"default"}`,{"w-spreadsheet__cell--wrap":!!x.wrap},x.class||""]}function r1(x,A,T){const X=T.target.value;r("cell-change",{rowKey:x.key,cellKey:A.key,value:X,row:x,cell:A})}function u1(x){const T=x.currentTarget.previousElementSibling;T?.focus(),T?.showPicker?.()}return(x,A)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"frameRef",ref:M,class:e.normalizeClass(["w-spreadsheet-frame",{"w-spreadsheet-frame--expanded":l.value}])},[l.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"w-spreadsheet-frame__backdrop","aria-label":"Restore spreadsheet",onClick:A[0]||(A[0]=T=>F(!1))})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-spreadsheet-frame__surface",{"w-spreadsheet--plain":n.appearance==="plain"}])},[n.expandable&&(n.showExpandButton!==!1||l.value)||n.downloadable&&(n.showDownloadButton!==!1||l.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-spreadsheet-frame__toolbar",{"w-spreadsheet-frame__toolbar--hover":n.actionsOnHover&&!l.value}])},[l.value&&x.$slots["expanded-header"]?(e.openBlock(),e.createElementBlock("div",_0,[e.renderSlot(x.$slots,"expanded-header")])):e.createCommentVNode("",!0),x.$slots["toolbar-status"]?(e.openBlock(),e.createElementBlock("div",e3,[e.renderSlot(x.$slots,"toolbar-status")])):e.createCommentVNode("",!0),e.renderSlot(x.$slots,"toolbar"),n.downloadable&&(n.showDownloadButton!==!1||l.value)?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"w-spreadsheet-frame__expand",title:"Download spreadsheet","aria-label":"Download spreadsheet",onClick:m},[e.createVNode(e.unref(b.Download),{size:16})])):e.createCommentVNode("",!0),n.expandable&&(n.showExpandButton!==!1||l.value)?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"w-spreadsheet-frame__expand",title:l.value?"Restore spreadsheet":"Expand spreadsheet","aria-label":l.value?"Restore spreadsheet":"Expand spreadsheet",onClick:A[1]||(A[1]=T=>F(!l.value))},[l.value?(e.openBlock(),e.createBlock(e.unref(b.Minimize),{key:0,size:16})):(e.openBlock(),e.createBlock(e.unref(b.Expand),{key:1,size:16}))],8,n3)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),n.loading?(e.openBlock(),e.createElementBlock("div",t3,[e.createVNode(O1),A[2]||(A[2]=e.createElementVNode("span",null,"Preparing sales estimate…",-1))])):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["w-spreadsheet",{"w-spreadsheet--with-column-axis":c.value}]),style:e.normalizeStyle({maxHeight:l.value?"calc(100vh - 96px)":n.maxHeight})},[e.createElementVNode("table",{class:e.normalizeClass(["w-spreadsheet__table",{"w-spreadsheet__table--sticky-columns":w.value}]),style:e.normalizeStyle({minWidth:n.minWidth})},[e.createElementVNode("colgroup",null,[i.value?(e.openBlock(),e.createElementBlock("col",c3)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,T=>(e.openBlock(),e.createElementBlock("col",{key:T.key,style:e.normalizeStyle({width:T.width})},null,4))),128))]),c.value?(e.openBlock(),e.createElementBlock("thead",l3,[e.createElementVNode("tr",null,[i.value?(e.openBlock(),e.createElementBlock("th",i3)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.columns,(T,X)=>(e.openBlock(),e.createElementBlock("th",{key:T.key,class:"w-spreadsheet__axis"},e.toDisplayString(T.label||Z(X)),1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(T,X)=>(e.openBlock(),e.createElementBlock("tr",{key:T.key,class:e.normalizeClass({"w-spreadsheet__row--sticky":T.sticky})},[i.value?(e.openBlock(),e.createElementBlock("th",a3,e.toDisplayString(X+1),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.cells,(Y,D)=>(e.openBlock(),e.createElementBlock("td",{key:Y.key,class:e.normalizeClass(["w-spreadsheet__cell",[e1(Y),{"w-spreadsheet__cell--sortable":V(Y),"w-spreadsheet__cell--sticky":U(T,D),"w-spreadsheet__cell--sticky-first":K(T,D),"w-spreadsheet__cell--active":W(T,Y)},J(X,D),k(T,Y)]]),colspan:Y.colspan||1,title:Y.title,style:e.normalizeStyle(l1(T,D)),tabindex:V(Y)?0:void 0,onClick:H=>N(Y),onKeydown:[e.withKeys(e.withModifiers(H=>N(Y),["prevent"]),["enter"]),e.withKeys(e.withModifiers(H=>N(Y),["prevent"]),["space"])],onPointerenter:H=>s1(X,D),onPointerdown:H=>Q(T,Y)},[e.renderSlot(x.$slots,`cell-${Y.key}`,{row:T,cell:Y,rowIndex:X},()=>[Y.editable?(e.openBlock(),e.createElementBlock("div",r3,[e.createElementVNode("input",{class:e.normalizeClass(["w-spreadsheet__input",{"w-spreadsheet__input--date":Y.inputType==="date"}]),type:Y.inputType||"text",value:Y.value??"",min:Y.min,placeholder:Y.placeholder,onInput:H=>r1(T,Y,H)},null,42,s3),Y.inputType==="date"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"w-spreadsheet__calendar","aria-label":"Choose date",title:"Choose date",onClick:u1},[e.createVNode(e.unref(b.CalendarDays),{size:16})])):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(Y.value??""),1)],64))]),V(Y)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value===Y.key?f.value==="asc"?e.unref(b.ChevronUp):e.unref(b.ChevronDown):e.unref(b.ChevronsUpDown)),{key:0,class:"w-spreadsheet__sort-icon",size:14})):e.createCommentVNode("",!0),n.fillHandle&&Y.editable&&W(T,Y)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"w-spreadsheet__fill-handle","aria-label":"Fill adjacent cells",title:"Drag to fill adjacent cells",onPointerdown:e.withModifiers(H=>c1(X,D,Y),["stop","prevent"])},null,40,p3)):e.createCommentVNode("",!0)],46,o3))),128))],2))),128))])],6)],6))],2)],2))}}),f1=(n,p)=>{const t=n.__vccOpts||n;for(const[a,r]of p)t[a]=r;return t},w3={},u3={class:"wpic:min-w-40 wpic:rounded-lg wpic:bg-white wpic:p-1.5 wpic:shadow-md wpic:shadow-zinc-900/5 wpic:dark:bg-zinc-700 wpic:dark:shadow-black/20"};function m3(n,p){return e.openBlock(),e.createElementBlock("div",u3,[e.renderSlot(n.$slots,"default")])}const l2=f1(w3,[["render",m3]]),h3=["disabled"],L1=e.defineComponent({__name:"WActionMenuItem",props:{danger:{type:Boolean},disabled:{type:Boolean}},emits:["click"],setup(n,{emit:p}){const t=p;return(a,r)=>(e.openBlock(),e.createElementBlock("button",{type:"button",disabled:n.disabled,onClick:r[0]||(r[0]=c=>t("click",c)),class:e.normalizeClass(["wpic:flex wpic:h-8 wpic:w-full wpic:items-center wpic:gap-2 wpic:rounded-md wpic:px-2 wpic:text-left wpic:font-medium wpic:transition wpic:disabled:cursor-not-allowed wpic:disabled:opacity-40",n.danger?"wpic:text-red-500 wpic:hover:bg-red-50 wpic:dark:hover:bg-red-950/30":"wpic:text-zinc-600 wpic:hover:bg-zinc-100 wpic:hover:text-zinc-900 wpic:dark:text-zinc-100 wpic:dark:hover:bg-zinc-600 wpic:dark:hover:text-white"])},[e.renderSlot(a.$slots,"default")],10,h3))}}),B2={light:{trendPositive:"#15803D",trendNegative:"#DB2777",canvas:"#F8F8F8",surface:"#FFFFFF",input:"#FFFFFF",raised:"#F2F3EF",popover:"#FFFFFF",border:"rgb(32 33 29 / 0.07)",borderHover:"rgb(32 33 29 / 0.16)",text:"#20211D",muted:"#64675C",dim:"#707467",accent:"#85C531",onAccent:"#17210B",primary:"#171717",primaryHover:"#303030",onPrimary:"#FFFFFF",secondary:"#EFEFEF",secondaryHover:"#E3E3E3",onSecondary:"#20211D",secondaryShadow:"none",switchOn:"linear-gradient(35deg, #32dc08 0%, #9de400 48%, #e9e600 100%)",switchOff:"#D4D4D8",switchDisabled:"#E4E4E7",switchThumb:"#FFFFFF",focusRing:"color-mix(in srgb, var(--wpic-accent) 18%, transparent)",positive:"#85C531",negative:"#B94238"},dark:{trendPositive:"#86EFAC",trendNegative:"#FDA4AF",canvas:"#090A05",surface:"#151515",input:"#151515",raised:"#2A2A28",popover:"#1F201D",border:"rgb(255 255 255 / 0.06)",borderHover:"rgb(255 255 255 / 0.14)",text:"#F5F5F5",muted:"#B4B4B4",dim:"#969696",accent:"#85C531",onAccent:"#17210B",primary:"#FFFFFF",primaryHover:"#E8E8E8",onPrimary:"#171717",secondary:"linear-gradient(180deg, #3A3B36, #30312D)",secondaryHover:"linear-gradient(180deg, #40413B, #353630)",onSecondary:"#F5F5F5",secondaryShadow:"inset 0 1px 0 rgb(255 255 255 / 0.15), 0 1px 2px rgb(0 0 0 / 0.12)",switchOn:"linear-gradient(35deg, #32dc08 0%, #9de400 48%, #e9e600 100%)",switchOff:"#343530",switchDisabled:"#252525",switchThumb:"#FFFFFF",focusRing:"color-mix(in srgb, var(--wpic-accent) 18%, transparent)",positive:"#85C531",negative:"#F0A09A"}},f3={light:["#3B73E1","#0891A6","#8B5CD6","#C58A16","#D64D79","#527FA8"],dark:["#7C9FE0","#5FB8C4","#AF94D5","#D8B26A","#D88FA5","#94A8BD"]};function M2(n,p={}){const t={...B2[n],...p},a={};for(const[r,c]of Object.entries(t))a[`--wpic-${r.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`)}`]=c;Object.assign(a,{"--wpic-legacy-bg-main":t.canvas,"--wpic-legacy-bg-card":t.surface,"--wpic-legacy-bg-input":t.input,"--wpic-legacy-border-subtle":t.border,"--wpic-legacy-border-strong":t.border,"--wpic-legacy-border-hover":t.borderHover,"--wpic-legacy-text-main":t.text,"--wpic-legacy-text-muted":t.muted,"--wpic-legacy-text-dim":t.dim,"--wpic-primary":t.accent,"--wpic-primary-hover":t.accent,"--wpic-control-height":"36px","--wpic-table-border":n==="light"?`color-mix(in srgb, ${t.text} 11.5%, ${t.surface})`:t.border,"--wpic-segment-active":n==="dark"?t.secondaryHover:t.surface,"--wpic-segment-shadow":n==="dark"?t.secondaryShadow:`inset 0 0 0 1px ${t.border}, 0 1px 2px rgb(0 0 0 / 0.08)`,"--wpic-button-primary":t.primary,"--wpic-button-primary-hover":t.primaryHover});for(const[r,c]of Object.entries(a))r.startsWith("--wpic-legacy-")&&(a[r.replace("--wpic-legacy-","--")]=c);return a}const V2=Symbol("wpic-theme");function A1(){return e.inject(V2,e.computed(()=>null))}const v3=["data-wpic-theme"],z1=e.defineComponent({__name:"WPopover",props:{open:{type:Boolean},anchor:{},placement:{},width:{},minWidth:{},height:{},minHeight:{},maxHeight:{},panelScroll:{type:Boolean,default:!0},offset:{},matchAnchorWidth:{type:Boolean},freezePositionOnOpen:{type:Boolean,default:!0},flip:{type:Boolean,default:!0},autoPlacement:{type:Boolean},shiftCrossAxis:{type:Boolean},zIndex:{default:9999},extraPanels:{}},emits:["close"],setup(n,{emit:p}){const t=n,a=A1(),r=p,c=Symbol.for("wpic-ui-popover-descendants"),i=e.inject(c,null),w=new Set;e.provide(c,{add(B){w.add(B),i?.add(B)},remove(B){w.delete(B),i?.remove(B)}});const u=e.computed(()=>{const B=t.anchor;return B?e.isRef(B)?B.value:B:null}),f=e.ref(null),l=e.ref(null),M=e.computed(()=>l.value??t.placement??"bottom-start"),z=e.computed(()=>{const B=[n1.offset(t.offset??6)];return l.value||(t.autoPlacement?B.push(n1.autoPlacement({alignment:"start"})):t.flip&&B.push(n1.flip({crossAxis:!t.shiftCrossAxis}))),B.push(n1.shift({padding:t.autoPlacement?8:4,crossAxis:t.autoPlacement||t.shiftCrossAxis})),B.push(n1.size({padding:8,apply({availableHeight:U,rects:K,elements:l1}){const j=Math.max(U-8,50),W={maxHeight:t.maxHeight?`min(${t.maxHeight}, ${j}px)`:`${j}px`,overflowY:t.panelScroll?"auto":"hidden"};if(t.height&&(W.height=`min(${t.height}, ${j}px)`),t.minHeight&&(W.minHeight=`min(${t.minHeight}, ${j}px)`),t.matchAnchorWidth){const c1=`${K.reference.width}px`;W.width=c1,W.minWidth=c1}Object.assign(l1.floating.style,W)}})),B}),{floatingStyles:S,placement:g,update:v,isPositioned:m}=n1.useFloating(u,f,{placement:M,strategy:"fixed",open:e.computed(()=>t.open),whileElementsMounted:n1.autoUpdate,middleware:z}),F=e.computed(()=>{const B=g.value;return B.startsWith("top")?"bottom":B.startsWith("bottom")?"top":B.startsWith("left")?"right":B.startsWith("right")?"left":"top"}),q=B=>{const U=B.target,K=u.value,l1=f.value;l1&&l1.contains(U)||[...w].some(j=>j.contains(U))||K&&K.contains(U)||t.extraPanels?.some(j=>j?.contains(U))||r("close")},t1=B=>{if(B.key!=="Escape"||!t.open||[...w].some(K=>K.isConnected&&K.style.display!=="none"))return;B.preventDefault(),B.stopImmediatePropagation(),r("close");const U=u.value;U?.matches("button, input, [tabindex]")?U.focus():U?.querySelector("button, input, [tabindex]")?.focus()};let G=!1,P=!1;function L(){P||(document.addEventListener("pointerdown",q,!0),document.addEventListener("keydown",t1,!0),P=!0)}function V(){P&&(document.removeEventListener("pointerdown",q,!0),document.removeEventListener("keydown",t1,!0),P=!1)}e.watch(()=>t.open,B=>{B?e.nextTick(()=>{G||!t.open||(t.autoPlacement&&f.value&&(f.value.style.maxHeight=""),v(),L())}):(l.value=null,V())},{immediate:!0}),e.watch(f,(B,U)=>{U&&i?.remove(U),B&&i?.add(B)}),e.watch(m,B=>{B&&t.open&&t.freezePositionOnOpen&&!l.value&&(l.value=g.value)}),e.onBeforeUnmount(()=>{G=!0,V(),f.value&&i?.remove(f.value)});const N=e.computed(()=>({...t.matchAnchorWidth?{}:{width:t.width??"auto"},...t.minWidth?{minWidth:t.minWidth}:{},transformOrigin:F.value,zIndex:t.zIndex}));return(B,U)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body",class:"wpic-popover"},[e.withDirectives(e.createElementVNode("div",{ref_key:"floatingEl",ref:f,"data-wpic-theme":e.unref(a)?.mode,class:e.normalizeClass([{"wpic-theme":e.unref(a),dark:e.unref(a)?.mode==="dark"},"wpic-popover-panel wpic:flex wpic:flex-col wpic:bg-white wpic:dark:bg-zinc-900 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:rounded-xl wpic:shadow-xl wpic:dark:shadow-black/40 wpic:overflow-hidden"]),style:e.normalizeStyle([e.unref(a)?.variables,e.unref(S),N.value])},[e.renderSlot(B.$slots,"default")],14,v3),[[e.vShow,n.open]])]))}}),b3={key:0,class:"wpic:fixed wpic:right-0 wpic:top-0 wpic:z-[9997] wpic:flex wpic:h-full wpic:w-20 wpic:items-center wpic:justify-center wpic:border-l-2 wpic:border-[var(--wpic-primary)] wpic:bg-[var(--wpic-primary)]/10 wpic:text-[var(--wpic-primary)] wpic:pointer-events-none"},g3=["data-variant","data-maximized"],C3=["title"],k3={class:"wpic:min-w-0 wpic:flex-1 wpic:px-2 wpic:text-center"},z3={class:"wpic:truncate wpic:font-medium wpic:text-zinc-700 wpic:dark:text-zinc-200"},y3={key:0,class:"wpic:truncate wpic:text-zinc-500 wpic:dark:text-zinc-400"},x3={class:"wpic:flex wpic:shrink-0 wpic:items-center wpic:gap-1"},B3=["title"],M3=["title"],V3=["title"],E3=["title"],N3={class:"wpic:flex wpic:h-11 wpic:shrink-0 wpic:items-center wpic:justify-between wpic:px-3"},S3={class:"wpic:font-medium wpic:text-zinc-700 wpic:dark:text-zinc-200"},L3=["title"],D3={class:"wpic:space-y-2 wpic:px-3 wpic:pb-3"},F3={class:"wpic:truncate"},$3={class:"wpic:flex-1 wpic:overflow-y-auto wpic:overflow-x-visible wpic:px-2 wpic:pb-3"},T3={class:"wpic:mb-2 wpic:flex wpic:h-7 wpic:items-center wpic:justify-between wpic:px-2 wpic:font-medium wpic:text-zinc-500 wpic:dark:text-zinc-400"},A3={class:"wpic:truncate"},H3=["title"],P3={class:"wpic:space-y-0.5"},j3={key:0,class:"wpic:rounded-lg wpic:border wpic:border-dashed wpic:border-zinc-200 wpic:px-2 wpic:py-2 wpic:text-zinc-500 wpic:dark:border-zinc-700 wpic:dark:text-zinc-400"},W3=["onMouseenter"],R3=["onClick"],I3={class:"wpic:min-w-0 wpic:flex-1 wpic:truncate"},Z3={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},U3={key:0,class:"wpic:px-3 wpic:py-2 wpic:text-zinc-400 wpic:dark:text-zinc-500"},K3=["onPointerdown","onClick"],O3={class:"wpic:min-w-0 wpic:flex-1 wpic:truncate"},q3={class:"wpic:shrink-0 wpic:text-zinc-400"},Y3={class:"wpic:mt-4"},Q3={class:"wpic:flex wpic:h-7 wpic:items-center wpic:px-2 wpic:font-medium wpic:text-zinc-500 wpic:dark:text-zinc-400"},J3={class:"wpic:truncate"},X3={class:"wpic:space-y-0.5"},G3={key:0,class:"wpic:rounded-lg wpic:border wpic:border-dashed wpic:border-zinc-200 wpic:px-2 wpic:py-2 wpic:text-zinc-500 wpic:dark:border-zinc-700 wpic:dark:text-zinc-400"},_3=["onPointerdown","onClick"],e5={class:"wpic:block wpic:truncate"},n5={class:"wpic:shrink-0 wpic:text-zinc-400"},t5=["onClick"],c5=["onPointerenter","onMouseenter"],l5={class:"wpic:truncate"},i5={class:"wpic:flex wpic:min-h-0 wpic:flex-1"},a5={class:"wpic:flex wpic:min-w-0 wpic:flex-1 wpic:flex-col"},o5={key:0,class:"wpic:flex wpic:h-full wpic:flex-col wpic:items-center wpic:justify-center wpic:px-5 wpic:text-center wpic:text-zinc-500 wpic:dark:text-zinc-400"},r5={class:"wpic:font-medium"},s5={key:1,class:"wpic:flex wpic:h-full wpic:flex-col wpic:items-center wpic:justify-center wpic:px-5 wpic:text-center"},p5={class:"wpic:mb-3 wpic:flex wpic:h-11 wpic:w-11 wpic:items-center wpic:justify-center wpic:rounded-xl wpic:bg-zinc-100 wpic:text-zinc-500 wpic:dark:bg-zinc-700 wpic:dark:text-zinc-300"},d5={class:"wpic:font-semibold wpic:text-zinc-800 wpic:dark:text-zinc-100"},w5={key:0,class:"wpic:mt-1 wpic:max-w-xs wpic:text-zinc-500 wpic:dark:text-zinc-400"},u5={key:2,class:"wpic:space-y-4"},m5={class:"wpic:max-w-[82%]"},h5=["src","alt"],f5={class:"wpic:max-w-40 wpic:truncate"},v5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},b5={key:0,class:"wpic:flex wpic:items-center wpic:gap-2 wpic:text-zinc-500 wpic:dark:text-zinc-400"},g5={key:1,class:"wpic-chat-loading-card",role:"status","aria-label":"Generating image"},C5=["innerHTML","onClick"],k5=["href","onClick"],z5=["src"],y5=["title","aria-label","onClick"],x5=["title","aria-label","onClick"],B5=["title","onClick"],M5=["onClick"],V5=["title","onClick"],E5={key:0,class:"wpic:mb-2 wpic:flex wpic:flex-wrap wpic:justify-end wpic:gap-1.5"},N5=["src","alt"],S5={class:"wpic:max-w-40 wpic:truncate"},L5={key:0,class:"wpic:shrink-0 wpic:text-zinc-400"},D5={key:1,class:"wpic:shrink-0 wpic:text-zinc-400"},F5=["title","onClick"],$5={class:"wpic-chat-panel__composer wpic:rounded-xl wpic:border wpic:border-zinc-200 wpic:bg-zinc-50 wpic:transition-colors wpic:focus-within:border-[var(--wpic-primary)]/50 wpic:dark:border-zinc-700 wpic:dark:bg-zinc-700"},T5={key:0,class:"wpic:mx-2 wpic:mt-2 wpic:overflow-hidden wpic:rounded-lg wpic:bg-white wpic:shadow-sm wpic:ring-1 wpic:ring-zinc-200 wpic:dark:bg-zinc-800 wpic:dark:ring-zinc-600"},A5=["onMousedown"],H5={class:"wpic:min-w-0 wpic:truncate wpic:font-medium wpic:text-zinc-900 wpic:dark:text-zinc-100"},P5={key:0,class:"wpic:max-w-32 wpic:shrink-0 wpic:truncate wpic:text-xs wpic:text-zinc-500 wpic:dark:text-zinc-400"},j5=["accept"],W5=["value","placeholder","disabled"],R5={class:"wpic:flex wpic:items-center wpic:justify-between wpic:px-2 wpic:pb-2"},I5=["disabled","title"],Z5=["title"],U5=["disabled","title"],k2=80,K5=e.defineComponent({__name:"WChatPanel",props:{open:{type:Boolean},messages:{},mentionItems:{default:()=>[]},projects:{default:()=>[]},sessions:{default:()=>[]},modelValue:{default:""},title:{default:"Chat"},subtitle:{default:""},selectedProjectId:{default:null},selectedSessionId:{default:null},placeholder:{default:"Ask anything..."},emptyTitle:{default:"How can I help?"},emptyDescription:{default:""},noProjectsLabel:{default:"No projects yet"},noConversationsLabel:{default:"No conversations yet"},allLabel:{default:"All"},recentLabel:{default:"Recent"},projectsLabel:{default:"Projects"},conversationsLabel:{default:"Conversations"},sendLabel:{default:"Send"},newLabel:{default:"New chat"},newProjectLabel:{default:"New project"},newConversationLabel:{default:"New conversation"},renameProjectLabel:{default:"Rename project"},renameConversationLabel:{default:"Rename conversation"},deleteProjectLabel:{default:"Delete project"},deleteConversationLabel:{default:"Delete conversation"},clearLabel:{default:"Clear"},copyLabel:{default:"Copy"},copiedLabel:{default:"Copied"},newChatFromMessageLabel:{default:"Start new chat from this message"},attachFilesLabel:{default:"Attach files"},removeAttachmentLabel:{default:"Remove attachment"},stopLabel:{default:"Stop"},applyPromptLabel:{default:"Apply prompt"},applyAllLabel:{default:"Apply all"},applySettingLabel:{default:"Apply setting"},thinkingLabel:{default:"Thinking..."},dockLabel:{default:"Dock"},undockLabel:{default:"Undock"},closeLabel:{default:"Close"},helpfulLabel:{default:"Helpful"},notHelpfulLabel:{default:"Not helpful"},attachments:{default:()=>[]},accept:{default:""},customAttachmentPicker:{type:Boolean,default:!1},showNavigator:{type:Boolean,default:!0},hideNewConversation:{type:Boolean,default:!1},hideClear:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},cancellable:{type:Boolean,default:!1},docked:{type:Boolean,default:!1},maximized:{type:Boolean,default:!1},maximizedMargin:{default:20},width:{default:420},height:{default:560},x:{default:-1},y:{default:-1},topOffset:{default:0},minWidth:{default:340},minHeight:{default:400},zIndex:{default:80},variant:{default:"default"}},emits:["close","send","clear","new","new-project","new-conversation","select-project","select-session","rename-project","rename-session","delete-project","delete-session","move-session","edit-message","new-chat-from-message","message-feedback","apply-message-proposal","navigate","cancel","attach","files-selected","remove-attachment","update:modelValue","update:docked","update:maximized","update:width","update:height","update:x","update:y"],setup(n,{emit:p}){const t=n,a=p,r=e.useSlots(),c=e.ref(null),i=e.ref(null),w=e.ref(null),u=e.ref(null),f=e.ref(null),l=e.ref(null),M=e.ref(0),z=e.ref(0),S=e.ref(!1),g=e.ref(null),v=e.ref(null);let m=null;const F=e.ref(!1),q=e.ref(!1),t1=e.ref(!1);e.ref(new Set);const G=e.ref(null),P=e.ref(null),L=e.ref({}),V=e.ref(null);let N=null,B=null;function U(){B?.disconnect(),B=null;const o=i.value,s=f.value;if(!o||!s||typeof ResizeObserver>"u")return;const d=()=>s.style.setProperty("--wpic-chat-footer-height",`${o.getBoundingClientRect().height}px`);d(),B=new ResizeObserver(d),B.observe(o)}const K=e.computed(()=>V.value?[]:t.messages.filter(o=>o.role!=="system")),l1=e.computed(()=>t.loading||V.value!==null),j=e.computed(()=>t.modelValue.trim().length>0&&!t.loading),Q=e.computed(()=>t.attachments.length>0),W=e.computed(()=>{const o=t.modelValue.slice(0,z.value),s=o.match(/(?:^|\s)@([^\s@]*)$/);return s?{start:o.length-s[0].length+(s[0].startsWith(" ")?1:0),query:s[1].toLowerCase()}:null}),c1=e.computed(()=>{const o=W.value;if(!o)return[];const s=o.query;return t.mentionItems.filter(d=>d.label.toLowerCase().includes(s)).slice(0,6)}),s1=e.computed(()=>t.showNavigator&&S.value),E=e.computed(()=>t.selectedProjectId??null),J=e.computed(()=>t.sessions.filter(o=>!o.projectId)),k=e.computed(()=>{const o=new Map;for(const s of t.projects)o.set(s.id,[]);for(const s of t.sessions){if(!s.projectId)continue;const d=o.get(s.projectId);d&&d.push(s)}return o});function $(o){const s=o.toLowerCase();if(s.includes("doubao-seedance-1-5-pro-251215")||s.includes("doubao seedance 1.5")||s.includes("seedance 1.5")||s.includes("seedance video"))return"jimeng:doubao-seedance-1-5-pro-251215";if(s.includes("imagen 4")||s.includes("imagen-4"))return"google:imagen-4.0-generate-001";if(s.includes("gpt-image-1")||s.includes("gpt image 1"))return"openai:gpt-image-1";if(s.includes("gpt-image-2")||s.includes("gpt image 2"))return"openai:gpt-image-2";if(s.includes("doubao-seedream-4-5-251128"))return"jimeng:doubao-seedream-4-5-251128";if(s.includes("doubao-seedream-4-0-250828"))return"jimeng:doubao-seedream-4-0-250828";if(s.includes("doubao seedream 5")||s.includes("seedream 5")||s.includes("doubao seedream 4.5")||s.includes("seedream 4.5"))return"jimeng:doubao-seedream-4-5-251128";if(s.includes("doubao seedream 4")||s.includes("seedream 4"))return"jimeng:doubao-seedream-4-0-250828";if(s.includes("auto"))return"auto";const d=o.match(/\b([a-z][a-z0-9_-]+):([a-z0-9._-]+)\b/i);if(d)return`${d[1].toLowerCase()}:${d[2]}`}function Z(o){if(o!=="auto"){if(o.includes("seedance"))return"video";if(o.includes("gpt-image")||o.includes("imagen")||o.includes("seedream")||o.includes("jimeng:"))return"image"}}function e1(o){const s=[],d=new Set,C=/\b(gpt[-\s]?image[-\s]?[12]|imagen\s*4|doubao\s+seedance\s+1\.5(?:\s+pro)?|seedance\s+1\.5(?:\s+pro)?|doubao\s+seedream\s+(?:5(?:\.0)?|4\.5|4)|seedream\s+(?:5(?:\.0)?|4\.5|4)|[a-z][a-z0-9_-]+:[a-z0-9._-]+|auto)\b/gi;for(const h of o.matchAll(C)){const y=h[1],I=$(y);!I||d.has(I)||(d.add(I),s.push({label:y,value:I}))}return s}function r1(o,s){return o.match(new RegExp(`${s}=["']([^"']+)["']`,"i"))?.[1]}function u1(o){const s={};for(const C of o.matchAll(/\[SETTING\s+([^\]]+)\]([\s\S]*?)\[\/SETTING\]/gi)){const h=C[1]??"",y=r1(h,"key"),I=r1(h,"value")??C[2]?.trim();if(!(!y||!I))if(y==="duration"||y==="fps"||y==="count"){const O=Number(I);Number.isFinite(O)&&(s[y]=O)}else if(y==="model"){const O=$(I)??$(C[2]?.trim()??"");O&&(s.model=O)}else(y==="aspect"||y==="resolution"||y==="format")&&(s[y]=I)}const d=o.split(/\r?\n/).map(C=>C.replace(/^[\s>*-]+/,"").trim()).filter(Boolean);for(const C of d){const h=C.toLowerCase();if(/(supporte|supports?|disponible|available|dur[eé]es?\s*:|ratios?\s*:|jusqu['’]?à|up to)/i.test(h))continue;const y=C.split(":").slice(1).join(":").trim()||C,I=y.match(/\b(\d{1,2}:\d{1,2})\b/);(h.includes("format")||h.includes("aspect")||h.includes("ratio"))&&I&&(s.aspect=I[1]);const O=y.match(/\b([1248]K)\b/i);(h.includes("résolution")||h.includes("resolution"))&&O&&(s.resolution=O[1].toUpperCase());const _=y.match(/\b(\d{1,3})\s*(?:s|sec|secondes?|seconds?)\b/i);(h.includes("durée")||h.includes("duration"))&&_&&(s.duration=Number(_[1]));const a1=y.match(/\b(\d{1,3})\s*fps\b/i);h.includes("fps")&&a1&&(s.fps=Number(a1[1]));const o1=y.match(/\b(\d{1,2})\b/);if((h.includes("count")||h.includes("nombre")||h.includes("variantes"))&&o1&&(s.count=Number(o1[1])),h.includes("modèle")||h.includes("modele")||h.includes("model")){const h1=$(y);h1&&(s.model=h1)}h.includes("jpg")||h.includes("jpeg")?s.format="jpg":h.includes("png")?s.format="png":h.includes("webp")&&(s.format="webp")}return Object.keys(s).length?s:void 0}function x(o){const s=o.match(/\[TASK(?:\s+([^\]]+))?\](?:([\s\S]*?)\[\/TASK\])?/i);if(s){const C=(r1(s[1]??"","value")??s[2]?.trim())?.toLowerCase();if(["image","video","audio","text"].includes(String(C)))return C}const d=o.split(/\r?\n/).map(C=>C.replace(/^[\s>*-]+/,"").trim()).filter(Boolean);for(const C of d){const h=C.toLowerCase(),y=C.split(":").slice(1).join(":").trim().toLowerCase()||h;if(/(task|type|mode|surface|format|réglage|reglage|setting)/i.test(h)){if(/\baudio\b|subtitles?|sous-titres?|transcri|tts|voice|voix/.test(y))return"audio";if(/\bvid[eé]o\b|\bvideo\b|\bfps\b|duration|dur[eé]e/.test(y))return"video";if(/\bimage\b|photo|visuel|illustration|aspect|ratio|resolution|résolution/.test(y))return"image";if(/\btext\b|texte|copy|caption|script/.test(y))return"text"}}}function A(o){const s=o.match(/\[PROMPT\]([\s\S]*?)\[\/PROMPT\]/i)?.[1];if(s){const _=M1(s).trim().replace(/^["“]|["”]$/g,"");if(_)return _}const d=o.replace(/\r\n/g,`
3
3
  `).split(`
4
4
  `),C=[];let h=!1,y=!1,I=!1;for(const _ of d){const a1=_.trim().replace(/^[\s>*-]+/,"").replace(/^#{1,6}\s+/,"").replace(/^\*\*|\*\*$/g,"").trim();if(y){if(/^```/.test(a1))break;C.push(_);continue}if(!h){const o1=a1.match(/^(?:(?:voici|essayez|utilisez|use|try)\s+(?:ce\s+)?(?:prompt)|prompt\s+(?:modifi[eé]|am[eé]lior[eé]|propos[eé]|recommand[eé])|prompt)\s*:\s*(.*)$/i);if(!o1){I||=/\bprompt\b/i.test(a1),I&&/^```/.test(a1)&&(h=!0,y=!0);continue}h=!0,o1[1]?.trim()&&C.push(o1[1].trim());continue}if(/^(?:r[eé]glages?(?:\s+recommand[eé]s?)?|settings?|mod[eè]le|model)\s*:/i.test(a1))break;C.push(_)}return M1(C.join(`
package/dist/wpic-ui.css CHANGED
@@ -475,6 +475,11 @@ input[type="range"].wpic-legacy-slider-themed::-webkit-slider-thumb {
475
475
  background: inherit;
476
476
  }
477
477
 
478
+ /* Optional vertical rules between cells, matching the row separators. */
479
+ .wpic-table--column-dividers :is(th, td) + :is(th, td) { border-left: 1px solid #f4f4f5; }
480
+ .dark .wpic-table--column-dividers :is(th, td) + :is(th, td) { border-left-color: #27272a; }
481
+ .wpic-theme .wpic-table--column-dividers :is(th, td) + :is(th, td) { border-left-color: var(--wpic-table-border, var(--wpic-border)); }
482
+
478
483
  /* Match row separators to the enclosing themed card in both modes. */
479
484
  .wpic-theme .wpic-table__divider,
480
485
  .wpic-theme .wpic-card--bordered:has(> .wpic-card__body > .wpic-table) {
package/dist/wpic-ui.js CHANGED
@@ -354,7 +354,8 @@ const D3 = {
354
354
  summaryRow: {},
355
355
  compact: { type: Boolean },
356
356
  padding: {},
357
- showFooter: { type: Boolean, default: !0 }
357
+ showFooter: { type: Boolean, default: !0 },
358
+ columnDividers: { type: Boolean, default: !1 }
358
359
  },
359
360
  emits: ["row-click", "update:selectedKeys", "row-select", "update:serverPage"],
360
361
  setup(n, { expose: w, emit: c }) {
@@ -429,7 +430,7 @@ const D3 = {
429
430
  ...j.minWidth ? { minWidth: j.minWidth } : {}
430
431
  });
431
432
  return w({ filteredCount: y(() => M.value.length), searchQuery: $ }), (j, p1) => (e(), t("div", {
432
- class: g(["wpic-table", r1.value])
433
+ class: g(["wpic-table", [r1.value, { "wpic-table--column-dividers": n.columnDividers }]])
433
434
  }, [
434
435
  (W.value || m(f).toolbar) && !n.loading ? (e(), t("div", {
435
436
  key: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpic/ui",
3
- "version": "0.9.14",
3
+ "version": "0.9.15",
4
4
  "type": "module",
5
5
  "description": "WPIC shared Vue 3 component library",
6
6
  "publishConfig": {
package/src/style.css CHANGED
@@ -474,6 +474,11 @@ input[type="range"].wpic-legacy-slider-themed::-webkit-slider-thumb {
474
474
  background: inherit;
475
475
  }
476
476
 
477
+ /* Optional vertical rules between cells, matching the row separators. */
478
+ .wpic-table--column-dividers :is(th, td) + :is(th, td) { border-left: 1px solid #f4f4f5; }
479
+ .dark .wpic-table--column-dividers :is(th, td) + :is(th, td) { border-left-color: #27272a; }
480
+ .wpic-theme .wpic-table--column-dividers :is(th, td) + :is(th, td) { border-left-color: var(--wpic-table-border, var(--wpic-border)); }
481
+
477
482
  /* Match row separators to the enclosing themed card in both modes. */
478
483
  .wpic-theme .wpic-table__divider,
479
484
  .wpic-theme .wpic-card--bordered:has(> .wpic-card__body > .wpic-table) {