@wpic/ui 0.9.19 → 0.9.21

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.
@@ -35,6 +35,8 @@ type __VLS_Props = {
35
35
  flushEdges?: boolean;
36
36
  rowClass?: (row: Record<string, unknown>) => string | Record<string, boolean> | undefined;
37
37
  rowStyle?: (row: Record<string, unknown>) => Record<string, string> | undefined;
38
+ /** Style the complete body cell, including its padding. */
39
+ cellStyle?: (row: Record<string, unknown>, column: WTableColumn) => Record<string, string> | undefined;
38
40
  summaryRow?: Record<string, unknown>;
39
41
  compact?: boolean;
40
42
  /** Horizontal padding scale. Omitted: inherits the enclosing WCard's
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"},$1=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]=l=>a("click",l)),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"}},l2=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),l=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(),i=e.ref(),M=e.ref(0);let z;e.watch(i,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(l2,{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,[l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.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:i,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",l.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&&!l.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},$0={class:"wpic-table__header wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},F0=["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 l(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),i=e.ref("asc");function M(E){f.value===E?i.value=i.value==="asc"?"desc":"asc":(f.value=E,i.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(F=>F.searchable).map(F=>F.field);E=E.filter(F=>k.some(Z=>String(F[Z]??"").toLowerCase().includes(J)))}if(f.value){const k=f.value;E=[...E].sort((F,Z)=>{const e1=F[k]??"",r1=Z[k]??"",u1=typeof e1=="number"&&typeof r1=="number"?e1-r1:String(e1).toLowerCase().localeCompare(String(r1).toLowerCase());return i.value==="asc"?u1:-u1})}return E}),v=e.ref(1),m=e.computed(()=>a.serverTotal!==void 0),$=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||($.value=1),c.value.clear()});const G=e.computed(()=>{if(m.value)return g.value;const E=($.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:`${$.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 F=P(E,J),Z=new Set(a.selectedKeys??[]),e1=k===!0;e1?Z.add(F):Z.delete(F),r("update:selectedKeys",[...Z]),r("row-select",E,e1)}function U(E){const J=new Set(a.selectedKeys??[]),k=E===!0;for(const F of V.value)k?J.add(F):J.delete(F);r("update:selectedKeys",[...J])}const K=e.computed(()=>q.value===0?0:($.value-1)*u.value+1),i1=e.computed(()=>Math.min($.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=$.value,k=[],F=new Set([1,E,J-1,J,J+1].filter(e1=>e1>=1&&e1<=E));let Z=0;for(const e1 of[...F].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",$0,[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,F)=>(e.openBlock(),e.createElementBlock("th",{key:k.field,class:e.normalizeClass([c1(F,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),F===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:i.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&&i.value==="asc"?(e.openBlock(),e.createBlock(e.unref(b.ChevronUp),{key:0,size:11,style:{color:"#5E6AD2"}})):f.value===k.field&&i.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,F0)):(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,F)=>(e.openBlock(),e.createElementBlock("td",{key:k.field,class:e.normalizeClass([c1(F,n.compact?"wpic:py-1":"wpic:py-2.5"),W(k.align),F===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,F)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:F},[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(F)?"wpic:border-b-0":"",n.rowClass?.(k)]]),style:e.normalizeStyle({cursor:n.rowClickable||n.expandable?"pointer":"default",...n.rowStyle?.(k)??{}}),onClick:Z=>n.expandable?l(F):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,F)),"onUpdate:modelValue":Z=>B(k,F,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(F)?(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(F)?(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(i1.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=>$.value--),disabled:$.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",$.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($.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=>$.value++),disabled:$.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"},i3={key:0},l3={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),l=e.computed(()=>a.showAxes&&a.showRowNumbers),w=e.computed(()=>a.columns.some(x=>x.sticky)),u=e.ref(null),f=e.ref("asc"),i=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"},$1=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]=l=>a("click",l)),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"}},l2=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),l=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(),i=e.ref(),M=e.ref(0);let z;e.watch(i,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(l2,{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,[l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.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:i,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",l.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&&!l.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},$0={class:"wpic-table__header wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800"},F0=["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:{},cellStyle:{},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 l(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),i=e.ref("asc");function M(E){f.value===E?i.value=i.value==="asc"?"desc":"asc":(f.value=E,i.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(F=>F.searchable).map(F=>F.field);E=E.filter(F=>k.some(Z=>String(F[Z]??"").toLowerCase().includes(J)))}if(f.value){const k=f.value;E=[...E].sort((F,Z)=>{const e1=F[k]??"",r1=Z[k]??"",u1=typeof e1=="number"&&typeof r1=="number"?e1-r1:String(e1).toLowerCase().localeCompare(String(r1).toLowerCase());return i.value==="asc"?u1:-u1})}return E}),v=e.ref(1),m=e.computed(()=>a.serverTotal!==void 0),$=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||($.value=1),c.value.clear()});const G=e.computed(()=>{if(m.value)return g.value;const E=($.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:`${$.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 F=P(E,J),Z=new Set(a.selectedKeys??[]),e1=k===!0;e1?Z.add(F):Z.delete(F),r("update:selectedKeys",[...Z]),r("row-select",E,e1)}function U(E){const J=new Set(a.selectedKeys??[]),k=E===!0;for(const F of V.value)k?J.add(F):J.delete(F);r("update:selectedKeys",[...J])}const K=e.computed(()=>q.value===0?0:($.value-1)*u.value+1),i1=e.computed(()=>Math.min($.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=$.value,k=[],F=new Set([1,E,J-1,J,J+1].filter(e1=>e1>=1&&e1<=E));let Z=0;for(const e1 of[...F].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",$0,[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,F)=>(e.openBlock(),e.createElementBlock("th",{key:k.field,class:e.normalizeClass([c1(F,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),F===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:i.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&&i.value==="asc"?(e.openBlock(),e.createBlock(e.unref(b.ChevronUp),{key:0,size:11,style:{color:"#5E6AD2"}})):f.value===k.field&&i.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,F0)):(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,F)=>(e.openBlock(),e.createElementBlock("td",{key:k.field,class:e.normalizeClass([c1(F,n.compact?"wpic:py-1":"wpic:py-2.5"),W(k.align),F===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,F)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:F},[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(F)?"wpic:border-b-0":"",n.rowClass?.(k)]]),style:e.normalizeStyle({cursor:n.rowClickable||n.expandable?"pointer":"default",...n.rowStyle?.(k)??{}}),onClick:Z=>n.expandable?l(F):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,F)),"onUpdate:modelValue":Z=>B(k,F,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(F)?(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"]),style:e.normalizeStyle(n.cellStyle?.(k,Z)),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)])],14,W0))),128))],14,j0),n.expandable&&c.value.has(F)?(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(i1.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=>$.value--),disabled:$.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",$.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($.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=>$.value++),disabled:$.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"},i3={key:0},l3={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),l=e.computed(()=>a.showAxes&&a.showRowNumbers),w=e.computed(()=>a.columns.some(x=>x.sticky)),u=e.ref(null),f=e.ref("asc"),i=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 $(x,A=!0){if(i.value===x)return;const T=performance.now();console.debug(`[WSpreadsheet] ${x?"expand":"minimize"} requested`),i.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&&$(x,!1)}),e.watch(()=>a.downloadRequest,(x,A)=>{x!=null&&x!==A&&m()}),p({expand:()=>{a.expandable&&$(!0)},collapse:()=>{$(!1)},toggleExpanded:()=>{a.expandable&&$(!i.value)},download:m});function q(x){x.key==="Escape"&&i.value&&$(!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",F)});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 i1(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",F,{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 F(){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],l1=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&&l1?{cells:H,source:j(R,l1)}: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":i.value}])},[i.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=>$(!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||i.value)||n.downloadable&&(n.showDownloadButton!==!1||i.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-spreadsheet-frame__toolbar",{"w-spreadsheet-frame__toolbar--hover":n.actionsOnHover&&!i.value}])},[i.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||i.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||i.value)?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"w-spreadsheet-frame__expand",title:i.value?"Restore spreadsheet":"Expand spreadsheet","aria-label":i.value?"Restore spreadsheet":"Expand spreadsheet",onClick:A[1]||(A[1]=T=>$(!i.value))},[i.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:i.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,[l.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",i3,[e.createElementVNode("tr",null,[l.value?(e.openBlock(),e.createElementBlock("th",l3)):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})},[l.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(i1(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 i2=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,l=>`-${l.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"),l=e.inject(c,null),w=new Set;e.provide(c,{add(B){w.add(B),l?.add(B)},remove(B){w.delete(B),l?.remove(B)}});const u=e.computed(()=>{const B=t.anchor;return B?e.isRef(B)?B.value:B:null}),f=e.ref(null),i=e.ref(null),M=e.computed(()=>i.value??t.placement??"bottom-start"),z=e.computed(()=>{const B=[n1.offset(t.offset??6)];return i.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:i1}){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(i1.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}),$=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,i1=f.value;i1&&i1.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())}):(i.value=null,V())},{immediate:!0}),e.watch(f,(B,U)=>{U&&l?.remove(U),B&&l?.add(B)}),e.watch(m,B=>{B&&t.open&&t.freezePositionOnOpen&&!i.value&&(i.value=g.value)}),e.onBeforeUnmount(()=>{G=!0,V(),f.value&&l?.remove(f.value)});const N=e.computed(()=>({...t.matchAnchorWidth?{}:{width:t.width??"auto"},...t.minWidth?{minWidth:t.minWidth}:{},transformOrigin:$.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"},$3={class:"wpic:truncate"},F3={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"],i5={class:"wpic:truncate"},l5={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"},$5=["title","onClick"],F5={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),l=e.ref(null),w=e.ref(null),u=e.ref(null),f=e.ref(null),i=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 $=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=l.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")),i1=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 F(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=F(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=F(I)??F(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=F(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
@@ -467,8 +467,10 @@ input[type="range"].wpic-legacy-slider-themed::-webkit-slider-thumb {
467
467
  /* Opaque row surfaces prevent scrolled content showing through fixed cells.
468
468
  Keep header, summary and hover surfaces in sync with the fixed column. */
469
469
  .wpic-table__scroll { isolation: isolate; }
470
- .wpic-table__header,
471
470
  .wpic-table__row { background: var(--wpic-surface, var(--wpic-legacy-bg-card)); }
471
+ /* Match the WSpreadsheet header surface. */
472
+ .wpic-table__header { background: var(--wpic-table-header, #f4f4f5); }
473
+ .dark .wpic-table__header { background: var(--wpic-table-header, #303033); }
472
474
  .wpic-table__summary,
473
475
  .wpic-table__row:hover { background: var(--wpic-raised, var(--wpic-legacy-bg-input)); }
474
476
  .wpic-table__sticky {
package/dist/wpic-ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as X, openBlock as e, createBlock as O, resolveDynamicComponent as B1, normalizeClass as g, withCtx as s1, createElementVNode as i, createCommentVNode as h, renderSlot as U, createElementBlock as t, createVNode as L, unref as m, Fragment as I, renderList as c1, toDisplayString as v, useModel as G1, useSlots as q2, computed as y, ref as H, watch as M1, onBeforeUnmount as s2, mergeProps as U1, createTextVNode as w1, withDirectives as T1, normalizeStyle as m1, vModelDynamic as b0, mergeModels as _1, vModelCheckbox as J0, withModifiers as f1, onMounted as H2, withKeys as M2, inject as Q2, provide as g2, isRef as X0, nextTick as H1, Teleport as Y1, vShow as G0, Transition as w2, getCurrentInstance as g0, vModelText as l2, useAttrs as _0, TransitionGroup as n3, useCssVars as e3, vModelSelect as c3, onUnmounted as t3, createStaticVNode as A1 } from "vue";
1
+ import { defineComponent as X, openBlock as e, createBlock as O, resolveDynamicComponent as B1, normalizeClass as g, withCtx as s1, createElementVNode as i, createCommentVNode as h, renderSlot as U, createElementBlock as t, createVNode as L, unref as m, Fragment as I, renderList as c1, toDisplayString as v, useModel as G1, useSlots as q2, computed as y, ref as H, watch as M1, onBeforeUnmount as s2, mergeProps as U1, createTextVNode as w1, withDirectives as T1, normalizeStyle as u1, vModelDynamic as b0, mergeModels as _1, vModelCheckbox as J0, withModifiers as f1, onMounted as H2, withKeys as M2, inject as Q2, provide as g2, isRef as X0, nextTick as H1, Teleport as Y1, vShow as G0, Transition as w2, getCurrentInstance as g0, vModelText as l2, useAttrs as _0, TransitionGroup as n3, useCssVars as e3, vModelSelect as c3, onUnmounted as t3, createStaticVNode as A1 } from "vue";
2
2
  import { Loader2 as a2, Calendar as z0, DollarSign as i3, X as $1, Check as q1, Search as P2, ChevronUp as C0, ChevronDown as D1, ChevronsUpDown as J2, ChevronRight as j1, ChevronLeft as z2, Download as l3, Minimize as a3, Expand as o3, CalendarDays as T2, FolderSymlink as s3, Minimize2 as r3, Maximize2 as p3, Plus as y2, Trash2 as d3, Folder as w0, MoreHorizontal as w3, Bot as u3, Paperclip as K2, ThumbsUp as h3, ThumbsDown as m3, Copy as v3, Pencil as f3, MessageSquarePlus as b3, Square as g3, ArrowUp as z3, CircleAlert as C3, CircleCheck as k3, ShieldAlert as x3, Lightbulb as y3, PanelLeftOpen as M3, PanelLeftClose as V3, AlertTriangle as L3, Tag as F2, Clock as B3, RefreshCw as $3 } from "lucide-vue-next";
3
3
  import { offset as u2, autoPlacement as A3, flip as h2, shift as m2, size as X2, useFloating as v2, autoUpdate as f2, arrow as S3 } from "@floating-ui/vue";
4
4
  import { defineStore as F3 } from "pinia";
@@ -206,7 +206,7 @@ const D3 = {
206
206
  l.value && (c.clearable && w.value || c.loading) ? "wpic:pr-14" : l.value ? "wpic:pr-9" : c.clearable && w.value || c.loading ? c.size === "xl" ? "wpic:pr-10" : "wpic:pr-7" : c.size === "xl" ? "wpic:pr-4" : "wpic:pr-2.5",
207
207
  c.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" : c.disabled ? (c.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" : (c.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"
208
208
  ]]),
209
- style: m1(p.value && !o.value ? { paddingLeft: `calc(${P.value}px + 1.25rem)` } : void 0),
209
+ style: u1(p.value && !o.value ? { paddingLeft: `calc(${P.value}px + 1.25rem)` } : void 0),
210
210
  "data-size": c.size ?? "md",
211
211
  "data-variant": c.variant ?? "default",
212
212
  "onUpdate:modelValue": x[0] || (x[0] = (z) => w.value = z),
@@ -351,6 +351,7 @@ const D3 = {
351
351
  flushEdges: { type: Boolean, default: !1 },
352
352
  rowClass: {},
353
353
  rowStyle: {},
354
+ cellStyle: {},
354
355
  summaryRow: {},
355
356
  compact: { type: Boolean },
356
357
  padding: {},
@@ -391,7 +392,7 @@ const D3 = {
391
392
  M1([$, () => s.data], () => {
392
393
  z.value || (Z.value = 1), l.value.clear();
393
394
  });
394
- const u1 = y(() => {
395
+ const h1 = y(() => {
395
396
  if (z.value) return M.value;
396
397
  const j = (Z.value - 1) * b.value;
397
398
  return M.value.slice(j, j + b.value);
@@ -400,7 +401,7 @@ const D3 = {
400
401
  const B = j[s.rowKey];
401
402
  return typeof B == "string" || typeof B == "number" ? B : `${Z.value}:${p1}`;
402
403
  }
403
- const D = y(() => new Set(s.selectedKeys ?? [])), T = y(() => u1.value.map(Q)), E = y(
404
+ const D = y(() => new Set(s.selectedKeys ?? [])), T = y(() => h1.value.map(Q)), E = y(
404
405
  () => s.selectable && T.value.length > 0 && T.value.every((j) => D.value.has(j))
405
406
  );
406
407
  function F(j, p1, B) {
@@ -462,7 +463,7 @@ const D3 = {
462
463
  n.expandable ? (e(), t("col", e5)) : h("", !0),
463
464
  (e(!0), t(I, null, c1(n.columns, (B) => (e(), t("col", {
464
465
  key: B.field,
465
- style: m1(V1(B))
466
+ style: u1(V1(B))
466
467
  }, null, 4))), 128))
467
468
  ]),
468
469
  s.showHeader !== !1 ? (e(), t("thead", c5, [
@@ -485,7 +486,7 @@ const D3 = {
485
486
  (e(!0), t(I, null, c1(n.columns, (B, N) => (e(), t("th", {
486
487
  key: B.field,
487
488
  class: g([g1(N, n.compact ? "wpic:py-1.5" : "wpic:py-3"), "wpic:whitespace-nowrap wpic:text-zinc-500 wpic:dark:text-zinc-300 wpic:font-medium", G(B.align), N === 0 && !n.expandable && !n.selectable ? "wpic-table__sticky wpic:sticky wpic:left-0 wpic:z-10" : ""]),
488
- style: m1({ ...V1(B) })
489
+ style: u1({ ...V1(B) })
489
490
  }, [
490
491
  U(j.$slots, "th-" + B.field, {
491
492
  col: B,
@@ -539,10 +540,10 @@ const D3 = {
539
540
  ])
540
541
  ], 2))), 128))
541
542
  ])) : h("", !0),
542
- u1.value.length ? (e(!0), t(I, { key: 1 }, c1(u1.value, (B, N) => (e(), t(I, { key: N }, [
543
+ h1.value.length ? (e(!0), t(I, { key: 1 }, c1(h1.value, (B, N) => (e(), t(I, { key: N }, [
543
544
  i("tr", {
544
545
  class: g(["wpic-table__row wpic:group wpic-table__divider wpic:border-b wpic:border-zinc-100 wpic:dark:border-zinc-800", [n.expandable && l.value.has(N) ? "wpic:border-b-0" : "", n.rowClass?.(B)]]),
545
- style: m1({ cursor: n.rowClickable || n.expandable ? "pointer" : "default", ...n.rowStyle?.(B) ?? {} }),
546
+ style: u1({ cursor: n.rowClickable || n.expandable ? "pointer" : "default", ...n.rowStyle?.(B) ?? {} }),
546
547
  onClick: (e1) => n.expandable ? o(N) : n.rowClickable && p("row-click", B)
547
548
  }, [
548
549
  n.selectable ? (e(), t("td", {
@@ -577,6 +578,7 @@ const D3 = {
577
578
  G(e1.align),
578
579
  v1 === 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"
579
580
  ]),
581
+ style: u1(n.cellStyle?.(B, e1)),
580
582
  onClick: (y1) => n.expandable ? (n.rowClickable && p("row-click", B), y1.stopPropagation()) : void 0
581
583
  }, [
582
584
  U(j.$slots, e1.field, {
@@ -585,7 +587,7 @@ const D3 = {
585
587
  }, () => [
586
588
  w1(v(B[e1.field] ?? "—"), 1)
587
589
  ])
588
- ], 10, p5))), 128))
590
+ ], 14, p5))), 128))
589
591
  ], 14, r5),
590
592
  n.expandable && l.value.has(N) ? (e(), t("tr", d5, [
591
593
  i("td", {
@@ -637,7 +639,7 @@ const D3 = {
637
639
  "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",
638
640
  Z.value === B ? "" : "wpic:text-zinc-700 wpic:dark:text-zinc-200 wpic:hover:bg-zinc-100 wpic:dark:hover:bg-zinc-700"
639
641
  ]),
640
- style: m1(Z.value === B ? "background:rgba(94,106,210,0.1);color:#5E6AD2" : void 0)
642
+ style: u1(Z.value === B ? "background:rgba(94,106,210,0.1);color:#5E6AD2" : void 0)
641
643
  }, v(B), 15, z5))
642
644
  ], 64))), 128)),
643
645
  i("button", {
@@ -702,7 +704,7 @@ const D3 = {
702
704
  const s = n, p = c, l = y(() => s.showAxes && s.showColumnLetters), o = y(() => s.showAxes && s.showRowNumbers), f = y(() => s.columns.some((S) => S.sticky)), b = H(null), k = H("asc"), a = H(s.expanded ?? !1), P = H(null), $ = H(null), W = H(null), M = H(null), x = H(null);
703
705
  function z() {
704
706
  if (!s.downloadable) return;
705
- const S = (R) => `"${String(R ?? "").replace(/"/g, '""')}"`, Y = D.value.map((R) => s.columns.map((q) => S(u1(R, q.key))).join(",")).join(`\r
707
+ const S = (R) => `"${String(R ?? "").replace(/"/g, '""')}"`, Y = D.value.map((R) => s.columns.map((q) => S(h1(R, q.key))).join(",")).join(`\r
706
708
  `), K = new Blob([`\uFEFF${Y}`], { type: "text/csv;charset=utf-8" }), d1 = URL.createObjectURL(K), o1 = document.createElement("a");
707
709
  o1.href = d1, o1.download = s.downloadFilename || "spreadsheet.csv", o1.click(), URL.revokeObjectURL(d1);
708
710
  }
@@ -743,7 +745,7 @@ const D3 = {
743
745
  }), s2(() => {
744
746
  document.removeEventListener("keydown", a1), document.removeEventListener("pointerdown", b1), window.removeEventListener("pointerup", N);
745
747
  });
746
- function u1(S, Y) {
748
+ function h1(S, Y) {
747
749
  return S.cells.find((K) => K.key === Y)?.value ?? "";
748
750
  }
749
751
  function Q(S) {
@@ -755,7 +757,7 @@ const D3 = {
755
757
  if (!b.value) return s.rows;
756
758
  const S = s.rows.filter((d1) => d1.sortable !== !1), Y = k.value === "asc" ? 1 : -1;
757
759
  S.sort((d1, o1) => {
758
- const R = Q(u1(d1, b.value)), q = Q(u1(o1, b.value));
760
+ const R = Q(h1(d1, b.value)), q = Q(h1(o1, b.value));
759
761
  return typeof R == "number" && typeof q == "number" ? (R - q) * Y : String(R).localeCompare(String(q), void 0, { numeric: !0 }) * Y;
760
762
  });
761
763
  let K = 0;
@@ -918,17 +920,17 @@ const D3 = {
918
920
  ])) : (e(), t("div", {
919
921
  key: 2,
920
922
  class: g(["w-spreadsheet", { "w-spreadsheet--with-column-axis": l.value }]),
921
- style: m1({ maxHeight: a.value ? "calc(100vh - 96px)" : n.maxHeight })
923
+ style: u1({ maxHeight: a.value ? "calc(100vh - 96px)" : n.maxHeight })
922
924
  }, [
923
925
  i("table", {
924
926
  class: g(["w-spreadsheet__table", { "w-spreadsheet__table--sticky-columns": f.value }]),
925
- style: m1({ minWidth: n.minWidth })
927
+ style: u1({ minWidth: n.minWidth })
926
928
  }, [
927
929
  i("colgroup", null, [
928
930
  o.value ? (e(), t("col", V5)) : h("", !0),
929
931
  (e(!0), t(I, null, c1(n.columns, (K) => (e(), t("col", {
930
932
  key: K.key,
931
- style: m1({ width: K.width })
933
+ style: u1({ width: K.width })
932
934
  }, null, 4))), 128))
933
935
  ]),
934
936
  l.value ? (e(), t("thead", L5, [
@@ -951,7 +953,7 @@ const D3 = {
951
953
  class: g(["w-spreadsheet__cell", [v1(o1), { "w-spreadsheet__cell--sortable": T(o1), "w-spreadsheet__cell--sticky": t1(K, R), "w-spreadsheet__cell--sticky-first": i1(K, R), "w-spreadsheet__cell--active": G(K, o1) }, p1(d1, R), B(K, o1)]]),
952
954
  colspan: o1.colspan || 1,
953
955
  title: o1.title,
954
- style: m1(z1(K, R)),
956
+ style: u1(z1(K, R)),
955
957
  tabindex: T(o1) ? 0 : void 0,
956
958
  onClick: (q) => E(o1),
957
959
  onKeydown: [
@@ -1204,7 +1206,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1204
1206
  const t1 = b.value;
1205
1207
  t1?.matches("button, input, [tabindex]") ? t1.focus() : t1?.querySelector("button, input, [tabindex]")?.focus();
1206
1208
  };
1207
- let u1 = !1, Q = !1;
1209
+ let h1 = !1, Q = !1;
1208
1210
  function D() {
1209
1211
  Q || (document.addEventListener("pointerdown", a1, !0), document.addEventListener("keydown", b1, !0), Q = !0);
1210
1212
  }
@@ -1213,14 +1215,14 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1213
1215
  }
1214
1216
  M1(() => c.open, (F) => {
1215
1217
  F ? H1(() => {
1216
- u1 || !c.open || (c.autoPlacement && k.value && (k.value.style.maxHeight = ""), x(), D());
1218
+ h1 || !c.open || (c.autoPlacement && k.value && (k.value.style.maxHeight = ""), x(), D());
1217
1219
  }) : (a.value = null, T());
1218
1220
  }, { immediate: !0 }), M1(k, (F, t1) => {
1219
1221
  t1 && o?.remove(t1), F && o?.add(F);
1220
1222
  }), M1(z, (F) => {
1221
1223
  F && c.open && c.freezePositionOnOpen && !a.value && (a.value = M.value);
1222
1224
  }), s2(() => {
1223
- u1 = !0, T(), k.value && o?.remove(k.value);
1225
+ h1 = !0, T(), k.value && o?.remove(k.value);
1224
1226
  });
1225
1227
  const E = y(() => ({
1226
1228
  // Omit width properties entirely when the size middleware owns them.
@@ -1240,7 +1242,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1240
1242
  ref: k,
1241
1243
  "data-wpic-theme": m(s)?.mode,
1242
1244
  class: g([{ "wpic-theme": m(s), dark: m(s)?.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"]),
1243
- style: m1([m(s)?.variables, m(W), E.value])
1245
+ style: u1([m(s)?.variables, m(W), E.value])
1244
1246
  }, [
1245
1247
  U(F.$slots, "default")
1246
1248
  ], 14, I5), [
@@ -1377,7 +1379,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1377
1379
  let z = null;
1378
1380
  const Z = H(!1), a1 = H(!1), b1 = H(!1);
1379
1381
  H(/* @__PURE__ */ new Set());
1380
- const u1 = H(null), Q = H(null), D = H({}), T = H(null);
1382
+ const h1 = H(null), Q = H(null), D = H({}), T = H(null);
1381
1383
  let E = null, F = null;
1382
1384
  function t1() {
1383
1385
  F?.disconnect(), F = null;
@@ -1456,8 +1458,8 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1456
1458
  (C.includes("format") || C.includes("aspect") || C.includes("ratio")) && n1 && (d.aspect = n1[1]);
1457
1459
  const l1 = A.match(/\b([1248]K)\b/i);
1458
1460
  (C.includes("résolution") || C.includes("resolution")) && l1 && (d.resolution = l1[1].toUpperCase());
1459
- const h1 = A.match(/\b(\d{1,3})\s*(?:s|sec|secondes?|seconds?)\b/i);
1460
- (C.includes("durée") || C.includes("duration")) && h1 && (d.duration = Number(h1[1]));
1461
+ const m1 = A.match(/\b(\d{1,3})\s*(?:s|sec|secondes?|seconds?)\b/i);
1462
+ (C.includes("durée") || C.includes("duration")) && m1 && (d.duration = Number(m1[1]));
1461
1463
  const k1 = A.match(/\b(\d{1,3})\s*fps\b/i);
1462
1464
  C.includes("fps") && k1 && (d.fps = Number(k1[1]));
1463
1465
  const x1 = A.match(/\b(\d{1,2})\b/);
@@ -1489,18 +1491,18 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1489
1491
  function Y(r) {
1490
1492
  const d = r.match(/\[PROMPT\]([\s\S]*?)\[\/PROMPT\]/i)?.[1];
1491
1493
  if (d) {
1492
- const h1 = e2(d).trim().replace(/^["“]|["”]$/g, "");
1493
- if (h1) return h1;
1494
+ const m1 = e2(d).trim().replace(/^["“]|["”]$/g, "");
1495
+ if (m1) return m1;
1494
1496
  }
1495
1497
  const u = r.replace(/\r\n/g, `
1496
1498
  `).split(`
1497
1499
  `), V = [];
1498
1500
  let C = !1, A = !1, n1 = !1;
1499
- for (const h1 of u) {
1500
- const k1 = h1.trim().replace(/^[\s>*-]+/, "").replace(/^#{1,6}\s+/, "").replace(/^\*\*|\*\*$/g, "").trim();
1501
+ for (const m1 of u) {
1502
+ const k1 = m1.trim().replace(/^[\s>*-]+/, "").replace(/^#{1,6}\s+/, "").replace(/^\*\*|\*\*$/g, "").trim();
1501
1503
  if (A) {
1502
1504
  if (/^```/.test(k1)) break;
1503
- V.push(h1);
1505
+ V.push(m1);
1504
1506
  continue;
1505
1507
  }
1506
1508
  if (!C) {
@@ -1513,7 +1515,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1513
1515
  continue;
1514
1516
  }
1515
1517
  if (/^(?:r[eé]glages?(?:\s+recommand[eé]s?)?|settings?|mod[eè]le|model)\s*:/i.test(k1)) break;
1516
- V.push(h1);
1518
+ V.push(m1);
1517
1519
  }
1518
1520
  return e2(V.join(`
1519
1521
  `)).trim().replace(/^["“]|["”]$/g, "") || void 0;
@@ -1731,28 +1733,28 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1731
1733
  if (C?.prompt && n1.test(r))
1732
1734
  return d.replace(/(:)/, `$1 ${c2(c.applyPromptLabel, "prompt")}`);
1733
1735
  const l1 = r.toLowerCase();
1734
- let h1 = d;
1736
+ let m1 = d;
1735
1737
  if (!c0(r))
1736
1738
  for (const x1 of A)
1737
- h1 = h1.replace(R1(x1.label), c2(x1.label, "setting", "model", x1.value));
1738
- if (!C?.settings) return h1;
1739
+ m1 = m1.replace(R1(x1.label), c2(x1.label, "setting", "model", x1.value));
1740
+ if (!C?.settings) return m1;
1739
1741
  const k1 = (x1, W1, X1) => {
1740
1742
  if (X1 == null) return;
1741
1743
  const N1 = r.match(x1);
1742
- N1?.[1] && (h1 = h1.replace(R1(N1[1]), c2(N1[1], "setting", W1, X1)));
1744
+ N1?.[1] && (m1 = m1.replace(R1(N1[1]), c2(N1[1], "setting", W1, X1)));
1743
1745
  };
1744
1746
  if ((l1.includes("format") || l1.includes("aspect") || l1.includes("ratio")) && k1(/\b(\d{1,2}:\d{1,2})\b/, "aspect", C.settings.aspect), (l1.includes("résolution") || l1.includes("resolution")) && k1(/\b([1248]K)\b/i, "resolution", C.settings.resolution), (l1.includes("durée") || l1.includes("duration")) && k1(/\b(\d{1,3})\s*(?:s|sec|secondes?|seconds?)\b/i, "duration", C.settings.duration), l1.includes("fps") && k1(/\b(\d{1,3})\s*fps\b/i, "fps", C.settings.fps), C.settings.format) {
1745
1747
  const x1 = r.match(/\b(jpe?g|png|webp)\b/i)?.[1];
1746
- x1 && (h1 = h1.replace(R1(x1), c2(x1, "setting", "format", C.settings.format)));
1748
+ x1 && (m1 = m1.replace(R1(x1), c2(x1, "setting", "format", C.settings.format)));
1747
1749
  }
1748
- return h1;
1750
+ return m1;
1749
1751
  }
1750
1752
  function k2(r, d) {
1751
1753
  const u = Q1(r);
1752
1754
  let V = R1(u);
1753
1755
  return d?.role === "assistant" && !d.streaming && !d.error && (V = H0(u, V, d)), V = V.replace(/`([^`]+)`/g, "<code>$1</code>").replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(/__([^_]+)__/g, "<strong>$1</strong>").replace(/\*([^*]+)\*/g, "<em>$1</em>").replace(/_([^_]+)_/g, "<em>$1</em>").replace(/\[([^\]]+)\]\(((?:https?:\/\/|\/(?!\/))[^)\s]+)\)/g, (C, A, n1) => {
1754
- const h1 = /^https?:\/\//.test(n1) ? ' target="_blank" rel="noopener noreferrer"' : "";
1755
- return `<a href="${n1}"${h1}>${A}</a>`;
1756
+ const m1 = /^https?:\/\//.test(n1) ? ' target="_blank" rel="noopener noreferrer"' : "";
1757
+ return `<a href="${n1}"${m1}>${A}</a>`;
1756
1758
  }).replace(/\b([A-ZÀ-ÖØ-Þ][\p{L}\p{N} _-]{1,40})\s+\(((?:\/(?!\/)[A-Za-z0-9._~:/?#[\]@!$&'*+,;=%-]+))\)/gu, (C, A, n1) => `<a href="${n1}">${A.trim()}</a>`).replace(/(^|[\s(])((?:\/(?!\/)[A-Za-z0-9._~:/?#[\]@!$&'*+,;=%-]+))/g, (C, A, n1) => C.includes("<a ") ? C : `${A}<a href="${n1}">${n1}</a>`), V;
1757
1759
  }
1758
1760
  function P0(r) {
@@ -1768,11 +1770,11 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1768
1770
  }), V = Q1(u).replace(/\r\n/g, `
1769
1771
  `).split(`
1770
1772
  `), C = [];
1771
- let A = !1, n1 = [], l1 = !1, h1 = !1;
1773
+ let A = !1, n1 = [], l1 = !1, m1 = !1;
1772
1774
  const k1 = () => {
1773
1775
  l1 && (C.push("</ul>"), l1 = !1);
1774
1776
  }, x1 = () => {
1775
- h1 && (C.push("</tbody></table></div>"), h1 = !1);
1777
+ m1 && (C.push("</tbody></table></div>"), m1 = !1);
1776
1778
  }, W1 = () => {
1777
1779
  A && (C.push(`<pre><code>${R1(n1.join(`
1778
1780
  `))}</code></pre>`), n1 = [], A = !1);
@@ -1801,13 +1803,13 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1801
1803
  x1(), k1();
1802
1804
  continue;
1803
1805
  }
1804
- if (!h1 && S1.includes("|") && V[L1 + 1] && X1(V[L1 + 1])) {
1806
+ if (!m1 && S1.includes("|") && V[L1 + 1] && X1(V[L1 + 1])) {
1805
1807
  k1();
1806
1808
  const K1 = N1(S1);
1807
- C.push('<div class="wpic-chat-table-wrap"><table><thead><tr>'), C.push(K1.map((O2) => `<th>${k2(O2, r)}</th>`).join("")), C.push("</tr></thead><tbody>"), h1 = !0, L1 += 1;
1809
+ C.push('<div class="wpic-chat-table-wrap"><table><thead><tr>'), C.push(K1.map((O2) => `<th>${k2(O2, r)}</th>`).join("")), C.push("</tr></thead><tbody>"), m1 = !0, L1 += 1;
1808
1810
  continue;
1809
1811
  }
1810
- if (h1) {
1812
+ if (m1) {
1811
1813
  if (S1.includes("|")) {
1812
1814
  const K1 = N1(S1);
1813
1815
  C.push("<tr>"), C.push(K1.map((O2) => `<td>${k2(O2, r)}</td>`).join("")), C.push("</tr>");
@@ -1853,7 +1855,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1853
1855
  }, 140);
1854
1856
  }
1855
1857
  function E0(r) {
1856
- u1.value = u1.value === r ? null : r, Q.value = null;
1858
+ h1.value = h1.value === r ? null : r, Q.value = null;
1857
1859
  }
1858
1860
  function r2() {
1859
1861
  E && (window.clearTimeout(E), E = null);
@@ -1878,10 +1880,10 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1878
1880
  }, 120);
1879
1881
  }
1880
1882
  function t2() {
1881
- r2(), u1.value = null, Q.value = null;
1883
+ r2(), h1.value = null, Q.value = null;
1882
1884
  }
1883
1885
  function i0(r) {
1884
- !u1.value || (r.target instanceof Element ? r.target : null)?.closest("[data-wpic-chat-menu-root], [data-wpic-chat-menu-trigger]") || t2();
1886
+ !h1.value || (r.target instanceof Element ? r.target : null)?.closest("[data-wpic-chat-menu-root], [data-wpic-chat-menu-trigger]") || t2();
1885
1887
  }
1886
1888
  function l0(r, d) {
1887
1889
  s("move-session", r, d), t2();
@@ -1910,8 +1912,8 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1910
1912
  d.preventDefault(), d.stopPropagation();
1911
1913
  const A = u.dataset.wpicChatAction, n1 = J1(r);
1912
1914
  if (A === "metadata") {
1913
- const l1 = u.dataset.wpicChatActionId, h1 = l1 ? A0(r, l1) : null;
1914
- h1 && B2(r, h1);
1915
+ const l1 = u.dataset.wpicChatActionId, m1 = l1 ? A0(r, l1) : null;
1916
+ m1 && B2(r, m1);
1915
1917
  return;
1916
1918
  }
1917
1919
  if (A === "prompt") {
@@ -1924,9 +1926,9 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
1924
1926
  return;
1925
1927
  }
1926
1928
  if (A === "setting") {
1927
- const l1 = u.dataset.wpicChatKey, h1 = u.dataset.wpicChatValue;
1928
- if (!l1 || h1 === void 0) return;
1929
- const k1 = ["duration", "fps", "count"].includes(l1) ? Number(h1) : h1;
1929
+ const l1 = u.dataset.wpicChatKey, m1 = u.dataset.wpicChatValue;
1930
+ if (!l1 || m1 === void 0) return;
1931
+ const k1 = ["duration", "fps", "count"].includes(l1) ? Number(m1) : m1;
1930
1932
  B2(r, {
1931
1933
  ...l1 === "model" && typeof k1 == "string" ? { taskType: e1(k1) } : {},
1932
1934
  settings: { [l1]: k1 }
@@ -2045,8 +2047,8 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
2045
2047
  const A = (l1) => {
2046
2048
  if (l1.clientX >= window.innerWidth - m0) return;
2047
2049
  s("update:docked", !1), Z.value = !0;
2048
- const h1 = q0(), k1 = Math.max(0, Math.min(window.innerWidth - c.width, l1.clientX - R2)), x1 = Math.max(c.topOffset, Math.min(window.innerHeight - h1 - 16, l1.clientY - Z2));
2049
- s("update:x", k1), s("update:y", x1), s("update:height", h1), document.removeEventListener("mousemove", A), document.removeEventListener("mouseup", n1), document.addEventListener("mousemove", V), document.addEventListener("mouseup", C);
2050
+ const m1 = q0(), k1 = Math.max(0, Math.min(window.innerWidth - c.width, l1.clientX - R2)), x1 = Math.max(c.topOffset, Math.min(window.innerHeight - m1 - 16, l1.clientY - Z2));
2051
+ s("update:x", k1), s("update:y", x1), s("update:height", m1), document.removeEventListener("mousemove", A), document.removeEventListener("mouseup", n1), document.addEventListener("mousemove", V), document.addEventListener("mouseup", C);
2050
2052
  }, n1 = () => {
2051
2053
  document.removeEventListener("mousemove", A), document.removeEventListener("mouseup", n1);
2052
2054
  };
@@ -2060,10 +2062,10 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
2060
2062
  const u = k.value?.getBoundingClientRect();
2061
2063
  if (!u) return;
2062
2064
  a1.value = !0;
2063
- const V = r.clientX, C = r.clientY, A = u.width, n1 = u.height, l1 = u.left, h1 = u.top, k1 = (W1) => {
2065
+ const V = r.clientX, C = r.clientY, A = u.width, n1 = u.height, l1 = u.left, m1 = u.top, k1 = (W1) => {
2064
2066
  const X1 = W1.clientX - V, N1 = W1.clientY - C;
2065
- let i2 = A, O1 = n1, L1 = l1, F1 = h1;
2066
- d.includes("e") && (i2 = Math.max(c.minWidth, A + X1)), d.includes("s") && (O1 = Math.max(c.minHeight, n1 + N1)), d.includes("w") && (i2 = Math.max(c.minWidth, A - X1), L1 = l1 + (A - i2)), d.includes("n") && (O1 = Math.max(c.minHeight, n1 - N1), F1 = Math.max(c.topOffset, h1 + (n1 - O1))), s("update:width", Math.min(i2, window.innerWidth)), s("update:height", Math.min(O1, window.innerHeight - c.topOffset)), c.docked || (s("update:x", Math.max(0, L1)), s("update:y", Math.max(c.topOffset, F1)));
2067
+ let i2 = A, O1 = n1, L1 = l1, F1 = m1;
2068
+ d.includes("e") && (i2 = Math.max(c.minWidth, A + X1)), d.includes("s") && (O1 = Math.max(c.minHeight, n1 + N1)), d.includes("w") && (i2 = Math.max(c.minWidth, A - X1), L1 = l1 + (A - i2)), d.includes("n") && (O1 = Math.max(c.minHeight, n1 - N1), F1 = Math.max(c.topOffset, m1 + (n1 - O1))), s("update:width", Math.min(i2, window.innerWidth)), s("update:height", Math.min(O1, window.innerHeight - c.topOffset)), c.docked || (s("update:x", Math.max(0, L1)), s("update:y", Math.max(c.topOffset, F1)));
2067
2069
  }, x1 = () => {
2068
2070
  a1.value = !1, document.removeEventListener("mousemove", k1), document.removeEventListener("mouseup", x1);
2069
2071
  };
@@ -2118,7 +2120,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
2118
2120
  class: g(["wpic-chat-panel wpic:overflow-visible wpic:text-zinc-900 wpic:dark:text-zinc-100", [n.docked ? "wpic:flex wpic:border-l wpic:border-zinc-200/40 wpic:bg-zinc-50 wpic:dark:border-zinc-800/40 wpic:dark:bg-zinc-950" : "", Z.value ? "wpic:cursor-grabbing" : "", a1.value ? "wpic:select-none" : ""]]),
2119
2121
  "data-variant": n.variant,
2120
2122
  "data-maximized": n.maximized,
2121
- style: m1(M0.value),
2123
+ style: u1(M0.value),
2122
2124
  "aria-label": "Chat"
2123
2125
  }, [
2124
2126
  i("div", {
@@ -2370,7 +2372,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
2370
2372
  }, [
2371
2373
  L(m(w3), { size: 14 })
2372
2374
  ], 8, M4),
2373
- u1.value === `loose-${u.id}` ? (e(), t("div", {
2375
+ h1.value === `loose-${u.id}` ? (e(), t("div", {
2374
2376
  key: 0,
2375
2377
  class: "wpic:absolute wpic:right-2 wpic:top-8 wpic:z-30 wpic:text-left",
2376
2378
  "data-wpic-chat-menu-root": "",
@@ -2399,7 +2401,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
2399
2401
  (e(), O(Y1, { to: "body" }, [
2400
2402
  Q.value === `loose-${u.id}` ? (e(), t("div", {
2401
2403
  key: 0,
2402
- style: m1(D.value),
2404
+ style: u1(D.value),
2403
2405
  "data-wpic-chat-menu-root": "",
2404
2406
  onPointerenter: r2,
2405
2407
  onMouseenter: r2,
@@ -2824,7 +2826,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
2824
2826
  );
2825
2827
  const $ = y(() => {
2826
2828
  const M = c.modelValue, x = f.value;
2827
- if (x <= 7) return Array.from({ length: x }, (b1, u1) => u1 + 1);
2829
+ if (x <= 7) return Array.from({ length: x }, (b1, h1) => h1 + 1);
2828
2830
  const z = [];
2829
2831
  z.push(1), M > 4 && z.push("...");
2830
2832
  const Z = Math.max(2, M - 2), a1 = Math.min(x - 1, M + 2);
@@ -2992,9 +2994,9 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
2992
2994
  return J ? J.label : null;
2993
2995
  }).filter(Boolean);
2994
2996
  return i1.length ? E <= t1 ? i1.join(", ") : `${i1.slice(0, t1).join(", ")} · ${E}` : c.placeholder ? `${c.placeholder} · ${E}` : `${E} selected`;
2995
- }), u1 = y(() => c.multiple ? a.value.length > 0 : c.modelValue != null && c.modelValue !== ""), Q = y(() => c.variant ?? "default");
2997
+ }), h1 = y(() => c.multiple ? a.value.length > 0 : c.modelValue != null && c.modelValue !== ""), Q = y(() => c.variant ?? "default");
2996
2998
  return (D, T) => (e(), t("div", {
2997
- style: m1({ position: "relative", width: Q.value === "plain" ? "auto" : "100%", minWidth: 0 })
2999
+ style: u1({ position: "relative", width: Q.value === "plain" ? "auto" : "100%", minWidth: 0 })
2998
3000
  }, [
2999
3001
  n.label && n.labelPlacement !== "inline" ? (e(), O(k0, {
3000
3002
  key: 0,
@@ -3025,7 +3027,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
3025
3027
  }, [
3026
3028
  i("span", {
3027
3029
  style: { display: "flex", "align-items": "center", gap: "6px", "min-width": "0", flex: "1", "text-align": "left", overflow: "hidden" },
3028
- class: g(u1.value && !n.disabled ? "wpic:text-zinc-900 wpic:dark:text-zinc-100" : "wpic:text-zinc-400 wpic:dark:text-zinc-500")
3030
+ class: g(h1.value && !n.disabled ? "wpic:text-zinc-900 wpic:dark:text-zinc-100" : "wpic:text-zinc-400 wpic:dark:text-zinc-500")
3029
3031
  }, [
3030
3032
  a1.value?.icon ? (e(), O(B1(a1.value.icon), {
3031
3033
  key: 0,
@@ -3039,7 +3041,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
3039
3041
  key: 0,
3040
3042
  size: 13,
3041
3043
  class: "wpic:shrink-0 wpic:animate-spin wpic:text-zinc-400 wpic:dark:text-zinc-500"
3042
- })) : Q.value !== "plain" && u1.value && !n.multiple && c.clearable !== !1 ? (e(), t("button", {
3044
+ })) : Q.value !== "plain" && h1.value && !n.multiple && c.clearable !== !1 ? (e(), t("button", {
3043
3045
  key: 1,
3044
3046
  type: "button",
3045
3047
  onClick: T[0] || (T[0] = f1((E) => {
@@ -3151,7 +3153,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
3151
3153
  E.meta ? (e(), t("span", {
3152
3154
  key: 2,
3153
3155
  class: "wpic:shrink-0 wpic:px-1.5 wpic:py-px wpic:rounded wpic:text-[11px]",
3154
- style: m1({
3156
+ style: u1({
3155
3157
  background: E.metaVariant === "success" ? "rgba(34,197,94,0.12)" : E.metaVariant === "warning" ? "rgba(245,158,11,0.12)" : E.metaVariant === "error" ? "rgba(239,68,68,0.12)" : E.metaVariant === "subtle" ? "rgba(113,113,122,0.12)" : "transparent",
3156
3158
  color: E.metaVariant === "success" ? "#22C55E" : E.metaVariant === "warning" ? "#F59E0B" : E.metaVariant === "error" ? "#EF4444" : "rgb(161 161 170)"
3157
3159
  })
@@ -3217,7 +3219,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
3217
3219
  max: n.max,
3218
3220
  step: n.step,
3219
3221
  disabled: n.disabled,
3220
- style: m1({ "--wpic-slider-progress": `${s.value}%` }),
3222
+ style: u1({ "--wpic-slider-progress": `${s.value}%` }),
3221
3223
  class: g([
3222
3224
  "wpic-slider",
3223
3225
  `wpic-slider--${n.variant}`,
@@ -3265,7 +3267,7 @@ const I5 = ["data-wpic-theme"], n2 = /* @__PURE__ */ X({
3265
3267
  o.color ? (e(), t("span", {
3266
3268
  key: 0,
3267
3269
  class: "wpic:w-2 wpic:h-2 wpic:rounded-full wpic:shrink-0",
3268
- style: m1({ background: o.color })
3270
+ style: u1({ background: o.color })
3269
3271
  }, null, 4)) : o.icon ? (e(), O(B1(o.icon), {
3270
3272
  key: 1,
3271
3273
  size: 13,
@@ -3638,7 +3640,7 @@ const R6 = {
3638
3640
  setup(n) {
3639
3641
  return (w, c) => (e(), t("div", {
3640
3642
  class: "wpic-skeleton wpic:animate-pulse wpic:bg-zinc-200 wpic:dark:bg-zinc-800",
3641
- style: m1({
3643
+ style: u1({
3642
3644
  width: n.width ?? "100%",
3643
3645
  height: n.height ?? "1rem",
3644
3646
  borderRadius: n.rounded ?? "4px"
@@ -3727,7 +3729,7 @@ const R6 = {
3727
3729
  const c = V2(), s = w, p = H(!1);
3728
3730
  return g2("wpic-pagination-url-sync", !1), (l, o) => (e(), O(Y1, { to: "body" }, [
3729
3731
  i("div", {
3730
- style: m1(m(c)?.variables),
3732
+ style: u1(m(c)?.variables),
3731
3733
  "data-wpic-theme": m(c)?.mode,
3732
3734
  class: g([{ "wpic-theme": m(c), dark: m(c)?.mode === "dark" }, "wpic-modal-overlay wpic:flex wpic:items-center wpic:justify-center wpic:bg-black/50 wpic:backdrop-blur-sm", n.size === "screen" ? "wpic:px-3" : "wpic:px-4", n.zIndex]),
3733
3735
  onMousedown: o[2] || (o[2] = f1((f) => p.value = !0, ["self"])),
@@ -4240,23 +4242,23 @@ const Mi = /* @__PURE__ */ I1(w7, [["render", h7]]), m7 = ["placeholder", "rows"
4240
4242
  for (let K = 1; K <= Y; K++)
4241
4243
  S.push({ day: K, month: N + 1, year: B, outside: !0 });
4242
4244
  return S;
4243
- }, a1 = y(() => Z(a.value, P.value)), b1 = y(() => Z($.value, W.value)), u1 = (B) => {
4245
+ }, a1 = y(() => Z(a.value, P.value)), b1 = y(() => Z($.value, W.value)), h1 = (B) => {
4244
4246
  const N = B.month < 0 ? B.year - 1 : B.month > 11 ? B.year + 1 : B.year, e1 = (B.month % 12 + 12) % 12;
4245
4247
  return `${N}-${String(e1 + 1).padStart(2, "0")}-${String(B.day).padStart(2, "0")}`;
4246
4248
  }, Q = `${k.getFullYear()}-${String(k.getMonth() + 1).padStart(2, "0")}-${String(k.getDate()).padStart(2, "0")}`, D = y(() => p.value ? c.modelValue?.start ?? null : c.modelValue ?? null), T = y(() => p.value ? c.modelValue?.end ?? null : null), E = y(() => !!(D.value && T.value)), F = H(null), t1 = (B) => {
4247
4249
  if (!p.value) return !1;
4248
- const N = u1(B);
4250
+ const N = h1(B);
4249
4251
  return E.value && !M.value ? N > D.value && N < T.value : !1;
4250
4252
  }, i1 = (B) => {
4251
4253
  if (!p.value || !M.value || !F.value) return !1;
4252
- const N = u1(B), [e1, v1] = [M.value, F.value].sort();
4254
+ const N = h1(B), [e1, v1] = [M.value, F.value].sort();
4253
4255
  return N > e1 && N < v1;
4254
4256
  }, z1 = (B) => {
4255
4257
  if (!p.value) return !1;
4256
- const N = u1(B);
4258
+ const N = h1(B);
4257
4259
  return N === D.value || N === T.value || M.value && N === M.value;
4258
4260
  }, J = (B) => {
4259
- const N = u1(B);
4261
+ const N = h1(B);
4260
4262
  if (!p.value) {
4261
4263
  s("update:modelValue", N), l.value = !1;
4262
4264
  return;
@@ -4292,7 +4294,7 @@ const Mi = /* @__PURE__ */ I1(w7, [["render", h7]]), m7 = ["placeholder", "rows"
4292
4294
  const [N, e1] = D.value.split("-").map(Number);
4293
4295
  a.value = N, P.value = e1 - 1;
4294
4296
  });
4295
- const p1 = (B) => z1(B) ? "wpic:bg-indigo-500 wpic:text-white wpic:font-semibold" : t1(B) || i1(B) ? "wpic:bg-indigo-500/15 text-wpic-green" : u1(B) === Q ? "wpic:ring-1 ring-wpic-green/50 text-wpic-green wpic:font-medium wpic:hover:bg-black/5 wpic:dark:hover:bg-white/5" : B.outside ? "wpic:text-zinc-300 wpic:dark:text-zinc-600 wpic:hover:bg-black/5 wpic:dark:hover:bg-white/5" : "wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:hover:bg-black/5 wpic:dark:hover:bg-white/5";
4297
+ const p1 = (B) => z1(B) ? "wpic:bg-indigo-500 wpic:text-white wpic:font-semibold" : t1(B) || i1(B) ? "wpic:bg-indigo-500/15 text-wpic-green" : h1(B) === Q ? "wpic:ring-1 ring-wpic-green/50 text-wpic-green wpic:font-medium wpic:hover:bg-black/5 wpic:dark:hover:bg-white/5" : B.outside ? "wpic:text-zinc-300 wpic:dark:text-zinc-600 wpic:hover:bg-black/5 wpic:dark:hover:bg-white/5" : "wpic:text-zinc-900 wpic:dark:text-zinc-100 wpic:hover:bg-black/5 wpic:dark:hover:bg-white/5";
4296
4298
  return (B, N) => (e(), t("div", g7, [
4297
4299
  i("button", {
4298
4300
  ref_key: "triggerRef",
@@ -4327,7 +4329,7 @@ const Mi = /* @__PURE__ */ I1(w7, [["render", h7]]), m7 = ["placeholder", "rows"
4327
4329
  key: 0,
4328
4330
  ref_key: "floatingRef",
4329
4331
  ref: f,
4330
- style: m1({ ...m(b), minWidth: p.value ? "560px" : "280px" }),
4332
+ style: u1({ ...m(b), minWidth: p.value ? "560px" : "280px" }),
4331
4333
  class: "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:z-50 wpic:p-3"
4332
4334
  }, [
4333
4335
  i("div", C7, [
@@ -4360,7 +4362,7 @@ const Mi = /* @__PURE__ */ I1(w7, [["render", h7]]), m7 = ["placeholder", "rows"
4360
4362
  (e(!0), t(I, null, c1(a1.value, (e1, v1) => (e(), t("button", {
4361
4363
  key: v1,
4362
4364
  onClick: (y1) => J(e1),
4363
- onMouseenter: (y1) => F.value = u1(e1),
4365
+ onMouseenter: (y1) => F.value = h1(e1),
4364
4366
  onMouseleave: N[1] || (N[1] = (y1) => F.value = null),
4365
4367
  type: "button",
4366
4368
  class: g(["wpic:h-8 wpic:w-full wpic:flex wpic:items-center wpic:justify-center wpic:rounded-lg wpic:transition wpic:cursor-pointer", p1(e1)])
@@ -4391,7 +4393,7 @@ const Mi = /* @__PURE__ */ I1(w7, [["render", h7]]), m7 = ["placeholder", "rows"
4391
4393
  (e(!0), t(I, null, c1(b1.value, (e1, v1) => (e(), t("button", {
4392
4394
  key: v1,
4393
4395
  onClick: (y1) => J(e1),
4394
- onMouseenter: (y1) => F.value = u1(e1),
4396
+ onMouseenter: (y1) => F.value = h1(e1),
4395
4397
  onMouseleave: N[2] || (N[2] = (y1) => F.value = null),
4396
4398
  type: "button",
4397
4399
  class: g(["wpic:h-8 wpic:w-full wpic:flex wpic:items-center wpic:justify-center wpic:rounded-lg wpic:transition wpic:cursor-pointer", p1(e1)])
@@ -4647,7 +4649,7 @@ const Ei = /* @__PURE__ */ X({
4647
4649
  n.modelValue ? (e(), t("div", {
4648
4650
  key: 0,
4649
4651
  class: "wpic:fixed wpic:inset-0 wpic:bg-black/30 wpic:backdrop-blur-[2px]",
4650
- style: m1({ zIndex: (n.zIndex ?? 70) - 1, right: l }),
4652
+ style: u1({ zIndex: (n.zIndex ?? 70) - 1, right: l }),
4651
4653
  onClick: a[0] || (a[0] = (P) => b())
4652
4654
  }, null, 4)) : h("", !0)
4653
4655
  ]),
@@ -4658,7 +4660,7 @@ const Ei = /* @__PURE__ */ X({
4658
4660
  n.modelValue ? (e(), t("div", {
4659
4661
  key: 0,
4660
4662
  class: g(["wpic-slide-panel wpic:fixed wpic:box-border wpic:flex wpic:flex-col wpic:bg-white wpic:dark:bg-zinc-900 wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:shadow-2xl", n.island ? "wpic:top-3 wpic:bottom-3 wpic:rounded-xl wpic:border wpic:overflow-hidden" : "wpic:top-0 wpic:h-full wpic:border-l", p.value ? "" : n.width ?? "wpic:w-[420px]"]),
4661
- style: m1({ width: p.value, zIndex: n.zIndex ?? 70, right: n.island ? `calc(${l} + 12px)` : l, maxWidth: `calc(100vw - ${l}${n.island ? " - 24px" : ""})` })
4663
+ style: u1({ width: p.value, zIndex: n.zIndex ?? 70, right: n.island ? `calc(${l} + 12px)` : l, maxWidth: `calc(100vw - ${l}${n.island ? " - 24px" : ""})` })
4662
4664
  }, [
4663
4665
  n.hideHeader ? h("", !0) : (e(), t("div", G7, [
4664
4666
  U(k.$slots, "header", {}, () => [
@@ -4771,9 +4773,9 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
4771
4773
  o.value = !1;
4772
4774
  }, 150);
4773
4775
  }
4774
- const W = H(""), M = H("idle"), x = H(null), z = H(null), Z = H(null), a1 = H(""), b1 = H(null), u1 = H(null), Q = H(null), D = H(!1), T = H([]), E = H(!1);
4776
+ const W = H(""), M = H("idle"), x = H(null), z = H(null), Z = H(null), a1 = H(""), b1 = H(null), h1 = H(null), Q = H(null), D = H(!1), T = H([]), E = H(!1);
4775
4777
  let F = null;
4776
- const { getRecent: t1, addRecent: i1 } = t8(c.recentKey, 10), { floatingStyles: z1 } = v2(u1, Q, {
4778
+ const { getRecent: t1, addRecent: i1 } = t8(c.recentKey, 10), { floatingStyles: z1 } = v2(h1, Q, {
4777
4779
  placement: "bottom-start",
4778
4780
  middleware: [
4779
4781
  u2(4),
@@ -4991,7 +4993,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
4991
4993
  i("div", {
4992
4994
  class: "wpic:relative",
4993
4995
  ref_key: "inputRef",
4994
- ref: u1
4996
+ ref: h1
4995
4997
  }, [
4996
4998
  i("div", u8, [
4997
4999
  T1(i("input", {
@@ -5017,7 +5019,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5017
5019
  key: 1,
5018
5020
  ref_key: "dropdownRef",
5019
5021
  ref: Q,
5020
- style: m1({ ...m(z1), minWidth: u1.value?.offsetWidth + "px" }),
5022
+ style: u1({ ...m(z1), minWidth: h1.value?.offsetWidth + "px" }),
5021
5023
  class: "wpic:bg-white wpic:dark:bg-zinc-900 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:rounded-lg wpic:shadow-xl wpic:z-50 wpic:overflow-y-auto"
5022
5024
  }, [
5023
5025
  j.value ? (e(), t("div", v8, [
@@ -5248,7 +5250,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5248
5250
  Z = setTimeout(() => {
5249
5251
  o.value = null;
5250
5252
  }, 150);
5251
- }, u1 = () => {
5253
+ }, h1 = () => {
5252
5254
  Z && clearTimeout(Z);
5253
5255
  }, Q = () => {
5254
5256
  Z = setTimeout(() => {
@@ -5294,7 +5296,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5294
5296
  key: 0,
5295
5297
  ref_key: "floatingRef",
5296
5298
  ref: b,
5297
- style: m1({ ...m($), minWidth: f.value?.offsetWidth + "px", width: "280px" }),
5299
+ style: u1({ ...m($), minWidth: f.value?.offsetWidth + "px", width: "280px" }),
5298
5300
  class: "wpic:bg-white wpic:dark:bg-zinc-900 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:rounded-lg wpic:shadow-xl wpic:z-50 wpic:overflow-hidden"
5299
5301
  }, [
5300
5302
  i("div", P8, [
@@ -5355,9 +5357,9 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5355
5357
  key: 1,
5356
5358
  ref_key: "subPanelRef",
5357
5359
  ref: P,
5358
- style: m1(m(W)),
5360
+ style: u1(m(W)),
5359
5361
  class: "wpic:bg-white wpic:dark:bg-zinc-900 wpic:border wpic:border-zinc-200 wpic:dark:border-zinc-800 wpic:rounded-lg wpic:shadow-xl wpic:z-[51] wpic:overflow-hidden wpic:w-[320px] wpic:max-h-[280px] wpic:overflow-y-auto",
5360
- onMouseenter: u1,
5362
+ onMouseenter: h1,
5361
5363
  onMouseleave: Q
5362
5364
  }, [
5363
5365
  i("div", D8, [
@@ -5502,7 +5504,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5502
5504
  key: 0,
5503
5505
  ref_key: "floating",
5504
5506
  ref: p,
5505
- style: m1([m(c)?.variables, m(b)]),
5507
+ style: u1([m(c)?.variables, m(b)]),
5506
5508
  class: g([{ "wpic-theme": m(c), dark: m(c)?.mode === "dark" }, "wpic-tooltip-panel wpic:pointer-events-none wpic:z-[9999] wpic:max-w-[200px] wpic:whitespace-pre-line wpic:break-words"]),
5507
5509
  "data-wpic-theme": m(c)?.mode,
5508
5510
  role: "tooltip"
@@ -5512,7 +5514,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5512
5514
  ref_key: "arrowEl",
5513
5515
  ref: l,
5514
5516
  class: "wpic-tooltip-arrow",
5515
- style: m1($.value)
5517
+ style: u1($.value)
5516
5518
  }, null, 4)
5517
5519
  ], 14, Y8)) : h("", !0)
5518
5520
  ]),
@@ -5599,7 +5601,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5599
5601
  class: "wpic-stat-card__change wpic:shrink-0 wpic:text-xs wpic:font-medium wpic:tabular-nums",
5600
5602
  title: n.changeTitle,
5601
5603
  "aria-label": n.changeTitle ? `${n.change}. ${n.changeTitle}` : void 0,
5602
- style: m1({ color: n.changeTone === "negative" ? "var(--wpic-negative)" : n.changeTone === "neutral" ? "var(--wpic-muted)" : "var(--wpic-accent)" })
5604
+ style: u1({ color: n.changeTone === "negative" ? "var(--wpic-negative)" : n.changeTone === "neutral" ? "var(--wpic-muted)" : "var(--wpic-accent)" })
5603
5605
  }, v(n.change), 13, _8)) : h("", !0)
5604
5606
  ]),
5605
5607
  i("div", {
@@ -5607,7 +5609,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5607
5609
  }, [
5608
5610
  i("strong", {
5609
5611
  class: g([n.compact ? "wpic:text-lg" : "wpic:text-2xl", "wpic-stat-card__value wpic:font-semibold wpic:tracking-tight wpic:tabular-nums wpic:text-[var(--wpic-text)]"]),
5610
- style: m1(n.color ? { color: n.color } : void 0)
5612
+ style: u1(n.color ? { color: n.color } : void 0)
5611
5613
  }, [
5612
5614
  w1(v(n.value), 1),
5613
5615
  n.unit ? (e(), t("span", nn, v(n.unit), 1)) : h("", !0)
@@ -5616,7 +5618,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5616
5618
  key: 0,
5617
5619
  title: n.changeTitle,
5618
5620
  class: "wpic-stat-card__change wpic:shrink-0 wpic:text-sm wpic:font-medium",
5619
- style: m1({ color: n.changeTone === "negative" ? "var(--wpic-negative)" : n.changeTone === "neutral" ? "var(--wpic-muted)" : "var(--wpic-accent)" })
5621
+ style: u1({ color: n.changeTone === "negative" ? "var(--wpic-negative)" : n.changeTone === "neutral" ? "var(--wpic-muted)" : "var(--wpic-accent)" })
5620
5622
  }, v(n.change), 13, en)) : h("", !0)
5621
5623
  ], 2),
5622
5624
  n.trend !== void 0 ? (e(), t("div", cn, [
@@ -5630,7 +5632,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5630
5632
  n.sub ? (e(), t("p", {
5631
5633
  key: 1,
5632
5634
  class: "wpic:mt-2 wpic:text-xs wpic:tabular-nums",
5633
- style: m1({ color: n.subColor || "var(--wpic-muted)" })
5635
+ style: u1({ color: n.subColor || "var(--wpic-muted)" })
5634
5636
  }, v(n.sub), 5)) : h("", !0)
5635
5637
  ]),
5636
5638
  _: 1
@@ -5641,7 +5643,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5641
5643
  i("p", ln, v(n.label), 1),
5642
5644
  i("p", {
5643
5645
  class: "wpic:text-2xl wpic:font-semibold wpic:tabular-nums wpic:tracking-tight wpic:leading-none wpic-legacy-text-main wpic:mb-2",
5644
- style: m1(n.color ? `color:${n.color}` : "")
5646
+ style: u1(n.color ? `color:${n.color}` : "")
5645
5647
  }, [
5646
5648
  w1(v(n.value) + " ", 1),
5647
5649
  n.unit ? (e(), t("span", an, v(n.unit), 1)) : h("", !0)
@@ -5649,7 +5651,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5649
5651
  n.sub ? (e(), t("p", {
5650
5652
  key: 0,
5651
5653
  class: "wpic:text-xs wpic:mt-1 wpic:tabular-nums",
5652
- style: m1(n.subColor ? `color:${n.subColor}` : "color:var(--wpic-legacy-text-dim)")
5654
+ style: u1(n.subColor ? `color:${n.subColor}` : "color:var(--wpic-legacy-text-dim)")
5653
5655
  }, v(n.sub), 5)) : h("", !0)
5654
5656
  ], 2));
5655
5657
  }
@@ -5768,7 +5770,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5768
5770
  }, [
5769
5771
  i("div", {
5770
5772
  class: g(["wpic:h-full wpic:rounded-full", [n.color ? "" : "wpic:bg-indigo-500", n.animated ? "wpic:animate-pulse" : ""]]),
5771
- style: m1(p.value)
5773
+ style: u1(p.value)
5772
5774
  }, null, 6)
5773
5775
  ], 2)
5774
5776
  ]));
@@ -5833,7 +5835,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5833
5835
  k.dot ? (e(), t("span", {
5834
5836
  key: 1,
5835
5837
  class: "wpic:w-1.5 wpic:h-1.5 wpic:rounded-full wpic:shrink-0",
5836
- style: m1({ background: k.dot })
5838
+ style: u1({ background: k.dot })
5837
5839
  }, null, 4)) : h("", !0),
5838
5840
  n.selectionIndicator ? (e(), t("span", {
5839
5841
  key: 2,
@@ -5868,7 +5870,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
5868
5870
  k.dot ? (e(), t("span", {
5869
5871
  key: 1,
5870
5872
  class: "wpic:w-1.5 wpic:h-1.5 wpic:rounded-full wpic:shrink-0",
5871
- style: m1({ background: k.dot })
5873
+ style: u1({ background: k.dot })
5872
5874
  }, null, 4)) : h("", !0),
5873
5875
  n.selectionIndicator ? (e(), t("span", {
5874
5876
  key: 2,
@@ -6064,7 +6066,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
6064
6066
  function b1(Q) {
6065
6067
  f.value = new Date(f.value.getFullYear(), f.value.getMonth() + Q, 1);
6066
6068
  }
6067
- function u1(Q) {
6069
+ function h1(Q) {
6068
6070
  return Q.iso === c.modelValue ? "wpic:bg-[var(--wpic-primary)] wpic:text-white wpic:font-semibold" : z(Q.iso) ? "wpic:cursor-not-allowed wpic:text-zinc-200 wpic:dark:text-zinc-700" : Q.inMonth ? Q.iso === k(o) ? "wpic:text-[var(--wpic-primary)] wpic:ring-1 wpic:ring-[var(--wpic-primary)]/40 wpic:hover:bg-zinc-100 wpic:dark:hover:bg-zinc-800" : "wpic:text-zinc-700 wpic:hover:bg-zinc-100 wpic:dark:text-zinc-200 wpic:dark:hover:bg-zinc-800" : "wpic:text-zinc-300 wpic:hover:bg-zinc-100 wpic:dark:text-zinc-600 wpic:dark:hover:bg-zinc-800";
6069
6071
  }
6070
6072
  return M1(p, (Q) => {
@@ -6152,7 +6154,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
6152
6154
  "aria-pressed": T.iso === n.modelValue,
6153
6155
  type: "button",
6154
6156
  disabled: z(T.iso),
6155
- class: g(["wpic-calendar-day wpic:flex wpic:h-9 wpic:w-9 wpic:items-center wpic:justify-center wpic:rounded-lg wpic:text-sm wpic:transition", u1(T)]),
6157
+ class: g(["wpic-calendar-day wpic:flex wpic:h-9 wpic:w-9 wpic:items-center wpic:justify-center wpic:rounded-lg wpic:text-sm wpic:transition", h1(T)]),
6156
6158
  onClick: (E) => Z(T.iso)
6157
6159
  }, v(T.day), 11, Wn))), 128))
6158
6160
  ])
@@ -6216,12 +6218,12 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
6216
6218
  placeholder: z.placeholder ?? "Search…",
6217
6219
  clearable: z.clearable ?? !0,
6218
6220
  class: "wpic:flex-1 wpic:min-w-0",
6219
- style: m1(z.width ? { width: z.width } : {}),
6221
+ style: u1(z.width ? { width: z.width } : {}),
6220
6222
  "onUpdate:modelValue": (a1) => k(z.modelKey, a1)
6221
6223
  }, null, 8, ["model-value", "icon", "placeholder", "clearable", "style", "onUpdate:modelValue"])) : z.type === "select" ? (e(), t("div", {
6222
6224
  key: 1,
6223
6225
  class: "wpic:shrink-0 wpic:text-base",
6224
- style: m1({ width: z.width ?? "150px" })
6226
+ style: u1({ width: z.width ?? "150px" })
6225
6227
  }, [
6226
6228
  L(Y2, U1({ ref_for: !0 }, n.selectLabels, {
6227
6229
  "model-value": o(z.modelKey),
@@ -6242,7 +6244,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
6242
6244
  max: z.max,
6243
6245
  clearable: z.clearable ?? !0,
6244
6246
  class: "wpic:shrink-0",
6245
- style: m1({ width: z.width ?? "170px" }),
6247
+ style: u1({ width: z.width ?? "170px" }),
6246
6248
  "onUpdate:modelValue": (a1) => a(z.modelKey, a1)
6247
6249
  }, null, 8, ["model-value", "placeholder", "locale", "min", "max", "clearable", "style", "onUpdate:modelValue"])) : z.type === "pills" ? (e(), t(I, { key: 3 }, [
6248
6250
  L(Cn, {
@@ -6995,7 +6997,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
6995
6997
  const z = y(() => a.value.getFullYear()), Z = y(() => a.value.getMonth()), a1 = y(
6996
6998
  () => a.value.toLocaleString(c.locale, { month: "long", year: "numeric" })
6997
6999
  ), b1 = y(() => Array.from({ length: 7 }, (J, r1) => new Intl.DateTimeFormat(c.locale, { weekday: "short", timeZone: "UTC" }).format(new Date(Date.UTC(2024, 0, 1 + r1)))));
6998
- function u1() {
7000
+ function h1() {
6999
7001
  a.value = new Date(z.value, Z.value - 1, 1);
7000
7002
  }
7001
7003
  function Q() {
@@ -7106,7 +7108,7 @@ const i8 = { class: "wpic-tag-input" }, l8 = {
7106
7108
  i("button", {
7107
7109
  type: "button",
7108
7110
  "aria-label": n.previousMonthLabel,
7109
- onClick: u1,
7111
+ onClick: h1,
7110
7112
  class: "wpic:rounded wpic:p-1 wpic:hover:bg-zinc-100 wpic:dark:hover:bg-zinc-800 wpic:cursor-pointer"
7111
7113
  }, [
7112
7114
  L(m(z2), { size: 16 })
@@ -18020,7 +18022,7 @@ c36 -78 76 -117 152 -146 53 -20 76 -23 190 -22 137 2 262 27 295 59 10 11 17
18020
18022
  return g2(y0, o), (f, b) => (e(), t("div", {
18021
18023
  class: g({ "wpic-theme": o.value, dark: o.value?.mode === "dark" }),
18022
18024
  "data-wpic-theme": o.value?.mode,
18023
- style: m1(o.value?.variables)
18025
+ style: u1(o.value?.variables)
18024
18026
  }, [
18025
18027
  U(f.$slots, "default")
18026
18028
  ], 14, Zt));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpic/ui",
3
- "version": "0.9.19",
3
+ "version": "0.9.21",
4
4
  "type": "module",
5
5
  "description": "WPIC shared Vue 3 component library",
6
6
  "publishConfig": {
package/src/style.css CHANGED
@@ -466,8 +466,10 @@ input[type="range"].wpic-legacy-slider-themed::-webkit-slider-thumb {
466
466
  /* Opaque row surfaces prevent scrolled content showing through fixed cells.
467
467
  Keep header, summary and hover surfaces in sync with the fixed column. */
468
468
  .wpic-table__scroll { isolation: isolate; }
469
- .wpic-table__header,
470
469
  .wpic-table__row { background: var(--wpic-surface, var(--wpic-legacy-bg-card)); }
470
+ /* Match the WSpreadsheet header surface. */
471
+ .wpic-table__header { background: var(--wpic-table-header, #f4f4f5); }
472
+ .dark .wpic-table__header { background: var(--wpic-table-header, #303033); }
471
473
  .wpic-table__summary,
472
474
  .wpic-table__row:hover { background: var(--wpic-raised, var(--wpic-legacy-bg-input)); }
473
475
  .wpic-table__sticky {