@romainbx/wpic-components 0.0.127 → 0.0.129

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.
@@ -2,7 +2,7 @@
2
2
  * vee-validate v4.12.8
3
3
  * (c) 2024 Abdelrahman Awad
4
4
  * @license MIT
5
- */function Ge(t){return typeof t=="function"}function Pc(t){return t==null}const Ln=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Zs(t){return Number(t)>=0}function Yg(t){const e=parseFloat(t);return isNaN(e)?t:e}function qg(t){return typeof t=="object"&&t!==null}function Kg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function Rc(t){if(!qg(t)||Kg(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ei(t,e){return Object.keys(e).forEach(n=>{if(Rc(e[n])&&Rc(t[n])){t[n]||(t[n]={}),Ei(t[n],e[n]);return}t[n]=e[n]}),t}function Ci(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Zs(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Fc={};function Gt(t,e){Jg(t,e),Fc[t]=e}function Gg(t){return Fc[t]}function Jg(t,e){if(!Ge(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function zc(t,e,n){typeof n.value=="object"&&(n.value=De(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function De(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(De(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(De(l),De(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(De(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)zc(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||zc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Si=Symbol("vee-validate-form"),jc=Symbol("vee-validate-field-instance"),_o=Symbol("Default empty value"),Zg=typeof window<"u";function Xs(t){return Ge(t)&&!!t.__locatorRef}function Jt(t){return!!t&&Ge(t.parse)&&t.__type==="VVTypedSchema"}function Oo(t){return!!t&&Ge(t.validate)}function _i(t){return t==="checkbox"||t==="radio"}function Xg(t){return Ln(t)||Array.isArray(t)}function Qg(t){return Array.isArray(t)?t.length===0:Ln(t)&&Object.keys(t).length===0}function To(t){return/^\[.+\]$/i.test(t)}function e0(t){return Hc(t)&&t.multiple}function Hc(t){return t.tagName==="SELECT"}function t0(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function n0(t,e){return!t0(t,e)&&e.type!=="file"&&!_i(e.type)}function Wc(t){return Qs(t)&&t.target&&"submit"in t.target}function Qs(t){return t?!!(typeof Event<"u"&&Ge(Event)&&t instanceof Event||t&&t.srcElement):!1}function Uc(t,e){return e in t&&t[e]!==_o}function mt(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!mt(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!mt(r[1],e.get(r[0])))return!1;return!0}if(Yc(t)&&Yc(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!mt(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Yc(t){return Zg?t instanceof File:!1}function el(t){return To(t)?t.replace(/\[|\]/gi,""):t}function xt(t,e,n){return t?To(e)?t[el(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>Xg(i)&&o in i?i[o]:n,t):n}function gn(t,e,n){if(To(e)){t[el(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||Pc(i[r[o]]))&&(i[r[o]]=Zs(r[o+1])?[]:{}),i=i[r[o]]}}function tl(t,e){if(Array.isArray(t)&&Zs(e)){t.splice(Number(e),1);return}Ln(t)&&delete t[e]}function qc(t,e){if(To(e)){delete t[el(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){tl(r,n[o]);break}if(!(n[o]in r)||Pc(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>xt(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(Qg(i[o])){if(o===0){tl(t,n[0]);continue}tl(i[o-1],n[o-1])}}function Et(t){return Object.keys(t)}function nl(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function Kc(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>mt(o,e));return i>=0?r.splice(i,1):r.push(e),r}return mt(t,e)?n:e}function r0(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function Gc(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function i0(t,e){return Ln(e)&&e.number?Yg(t):t}function rl(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function il(t){return Array.isArray(t)?t:t?[t]:[]}function No(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function o0(t){let e=null,n=[];return function(...r){const i=a.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function ol(t,e,n){return e.slots.default?typeof t=="string"||!t?e.slots.default(n()):{default:()=>{var r,i;return(i=(r=e.slots).default)===null||i===void 0?void 0:i.call(r,n())}}:e.slots.default}function sl(t){if(Jc(t))return t._value}function Jc(t){return"_value"in t}function s0(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Mo(t){if(!Qs(t))return t;const e=t.target;if(_i(e.type)&&Jc(e))return sl(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(e0(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(sl);if(Hc(e)){const n=Array.from(e.options).find(r=>r.selected);return n?sl(n):e.value}return s0(e)}function Zc(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Ln(t)&&t._$$isNormalized?t:Ln(t)?Object.keys(t).reduce((n,r)=>{const i=l0(t[r]);return t[r]!==!1&&(n[r]=Xc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=a0(r);return i.name&&(n[i.name]=Xc(i.params)),n},e):e}function l0(t){return t===!0?[]:Array.isArray(t)||Ln(t)?t:[t]}function Xc(t){const e=n=>typeof n=="string"&&n[0]==="@"?c0(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const a0=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function c0(t){const e=n=>xt(n,t)||n[t];return e.__locatorRef=t,e}function d0(t){return Array.isArray(t)?t.filter(Xs):Et(t).filter(e=>Xs(t[e])).map(e=>t[e])}let u0=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const ar=()=>u0;async function Qc(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await f0(i,t)).errors;return{errors:s,valid:!s.length}}async function f0(t,e){if(Jt(t.rules)||Oo(t.rules))return p0(e,t.rules);if(Ge(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},l=Array.isArray(t.rules)?t.rules:[t.rules],c=l.length,d=[];for(let u=0;u<c;u++){const f=l[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:td(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Zc(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await m0(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function h0(t){return!!t&&t.name==="ValidationError"}function ed(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!h0(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,l)=>{const c=l.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...l.errors),s},{});return{errors:Object.values(o)}}}}}async function p0(t,e){const r=await(Jt(e)?e:ed(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function m0(t,e,n){const r=Gg(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=g0(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:td(o)}}function td(t){const e=ar().generateMessage;return e?e(t):"Field is invalid"}function g0(t,e){const n=r=>Xs(r)?r(e):r;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((r,i)=>(r[i]=n(t[i]),r),{})}async function y0(t,e){const r=await(Jt(t)?t:ed(t)).parse(De(e)),i={},o={};for(const s of r.errors){const l=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function b0(t,e,n){const i=Et(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await Qc(xt(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),l={},c={};for(const d of s)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c}}let nd=0;function k0(t,e){const{value:n,initialValue:r,setInitialValue:i}=w0(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&d(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:c,setErrors:d}=E0(),u=nd>=Number.MAX_SAFE_INTEGER?0:++nd,f=x0(n,r,c,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:c,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=a.computed(()=>o.errors);function l(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(a.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(a.unref(t),(f=c.touched)!==null&&f!==void 0?f:!1)),"initialValue"in c&&i(c.initialValue)}return{id:Array.isArray(o.id)?o.id[o.id.length-1]:o.id,path:t,value:n,errors:s,meta:o,initialValue:r,flags:o.__flags,setState:l}}function w0(t,e,n){const r=a.ref(a.unref(e));function i(){return n?xt(n.initialValues.value,a.unref(t),a.unref(r)):a.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(a.unref(t),d,!0)}const s=a.computed(i);if(!n)return{value:a.ref(i()),initialValue:s,setInitialValue:o};const l=v0(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return xt(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function v0(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:xt(e.values,a.unref(r),a.unref(n))}function x0(t,e,n,r){const i=a.computed(()=>{var s,l,c;return(c=(l=(s=a.toValue(r))===null||s===void 0?void 0:s.describe)===null||l===void 0?void 0:l.call(s).required)!==null&&c!==void 0?c:!1}),o=a.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!a.unref(n).length,initialValue:a.computed(()=>a.unref(e)),dirty:a.computed(()=>!mt(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function E0(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=il(e)}}}function rd(t){process.env.NODE_ENV!=="production"&&Ug({id:"vee-validate-devtools-plugin",label:"VeeValidate Plugin",packageName:"vee-validate",homepage:"https://vee-validate.logaretm.com/v4",app:t,logo:"https://vee-validate.logaretm.com/v4/logo.png"},_0)}const Oi={},Ti={};let yn;const Pr=r0(()=>{setTimeout(async()=>{await a.nextTick(),yn==null||yn.sendInspectorState(Rr),yn==null||yn.sendInspectorTree(Rr)},100)},100);function C0(t){const e=a.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Oi[t.formId]=Object.assign({},t),Oi[t.formId]._vm=e,a.onUnmounted(()=>{delete Oi[t.formId],Pr()}),Pr()}function S0(t){const e=a.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Ti[t.id]=Object.assign({},t),Ti[t.id]._vm=e,a.onUnmounted(()=>{delete Ti[t.id],Pr()}),Pr()}const Rr="vee-validate-inspector",Ct={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let We=null;function _0(t){yn=t,t.addInspector({id:Rr,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!We){console.error("There is not a valid selected vee-validate node or component");return}if(We.type==="field"){await We.field.validate();return}if(We.type==="form"){await We.form.validate();return}We.type==="pathState"&&await We.form.validateField(We.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!We){console.error("There is not a valid selected vee-validate node or component");return}if(We.type==="field"){We.field.resetField();return}We.type==="form"&&We.form.resetForm(),We.type==="pathState"&&We.form.resetField(We.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Rr)return;const n=Object.values(Oi),r=Object.values(Ti);e.rootNodes=[...n.map(O0),...r.map(i=>N0(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Rr||n.currentTab!==`custom-inspector:${Rr}`)return;const{form:r,field:i,state:o,type:s}=M0(e.nodeId);if(r&&s==="form"){e.state=A0(r),We={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=od(o),We={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=od({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),We={field:i,type:"field"};return}We=null})}function O0(t){const{textColor:e,bgColor:n}=sd(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{gn(r,a.unref(s.path),T0(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Ln(s)?{id:`${l.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...l,d]))}:Array.isArray(s)?{id:`${l.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...l,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:ll(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Ct.white,backgroundColor:Ct.unknown}]}}function T0(t,e){return{id:ll(e,t),label:a.unref(t.path),tags:id(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function N0(t,e){return{id:ll(e,t),label:a.unref(t.name),tags:id(!1,1,t.type,t.meta.valid,e)}}function id(t,e,n,r,i){const{textColor:o,bgColor:s}=sd(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Ct.black,backgroundColor:Ct.gray},n==="checkbox"?{label:"Checkbox",textColor:Ct.white,backgroundColor:Ct.blue}:void 0,n==="radio"?{label:"Radio",textColor:Ct.white,backgroundColor:Ct.purple}:void 0,t?{label:"Multiple",textColor:Ct.black,backgroundColor:Ct.orange}:void 0].filter(Boolean)}function ll(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:a.unref(e==null?void 0:e.name):"",i={f:t==null?void 0:t.formId,ff:r,type:n};return btoa(encodeURIComponent(JSON.stringify(i)))}function M0(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Oi[e.f];if(!n&&e.ff){const i=Ti[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function od(t){return{"Field state":[{key:"errors",value:t.errors},{key:"initialValue",value:t.initialValue},{key:"currentValue",value:t.value},{key:"touched",value:t.touched},{key:"dirty",value:t.dirty},{key:"valid",value:t.valid}]}}function A0(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:Et(e.value).reduce((l,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(l[c]=u),l},{})}]}}function sd(t){return{bgColor:t?Ct.success:Ct.error,textColor:t?Ct.black:Ct.white}}function D0(t,e,n){return _i(n==null?void 0:n.type)?B0(t,e,n):ld(t,e,n)}function ld(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:l,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=L0(n),g=f?nl(Si):void 0,y=m||g,k=a.computed(()=>Ci(a.toValue(t))),x=a.computed(()=>{if(a.toValue(y==null?void 0:y.schema))return;const V=a.unref(e);return Oo(V)||Jt(V)||Ge(V)||Array.isArray(V)?V:Zc(V)}),w=!Ge(x.value)&&Jt(a.toValue(e)),{id:b,value:C,initialValue:v,meta:O,setState:D,errors:A,flags:I}=k0(k,{modelValue:r,form:y,bails:o,label:c,type:s,validate:x.value?S:void 0,schema:w?e:void 0}),L=a.computed(()=>A.value[0]);p&&I0({value:C,prop:p,handleChange:B,shouldValidate:()=>d&&!I.pendingReset});const R=(q,V=!1)=>{O.touched=!0,V&&H()};async function K(q){var V,ue;if(y!=null&&y.validateSchema){const{results:ce}=await y.validateSchema(q);return(V=ce[a.toValue(k)])!==null&&V!==void 0?V:{valid:!0,errors:[]}}return x.value?Qc(C.value,x.value,{name:a.toValue(k),label:a.toValue(c),values:(ue=y==null?void 0:y.values)!==null&&ue!==void 0?ue:{},bails:o}):{valid:!0,errors:[]}}const H=rl(async()=>(O.pending=!0,O.validated=!0,K("validated-only")),q=>(I.pendingUnmount[W.id]||(D({errors:q.errors}),O.pending=!1,O.valid=q.valid),q)),$=rl(async()=>K("silent"),q=>(O.valid=q.valid,q));function S(q){return(q==null?void 0:q.mode)==="silent"?$():H()}function B(q,V=!0){const ue=Mo(q);te(ue,V)}a.onMounted(()=>{if(i)return H();(!y||!y.validateSchema)&&$()});function z(q){O.touched=q}function X(q){var V;const ue=q&&"value"in q?q.value:v.value;D({value:De(ue),initialValue:De(ue),touched:(V=q==null?void 0:q.touched)!==null&&V!==void 0?V:!1,errors:(q==null?void 0:q.errors)||[]}),O.pending=!1,O.validated=!1,$()}const j=a.getCurrentInstance();function te(q,V=!0){C.value=j&&p?i0(q,j.props.modelModifiers):q,(V?H:$)()}function re(q){D({errors:Array.isArray(q)?q:[q]})}const P=a.computed({get(){return C.value},set(q){te(q,d)}}),W={id:b,name:k,label:c,value:P,meta:O,errors:A,errorMessage:L,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:X,handleReset:()=>X(),validate:S,handleChange:B,handleBlur:R,setState:D,setTouched:z,setErrors:re,setValue:te};if(a.provide(jc,W),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(q,V)=>{mt(q,V)||(O.validated?H():$())},{deep:!0}),process.env.NODE_ENV!=="production"&&(W._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:A.value},O),{value:C.value}),Pr,{deep:!0}),y||S0(W)),!y)return W;const G=a.computed(()=>{const q=x.value;return!q||Ge(q)||Oo(q)||Jt(q)||Array.isArray(q)?{}:Object.keys(q).reduce((V,ue)=>{const ce=d0(q[ue]).map(we=>we.__locatorRef).reduce((we,Se)=>{const Be=xt(y.values,Se)||y.values[Se];return Be!==void 0&&(we[Se]=Be),we},{});return Object.assign(V,ce),V},{})});return a.watch(G,(q,V)=>{if(!Object.keys(q).length)return;!mt(q,V)&&(O.validated?H():$())}),a.onBeforeUnmount(()=>{var q;const V=(q=a.toValue(W.keepValueOnUnmount))!==null&&q!==void 0?q:a.toValue(y.keepValuesOnUnmount),ue=a.toValue(k);if(V||!y||I.pendingUnmount[W.id]){y==null||y.removePathState(ue,b);return}I.pendingUnmount[W.id]=!0;const ce=y.getPathState(ue);if(Array.isArray(ce==null?void 0:ce.id)&&(ce!=null&&ce.multiple)?ce!=null&&ce.id.includes(W.id):(ce==null?void 0:ce.id)===W.id){if(ce!=null&&ce.multiple&&Array.isArray(ce.value)){const Se=ce.value.findIndex(Be=>mt(Be,a.toValue(W.checkedValue)));if(Se>-1){const Be=[...ce.value];Be.splice(Se,1),y.setFieldValue(ue,Be)}Array.isArray(ce.id)&&ce.id.splice(ce.id.indexOf(W.id),1)}else y.unsetPathValue(a.toValue(k));y.removePathState(ue,b)}}),W}function L0(t){const e=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!(t!=null&&t.syncVModel),r=typeof(t==null?void 0:t.syncVModel)=="string"?t.syncVModel:(t==null?void 0:t.modelPropName)||"modelValue",i=n&&!("initialValue"in(t||{}))?al(a.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,l=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:l})}function B0(t,e,n){const r=n!=null&&n.standalone?void 0:nl(Si),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(l){const c=l.handleChange,d=a.computed(()=>{const f=a.toValue(l.value),h=a.toValue(i);return Array.isArray(f)?f.findIndex(p=>mt(p,h))>=0:mt(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&l.validate();return}const g=a.toValue(t),y=r==null?void 0:r.getPathState(g),k=Mo(f);let x=(m=a.toValue(i))!==null&&m!==void 0?m:k;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?x=Kc(xt(r.values,g)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=Kc(a.toValue(l.value),x,a.toValue(o))),c(x,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(ld(t,e,n))}function I0({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=a.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(a.watch(e,l=>{mt(l,al(i,o))||i.emit(s,l)}),a.watch(()=>al(i,o),l=>{if(l===_o&&e.value===void 0)return;const c=l===_o?void 0:l;mt(c,e.value)||n(c,r())}))}function al(t,e){if(t)return t.props[e]}const $0=a.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>ar().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:_o},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(t,e){const n=a.toRef(t,"rules"),r=a.toRef(t,"name"),i=a.toRef(t,"label"),o=a.toRef(t,"uncheckedValue"),s=a.toRef(t,"keepValue"),{errors:l,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:k,setErrors:x}=D0(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:P0(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),w=function(A,I=!0){f(A,I)},b=a.computed(()=>{const{validateOnInput:D,validateOnChange:A,validateOnBlur:I,validateOnModelUpdate:L}=V0(t);function R(S){h(S,I),Ge(e.attrs.onBlur)&&e.attrs.onBlur(S)}function K(S){w(S,D),Ge(e.attrs.onInput)&&e.attrs.onInput(S)}function H(S){w(S,A),Ge(e.attrs.onChange)&&e.attrs.onChange(S)}const $={name:t.name,onBlur:R,onInput:K,onChange:H};return $["onUpdate:modelValue"]=S=>w(S,L),$}),C=a.computed(()=>{const D=Object.assign({},b.value);_i(e.attrs.type)&&k&&(D.checked=k.value);const A=ad(t,e);return n0(A,e.attrs)&&(D.value=c.value),D}),v=a.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:c.value}));function O(){return{field:C.value,componentField:v.value,value:c.value,meta:y,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:w,handleInput:D=>w(D,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:c,meta:y,errors:l,errorMessage:d,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const D=a.resolveDynamicComponent(ad(t,e)),A=ol(D,e,O);return D?a.h(D,Object.assign(Object.assign({},e.attrs),C.value),A):A}}});function ad(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function V0(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=ar();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:l,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function P0(t,e){return _i(e.attrs.type)?Uc(t,"modelValue")?t.modelValue:void 0:Uc(t,"modelValue")?t.modelValue:e.attrs.value}const cr=$0;let R0=0;const Ao=["bails","fieldsCount","id","multiple","type","validate"];function cd(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},a.toValue(e)),r=a.unref(t==null?void 0:t.validationSchema);return r&&Jt(r)&&Ge(r.cast)?De(r.cast(n)||{}):De(n)}function F0(t){var e;const n=R0++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(cd(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=o0(()=>{f.value=d.value.reduce((T,M)=>(T[Ci(a.toValue(M.path))]=M,T),{})});function p(T,M){const Y=S(T);if(!Y){typeof T=="string"&&(u.value[Ci(T)]=il(M));return}if(typeof T=="string"){const ie=Ci(T);u.value[ie]&&delete u.value[ie]}Y.errors=il(M),Y.valid=!Y.errors.length}function m(T){Et(T).forEach(M=>{p(M,T[M])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=a.computed(()=>{const T=d.value.reduce((M,Y)=>(Y.errors.length&&(M[Y.path]=Y.errors),M),{});return Object.assign(Object.assign({},u.value),T)}),y=a.computed(()=>Et(g.value).reduce((T,M)=>{const Y=g.value[M];return Y!=null&&Y.length&&(T[M]=Y[0]),T},{})),k=a.computed(()=>d.value.reduce((T,M)=>(T[M.path]={name:M.path||"",label:M.label||""},T),{})),x=a.computed(()=>d.value.reduce((T,M)=>{var Y;return T[M.path]=(Y=M.bails)!==null&&Y!==void 0?Y:!0,T},{})),w=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:C,originalInitialValues:v,setInitialValues:O}=j0(d,c,t),D=z0(d,c,v,y),A=a.computed(()=>d.value.reduce((T,M)=>{const Y=xt(c,M.path);return gn(T,M.path,Y),T},{})),I=t==null?void 0:t.validationSchema;function L(T,M){var Y,ie;const fe=a.computed(()=>xt(C.value,a.toValue(T))),N=f.value[a.toValue(T)],ee=(M==null?void 0:M.type)==="checkbox"||(M==null?void 0:M.type)==="radio";if(N&&ee){N.multiple=!0;const vt=r++;return Array.isArray(N.id)?N.id.push(vt):N.id=[N.id,vt],N.fieldsCount++,N.__flags.pendingUnmount[vt]=!1,N}const se=a.computed(()=>xt(c,a.toValue(T))),me=a.toValue(T),ye=z.findIndex(vt=>vt===me);ye!==-1&&z.splice(ye,1);const ve=a.computed(()=>{var vt,Ft,$r,lr;const mn=a.toValue(I);if(Jt(mn))return(Ft=(vt=mn.describe)===null||vt===void 0?void 0:vt.call(mn,a.toValue(T)).required)!==null&&Ft!==void 0?Ft:!1;const So=a.toValue(M==null?void 0:M.schema);return Jt(So)&&(lr=($r=So.describe)===null||$r===void 0?void 0:$r.call(So).required)!==null&&lr!==void 0?lr:!1}),Ae=r++,He=a.reactive({id:Ae,path:T,touched:!1,pending:!1,valid:!0,validated:!!(!((Y=w[me])===null||Y===void 0)&&Y.length),required:ve,initialValue:fe,errors:a.shallowRef([]),bails:(ie=M==null?void 0:M.bails)!==null&&ie!==void 0?ie:!1,label:M==null?void 0:M.label,type:(M==null?void 0:M.type)||"default",value:se,multiple:!1,__flags:{pendingUnmount:{[Ae]:!1},pendingReset:!1},fieldsCount:1,validate:M==null?void 0:M.validate,dirty:a.computed(()=>!mt(a.unref(se),a.unref(fe)))});return d.value.push(He),f.value[me]=He,h(),y.value[me]&&!w[me]&&a.nextTick(()=>{pt(me,{mode:"silent"})}),a.isRef(T)&&a.watch(T,vt=>{h();const Ft=De(se.value);f.value[vt]=He,a.nextTick(()=>{gn(c,vt,Ft)})}),He}const R=Gc(ae,5),K=Gc(ae,5),H=rl(async T=>await(T==="silent"?R():K()),(T,[M])=>{const Y=Et(q.errorBag.value),fe=[...new Set([...Et(T.results),...d.value.map(N=>N.path),...Y])].sort().reduce((N,ee)=>{var se;const me=ee,ye=S(me)||B(me),ve=((se=T.results[me])===null||se===void 0?void 0:se.errors)||[],Ae=a.toValue(ye==null?void 0:ye.path)||me,He=H0({errors:ve,valid:!ve.length},N.results[Ae]);return N.results[Ae]=He,He.valid||(N.errors[Ae]=He.errors[0]),ye&&u.value[Ae]&&delete u.value[Ae],ye?(ye.valid=He.valid,M==="silent"||M==="validated-only"&&!ye.validated||p(ye,He.errors),N):(p(Ae,ve),N)},{valid:T.valid,results:{},errors:{}});return T.values&&(fe.values=T.values),Et(fe.results).forEach(N=>{var ee;const se=S(N);se&&M!=="silent"&&(M==="validated-only"&&!se.validated||p(se,(ee=fe.results[N])===null||ee===void 0?void 0:ee.errors))}),fe});function $(T){d.value.forEach(T)}function S(T){const M=typeof T=="string"?Ci(T):T;return typeof M=="string"?f.value[M]:M}function B(T){return d.value.filter(Y=>T.startsWith(Y.path)).reduce((Y,ie)=>Y?ie.path.length>Y.path.length?ie:Y:ie,void 0)}let z=[],X;function j(T){return z.push(T),X||(X=a.nextTick(()=>{[...z].sort().reverse().forEach(Y=>{qc(c,Y)}),z=[],X=null})),X}function te(T){return function(Y,ie){return function(N){return N instanceof Event&&(N.preventDefault(),N.stopPropagation()),$(ee=>ee.touched=!0),i.value=!0,s.value++,at().then(ee=>{const se=De(c);if(ee.valid&&typeof Y=="function"){const me=De(A.value);let ye=T?me:se;return ee.values&&(ye=ee.values),Y(ye,{evt:N,controlledValues:me,setErrors:m,setFieldError:p,setTouched:Ee,setFieldTouched:Se,setValues:ce,setFieldValue:V,resetForm:lt,resetField:At})}!ee.valid&&typeof ie=="function"&&ie({values:se,evt:N,errors:ee.errors,results:ee.results})}).then(ee=>(i.value=!1,ee),ee=>{throw i.value=!1,ee})}}}const P=te(!1);P.withControlled=te(!0);function W(T,M){const Y=d.value.findIndex(fe=>fe.path===T&&(Array.isArray(fe.id)?fe.id.includes(M):fe.id===M)),ie=d.value[Y];if(!(Y===-1||!ie)){if(a.nextTick(()=>{pt(T,{mode:"silent",warn:!1})}),ie.multiple&&ie.fieldsCount&&ie.fieldsCount--,Array.isArray(ie.id)){const fe=ie.id.indexOf(M);fe>=0&&ie.id.splice(fe,1),delete ie.__flags.pendingUnmount[M]}(!ie.multiple||ie.fieldsCount<=0)&&(d.value.splice(Y,1),E(T),h(),delete f.value[T])}}function G(T){Et(f.value).forEach(M=>{M.startsWith(T)&&delete f.value[M]}),d.value=d.value.filter(M=>!M.path.startsWith(T)),a.nextTick(()=>{h()})}const q={formId:n,values:c,controlledValues:A,errorBag:g,errors:y,schema:I,submitCount:s,meta:D,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:b,validateSchema:a.unref(I)?H:void 0,validate:at,setFieldError:p,validateField:pt,setFieldValue:V,setValues:ce,setErrors:m,setFieldTouched:Se,setTouched:Ee,resetForm:lt,resetField:At,handleSubmit:P,useFieldModel:Te,defineInputBinds:F,defineComponentBinds:Q,defineField:Oe,stageInitialValue:_,unsetInitialValue:E,setFieldInitialValue:U,createPathState:L,getPathState:S,unsetPathValue:j,removePathState:W,initialValues:C,getAllPathStates:()=>d.value,destroyPath:G,isFieldTouched:Be,isFieldDirty:je,isFieldValid:ne};function V(T,M,Y=!0){const ie=De(M),fe=typeof T=="string"?T:T.path;S(fe)||L(fe),gn(c,fe,ie),Y&&pt(fe)}function ue(T,M=!0){Et(c).forEach(Y=>{delete c[Y]}),Et(T).forEach(Y=>{V(Y,T[Y],!1)}),M&&at()}function ce(T,M=!0){Ei(c,T),l.forEach(Y=>Y&&Y.reset()),M&&at()}function we(T,M){const Y=S(a.toValue(T))||L(T);return a.computed({get(){return Y.value},set(ie){var fe;const N=a.toValue(T);V(N,ie,(fe=a.toValue(M))!==null&&fe!==void 0?fe:!1)}})}function Se(T,M){const Y=S(T);Y&&(Y.touched=M)}function Be(T){const M=S(T);return M?M.touched:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.touched)}function je(T){const M=S(T);return M?M.dirty:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.dirty)}function ne(T){const M=S(T);return M?M.valid:d.value.filter(Y=>Y.path.startsWith(T)).every(Y=>Y.valid)}function Ee(T){if(typeof T=="boolean"){$(M=>{M.touched=T});return}Et(T).forEach(M=>{Se(M,!!T[M])})}function At(T,M){var Y;const ie=M&&"value"in M?M.value:xt(C.value,T),fe=S(T);fe&&(fe.__flags.pendingReset=!0),U(T,De(ie),!0),V(T,ie,!1),Se(T,(Y=M==null?void 0:M.touched)!==null&&Y!==void 0?Y:!1),p(T,(M==null?void 0:M.errors)||[]),a.nextTick(()=>{fe&&(fe.__flags.pendingReset=!1)})}function lt(T,M){let Y=De(T!=null&&T.values?T.values:v.value);Y=M!=null&&M.force?Y:Ei(v.value,Y),Y=Jt(I)&&Ge(I.cast)?I.cast(Y):Y,O(Y),$(ie=>{var fe;ie.__flags.pendingReset=!0,ie.validated=!1,ie.touched=((fe=T==null?void 0:T.touched)===null||fe===void 0?void 0:fe[ie.path])||!1,V(ie.path,xt(Y,ie.path),!1),p(ie.path,void 0)}),M!=null&&M.force?ue(Y,!1):ce(Y,!1),m((T==null?void 0:T.errors)||{}),s.value=(T==null?void 0:T.submitCount)||0,a.nextTick(()=>{at({mode:"silent"}),$(ie=>{ie.__flags.pendingReset=!1})})}async function at(T){const M=(T==null?void 0:T.mode)||"force";if(M==="force"&&$(N=>N.validated=!0),q.validateSchema)return q.validateSchema(M);o.value=!0;const Y=await Promise.all(d.value.map(N=>N.validate?N.validate(T).then(ee=>({key:N.path,valid:ee.valid,errors:ee.errors})):Promise.resolve({key:N.path,valid:!0,errors:[]})));o.value=!1;const ie={},fe={};for(const N of Y)ie[N.key]={valid:N.valid,errors:N.errors},N.errors.length&&(fe[N.key]=N.errors[0]);return{valid:Y.every(N=>N.valid),results:ie,errors:fe}}async function pt(T,M){var Y;const ie=S(T);if(ie&&(M==null?void 0:M.mode)!=="silent"&&(ie.validated=!0),I){const{results:N}=await H((M==null?void 0:M.mode)||"validated-only");return N[T]||{errors:[],valid:!0}}return ie!=null&&ie.validate?ie.validate(M):(!ie&&((Y=M==null?void 0:M.warn)!==null&&Y!==void 0?Y:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${T} was not found`),Promise.resolve({errors:[],valid:!0}))}function E(T){qc(C.value,T)}function _(T,M,Y=!1){U(T,M),gn(c,T,M),Y&&!(t!=null&&t.initialValues)&&gn(v.value,T,De(M))}function U(T,M,Y=!1){gn(C.value,T,De(M)),Y&&gn(v.value,T,De(M))}async function ae(){const T=a.unref(I);if(!T)return{valid:!0,results:{},errors:{}};o.value=!0;const M=Oo(T)||Jt(T)?await y0(T,c):await b0(T,c,{names:k.value,bailsMap:x.value});return o.value=!1,M}const Me=P((T,{evt:M})=>{Wc(M)&&M.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&Ee(t.initialTouched),t!=null&&t.validateOnMount){at();return}q.validateSchema&&q.validateSchema("silent")}),a.isRef(I)&&a.watch(I,()=>{var T;(T=q.validateSchema)===null||T===void 0||T.call(q,"validated-only")}),a.provide(Si,q),process.env.NODE_ENV!=="production"&&(C0(q),a.watch(()=>Object.assign(Object.assign({errors:g.value},D.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Pr,{deep:!0}));function Oe(T,M){const Y=Ge(M)||M==null?void 0:M.label,ie=S(a.toValue(T))||L(T,{label:Y}),fe=()=>Ge(M)?M(No(ie,Ao)):M||{};function N(){var ve;ie.touched=!0,((ve=fe().validateOnBlur)!==null&&ve!==void 0?ve:ar().validateOnBlur)&&pt(ie.path)}function ee(){var ve;((ve=fe().validateOnInput)!==null&&ve!==void 0?ve:ar().validateOnInput)&&a.nextTick(()=>{pt(ie.path)})}function se(){var ve;((ve=fe().validateOnChange)!==null&&ve!==void 0?ve:ar().validateOnChange)&&a.nextTick(()=>{pt(ie.path)})}const me=a.computed(()=>{const ve={onChange:se,onInput:ee,onBlur:N};return Ge(M)?Object.assign(Object.assign({},ve),M(No(ie,Ao)).props||{}):M!=null&&M.props?Object.assign(Object.assign({},ve),M.props(No(ie,Ao))):ve});return[we(T,()=>{var ve,Ae,He;return(He=(ve=fe().validateOnModelUpdate)!==null&&ve!==void 0?ve:(Ae=ar())===null||Ae===void 0?void 0:Ae.validateOnModelUpdate)!==null&&He!==void 0?He:!0}),me]}function Te(T){return Array.isArray(T)?T.map(M=>we(M,!0)):we(T)}function F(T,M){const[Y,ie]=Oe(T,M);function fe(){ie.value.onBlur()}function N(se){const me=Mo(se);V(a.toValue(T),me,!1),ie.value.onInput()}function ee(se){const me=Mo(se);V(a.toValue(T),me,!1),ie.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},ie.value),{onBlur:fe,onInput:N,onChange:ee,value:Y.value}))}function Q(T,M){const[Y,ie]=Oe(T,M),fe=S(a.toValue(T));function N(ee){Y.value=ee}return a.computed(()=>{const ee=Ge(M)?M(No(fe,Ao)):M||{};return Object.assign({[ee.model||"modelValue"]:Y.value,[`onUpdate:${ee.model||"modelValue"}`]:N},ie.value)})}return Object.assign(Object.assign({},q),{values:a.readonly(c),handleReset:()=>lt(),submitForm:Me})}function z0(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!mt(e,a.unref(n)));function s(){const c=t.value;return Et(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const l=a.reactive(s());return a.watchEffect(()=>{const c=s();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(n)},l),{valid:l.valid&&!Et(r.value).length,dirty:o.value}))}function j0(t,e,n){const r=cd(n),i=a.ref(r),o=a.ref(De(r));function s(l,c=!1){i.value=Ei(De(i.value)||{},De(l)),o.value=Ei(De(o.value)||{},De(l)),c&&t.value.forEach(d=>{if(d.touched)return;const f=xt(i.value,d.path);gn(e,d.path,De(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function H0(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const W0=a.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:null,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(t,e){const n=a.toRef(t,"validationSchema"),r=a.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:l,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetField:O}=F0({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),D=y((S,{evt:B})=>{Wc(B)&&B.target.submit()},t.onInvalidSubmit),A=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):D;function I(S){Qs(S)&&S.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function L(S,B){return y(typeof S=="function"&&!B?S:B,t.onInvalidSubmit)(S)}function R(){return De(s)}function K(){return De(l.value)}function H(){return De(i.value)}function $(){return{meta:l.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:c.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:L,handleReset:m,submitForm:D,setErrors:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetForm:g,resetField:O,getValues:R,getMeta:K,getErrors:H}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetForm:g,validate:h,validateField:p,resetField:O,getValues:R,getMeta:K,getErrors:H,values:s,meta:l,errors:i}),function(){const B=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,z=ol(B,e,$);if(!B)return z;const X=B==="form"?{novalidate:!0}:{};return a.h(B,Object.assign(Object.assign(Object.assign({},X),e.attrs),{onSubmit:A,onReset:I}),z)}}}),U0=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Si,void 0),r=a.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?a.resolveDynamicComponent(t.as):t.as,s=ol(o,e,i),l=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?a.h(o||"span",l,r.value):a.h(o,l,s)}}});function Y0(t){const e=nl(Si),n=t?void 0:a.inject(jc);return a.computed(()=>t?e==null?void 0:e.errors.value[a.toValue(t)]:n==null?void 0:n.errorMessage.value)}Gt("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),Gt("email",t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid email"}),Gt("strong_password",t=>t?t.indexOf(" ")>-1?"Password shouldn't contain space":t.length<8||t.length>30?"Password must be between 8 and 30 characters":t.match(/[a-z]/)===null||t.match(/[A-Z]/)===null||t.match(/\d/)===null?"Password must contain at least one uppercase letter, one lowercase letter and one number digit":!0:"Password is required"),Gt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),Gt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),Gt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),Gt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),Gt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),Gt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),Gt("url",t=>{var e=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid URL"}),Gt("number",t=>parseFloat(t)?!0:"This field must be a number");const be=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},q0={},K0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},G0=[a.createElementVNode("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"},null,-1)];function J0(t,e){return a.openBlock(),a.createElementBlock("svg",K0,G0)}const Z0=be(q0,[["render",J0]]),X0={},Q0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},ey=[a.createElementVNode("path",{d:"M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"},null,-1)];function ty(t,e){return a.openBlock(),a.createElementBlock("svg",Q0,ey)}const ny=be(X0,[["render",ty]]),ry={class:"relative"},Fr=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",ry,[a.createVNode(Z0,{class:"absolute opacity-25"}),a.createVNode(ny,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let he={theme:"wpic-tools",popoverTarget:"body"};const iy=["is","type","disabled"],oy={key:0,class:"absolute inset-0 flex justify-center items-center"},sy={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},ly=["onClick"],Ni=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled:Boolean,highlightDisabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object],actions:{}},setup(t){const e=t,n=a.ref(null),r=a.ref(null),i=a.ref(!1),o=a.computed(()=>e.to?"router-link":"div"),s=k=>{r.value&&!r.value.contains(k.target)&&n.value&&!n.value.contains(k.target)&&(i.value=!1)};a.onMounted(()=>{document.addEventListener("click",s)}),a.onUnmounted(()=>{document.removeEventListener("click",s)});const l={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},c={pmi:"","wpic-tools":"border-none ring-1 ring-black/5 dark:ring-white/10 bg-transparent text-iron-700 disabled:text-iron-700/50 enabled:hover:bg-iron-900/5 enabled:active:bg-iron-200 enabled:active:shadow-inner dark:enabled:border-iron-900 dark:disabled:border-iron-900 dark:text-iron-200 dark:enabled:hover:bg-iron-900 dark:enabled:active:bg-iron-930 dark:disabled:text-iron-400/50"},d={pmi:"","wpic-tools":"bg-transparent text-red-600 disabled:text-red-600/50 enabled:hover:bg-red-500/5 enabled:active:bg-red-100 enabled:active:shadow-inner dark:text-red-400 dark:enabled:hover:bg-red-500/10 dark:enabled:active:bg-red-500/25 dark:disabled:text-red-500/50"},u={pmi:"bg-violet-800 border border-violet-800 focus:bg-violet-800 text-white disabled:bg-zinc-100 disabled:text-zinc-400 disabled:border-zinc-100 enabled:hover:bg-violet-900 enabled:hover:border-violet-900 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b bg-wpic-600 text-white disabled:text-white/50 border-none shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-wpic-500 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:bg-wpic-700 dark:enabled:active:shadow-inner dark:enabled:hover:bg-wpic-600"},f={pmi:"bg-white text-violet-800 border-zinc-400 dark:border-zinc-700 dark:text-zinc-200 dark:bg-zinc-700 dark:hover:bg-zinc-600 dark:hover:border-zinc-600 disabled:text-zinc-400 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b bg-iron-100 text-iron-800 disabled:text-iron-800/50 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-iron-200 enabled:active:bg-iron-300 enabled:active:text-iron-800/80 dark:enabled:active:text-iron-200/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200 dark:bg-iron-900 dark:disabled:text-iron-200/50 dark:enabled:active:shadow-inner dark:enabled:hover:bg-iron-800 dark:enabled:active:bg-iron-700"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b bg-red-500 disabled:text-red-600/50 border-red-500 enabled:hover:bg-red-400 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:hover:border-red-600 enabled:active:shadow-inner enabled:active:text-white/80 enabled:active:bg-red-700 enabled:active:border-red-700 dark:bg-red-400/70 dark:border-red-400/70"},p={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":" text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/10 shadow-xs enabled:hover:bg-gray-50 enabled:active:text-gray-950/60 bg-white dark:ring-1 dark:disabled:text-white/50 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] enabled:active:shadow-inner dark:hover:bg-white/10 dark:enabled:active:text-white/80 dark:disabled:text-iron-200/50 dark:text-iron-200 dark:active:shadow-inner dark:bg-iron-900 dark:hover:bg-iron-800 dark:active:bg-iron-700"},m={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},g={pmi:"text-red-600 hover:text-red-500 hover:underline","wpic-tools":"text-red-600 disabled:text-red-600/50 hover:text-red-500 dark:text-red-400 dark:hover:text-red-500 hover:underline"},y={pmi:"hover:text-violet-800 hover:underline","wpic-tools":"dark:text-gray-200 hover:text-lime-800 hover:underline"};return(k,x)=>{var w;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:x[0]||(x[0]=b=>{var C;return(C=t.actions)!=null&&C.length?i.value=!i.value:null}),class:a.normalizeClass([{"cursor-pointer":!t.disabled&&!t.loading,"active:outline active:outline-2 active:outline-offset-4":!t.disabled&&!t.loading&&t.outlining,"cursor-not-allowed":t.disabled&&!t.hideDisabled,"":t.outline&&!t.plain,"ring-0!":!t.outline,[`${l[a.unref(he).theme]}`]:!0,[`${u[a.unref(he).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(he).theme]}`]:t.secondary,[`${p[a.unref(he).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(he).theme]}`]:t.primary&&t.plain,[`${y[a.unref(he).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(he).theme]}`]:t.colorless,[`${h[a.unref(he).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[a.unref(he).theme]}`]:t.destructive&&t.plain,[`${d[a.unref(he).theme]}`]:t.destructive&&t.colorless,"text-violet-500! dark:!text-violet-500/75":t.highlightDisabled&&t.disabled,"bg-zinc-50 border-violet-800 text-violet-800":t.primary&&t.inverse,"hover:bg-white":t.primary&&t.inverse&&!t.disabled&&!t.loading,"w-full":t.full,"text-opacity-50":t.disabled,"h-auto":t.plain,"rounded-sm":!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-hidden relative inline-flex justify-center items-center"])},[t.loading?(a.openBlock(),a.createElementBlock("div",oy,[a.createVNode(Fr,{class:"w-6 h-6"})])):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.value),{to:t.to,class:a.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{medium:t.medium,small:t.small,"opacity-0":t.loading,"px-2":!!(t.small&&!t.plain),"px-3":!!(t.medium&&!t.plain),"px-4":!t.small&&!t.medium&&!t.plain,"px-0! aspect-square":t.square}])},{default:a.withCtx(()=>[a.renderSlot(k.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(w=t.actions)!=null&&w.length&&i.value?(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[a.createElementVNode("div",sy,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,b=>(a.openBlock(),a.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(b.label),9,ly))),256))])],512)):a.createCommentVNode("",!0)],10,iy)}}}),ay=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[a.unref(he).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),cy={name:"WpicInputGroup"},dy={class:"wpic-input-group flex w-full"};function uy(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",dy,[a.renderSlot(t.$slots,"default")])}const fy=be(cy,[["render",uy]]),hy=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=a.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(l,c)=>(a.openBlock(),a.createBlock(a.unref(W0),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Mi=Math.min,zr=Math.max,Do=Math.round,Bn=t=>({x:t,y:t}),py={left:"right",right:"left",bottom:"top",top:"bottom"},my={start:"end",end:"start"};function cl(t,e,n){return zr(t,Mi(e,n))}function Ai(t,e){return typeof t=="function"?t(e):t}function dr(t){return t.split("-")[0]}function Di(t){return t.split("-")[1]}function dd(t){return t==="x"?"y":"x"}function dl(t){return t==="y"?"height":"width"}function Lo(t){return["top","bottom"].includes(dr(t))?"y":"x"}function ul(t){return dd(Lo(t))}function gy(t,e,n){n===void 0&&(n=!1);const r=Di(t),i=ul(t),o=dl(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Bo(s)),[s,Bo(s)]}function yy(t){const e=Bo(t);return[fl(t),e,fl(e)]}function fl(t){return t.replace(/start|end/g,e=>my[e])}function by(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function ky(t,e,n,r){const i=Di(t);let o=by(dr(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(fl)))),o}function Bo(t){return t.replace(/left|right|bottom|top/g,e=>py[e])}function wy(t){return{top:0,right:0,bottom:0,left:0,...t}}function ud(t){return typeof t!="number"?wy(t):{top:t,right:t,bottom:t,left:t}}function Io(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function fd(t,e,n){let{reference:r,floating:i}=t;const o=Lo(e),s=ul(e),l=dl(s),c=dr(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(c){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Di(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const vy=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=fd(d,r,c),h=r,p={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:k}=l[g],{x,y:w,data:b,reset:C}=await k({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=x??u,f=w??f,p={...p,[y]:{...p[y],...b}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):C.rects),{x:u,y:f}=fd(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function hd(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ai(e,t),m=ud(p),y=l[h?f==="floating"?"reference":"floating":f],k=Io(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),b=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Io(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(k.top-C.top+m.top)/b.y,bottom:(C.bottom-k.bottom+m.bottom)/b.y,left:(k.left-C.left+m.left)/b.x,right:(C.right-k.right+m.right)/b.x}}const xy=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:c}=e,{element:d,padding:u=0}=Ai(t,e)||{};if(d==null)return{};const f=ud(u),h={x:n,y:r},p=ul(i),m=dl(p),g=await s.getDimensions(d),y=p==="y",k=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],C=h[p]-o.reference[p],v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let O=v?v[w]:0;(!O||!await(s.isElement==null?void 0:s.isElement(v)))&&(O=l.floating[w]||o.floating[m]);const D=b/2-C/2,A=O/2-g[m]/2-1,I=Mi(f[k],A),L=Mi(f[x],A),R=I,K=O-g[m]-L,H=O/2-g[m]/2+D,$=cl(R,H,K),S=!c.arrow&&Di(i)!=null&&H!==$&&o.reference[m]/2-(H<R?I:L)-g[m]/2<0,B=S?H<R?H-R:H-K:0;return{[p]:h[p]+B,data:{[p]:$,centerOffset:H-$-B,...S&&{alignmentOffset:B}},reset:S}}}),Ey=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Ai(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=dr(i),x=dr(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),b=h||(x||!g?[Bo(l)]:yy(l));!h&&m!=="none"&&b.push(...ky(l,g,m,w));const C=[l,...b],v=await hd(e,y),O=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&O.push(v[k]),f){const R=gy(i,s,w);O.push(v[R[0]],v[R[1]])}if(D=[...D,{placement:i,overflows:O}],!O.every(R=>R<=0)){var A,I;const R=(((A=o.flip)==null?void 0:A.index)||0)+1,K=C[R];if(K)return{data:{index:R,overflows:D},reset:{placement:K}};let H=(I=D.filter($=>$.overflows[0]<=0).sort(($,S)=>$.overflows[1]-S.overflows[1])[0])==null?void 0:I.placement;if(!H)switch(p){case"bestFit":{var L;const $=(L=D.map(S=>[S.placement,S.overflows.filter(B=>B>0).reduce((B,z)=>B+z,0)]).sort((S,B)=>S[1]-B[1])[0])==null?void 0:L[0];$&&(H=$);break}case"initialPlacement":H=l;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function Cy(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=dr(n),l=Di(n),c=Lo(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=Ai(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Sy=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=e,c=await Cy(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},_y=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:y=>{let{x:k,y:x}=y;return{x:k,y:x}}},...c}=Ai(t,e),d={x:n,y:r},u=await hd(e,c),f=Lo(dr(i)),h=dd(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=p+u[y],w=p-u[k];p=cl(x,p,w)}if(s){const y=f==="y"?"top":"left",k=f==="y"?"bottom":"right",x=m+u[y],w=m-u[k];m=cl(x,m,w)}const g=l.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function ur(t){return hl(t)?(t.nodeName||"").toLowerCase():"#document"}function Dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function In(t){var e;return(e=(hl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hl(t){return t instanceof Node||t instanceof Dt(t).Node}function rn(t){return t instanceof Element||t instanceof Dt(t).Element}function on(t){return t instanceof HTMLElement||t instanceof Dt(t).HTMLElement}function pd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dt(t).ShadowRoot}function Li(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Zt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Oy(t){return["table","td","th"].includes(ur(t))}function pl(t){const e=ml(),n=Zt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ty(t){let e=$n(t);for(;on(e)&&!jr(e);){if(pl(e))return e;e=$n(e)}return null}function ml(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jr(t){return["html","body","#document"].includes(ur(t))}function Zt(t){return Dt(t).getComputedStyle(t)}function $o(t){return rn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function $n(t){if(ur(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pd(t)&&t.host||In(t);return pd(e)?e.host:e}function md(t){const e=$n(t);return jr(e)?t.ownerDocument?t.ownerDocument.body:t.body:on(e)&&Li(e)?e:md(e)}function gl(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=md(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Dt(i);return o?e.concat(s,s.visualViewport||[],Li(i)?i:[],s.frameElement&&n?gl(s.frameElement):[]):e.concat(i,gl(i,[],n))}function gd(t){const e=Zt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=on(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Do(n)!==o||Do(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function yd(t){return rn(t)?t:t.contextElement}function Hr(t){const e=yd(t);if(!on(e))return Bn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=gd(e);let s=(o?Do(n.width):n.width)/r,l=(o?Do(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Ny=Bn(0);function bd(t){const e=Dt(t);return!ml()||!e.visualViewport?Ny:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function My(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Dt(t)?!1:e}function Bi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=yd(t);let s=Bn(1);e&&(r?rn(r)&&(s=Hr(r)):s=Hr(t));const l=My(o,n,r)?bd(o):Bn(0);let c=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=Dt(o),p=r&&rn(r)?Dt(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Hr(g),k=g.getBoundingClientRect(),x=Zt(g),w=k.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,b=k.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=w,d+=b,m=Dt(g),g=m.frameElement}}return Io({width:u,height:f,x:c,y:d})}const Ay=[":popover-open",":modal"];function yl(t){return Ay.some(e=>{try{return t.matches(e)}catch{return!1}})}function Dy(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=In(r),l=e?yl(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Bn(1);const u=Bn(0),f=on(r);if((f||!f&&!o)&&((ur(r)!=="body"||Li(s))&&(c=$o(r)),on(r))){const h=Bi(r);d=Hr(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function Ly(t){return Array.from(t.getClientRects())}function kd(t){return Bi(In(t)).left+$o(t).scrollLeft}function By(t){const e=In(t),n=$o(t),r=t.ownerDocument.body,i=zr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=zr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+kd(t);const l=-n.scrollTop;return Zt(r).direction==="rtl"&&(s+=zr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function Iy(t,e){const n=Dt(t),r=In(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;const d=ml();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function $y(t,e){const n=Bi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=on(t)?Hr(t):Bn(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:l,x:c,y:d}}function wd(t,e,n){let r;if(e==="viewport")r=Iy(t,n);else if(e==="document")r=By(In(t));else if(rn(e))r=$y(e,n);else{const i=bd(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Io(r)}function vd(t,e){const n=$n(t);return n===e||!rn(n)||jr(n)?!1:Zt(n).position==="fixed"||vd(n,e)}function Vy(t,e){const n=e.get(t);if(n)return n;let r=gl(t,[],!1).filter(l=>rn(l)&&ur(l)!=="body"),i=null;const o=Zt(t).position==="fixed";let s=o?$n(t):t;for(;rn(s)&&!jr(s);){const l=Zt(s),c=pl(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Li(s)&&!c&&vd(t,s))?r=r.filter(u=>u!==s):i=l,s=$n(s)}return e.set(t,r),r}function Py(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?yl(e)?[]:Vy(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=wd(e,u,i);return d.top=zr(f.top,d.top),d.right=Mi(f.right,d.right),d.bottom=Mi(f.bottom,d.bottom),d.left=zr(f.left,d.left),d},wd(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ry(t){const{width:e,height:n}=gd(t);return{width:e,height:n}}function Fy(t,e,n){const r=on(e),i=In(e),o=n==="fixed",s=Bi(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const c=Bn(0);if(r||!r&&!o)if((ur(e)!=="body"||Li(i))&&(l=$o(e)),r){const f=Bi(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=kd(i));const d=s.left+l.scrollLeft-c.x,u=s.top+l.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function bl(t){return Zt(t).position==="static"}function xd(t,e){return!on(t)||Zt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ed(t,e){const n=Dt(t);if(yl(t))return n;if(!on(t)){let i=$n(t);for(;i&&!jr(i);){if(rn(i)&&!bl(i))return i;i=$n(i)}return n}let r=xd(t,e);for(;r&&Oy(r)&&bl(r);)r=xd(r,e);return r&&jr(r)&&bl(r)&&!pl(r)?n:r||Ty(t)||n}const zy=async function(t){const e=this.getOffsetParent||Ed,n=this.getDimensions,r=await n(t.floating);return{reference:Fy(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jy(t){return Zt(t).direction==="rtl"}const Hy={convertOffsetParentRelativeRectToViewportRelativeRect:Dy,getDocumentElement:In,getClippingRect:Py,getOffsetParent:Ed,getElementRects:zy,getClientRects:Ly,getDimensions:Ry,getScale:Hr,isElement:rn,isRTL:jy},Cd=Sy,Sd=_y,_d=Ey,Wy=xy,Od=(t,e,n)=>{const r=new Map,i={platform:Hy,...n},o={...i.platform,_c:r};return vy(t,e,{...i,platform:o})};function Uy(t){return t!=null&&typeof t=="object"&&"$el"in t}function Yy(t){if(Uy(t)){const e=t.$el;return hl(e)&&ur(e)==="#comment"?null:e}return t}function qy(t){return{name:"arrow",options:t,fn(e){const n=Yy(a.unref(t.element));return n==null?{}:Wy({element:n,padding:t.padding}).fn(e)}}}const Ky={},Gy={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Jy=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function Zy(t,e){return a.openBlock(),a.createElementBlock("svg",Gy,Jy)}const Ii=be(Ky,[["render",Zy]]);let Vo;const Xy=new Uint8Array(16);function Qy(){if(!Vo&&(Vo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vo(Xy)}const nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));function e1(t,e=0){return nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]}const Td={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function kl(t,e,n){if(Td.randomUUID&&!t)return Td.randomUUID();t=t||{};const r=t.random||(t.rng||Qy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,e1(r)}let t1={isMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},capitalize(t){return t?(t=t.toString(),t=t.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()}).trim(),t.charAt(0).toUpperCase()+t.slice(1)):""},sortByKey(t,e,n="asc"){return[...t].sort((r,i)=>{let o=r[e],s=i[e];const l=!isNaN(Date.parse(o))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(o),c=!isNaN(Date.parse(s))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(s);if(l&&c)o=new Date(o).getTime(),s=new Date(s).getTime();else{const d=parseFloat(o),u=parseFloat(s),f=!isNaN(d)&&typeof o!="boolean",h=!isNaN(u)&&typeof s!="boolean";f&&h?(o=d,s=u):(o=String(o).toLowerCase(),s=String(s).toLowerCase())}return n==="asc"?o>s?1:o<s?-1:0:o<s?1:o>s?-1:0})}};const fr=Object.assign({name:"WpicPopover"},{inheritAttrs:!1},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},transparent:Boolean,noBorder:Boolean,noShadow:Boolean,expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=kl(),i=n,o=t,s={pmi:"md:absolute md:block bg-white shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"block absolute mt-2 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},l=a.ref(null),c=a.ref(null),d=a.ref(!0);function u(){o.disabled||(d.value=!1,p()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(k){if(d.value)u();else{if(o.noCloseClasses.some(x=>k.target.closest(`.${x}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const k=await Od(l.value,c.value,{placement:o.placement,middleware:[_d(),Sd(),Cd(o.offset)]});c.value.style.left=`${k.x}px`,c.value.style.top=`${k.y}px`}const m=k=>{c.value&&!c.value.contains(k.target)&&l.value&&!l.value.contains(k.target)&&h()};a.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",k=>{k.detail.uuid!==r&&h()})}),a.onUnmounted(()=>{document.removeEventListener("click",m),document.removeEventListener("submenu-open",h)});function g(){o.hover&&u()}function y(){o.hover&&h()}return e({hide:h}),(k,x)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[(a.openBlock(),a.createElementBlock("div",a.mergeProps({class:"flex-1",key:`reference_${a.unref(r)}`,ref_key:"reference",ref:l},k.$attrs,{onMouseenter:g,onMouseleave:y,onClick:x[0]||(x[0]=a.withModifiers(w=>f(w),["stop"]))}),[a.renderSlot(k.$slots,"default",{isHidden:d.value})],16)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(he).popoverTarget},[(a.openBlock(),a.createElementBlock("div",{key:`floating_${a.unref(r)}`,ref_key:"floating",ref:c,style:a.normalizeStyle({maxWidth:t.maxWidth}),class:a.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[a.unref(he).theme]}`]:!d.value,"bg-transparent!":t.transparent,"border-none!":t.noBorder,"shadow-none":t.noShadow,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(k.$slots,"content")],6))],8,["to"]))],64))}});/*!
5
+ */function Ge(t){return typeof t=="function"}function Pc(t){return t==null}const Ln=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Zs(t){return Number(t)>=0}function Yg(t){const e=parseFloat(t);return isNaN(e)?t:e}function qg(t){return typeof t=="object"&&t!==null}function Kg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function Rc(t){if(!qg(t)||Kg(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ei(t,e){return Object.keys(e).forEach(n=>{if(Rc(e[n])&&Rc(t[n])){t[n]||(t[n]={}),Ei(t[n],e[n]);return}t[n]=e[n]}),t}function Ci(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Zs(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Fc={};function Gt(t,e){Jg(t,e),Fc[t]=e}function Gg(t){return Fc[t]}function Jg(t,e){if(!Ge(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function zc(t,e,n){typeof n.value=="object"&&(n.value=De(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function De(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(De(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(De(l),De(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(De(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)zc(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||zc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Si=Symbol("vee-validate-form"),jc=Symbol("vee-validate-field-instance"),_o=Symbol("Default empty value"),Zg=typeof window<"u";function Xs(t){return Ge(t)&&!!t.__locatorRef}function Jt(t){return!!t&&Ge(t.parse)&&t.__type==="VVTypedSchema"}function Oo(t){return!!t&&Ge(t.validate)}function _i(t){return t==="checkbox"||t==="radio"}function Xg(t){return Ln(t)||Array.isArray(t)}function Qg(t){return Array.isArray(t)?t.length===0:Ln(t)&&Object.keys(t).length===0}function To(t){return/^\[.+\]$/i.test(t)}function e0(t){return Hc(t)&&t.multiple}function Hc(t){return t.tagName==="SELECT"}function t0(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function n0(t,e){return!t0(t,e)&&e.type!=="file"&&!_i(e.type)}function Wc(t){return Qs(t)&&t.target&&"submit"in t.target}function Qs(t){return t?!!(typeof Event<"u"&&Ge(Event)&&t instanceof Event||t&&t.srcElement):!1}function Uc(t,e){return e in t&&t[e]!==_o}function mt(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!mt(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!mt(r[1],e.get(r[0])))return!1;return!0}if(Yc(t)&&Yc(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!mt(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function Yc(t){return Zg?t instanceof File:!1}function el(t){return To(t)?t.replace(/\[|\]/gi,""):t}function xt(t,e,n){return t?To(e)?t[el(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>Xg(i)&&o in i?i[o]:n,t):n}function gn(t,e,n){if(To(e)){t[el(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||Pc(i[r[o]]))&&(i[r[o]]=Zs(r[o+1])?[]:{}),i=i[r[o]]}}function tl(t,e){if(Array.isArray(t)&&Zs(e)){t.splice(Number(e),1);return}Ln(t)&&delete t[e]}function qc(t,e){if(To(e)){delete t[el(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){tl(r,n[o]);break}if(!(n[o]in r)||Pc(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>xt(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(Qg(i[o])){if(o===0){tl(t,n[0]);continue}tl(i[o-1],n[o-1])}}function Et(t){return Object.keys(t)}function nl(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function Kc(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>mt(o,e));return i>=0?r.splice(i,1):r.push(e),r}return mt(t,e)?n:e}function r0(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function Gc(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function i0(t,e){return Ln(e)&&e.number?Yg(t):t}function rl(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function il(t){return Array.isArray(t)?t:t?[t]:[]}function No(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function o0(t){let e=null,n=[];return function(...r){const i=a.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function ol(t,e,n){return e.slots.default?typeof t=="string"||!t?e.slots.default(n()):{default:()=>{var r,i;return(i=(r=e.slots).default)===null||i===void 0?void 0:i.call(r,n())}}:e.slots.default}function sl(t){if(Jc(t))return t._value}function Jc(t){return"_value"in t}function s0(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Mo(t){if(!Qs(t))return t;const e=t.target;if(_i(e.type)&&Jc(e))return sl(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(e0(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(sl);if(Hc(e)){const n=Array.from(e.options).find(r=>r.selected);return n?sl(n):e.value}return s0(e)}function Zc(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Ln(t)&&t._$$isNormalized?t:Ln(t)?Object.keys(t).reduce((n,r)=>{const i=l0(t[r]);return t[r]!==!1&&(n[r]=Xc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=a0(r);return i.name&&(n[i.name]=Xc(i.params)),n},e):e}function l0(t){return t===!0?[]:Array.isArray(t)||Ln(t)?t:[t]}function Xc(t){const e=n=>typeof n=="string"&&n[0]==="@"?c0(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const a0=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function c0(t){const e=n=>xt(n,t)||n[t];return e.__locatorRef=t,e}function d0(t){return Array.isArray(t)?t.filter(Xs):Et(t).filter(e=>Xs(t[e])).map(e=>t[e])}let u0=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const ar=()=>u0;async function Qc(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await f0(i,t)).errors;return{errors:s,valid:!s.length}}async function f0(t,e){if(Jt(t.rules)||Oo(t.rules))return p0(e,t.rules);if(Ge(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},l=Array.isArray(t.rules)?t.rules:[t.rules],c=l.length,d=[];for(let u=0;u<c;u++){const f=l[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:td(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Zc(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await m0(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function h0(t){return!!t&&t.name==="ValidationError"}function ed(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!h0(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,l)=>{const c=l.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...l.errors),s},{});return{errors:Object.values(o)}}}}}async function p0(t,e){const r=await(Jt(e)?e:ed(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function m0(t,e,n){const r=Gg(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=g0(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:td(o)}}function td(t){const e=ar().generateMessage;return e?e(t):"Field is invalid"}function g0(t,e){const n=r=>Xs(r)?r(e):r;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((r,i)=>(r[i]=n(t[i]),r),{})}async function y0(t,e){const r=await(Jt(t)?t:ed(t)).parse(De(e)),i={},o={};for(const s of r.errors){const l=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function b0(t,e,n){const i=Et(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await Qc(xt(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),l={},c={};for(const d of s)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c}}let nd=0;function k0(t,e){const{value:n,initialValue:r,setInitialValue:i}=w0(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&d(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:c,setErrors:d}=E0(),u=nd>=Number.MAX_SAFE_INTEGER?0:++nd,f=x0(n,r,c,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:c,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=a.computed(()=>o.errors);function l(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(a.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(a.unref(t),(f=c.touched)!==null&&f!==void 0?f:!1)),"initialValue"in c&&i(c.initialValue)}return{id:Array.isArray(o.id)?o.id[o.id.length-1]:o.id,path:t,value:n,errors:s,meta:o,initialValue:r,flags:o.__flags,setState:l}}function w0(t,e,n){const r=a.ref(a.unref(e));function i(){return n?xt(n.initialValues.value,a.unref(t),a.unref(r)):a.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(a.unref(t),d,!0)}const s=a.computed(i);if(!n)return{value:a.ref(i()),initialValue:s,setInitialValue:o};const l=v0(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return xt(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function v0(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:xt(e.values,a.unref(r),a.unref(n))}function x0(t,e,n,r){const i=a.computed(()=>{var s,l,c;return(c=(l=(s=a.toValue(r))===null||s===void 0?void 0:s.describe)===null||l===void 0?void 0:l.call(s).required)!==null&&c!==void 0?c:!1}),o=a.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!a.unref(n).length,initialValue:a.computed(()=>a.unref(e)),dirty:a.computed(()=>!mt(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function E0(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=il(e)}}}function rd(t){process.env.NODE_ENV!=="production"&&Ug({id:"vee-validate-devtools-plugin",label:"VeeValidate Plugin",packageName:"vee-validate",homepage:"https://vee-validate.logaretm.com/v4",app:t,logo:"https://vee-validate.logaretm.com/v4/logo.png"},_0)}const Oi={},Ti={};let yn;const Pr=r0(()=>{setTimeout(async()=>{await a.nextTick(),yn==null||yn.sendInspectorState(Rr),yn==null||yn.sendInspectorTree(Rr)},100)},100);function C0(t){const e=a.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Oi[t.formId]=Object.assign({},t),Oi[t.formId]._vm=e,a.onUnmounted(()=>{delete Oi[t.formId],Pr()}),Pr()}function S0(t){const e=a.getCurrentInstance();if(!yn){const n=e==null?void 0:e.appContext.app;if(!n)return;rd(n)}Ti[t.id]=Object.assign({},t),Ti[t.id]._vm=e,a.onUnmounted(()=>{delete Ti[t.id],Pr()}),Pr()}const Rr="vee-validate-inspector",Ct={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let We=null;function _0(t){yn=t,t.addInspector({id:Rr,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!We){console.error("There is not a valid selected vee-validate node or component");return}if(We.type==="field"){await We.field.validate();return}if(We.type==="form"){await We.form.validate();return}We.type==="pathState"&&await We.form.validateField(We.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!We){console.error("There is not a valid selected vee-validate node or component");return}if(We.type==="field"){We.field.resetField();return}We.type==="form"&&We.form.resetForm(),We.type==="pathState"&&We.form.resetField(We.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Rr)return;const n=Object.values(Oi),r=Object.values(Ti);e.rootNodes=[...n.map(O0),...r.map(i=>N0(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Rr||n.currentTab!==`custom-inspector:${Rr}`)return;const{form:r,field:i,state:o,type:s}=M0(e.nodeId);if(r&&s==="form"){e.state=A0(r),We={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=od(o),We={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=od({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),We={field:i,type:"field"};return}We=null})}function O0(t){const{textColor:e,bgColor:n}=sd(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{gn(r,a.unref(s.path),T0(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Ln(s)?{id:`${l.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...l,d]))}:Array.isArray(s)?{id:`${l.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...l,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:ll(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Ct.white,backgroundColor:Ct.unknown}]}}function T0(t,e){return{id:ll(e,t),label:a.unref(t.path),tags:id(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function N0(t,e){return{id:ll(e,t),label:a.unref(t.name),tags:id(!1,1,t.type,t.meta.valid,e)}}function id(t,e,n,r,i){const{textColor:o,bgColor:s}=sd(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Ct.black,backgroundColor:Ct.gray},n==="checkbox"?{label:"Checkbox",textColor:Ct.white,backgroundColor:Ct.blue}:void 0,n==="radio"?{label:"Radio",textColor:Ct.white,backgroundColor:Ct.purple}:void 0,t?{label:"Multiple",textColor:Ct.black,backgroundColor:Ct.orange}:void 0].filter(Boolean)}function ll(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:a.unref(e==null?void 0:e.name):"",i={f:t==null?void 0:t.formId,ff:r,type:n};return btoa(encodeURIComponent(JSON.stringify(i)))}function M0(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Oi[e.f];if(!n&&e.ff){const i=Ti[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function od(t){return{"Field state":[{key:"errors",value:t.errors},{key:"initialValue",value:t.initialValue},{key:"currentValue",value:t.value},{key:"touched",value:t.touched},{key:"dirty",value:t.dirty},{key:"valid",value:t.valid}]}}function A0(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:Et(e.value).reduce((l,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(l[c]=u),l},{})}]}}function sd(t){return{bgColor:t?Ct.success:Ct.error,textColor:t?Ct.black:Ct.white}}function D0(t,e,n){return _i(n==null?void 0:n.type)?B0(t,e,n):ld(t,e,n)}function ld(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:l,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=L0(n),g=f?nl(Si):void 0,y=m||g,k=a.computed(()=>Ci(a.toValue(t))),x=a.computed(()=>{if(a.toValue(y==null?void 0:y.schema))return;const V=a.unref(e);return Oo(V)||Jt(V)||Ge(V)||Array.isArray(V)?V:Zc(V)}),w=!Ge(x.value)&&Jt(a.toValue(e)),{id:b,value:C,initialValue:v,meta:O,setState:D,errors:A,flags:I}=k0(k,{modelValue:r,form:y,bails:o,label:c,type:s,validate:x.value?S:void 0,schema:w?e:void 0}),L=a.computed(()=>A.value[0]);p&&I0({value:C,prop:p,handleChange:B,shouldValidate:()=>d&&!I.pendingReset});const R=(q,V=!1)=>{O.touched=!0,V&&H()};async function K(q){var V,ue;if(y!=null&&y.validateSchema){const{results:ce}=await y.validateSchema(q);return(V=ce[a.toValue(k)])!==null&&V!==void 0?V:{valid:!0,errors:[]}}return x.value?Qc(C.value,x.value,{name:a.toValue(k),label:a.toValue(c),values:(ue=y==null?void 0:y.values)!==null&&ue!==void 0?ue:{},bails:o}):{valid:!0,errors:[]}}const H=rl(async()=>(O.pending=!0,O.validated=!0,K("validated-only")),q=>(I.pendingUnmount[W.id]||(D({errors:q.errors}),O.pending=!1,O.valid=q.valid),q)),$=rl(async()=>K("silent"),q=>(O.valid=q.valid,q));function S(q){return(q==null?void 0:q.mode)==="silent"?$():H()}function B(q,V=!0){const ue=Mo(q);te(ue,V)}a.onMounted(()=>{if(i)return H();(!y||!y.validateSchema)&&$()});function z(q){O.touched=q}function X(q){var V;const ue=q&&"value"in q?q.value:v.value;D({value:De(ue),initialValue:De(ue),touched:(V=q==null?void 0:q.touched)!==null&&V!==void 0?V:!1,errors:(q==null?void 0:q.errors)||[]}),O.pending=!1,O.validated=!1,$()}const j=a.getCurrentInstance();function te(q,V=!0){C.value=j&&p?i0(q,j.props.modelModifiers):q,(V?H:$)()}function re(q){D({errors:Array.isArray(q)?q:[q]})}const P=a.computed({get(){return C.value},set(q){te(q,d)}}),W={id:b,name:k,label:c,value:P,meta:O,errors:A,errorMessage:L,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:X,handleReset:()=>X(),validate:S,handleChange:B,handleBlur:R,setState:D,setTouched:z,setErrors:re,setValue:te};if(a.provide(jc,W),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(q,V)=>{mt(q,V)||(O.validated?H():$())},{deep:!0}),process.env.NODE_ENV!=="production"&&(W._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:A.value},O),{value:C.value}),Pr,{deep:!0}),y||S0(W)),!y)return W;const G=a.computed(()=>{const q=x.value;return!q||Ge(q)||Oo(q)||Jt(q)||Array.isArray(q)?{}:Object.keys(q).reduce((V,ue)=>{const ce=d0(q[ue]).map(we=>we.__locatorRef).reduce((we,Se)=>{const Be=xt(y.values,Se)||y.values[Se];return Be!==void 0&&(we[Se]=Be),we},{});return Object.assign(V,ce),V},{})});return a.watch(G,(q,V)=>{if(!Object.keys(q).length)return;!mt(q,V)&&(O.validated?H():$())}),a.onBeforeUnmount(()=>{var q;const V=(q=a.toValue(W.keepValueOnUnmount))!==null&&q!==void 0?q:a.toValue(y.keepValuesOnUnmount),ue=a.toValue(k);if(V||!y||I.pendingUnmount[W.id]){y==null||y.removePathState(ue,b);return}I.pendingUnmount[W.id]=!0;const ce=y.getPathState(ue);if(Array.isArray(ce==null?void 0:ce.id)&&(ce!=null&&ce.multiple)?ce!=null&&ce.id.includes(W.id):(ce==null?void 0:ce.id)===W.id){if(ce!=null&&ce.multiple&&Array.isArray(ce.value)){const Se=ce.value.findIndex(Be=>mt(Be,a.toValue(W.checkedValue)));if(Se>-1){const Be=[...ce.value];Be.splice(Se,1),y.setFieldValue(ue,Be)}Array.isArray(ce.id)&&ce.id.splice(ce.id.indexOf(W.id),1)}else y.unsetPathValue(a.toValue(k));y.removePathState(ue,b)}}),W}function L0(t){const e=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!(t!=null&&t.syncVModel),r=typeof(t==null?void 0:t.syncVModel)=="string"?t.syncVModel:(t==null?void 0:t.modelPropName)||"modelValue",i=n&&!("initialValue"in(t||{}))?al(a.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,l=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:l})}function B0(t,e,n){const r=n!=null&&n.standalone?void 0:nl(Si),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(l){const c=l.handleChange,d=a.computed(()=>{const f=a.toValue(l.value),h=a.toValue(i);return Array.isArray(f)?f.findIndex(p=>mt(p,h))>=0:mt(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&l.validate();return}const g=a.toValue(t),y=r==null?void 0:r.getPathState(g),k=Mo(f);let x=(m=a.toValue(i))!==null&&m!==void 0?m:k;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?x=Kc(xt(r.values,g)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=Kc(a.toValue(l.value),x,a.toValue(o))),c(x,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(ld(t,e,n))}function I0({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=a.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(a.watch(e,l=>{mt(l,al(i,o))||i.emit(s,l)}),a.watch(()=>al(i,o),l=>{if(l===_o&&e.value===void 0)return;const c=l===_o?void 0:l;mt(c,e.value)||n(c,r())}))}function al(t,e){if(t)return t.props[e]}const $0=a.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>ar().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:_o},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(t,e){const n=a.toRef(t,"rules"),r=a.toRef(t,"name"),i=a.toRef(t,"label"),o=a.toRef(t,"uncheckedValue"),s=a.toRef(t,"keepValue"),{errors:l,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:k,setErrors:x}=D0(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:P0(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),w=function(A,I=!0){f(A,I)},b=a.computed(()=>{const{validateOnInput:D,validateOnChange:A,validateOnBlur:I,validateOnModelUpdate:L}=V0(t);function R(S){h(S,I),Ge(e.attrs.onBlur)&&e.attrs.onBlur(S)}function K(S){w(S,D),Ge(e.attrs.onInput)&&e.attrs.onInput(S)}function H(S){w(S,A),Ge(e.attrs.onChange)&&e.attrs.onChange(S)}const $={name:t.name,onBlur:R,onInput:K,onChange:H};return $["onUpdate:modelValue"]=S=>w(S,L),$}),C=a.computed(()=>{const D=Object.assign({},b.value);_i(e.attrs.type)&&k&&(D.checked=k.value);const A=ad(t,e);return n0(A,e.attrs)&&(D.value=c.value),D}),v=a.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:c.value}));function O(){return{field:C.value,componentField:v.value,value:c.value,meta:y,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:w,handleInput:D=>w(D,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:c,meta:y,errors:l,errorMessage:d,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const D=a.resolveDynamicComponent(ad(t,e)),A=ol(D,e,O);return D?a.h(D,Object.assign(Object.assign({},e.attrs),C.value),A):A}}});function ad(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function V0(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=ar();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:l,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function P0(t,e){return _i(e.attrs.type)?Uc(t,"modelValue")?t.modelValue:void 0:Uc(t,"modelValue")?t.modelValue:e.attrs.value}const cr=$0;let R0=0;const Ao=["bails","fieldsCount","id","multiple","type","validate"];function cd(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},a.toValue(e)),r=a.unref(t==null?void 0:t.validationSchema);return r&&Jt(r)&&Ge(r.cast)?De(r.cast(n)||{}):De(n)}function F0(t){var e;const n=R0++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(cd(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=o0(()=>{f.value=d.value.reduce((T,M)=>(T[Ci(a.toValue(M.path))]=M,T),{})});function p(T,M){const Y=S(T);if(!Y){typeof T=="string"&&(u.value[Ci(T)]=il(M));return}if(typeof T=="string"){const ie=Ci(T);u.value[ie]&&delete u.value[ie]}Y.errors=il(M),Y.valid=!Y.errors.length}function m(T){Et(T).forEach(M=>{p(M,T[M])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=a.computed(()=>{const T=d.value.reduce((M,Y)=>(Y.errors.length&&(M[Y.path]=Y.errors),M),{});return Object.assign(Object.assign({},u.value),T)}),y=a.computed(()=>Et(g.value).reduce((T,M)=>{const Y=g.value[M];return Y!=null&&Y.length&&(T[M]=Y[0]),T},{})),k=a.computed(()=>d.value.reduce((T,M)=>(T[M.path]={name:M.path||"",label:M.label||""},T),{})),x=a.computed(()=>d.value.reduce((T,M)=>{var Y;return T[M.path]=(Y=M.bails)!==null&&Y!==void 0?Y:!0,T},{})),w=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:C,originalInitialValues:v,setInitialValues:O}=j0(d,c,t),D=z0(d,c,v,y),A=a.computed(()=>d.value.reduce((T,M)=>{const Y=xt(c,M.path);return gn(T,M.path,Y),T},{})),I=t==null?void 0:t.validationSchema;function L(T,M){var Y,ie;const fe=a.computed(()=>xt(C.value,a.toValue(T))),N=f.value[a.toValue(T)],ee=(M==null?void 0:M.type)==="checkbox"||(M==null?void 0:M.type)==="radio";if(N&&ee){N.multiple=!0;const vt=r++;return Array.isArray(N.id)?N.id.push(vt):N.id=[N.id,vt],N.fieldsCount++,N.__flags.pendingUnmount[vt]=!1,N}const se=a.computed(()=>xt(c,a.toValue(T))),me=a.toValue(T),ye=z.findIndex(vt=>vt===me);ye!==-1&&z.splice(ye,1);const ve=a.computed(()=>{var vt,Ft,$r,lr;const mn=a.toValue(I);if(Jt(mn))return(Ft=(vt=mn.describe)===null||vt===void 0?void 0:vt.call(mn,a.toValue(T)).required)!==null&&Ft!==void 0?Ft:!1;const So=a.toValue(M==null?void 0:M.schema);return Jt(So)&&(lr=($r=So.describe)===null||$r===void 0?void 0:$r.call(So).required)!==null&&lr!==void 0?lr:!1}),Ae=r++,He=a.reactive({id:Ae,path:T,touched:!1,pending:!1,valid:!0,validated:!!(!((Y=w[me])===null||Y===void 0)&&Y.length),required:ve,initialValue:fe,errors:a.shallowRef([]),bails:(ie=M==null?void 0:M.bails)!==null&&ie!==void 0?ie:!1,label:M==null?void 0:M.label,type:(M==null?void 0:M.type)||"default",value:se,multiple:!1,__flags:{pendingUnmount:{[Ae]:!1},pendingReset:!1},fieldsCount:1,validate:M==null?void 0:M.validate,dirty:a.computed(()=>!mt(a.unref(se),a.unref(fe)))});return d.value.push(He),f.value[me]=He,h(),y.value[me]&&!w[me]&&a.nextTick(()=>{pt(me,{mode:"silent"})}),a.isRef(T)&&a.watch(T,vt=>{h();const Ft=De(se.value);f.value[vt]=He,a.nextTick(()=>{gn(c,vt,Ft)})}),He}const R=Gc(ae,5),K=Gc(ae,5),H=rl(async T=>await(T==="silent"?R():K()),(T,[M])=>{const Y=Et(q.errorBag.value),fe=[...new Set([...Et(T.results),...d.value.map(N=>N.path),...Y])].sort().reduce((N,ee)=>{var se;const me=ee,ye=S(me)||B(me),ve=((se=T.results[me])===null||se===void 0?void 0:se.errors)||[],Ae=a.toValue(ye==null?void 0:ye.path)||me,He=H0({errors:ve,valid:!ve.length},N.results[Ae]);return N.results[Ae]=He,He.valid||(N.errors[Ae]=He.errors[0]),ye&&u.value[Ae]&&delete u.value[Ae],ye?(ye.valid=He.valid,M==="silent"||M==="validated-only"&&!ye.validated||p(ye,He.errors),N):(p(Ae,ve),N)},{valid:T.valid,results:{},errors:{}});return T.values&&(fe.values=T.values),Et(fe.results).forEach(N=>{var ee;const se=S(N);se&&M!=="silent"&&(M==="validated-only"&&!se.validated||p(se,(ee=fe.results[N])===null||ee===void 0?void 0:ee.errors))}),fe});function $(T){d.value.forEach(T)}function S(T){const M=typeof T=="string"?Ci(T):T;return typeof M=="string"?f.value[M]:M}function B(T){return d.value.filter(Y=>T.startsWith(Y.path)).reduce((Y,ie)=>Y?ie.path.length>Y.path.length?ie:Y:ie,void 0)}let z=[],X;function j(T){return z.push(T),X||(X=a.nextTick(()=>{[...z].sort().reverse().forEach(Y=>{qc(c,Y)}),z=[],X=null})),X}function te(T){return function(Y,ie){return function(N){return N instanceof Event&&(N.preventDefault(),N.stopPropagation()),$(ee=>ee.touched=!0),i.value=!0,s.value++,at().then(ee=>{const se=De(c);if(ee.valid&&typeof Y=="function"){const me=De(A.value);let ye=T?me:se;return ee.values&&(ye=ee.values),Y(ye,{evt:N,controlledValues:me,setErrors:m,setFieldError:p,setTouched:Ee,setFieldTouched:Se,setValues:ce,setFieldValue:V,resetForm:lt,resetField:At})}!ee.valid&&typeof ie=="function"&&ie({values:se,evt:N,errors:ee.errors,results:ee.results})}).then(ee=>(i.value=!1,ee),ee=>{throw i.value=!1,ee})}}}const P=te(!1);P.withControlled=te(!0);function W(T,M){const Y=d.value.findIndex(fe=>fe.path===T&&(Array.isArray(fe.id)?fe.id.includes(M):fe.id===M)),ie=d.value[Y];if(!(Y===-1||!ie)){if(a.nextTick(()=>{pt(T,{mode:"silent",warn:!1})}),ie.multiple&&ie.fieldsCount&&ie.fieldsCount--,Array.isArray(ie.id)){const fe=ie.id.indexOf(M);fe>=0&&ie.id.splice(fe,1),delete ie.__flags.pendingUnmount[M]}(!ie.multiple||ie.fieldsCount<=0)&&(d.value.splice(Y,1),E(T),h(),delete f.value[T])}}function G(T){Et(f.value).forEach(M=>{M.startsWith(T)&&delete f.value[M]}),d.value=d.value.filter(M=>!M.path.startsWith(T)),a.nextTick(()=>{h()})}const q={formId:n,values:c,controlledValues:A,errorBag:g,errors:y,schema:I,submitCount:s,meta:D,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:b,validateSchema:a.unref(I)?H:void 0,validate:at,setFieldError:p,validateField:pt,setFieldValue:V,setValues:ce,setErrors:m,setFieldTouched:Se,setTouched:Ee,resetForm:lt,resetField:At,handleSubmit:P,useFieldModel:Te,defineInputBinds:F,defineComponentBinds:Q,defineField:Oe,stageInitialValue:_,unsetInitialValue:E,setFieldInitialValue:U,createPathState:L,getPathState:S,unsetPathValue:j,removePathState:W,initialValues:C,getAllPathStates:()=>d.value,destroyPath:G,isFieldTouched:Be,isFieldDirty:je,isFieldValid:ne};function V(T,M,Y=!0){const ie=De(M),fe=typeof T=="string"?T:T.path;S(fe)||L(fe),gn(c,fe,ie),Y&&pt(fe)}function ue(T,M=!0){Et(c).forEach(Y=>{delete c[Y]}),Et(T).forEach(Y=>{V(Y,T[Y],!1)}),M&&at()}function ce(T,M=!0){Ei(c,T),l.forEach(Y=>Y&&Y.reset()),M&&at()}function we(T,M){const Y=S(a.toValue(T))||L(T);return a.computed({get(){return Y.value},set(ie){var fe;const N=a.toValue(T);V(N,ie,(fe=a.toValue(M))!==null&&fe!==void 0?fe:!1)}})}function Se(T,M){const Y=S(T);Y&&(Y.touched=M)}function Be(T){const M=S(T);return M?M.touched:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.touched)}function je(T){const M=S(T);return M?M.dirty:d.value.filter(Y=>Y.path.startsWith(T)).some(Y=>Y.dirty)}function ne(T){const M=S(T);return M?M.valid:d.value.filter(Y=>Y.path.startsWith(T)).every(Y=>Y.valid)}function Ee(T){if(typeof T=="boolean"){$(M=>{M.touched=T});return}Et(T).forEach(M=>{Se(M,!!T[M])})}function At(T,M){var Y;const ie=M&&"value"in M?M.value:xt(C.value,T),fe=S(T);fe&&(fe.__flags.pendingReset=!0),U(T,De(ie),!0),V(T,ie,!1),Se(T,(Y=M==null?void 0:M.touched)!==null&&Y!==void 0?Y:!1),p(T,(M==null?void 0:M.errors)||[]),a.nextTick(()=>{fe&&(fe.__flags.pendingReset=!1)})}function lt(T,M){let Y=De(T!=null&&T.values?T.values:v.value);Y=M!=null&&M.force?Y:Ei(v.value,Y),Y=Jt(I)&&Ge(I.cast)?I.cast(Y):Y,O(Y),$(ie=>{var fe;ie.__flags.pendingReset=!0,ie.validated=!1,ie.touched=((fe=T==null?void 0:T.touched)===null||fe===void 0?void 0:fe[ie.path])||!1,V(ie.path,xt(Y,ie.path),!1),p(ie.path,void 0)}),M!=null&&M.force?ue(Y,!1):ce(Y,!1),m((T==null?void 0:T.errors)||{}),s.value=(T==null?void 0:T.submitCount)||0,a.nextTick(()=>{at({mode:"silent"}),$(ie=>{ie.__flags.pendingReset=!1})})}async function at(T){const M=(T==null?void 0:T.mode)||"force";if(M==="force"&&$(N=>N.validated=!0),q.validateSchema)return q.validateSchema(M);o.value=!0;const Y=await Promise.all(d.value.map(N=>N.validate?N.validate(T).then(ee=>({key:N.path,valid:ee.valid,errors:ee.errors})):Promise.resolve({key:N.path,valid:!0,errors:[]})));o.value=!1;const ie={},fe={};for(const N of Y)ie[N.key]={valid:N.valid,errors:N.errors},N.errors.length&&(fe[N.key]=N.errors[0]);return{valid:Y.every(N=>N.valid),results:ie,errors:fe}}async function pt(T,M){var Y;const ie=S(T);if(ie&&(M==null?void 0:M.mode)!=="silent"&&(ie.validated=!0),I){const{results:N}=await H((M==null?void 0:M.mode)||"validated-only");return N[T]||{errors:[],valid:!0}}return ie!=null&&ie.validate?ie.validate(M):(!ie&&((Y=M==null?void 0:M.warn)!==null&&Y!==void 0?Y:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${T} was not found`),Promise.resolve({errors:[],valid:!0}))}function E(T){qc(C.value,T)}function _(T,M,Y=!1){U(T,M),gn(c,T,M),Y&&!(t!=null&&t.initialValues)&&gn(v.value,T,De(M))}function U(T,M,Y=!1){gn(C.value,T,De(M)),Y&&gn(v.value,T,De(M))}async function ae(){const T=a.unref(I);if(!T)return{valid:!0,results:{},errors:{}};o.value=!0;const M=Oo(T)||Jt(T)?await y0(T,c):await b0(T,c,{names:k.value,bailsMap:x.value});return o.value=!1,M}const Me=P((T,{evt:M})=>{Wc(M)&&M.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&Ee(t.initialTouched),t!=null&&t.validateOnMount){at();return}q.validateSchema&&q.validateSchema("silent")}),a.isRef(I)&&a.watch(I,()=>{var T;(T=q.validateSchema)===null||T===void 0||T.call(q,"validated-only")}),a.provide(Si,q),process.env.NODE_ENV!=="production"&&(C0(q),a.watch(()=>Object.assign(Object.assign({errors:g.value},D.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Pr,{deep:!0}));function Oe(T,M){const Y=Ge(M)||M==null?void 0:M.label,ie=S(a.toValue(T))||L(T,{label:Y}),fe=()=>Ge(M)?M(No(ie,Ao)):M||{};function N(){var ve;ie.touched=!0,((ve=fe().validateOnBlur)!==null&&ve!==void 0?ve:ar().validateOnBlur)&&pt(ie.path)}function ee(){var ve;((ve=fe().validateOnInput)!==null&&ve!==void 0?ve:ar().validateOnInput)&&a.nextTick(()=>{pt(ie.path)})}function se(){var ve;((ve=fe().validateOnChange)!==null&&ve!==void 0?ve:ar().validateOnChange)&&a.nextTick(()=>{pt(ie.path)})}const me=a.computed(()=>{const ve={onChange:se,onInput:ee,onBlur:N};return Ge(M)?Object.assign(Object.assign({},ve),M(No(ie,Ao)).props||{}):M!=null&&M.props?Object.assign(Object.assign({},ve),M.props(No(ie,Ao))):ve});return[we(T,()=>{var ve,Ae,He;return(He=(ve=fe().validateOnModelUpdate)!==null&&ve!==void 0?ve:(Ae=ar())===null||Ae===void 0?void 0:Ae.validateOnModelUpdate)!==null&&He!==void 0?He:!0}),me]}function Te(T){return Array.isArray(T)?T.map(M=>we(M,!0)):we(T)}function F(T,M){const[Y,ie]=Oe(T,M);function fe(){ie.value.onBlur()}function N(se){const me=Mo(se);V(a.toValue(T),me,!1),ie.value.onInput()}function ee(se){const me=Mo(se);V(a.toValue(T),me,!1),ie.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},ie.value),{onBlur:fe,onInput:N,onChange:ee,value:Y.value}))}function Q(T,M){const[Y,ie]=Oe(T,M),fe=S(a.toValue(T));function N(ee){Y.value=ee}return a.computed(()=>{const ee=Ge(M)?M(No(fe,Ao)):M||{};return Object.assign({[ee.model||"modelValue"]:Y.value,[`onUpdate:${ee.model||"modelValue"}`]:N},ie.value)})}return Object.assign(Object.assign({},q),{values:a.readonly(c),handleReset:()=>lt(),submitForm:Me})}function z0(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!mt(e,a.unref(n)));function s(){const c=t.value;return Et(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const l=a.reactive(s());return a.watchEffect(()=>{const c=s();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(n)},l),{valid:l.valid&&!Et(r.value).length,dirty:o.value}))}function j0(t,e,n){const r=cd(n),i=a.ref(r),o=a.ref(De(r));function s(l,c=!1){i.value=Ei(De(i.value)||{},De(l)),o.value=Ei(De(o.value)||{},De(l)),c&&t.value.forEach(d=>{if(d.touched)return;const f=xt(i.value,d.path);gn(e,d.path,De(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function H0(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const W0=a.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:null,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(t,e){const n=a.toRef(t,"validationSchema"),r=a.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:l,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetField:O}=F0({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),D=y((S,{evt:B})=>{Wc(B)&&B.target.submit()},t.onInvalidSubmit),A=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):D;function I(S){Qs(S)&&S.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function L(S,B){return y(typeof S=="function"&&!B?S:B,t.onInvalidSubmit)(S)}function R(){return De(s)}function K(){return De(l.value)}function H(){return De(i.value)}function $(){return{meta:l.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:c.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:L,handleReset:m,submitForm:D,setErrors:k,setFieldError:x,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetForm:g,resetField:O,getValues:R,getMeta:K,getErrors:H}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:w,setValues:b,setFieldTouched:C,setTouched:v,resetForm:g,validate:h,validateField:p,resetField:O,getValues:R,getMeta:K,getErrors:H,values:s,meta:l,errors:i}),function(){const B=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,z=ol(B,e,$);if(!B)return z;const X=B==="form"?{novalidate:!0}:{};return a.h(B,Object.assign(Object.assign(Object.assign({},X),e.attrs),{onSubmit:A,onReset:I}),z)}}}),U0=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Si,void 0),r=a.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?a.resolveDynamicComponent(t.as):t.as,s=ol(o,e,i),l=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?a.h(o||"span",l,r.value):a.h(o,l,s)}}});function Y0(t){const e=nl(Si),n=t?void 0:a.inject(jc);return a.computed(()=>t?e==null?void 0:e.errors.value[a.toValue(t)]:n==null?void 0:n.errorMessage.value)}Gt("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),Gt("email",t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid email"}),Gt("strong_password",t=>t?t.indexOf(" ")>-1?"Password shouldn't contain space":t.length<8||t.length>30?"Password must be between 8 and 30 characters":t.match(/[a-z]/)===null||t.match(/[A-Z]/)===null||t.match(/\d/)===null?"Password must contain at least one uppercase letter, one lowercase letter and one number digit":!0:"Password is required"),Gt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),Gt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),Gt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),Gt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),Gt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),Gt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),Gt("url",t=>{var e=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid URL"}),Gt("number",t=>parseFloat(t)?!0:"This field must be a number");const be=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},q0={},K0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},G0=[a.createElementVNode("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"},null,-1)];function J0(t,e){return a.openBlock(),a.createElementBlock("svg",K0,G0)}const Z0=be(q0,[["render",J0]]),X0={},Q0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},ey=[a.createElementVNode("path",{d:"M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"},null,-1)];function ty(t,e){return a.openBlock(),a.createElementBlock("svg",Q0,ey)}const ny=be(X0,[["render",ty]]),ry={class:"relative"},Fr=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",ry,[a.createVNode(Z0,{class:"absolute opacity-25"}),a.createVNode(ny,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let he={theme:"wpic-tools",popoverTarget:"body"};const iy=["is","type","disabled"],oy={key:0,class:"absolute inset-0 flex justify-center items-center"},sy={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},ly=["onClick"],Ni=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled:Boolean,highlightDisabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object],actions:{}},setup(t){const e=t,n=a.ref(null),r=a.ref(null),i=a.ref(!1),o=a.computed(()=>e.to?"router-link":"div"),s=k=>{r.value&&!r.value.contains(k.target)&&n.value&&!n.value.contains(k.target)&&(i.value=!1)};a.onMounted(()=>{document.addEventListener("click",s)}),a.onUnmounted(()=>{document.removeEventListener("click",s)});const l={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},c={pmi:"","wpic-tools":"border-none ring-1 ring-black/5 dark:ring-white/10 bg-transparent text-iron-700 disabled:text-iron-700/50 enabled:hover:bg-iron-900/5 enabled:active:bg-iron-200 enabled:active:shadow-inner dark:enabled:border-iron-900 dark:disabled:border-iron-900 dark:text-iron-200 dark:enabled:hover:bg-iron-900 dark:enabled:active:bg-iron-930 dark:disabled:text-iron-400/50"},d={pmi:"","wpic-tools":"bg-transparent text-red-600 disabled:text-red-600/50 enabled:hover:bg-red-500/5 enabled:active:bg-red-100 enabled:active:shadow-inner dark:text-red-400 dark:enabled:hover:bg-red-500/10 dark:enabled:active:bg-red-500/25 dark:disabled:text-red-500/50"},u={pmi:"bg-violet-800 border border-violet-800 focus:bg-violet-800 text-white disabled:bg-zinc-100 disabled:text-zinc-400 disabled:border-zinc-100 enabled:hover:bg-violet-900 enabled:hover:border-violet-900 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b bg-wpic-600 text-white disabled:text-white/50 border-none shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-wpic-500 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:bg-wpic-700 dark:enabled:active:shadow-inner dark:enabled:hover:bg-wpic-600"},f={pmi:"bg-white text-violet-800 border-zinc-400 dark:border-zinc-700 dark:text-zinc-200 dark:bg-zinc-700 dark:hover:bg-zinc-600 dark:hover:border-zinc-600 disabled:text-zinc-400 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b bg-iron-100 text-iron-800 disabled:text-iron-800/50 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-iron-200 enabled:active:bg-iron-300 enabled:active:text-iron-800/80 dark:enabled:active:text-iron-200/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200 dark:bg-iron-900 dark:disabled:text-iron-200/50 dark:enabled:active:shadow-inner dark:enabled:hover:bg-iron-800 dark:enabled:active:bg-iron-700"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b bg-red-500 disabled:text-red-600/50 border-red-500 enabled:hover:bg-red-400 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:hover:border-red-600 enabled:active:shadow-inner enabled:active:text-white/80 enabled:active:bg-red-700 enabled:active:border-red-700 dark:bg-red-400/70 dark:border-red-400/70"},p={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":" text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/10 shadow-xs enabled:hover:bg-gray-50 enabled:active:text-gray-950/60 bg-white dark:ring-1 dark:disabled:text-white/50 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] enabled:active:shadow-inner dark:hover:bg-white/10 dark:enabled:active:text-white/80 dark:disabled:text-iron-200/50 dark:text-iron-200 dark:active:shadow-inner dark:bg-iron-900 dark:hover:bg-iron-800 dark:active:bg-iron-700"},m={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},g={pmi:"text-red-600 hover:text-red-500 hover:underline","wpic-tools":"text-red-600 disabled:text-red-600/50 hover:text-red-500 dark:text-red-400 dark:hover:text-red-500 hover:underline"},y={pmi:"hover:text-violet-800 hover:underline","wpic-tools":"dark:text-gray-200 hover:text-lime-800 hover:underline"};return(k,x)=>{var w;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:x[0]||(x[0]=b=>{var C;return(C=t.actions)!=null&&C.length?i.value=!i.value:null}),class:a.normalizeClass([{"cursor-pointer":!t.disabled&&!t.loading,"active:outline active:outline-2 active:outline-offset-4":!t.disabled&&!t.loading&&t.outlining,"cursor-not-allowed":t.disabled&&!t.hideDisabled,"":t.outline&&!t.plain,"ring-0!":!t.outline,[`${l[a.unref(he).theme]}`]:!0,[`${u[a.unref(he).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(he).theme]}`]:t.secondary,[`${p[a.unref(he).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(he).theme]}`]:t.primary&&t.plain,[`${y[a.unref(he).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(he).theme]}`]:t.colorless,[`${h[a.unref(he).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[a.unref(he).theme]}`]:t.destructive&&t.plain,[`${d[a.unref(he).theme]}`]:t.destructive&&t.colorless,"text-violet-500! dark:!text-violet-500/75":t.highlightDisabled&&t.disabled,"bg-zinc-50 border-violet-800 text-violet-800":t.primary&&t.inverse,"hover:bg-white":t.primary&&t.inverse&&!t.disabled&&!t.loading,"w-full":t.full,"text-opacity-50":t.disabled,"h-auto":t.plain,"rounded-sm":!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-hidden relative inline-flex justify-center items-center"])},[t.loading?(a.openBlock(),a.createElementBlock("div",oy,[a.createVNode(Fr,{class:"w-6 h-6"})])):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.value),{to:t.to,class:a.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{medium:t.medium,small:t.small,"opacity-0":t.loading,"px-2":!!(t.small&&!t.plain),"px-3":!!(t.medium&&!t.plain),"px-4":!t.small&&!t.medium&&!t.plain,"px-0! aspect-square":t.square}])},{default:a.withCtx(()=>[a.renderSlot(k.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(w=t.actions)!=null&&w.length&&i.value?(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[a.createElementVNode("div",sy,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,b=>(a.openBlock(),a.createElementBlock("div",{onClick:b.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(b.label),9,ly))),256))])],512)):a.createCommentVNode("",!0)],10,iy)}}}),ay=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[a.unref(he).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),cy={name:"WpicInputGroup"},dy={class:"wpic-input-group flex w-full"};function uy(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",dy,[a.renderSlot(t.$slots,"default")])}const fy=be(cy,[["render",uy]]),hy=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=a.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(l,c)=>(a.openBlock(),a.createBlock(a.unref(W0),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Mi=Math.min,zr=Math.max,Do=Math.round,Bn=t=>({x:t,y:t}),py={left:"right",right:"left",bottom:"top",top:"bottom"},my={start:"end",end:"start"};function cl(t,e,n){return zr(t,Mi(e,n))}function Ai(t,e){return typeof t=="function"?t(e):t}function dr(t){return t.split("-")[0]}function Di(t){return t.split("-")[1]}function dd(t){return t==="x"?"y":"x"}function dl(t){return t==="y"?"height":"width"}function Lo(t){return["top","bottom"].includes(dr(t))?"y":"x"}function ul(t){return dd(Lo(t))}function gy(t,e,n){n===void 0&&(n=!1);const r=Di(t),i=ul(t),o=dl(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Bo(s)),[s,Bo(s)]}function yy(t){const e=Bo(t);return[fl(t),e,fl(e)]}function fl(t){return t.replace(/start|end/g,e=>my[e])}function by(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function ky(t,e,n,r){const i=Di(t);let o=by(dr(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(fl)))),o}function Bo(t){return t.replace(/left|right|bottom|top/g,e=>py[e])}function wy(t){return{top:0,right:0,bottom:0,left:0,...t}}function ud(t){return typeof t!="number"?wy(t):{top:t,right:t,bottom:t,left:t}}function Io(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function fd(t,e,n){let{reference:r,floating:i}=t;const o=Lo(e),s=ul(e),l=dl(s),c=dr(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(c){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Di(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const vy=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=fd(d,r,c),h=r,p={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:k}=l[g],{x,y:w,data:b,reset:C}=await k({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=x??u,f=w??f,p={...p,[y]:{...p[y],...b}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(d=C.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):C.rects),{x:u,y:f}=fd(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function hd(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ai(e,t),m=ud(p),y=l[h?f==="floating"?"reference":"floating":f],k=Io(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),b=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Io(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(k.top-C.top+m.top)/b.y,bottom:(C.bottom-k.bottom+m.bottom)/b.y,left:(k.left-C.left+m.left)/b.x,right:(C.right-k.right+m.right)/b.x}}const xy=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:c}=e,{element:d,padding:u=0}=Ai(t,e)||{};if(d==null)return{};const f=ud(u),h={x:n,y:r},p=ul(i),m=dl(p),g=await s.getDimensions(d),y=p==="y",k=y?"top":"left",x=y?"bottom":"right",w=y?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],C=h[p]-o.reference[p],v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let O=v?v[w]:0;(!O||!await(s.isElement==null?void 0:s.isElement(v)))&&(O=l.floating[w]||o.floating[m]);const D=b/2-C/2,A=O/2-g[m]/2-1,I=Mi(f[k],A),L=Mi(f[x],A),R=I,K=O-g[m]-L,H=O/2-g[m]/2+D,$=cl(R,H,K),S=!c.arrow&&Di(i)!=null&&H!==$&&o.reference[m]/2-(H<R?I:L)-g[m]/2<0,B=S?H<R?H-R:H-K:0;return{[p]:h[p]+B,data:{[p]:$,centerOffset:H-$-B,...S&&{alignmentOffset:B}},reset:S}}}),Ey=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Ai(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const k=dr(i),x=dr(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),b=h||(x||!g?[Bo(l)]:yy(l));!h&&m!=="none"&&b.push(...ky(l,g,m,w));const C=[l,...b],v=await hd(e,y),O=[];let D=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&O.push(v[k]),f){const R=gy(i,s,w);O.push(v[R[0]],v[R[1]])}if(D=[...D,{placement:i,overflows:O}],!O.every(R=>R<=0)){var A,I;const R=(((A=o.flip)==null?void 0:A.index)||0)+1,K=C[R];if(K)return{data:{index:R,overflows:D},reset:{placement:K}};let H=(I=D.filter($=>$.overflows[0]<=0).sort(($,S)=>$.overflows[1]-S.overflows[1])[0])==null?void 0:I.placement;if(!H)switch(p){case"bestFit":{var L;const $=(L=D.map(S=>[S.placement,S.overflows.filter(B=>B>0).reduce((B,z)=>B+z,0)]).sort((S,B)=>S[1]-B[1])[0])==null?void 0:L[0];$&&(H=$);break}case"initialPlacement":H=l;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function Cy(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=dr(n),l=Di(n),c=Lo(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=Ai(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Sy=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=e,c=await Cy(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},_y=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:y=>{let{x:k,y:x}=y;return{x:k,y:x}}},...c}=Ai(t,e),d={x:n,y:r},u=await hd(e,c),f=Lo(dr(i)),h=dd(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=p+u[y],w=p-u[k];p=cl(x,p,w)}if(s){const y=f==="y"?"top":"left",k=f==="y"?"bottom":"right",x=m+u[y],w=m-u[k];m=cl(x,m,w)}const g=l.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function ur(t){return hl(t)?(t.nodeName||"").toLowerCase():"#document"}function Dt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function In(t){var e;return(e=(hl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function hl(t){return t instanceof Node||t instanceof Dt(t).Node}function rn(t){return t instanceof Element||t instanceof Dt(t).Element}function on(t){return t instanceof HTMLElement||t instanceof Dt(t).HTMLElement}function pd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dt(t).ShadowRoot}function Li(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Zt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Oy(t){return["table","td","th"].includes(ur(t))}function pl(t){const e=ml(),n=Zt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ty(t){let e=$n(t);for(;on(e)&&!jr(e);){if(pl(e))return e;e=$n(e)}return null}function ml(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jr(t){return["html","body","#document"].includes(ur(t))}function Zt(t){return Dt(t).getComputedStyle(t)}function $o(t){return rn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function $n(t){if(ur(t)==="html")return t;const e=t.assignedSlot||t.parentNode||pd(t)&&t.host||In(t);return pd(e)?e.host:e}function md(t){const e=$n(t);return jr(e)?t.ownerDocument?t.ownerDocument.body:t.body:on(e)&&Li(e)?e:md(e)}function gl(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=md(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Dt(i);return o?e.concat(s,s.visualViewport||[],Li(i)?i:[],s.frameElement&&n?gl(s.frameElement):[]):e.concat(i,gl(i,[],n))}function gd(t){const e=Zt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=on(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Do(n)!==o||Do(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function yd(t){return rn(t)?t:t.contextElement}function Hr(t){const e=yd(t);if(!on(e))return Bn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=gd(e);let s=(o?Do(n.width):n.width)/r,l=(o?Do(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Ny=Bn(0);function bd(t){const e=Dt(t);return!ml()||!e.visualViewport?Ny:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function My(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Dt(t)?!1:e}function Bi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=yd(t);let s=Bn(1);e&&(r?rn(r)&&(s=Hr(r)):s=Hr(t));const l=My(o,n,r)?bd(o):Bn(0);let c=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=Dt(o),p=r&&rn(r)?Dt(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Hr(g),k=g.getBoundingClientRect(),x=Zt(g),w=k.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,b=k.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=w,d+=b,m=Dt(g),g=m.frameElement}}return Io({width:u,height:f,x:c,y:d})}const Ay=[":popover-open",":modal"];function yl(t){return Ay.some(e=>{try{return t.matches(e)}catch{return!1}})}function Dy(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=In(r),l=e?yl(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Bn(1);const u=Bn(0),f=on(r);if((f||!f&&!o)&&((ur(r)!=="body"||Li(s))&&(c=$o(r)),on(r))){const h=Bi(r);d=Hr(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function Ly(t){return Array.from(t.getClientRects())}function kd(t){return Bi(In(t)).left+$o(t).scrollLeft}function By(t){const e=In(t),n=$o(t),r=t.ownerDocument.body,i=zr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=zr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+kd(t);const l=-n.scrollTop;return Zt(r).direction==="rtl"&&(s+=zr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function Iy(t,e){const n=Dt(t),r=In(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;const d=ml();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function $y(t,e){const n=Bi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=on(t)?Hr(t):Bn(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:l,x:c,y:d}}function wd(t,e,n){let r;if(e==="viewport")r=Iy(t,n);else if(e==="document")r=By(In(t));else if(rn(e))r=$y(e,n);else{const i=bd(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Io(r)}function vd(t,e){const n=$n(t);return n===e||!rn(n)||jr(n)?!1:Zt(n).position==="fixed"||vd(n,e)}function Vy(t,e){const n=e.get(t);if(n)return n;let r=gl(t,[],!1).filter(l=>rn(l)&&ur(l)!=="body"),i=null;const o=Zt(t).position==="fixed";let s=o?$n(t):t;for(;rn(s)&&!jr(s);){const l=Zt(s),c=pl(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Li(s)&&!c&&vd(t,s))?r=r.filter(u=>u!==s):i=l,s=$n(s)}return e.set(t,r),r}function Py(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?yl(e)?[]:Vy(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=wd(e,u,i);return d.top=zr(f.top,d.top),d.right=Mi(f.right,d.right),d.bottom=Mi(f.bottom,d.bottom),d.left=zr(f.left,d.left),d},wd(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ry(t){const{width:e,height:n}=gd(t);return{width:e,height:n}}function Fy(t,e,n){const r=on(e),i=In(e),o=n==="fixed",s=Bi(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const c=Bn(0);if(r||!r&&!o)if((ur(e)!=="body"||Li(i))&&(l=$o(e)),r){const f=Bi(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=kd(i));const d=s.left+l.scrollLeft-c.x,u=s.top+l.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function bl(t){return Zt(t).position==="static"}function xd(t,e){return!on(t)||Zt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ed(t,e){const n=Dt(t);if(yl(t))return n;if(!on(t)){let i=$n(t);for(;i&&!jr(i);){if(rn(i)&&!bl(i))return i;i=$n(i)}return n}let r=xd(t,e);for(;r&&Oy(r)&&bl(r);)r=xd(r,e);return r&&jr(r)&&bl(r)&&!pl(r)?n:r||Ty(t)||n}const zy=async function(t){const e=this.getOffsetParent||Ed,n=this.getDimensions,r=await n(t.floating);return{reference:Fy(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function jy(t){return Zt(t).direction==="rtl"}const Hy={convertOffsetParentRelativeRectToViewportRelativeRect:Dy,getDocumentElement:In,getClippingRect:Py,getOffsetParent:Ed,getElementRects:zy,getClientRects:Ly,getDimensions:Ry,getScale:Hr,isElement:rn,isRTL:jy},Cd=Sy,Sd=_y,_d=Ey,Wy=xy,Od=(t,e,n)=>{const r=new Map,i={platform:Hy,...n},o={...i.platform,_c:r};return vy(t,e,{...i,platform:o})};function Uy(t){return t!=null&&typeof t=="object"&&"$el"in t}function Yy(t){if(Uy(t)){const e=t.$el;return hl(e)&&ur(e)==="#comment"?null:e}return t}function qy(t){return{name:"arrow",options:t,fn(e){const n=Yy(a.unref(t.element));return n==null?{}:Wy({element:n,padding:t.padding}).fn(e)}}}const Ky={},Gy={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Jy=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function Zy(t,e){return a.openBlock(),a.createElementBlock("svg",Gy,Jy)}const Ii=be(Ky,[["render",Zy]]);let Vo;const Xy=new Uint8Array(16);function Qy(){if(!Vo&&(Vo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vo(Xy)}const nt=[];for(let t=0;t<256;++t)nt.push((t+256).toString(16).slice(1));function e1(t,e=0){return nt[t[e+0]]+nt[t[e+1]]+nt[t[e+2]]+nt[t[e+3]]+"-"+nt[t[e+4]]+nt[t[e+5]]+"-"+nt[t[e+6]]+nt[t[e+7]]+"-"+nt[t[e+8]]+nt[t[e+9]]+"-"+nt[t[e+10]]+nt[t[e+11]]+nt[t[e+12]]+nt[t[e+13]]+nt[t[e+14]]+nt[t[e+15]]}const Td={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function kl(t,e,n){if(Td.randomUUID&&!t)return Td.randomUUID();t=t||{};const r=t.random||(t.rng||Qy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,e1(r)}let t1={isMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},capitalize(t){return t?(t=t.toString(),t=t.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()}).trim(),t.charAt(0).toUpperCase()+t.slice(1)):""},sortByKey(t,e,n="asc"){return[...t].sort((r,i)=>{let o=r[e],s=i[e];const l=!isNaN(Date.parse(o))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(o),c=!isNaN(Date.parse(s))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(s);if(l&&c)o=new Date(o).getTime(),s=new Date(s).getTime();else{const d=parseFloat(o),u=parseFloat(s),f=!isNaN(d)&&typeof o!="boolean",h=!isNaN(u)&&typeof s!="boolean";f&&h?(o=d,s=u):(o=String(o).toLowerCase(),s=String(s).toLowerCase())}return n==="asc"?o>s?1:o<s?-1:0:o<s?1:o>s?-1:0})}};const fr=Object.assign({name:"WpicPopover"},{inheritAttrs:!1},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},transparent:Boolean,noBorder:Boolean,noShadow:Boolean,expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=kl(),i=n,o=t,s={pmi:"md:absolute md:block bg-white shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"block absolute mt-2 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},l=a.ref(null),c=a.ref(null),d=a.ref(!0);function u(){o.disabled||(d.value=!1,p()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(x){if(d.value)u();else{if(o.noCloseClasses.some(w=>x.target.closest(`.${w}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const x=await Od(l.value,c.value,{placement:o.placement,middleware:[_d(),Sd(),Cd(o.offset)]});c.value.style.left=`${x.x}px`,c.value.style.top=`${x.y}px`}const m=x=>{if(d.value)return;const w=x.target;c.value&&!c.value.contains(w)&&l.value&&!l.value.contains(w)&&h()},g=x=>{x.detail.uuid!==r&&h()};a.onMounted(()=>{document.addEventListener("pointerdown",m),document.addEventListener("submenu-open",g)}),a.onUnmounted(()=>{document.removeEventListener("pointerdown",m),document.removeEventListener("submenu-open",g)});function y(){o.hover&&u()}function k(){o.hover&&h()}return e({hide:h}),(x,w)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[(a.openBlock(),a.createElementBlock("div",a.mergeProps({class:"flex-1",key:`reference_${a.unref(r)}`,ref_key:"reference",ref:l},x.$attrs,{onMouseenter:y,onMouseleave:k,onClick:w[0]||(w[0]=a.withModifiers(b=>f(b),["stop"]))}),[a.renderSlot(x.$slots,"default",{isHidden:d.value})],16)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(he).popoverTarget},[(a.openBlock(),a.createElementBlock("div",{key:`floating_${a.unref(r)}`,ref_key:"floating",ref:c,style:a.normalizeStyle({maxWidth:t.maxWidth}),class:a.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[a.unref(he).theme]}`]:!d.value,"bg-transparent!":t.transparent,"border-none!":t.noBorder,"shadow-none":t.noShadow,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(x.$slots,"content")],6))],8,["to"]))],64))}});/*!
6
6
  * shared v9.14.4
7
7
  * (c) 2025 kazuya kawaguchi
8
8
  * Released under the MIT License.
@@ -24,7 +24,7 @@ ${d}`:c)}else throw s},onCacheKey:s=>r1(e,n,s)}}function Rb(t){if(le(t))return t
24
24
  * vue-i18n v9.14.4
25
25
  * (c) 2025 kazuya kawaguchi
26
26
  * Released under the MIT License.
27
- */const zb="9.14.4";function jb(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(wn().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(wn().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(wn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(wn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(wn().__INTLIFY_PROD_DEVTOOLS__=!1)}const Lu=yt.__EXTEND_POINT__,En=Ro(Lu),St={FALLBACK_TO_ROOT:Lu,NOT_SUPPORTED_PRESERVE:En(),NOT_SUPPORTED_FORMATTER:En(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:En(),NOT_SUPPORTED_GET_CHOICE_INDEX:En(),COMPONENT_NAME_LEGACY_COMPATIBLE:En(),NOT_FOUND_PARENT_SCOPE:En(),IGNORE_OBJ_FLATTEN:En(),NOTICE_DROP_ALLOW_COMPOSITION:En(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:En()},Hb={[St.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[St.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[St.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[St.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[St.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[St.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[St.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[St.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[St.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[St.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function Ko(t,...e){return wl(Hb[t],...e)}const Bu=Ze.__EXTEND_POINT__,_t=Ro(Bu),Re={UNEXPECTED_RETURN_TYPE:Bu,INVALID_ARGUMENT:_t(),MUST_BE_CALL_SETUP_TOP:_t(),NOT_INSTALLED:_t(),NOT_AVAILABLE_IN_LEGACY_MODE:_t(),REQUIRED_VALUE:_t(),INVALID_VALUE:_t(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:_t(),NOT_INSTALLED_WITH_PROVIDE:_t(),UNEXPECTED_ERROR:_t(),NOT_COMPATIBLE_LEGACY_VUE_I18N:_t(),BRIDGE_SUPPORT_VUE_2_ONLY:_t(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:_t(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:_t(),__EXTEND_POINT__:_t()};function Fn(t,...e){return Ur(t,null,process.env.NODE_ENV!=="production"?{messages:Wb,args:e}:void 0)}const Wb={[Re.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Re.INVALID_ARGUMENT]:"Invalid argument",[Re.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Re.NOT_INSTALLED]:"Need to install with `app.use` function",[Re.UNEXPECTED_ERROR]:"Unexpected error",[Re.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[Re.REQUIRED_VALUE]:"Required in value: {0}",[Re.INVALID_VALUE]:"Invalid value",[Re.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Re.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Re.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Re.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},Dl=kn("__translateVNode"),Ll=kn("__datetimeParts"),Bl=kn("__numberParts"),Il=kn("__enableEmitter"),$l=kn("__disableEmitter"),Ub=kn("__setPluralRules"),Iu=kn("__injectWithOption"),Vl=kn("__dispose");function Fi(t){if(!Ne(t)||en(t))return t;for(const e in t)if(Xt(t,e))if(!e.includes("."))Ne(t[e])&&Fi(t[e]);else{const n=e.split("."),r=n.length-1;let i=t,o=!1;for(let s=0;s<r;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in i||(i[n[s]]=Le()),!Ne(i[n[s]])){process.env.NODE_ENV!=="production"&&vn(Ko(St.IGNORE_OBJ_FLATTEN,{key:n[s]})),o=!0;break}i=i[n[s]]}if(o||(en(i)?Zd.includes(n[r])||delete t[e]:(i[n[r]]=t[e],delete t[e])),!en(i)){const s=i[n[r]];Ne(s)&&Fi(s)}}return t}function Pl(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:o}=e,s=_e(n)?n:Ue(r)?Le():{[t]:Le()};if(Ue(r)&&r.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:c,resource:d}=l;c?(s[c]=s[c]||Le(),zo(d,s[c])):zo(d,s)}else le(l)&&zo(JSON.parse(l),s)}),i==null&&o)for(const l in s)Xt(s,l)&&Fi(s[l]);return s}function $u(t){return t.type}function Yb(t,e,n){let r=Ne(e.messages)?e.messages:Le();"__i18nGlobal"in n&&(r=Pl(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(o=>{t.mergeLocaleMessage(o,r[o])});{if(Ne(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(s=>{t.mergeDateTimeFormat(s,e.datetimeFormats[s])})}if(Ne(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(s=>{t.mergeNumberFormat(s,e.numberFormats[s])})}}}function Vu(t){return a.createVNode(a.Text,null,t,0)}const Pu="__INTLIFY_META__",Ru=()=>[],qb=()=>!1;let Fu=0;function zu(t){return(e,n,r,i)=>t(n,r,a.getCurrentInstance()||void 0,i)}const Kb=()=>{const t=a.getCurrentInstance();let e=null;return t&&(e=$u(t)[Pu])?{[Pu]:e}:null};function Gb(t={},e){const{__root:n,__injectWithOption:r}=t,i=n===void 0,o=t.flatJson,s=bn?a.ref:a.shallowRef,l=!!t.translateExistCompatible;process.env.NODE_ENV!=="production"&&l&&Id(Ko(St.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let c=Ie(t.inheritLocale)?t.inheritLocale:!0;const d=s(n&&c?n.locale.value:le(t.locale)?t.locale:Pi),u=s(n&&c?n.fallbackLocale.value:le(t.fallbackLocale)||Ue(t.fallbackLocale)||_e(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:d.value),f=s(Pl(d.value,t)),h=s(_e(t.datetimeFormats)?t.datetimeFormats:{[d.value]:{}}),p=s(_e(t.numberFormats)?t.numberFormats:{[d.value]:{}});let m=n?n.missingWarn:Ie(t.missingWarn)||Wr(t.missingWarn)?t.missingWarn:!0,g=n?n.fallbackWarn:Ie(t.fallbackWarn)||Wr(t.fallbackWarn)?t.fallbackWarn:!0,y=n?n.fallbackRoot:Ie(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,x=Ve(t.missing)?t.missing:null,w=Ve(t.missing)?zu(t.missing):null,b=Ve(t.postTranslation)?t.postTranslation:null,C=n?n.warnHtmlMessage:Ie(t.warnHtmlMessage)?t.warnHtmlMessage:!0,v=!!t.escapeParameter;const O=n?n.modifiers:_e(t.modifiers)?t.modifiers:{};let D=t.pluralRules||n&&n.pluralRules,A;A=(()=>{i&&fu(null);const F={version:zb,locale:d.value,fallbackLocale:u.value,messages:f.value,modifiers:O,pluralRules:D,missing:w===null?void 0:w,missingWarn:m,fallbackWarn:g,fallbackFormat:k,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:C,escapeParameter:v,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};F.datetimeFormats=h.value,F.numberFormats=p.value,F.__datetimeFormatters=_e(A)?A.__datetimeFormatters:void 0,F.__numberFormatters=_e(A)?A.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(F.__v_emitter=_e(A)?A.__v_emitter:void 0);const Q=Mb(F);return i&&fu(Q),Q})(),Ri(A,d.value,u.value);function L(){return[d.value,u.value,f.value,h.value,p.value]}const R=a.computed({get:()=>d.value,set:F=>{d.value=F,A.locale=d.value}}),K=a.computed({get:()=>u.value,set:F=>{u.value=F,A.fallbackLocale=u.value,Ri(A,d.value,F)}}),H=a.computed(()=>f.value),$=a.computed(()=>h.value),S=a.computed(()=>p.value);function B(){return Ve(b)?b:null}function z(F){b=F,A.postTranslation=F}function X(){return x}function j(F){F!==null&&(w=zu(F)),x=F,A.missing=w}function te(F,Q){return F!=="translate"||!Q.resolvedMessage}const re=(F,Q,T,M,Y,ie)=>{L();let fe;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=n?Nb():void 0),fe=F(A)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=void 0)}if(T!=="translate exists"&&Je(fe)&&fe===Uo||T==="translate exists"&&!fe){const[N,ee]=Q();if(process.env.NODE_ENV!=="production"&&n&&le(N)&&te(T,ee)&&(y&&(qo(g,N)||pu(m,N))&&vn(Ko(St.FALLBACK_TO_ROOT,{key:N,type:T})),process.env.NODE_ENV!=="production")){const{__v_emitter:se}=A;se&&y&&se.emit("fallback",{type:T,key:N,to:"global",groupId:`${T}:${N}`})}return n&&y?M(n):Y(N)}else{if(ie(fe))return fe;throw Fn(Re.UNEXPECTED_RETURN_TYPE)}};function P(...F){return re(Q=>Reflect.apply(xu,null,[Q,...F]),()=>Nl(...F),"translate",Q=>Reflect.apply(Q.t,Q,[...F]),Q=>Q,Q=>le(Q))}function W(...F){const[Q,T,M]=F;if(M&&!Ne(M))throw Fn(Re.INVALID_ARGUMENT);return P(Q,T,dt({resolvedMessage:!0},M||{}))}function G(...F){return re(Q=>Reflect.apply(Ou,null,[Q,...F]),()=>Ml(...F),"datetime format",Q=>Reflect.apply(Q.d,Q,[...F]),()=>Yo,Q=>le(Q))}function q(...F){return re(Q=>Reflect.apply(Mu,null,[Q,...F]),()=>Al(...F),"number format",Q=>Reflect.apply(Q.n,Q,[...F]),()=>Yo,Q=>le(Q))}function V(F){return F.map(Q=>le(Q)||Je(Q)||Ie(Q)?Vu(String(Q)):Q)}const ce={normalize:V,interpolate:F=>F,type:"vnode"};function we(...F){return re(Q=>{let T;const M=Q;try{M.processor=ce,T=Reflect.apply(xu,null,[M,...F])}finally{M.processor=null}return T},()=>Nl(...F),"translate",Q=>Q[Dl](...F),Q=>[Vu(Q)],Q=>Ue(Q))}function Se(...F){return re(Q=>Reflect.apply(Mu,null,[Q,...F]),()=>Al(...F),"number format",Q=>Q[Bl](...F),Ru,Q=>le(Q)||Ue(Q))}function Be(...F){return re(Q=>Reflect.apply(Ou,null,[Q,...F]),()=>Ml(...F),"datetime format",Q=>Q[Ll](...F),Ru,Q=>le(Q)||Ue(Q))}function je(F){D=F,A.pluralRules=D}function ne(F,Q){return re(()=>{if(!F)return!1;const T=le(Q)?Q:d.value,M=lt(T),Y=A.messageResolver(M,F);return l?Y!=null:en(Y)||zt(Y)||le(Y)},()=>[F],"translate exists",T=>Reflect.apply(T.te,T,[F,Q]),qb,T=>Ie(T))}function Ee(F){let Q=null;const T=ru(A,u.value,d.value);for(let M=0;M<T.length;M++){const Y=f.value[T[M]]||{},ie=A.messageResolver(Y,F);if(ie!=null){Q=ie;break}}return Q}function At(F){const Q=Ee(F);return Q??(n?n.tm(F)||{}:{})}function lt(F){return f.value[F]||{}}function at(F,Q){if(o){const T={[F]:Q};for(const M in T)Xt(T,M)&&Fi(T[M]);Q=T[F]}f.value[F]=Q,A.messages=f.value}function pt(F,Q){f.value[F]=f.value[F]||{};const T={[F]:Q};if(o)for(const M in T)Xt(T,M)&&Fi(T[M]);Q=T[F],zo(Q,f.value[F]),A.messages=f.value}function E(F){return h.value[F]||{}}function _(F,Q){h.value[F]=Q,A.datetimeFormats=h.value,Nu(A,F,Q)}function U(F,Q){h.value[F]=dt(h.value[F]||{},Q),A.datetimeFormats=h.value,Nu(A,F,Q)}function ae(F){return p.value[F]||{}}function Me(F,Q){p.value[F]=Q,A.numberFormats=p.value,Du(A,F,Q)}function Oe(F,Q){p.value[F]=dt(p.value[F]||{},Q),A.numberFormats=p.value,Du(A,F,Q)}Fu++,n&&bn&&(a.watch(n.locale,F=>{c&&(d.value=F,A.locale=F,Ri(A,d.value,u.value))}),a.watch(n.fallbackLocale,F=>{c&&(u.value=F,A.fallbackLocale=F,Ri(A,d.value,u.value))}));const Te={id:Fu,locale:R,fallbackLocale:K,get inheritLocale(){return c},set inheritLocale(F){c=F,F&&n&&(d.value=n.locale.value,u.value=n.fallbackLocale.value,Ri(A,d.value,u.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:H,get modifiers(){return O},get pluralRules(){return D||{}},get isGlobal(){return i},get missingWarn(){return m},set missingWarn(F){m=F,A.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn(F){g=F,A.fallbackWarn=g},get fallbackRoot(){return y},set fallbackRoot(F){y=F},get fallbackFormat(){return k},set fallbackFormat(F){k=F,A.fallbackFormat=k},get warnHtmlMessage(){return C},set warnHtmlMessage(F){C=F,A.warnHtmlMessage=F},get escapeParameter(){return v},set escapeParameter(F){v=F,A.escapeParameter=F},t:P,getLocaleMessage:lt,setLocaleMessage:at,mergeLocaleMessage:pt,getPostTranslationHandler:B,setPostTranslationHandler:z,getMissingHandler:X,setMissingHandler:j,[Ub]:je};return Te.datetimeFormats=$,Te.numberFormats=S,Te.rt=W,Te.te=ne,Te.tm=At,Te.d=G,Te.n=q,Te.getDateTimeFormat=E,Te.setDateTimeFormat=_,Te.mergeDateTimeFormat=U,Te.getNumberFormat=ae,Te.setNumberFormat=Me,Te.mergeNumberFormat=Oe,Te[Iu]=r,Te[Dl]=we,Te[Ll]=Be,Te[Bl]=Se,process.env.NODE_ENV!=="production"&&(Te[Il]=F=>{A.__v_emitter=F},Te[$l]=()=>{A.__v_emitter=void 0}),Te}const Rl={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function Jb({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===a.Fragment?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},Le())}function ju(t){return a.Fragment}dt({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Je(t)||!isNaN(t)}},Rl);function Zb(t){return Ue(t)&&!le(t[0])}function Hu(t,e,n,r){const{slots:i,attrs:o}=e;return()=>{const s={part:!0};let l=Le();t.locale&&(s.locale=t.locale),le(t.format)?s.key=t.format:Ne(t.format)&&(le(t.format.key)&&(s.key=t.format.key),l=Object.keys(t.format).reduce((h,p)=>n.includes(p)?dt(Le(),h,{[p]:t.format[p]}):h,Le()));const c=r(t.value,s,l);let d=[s.key];Ue(c)?d=c.map((h,p)=>{const m=i[h.type],g=m?m({[h.type]:h.value,index:p,parts:c}):[h.value];return Zb(g)&&(g[0].key=`${h.type}-${p}`),g}):le(c)&&(d=[c]);const u=dt(Le(),o),f=le(t.tag)||Ne(t.tag)?t.tag:ju();return a.h(f,u,d)}}dt({value:{type:Number,required:!0},format:{type:[String,Object]}},Rl),dt({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Rl);function Wu(t,e){}const Xb=kn("global-vue-i18n");function zn(t={}){const e=a.getCurrentInstance();if(e==null)throw Fn(Re.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Fn(Re.NOT_INSTALLED);const n=Qb(e),r=tk(n),i=$u(e),o=ek(t,i);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!t.__useComponent){if(!n.allowComposition)throw Fn(Re.NOT_AVAILABLE_IN_LEGACY_MODE);return ok(e,o,r,t)}if(o==="global")return Yb(r,t,i),r;if(o==="parent"){let c=nk(n,e,t.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&vn(Ko(St.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=n;let l=s.__getInstance(e);if(l==null){const c=dt({},t);"__i18n"in i&&(c.__i18n=i.__i18n),r&&(c.__root=r),l=Gb(c),s.__composerExtend&&(l[Vl]=s.__composerExtend(l)),ik(s,e,l),s.__setInstance(e,l)}return l}function Qb(t){{const e=a.inject(t.isCE?Xb:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Fn(t.isCE?Re.NOT_INSTALLED_WITH_PROVIDE:Re.UNEXPECTED_ERROR);return e}}function ek(t,e){return Po(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function tk(t){return t.mode==="composition"?t.global:t.global.__composer}function nk(t,e,n=!1){let r=null;const i=e.root;let o=rk(e,n);for(;o!=null;){const s=t;if(t.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const l=s.__getInstance(o);l!=null&&(r=l.__composer,n&&r&&!r[Iu]&&(r=null))}if(r!=null||i===o)break;o=o.parent}return r}function rk(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function ik(t,e,n){let r=null;a.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=f1();const i=n;i[Il]&&i[Il](r),r.on("*",Wu)}},e),a.onUnmounted(()=>{const i=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",Wu),i[$l]&&i[$l](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const o=i[Vl];o&&(o(),delete i[Vl])},e)}function ok(t,e,n,r={}){const i=e==="local",o=a.shallowRef(null);if(i&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw Fn(Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const s=Ie(r.inheritLocale)?r.inheritLocale:!le(r.locale),l=a.ref(!i||s?n.locale.value:le(r.locale)?r.locale:Pi),c=a.ref(!i||s?n.fallbackLocale.value:le(r.fallbackLocale)||Ue(r.fallbackLocale)||_e(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:l.value),d=a.ref(Pl(l.value,r)),u=a.ref(_e(r.datetimeFormats)?r.datetimeFormats:{[l.value]:{}}),f=a.ref(_e(r.numberFormats)?r.numberFormats:{[l.value]:{}}),h=i?n.missingWarn:Ie(r.missingWarn)||Wr(r.missingWarn)?r.missingWarn:!0,p=i?n.fallbackWarn:Ie(r.fallbackWarn)||Wr(r.fallbackWarn)?r.fallbackWarn:!0,m=i?n.fallbackRoot:Ie(r.fallbackRoot)?r.fallbackRoot:!0,g=!!r.fallbackFormat,y=Ve(r.missing)?r.missing:null,k=Ve(r.postTranslation)?r.postTranslation:null,x=i?n.warnHtmlMessage:Ie(r.warnHtmlMessage)?r.warnHtmlMessage:!0,w=!!r.escapeParameter,b=i?n.modifiers:_e(r.modifiers)?r.modifiers:{},C=r.pluralRules||i&&n.pluralRules;function v(){return[l.value,c.value,d.value,u.value,f.value]}const O=a.computed({get:()=>o.value?o.value.locale.value:l.value,set:ne=>{o.value&&(o.value.locale.value=ne),l.value=ne}}),D=a.computed({get:()=>o.value?o.value.fallbackLocale.value:c.value,set:ne=>{o.value&&(o.value.fallbackLocale.value=ne),c.value=ne}}),A=a.computed(()=>o.value?o.value.messages.value:d.value),I=a.computed(()=>u.value),L=a.computed(()=>f.value);function R(){return o.value?o.value.getPostTranslationHandler():k}function K(ne){o.value&&o.value.setPostTranslationHandler(ne)}function H(){return o.value?o.value.getMissingHandler():y}function $(ne){o.value&&o.value.setMissingHandler(ne)}function S(ne){return v(),ne()}function B(...ne){return o.value?S(()=>Reflect.apply(o.value.t,null,[...ne])):S(()=>"")}function z(...ne){return o.value?Reflect.apply(o.value.rt,null,[...ne]):""}function X(...ne){return o.value?S(()=>Reflect.apply(o.value.d,null,[...ne])):S(()=>"")}function j(...ne){return o.value?S(()=>Reflect.apply(o.value.n,null,[...ne])):S(()=>"")}function te(ne){return o.value?o.value.tm(ne):{}}function re(ne,Ee){return o.value?o.value.te(ne,Ee):!1}function P(ne){return o.value?o.value.getLocaleMessage(ne):{}}function W(ne,Ee){o.value&&(o.value.setLocaleMessage(ne,Ee),d.value[ne]=Ee)}function G(ne,Ee){o.value&&o.value.mergeLocaleMessage(ne,Ee)}function q(ne){return o.value?o.value.getDateTimeFormat(ne):{}}function V(ne,Ee){o.value&&(o.value.setDateTimeFormat(ne,Ee),u.value[ne]=Ee)}function ue(ne,Ee){o.value&&o.value.mergeDateTimeFormat(ne,Ee)}function ce(ne){return o.value?o.value.getNumberFormat(ne):{}}function we(ne,Ee){o.value&&(o.value.setNumberFormat(ne,Ee),f.value[ne]=Ee)}function Se(ne,Ee){o.value&&o.value.mergeNumberFormat(ne,Ee)}const Be={get id(){return o.value?o.value.id:-1},locale:O,fallbackLocale:D,messages:A,datetimeFormats:I,numberFormats:L,get inheritLocale(){return o.value?o.value.inheritLocale:s},set inheritLocale(ne){o.value&&(o.value.inheritLocale=ne)},get availableLocales(){return o.value?o.value.availableLocales:Object.keys(d.value)},get modifiers(){return o.value?o.value.modifiers:b},get pluralRules(){return o.value?o.value.pluralRules:C},get isGlobal(){return o.value?o.value.isGlobal:!1},get missingWarn(){return o.value?o.value.missingWarn:h},set missingWarn(ne){o.value&&(o.value.missingWarn=ne)},get fallbackWarn(){return o.value?o.value.fallbackWarn:p},set fallbackWarn(ne){o.value&&(o.value.missingWarn=ne)},get fallbackRoot(){return o.value?o.value.fallbackRoot:m},set fallbackRoot(ne){o.value&&(o.value.fallbackRoot=ne)},get fallbackFormat(){return o.value?o.value.fallbackFormat:g},set fallbackFormat(ne){o.value&&(o.value.fallbackFormat=ne)},get warnHtmlMessage(){return o.value?o.value.warnHtmlMessage:x},set warnHtmlMessage(ne){o.value&&(o.value.warnHtmlMessage=ne)},get escapeParameter(){return o.value?o.value.escapeParameter:w},set escapeParameter(ne){o.value&&(o.value.escapeParameter=ne)},t:B,getPostTranslationHandler:R,setPostTranslationHandler:K,getMissingHandler:H,setMissingHandler:$,rt:z,d:X,n:j,tm:te,te:re,getLocaleMessage:P,setLocaleMessage:W,mergeLocaleMessage:G,getDateTimeFormat:q,setDateTimeFormat:V,mergeDateTimeFormat:ue,getNumberFormat:ce,setNumberFormat:we,mergeNumberFormat:Se};function je(ne){ne.locale.value=l.value,ne.fallbackLocale.value=c.value,Object.keys(d.value).forEach(Ee=>{ne.mergeLocaleMessage(Ee,d.value[Ee])}),Object.keys(u.value).forEach(Ee=>{ne.mergeDateTimeFormat(Ee,u.value[Ee])}),Object.keys(f.value).forEach(Ee=>{ne.mergeNumberFormat(Ee,f.value[Ee])}),ne.escapeParameter=w,ne.fallbackFormat=g,ne.fallbackRoot=m,ne.fallbackWarn=p,ne.missingWarn=h,ne.warnHtmlMessage=x}return a.onBeforeMount(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw Fn(Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const ne=o.value=t.proxy.$i18n.__composer;e==="global"?(l.value=ne.locale.value,c.value=ne.fallbackLocale.value,d.value=ne.messages.value,u.value=ne.datetimeFormats.value,f.value=ne.numberFormats.value):i&&je(ne)}),Be}if(jb(),__INTLIFY_JIT_COMPILATION__?lu(Ib):lu(Bb),Sb(ob),_b(ru),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=wn();t.__INTLIFY__=!0,pb(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const sk={},lk={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},ak=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function ck(t,e){return a.openBlock(),a.createElementBlock("svg",lk,ak)}const Uu=be(sk,[["render",ck]]),dk={},uk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},fk=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"},null,-1)];function hk(t,e){return a.openBlock(),a.createElementBlock("svg",uk,fk)}const Fl=be(dk,[["render",hk]]),pk={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},mk={class:"flex items-center gap-2"},gk={key:0},yk={class:""},bk={class:"flex justify-end"},kk={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},wk={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},vk={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},zi=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,medium:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean,material:Boolean,naked:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 bg-white border-gray-300 focus:border-lime-400 focus-within:border-lime-400 dark:bg-iron-900 dark:enabled:active:shadow-inner dark:active:bg-iron-700 dark:hover:bg-iron-800 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-gray-200! text-gray-400! dark:text-gray-800! bg-gray-50! dark:border-gray-900! dark:bg-gray-940!"},i=e;function o(){i("onClear")}return(s,l)=>(a.openBlock(),a.createElementBlock("div",null,[t.label?(a.openBlock(),a.createElementBlock("div",pk,[a.createElementVNode("div",mk,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",gk,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",yk,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",bk,[a.renderSlot(s.$slots,"more")])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-input overflow-auto leading-none flex relative items-center",{"ring-1 ring-black/10 shadow-xs rounded-sm pr-3 dark:bg-iron-900":!t.naked,"!pl-0 pr-1 !bg-transparent":t.naked,"border-b":t.material,"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[a.unref(he).theme]}`]:!0,"h-6 text-xs":t.small,"h-8 text-sm":t.medium,"h-10":!t.large&&!t.small&&!t.medium,"h-12":t.large,[`${r[a.unref(he).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(a.openBlock(),a.createElementBlock("div",kk,[a.createElementVNode("div",wk,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",vk,[a.createVNode(Fr,{class:"w-6 h-6 opacity-50"})])):t.clearable?(a.openBlock(),a.createElementBlock("div",{key:2,onClick:a.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Ii,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)]))}});var Yu=typeof global=="object"&&global&&global.Object===Object&&global,xk=typeof self=="object"&&self&&self.Object===Object&&self,ln=Yu||xk||Function("return this")(),Gr=ln.Symbol,qu=Object.prototype,Ek=qu.hasOwnProperty,Ck=qu.toString,ji=Gr?Gr.toStringTag:void 0;function Sk(t){var e=Ek.call(t,ji),n=t[ji];try{t[ji]=void 0;var r=!0}catch{}var i=Ck.call(t);return r&&(e?t[ji]=n:delete t[ji]),i}var _k=Object.prototype,Ok=_k.toString;function Tk(t){return Ok.call(t)}var Nk="[object Null]",Mk="[object Undefined]",Ku=Gr?Gr.toStringTag:void 0;function Jr(t){return t==null?t===void 0?Mk:Nk:Ku&&Ku in Object(t)?Sk(t):Tk(t)}function Zr(t){return t!=null&&typeof t=="object"}var Ak="[object Symbol]";function Dk(t){return typeof t=="symbol"||Zr(t)&&Jr(t)==Ak}var Go=Array.isArray,Lk=/\s/;function Bk(t){for(var e=t.length;e--&&Lk.test(t.charAt(e)););return e}var Ik=/^\s+/;function $k(t){return t&&t.slice(0,Bk(t)+1).replace(Ik,"")}function Hi(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Gu=NaN,Vk=/^[-+]0x[0-9a-f]+$/i,Pk=/^0b[01]+$/i,Rk=/^0o[0-7]+$/i,Fk=parseInt;function Ju(t){if(typeof t=="number")return t;if(Dk(t))return Gu;if(Hi(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Hi(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=$k(t);var n=Pk.test(t);return n||Rk.test(t)?Fk(t.slice(2),n?2:8):Vk.test(t)?Gu:+t}var zk="[object AsyncFunction]",jk="[object Function]",Hk="[object GeneratorFunction]",Wk="[object Proxy]";function Zu(t){if(!Hi(t))return!1;var e=Jr(t);return e==jk||e==Hk||e==zk||e==Wk}var zl=ln["__core-js_shared__"],Xu=function(){var t=/[^.]+$/.exec(zl&&zl.keys&&zl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Uk(t){return!!Xu&&Xu in t}var Yk=Function.prototype,qk=Yk.toString;function yr(t){if(t!=null){try{return qk.call(t)}catch{}try{return t+""}catch{}}return""}var Kk=/[\\^$.*+?()[\]{}|]/g,Gk=/^\[object .+?Constructor\]$/,Jk=Function.prototype,Zk=Object.prototype,Xk=Jk.toString,Qk=Zk.hasOwnProperty,e2=RegExp("^"+Xk.call(Qk).replace(Kk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function t2(t){if(!Hi(t)||Uk(t))return!1;var e=Zu(t)?e2:Gk;return e.test(yr(t))}function n2(t,e){return t==null?void 0:t[e]}function Xr(t,e){var n=n2(t,e);return t2(n)?n:void 0}var jl=Xr(ln,"WeakMap"),r2=9007199254740991,i2=/^(?:0|[1-9]\d*)$/;function o2(t,e){var n=typeof t;return e=e??r2,!!e&&(n=="number"||n!="symbol"&&i2.test(t))&&t>-1&&t%1==0&&t<e}function Qu(t,e){return t===e||t!==t&&e!==e}var s2=9007199254740991;function ef(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=s2}function l2(t){return t!=null&&ef(t.length)&&!Zu(t)}var a2=Object.prototype;function c2(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||a2;return t===n}function d2(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var u2="[object Arguments]";function tf(t){return Zr(t)&&Jr(t)==u2}var nf=Object.prototype,f2=nf.hasOwnProperty,h2=nf.propertyIsEnumerable,p2=tf(function(){return arguments}())?tf:function(t){return Zr(t)&&f2.call(t,"callee")&&!h2.call(t,"callee")};function m2(){return!1}var rf=typeof ct=="object"&&ct&&!ct.nodeType&&ct,of=rf&&typeof module=="object"&&module&&!module.nodeType&&module,g2=of&&of.exports===rf,sf=g2?ln.Buffer:void 0,y2=sf?sf.isBuffer:void 0,Hl=y2||m2,b2="[object Arguments]",k2="[object Array]",w2="[object Boolean]",v2="[object Date]",x2="[object Error]",E2="[object Function]",C2="[object Map]",S2="[object Number]",_2="[object Object]",O2="[object RegExp]",T2="[object Set]",N2="[object String]",M2="[object WeakMap]",A2="[object ArrayBuffer]",D2="[object DataView]",L2="[object Float32Array]",B2="[object Float64Array]",I2="[object Int8Array]",$2="[object Int16Array]",V2="[object Int32Array]",P2="[object Uint8Array]",R2="[object Uint8ClampedArray]",F2="[object Uint16Array]",z2="[object Uint32Array]",Pe={};Pe[L2]=Pe[B2]=Pe[I2]=Pe[$2]=Pe[V2]=Pe[P2]=Pe[R2]=Pe[F2]=Pe[z2]=!0,Pe[b2]=Pe[k2]=Pe[A2]=Pe[w2]=Pe[D2]=Pe[v2]=Pe[x2]=Pe[E2]=Pe[C2]=Pe[S2]=Pe[_2]=Pe[O2]=Pe[T2]=Pe[N2]=Pe[M2]=!1;function j2(t){return Zr(t)&&ef(t.length)&&!!Pe[Jr(t)]}function H2(t){return function(e){return t(e)}}var lf=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Wi=lf&&typeof module=="object"&&module&&!module.nodeType&&module,W2=Wi&&Wi.exports===lf,Wl=W2&&Yu.process,af=function(){try{var t=Wi&&Wi.require&&Wi.require("util").types;return t||Wl&&Wl.binding&&Wl.binding("util")}catch{}}(),cf=af&&af.isTypedArray,df=cf?H2(cf):j2,U2=Object.prototype,Y2=U2.hasOwnProperty;function q2(t,e){var n=Go(t),r=!n&&p2(t),i=!n&&!r&&Hl(t),o=!n&&!r&&!i&&df(t),s=n||r||i||o,l=s?d2(t.length,String):[],c=l.length;for(var d in t)Y2.call(t,d)&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||o2(d,c)))&&l.push(d);return l}function K2(t,e){return function(n){return t(e(n))}}var G2=K2(Object.keys,Object),J2=Object.prototype,Z2=J2.hasOwnProperty;function X2(t){if(!c2(t))return G2(t);var e=[];for(var n in Object(t))Z2.call(t,n)&&n!="constructor"&&e.push(n);return e}function Q2(t){return l2(t)?q2(t):X2(t)}var Ui=Xr(Object,"create");function ew(){this.__data__=Ui?Ui(null):{},this.size=0}function tw(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var nw="__lodash_hash_undefined__",rw=Object.prototype,iw=rw.hasOwnProperty;function ow(t){var e=this.__data__;if(Ui){var n=e[t];return n===nw?void 0:n}return iw.call(e,t)?e[t]:void 0}var sw=Object.prototype,lw=sw.hasOwnProperty;function aw(t){var e=this.__data__;return Ui?e[t]!==void 0:lw.call(e,t)}var cw="__lodash_hash_undefined__";function dw(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ui&&e===void 0?cw:e,this}function br(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}br.prototype.clear=ew,br.prototype.delete=tw,br.prototype.get=ow,br.prototype.has=aw,br.prototype.set=dw;function uw(){this.__data__=[],this.size=0}function Jo(t,e){for(var n=t.length;n--;)if(Qu(t[n][0],e))return n;return-1}var fw=Array.prototype,hw=fw.splice;function pw(t){var e=this.__data__,n=Jo(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():hw.call(e,n,1),--this.size,!0}function mw(t){var e=this.__data__,n=Jo(e,t);return n<0?void 0:e[n][1]}function gw(t){return Jo(this.__data__,t)>-1}function yw(t,e){var n=this.__data__,r=Jo(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Cn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Cn.prototype.clear=uw,Cn.prototype.delete=pw,Cn.prototype.get=mw,Cn.prototype.has=gw,Cn.prototype.set=yw;var Yi=Xr(ln,"Map");function bw(){this.size=0,this.__data__={hash:new br,map:new(Yi||Cn),string:new br}}function kw(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Zo(t,e){var n=t.__data__;return kw(e)?n[typeof e=="string"?"string":"hash"]:n.map}function ww(t){var e=Zo(this,t).delete(t);return this.size-=e?1:0,e}function vw(t){return Zo(this,t).get(t)}function xw(t){return Zo(this,t).has(t)}function Ew(t,e){var n=Zo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function kr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}kr.prototype.clear=bw,kr.prototype.delete=ww,kr.prototype.get=vw,kr.prototype.has=xw,kr.prototype.set=Ew;function Cw(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Sw(){this.__data__=new Cn,this.size=0}function _w(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Ow(t){return this.__data__.get(t)}function Tw(t){return this.__data__.has(t)}var Nw=200;function Mw(t,e){var n=this.__data__;if(n instanceof Cn){var r=n.__data__;if(!Yi||r.length<Nw-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new kr(r)}return n.set(t,e),this.size=n.size,this}function jn(t){var e=this.__data__=new Cn(t);this.size=e.size}jn.prototype.clear=Sw,jn.prototype.delete=_w,jn.prototype.get=Ow,jn.prototype.has=Tw,jn.prototype.set=Mw;function Aw(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function Dw(){return[]}var Lw=Object.prototype,Bw=Lw.propertyIsEnumerable,uf=Object.getOwnPropertySymbols,Iw=uf?function(t){return t==null?[]:(t=Object(t),Aw(uf(t),function(e){return Bw.call(t,e)}))}:Dw;function $w(t,e,n){var r=e(t);return Go(t)?r:Cw(r,n(t))}function ff(t){return $w(t,Q2,Iw)}var Ul=Xr(ln,"DataView"),Yl=Xr(ln,"Promise"),ql=Xr(ln,"Set"),hf="[object Map]",Vw="[object Object]",pf="[object Promise]",mf="[object Set]",gf="[object WeakMap]",yf="[object DataView]",Pw=yr(Ul),Rw=yr(Yi),Fw=yr(Yl),zw=yr(ql),jw=yr(jl),Hn=Jr;(Ul&&Hn(new Ul(new ArrayBuffer(1)))!=yf||Yi&&Hn(new Yi)!=hf||Yl&&Hn(Yl.resolve())!=pf||ql&&Hn(new ql)!=mf||jl&&Hn(new jl)!=gf)&&(Hn=function(t){var e=Jr(t),n=e==Vw?t.constructor:void 0,r=n?yr(n):"";if(r)switch(r){case Pw:return yf;case Rw:return hf;case Fw:return pf;case zw:return mf;case jw:return gf}return e});var bf=ln.Uint8Array,Hw="__lodash_hash_undefined__";function Ww(t){return this.__data__.set(t,Hw),this}function Uw(t){return this.__data__.has(t)}function Xo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new kr;++e<n;)this.add(t[e])}Xo.prototype.add=Xo.prototype.push=Ww,Xo.prototype.has=Uw;function Yw(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function qw(t,e){return t.has(e)}var Kw=1,Gw=2;function kf(t,e,n,r,i,o){var s=n&Kw,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&Gw?new Xo:void 0;for(o.set(t,e),o.set(e,t);++f<l;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!Yw(e,function(k,x){if(!qw(p,x)&&(m===k||i(m,k,n,r,o)))return p.push(x)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}function Jw(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Zw(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Xw=1,Qw=2,ev="[object Boolean]",tv="[object Date]",nv="[object Error]",rv="[object Map]",iv="[object Number]",ov="[object RegExp]",sv="[object Set]",lv="[object String]",av="[object Symbol]",cv="[object ArrayBuffer]",dv="[object DataView]",wf=Gr?Gr.prototype:void 0,Kl=wf?wf.valueOf:void 0;function uv(t,e,n,r,i,o,s){switch(n){case dv:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case cv:return!(t.byteLength!=e.byteLength||!o(new bf(t),new bf(e)));case ev:case tv:case iv:return Qu(+t,+e);case nv:return t.name==e.name&&t.message==e.message;case ov:case lv:return t==e+"";case rv:var l=Jw;case sv:var c=r&Xw;if(l||(l=Zw),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=Qw,s.set(t,e);var u=kf(l(t),l(e),r,i,o,s);return s.delete(t),u;case av:if(Kl)return Kl.call(t)==Kl.call(e)}return!1}var fv=1,hv=Object.prototype,pv=hv.hasOwnProperty;function mv(t,e,n,r,i,o){var s=n&fv,l=ff(t),c=l.length,d=ff(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:pv.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<c;){h=l[f];var k=t[h],x=e[h];if(r)var w=s?r(x,k,h,e,t,o):r(k,x,h,t,e,o);if(!(w===void 0?k===x||i(k,x,n,r,o):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var b=t.constructor,C=e.constructor;b!=C&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof C=="function"&&C instanceof C)&&(g=!1)}return o.delete(t),o.delete(e),g}var gv=1,vf="[object Arguments]",xf="[object Array]",Qo="[object Object]",yv=Object.prototype,Ef=yv.hasOwnProperty;function bv(t,e,n,r,i,o){var s=Go(t),l=Go(e),c=s?xf:Hn(t),d=l?xf:Hn(e);c=c==vf?Qo:c,d=d==vf?Qo:d;var u=c==Qo,f=d==Qo,h=c==d;if(h&&Hl(t)){if(!Hl(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new jn),s||df(t)?kf(t,e,n,r,i,o):uv(t,e,c,n,r,i,o);if(!(n&gv)){var p=u&&Ef.call(t,"__wrapped__"),m=f&&Ef.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new jn),i(g,y,n,r,o)}}return h?(o||(o=new jn),mv(t,e,n,r,i,o)):!1}function Cf(t,e,n,r,i){return t===e?!0:t==null||e==null||!Zr(t)&&!Zr(e)?t!==t&&e!==e:bv(t,e,n,r,Cf,i)}var Gl=function(){return ln.Date.now()},kv="Expected a function",wv=Math.max,vv=Math.min;function Jl(t,e,n){var r,i,o,s,l,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(kv);e=Ju(e)||0,Hi(n)&&(u=!!n.leading,f="maxWait"in n,o=f?wv(Ju(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(v){var O=r,D=i;return r=i=void 0,d=v,s=t.apply(D,O),s}function m(v){return d=v,l=setTimeout(k,e),u?p(v):s}function g(v){var O=v-c,D=v-d,A=e-O;return f?vv(A,o-D):A}function y(v){var O=v-c,D=v-d;return c===void 0||O>=e||O<0||f&&D>=o}function k(){var v=Gl();if(y(v))return x(v);l=setTimeout(k,g(v))}function x(v){return l=void 0,h&&r?p(v):(r=i=void 0,s)}function w(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function b(){return l===void 0?s:x(Gl())}function C(){var v=Gl(),O=y(v);if(r=arguments,i=this,c=v,O){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(k,e),p(c)}return l===void 0&&(l=setTimeout(k,e)),s}return C.cancel=w,C.flush=b,C}function qi(t,e){return Cf(t,e)}const xv={},Ev={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Cv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"},null,-1)];function Sv(t,e){return a.openBlock(),a.createElementBlock("svg",Ev,Cv)}const _v=be(xv,[["render",Sv]]),Ov={key:0,class:"leading-none"},Tv={key:1},Nv={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},Mv={key:1},Av={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},Dv=["onClick"],Lv={class:"select-none flex w-full items-center justify-between"},Bv={class:"flex-1"},Iv={key:0,class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400 text-center"},$v={key:1,class:"px-4 py-2 text-sm text-gray-400 text-center"},Sf=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,medium:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean,material:Boolean,naked:Boolean,hideChevron:Boolean,summaryText:String,oneLine:Boolean,total:{type:Number,default:null},groupSelected:{type:Boolean,default:!1}},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,{t:i}=zn(),o=a.computed(()=>r.placeholder==="Select..."?i("wpiccomponents.placeholder_select"):r.placeholder),s=a.ref(!1),l=a.ref(r.options);a.watch(()=>r.options,()=>{const R=(Array.isArray(r.modelValue)?r.modelValue:r.modelValue!==null&&r.modelValue!==void 0?[r.modelValue]:[]).map(K=>l.value.find(H=>qi(H.value,K))||r.options.find(H=>qi(H.value,K))).filter(Boolean);if(!r.groupSelected||!r.multiple){const K=new Set;l.value=[...r.options,...R].filter(H=>{const $=JSON.stringify(H.value);return K.has($)?!1:(K.add($),!0)})}else{const K=[...R];for(const H of r.options)K.some($=>qi($.value,H.value))||K.push(H);l.value=K}},{immediate:!0,deep:!0});const c=n,d=a.ref(),u=a.ref();function f(L){var R,K;if(r.multiple){if(L){let H=r.modelValue||[];H.indexOf(L)>=0?H.splice(H.indexOf(L),1):H.push(L),c("update:modelValue",H),g(H),((R=r.modelValue)==null?void 0:R.length)===((K=r.options)==null?void 0:K.length)?s.value=!0:s.value=!1}}else c("update:modelValue",L),g(L),d.value=null,u.value.hide()}async function h(L){var R,K;c("update:modelValue",L),g(L),await a.nextTick(),((R=r.modelValue)==null?void 0:R.length)===((K=r.options)==null?void 0:K.length)&&(s.value=!0)}function p(L){c("update:modelValue",L),s.value=!1,g(L)}function m(){s.value=!1,r.multiple?(c("update:modelValue",[]),g([])):(c("update:modelValue",null),g(null))}const g=Jl(function(L){c("change",L)},r.debounce),y=a.computed(()=>{var L,R,K,H;if(r.multiple){const $=((L=l.value)==null?void 0:L.filter(B=>{var z;return(z=r.modelValue)==null?void 0:z.includes(B.value)}))||[],S=((R=r.modelValue)==null?void 0:R.length)||0;if(r.summaryText&&S>0){const B=i(r.summaryText,S);return i("wpiccomponents.summary_items",{count:S,type:B})}if(r.maxDisplay){const B=$.slice(0,r.maxDisplay);return $.length-B.length>0?`${B.map(z=>z.label).join(", ")} (+${$.length-B.length})`:B.map(z=>z.label).join(", ")}else return $.map(B=>B.label).join(", ")}else return((H=(K=l.value)==null?void 0:K.find($=>$.value===r.modelValue))==null?void 0:H.label)||r.modelValue});function k(L){var R;try{return r.multiple?r.modelValue!==null&&((R=r.modelValue)==null?void 0:R.some(K=>qi(K,L))):r.modelValue!==null&&qi(L,r.modelValue)}catch(K){return console.log(K),!1}}const x={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-gray-800 group-[.is-selected]:font-semibold text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-white"},w=a.computed(()=>{var L,R;return((L=r.modelValue)==null?void 0:L.length)===((R=r.options)==null?void 0:R.length)}),b=a.computed(()=>{var $;const L=l.value||[];if(r.filterable&&!r.remoteMethod&&(($=d.value)!=null&&$.trim().length)){const S=d.value.trim().toLowerCase(),B=L.filter(te=>{var re;return(re=te.label)==null?void 0:re.toLowerCase().includes(S)});if(!r.groupSelected||!r.multiple)return B;const z=r.modelValue||[],X=B.filter(te=>z.includes(te.value)),j=B.filter(te=>!z.includes(te.value));return[...X,...j]}if(!r.groupSelected||!r.multiple)return L;const R=r.modelValue||[],K=L.filter(S=>R.includes(S.value)),H=L.filter(S=>!R.includes(S.value));return[...K,...H]});function C(){v.value=1,r.remoteMethod&&(O.value=!0,I(d.value,v.value,()=>{O.value=!1}))}const v=a.ref(1),O=a.ref(!1),D=a.computed(()=>{var L;return r.total!==void 0&&((L=r.options)==null?void 0:L.length)>=r.total});function A(L){const R=L.target;R.scrollTop+R.clientHeight>=R.scrollHeight-30&&!O.value&&!D.value&&(O.value=!0,v.value+=1,I(d.value,v.value,()=>{O.value=!1}))}const I=Jl((L,R,K)=>{r.remoteMethod(L,R).finally(()=>{K==null||K()})},r.debounce||300);return e({allSelected:s,isAllSelected:w}),(L,R)=>(a.openBlock(),a.createBlock(fr,{custom:"",ref_key:"myPopover",ref:u,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:K})=>[a.createVNode(zi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,medium:t.medium,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var H,$,S,B,z,X;return[a.createElementVNode("span",{class:a.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple,truncate:t.oneLine}])},[t.modelValue&&(!t.multiple||t.multiple&&((H=t.modelValue)==null?void 0:H.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",Ov,[w.value&&(($=t.allSelectedText)!=null&&$.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((S=t.options)==null?void 0:S.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(y.value),1)],64))])):!t.multiple&&((B=t.options)!=null&&B.find(j=>j.value===null))?(a.openBlock(),a.createElementBlock("span",Tv,a.toDisplayString((X=(z=t.options)==null?void 0:z.find(j=>j.value===null))==null?void 0:X.label),1)):a.renderSlot(L.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(o.value),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(m,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Ii,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(a.openBlock(),a.createBlock(_v,{key:1,class:a.normalizeClass(["h-5 w-5 -mr-[2px]",{"h-4!":t.small||t.medium}])},null,8,["class"])):a.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","medium","invalid","loading"])]),content:a.withCtx(()=>{var K,H;return[a.createElementVNode("div",{class:"flex flex-col max-h-80 overflow-y-auto",onScrollPassive:A},[t.filterable?(a.openBlock(),a.createElementBlock("div",Nv,[a.createVNode(Nf,{slim:"",placeholder:L.$t("wpiccomponents.placeholder_search"),clearable:"",modelValue:d.value,"onUpdate:modelValue":[R[0]||(R[0]=$=>d.value=$),C]},null,8,["placeholder","modelValue"])])):a.createCommentVNode("",!0),!t.options&&((K=t.options)==null?void 0:K.length)==0?(a.openBlock(),a.createElementBlock("span",Mv,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",Av,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:R[1]||(R[1]=$=>{var S;return h((S=b.value)==null?void 0:S.filter(B=>B.value).map(B=>B.value))})},a.toDisplayString(L.$t("wpiccomponents.select_all")),1),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:R[2]||(R[2]=$=>p([]))},a.toDisplayString(L.$t("wpiccomponents.select_none")),1)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.value,$=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!k($.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||$.value,[`${x[a.unref(he).theme]}`]:!0}]),onClick:S=>$.disabled?null:f($.value)},[a.createElementVNode("div",Lv,[a.createElementVNode("div",Bv,[a.createElementVNode("div",{class:a.normalizeClass(["",{"opacity-25":$.disabled,"line-clamp-1":t.oneLine}])},a.toDisplayString($.label||$.value),3),$.description?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-xs opacity-50 font-normal!",{"opacity-10":$.disabled}])},a.toDisplayString($.description),3)):a.createCommentVNode("",!0)]),t.multiple&&k($.value)?(a.openBlock(),a.createBlock(Uu,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,Dv)],2))),256)),r.remoteMethod?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[O.value?(a.openBlock(),a.createElementBlock("div",Iv,a.toDisplayString(L.$t("wpiccomponents.loading_more")),1)):D.value&&((H=t.options)==null?void 0:H.length)>0?(a.openBlock(),a.createElementBlock("div",$v,a.toDisplayString(L.$t("wpiccomponents.no_more_results")),1)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],64))],32)]}),_:3},8,["label","disabled"]))}}),_f=Object.assign({name:"WpicToggleSwitch"},{props:{modelValue:Boolean,label:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(){n.disabled||r("update:modelValue",!n.modelValue)}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[a.createElementVNode("div",{class:a.normalizeClass(["w-11 h-6 rounded-full shadow-inner flex items-center transition-all duration-100",{"bg-lime-500 dark:bg-lime-600":t.modelValue,"bg-gray-300 dark:bg-gray-800":!t.modelValue}])},[a.createElementVNode("div",{class:a.normalizeClass(["w-5 h-5 rounded-full bg-white dark:bg-gray-500 shadow-md transition-all duration-100 transform",{"translate-x-[calc(100%+3px)] dark:!bg-gray-200":t.modelValue,"translate-x-px":!t.modelValue}])},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},a.toDisplayString(t.label),3)],2))}}),Vv={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Pv=["disabled","rows","placeholder"],Of=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,info:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=a.computed(()=>Number(r.minHeight)||0),s=a.computed(()=>Number(r.maxHeight)||1/0),l=a.ref(null),c=a.ref(!1),d=a.ref(r.modelValue??"");a.watch(()=>r.modelValue,h=>{d.value=h??""}),a.watch(d,h=>{i("update:modelValue",h),u()}),a.onMounted(()=>a.nextTick(u));function u(){const h=l.value;if(!h||!r.autoResize)return;h.style.height="auto";const p=h.scrollHeight,m=Math.max(o.value,Math.min(p,s.value));h.style.height=`${m}px`,c.value=p>s.value}function f(){var h;(h=l.value)==null||h.focus()}return e({focus:f}),(h,p)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[t.label?(a.openBlock(),a.createElementBlock("div",Vv,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",null,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),a.withDirectives(a.createElementVNode("textarea",{ref_key:"myTextarea",ref:l,"onUpdate:modelValue":p[0]||(p[0]=m=>d.value=m),class:a.normalizeClass(["relative appearance-none outline-hidden flex w-full rounded-sm px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus-visible:border-none placeholder:opacity-30 dark:text-gray-400",{"cursor-not-allowed":t.disabled,"resize-none":t.autoResize||t.noResize,"overflow-hidden":t.autoResize&&!c.value,"overflow-auto":c.value}]),style:a.normalizeStyle({minHeight:t.autoResize?`${o.value}px`:void 0,maxHeight:t.autoResize?`${s.value}px`:void 0}),disabled:t.disabled,rows:t.rows,placeholder:t.placeholder},null,14,Pv),[[a.vModelText,d.value]])],64))}}),Rv=["placeholder"],Tf={__name:"ColorPicker",props:{modelValue:String,defaultColor:{type:String},loading:Boolean,material:Boolean,naked:Boolean,isInvalid:Boolean,placeholder:String,disabled:Boolean,small:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return a.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,l)=>(a.openBlock(),a.createBlock(zi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[a.vModelText,i.value]]),a.withDirectives(a.createElementVNode("input",{type:"text","onUpdate:modelValue":l[1]||(l[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,Rv),[[a.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},Fv={},zv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},jv=[a.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),a.createElementVNode("path",{"fill-rule":"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z","clip-rule":"evenodd"},null,-1)];function Hv(t,e){return a.openBlock(),a.createElementBlock("svg",zv,jv)}const Wv=be(Fv,[["render",Hv]]),Uv={},Yv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},qv=[a.createElementVNode("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM22.676 12.553a11.249 11.249 0 0 1-2.631 4.31l-3.099-3.099a5.25 5.25 0 0 0-6.71-6.71L7.759 4.577a11.217 11.217 0 0 1 4.242-.827c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113Z"},null,-1),a.createElementVNode("path",{d:"M15.75 12c0 .18-.013.357-.037.53l-4.244-4.243A3.75 3.75 0 0 1 15.75 12ZM12.53 15.713l-4.243-4.244a3.75 3.75 0 0 0 4.244 4.243Z"},null,-1),a.createElementVNode("path",{d:"M6.75 12c0-.619.107-1.213.304-1.764l-3.1-3.1a11.25 11.25 0 0 0-2.63 4.31c-.12.362-.12.752 0 1.114 1.489 4.467 5.704 7.69 10.675 7.69 1.5 0 2.933-.294 4.242-.827l-2.477-2.477A5.25 5.25 0 0 1 6.75 12Z"},null,-1)];function Kv(t,e){return a.openBlock(),a.createElementBlock("svg",Yv,qv)}const Gv=be(Uv,[["render",Kv]]),Jv={},Zv={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Xv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function Qv(t,e){return a.openBlock(),a.createElementBlock("svg",Zv,Xv)}const ex=be(Jv,[["render",Qv]]),tx={class:"flex items-center gap-2"},nx={key:0},rx={class:""},ix=["innerHTML"],ox={class:"flex justify-end"},sx=["name","value","checked"],lx={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},ax={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},cx={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},dx={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Nf=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,medium:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color:Boolean,summaryText:String,oneLine:Boolean,total:Number},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-iron-900 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-iron-800 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=a.computed(()=>o.name?o.name:kl()),l=Y0(s.value),c=a.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=a.ref(!0),u=a.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=a.computed(()=>{var I;if(o.rules&&typeof o.rules=="string"){let L=(I=o.rules)==null?void 0:I.split("|");return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}else if(!o.rules){let L=[];return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}return"required"});function p(I){let L=I&&I.target?I.target.value:I;x(L)}const m=n;function g(I){I===!0||I===!1?m("update:modelValue",!I):m("update:modelValue",I)}function y(I){let L=I&&I.target?I.target.value:I;m("update:modelValue",L),m("onChange",L)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=Jl(function(I){m("update:modelValue",I),m("onChange",I)},o.debounce),w=a.ref(null),b=a.ref();function C(){var I,L;o.textarea?(I=b.value)==null||I.focus():(L=w.value)==null||L.$el.focus()}function v(){return w.value.meta.valid}const O=a.ref(),D=a.computed(()=>O.value.allSelected),A=a.computed(()=>O.value.isAllSelected);return e({focus:C,isValid:v,allSelected:D,isAllSelected:A}),(I,L)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio&&!t.toggleSwitch?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass([{"text-sm":t.small,"text-base":!t.small},"mb-2 wpic-form-label text-gray-500 dark:text-gray-500 flex items-center justify-between"])},[a.createElementVNode("div",tx,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",nx,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",rx,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,ix)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-iron-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",ox,[a.renderSlot(I.$slots,"more")])],2)):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(cr),{key:1,ref_key:"myInput",ref:w,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:R})=>[a.createElementVNode("div",{class:a.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:L[0]||(L[0]=K=>t.disabled?void 0:g(t.modelValue))},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[a.unref(he).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(Uu,{key:0})):a.createCommentVNode("",!0)],2),a.createElementVNode("span",{class:a.normalizeClass(["text-base cursor-pointer select-none text-gray-600 dark:text-gray-500",{"!text-gray-500/50 dark:text-gray-700/50":t.disabled}])},[a.renderSlot(I.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(a.openBlock(),a.createBlock(a.unref(cr),{key:2,ref_key:"myInput",ref:w,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:R})=>[a.createElementVNode("div",{onClick:L[2]||(L[2]=()=>{t.disabled||y(t.radioValue)}),class:a.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[a.createElementVNode("span",{class:a.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled,"border-lime-600!":t.radioValue==t.modelValue}])},[t.radioValue==t.modelValue?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["flex rounded-full h-full w-full bg-lime-600",{"bg-opacity-50":t.disabled}])},null,2)):a.createCommentVNode("",!0)],2),a.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:L[1]||(L[1]=(...K)=>I.onChange&&I.onChange(...K)),checked:t.radioValue==t.modelValue},null,40,sx),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["text-base text-gray-700 dark:text-gray-300",{"opacity-50":t.disabled}])},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(a.openBlock(),a.createBlock(a.unref(cr),{key:3,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:R})=>{var K;return[a.createVNode(Sf,{ref_key:"myChoiceList",ref:O,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,medium:t.medium,oneLine:t.oneLine,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,summaryText:t.summaryText,debounce:t.debounce,total:t.total,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((K=h.value)==null?void 0:K.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","medium","oneLine","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","summaryText","debounce","total","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(a.openBlock(),a.createBlock(a.unref(cr),{key:4,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:R})=>[a.createVNode(Tf,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":y},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(a.openBlock(),a.createBlock(a.unref(cr),{key:5,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:R})=>[a.createVNode(_f,{modelValue:t.modelValue,"onUpdate:modelValue":y,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createElementBlock("div",{key:6,class:a.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[a.unref(he).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-gray-200! bg-gray-50! dark:bg-gray-940! dark:border-gray-900! text-gray-400 dark:text-gray-800":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":a.unref(l)}])},[I.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["absolute dark:text-iron-400 left-0 ml-0 w-9 h-full flex items-center text-center",{"justify-center":!t.naked}])},[a.createElementVNode("div",lx,[a.renderSlot(I.$slots,"prepend")])],2)):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(cr),{key:1,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var R;return[a.createVNode(Of,{ref_key:"myTextarea",ref:b,modelValue:t.modelValue,"onUpdate:modelValue":p,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((R=h.value)==null?void 0:R.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createBlock(a.unref(cr),{key:2,ref_key:"myInput",ref:w,autocomplete:"off",style:{"z-index":"1"},class:a.normalizeClass(["flex w-full h-full rounded-sm pr-4 bg-transparent outline-hidden appearance-none dark:text-gray-400 dark:placeholder:text-iron-600",{"pl-4":!I.$slots.prepend&&!t.naked,"pl-8":I.$slots.prepend&&!t.naked,"pl-6":I.$slots.prepend&&t.naked,"py-2":t.textarea,"text-sm":t.small,"cursor-not-allowed dark:placeholder:text-gray-800!":t.disabled}]),type:u.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:p,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!a.unref(l),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(a.openBlock(),a.createElementBlock("div",{key:3,onClick:a.withModifiers(k,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Fr,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(k,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Ii,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),I.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",ax,[a.createElementVNode("div",cx,[a.renderSlot(I.$slots,"append",{},()=>[a.withDirectives(a.createVNode(Wv,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(Gv,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,!d.value]])])])])):a.createCommentVNode("",!0)],2)),t.error&&a.unref(l)?(a.openBlock(),a.createElementBlock("div",dx,[a.createVNode(a.unref(U0),{name:s.value},{default:a.withCtx(R=>[a.createTextVNode(a.toDisplayString(R.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),I.$slots.help||t.help?(a.openBlock(),a.createElementBlock("div",{key:8,class:a.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[a.renderSlot(I.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),ux=["innerHTML"],Mf=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},full:Boolean,text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=a.ref(),n=a.ref(),r=a.ref();kl();const i=t;function o(){i.text&&(n.value.style.display="block",l())}function s(){n.value.style.display=""}async function l(){var h,p;await a.nextTick();const c=await Od(e.value,n.value,{placement:i.placement,middleware:[_d(),Sd(),Cd(i.offset),qy({element:r.value})]});n.value.style.left=`${c.x}px`,n.value.style.top=`${c.y}px`;const{x:d,y:u}=c.middlewareData.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[(h=i.placement)==null?void 0:h.split("-")[0]];r.value&&Object.assign((p=r.value)==null?void 0:p.style,{left:d!=null?`${d}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[f]:"-4px"})}return(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("span",{ref_key:"button",ref:e,class:a.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[a.renderSlot(c.$slots,"default")],34),a.createElementVNode("div",{ref_key:"tooltip",ref:n,class:"tooltip z-30 px-3 py-2 border border-zinc-200 dark:border-gray-900 text-sm absolute top-0 left-0 bg-black text-white rounded-md hidden",role:"tooltip"},[a.createElementVNode("span",{innerHTML:t.text},null,8,ux),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),fx={key:1,class:"flex justify-between items-baseline pt-4 px-6"},hx={class:""},px={key:2,class:"flex items-center justify-end py-4 px-6"},mx=Object.assign({name:"WpicCard"},{props:{title:String,inline:Boolean,loading:Boolean},setup(t){const e={pmi:"bg-white dark:bg-zinc-800/50 shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"bg-white border border-gray-200 dark:bg-gray-940 dark:border-gray-920"},n={pmi:"font-bold","wpic-tools":"font-medium dark:text-gray-300"};return(r,i)=>{const o=a.resolveComponent("wpic-loading-panel");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["rounded-lg wpic-card relative",{[e[a.unref(he).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(a.openBlock(),a.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):a.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",fx,[t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[a.unref(he).theme]]])},[a.renderSlot(r.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])],2)):a.createCommentVNode("",!0),a.createElementVNode("div",hx,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",px,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),gx={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},yx={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},bx=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean,expand:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[a.unref(he).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions&&n.$slots.title),"pt-6":!t.title&&!n.$slots.actions&&!n.$slots.title,"bg-gray-50 dark:bg-gray-930 last:rounded-b-lg":t.sub,"p-0! m-0!":t.expand}])},[t.title||n.$slots.title||n.$slots.actions?(a.openBlock(),a.createElementBlock("div",gx,[a.createElementVNode("div",yx,[a.renderSlot(n.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])]),a.renderSlot(n.$slots,"actions")])):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"default")],2))}}),kx=a.createElementVNode("div",{class:""},null,-1),wx=a.createStaticVNode('<div class="-mt-2"><div class="absolute left-1/4 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-1/2 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-3/4 h-8 border-r border-gray-100 dark:border-gray-900"></div></div><div class="mt-7 text-gray-500 dark:text-gray-600"><div class="absolute left-0 text-xs">0%</div><div class="absolute left-1/4 -translate-x-1/4 text-xs">25%</div><div class="absolute left-1/2 -translate-x-1/2 text-xs">50%</div><div class="absolute right-1/4 translate-x-3/4 text-xs">75%</div><div class="absolute right-0 text-xs">100%</div></div>',2),vx=Object.assign({name:"WpicProgressBar"},{props:{percent:Number,value:Number,indicators:Boolean,background:{type:String,default:null},max:{type:Number,default:100},text:String},setup(t){const e=t,n=a.computed(()=>e.percent?e.percent:100/e.max*e.value),r={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-gray-100 rounded-xs h-4 dark:bg-gray-900"},i={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-xs dark:bg-lime-700"};return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex w-full relative",r[a.unref(he).theme]]),style:{"z-index":"1"}},[n.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({width:`${n.value}%`}),class:a.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[a.unref(he).theme]}`]:!0}])},[a.createVNode(Mf,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[kx]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[wx],64)):a.createCommentVNode("",!0)],2))}}),xx={class:"leading-none"},Ex=Object.assign({name:"WpicTag"},{props:{clearable:Boolean,small:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-none bg-gray-200 text-gray-700 text-sm dark:text-gray-400 dark:bg-gray-810"},r=e;function i(){r("clear")}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-tag select-none border inline-flex rounded-sm h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-1":t.clearable,[n[a.unref(he).theme]]:!0}])},[a.createElementVNode("span",xx,[a.renderSlot(o.$slots,"default")]),t.clearable?(a.openBlock(),a.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Ii,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Cx=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass({"w-full":t.full})},[a.createElementVNode("div",{class:a.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[a.renderSlot(e.$slots,"default")],2)],2))}}),Sx=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),_x={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Ox=[Sx(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Tx=be(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(a.openBlock(),a.createElementBlock("div",_x,Ox)):(a.openBlock(),a.createBlock(Fr,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Nx={class:"text-base font-medium select-none"},Ki=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean,disabled:Boolean},setup(t){const e={pmi:"border-zinc-300 dark:border-zinc-700 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-500 hover:text-white","wpic-tools":"dark:text-gray-400 hover:text-lime-600 dark:border-gray-900"},n={pmi:"bg-violet-800 border-violet-800 hover:bg-violet-900 hover:border-violet-900 text-white","wpic-tools":"bg-lime-500 border-lime-500 text-white dark:bg-lime-700 dark:border-lime-700"},r={pmi:"text-zinc-300","wpic-tools":"text-gray-300 dark:text-gray-700 dark:border-gray-900"};return(i,o)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[a.unref(he).theme]]:!t.active&&!t.disabled,[n[a.unref(he).theme]]:t.active&&!t.disabled,[r[a.unref(he).theme]]:t.disabled}])},[a.createElementVNode("span",Nx,[a.renderSlot(i.$slots,"default")])],2))}}),Mx={},Ax={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Dx=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function Lx(t,e){return a.openBlock(),a.createElementBlock("svg",Ax,Dx)}const Af=be(Mx,[["render",Lx]]),Bx={},Ix={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},$x=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z","clip-rule":"evenodd"},null,-1)];function Vx(t,e){return a.openBlock(),a.createElementBlock("svg",Ix,$x)}const Df=be(Bx,[["render",Vx]]),Px={},Rx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Fx=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function zx(t,e){return a.openBlock(),a.createElementBlock("svg",Rx,Fx)}const Lf=be(Px,[["render",zx]]),jx={},Hx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Wx=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function Ux(t,e){return a.openBlock(),a.createElementBlock("svg",Hx,Wx)}const Bf=be(jx,[["render",Ux]]),Yx={class:"wpic-pagination flex justify-between"},qx={key:0,class:"flex items-center"},Kx={key:0},Gx={key:1,class:"flex flex-wrap gap-2"},Jx=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:{type:Boolean,default:!1},total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1},perPageOptions:{type:Array,default:()=>[10,20,50,100,200]}},emits:["update:perPage","update:currentPage","update:perPage"],setup(t,{expose:e,emit:n}){const{t:r}=zn(),i=t,o=a.computed(()=>i.perPageOptions.map(p=>({value:Number(p),label:r("wpiccomponents.per_page",{count:p})}))),s=n,l=a.computed(()=>Math.ceil(i.total/i.perPage)),c=a.computed(()=>{const p=l.value;if(!p||p===1)return[1];const m=i.currentPage,g=1;let y=Math.max(2,m-g),k=Math.min(p-1,m+g);m<=g+2&&(y=2,k=Math.min(2*g+2,p-1)),m>=p-g-1&&(y=Math.max(2,p-2*g-1),k=p-1);const x=[];for(let w=y;w<=k;w++)x.push(w);return y>2&&x.unshift("..."),k<p-1&&x.push("..."),[1,...x,p]});function d(p){p>=1&&p<=l.value&&s("update:currentPage",p)}function u(){return i.perPage*(i.currentPage-1)+1}function f(){return i.perPage*i.currentPage>i.total?i.total:i.perPage*i.currentPage}async function h(p){s("update:perPage",p),s("update:currentPage",1)}return e({getStart:u,getEnd:f}),(p,m)=>{const g=a.resolveComponent("wpic-choice-list");return a.openBlock(),a.createElementBlock("div",Yx,[t.info?(a.openBlock(),a.createElementBlock("div",qx,[t.total>0?(a.openBlock(),a.createElementBlock("span",Kx,a.toDisplayString(p.$t("wpiccomponents.pagination",{start:u(),end:f(),total:t.total})),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",Gx,[a.createVNode(Ki,{onClick:m[0]||(m[0]=y=>d(1)),disabled:t.currentPage===1||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Af,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Ki,{onClick:m[1]||(m[1]=y=>d(t.currentPage-1)),disabled:t.currentPage===1||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Df,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,y=>(a.openBlock(),a.createBlock(Ki,{key:`page_${y}`,onClick:k=>d(y),active:y===t.currentPage,disabled:l.value==0||!l.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(y),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Ki,{onClick:m[2]||(m[2]=y=>d(t.currentPage+1)),disabled:t.currentPage===l.value||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Bf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Ki,{onClick:m[3]||(m[3]=y=>d(l.value)),disabled:t.currentPage===l.value||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Lf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(a.openBlock(),a.createBlock(g,{key:0,modelValue:t.perPage,"onUpdate:modelValue":h,options:o.value},null,8,["modelValue","options"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])}}}),If=(t,e)=>{const n=t.column.children&&t.column.children.default&&typeof t.column.children.default=="function"?t.column.children.default({item:t.item}):t.column.children;return a.h("td",e.attrs,n)};If.props=["column","item","rowIndex"];const es=If,Zx={},Xx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Qx=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function eE(t,e){return a.openBlock(),a.createElementBlock("svg",Xx,Qx)}const tE=be(Zx,[["render",eE]]),nE={class:"font-semibold"},$f={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String,checkable:Boolean},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-gray-50 border-gray-200 dark:text-gray-300 dark:border-gray-900 dark:bg-gray-810/45"};return(n,r)=>(a.openBlock(),a.createElementBlock("tr",nE,[t.checkable?(a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(he).theme]}`]:!0,"sticky left-0":!0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer"}]),id:"total_0",column:{},key:"tr_total_0"},null,8,["class"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,(i,o)=>(a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(he).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer","text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},rE={},iE={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},oE=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function sE(t,e){return a.openBlock(),a.createElementBlock("svg",iE,oE)}const lE=be(rE,[["render",sE]]),aE={},cE={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},dE=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"},null,-1)];function uE(t,e){return a.openBlock(),a.createElementBlock("svg",cE,dE)}const fE=be(aE,[["render",uE]]),hE={class:"wpic-table"},pE={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},mE={class:"flex items-center gap-2"},gE={class:"flex items-center gap-2"},yE={class:"w-full rounded-lg"},bE={key:0,class:"w-16"},kE=["width"],wE=["width"],vE={class:"flex justify-center items-center h-full"},xE=["onClick"],EE={class:"rounded-b-lg relative"},CE={key:0},SE=[a.createElementVNode("td",{class:"text-center py-3"},"   ",-1)],_E=["onClick"],OE={class:"flex justify-center items-center h-full"},TE={key:1},NE={key:0,class:"text-center text-gray-400 py-3"},ME=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"},small:Boolean,noRadius:Boolean,stickyHeader:Boolean,columnToggleable:Boolean,checkable:Boolean,itemId:{type:String,default:"id"}},emits:["changeSort","expandRow","row-click"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-gray-300 dark:border-gray-700"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-gray-100 text-gray-600 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},l={pmi:"","wpic-tools":""},c={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white text-gray-500 !font-normal border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-400"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50 border-gray-200 dark:group-[.is-odd]:bg-gray-940 dark:group-[.is-even]:bg-gray-930"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-gray-900/10 dark:bg-gray-950/75"},f=n;a.onMounted(()=>{k()});const h=a.getCurrentInstance();a.provide("wtable",h==null?void 0:h.proxy);const p=a.useSlots(),m=a.ref([]),g=a.ref([]),y=a.computed(()=>r.columnToggleable?m.value.filter(S=>g.value.includes(S.field)||!S.selectable):m.value.filter(S=>S.visible||!S.selectable));function k(){const S=(X,j)=>{let te={};for(let re in X){if(typeof X[re].default=="boolean"&&j[re]!==void 0){te[re]=j[re]!==!1;continue}if(j[re]!==void 0){te[re]=j[re];continue}if(typeof X[re].default=="function"){te[re]=X[re].default();continue}te[re]=X[re].default}return te};let B=[];(p.default&&p.default()||[]).forEach(X=>{var j,te;((j=X.type)==null?void 0:j.name)==="WpicTableColumn"?B.push(X):(te=X.children)!=null&&te.length&&X.children.forEach(re=>{var P;((P=re.type)==null?void 0:P.name)==="WpicTableColumn"&&B.push(re)})}),m.value=B.map(X=>{let j=X.children,te=X.props||{},{field:re,label:P,help:W,width:G,minWidth:q,maxWidth:V,sortable:ue,selectable:ce,render:we,type:Se,align:Be,visible:je,noPadding:ne}=S(X.type.props,te);return re||(re=L(P)),ce&&je&&g.value.push(re),{label:P,help:W,width:G,minWidth:q,maxWidth:V,type:Se,align:Be,sortable:ue,selectable:ce,field:re,render:we,children:j,visible:je,noPadding:ne}})}function x(S){var z,X;let B=(z=r.sortOptions)==null?void 0:z.sortDirection;((X=r.sortOptions)==null?void 0:X.sortBy)===S&&(B=B==="asc"?"desc":"asc"),f("changeSort",{sortDirection:B,sortBy:S})}a.watch(()=>p.default,S=>{k()},{deep:!0});const w=a.reactive({});function b({index:S,item:B}){w[S]?w[S]=null:(w[S]=!0,f("expandRow",{index:S,item:B}))}const C=a.ref([]);function v(S){const B=I(S,r.itemId);C.value.includes(B)?(C.value.splice(C.value.indexOf(B),1),O.value=!1):C.value.push(B)}const O=a.ref(!1);function D(){if(O.value=!O.value,C.value=[],O.value)for(let S of r.data){let B=I(S,r.itemId);C.value.push(B)}}function A(){O.value=!1,C.value=[]}e({buildColumns:k,selectedRows:C,selectedColumns:g,resetSelectedRows:A});function I(S,B){return B.split(".").reduce((z,X)=>z?z[X]:void 0,S)}function L(S){return!S||typeof S!="string"?"":S.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}const R=a.computed(()=>{var B;const S=((B=h==null?void 0:h.vnode)==null?void 0:B.props)??{};return!!(S["onRow-click"]||S.onRowClick)});function K(S){const B=[];for(;S;)B.push(S),S=S.parentNode||S.host;return B}function H(S){const B='a, button, input, select, textarea, label, summary, [role="button"], [contenteditable="true"]',z=new Set(["SPAN","DIV","SVG","I","IMG"]),X=S.composedPath?S.composedPath():K(S.target),j=window.getSelection&&window.getSelection();if(j&&j.type==="Range")return!0;for(const te of X){if(!(te instanceof Element))continue;if(te.tagName==="TR")break;if(te.matches(B))return!0;const re=window.getComputedStyle(te);if(re&&re.cursor==="pointer"&&z.has(te.tagName))return!0}return!1}function $(S,B,z){R.value&&(H(S)||f("row-click",B,z,S))}return(S,B)=>{const z=a.resolveComponent("wpic-choice-list"),X=a.resolveComponent("wpic-form-field");return a.openBlock(),a.createElementBlock("div",hE,[S.$slots.header||S.$slots.actions||t.columnToggleable?(a.openBlock(),a.createElementBlock("div",pE,[a.createElementVNode("div",mE,[a.renderSlot(S.$slots,"header")]),a.createElementVNode("div",gE,[a.renderSlot(S.$slots,"actions"),a.createVNode(z,{multiple:"",modelValue:g.value,"onUpdate:modelValue":B[0]||(B[0]=j=>g.value=j),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(j=>j.selectable).map(j=>({label:j.label,value:j.field}))},{default:a.withCtx(()=>[a.createVNode(Ni,{medium:"",square:"",colorless:"",class:"ml-px"},{default:a.withCtx(()=>[a.createVNode(fE,{class:"w-5 h-5"})]),_:1})]),_:1},8,["modelValue","options"])])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[a.unref(he).theme]}`]:!0}])},[a.createElementVNode("div",{class:a.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[a.createElementVNode("table",yE,[a.createElementVNode("colgroup",null,[t.checkable?(a.openBlock(),a.createElementBlock("col",bE)):a.createCommentVNode("",!0),y.value.find(j=>j.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:1,style:a.normalizeStyle({minWidth:`${y.value.find(j=>j.type=="expand").minWidth}px`}),width:y.value.find(j=>j.type=="expand").width,class:"w-16"},null,12,kE)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(j=>j.type!="expand"),(j,te)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${j.minWidth}px`,maxWidth:`${j.maxWidth}px`}),width:j.width,key:te},null,12,wE))),128))]),t.hideHeaders?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("thead",{key:0,class:a.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[a.createElementVNode("tr",null,[t.checkable?(a.openBlock(),a.createElementBlock("th",{key:0,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(he).theme]}`]])},[a.createElementVNode("div",vE,[a.createVNode(X,{slim:"","hide-error":"",checkbox:"",modelValue:O.value,"onUpdate:modelValue":D},null,8,["modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(j=>j.type=="expand")?(a.openBlock(),a.createElementBlock("th",{key:1,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(he).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(j=>j.type!="expand"),(j,te)=>{var re,P;return a.openBlock(),a.createElementBlock("th",{class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[a.unref(he).theme]}`]:!0,"sticky top-0 left-0":te===0}]),style:a.normalizeStyle({maxWidth:`${j.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{j.sortable&&x(j.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":j.sortable&&j.field,"justify-center":j.align=="center","justify-end":j.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium text-sm",{"text-right":j.align=="right"}])},a.toDisplayString(j.label),3),j.sortable&&j.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":j.field!=((re=t.sortOptions)==null?void 0:re.sortBy)}])},[a.createVNode(tE,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((P=t.sortOptions)==null?void 0:P.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,xE)],6)}),256))])],2)),a.createElementVNode("tbody",EE,[t.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:a.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[a.unref(he).theme]]])},[a.createVNode(Fr,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",CE,SE))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock($f,{key:1,checkable:t.checkable,position:"header",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.data,(j,te)=>{var re,P,W,G,q;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${te}`},[a.createElementVNode("tr",{onClick:V=>$(V,j,te),class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":te%2==0,"is-even":te%2!=0,[s[a.unref(he).theme]]:!0}])},[t.checkable?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass([{[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe}])},[a.createElementVNode("div",OE,[a.createVNode(X,{slim:"","hide-error":"",checkbox:"",modelValue:C.value.includes(I(j,t.itemId)),checkboxValue:I(j,t.itemId),"onUpdate:modelValue":V=>v(j)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(V=>V.type=="expand")?(a.openBlock(),a.createElementBlock("td",{key:1,class:a.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top",[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[a.createVNode(Ni,{small:"",square:"",onClick:V=>b({item:j,index:te})},{default:a.withCtx(()=>[w[te]?(a.openBlock(),a.createBlock(ex,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(lE,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(V=>V.type!="expand"),(V,ue)=>{var ce,we;return a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":ue===0,[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!V.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":te===((ce=t.data)==null?void 0:ce.length)-1&&!t.totalItem&&!y.value.find(Se=>Se.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":te===((we=t.data)==null?void 0:we.length)-1&&!t.totalItem&&!y.value.find(Se=>Se.type=="expand")&&!t.noRadius,"text-center justify-center":V.align=="center","text-right justify-end":V.align=="right","align-top py-5":t.valign=="top","cursor-pointer group-hover:bg-gray-100 dark:group-hover:bg-gray-930":R.value}]),style:a.normalizeStyle({maxWidth:`${V.maxWidth}px`}),id:`${te}_${ue}`,column:V,item:j,rowIndex:te,key:ue},null,8,["class","style","id","column","item","rowIndex"])}),128))],10,_E),y.value.find(V=>V.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(he).theme]]:!t.stripe,[l[a.unref(he).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(es,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(he).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((re=y.value.find(V=>V.type=="expand"))!=null&&re.noPadding),"p-0":(P=y.value.find(V=>V.type=="expand"))==null?void 0:P.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":te===((W=t.data)==null?void 0:W.length)-1&&!t.totalItem,"first:rounded-bl-lg":te===((G=t.data)==null?void 0:G.length)-1&&!t.totalItem,"text-center":y.value.find(V=>V.type=="expand").align=="center","text-right":y.value.find(V=>V.type=="expand").align=="right"}]),column:y.value.find(V=>V.type=="expand"),rowIndex:te,colspan:(q=y.value)==null?void 0:q.length,item:j},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,w[te]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",TE,[a.createVNode($f,{checkable:t.checkable,position:"footer",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):a.createCommentVNode("",!0)])],2),!t.loading&&!t.data.length?(a.openBlock(),a.createElementBlock("div",NE," No Data ")):a.createCommentVNode("",!0)],2)])}}}),AE={name:"WpicTableColumn",props:{label:{type:String},help:{type:String},field:{type:String,default:""},selectable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},type:{type:String,default:"default"},width:{type:[String,Number],default:null},minWidth:{type:[String,Number],default:null},maxWidth:{type:[String,Number],default:null},align:{type:String,default:"left"},visible:{type:Boolean,default:!0},noPadding:{type:Boolean,default:!1}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function rt(t){this.content=t}rt.prototype={constructor:rt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new rt(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new rt(n)},addToStart:function(t,e){return new rt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new rt(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new rt(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=rt.from(t),t.size?new rt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=rt.from(t),t.size?new rt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=rt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},rt.from=function(t){if(t instanceof rt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new rt(e)};function Vf(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=Vf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Pf(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){n-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=Pf(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class Z{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,i+l,o||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),r,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new Z(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],c=s+l.nodeSize;c>e&&((s<e||c>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=c}return new Z(r,i)}cutByIndex(e,n){return e==n?Z.empty:e==0&&n==this.content.length?this:new Z(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Z(i,o)}addToStart(e){return new Z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Z(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Vf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Pf(this,e,n,r)}findIndex(e,n=-1){if(e==0)return ts(0,e);if(e==this.size)return ts(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?ts(r+1,s):ts(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Z.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Z(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Z.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Z(n||e,r)}static from(e){if(!e)return Z.empty;if(e instanceof Z)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Z([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Z.empty=new Z([],0);const Zl={index:0,offset:0};function ts(t,e){return Zl.index=t,Zl.offset=e,Zl}function ns(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ns(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ns(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $e=class Bc{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ns(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Bc.none;if(e instanceof Bc)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$e.none=[];class rs extends Error{}class oe{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Ff(this.content,e+this.openStart,n);return r&&new oe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new oe(Rf(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return oe.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new oe(Z.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new oe(e,r,i)}}oe.empty=new oe(Z.empty,0,0);function Rf(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Rf(o.content,e-i-1,n-i-1)))}function Ff(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=Ff(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function DE(t,e,n){if(n.openStart>t.depth)throw new rs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new rs("Inconsistent open depths");return zf(t,e,n,0)}function zf(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=zf(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return vr(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=LE(n,t);return vr(o,Hf(t,s,l,e,r))}else return vr(o,is(t,e,r))}function jf(t,e){if(!e.type.compatibleContent(t.type))throw new rs("Cannot join "+e.type.name+" onto "+t.type.name)}function Xl(t,e,n){let r=t.node(n);return jf(r,e.node(n)),r}function wr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Gi(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(wr(t.nodeAfter,r),o++));for(let l=o;l<s;l++)wr(i.child(l),r);e&&e.depth==n&&e.textOffset&&wr(e.nodeBefore,r)}function vr(t,e){return t.type.checkContent(e),t.copy(e)}function Hf(t,e,n,r,i){let o=t.depth>i&&Xl(t,e,i+1),s=r.depth>i&&Xl(n,r,i+1),l=[];return Gi(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(jf(o,s),wr(vr(o,Hf(t,e,n,r,i+1)),l)):(o&&wr(vr(o,is(t,e,i+1)),l),Gi(e,n,i,l),s&&wr(vr(s,is(n,r,i+1)),l)),Gi(r,null,i,l),new Z(l)}function is(t,e,n){let r=[];if(Gi(null,t,n,r),t.depth>n){let i=Xl(t,e,n+1);wr(vr(i,is(t,e,n+1)),r)}return Gi(e,null,n,r),new Z(r)}function LE(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(Z.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ji{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ss(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new Ji(n,r,o)}static resolveCached(e,n){let r=Wf.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else Wf.set(e,r=new BE);let i=r.elts[r.i]=Ji.resolve(e,n);return r.i=(r.i+1)%IE,i}}class BE{constructor(){this.elts=[],this.i=0}}const IE=12,Wf=new WeakMap;class ss{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const $E=Object.create(null);let Wn=class Ic{constructor(e,n,r,i=$e.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||Z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ns(this.attrs,n||e.defaultAttrs||$E)&&$e.sameSet(this.marks,r||$e.none)}copy(e=null){return e==this.content?this:new Ic(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ic(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return oe.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new oe(d,i.depth-s,o.depth-s)}replace(e,n,r){return DE(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Ji.resolveCached(this,e)}resolveNoCache(e){return Ji.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Uf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Z.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$e.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=Z.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Wn.prototype.text=void 0;class ls extends Wn{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Uf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ls(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ls(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Uf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class xr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new VE(e,n);if(r.next==null)return xr.empty;let i=Yf(r);r.next&&r.err("Unexpected trailing text");let o=WE(HE(i));return UE(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,l){let c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return Z.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
27
+ */const zb="9.14.4";function jb(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(wn().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(wn().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_JIT_COMPILATION__!="boolean"&&(wn().__INTLIFY_JIT_COMPILATION__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(wn().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(wn().__INTLIFY_PROD_DEVTOOLS__=!1)}const Lu=yt.__EXTEND_POINT__,En=Ro(Lu),St={FALLBACK_TO_ROOT:Lu,NOT_SUPPORTED_PRESERVE:En(),NOT_SUPPORTED_FORMATTER:En(),NOT_SUPPORTED_PRESERVE_DIRECTIVE:En(),NOT_SUPPORTED_GET_CHOICE_INDEX:En(),COMPONENT_NAME_LEGACY_COMPATIBLE:En(),NOT_FOUND_PARENT_SCOPE:En(),IGNORE_OBJ_FLATTEN:En(),NOTICE_DROP_ALLOW_COMPOSITION:En(),NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG:En()},Hb={[St.FALLBACK_TO_ROOT]:"Fall back to {type} '{key}' with root locale.",[St.NOT_SUPPORTED_PRESERVE]:"Not supported 'preserve'.",[St.NOT_SUPPORTED_FORMATTER]:"Not supported 'formatter'.",[St.NOT_SUPPORTED_PRESERVE_DIRECTIVE]:"Not supported 'preserveDirectiveContent'.",[St.NOT_SUPPORTED_GET_CHOICE_INDEX]:"Not supported 'getChoiceIndex'.",[St.COMPONENT_NAME_LEGACY_COMPATIBLE]:"Component name legacy compatible: '{name}' -> 'i18n'",[St.NOT_FOUND_PARENT_SCOPE]:"Not found parent scope. use the global scope.",[St.IGNORE_OBJ_FLATTEN]:"Ignore object flatten: '{key}' key has an string value",[St.NOTICE_DROP_ALLOW_COMPOSITION]:"'allowComposition' option will be dropped in the next major version. For more information, please see 👉 https://tinyurl.com/2p97mcze",[St.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]:"'translateExistCompatible' option will be dropped in the next major version."};function Ko(t,...e){return wl(Hb[t],...e)}const Bu=Ze.__EXTEND_POINT__,_t=Ro(Bu),Re={UNEXPECTED_RETURN_TYPE:Bu,INVALID_ARGUMENT:_t(),MUST_BE_CALL_SETUP_TOP:_t(),NOT_INSTALLED:_t(),NOT_AVAILABLE_IN_LEGACY_MODE:_t(),REQUIRED_VALUE:_t(),INVALID_VALUE:_t(),CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN:_t(),NOT_INSTALLED_WITH_PROVIDE:_t(),UNEXPECTED_ERROR:_t(),NOT_COMPATIBLE_LEGACY_VUE_I18N:_t(),BRIDGE_SUPPORT_VUE_2_ONLY:_t(),MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION:_t(),NOT_AVAILABLE_COMPOSITION_IN_LEGACY:_t(),__EXTEND_POINT__:_t()};function Fn(t,...e){return Ur(t,null,process.env.NODE_ENV!=="production"?{messages:Wb,args:e}:void 0)}const Wb={[Re.UNEXPECTED_RETURN_TYPE]:"Unexpected return type in composer",[Re.INVALID_ARGUMENT]:"Invalid argument",[Re.MUST_BE_CALL_SETUP_TOP]:"Must be called at the top of a `setup` function",[Re.NOT_INSTALLED]:"Need to install with `app.use` function",[Re.UNEXPECTED_ERROR]:"Unexpected error",[Re.NOT_AVAILABLE_IN_LEGACY_MODE]:"Not available in legacy mode",[Re.REQUIRED_VALUE]:"Required in value: {0}",[Re.INVALID_VALUE]:"Invalid value",[Re.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]:"Cannot setup vue-devtools plugin",[Re.NOT_INSTALLED_WITH_PROVIDE]:"Need to install with `provide` function",[Re.NOT_COMPATIBLE_LEGACY_VUE_I18N]:"Not compatible legacy VueI18n.",[Re.BRIDGE_SUPPORT_VUE_2_ONLY]:"vue-i18n-bridge support Vue 2.x only",[Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:"Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode",[Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:"Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly"},Dl=kn("__translateVNode"),Ll=kn("__datetimeParts"),Bl=kn("__numberParts"),Il=kn("__enableEmitter"),$l=kn("__disableEmitter"),Ub=kn("__setPluralRules"),Iu=kn("__injectWithOption"),Vl=kn("__dispose");function Fi(t){if(!Ne(t)||en(t))return t;for(const e in t)if(Xt(t,e))if(!e.includes("."))Ne(t[e])&&Fi(t[e]);else{const n=e.split("."),r=n.length-1;let i=t,o=!1;for(let s=0;s<r;s++){if(n[s]==="__proto__")throw new Error(`unsafe key: ${n[s]}`);if(n[s]in i||(i[n[s]]=Le()),!Ne(i[n[s]])){process.env.NODE_ENV!=="production"&&vn(Ko(St.IGNORE_OBJ_FLATTEN,{key:n[s]})),o=!0;break}i=i[n[s]]}if(o||(en(i)?Zd.includes(n[r])||delete t[e]:(i[n[r]]=t[e],delete t[e])),!en(i)){const s=i[n[r]];Ne(s)&&Fi(s)}}return t}function Pl(t,e){const{messages:n,__i18n:r,messageResolver:i,flatJson:o}=e,s=_e(n)?n:Ue(r)?Le():{[t]:Le()};if(Ue(r)&&r.forEach(l=>{if("locale"in l&&"resource"in l){const{locale:c,resource:d}=l;c?(s[c]=s[c]||Le(),zo(d,s[c])):zo(d,s)}else le(l)&&zo(JSON.parse(l),s)}),i==null&&o)for(const l in s)Xt(s,l)&&Fi(s[l]);return s}function $u(t){return t.type}function Yb(t,e,n){let r=Ne(e.messages)?e.messages:Le();"__i18nGlobal"in n&&(r=Pl(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(o=>{t.mergeLocaleMessage(o,r[o])});{if(Ne(e.datetimeFormats)){const o=Object.keys(e.datetimeFormats);o.length&&o.forEach(s=>{t.mergeDateTimeFormat(s,e.datetimeFormats[s])})}if(Ne(e.numberFormats)){const o=Object.keys(e.numberFormats);o.length&&o.forEach(s=>{t.mergeNumberFormat(s,e.numberFormats[s])})}}}function Vu(t){return a.createVNode(a.Text,null,t,0)}const Pu="__INTLIFY_META__",Ru=()=>[],qb=()=>!1;let Fu=0;function zu(t){return(e,n,r,i)=>t(n,r,a.getCurrentInstance()||void 0,i)}const Kb=()=>{const t=a.getCurrentInstance();let e=null;return t&&(e=$u(t)[Pu])?{[Pu]:e}:null};function Gb(t={},e){const{__root:n,__injectWithOption:r}=t,i=n===void 0,o=t.flatJson,s=bn?a.ref:a.shallowRef,l=!!t.translateExistCompatible;process.env.NODE_ENV!=="production"&&l&&Id(Ko(St.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG));let c=Ie(t.inheritLocale)?t.inheritLocale:!0;const d=s(n&&c?n.locale.value:le(t.locale)?t.locale:Pi),u=s(n&&c?n.fallbackLocale.value:le(t.fallbackLocale)||Ue(t.fallbackLocale)||_e(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:d.value),f=s(Pl(d.value,t)),h=s(_e(t.datetimeFormats)?t.datetimeFormats:{[d.value]:{}}),p=s(_e(t.numberFormats)?t.numberFormats:{[d.value]:{}});let m=n?n.missingWarn:Ie(t.missingWarn)||Wr(t.missingWarn)?t.missingWarn:!0,g=n?n.fallbackWarn:Ie(t.fallbackWarn)||Wr(t.fallbackWarn)?t.fallbackWarn:!0,y=n?n.fallbackRoot:Ie(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,x=Ve(t.missing)?t.missing:null,w=Ve(t.missing)?zu(t.missing):null,b=Ve(t.postTranslation)?t.postTranslation:null,C=n?n.warnHtmlMessage:Ie(t.warnHtmlMessage)?t.warnHtmlMessage:!0,v=!!t.escapeParameter;const O=n?n.modifiers:_e(t.modifiers)?t.modifiers:{};let D=t.pluralRules||n&&n.pluralRules,A;A=(()=>{i&&fu(null);const F={version:zb,locale:d.value,fallbackLocale:u.value,messages:f.value,modifiers:O,pluralRules:D,missing:w===null?void 0:w,missingWarn:m,fallbackWarn:g,fallbackFormat:k,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:C,escapeParameter:v,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};F.datetimeFormats=h.value,F.numberFormats=p.value,F.__datetimeFormatters=_e(A)?A.__datetimeFormatters:void 0,F.__numberFormatters=_e(A)?A.__numberFormatters:void 0,process.env.NODE_ENV!=="production"&&(F.__v_emitter=_e(A)?A.__v_emitter:void 0);const Q=Mb(F);return i&&fu(Q),Q})(),Ri(A,d.value,u.value);function L(){return[d.value,u.value,f.value,h.value,p.value]}const R=a.computed({get:()=>d.value,set:F=>{d.value=F,A.locale=d.value}}),K=a.computed({get:()=>u.value,set:F=>{u.value=F,A.fallbackLocale=u.value,Ri(A,d.value,F)}}),H=a.computed(()=>f.value),$=a.computed(()=>h.value),S=a.computed(()=>p.value);function B(){return Ve(b)?b:null}function z(F){b=F,A.postTranslation=F}function X(){return x}function j(F){F!==null&&(w=zu(F)),x=F,A.missing=w}function te(F,Q){return F!=="translate"||!Q.resolvedMessage}const re=(F,Q,T,M,Y,ie)=>{L();let fe;try{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=n?Nb():void 0),fe=F(A)}finally{process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__,i||(A.fallbackContext=void 0)}if(T!=="translate exists"&&Je(fe)&&fe===Uo||T==="translate exists"&&!fe){const[N,ee]=Q();if(process.env.NODE_ENV!=="production"&&n&&le(N)&&te(T,ee)&&(y&&(qo(g,N)||pu(m,N))&&vn(Ko(St.FALLBACK_TO_ROOT,{key:N,type:T})),process.env.NODE_ENV!=="production")){const{__v_emitter:se}=A;se&&y&&se.emit("fallback",{type:T,key:N,to:"global",groupId:`${T}:${N}`})}return n&&y?M(n):Y(N)}else{if(ie(fe))return fe;throw Fn(Re.UNEXPECTED_RETURN_TYPE)}};function P(...F){return re(Q=>Reflect.apply(xu,null,[Q,...F]),()=>Nl(...F),"translate",Q=>Reflect.apply(Q.t,Q,[...F]),Q=>Q,Q=>le(Q))}function W(...F){const[Q,T,M]=F;if(M&&!Ne(M))throw Fn(Re.INVALID_ARGUMENT);return P(Q,T,dt({resolvedMessage:!0},M||{}))}function G(...F){return re(Q=>Reflect.apply(Ou,null,[Q,...F]),()=>Ml(...F),"datetime format",Q=>Reflect.apply(Q.d,Q,[...F]),()=>Yo,Q=>le(Q))}function q(...F){return re(Q=>Reflect.apply(Mu,null,[Q,...F]),()=>Al(...F),"number format",Q=>Reflect.apply(Q.n,Q,[...F]),()=>Yo,Q=>le(Q))}function V(F){return F.map(Q=>le(Q)||Je(Q)||Ie(Q)?Vu(String(Q)):Q)}const ce={normalize:V,interpolate:F=>F,type:"vnode"};function we(...F){return re(Q=>{let T;const M=Q;try{M.processor=ce,T=Reflect.apply(xu,null,[M,...F])}finally{M.processor=null}return T},()=>Nl(...F),"translate",Q=>Q[Dl](...F),Q=>[Vu(Q)],Q=>Ue(Q))}function Se(...F){return re(Q=>Reflect.apply(Mu,null,[Q,...F]),()=>Al(...F),"number format",Q=>Q[Bl](...F),Ru,Q=>le(Q)||Ue(Q))}function Be(...F){return re(Q=>Reflect.apply(Ou,null,[Q,...F]),()=>Ml(...F),"datetime format",Q=>Q[Ll](...F),Ru,Q=>le(Q)||Ue(Q))}function je(F){D=F,A.pluralRules=D}function ne(F,Q){return re(()=>{if(!F)return!1;const T=le(Q)?Q:d.value,M=lt(T),Y=A.messageResolver(M,F);return l?Y!=null:en(Y)||zt(Y)||le(Y)},()=>[F],"translate exists",T=>Reflect.apply(T.te,T,[F,Q]),qb,T=>Ie(T))}function Ee(F){let Q=null;const T=ru(A,u.value,d.value);for(let M=0;M<T.length;M++){const Y=f.value[T[M]]||{},ie=A.messageResolver(Y,F);if(ie!=null){Q=ie;break}}return Q}function At(F){const Q=Ee(F);return Q??(n?n.tm(F)||{}:{})}function lt(F){return f.value[F]||{}}function at(F,Q){if(o){const T={[F]:Q};for(const M in T)Xt(T,M)&&Fi(T[M]);Q=T[F]}f.value[F]=Q,A.messages=f.value}function pt(F,Q){f.value[F]=f.value[F]||{};const T={[F]:Q};if(o)for(const M in T)Xt(T,M)&&Fi(T[M]);Q=T[F],zo(Q,f.value[F]),A.messages=f.value}function E(F){return h.value[F]||{}}function _(F,Q){h.value[F]=Q,A.datetimeFormats=h.value,Nu(A,F,Q)}function U(F,Q){h.value[F]=dt(h.value[F]||{},Q),A.datetimeFormats=h.value,Nu(A,F,Q)}function ae(F){return p.value[F]||{}}function Me(F,Q){p.value[F]=Q,A.numberFormats=p.value,Du(A,F,Q)}function Oe(F,Q){p.value[F]=dt(p.value[F]||{},Q),A.numberFormats=p.value,Du(A,F,Q)}Fu++,n&&bn&&(a.watch(n.locale,F=>{c&&(d.value=F,A.locale=F,Ri(A,d.value,u.value))}),a.watch(n.fallbackLocale,F=>{c&&(u.value=F,A.fallbackLocale=F,Ri(A,d.value,u.value))}));const Te={id:Fu,locale:R,fallbackLocale:K,get inheritLocale(){return c},set inheritLocale(F){c=F,F&&n&&(d.value=n.locale.value,u.value=n.fallbackLocale.value,Ri(A,d.value,u.value))},get availableLocales(){return Object.keys(f.value).sort()},messages:H,get modifiers(){return O},get pluralRules(){return D||{}},get isGlobal(){return i},get missingWarn(){return m},set missingWarn(F){m=F,A.missingWarn=m},get fallbackWarn(){return g},set fallbackWarn(F){g=F,A.fallbackWarn=g},get fallbackRoot(){return y},set fallbackRoot(F){y=F},get fallbackFormat(){return k},set fallbackFormat(F){k=F,A.fallbackFormat=k},get warnHtmlMessage(){return C},set warnHtmlMessage(F){C=F,A.warnHtmlMessage=F},get escapeParameter(){return v},set escapeParameter(F){v=F,A.escapeParameter=F},t:P,getLocaleMessage:lt,setLocaleMessage:at,mergeLocaleMessage:pt,getPostTranslationHandler:B,setPostTranslationHandler:z,getMissingHandler:X,setMissingHandler:j,[Ub]:je};return Te.datetimeFormats=$,Te.numberFormats=S,Te.rt=W,Te.te=ne,Te.tm=At,Te.d=G,Te.n=q,Te.getDateTimeFormat=E,Te.setDateTimeFormat=_,Te.mergeDateTimeFormat=U,Te.getNumberFormat=ae,Te.setNumberFormat=Me,Te.mergeNumberFormat=Oe,Te[Iu]=r,Te[Dl]=we,Te[Ll]=Be,Te[Bl]=Se,process.env.NODE_ENV!=="production"&&(Te[Il]=F=>{A.__v_emitter=F},Te[$l]=()=>{A.__v_emitter=void 0}),Te}const Rl={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function Jb({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,i)=>[...r,...i.type===a.Fragment?i.children:[i]],[]):e.reduce((n,r)=>{const i=t[r];return i&&(n[r]=i()),n},Le())}function ju(t){return a.Fragment}dt({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Je(t)||!isNaN(t)}},Rl);function Zb(t){return Ue(t)&&!le(t[0])}function Hu(t,e,n,r){const{slots:i,attrs:o}=e;return()=>{const s={part:!0};let l=Le();t.locale&&(s.locale=t.locale),le(t.format)?s.key=t.format:Ne(t.format)&&(le(t.format.key)&&(s.key=t.format.key),l=Object.keys(t.format).reduce((h,p)=>n.includes(p)?dt(Le(),h,{[p]:t.format[p]}):h,Le()));const c=r(t.value,s,l);let d=[s.key];Ue(c)?d=c.map((h,p)=>{const m=i[h.type],g=m?m({[h.type]:h.value,index:p,parts:c}):[h.value];return Zb(g)&&(g[0].key=`${h.type}-${p}`),g}):le(c)&&(d=[c]);const u=dt(Le(),o),f=le(t.tag)||Ne(t.tag)?t.tag:ju();return a.h(f,u,d)}}dt({value:{type:Number,required:!0},format:{type:[String,Object]}},Rl),dt({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Rl);function Wu(t,e){}const Xb=kn("global-vue-i18n");function zn(t={}){const e=a.getCurrentInstance();if(e==null)throw Fn(Re.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Fn(Re.NOT_INSTALLED);const n=Qb(e),r=tk(n),i=$u(e),o=ek(t,i);if(__VUE_I18N_LEGACY_API__&&n.mode==="legacy"&&!t.__useComponent){if(!n.allowComposition)throw Fn(Re.NOT_AVAILABLE_IN_LEGACY_MODE);return ok(e,o,r,t)}if(o==="global")return Yb(r,t,i),r;if(o==="parent"){let c=nk(n,e,t.__useComponent);return c==null&&(process.env.NODE_ENV!=="production"&&vn(Ko(St.NOT_FOUND_PARENT_SCOPE)),c=r),c}const s=n;let l=s.__getInstance(e);if(l==null){const c=dt({},t);"__i18n"in i&&(c.__i18n=i.__i18n),r&&(c.__root=r),l=Gb(c),s.__composerExtend&&(l[Vl]=s.__composerExtend(l)),ik(s,e,l),s.__setInstance(e,l)}return l}function Qb(t){{const e=a.inject(t.isCE?Xb:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Fn(t.isCE?Re.NOT_INSTALLED_WITH_PROVIDE:Re.UNEXPECTED_ERROR);return e}}function ek(t,e){return Po(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function tk(t){return t.mode==="composition"?t.global:t.global.__composer}function nk(t,e,n=!1){let r=null;const i=e.root;let o=rk(e,n);for(;o!=null;){const s=t;if(t.mode==="composition")r=s.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const l=s.__getInstance(o);l!=null&&(r=l.__composer,n&&r&&!r[Iu]&&(r=null))}if(r!=null||i===o)break;o=o.parent}return r}function rk(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function ik(t,e,n){let r=null;a.onMounted(()=>{if(process.env.NODE_ENV!=="production"&&e.vnode.el){e.vnode.el.__VUE_I18N__=n,r=f1();const i=n;i[Il]&&i[Il](r),r.on("*",Wu)}},e),a.onUnmounted(()=>{const i=n;process.env.NODE_ENV!=="production"&&e.vnode.el&&e.vnode.el.__VUE_I18N__&&(r&&r.off("*",Wu),i[$l]&&i[$l](),delete e.vnode.el.__VUE_I18N__),t.__deleteInstance(e);const o=i[Vl];o&&(o(),delete i[Vl])},e)}function ok(t,e,n,r={}){const i=e==="local",o=a.shallowRef(null);if(i&&t.proxy&&!(t.proxy.$options.i18n||t.proxy.$options.__i18n))throw Fn(Re.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION);const s=Ie(r.inheritLocale)?r.inheritLocale:!le(r.locale),l=a.ref(!i||s?n.locale.value:le(r.locale)?r.locale:Pi),c=a.ref(!i||s?n.fallbackLocale.value:le(r.fallbackLocale)||Ue(r.fallbackLocale)||_e(r.fallbackLocale)||r.fallbackLocale===!1?r.fallbackLocale:l.value),d=a.ref(Pl(l.value,r)),u=a.ref(_e(r.datetimeFormats)?r.datetimeFormats:{[l.value]:{}}),f=a.ref(_e(r.numberFormats)?r.numberFormats:{[l.value]:{}}),h=i?n.missingWarn:Ie(r.missingWarn)||Wr(r.missingWarn)?r.missingWarn:!0,p=i?n.fallbackWarn:Ie(r.fallbackWarn)||Wr(r.fallbackWarn)?r.fallbackWarn:!0,m=i?n.fallbackRoot:Ie(r.fallbackRoot)?r.fallbackRoot:!0,g=!!r.fallbackFormat,y=Ve(r.missing)?r.missing:null,k=Ve(r.postTranslation)?r.postTranslation:null,x=i?n.warnHtmlMessage:Ie(r.warnHtmlMessage)?r.warnHtmlMessage:!0,w=!!r.escapeParameter,b=i?n.modifiers:_e(r.modifiers)?r.modifiers:{},C=r.pluralRules||i&&n.pluralRules;function v(){return[l.value,c.value,d.value,u.value,f.value]}const O=a.computed({get:()=>o.value?o.value.locale.value:l.value,set:ne=>{o.value&&(o.value.locale.value=ne),l.value=ne}}),D=a.computed({get:()=>o.value?o.value.fallbackLocale.value:c.value,set:ne=>{o.value&&(o.value.fallbackLocale.value=ne),c.value=ne}}),A=a.computed(()=>o.value?o.value.messages.value:d.value),I=a.computed(()=>u.value),L=a.computed(()=>f.value);function R(){return o.value?o.value.getPostTranslationHandler():k}function K(ne){o.value&&o.value.setPostTranslationHandler(ne)}function H(){return o.value?o.value.getMissingHandler():y}function $(ne){o.value&&o.value.setMissingHandler(ne)}function S(ne){return v(),ne()}function B(...ne){return o.value?S(()=>Reflect.apply(o.value.t,null,[...ne])):S(()=>"")}function z(...ne){return o.value?Reflect.apply(o.value.rt,null,[...ne]):""}function X(...ne){return o.value?S(()=>Reflect.apply(o.value.d,null,[...ne])):S(()=>"")}function j(...ne){return o.value?S(()=>Reflect.apply(o.value.n,null,[...ne])):S(()=>"")}function te(ne){return o.value?o.value.tm(ne):{}}function re(ne,Ee){return o.value?o.value.te(ne,Ee):!1}function P(ne){return o.value?o.value.getLocaleMessage(ne):{}}function W(ne,Ee){o.value&&(o.value.setLocaleMessage(ne,Ee),d.value[ne]=Ee)}function G(ne,Ee){o.value&&o.value.mergeLocaleMessage(ne,Ee)}function q(ne){return o.value?o.value.getDateTimeFormat(ne):{}}function V(ne,Ee){o.value&&(o.value.setDateTimeFormat(ne,Ee),u.value[ne]=Ee)}function ue(ne,Ee){o.value&&o.value.mergeDateTimeFormat(ne,Ee)}function ce(ne){return o.value?o.value.getNumberFormat(ne):{}}function we(ne,Ee){o.value&&(o.value.setNumberFormat(ne,Ee),f.value[ne]=Ee)}function Se(ne,Ee){o.value&&o.value.mergeNumberFormat(ne,Ee)}const Be={get id(){return o.value?o.value.id:-1},locale:O,fallbackLocale:D,messages:A,datetimeFormats:I,numberFormats:L,get inheritLocale(){return o.value?o.value.inheritLocale:s},set inheritLocale(ne){o.value&&(o.value.inheritLocale=ne)},get availableLocales(){return o.value?o.value.availableLocales:Object.keys(d.value)},get modifiers(){return o.value?o.value.modifiers:b},get pluralRules(){return o.value?o.value.pluralRules:C},get isGlobal(){return o.value?o.value.isGlobal:!1},get missingWarn(){return o.value?o.value.missingWarn:h},set missingWarn(ne){o.value&&(o.value.missingWarn=ne)},get fallbackWarn(){return o.value?o.value.fallbackWarn:p},set fallbackWarn(ne){o.value&&(o.value.missingWarn=ne)},get fallbackRoot(){return o.value?o.value.fallbackRoot:m},set fallbackRoot(ne){o.value&&(o.value.fallbackRoot=ne)},get fallbackFormat(){return o.value?o.value.fallbackFormat:g},set fallbackFormat(ne){o.value&&(o.value.fallbackFormat=ne)},get warnHtmlMessage(){return o.value?o.value.warnHtmlMessage:x},set warnHtmlMessage(ne){o.value&&(o.value.warnHtmlMessage=ne)},get escapeParameter(){return o.value?o.value.escapeParameter:w},set escapeParameter(ne){o.value&&(o.value.escapeParameter=ne)},t:B,getPostTranslationHandler:R,setPostTranslationHandler:K,getMissingHandler:H,setMissingHandler:$,rt:z,d:X,n:j,tm:te,te:re,getLocaleMessage:P,setLocaleMessage:W,mergeLocaleMessage:G,getDateTimeFormat:q,setDateTimeFormat:V,mergeDateTimeFormat:ue,getNumberFormat:ce,setNumberFormat:we,mergeNumberFormat:Se};function je(ne){ne.locale.value=l.value,ne.fallbackLocale.value=c.value,Object.keys(d.value).forEach(Ee=>{ne.mergeLocaleMessage(Ee,d.value[Ee])}),Object.keys(u.value).forEach(Ee=>{ne.mergeDateTimeFormat(Ee,u.value[Ee])}),Object.keys(f.value).forEach(Ee=>{ne.mergeNumberFormat(Ee,f.value[Ee])}),ne.escapeParameter=w,ne.fallbackFormat=g,ne.fallbackRoot=m,ne.fallbackWarn=p,ne.missingWarn=h,ne.warnHtmlMessage=x}return a.onBeforeMount(()=>{if(t.proxy==null||t.proxy.$i18n==null)throw Fn(Re.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const ne=o.value=t.proxy.$i18n.__composer;e==="global"?(l.value=ne.locale.value,c.value=ne.fallbackLocale.value,d.value=ne.messages.value,u.value=ne.datetimeFormats.value,f.value=ne.numberFormats.value):i&&je(ne)}),Be}if(jb(),__INTLIFY_JIT_COMPILATION__?lu(Ib):lu(Bb),Sb(ob),_b(ru),process.env.NODE_ENV!=="production"||__INTLIFY_PROD_DEVTOOLS__){const t=wn();t.__INTLIFY__=!0,pb(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}process.env.NODE_ENV;const sk={},lk={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},ak=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function ck(t,e){return a.openBlock(),a.createElementBlock("svg",lk,ak)}const Uu=be(sk,[["render",ck]]),dk={},uk={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},fk=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"},null,-1)];function hk(t,e){return a.openBlock(),a.createElementBlock("svg",uk,fk)}const Fl=be(dk,[["render",hk]]),pk={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},mk={class:"flex items-center gap-2"},gk={key:0},yk={class:""},bk={class:"flex justify-end"},kk={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},wk={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidde"},vk={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},zi=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,medium:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean,material:Boolean,naked:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 bg-white border-gray-300 focus:border-lime-400 focus-within:border-lime-400 dark:bg-iron-900 dark:enabled:active:shadow-inner dark:active:bg-iron-700 dark:hover:bg-iron-800 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-gray-200! text-gray-400! dark:text-gray-800! bg-gray-50! dark:border-gray-900! dark:bg-gray-940!"},i=e;function o(){i("onClear")}return(s,l)=>(a.openBlock(),a.createElementBlock("div",null,[t.label?(a.openBlock(),a.createElementBlock("div",pk,[a.createElementVNode("div",mk,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",gk,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",yk,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",bk,[a.renderSlot(s.$slots,"more")])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-input overflow-none leading-none flex relative items-center",{"ring-1 ring-black/10 shadow-xs rounded-sm pr-3 dark:bg-iron-900":!t.naked,"!pl-0 pr-1 !bg-transparent":t.naked,"border-b":t.material,"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[a.unref(he).theme]}`]:!0,"h-6 text-xs":t.small,"h-8 text-sm":t.medium,"h-10":!t.large&&!t.small&&!t.medium,"h-12":t.large,[`${r[a.unref(he).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(a.openBlock(),a.createElementBlock("div",kk,[a.createElementVNode("div",wk,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",vk,[a.createVNode(Fr,{class:"w-6 h-6 opacity-50"})])):t.clearable?(a.openBlock(),a.createElementBlock("div",{key:2,onClick:a.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Ii,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)]))}});var Yu=typeof global=="object"&&global&&global.Object===Object&&global,xk=typeof self=="object"&&self&&self.Object===Object&&self,ln=Yu||xk||Function("return this")(),Gr=ln.Symbol,qu=Object.prototype,Ek=qu.hasOwnProperty,Ck=qu.toString,ji=Gr?Gr.toStringTag:void 0;function Sk(t){var e=Ek.call(t,ji),n=t[ji];try{t[ji]=void 0;var r=!0}catch{}var i=Ck.call(t);return r&&(e?t[ji]=n:delete t[ji]),i}var _k=Object.prototype,Ok=_k.toString;function Tk(t){return Ok.call(t)}var Nk="[object Null]",Mk="[object Undefined]",Ku=Gr?Gr.toStringTag:void 0;function Jr(t){return t==null?t===void 0?Mk:Nk:Ku&&Ku in Object(t)?Sk(t):Tk(t)}function Zr(t){return t!=null&&typeof t=="object"}var Ak="[object Symbol]";function Dk(t){return typeof t=="symbol"||Zr(t)&&Jr(t)==Ak}var Go=Array.isArray,Lk=/\s/;function Bk(t){for(var e=t.length;e--&&Lk.test(t.charAt(e)););return e}var Ik=/^\s+/;function $k(t){return t&&t.slice(0,Bk(t)+1).replace(Ik,"")}function Hi(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Gu=NaN,Vk=/^[-+]0x[0-9a-f]+$/i,Pk=/^0b[01]+$/i,Rk=/^0o[0-7]+$/i,Fk=parseInt;function Ju(t){if(typeof t=="number")return t;if(Dk(t))return Gu;if(Hi(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Hi(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=$k(t);var n=Pk.test(t);return n||Rk.test(t)?Fk(t.slice(2),n?2:8):Vk.test(t)?Gu:+t}var zk="[object AsyncFunction]",jk="[object Function]",Hk="[object GeneratorFunction]",Wk="[object Proxy]";function Zu(t){if(!Hi(t))return!1;var e=Jr(t);return e==jk||e==Hk||e==zk||e==Wk}var zl=ln["__core-js_shared__"],Xu=function(){var t=/[^.]+$/.exec(zl&&zl.keys&&zl.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Uk(t){return!!Xu&&Xu in t}var Yk=Function.prototype,qk=Yk.toString;function yr(t){if(t!=null){try{return qk.call(t)}catch{}try{return t+""}catch{}}return""}var Kk=/[\\^$.*+?()[\]{}|]/g,Gk=/^\[object .+?Constructor\]$/,Jk=Function.prototype,Zk=Object.prototype,Xk=Jk.toString,Qk=Zk.hasOwnProperty,e2=RegExp("^"+Xk.call(Qk).replace(Kk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function t2(t){if(!Hi(t)||Uk(t))return!1;var e=Zu(t)?e2:Gk;return e.test(yr(t))}function n2(t,e){return t==null?void 0:t[e]}function Xr(t,e){var n=n2(t,e);return t2(n)?n:void 0}var jl=Xr(ln,"WeakMap"),r2=9007199254740991,i2=/^(?:0|[1-9]\d*)$/;function o2(t,e){var n=typeof t;return e=e??r2,!!e&&(n=="number"||n!="symbol"&&i2.test(t))&&t>-1&&t%1==0&&t<e}function Qu(t,e){return t===e||t!==t&&e!==e}var s2=9007199254740991;function ef(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=s2}function l2(t){return t!=null&&ef(t.length)&&!Zu(t)}var a2=Object.prototype;function c2(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||a2;return t===n}function d2(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var u2="[object Arguments]";function tf(t){return Zr(t)&&Jr(t)==u2}var nf=Object.prototype,f2=nf.hasOwnProperty,h2=nf.propertyIsEnumerable,p2=tf(function(){return arguments}())?tf:function(t){return Zr(t)&&f2.call(t,"callee")&&!h2.call(t,"callee")};function m2(){return!1}var rf=typeof ct=="object"&&ct&&!ct.nodeType&&ct,of=rf&&typeof module=="object"&&module&&!module.nodeType&&module,g2=of&&of.exports===rf,sf=g2?ln.Buffer:void 0,y2=sf?sf.isBuffer:void 0,Hl=y2||m2,b2="[object Arguments]",k2="[object Array]",w2="[object Boolean]",v2="[object Date]",x2="[object Error]",E2="[object Function]",C2="[object Map]",S2="[object Number]",_2="[object Object]",O2="[object RegExp]",T2="[object Set]",N2="[object String]",M2="[object WeakMap]",A2="[object ArrayBuffer]",D2="[object DataView]",L2="[object Float32Array]",B2="[object Float64Array]",I2="[object Int8Array]",$2="[object Int16Array]",V2="[object Int32Array]",P2="[object Uint8Array]",R2="[object Uint8ClampedArray]",F2="[object Uint16Array]",z2="[object Uint32Array]",Pe={};Pe[L2]=Pe[B2]=Pe[I2]=Pe[$2]=Pe[V2]=Pe[P2]=Pe[R2]=Pe[F2]=Pe[z2]=!0,Pe[b2]=Pe[k2]=Pe[A2]=Pe[w2]=Pe[D2]=Pe[v2]=Pe[x2]=Pe[E2]=Pe[C2]=Pe[S2]=Pe[_2]=Pe[O2]=Pe[T2]=Pe[N2]=Pe[M2]=!1;function j2(t){return Zr(t)&&ef(t.length)&&!!Pe[Jr(t)]}function H2(t){return function(e){return t(e)}}var lf=typeof ct=="object"&&ct&&!ct.nodeType&&ct,Wi=lf&&typeof module=="object"&&module&&!module.nodeType&&module,W2=Wi&&Wi.exports===lf,Wl=W2&&Yu.process,af=function(){try{var t=Wi&&Wi.require&&Wi.require("util").types;return t||Wl&&Wl.binding&&Wl.binding("util")}catch{}}(),cf=af&&af.isTypedArray,df=cf?H2(cf):j2,U2=Object.prototype,Y2=U2.hasOwnProperty;function q2(t,e){var n=Go(t),r=!n&&p2(t),i=!n&&!r&&Hl(t),o=!n&&!r&&!i&&df(t),s=n||r||i||o,l=s?d2(t.length,String):[],c=l.length;for(var d in t)Y2.call(t,d)&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||o2(d,c)))&&l.push(d);return l}function K2(t,e){return function(n){return t(e(n))}}var G2=K2(Object.keys,Object),J2=Object.prototype,Z2=J2.hasOwnProperty;function X2(t){if(!c2(t))return G2(t);var e=[];for(var n in Object(t))Z2.call(t,n)&&n!="constructor"&&e.push(n);return e}function Q2(t){return l2(t)?q2(t):X2(t)}var Ui=Xr(Object,"create");function ew(){this.__data__=Ui?Ui(null):{},this.size=0}function tw(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var nw="__lodash_hash_undefined__",rw=Object.prototype,iw=rw.hasOwnProperty;function ow(t){var e=this.__data__;if(Ui){var n=e[t];return n===nw?void 0:n}return iw.call(e,t)?e[t]:void 0}var sw=Object.prototype,lw=sw.hasOwnProperty;function aw(t){var e=this.__data__;return Ui?e[t]!==void 0:lw.call(e,t)}var cw="__lodash_hash_undefined__";function dw(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ui&&e===void 0?cw:e,this}function br(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}br.prototype.clear=ew,br.prototype.delete=tw,br.prototype.get=ow,br.prototype.has=aw,br.prototype.set=dw;function uw(){this.__data__=[],this.size=0}function Jo(t,e){for(var n=t.length;n--;)if(Qu(t[n][0],e))return n;return-1}var fw=Array.prototype,hw=fw.splice;function pw(t){var e=this.__data__,n=Jo(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():hw.call(e,n,1),--this.size,!0}function mw(t){var e=this.__data__,n=Jo(e,t);return n<0?void 0:e[n][1]}function gw(t){return Jo(this.__data__,t)>-1}function yw(t,e){var n=this.__data__,r=Jo(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Cn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Cn.prototype.clear=uw,Cn.prototype.delete=pw,Cn.prototype.get=mw,Cn.prototype.has=gw,Cn.prototype.set=yw;var Yi=Xr(ln,"Map");function bw(){this.size=0,this.__data__={hash:new br,map:new(Yi||Cn),string:new br}}function kw(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Zo(t,e){var n=t.__data__;return kw(e)?n[typeof e=="string"?"string":"hash"]:n.map}function ww(t){var e=Zo(this,t).delete(t);return this.size-=e?1:0,e}function vw(t){return Zo(this,t).get(t)}function xw(t){return Zo(this,t).has(t)}function Ew(t,e){var n=Zo(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function kr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}kr.prototype.clear=bw,kr.prototype.delete=ww,kr.prototype.get=vw,kr.prototype.has=xw,kr.prototype.set=Ew;function Cw(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Sw(){this.__data__=new Cn,this.size=0}function _w(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function Ow(t){return this.__data__.get(t)}function Tw(t){return this.__data__.has(t)}var Nw=200;function Mw(t,e){var n=this.__data__;if(n instanceof Cn){var r=n.__data__;if(!Yi||r.length<Nw-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new kr(r)}return n.set(t,e),this.size=n.size,this}function jn(t){var e=this.__data__=new Cn(t);this.size=e.size}jn.prototype.clear=Sw,jn.prototype.delete=_w,jn.prototype.get=Ow,jn.prototype.has=Tw,jn.prototype.set=Mw;function Aw(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function Dw(){return[]}var Lw=Object.prototype,Bw=Lw.propertyIsEnumerable,uf=Object.getOwnPropertySymbols,Iw=uf?function(t){return t==null?[]:(t=Object(t),Aw(uf(t),function(e){return Bw.call(t,e)}))}:Dw;function $w(t,e,n){var r=e(t);return Go(t)?r:Cw(r,n(t))}function ff(t){return $w(t,Q2,Iw)}var Ul=Xr(ln,"DataView"),Yl=Xr(ln,"Promise"),ql=Xr(ln,"Set"),hf="[object Map]",Vw="[object Object]",pf="[object Promise]",mf="[object Set]",gf="[object WeakMap]",yf="[object DataView]",Pw=yr(Ul),Rw=yr(Yi),Fw=yr(Yl),zw=yr(ql),jw=yr(jl),Hn=Jr;(Ul&&Hn(new Ul(new ArrayBuffer(1)))!=yf||Yi&&Hn(new Yi)!=hf||Yl&&Hn(Yl.resolve())!=pf||ql&&Hn(new ql)!=mf||jl&&Hn(new jl)!=gf)&&(Hn=function(t){var e=Jr(t),n=e==Vw?t.constructor:void 0,r=n?yr(n):"";if(r)switch(r){case Pw:return yf;case Rw:return hf;case Fw:return pf;case zw:return mf;case jw:return gf}return e});var bf=ln.Uint8Array,Hw="__lodash_hash_undefined__";function Ww(t){return this.__data__.set(t,Hw),this}function Uw(t){return this.__data__.has(t)}function Xo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new kr;++e<n;)this.add(t[e])}Xo.prototype.add=Xo.prototype.push=Ww,Xo.prototype.has=Uw;function Yw(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function qw(t,e){return t.has(e)}var Kw=1,Gw=2;function kf(t,e,n,r,i,o){var s=n&Kw,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&Gw?new Xo:void 0;for(o.set(t,e),o.set(e,t);++f<l;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!Yw(e,function(k,x){if(!qw(p,x)&&(m===k||i(m,k,n,r,o)))return p.push(x)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}function Jw(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Zw(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var Xw=1,Qw=2,ev="[object Boolean]",tv="[object Date]",nv="[object Error]",rv="[object Map]",iv="[object Number]",ov="[object RegExp]",sv="[object Set]",lv="[object String]",av="[object Symbol]",cv="[object ArrayBuffer]",dv="[object DataView]",wf=Gr?Gr.prototype:void 0,Kl=wf?wf.valueOf:void 0;function uv(t,e,n,r,i,o,s){switch(n){case dv:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case cv:return!(t.byteLength!=e.byteLength||!o(new bf(t),new bf(e)));case ev:case tv:case iv:return Qu(+t,+e);case nv:return t.name==e.name&&t.message==e.message;case ov:case lv:return t==e+"";case rv:var l=Jw;case sv:var c=r&Xw;if(l||(l=Zw),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=Qw,s.set(t,e);var u=kf(l(t),l(e),r,i,o,s);return s.delete(t),u;case av:if(Kl)return Kl.call(t)==Kl.call(e)}return!1}var fv=1,hv=Object.prototype,pv=hv.hasOwnProperty;function mv(t,e,n,r,i,o){var s=n&fv,l=ff(t),c=l.length,d=ff(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:pv.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<c;){h=l[f];var k=t[h],x=e[h];if(r)var w=s?r(x,k,h,e,t,o):r(k,x,h,t,e,o);if(!(w===void 0?k===x||i(k,x,n,r,o):w)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var b=t.constructor,C=e.constructor;b!=C&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof C=="function"&&C instanceof C)&&(g=!1)}return o.delete(t),o.delete(e),g}var gv=1,vf="[object Arguments]",xf="[object Array]",Qo="[object Object]",yv=Object.prototype,Ef=yv.hasOwnProperty;function bv(t,e,n,r,i,o){var s=Go(t),l=Go(e),c=s?xf:Hn(t),d=l?xf:Hn(e);c=c==vf?Qo:c,d=d==vf?Qo:d;var u=c==Qo,f=d==Qo,h=c==d;if(h&&Hl(t)){if(!Hl(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new jn),s||df(t)?kf(t,e,n,r,i,o):uv(t,e,c,n,r,i,o);if(!(n&gv)){var p=u&&Ef.call(t,"__wrapped__"),m=f&&Ef.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new jn),i(g,y,n,r,o)}}return h?(o||(o=new jn),mv(t,e,n,r,i,o)):!1}function Cf(t,e,n,r,i){return t===e?!0:t==null||e==null||!Zr(t)&&!Zr(e)?t!==t&&e!==e:bv(t,e,n,r,Cf,i)}var Gl=function(){return ln.Date.now()},kv="Expected a function",wv=Math.max,vv=Math.min;function Jl(t,e,n){var r,i,o,s,l,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(kv);e=Ju(e)||0,Hi(n)&&(u=!!n.leading,f="maxWait"in n,o=f?wv(Ju(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(v){var O=r,D=i;return r=i=void 0,d=v,s=t.apply(D,O),s}function m(v){return d=v,l=setTimeout(k,e),u?p(v):s}function g(v){var O=v-c,D=v-d,A=e-O;return f?vv(A,o-D):A}function y(v){var O=v-c,D=v-d;return c===void 0||O>=e||O<0||f&&D>=o}function k(){var v=Gl();if(y(v))return x(v);l=setTimeout(k,g(v))}function x(v){return l=void 0,h&&r?p(v):(r=i=void 0,s)}function w(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function b(){return l===void 0?s:x(Gl())}function C(){var v=Gl(),O=y(v);if(r=arguments,i=this,c=v,O){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(k,e),p(c)}return l===void 0&&(l=setTimeout(k,e)),s}return C.cancel=w,C.flush=b,C}function qi(t,e){return Cf(t,e)}const xv={},Ev={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Cv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"},null,-1)];function Sv(t,e){return a.openBlock(),a.createElementBlock("svg",Ev,Cv)}const _v=be(xv,[["render",Sv]]),Ov={key:0,class:"leading-none"},Tv={key:1},Nv={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},Mv={key:1},Av={key:0,class:"sticky top-16 bg-white z-[1] px-4 pb-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},Dv=["onClick"],Lv={class:"select-none flex w-full items-center justify-between"},Bv={class:"flex-1"},Iv={key:0,class:"px-4 py-2 text-sm text-gray-500 dark:text-gray-400 text-center"},$v={key:1,class:"px-4 py-2 text-sm text-gray-400 text-center"},Sf=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,medium:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean,material:Boolean,naked:Boolean,hideChevron:Boolean,summaryText:String,oneLine:Boolean,total:{type:Number,default:null},groupSelected:{type:Boolean,default:!1}},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,{t:i}=zn(),o=a.computed(()=>r.placeholder==="Select..."?i("wpiccomponents.placeholder_select"):r.placeholder),s=a.ref(!1),l=a.ref(r.options);a.watch(()=>r.options,()=>{const R=(Array.isArray(r.modelValue)?r.modelValue:r.modelValue!==null&&r.modelValue!==void 0?[r.modelValue]:[]).map(K=>l.value.find(H=>qi(H.value,K))||r.options.find(H=>qi(H.value,K))).filter(Boolean);if(!r.groupSelected||!r.multiple){const K=new Set;l.value=[...r.options,...R].filter(H=>{const $=JSON.stringify(H.value);return K.has($)?!1:(K.add($),!0)})}else{const K=[...R];for(const H of r.options)K.some($=>qi($.value,H.value))||K.push(H);l.value=K}},{immediate:!0,deep:!0});const c=n,d=a.ref(),u=a.ref();function f(L){var R,K;if(r.multiple){if(L){let H=r.modelValue||[];H.indexOf(L)>=0?H.splice(H.indexOf(L),1):H.push(L),c("update:modelValue",H),g(H),((R=r.modelValue)==null?void 0:R.length)===((K=r.options)==null?void 0:K.length)?s.value=!0:s.value=!1}}else c("update:modelValue",L),g(L),d.value=null,u.value.hide()}async function h(L){var R,K;c("update:modelValue",L),g(L),await a.nextTick(),((R=r.modelValue)==null?void 0:R.length)===((K=r.options)==null?void 0:K.length)&&(s.value=!0)}function p(L){c("update:modelValue",L),s.value=!1,g(L)}function m(){s.value=!1,r.multiple?(c("update:modelValue",[]),g([])):(c("update:modelValue",null),g(null))}const g=Jl(function(L){c("change",L)},r.debounce),y=a.computed(()=>{var L,R,K,H;if(r.multiple){const $=((L=l.value)==null?void 0:L.filter(B=>{var z;return(z=r.modelValue)==null?void 0:z.includes(B.value)}))||[],S=((R=r.modelValue)==null?void 0:R.length)||0;if(r.summaryText&&S>0){const B=i(r.summaryText,S);return i("wpiccomponents.summary_items",{count:S,type:B})}if(r.maxDisplay){const B=$.slice(0,r.maxDisplay);return $.length-B.length>0?`${B.map(z=>z.label).join(", ")} (+${$.length-B.length})`:B.map(z=>z.label).join(", ")}else return $.map(B=>B.label).join(", ")}else return((H=(K=l.value)==null?void 0:K.find($=>$.value===r.modelValue))==null?void 0:H.label)||r.modelValue});function k(L){var R;try{return r.multiple?r.modelValue!==null&&((R=r.modelValue)==null?void 0:R.some(K=>qi(K,L))):r.modelValue!==null&&qi(L,r.modelValue)}catch(K){return console.log(K),!1}}const x={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-gray-800 group-[.is-selected]:font-semibold text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-white"},w=a.computed(()=>{var L,R;return((L=r.modelValue)==null?void 0:L.length)===((R=r.options)==null?void 0:R.length)}),b=a.computed(()=>{var $;const L=l.value||[];if(r.filterable&&!r.remoteMethod&&(($=d.value)!=null&&$.trim().length)){const S=d.value.trim().toLowerCase(),B=L.filter(te=>{var re;return(re=te.label)==null?void 0:re.toLowerCase().includes(S)});if(!r.groupSelected||!r.multiple)return B;const z=r.modelValue||[],X=B.filter(te=>z.includes(te.value)),j=B.filter(te=>!z.includes(te.value));return[...X,...j]}if(!r.groupSelected||!r.multiple)return L;const R=r.modelValue||[],K=L.filter(S=>R.includes(S.value)),H=L.filter(S=>!R.includes(S.value));return[...K,...H]});function C(){v.value=1,r.remoteMethod&&(O.value=!0,I(d.value,v.value,()=>{O.value=!1}))}const v=a.ref(1),O=a.ref(!1),D=a.computed(()=>{var L;return r.total!==void 0&&((L=r.options)==null?void 0:L.length)>=r.total});function A(L){const R=L.target;R.scrollTop+R.clientHeight>=R.scrollHeight-30&&!O.value&&!D.value&&(O.value=!0,v.value+=1,I(d.value,v.value,()=>{O.value=!1}))}const I=Jl((L,R,K)=>{r.remoteMethod(L,R).finally(()=>{K==null||K()})},r.debounce||300);return e({allSelected:s,isAllSelected:w}),(L,R)=>(a.openBlock(),a.createBlock(fr,{custom:"",ref_key:"myPopover",ref:u,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:K})=>[a.createVNode(zi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,medium:t.medium,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var H,$,S,B,z,X;return[a.createElementVNode("span",{class:a.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple,truncate:t.oneLine}])},[t.modelValue&&(!t.multiple||t.multiple&&((H=t.modelValue)==null?void 0:H.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",Ov,[w.value&&(($=t.allSelectedText)!=null&&$.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((S=t.options)==null?void 0:S.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(y.value),1)],64))])):!t.multiple&&((B=t.options)!=null&&B.find(j=>j.value===null))?(a.openBlock(),a.createElementBlock("span",Tv,a.toDisplayString((X=(z=t.options)==null?void 0:z.find(j=>j.value===null))==null?void 0:X.label),1)):a.renderSlot(L.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(o.value),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(m,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Ii,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(a.openBlock(),a.createBlock(_v,{key:1,class:a.normalizeClass(["h-5 w-5 -mr-[2px]",{"h-4!":t.small||t.medium}])},null,8,["class"])):a.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","medium","invalid","loading"])]),content:a.withCtx(()=>{var K,H;return[a.createElementVNode("div",{class:"flex flex-col max-h-80 overflow-y-auto overflow-x-hidden relative",onScrollPassive:A},[t.filterable?(a.openBlock(),a.createElementBlock("div",Nv,[a.createVNode(Nf,{slim:"",placeholder:L.$t("wpiccomponents.placeholder_search"),clearable:"",modelValue:d.value,"onUpdate:modelValue":[R[0]||(R[0]=$=>d.value=$),C]},null,8,["placeholder","modelValue"])])):a.createCommentVNode("",!0),!t.options&&((K=t.options)==null?void 0:K.length)==0?(a.openBlock(),a.createElementBlock("span",Mv,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",Av,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:R[1]||(R[1]=$=>{var S;return h((S=b.value)==null?void 0:S.filter(B=>B.value).map(B=>B.value))})},a.toDisplayString(L.$t("wpiccomponents.select_all")),1),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:R[2]||(R[2]=$=>p([]))},a.toDisplayString(L.$t("wpiccomponents.select_none")),1)])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.value,$=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!k($.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||$.value,[`${x[a.unref(he).theme]}`]:!0}]),onClick:S=>$.disabled?null:f($.value)},[a.createElementVNode("div",Lv,[a.createElementVNode("div",Bv,[a.createElementVNode("div",{class:a.normalizeClass(["",{"opacity-25":$.disabled,"line-clamp-1":t.oneLine}])},a.toDisplayString($.label||$.value),3),$.description?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-xs opacity-50 font-normal!",{"opacity-10":$.disabled}])},a.toDisplayString($.description),3)):a.createCommentVNode("",!0)]),t.multiple&&k($.value)?(a.openBlock(),a.createBlock(Uu,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,Dv)],2))),256)),r.remoteMethod?(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[O.value?(a.openBlock(),a.createElementBlock("div",Iv,a.toDisplayString(L.$t("wpiccomponents.loading_more")),1)):D.value&&((H=t.options)==null?void 0:H.length)>0?(a.openBlock(),a.createElementBlock("div",$v,a.toDisplayString(L.$t("wpiccomponents.no_more_results")),1)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)],64))],32)]}),_:3},8,["label","disabled"]))}}),_f=Object.assign({name:"WpicToggleSwitch"},{props:{modelValue:Boolean,label:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(){n.disabled||r("update:modelValue",!n.modelValue)}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[a.createElementVNode("div",{class:a.normalizeClass(["w-11 h-6 rounded-full shadow-inner flex items-center transition-all duration-100",{"bg-lime-500 dark:bg-lime-600":t.modelValue,"bg-gray-300 dark:bg-gray-800":!t.modelValue}])},[a.createElementVNode("div",{class:a.normalizeClass(["w-5 h-5 rounded-full bg-white dark:bg-gray-500 shadow-md transition-all duration-100 transform",{"translate-x-[calc(100%+3px)] dark:!bg-gray-200":t.modelValue,"translate-x-px":!t.modelValue}])},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},a.toDisplayString(t.label),3)],2))}}),Vv={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Pv=["disabled","rows","placeholder"],Of=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,info:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=a.computed(()=>Number(r.minHeight)||0),s=a.computed(()=>Number(r.maxHeight)||1/0),l=a.ref(null),c=a.ref(!1),d=a.ref(r.modelValue??"");a.watch(()=>r.modelValue,h=>{d.value=h??""}),a.watch(d,h=>{i("update:modelValue",h),u()}),a.onMounted(()=>a.nextTick(u));function u(){const h=l.value;if(!h||!r.autoResize)return;h.style.height="auto";const p=h.scrollHeight,m=Math.max(o.value,Math.min(p,s.value));h.style.height=`${m}px`,c.value=p>s.value}function f(){var h;(h=l.value)==null||h.focus()}return e({focus:f}),(h,p)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[t.label?(a.openBlock(),a.createElementBlock("div",Vv,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",null,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),a.withDirectives(a.createElementVNode("textarea",{ref_key:"myTextarea",ref:l,"onUpdate:modelValue":p[0]||(p[0]=m=>d.value=m),class:a.normalizeClass(["relative appearance-none outline-hidden flex w-full rounded-sm px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus-visible:border-none placeholder:opacity-30 dark:text-gray-400",{"cursor-not-allowed":t.disabled,"resize-none":t.autoResize||t.noResize,"overflow-hidden":t.autoResize&&!c.value,"overflow-auto":c.value}]),style:a.normalizeStyle({minHeight:t.autoResize?`${o.value}px`:void 0,maxHeight:t.autoResize?`${s.value}px`:void 0}),disabled:t.disabled,rows:t.rows,placeholder:t.placeholder},null,14,Pv),[[a.vModelText,d.value]])],64))}}),Rv=["placeholder"],Tf={__name:"ColorPicker",props:{modelValue:String,defaultColor:{type:String},loading:Boolean,material:Boolean,naked:Boolean,isInvalid:Boolean,placeholder:String,disabled:Boolean,small:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return a.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,l)=>(a.openBlock(),a.createBlock(zi,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[a.vModelText,i.value]]),a.withDirectives(a.createElementVNode("input",{type:"text","onUpdate:modelValue":l[1]||(l[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,Rv),[[a.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},Fv={},zv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},jv=[a.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),a.createElementVNode("path",{"fill-rule":"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z","clip-rule":"evenodd"},null,-1)];function Hv(t,e){return a.openBlock(),a.createElementBlock("svg",zv,jv)}const Wv=be(Fv,[["render",Hv]]),Uv={},Yv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},qv=[a.createElementVNode("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM22.676 12.553a11.249 11.249 0 0 1-2.631 4.31l-3.099-3.099a5.25 5.25 0 0 0-6.71-6.71L7.759 4.577a11.217 11.217 0 0 1 4.242-.827c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113Z"},null,-1),a.createElementVNode("path",{d:"M15.75 12c0 .18-.013.357-.037.53l-4.244-4.243A3.75 3.75 0 0 1 15.75 12ZM12.53 15.713l-4.243-4.244a3.75 3.75 0 0 0 4.244 4.243Z"},null,-1),a.createElementVNode("path",{d:"M6.75 12c0-.619.107-1.213.304-1.764l-3.1-3.1a11.25 11.25 0 0 0-2.63 4.31c-.12.362-.12.752 0 1.114 1.489 4.467 5.704 7.69 10.675 7.69 1.5 0 2.933-.294 4.242-.827l-2.477-2.477A5.25 5.25 0 0 1 6.75 12Z"},null,-1)];function Kv(t,e){return a.openBlock(),a.createElementBlock("svg",Yv,qv)}const Gv=be(Uv,[["render",Kv]]),Jv={},Zv={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Xv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function Qv(t,e){return a.openBlock(),a.createElementBlock("svg",Zv,Xv)}const ex=be(Jv,[["render",Qv]]),tx={class:"flex items-center gap-2"},nx={key:0},rx={class:""},ix=["innerHTML"],ox={class:"flex justify-end"},sx=["name","value","checked"],lx={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},ax={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},cx={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},dx={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Nf=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,medium:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color:Boolean,summaryText:String,oneLine:Boolean,total:Number},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-iron-900 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-iron-800 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=a.computed(()=>o.name?o.name:kl()),l=Y0(s.value),c=a.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=a.ref(!0),u=a.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=a.computed(()=>{var I;if(o.rules&&typeof o.rules=="string"){let L=(I=o.rules)==null?void 0:I.split("|");return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}else if(!o.rules){let L=[];return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}return"required"});function p(I){let L=I&&I.target?I.target.value:I;x(L)}const m=n;function g(I){I===!0||I===!1?m("update:modelValue",!I):m("update:modelValue",I)}function y(I){let L=I&&I.target?I.target.value:I;m("update:modelValue",L),m("onChange",L)}function k(){m("update:modelValue",null),m("onChange",null),m("onClear")}const x=Jl(function(I){m("update:modelValue",I),m("onChange",I)},o.debounce),w=a.ref(null),b=a.ref();function C(){var I,L;o.textarea?(I=b.value)==null||I.focus():(L=w.value)==null||L.$el.focus()}function v(){return w.value.meta.valid}const O=a.ref(),D=a.computed(()=>O.value.allSelected),A=a.computed(()=>O.value.isAllSelected);return e({focus:C,isValid:v,allSelected:D,isAllSelected:A}),(I,L)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio&&!t.toggleSwitch?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass([{"text-sm":t.small,"text-base":!t.small},"mb-2 wpic-form-label text-gray-500 dark:text-gray-500 flex items-center justify-between"])},[a.createElementVNode("div",tx,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",nx,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",rx,[t.info?(a.openBlock(),a.createBlock(fr,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,ix)]),default:a.withCtx(()=>[a.createVNode(Fl,{class:"w-4 h-4 text-iron-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",ox,[a.renderSlot(I.$slots,"more")])],2)):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(cr),{key:1,ref_key:"myInput",ref:w,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:R})=>[a.createElementVNode("div",{class:a.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:L[0]||(L[0]=K=>t.disabled?void 0:g(t.modelValue))},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[a.unref(he).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(Uu,{key:0})):a.createCommentVNode("",!0)],2),a.createElementVNode("span",{class:a.normalizeClass(["text-base cursor-pointer select-none text-gray-600 dark:text-gray-500",{"!text-gray-500/50 dark:text-gray-700/50":t.disabled}])},[a.renderSlot(I.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(a.openBlock(),a.createBlock(a.unref(cr),{key:2,ref_key:"myInput",ref:w,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:R})=>[a.createElementVNode("div",{onClick:L[2]||(L[2]=()=>{t.disabled||y(t.radioValue)}),class:a.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[a.createElementVNode("span",{class:a.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled,"border-lime-600!":t.radioValue==t.modelValue}])},[t.radioValue==t.modelValue?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["flex rounded-full h-full w-full bg-lime-600",{"bg-opacity-50":t.disabled}])},null,2)):a.createCommentVNode("",!0)],2),a.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:L[1]||(L[1]=(...K)=>I.onChange&&I.onChange(...K)),checked:t.radioValue==t.modelValue},null,40,sx),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["text-base text-gray-700 dark:text-gray-300",{"opacity-50":t.disabled}])},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(a.openBlock(),a.createBlock(a.unref(cr),{key:3,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:R})=>{var K;return[a.createVNode(Sf,{ref_key:"myChoiceList",ref:O,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,medium:t.medium,oneLine:t.oneLine,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,summaryText:t.summaryText,debounce:t.debounce,total:t.total,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((K=h.value)==null?void 0:K.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","medium","oneLine","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","summaryText","debounce","total","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(a.openBlock(),a.createBlock(a.unref(cr),{key:4,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:R})=>[a.createVNode(Tf,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":y},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(a.openBlock(),a.createBlock(a.unref(cr),{key:5,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:R})=>[a.createVNode(_f,{modelValue:t.modelValue,"onUpdate:modelValue":y,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createElementBlock("div",{key:6,class:a.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[a.unref(he).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-gray-200! bg-gray-50! dark:bg-gray-940! dark:border-gray-900! text-gray-400 dark:text-gray-800":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":a.unref(l)}])},[I.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["absolute dark:text-iron-400 left-0 ml-0 w-9 h-full flex items-center text-center",{"justify-center":!t.naked}])},[a.createElementVNode("div",lx,[a.renderSlot(I.$slots,"prepend")])],2)):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(cr),{key:1,ref_key:"myInput",ref:w,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var R;return[a.createVNode(Of,{ref_key:"myTextarea",ref:b,modelValue:t.modelValue,"onUpdate:modelValue":p,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((R=h.value)==null?void 0:R.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createBlock(a.unref(cr),{key:2,ref_key:"myInput",ref:w,autocomplete:"off",style:{"z-index":"1"},class:a.normalizeClass(["flex w-full h-full rounded-sm pr-4 bg-transparent outline-hidden appearance-none dark:text-gray-400 dark:placeholder:text-iron-600",{"pl-4":!I.$slots.prepend&&!t.naked,"pl-8":I.$slots.prepend&&!t.naked,"pl-6":I.$slots.prepend&&t.naked,"py-2":t.textarea,"text-sm":t.small,"cursor-not-allowed dark:placeholder:text-gray-800!":t.disabled}]),type:u.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:p,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!a.unref(l),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(a.openBlock(),a.createElementBlock("div",{key:3,onClick:a.withModifiers(k,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Fr,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(k,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Ii,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),I.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",ax,[a.createElementVNode("div",cx,[a.renderSlot(I.$slots,"append",{},()=>[a.withDirectives(a.createVNode(Wv,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(Gv,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,!d.value]])])])])):a.createCommentVNode("",!0)],2)),t.error&&a.unref(l)?(a.openBlock(),a.createElementBlock("div",dx,[a.createVNode(a.unref(U0),{name:s.value},{default:a.withCtx(R=>[a.createTextVNode(a.toDisplayString(R.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),I.$slots.help||t.help?(a.openBlock(),a.createElementBlock("div",{key:8,class:a.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[a.renderSlot(I.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),ux=["innerHTML"],Mf=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},full:Boolean,text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=a.ref(),n=a.ref(),r=a.ref();kl();const i=t;function o(){i.text&&(n.value.style.display="block",l())}function s(){n.value.style.display=""}async function l(){var h,p;await a.nextTick();const c=await Od(e.value,n.value,{placement:i.placement,middleware:[_d(),Sd(),Cd(i.offset),qy({element:r.value})]});n.value.style.left=`${c.x}px`,n.value.style.top=`${c.y}px`;const{x:d,y:u}=c.middlewareData.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[(h=i.placement)==null?void 0:h.split("-")[0]];r.value&&Object.assign((p=r.value)==null?void 0:p.style,{left:d!=null?`${d}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[f]:"-4px"})}return(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("span",{ref_key:"button",ref:e,class:a.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[a.renderSlot(c.$slots,"default")],34),a.createElementVNode("div",{ref_key:"tooltip",ref:n,class:"tooltip z-30 px-3 py-2 border border-zinc-200 dark:border-gray-900 text-sm absolute top-0 left-0 bg-black text-white rounded-md hidden",role:"tooltip"},[a.createElementVNode("span",{innerHTML:t.text},null,8,ux),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),fx={key:1,class:"flex justify-between items-baseline pt-4 px-6"},hx={class:""},px={key:2,class:"flex items-center justify-end py-4 px-6"},mx=Object.assign({name:"WpicCard"},{props:{title:String,inline:Boolean,loading:Boolean},setup(t){const e={pmi:"bg-white dark:bg-zinc-800/50 shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"bg-white border border-gray-200 dark:bg-gray-940 dark:border-gray-920"},n={pmi:"font-bold","wpic-tools":"font-medium dark:text-gray-300"};return(r,i)=>{const o=a.resolveComponent("wpic-loading-panel");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["rounded-lg wpic-card relative",{[e[a.unref(he).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(a.openBlock(),a.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):a.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",fx,[t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[a.unref(he).theme]]])},[a.renderSlot(r.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])],2)):a.createCommentVNode("",!0),a.createElementVNode("div",hx,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",px,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),gx={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},yx={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},bx=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean,expand:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[a.unref(he).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions&&n.$slots.title),"pt-6":!t.title&&!n.$slots.actions&&!n.$slots.title,"bg-gray-50 dark:bg-gray-930 last:rounded-b-lg":t.sub,"p-0! m-0!":t.expand}])},[t.title||n.$slots.title||n.$slots.actions?(a.openBlock(),a.createElementBlock("div",gx,[a.createElementVNode("div",yx,[a.renderSlot(n.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])]),a.renderSlot(n.$slots,"actions")])):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"default")],2))}}),kx=a.createElementVNode("div",{class:""},null,-1),wx=a.createStaticVNode('<div class="-mt-2"><div class="absolute left-1/4 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-1/2 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-3/4 h-8 border-r border-gray-100 dark:border-gray-900"></div></div><div class="mt-7 text-gray-500 dark:text-gray-600"><div class="absolute left-0 text-xs">0%</div><div class="absolute left-1/4 -translate-x-1/4 text-xs">25%</div><div class="absolute left-1/2 -translate-x-1/2 text-xs">50%</div><div class="absolute right-1/4 translate-x-3/4 text-xs">75%</div><div class="absolute right-0 text-xs">100%</div></div>',2),vx=Object.assign({name:"WpicProgressBar"},{props:{percent:Number,value:Number,indicators:Boolean,background:{type:String,default:null},max:{type:Number,default:100},text:String},setup(t){const e=t,n=a.computed(()=>e.percent?e.percent:100/e.max*e.value),r={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-gray-100 rounded-xs h-4 dark:bg-gray-900"},i={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-xs dark:bg-lime-700"};return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex w-full relative",r[a.unref(he).theme]]),style:{"z-index":"1"}},[n.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({width:`${n.value}%`}),class:a.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[a.unref(he).theme]}`]:!0}])},[a.createVNode(Mf,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[kx]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[wx],64)):a.createCommentVNode("",!0)],2))}}),xx={class:"leading-none"},Ex=Object.assign({name:"WpicTag"},{props:{clearable:Boolean,small:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-none bg-gray-200 text-gray-700 text-sm dark:text-gray-400 dark:bg-gray-810"},r=e;function i(){r("clear")}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-tag select-none border inline-flex rounded-sm h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-1":t.clearable,[n[a.unref(he).theme]]:!0}])},[a.createElementVNode("span",xx,[a.renderSlot(o.$slots,"default")]),t.clearable?(a.openBlock(),a.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Ii,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Cx=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass({"w-full":t.full})},[a.createElementVNode("div",{class:a.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[a.renderSlot(e.$slots,"default")],2)],2))}}),Sx=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),_x={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Ox=[Sx(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Tx=be(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(a.openBlock(),a.createElementBlock("div",_x,Ox)):(a.openBlock(),a.createBlock(Fr,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Nx={class:"text-base font-medium select-none"},Ki=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean,disabled:Boolean},setup(t){const e={pmi:"border-zinc-300 dark:border-zinc-700 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-500 hover:text-white","wpic-tools":"dark:text-gray-400 hover:text-lime-600 dark:border-gray-900"},n={pmi:"bg-violet-800 border-violet-800 hover:bg-violet-900 hover:border-violet-900 text-white","wpic-tools":"bg-lime-500 border-lime-500 text-white dark:bg-lime-700 dark:border-lime-700"},r={pmi:"text-zinc-300","wpic-tools":"text-gray-300 dark:text-gray-700 dark:border-gray-900"};return(i,o)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[a.unref(he).theme]]:!t.active&&!t.disabled,[n[a.unref(he).theme]]:t.active&&!t.disabled,[r[a.unref(he).theme]]:t.disabled}])},[a.createElementVNode("span",Nx,[a.renderSlot(i.$slots,"default")])],2))}}),Mx={},Ax={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Dx=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function Lx(t,e){return a.openBlock(),a.createElementBlock("svg",Ax,Dx)}const Af=be(Mx,[["render",Lx]]),Bx={},Ix={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},$x=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z","clip-rule":"evenodd"},null,-1)];function Vx(t,e){return a.openBlock(),a.createElementBlock("svg",Ix,$x)}const Df=be(Bx,[["render",Vx]]),Px={},Rx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Fx=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function zx(t,e){return a.openBlock(),a.createElementBlock("svg",Rx,Fx)}const Lf=be(Px,[["render",zx]]),jx={},Hx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Wx=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function Ux(t,e){return a.openBlock(),a.createElementBlock("svg",Hx,Wx)}const Bf=be(jx,[["render",Ux]]),Yx={class:"wpic-pagination flex justify-between"},qx={key:0,class:"flex items-center"},Kx={key:0},Gx={key:1,class:"flex flex-wrap gap-2"},Jx=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:{type:Boolean,default:!1},total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1},perPageOptions:{type:Array,default:()=>[10,20,50,100,200]}},emits:["update:perPage","update:currentPage","update:perPage"],setup(t,{expose:e,emit:n}){const{t:r}=zn(),i=t,o=a.computed(()=>i.perPageOptions.map(p=>({value:Number(p),label:r("wpiccomponents.per_page",{count:p})}))),s=n,l=a.computed(()=>Math.ceil(i.total/i.perPage)),c=a.computed(()=>{const p=l.value;if(!p||p===1)return[1];const m=i.currentPage,g=1;let y=Math.max(2,m-g),k=Math.min(p-1,m+g);m<=g+2&&(y=2,k=Math.min(2*g+2,p-1)),m>=p-g-1&&(y=Math.max(2,p-2*g-1),k=p-1);const x=[];for(let w=y;w<=k;w++)x.push(w);return y>2&&x.unshift("..."),k<p-1&&x.push("..."),[1,...x,p]});function d(p){p>=1&&p<=l.value&&s("update:currentPage",p)}function u(){return i.perPage*(i.currentPage-1)+1}function f(){return i.perPage*i.currentPage>i.total?i.total:i.perPage*i.currentPage}async function h(p){s("update:perPage",p),s("update:currentPage",1)}return e({getStart:u,getEnd:f}),(p,m)=>{const g=a.resolveComponent("wpic-choice-list");return a.openBlock(),a.createElementBlock("div",Yx,[t.info?(a.openBlock(),a.createElementBlock("div",qx,[t.total>0?(a.openBlock(),a.createElementBlock("span",Kx,a.toDisplayString(p.$t("wpiccomponents.pagination",{start:u(),end:f(),total:t.total})),1)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",Gx,[a.createVNode(Ki,{onClick:m[0]||(m[0]=y=>d(1)),disabled:t.currentPage===1||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Af,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Ki,{onClick:m[1]||(m[1]=y=>d(t.currentPage-1)),disabled:t.currentPage===1||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Df,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.value,y=>(a.openBlock(),a.createBlock(Ki,{key:`page_${y}`,onClick:k=>d(y),active:y===t.currentPage,disabled:l.value==0||!l.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(y),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Ki,{onClick:m[2]||(m[2]=y=>d(t.currentPage+1)),disabled:t.currentPage===l.value||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Bf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Ki,{onClick:m[3]||(m[3]=y=>d(l.value)),disabled:t.currentPage===l.value||l.value==0||!l.value},{default:a.withCtx(()=>[a.createVNode(Lf,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(a.openBlock(),a.createBlock(g,{key:0,modelValue:t.perPage,"onUpdate:modelValue":h,options:o.value},null,8,["modelValue","options"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])}}}),If=(t,e)=>{const n=t.column.children&&t.column.children.default&&typeof t.column.children.default=="function"?t.column.children.default({item:t.item}):t.column.children;return a.h("td",e.attrs,n)};If.props=["column","item","rowIndex"];const es=If,Zx={},Xx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Qx=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function eE(t,e){return a.openBlock(),a.createElementBlock("svg",Xx,Qx)}const tE=be(Zx,[["render",eE]]),nE={class:"font-semibold"},$f={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String,checkable:Boolean},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-gray-50 border-gray-200 dark:text-gray-300 dark:border-gray-900 dark:bg-gray-810/45"};return(n,r)=>(a.openBlock(),a.createElementBlock("tr",nE,[t.checkable?(a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(he).theme]}`]:!0,"sticky left-0":!0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer"}]),id:"total_0",column:{},key:"tr_total_0"},null,8,["class"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,(i,o)=>(a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(he).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer","text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},rE={},iE={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},oE=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function sE(t,e){return a.openBlock(),a.createElementBlock("svg",iE,oE)}const lE=be(rE,[["render",sE]]),aE={},cE={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},dE=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"},null,-1)];function uE(t,e){return a.openBlock(),a.createElementBlock("svg",cE,dE)}const fE=be(aE,[["render",uE]]),hE={class:"wpic-table"},pE={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},mE={class:"flex items-center gap-2"},gE={class:"flex items-center gap-2"},yE={class:"w-full rounded-lg"},bE={key:0,class:"w-16"},kE=["width"],wE=["width"],vE={class:"flex justify-center items-center h-full"},xE=["onClick"],EE={class:"rounded-b-lg relative"},CE={key:0},SE=[a.createElementVNode("td",{class:"text-center py-3"},"   ",-1)],_E=["onClick"],OE={class:"flex justify-center items-center h-full"},TE={key:1},NE={key:0,class:"text-center text-gray-400 py-3"},ME=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"},small:Boolean,noRadius:Boolean,stickyHeader:Boolean,columnToggleable:Boolean,checkable:Boolean,itemId:{type:String,default:"id"}},emits:["changeSort","expandRow","row-click"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-gray-300 dark:border-gray-700"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-gray-100 text-gray-600 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},l={pmi:"","wpic-tools":""},c={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white text-gray-500 !font-normal border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-400"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50 border-gray-200 dark:group-[.is-odd]:bg-gray-940 dark:group-[.is-even]:bg-gray-930"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-gray-900/10 dark:bg-gray-950/75"},f=n;a.onMounted(()=>{k()});const h=a.getCurrentInstance();a.provide("wtable",h==null?void 0:h.proxy);const p=a.useSlots(),m=a.ref([]),g=a.ref([]),y=a.computed(()=>r.columnToggleable?m.value.filter(S=>g.value.includes(S.field)||!S.selectable):m.value.filter(S=>S.visible||!S.selectable));function k(){const S=(X,j)=>{let te={};for(let re in X){if(typeof X[re].default=="boolean"&&j[re]!==void 0){te[re]=j[re]!==!1;continue}if(j[re]!==void 0){te[re]=j[re];continue}if(typeof X[re].default=="function"){te[re]=X[re].default();continue}te[re]=X[re].default}return te};let B=[];(p.default&&p.default()||[]).forEach(X=>{var j,te;((j=X.type)==null?void 0:j.name)==="WpicTableColumn"?B.push(X):(te=X.children)!=null&&te.length&&X.children.forEach(re=>{var P;((P=re.type)==null?void 0:P.name)==="WpicTableColumn"&&B.push(re)})}),m.value=B.map(X=>{let j=X.children,te=X.props||{},{field:re,label:P,help:W,width:G,minWidth:q,maxWidth:V,sortable:ue,selectable:ce,render:we,type:Se,align:Be,visible:je,noPadding:ne}=S(X.type.props,te);return re||(re=L(P)),ce&&je&&g.value.push(re),{label:P,help:W,width:G,minWidth:q,maxWidth:V,type:Se,align:Be,sortable:ue,selectable:ce,field:re,render:we,children:j,visible:je,noPadding:ne}})}function x(S){var z,X;let B=(z=r.sortOptions)==null?void 0:z.sortDirection;((X=r.sortOptions)==null?void 0:X.sortBy)===S&&(B=B==="asc"?"desc":"asc"),f("changeSort",{sortDirection:B,sortBy:S})}a.watch(()=>p.default,S=>{k()},{deep:!0});const w=a.reactive({});function b({index:S,item:B}){w[S]?w[S]=null:(w[S]=!0,f("expandRow",{index:S,item:B}))}const C=a.ref([]);function v(S){const B=I(S,r.itemId);C.value.includes(B)?(C.value.splice(C.value.indexOf(B),1),O.value=!1):C.value.push(B)}const O=a.ref(!1);function D(){if(O.value=!O.value,C.value=[],O.value)for(let S of r.data){let B=I(S,r.itemId);C.value.push(B)}}function A(){O.value=!1,C.value=[]}e({buildColumns:k,selectedRows:C,selectedColumns:g,resetSelectedRows:A});function I(S,B){return B.split(".").reduce((z,X)=>z?z[X]:void 0,S)}function L(S){return!S||typeof S!="string"?"":S.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}const R=a.computed(()=>{var B;const S=((B=h==null?void 0:h.vnode)==null?void 0:B.props)??{};return!!(S["onRow-click"]||S.onRowClick)});function K(S){const B=[];for(;S;)B.push(S),S=S.parentNode||S.host;return B}function H(S){const B='a, button, input, select, textarea, label, summary, [role="button"], [contenteditable="true"]',z=new Set(["SPAN","DIV","SVG","I","IMG"]),X=S.composedPath?S.composedPath():K(S.target),j=window.getSelection&&window.getSelection();if(j&&j.type==="Range")return!0;for(const te of X){if(!(te instanceof Element))continue;if(te.tagName==="TR")break;if(te.matches(B))return!0;const re=window.getComputedStyle(te);if(re&&re.cursor==="pointer"&&z.has(te.tagName))return!0}return!1}function $(S,B,z){R.value&&(H(S)||f("row-click",B,z,S))}return(S,B)=>{const z=a.resolveComponent("wpic-choice-list"),X=a.resolveComponent("wpic-form-field");return a.openBlock(),a.createElementBlock("div",hE,[S.$slots.header||S.$slots.actions||t.columnToggleable?(a.openBlock(),a.createElementBlock("div",pE,[a.createElementVNode("div",mE,[a.renderSlot(S.$slots,"header")]),a.createElementVNode("div",gE,[a.renderSlot(S.$slots,"actions"),a.createVNode(z,{multiple:"",modelValue:g.value,"onUpdate:modelValue":B[0]||(B[0]=j=>g.value=j),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(j=>j.selectable).map(j=>({label:j.label,value:j.field}))},{default:a.withCtx(()=>[a.createVNode(Ni,{medium:"",square:"",colorless:"",class:"ml-px"},{default:a.withCtx(()=>[a.createVNode(fE,{class:"w-5 h-5"})]),_:1})]),_:1},8,["modelValue","options"])])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[a.unref(he).theme]}`]:!0}])},[a.createElementVNode("div",{class:a.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[a.createElementVNode("table",yE,[a.createElementVNode("colgroup",null,[t.checkable?(a.openBlock(),a.createElementBlock("col",bE)):a.createCommentVNode("",!0),y.value.find(j=>j.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:1,style:a.normalizeStyle({minWidth:`${y.value.find(j=>j.type=="expand").minWidth}px`}),width:y.value.find(j=>j.type=="expand").width,class:"w-16"},null,12,kE)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(j=>j.type!="expand"),(j,te)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${j.minWidth}px`,maxWidth:`${j.maxWidth}px`}),width:j.width,key:te},null,12,wE))),128))]),t.hideHeaders?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("thead",{key:0,class:a.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[a.createElementVNode("tr",null,[t.checkable?(a.openBlock(),a.createElementBlock("th",{key:0,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(he).theme]}`]])},[a.createElementVNode("div",vE,[a.createVNode(X,{slim:"","hide-error":"",checkbox:"",modelValue:O.value,"onUpdate:modelValue":D},null,8,["modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(j=>j.type=="expand")?(a.openBlock(),a.createElementBlock("th",{key:1,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(he).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(j=>j.type!="expand"),(j,te)=>{var re,P;return a.openBlock(),a.createElementBlock("th",{class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[a.unref(he).theme]}`]:!0,"sticky top-0 left-0":te===0}]),style:a.normalizeStyle({maxWidth:`${j.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{j.sortable&&x(j.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":j.sortable&&j.field,"justify-center":j.align=="center","justify-end":j.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium text-sm",{"text-right":j.align=="right"}])},a.toDisplayString(j.label),3),j.sortable&&j.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":j.field!=((re=t.sortOptions)==null?void 0:re.sortBy)}])},[a.createVNode(tE,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((P=t.sortOptions)==null?void 0:P.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,xE)],6)}),256))])],2)),a.createElementVNode("tbody",EE,[t.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:a.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[a.unref(he).theme]]])},[a.createVNode(Fr,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",CE,SE))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock($f,{key:1,checkable:t.checkable,position:"header",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.data,(j,te)=>{var re,P,W,G,q;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${te}`},[a.createElementVNode("tr",{onClick:V=>$(V,j,te),class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":te%2==0,"is-even":te%2!=0,[s[a.unref(he).theme]]:!0}])},[t.checkable?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass([{[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe}])},[a.createElementVNode("div",OE,[a.createVNode(X,{slim:"","hide-error":"",checkbox:"",modelValue:C.value.includes(I(j,t.itemId)),checkboxValue:I(j,t.itemId),"onUpdate:modelValue":V=>v(j)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(V=>V.type=="expand")?(a.openBlock(),a.createElementBlock("td",{key:1,class:a.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top",[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[a.createVNode(Ni,{small:"",square:"",onClick:V=>b({item:j,index:te})},{default:a.withCtx(()=>[w[te]?(a.openBlock(),a.createBlock(ex,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(lE,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(V=>V.type!="expand"),(V,ue)=>{var ce,we;return a.openBlock(),a.createBlock(es,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":ue===0,[`${c[a.unref(he).theme]}`]:!0,[`${d[a.unref(he).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!V.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":te===((ce=t.data)==null?void 0:ce.length)-1&&!t.totalItem&&!y.value.find(Se=>Se.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":te===((we=t.data)==null?void 0:we.length)-1&&!t.totalItem&&!y.value.find(Se=>Se.type=="expand")&&!t.noRadius,"text-center justify-center":V.align=="center","text-right justify-end":V.align=="right","align-top py-5":t.valign=="top","cursor-pointer group-hover:bg-gray-100 dark:group-hover:bg-gray-930":R.value}]),style:a.normalizeStyle({maxWidth:`${V.maxWidth}px`}),id:`${te}_${ue}`,column:V,item:j,rowIndex:te,key:ue},null,8,["class","style","id","column","item","rowIndex"])}),128))],10,_E),y.value.find(V=>V.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(he).theme]]:!t.stripe,[l[a.unref(he).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(es,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(he).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((re=y.value.find(V=>V.type=="expand"))!=null&&re.noPadding),"p-0":(P=y.value.find(V=>V.type=="expand"))==null?void 0:P.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":te===((W=t.data)==null?void 0:W.length)-1&&!t.totalItem,"first:rounded-bl-lg":te===((G=t.data)==null?void 0:G.length)-1&&!t.totalItem,"text-center":y.value.find(V=>V.type=="expand").align=="center","text-right":y.value.find(V=>V.type=="expand").align=="right"}]),column:y.value.find(V=>V.type=="expand"),rowIndex:te,colspan:(q=y.value)==null?void 0:q.length,item:j},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,w[te]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",TE,[a.createVNode($f,{checkable:t.checkable,position:"footer",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):a.createCommentVNode("",!0)])],2),!t.loading&&!t.data.length?(a.openBlock(),a.createElementBlock("div",NE," No Data ")):a.createCommentVNode("",!0)],2)])}}}),AE={name:"WpicTableColumn",props:{label:{type:String},help:{type:String},field:{type:String,default:""},selectable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},type:{type:String,default:"default"},width:{type:[String,Number],default:null},minWidth:{type:[String,Number],default:null},maxWidth:{type:[String,Number],default:null},align:{type:String,default:"left"},visible:{type:Boolean,default:!0},noPadding:{type:Boolean,default:!1}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function rt(t){this.content=t}rt.prototype={constructor:rt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new rt(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new rt(n)},addToStart:function(t,e){return new rt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new rt(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new rt(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=rt.from(t),t.size?new rt(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=rt.from(t),t.size?new rt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=rt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},rt.from=function(t){if(t instanceof rt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new rt(e)};function Vf(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=Vf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Pf(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){n-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=Pf(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class Z{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,i+l,o||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),r,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new Z(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],c=s+l.nodeSize;c>e&&((s<e||c>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=c}return new Z(r,i)}cutByIndex(e,n){return e==n?Z.empty:e==0&&n==this.content.length?this:new Z(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Z(i,o)}addToStart(e){return new Z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Z(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Vf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Pf(this,e,n,r)}findIndex(e,n=-1){if(e==0)return ts(0,e);if(e==this.size)return ts(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?ts(r+1,s):ts(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Z.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Z(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Z.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Z(n||e,r)}static from(e){if(!e)return Z.empty;if(e instanceof Z)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Z([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Z.empty=new Z([],0);const Zl={index:0,offset:0};function ts(t,e){return Zl.index=t,Zl.offset=e,Zl}function ns(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!ns(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!ns(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let $e=class Bc{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ns(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Bc.none;if(e instanceof Bc)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};$e.none=[];class rs extends Error{}class oe{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Ff(this.content,e+this.openStart,n);return r&&new oe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new oe(Rf(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return oe.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new oe(Z.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new oe(e,r,i)}}oe.empty=new oe(Z.empty,0,0);function Rf(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(Rf(o.content,e-i-1,n-i-1)))}function Ff(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=Ff(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function DE(t,e,n){if(n.openStart>t.depth)throw new rs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new rs("Inconsistent open depths");return zf(t,e,n,0)}function zf(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=zf(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return vr(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=LE(n,t);return vr(o,Hf(t,s,l,e,r))}else return vr(o,is(t,e,r))}function jf(t,e){if(!e.type.compatibleContent(t.type))throw new rs("Cannot join "+e.type.name+" onto "+t.type.name)}function Xl(t,e,n){let r=t.node(n);return jf(r,e.node(n)),r}function wr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Gi(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(wr(t.nodeAfter,r),o++));for(let l=o;l<s;l++)wr(i.child(l),r);e&&e.depth==n&&e.textOffset&&wr(e.nodeBefore,r)}function vr(t,e){return t.type.checkContent(e),t.copy(e)}function Hf(t,e,n,r,i){let o=t.depth>i&&Xl(t,e,i+1),s=r.depth>i&&Xl(n,r,i+1),l=[];return Gi(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(jf(o,s),wr(vr(o,Hf(t,e,n,r,i+1)),l)):(o&&wr(vr(o,is(t,e,i+1)),l),Gi(e,n,i,l),s&&wr(vr(s,is(n,r,i+1)),l)),Gi(r,null,i,l),new Z(l)}function is(t,e,n){let r=[];if(Gi(null,t,n,r),t.depth>n){let i=Xl(t,e,n+1);wr(vr(i,is(t,e,n+1)),r)}return Gi(e,null,n,r),new Z(r)}function LE(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(Z.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Ji{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return $e.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ss(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new Ji(n,r,o)}static resolveCached(e,n){let r=Wf.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else Wf.set(e,r=new BE);let i=r.elts[r.i]=Ji.resolve(e,n);return r.i=(r.i+1)%IE,i}}class BE{constructor(){this.elts=[],this.i=0}}const IE=12,Wf=new WeakMap;class ss{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const $E=Object.create(null);let Wn=class Ic{constructor(e,n,r,i=$e.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||Z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&ns(this.attrs,n||e.defaultAttrs||$E)&&$e.sameSet(this.marks,r||$e.none)}copy(e=null){return e==this.content?this:new Ic(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ic(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return oe.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new oe(d,i.depth-s,o.depth-s)}replace(e,n,r){return DE(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Ji.resolveCached(this,e)}resolveNoCache(e){return Ji.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Uf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Z.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=$e.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!$e.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=Z.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Wn.prototype.text=void 0;class ls extends Wn{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Uf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ls(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ls(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Uf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class xr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new VE(e,n);if(r.next==null)return xr.empty;let i=Yf(r);r.next&&r.err("Unexpected trailing text");let o=WE(HE(i));return UE(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,l){let c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return Z.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
28
28
  `)}}xr.empty=new xr(!0);class VE{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Yf(t){let e=[];do e.push(PE(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function PE(t){let e=[];do e.push(RE(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function RE(t){let e=jE(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=FE(t,e);else break;return e}function qf(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function FE(t,e){let n=qf(t),r=n;return t.eat(",")&&(t.next!="}"?r=qf(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function zE(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function jE(t){if(t.eat("(")){let e=Yf(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=zE(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function HE(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,c){let d={term:c,to:l};return e[s].push(d),d}function i(s,l){s.forEach(c=>c.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],l);if(c==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let c=n();return r(l,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,l),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d<s.min;d++){let u=n();i(o(s.expr,c),u),c=u}if(s.max==-1)i(o(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=n();r(c,u),i(o(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Kf(t,e){return e-t}function Gf(t,e){let n=[];return r(e),n.sort(Kf);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:l,to:c}=o[s];!l&&n.indexOf(c)==-1&&r(c)}}}function WE(t){let e=Object.create(null);return n(Gf(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u<i.length;u++)i[u][0]==l&&(d=i[u][1]);Gf(t,c).forEach(u=>{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new xr(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(Kf);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function UE(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:c,next:d}=i.next[l];s.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Jf(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Zf(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Xf(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function Qf(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new qE(t,r,e[r]);return n}let eh=class Vg{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Qf(e,r.attrs),this.defaultAttrs=Jf(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==xr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Zf(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Wn(this,this.computeAttrs(e),Z.from(n),$e.setFrom(r))}createChecked(e=null,n,r){return n=Z.from(n),this.checkContent(n),new Wn(this,this.computeAttrs(e),n,$e.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=Z.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(Z.empty,!0);return o?new Wn(this,e,n.append(o),$e.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Xf(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:$e.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Vg(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function YE(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class qE{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?YE(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class as{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Qf(e,i.attrs),this.excluded=null;let o=Jf(this.attrs);this.instance=o?new $e(this,o):null}create(e=null){return!e&&this.instance?this.instance:new $e(this,Zf(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new as(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Xf(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class th{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=rt.from(e.nodes),n.marks=rt.from(e.marks||{}),this.nodes=eh.compile(this.spec.nodes,this),this.marks=as.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=xr.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?nh(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:nh(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof eh){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new ls(r,r.defaultAttrs,e,$e.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Wn.fromJSON(this,e)}markFromJSON(e){return $e.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function nh(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let l in t.marks){let c=t.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function KE(t){return t.tag!=null}function GE(t){return t.style!=null}class Un{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(KE(i))this.tags.push(i);else if(GE(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new sh(this,n,!1);return r.addAll(e,$e.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new sh(this,n,!0);return r.addAll(e,$e.none,n.from,n.to),oe.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(XE(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=lh(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=lh(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Un(e,Un.schemaRules(e)))}}const rh={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},JE={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ih={ol:!0,ul:!0},Zi=1,Ql=2,cs=4;function oh(t,e,n){return e!=null?(e?Zi:0)|(e==="full"?Ql:0):t&&t.whitespace=="pre"?Zi|Ql:n&-5}class ds{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=$e.none,this.match=o||(s&cs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Z.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Zi)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=Z.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Z.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!rh.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class sh{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=oh(null,n.preserveWhitespace,0)|(r?cs:0);i?o=new ds(i.type,i.attrs,$e.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ds(null,null,$e.none,!0,null,s):o=new ds(e.schema.topNodeType,null,$e.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&Ql?"full":this.localPreserveWS||(i.options&Zi)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
29
29
  `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;ih.hasOwnProperty(s)&&this.parser.normalizeLists&&ZE(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(c?c.ignore:JE.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(rh.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=c&&c.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),d&&this.sync(o),this.needsBlock=u}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,c,d,c.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
30
30
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let l=void 0;;){let c=this.parser.matchStyle(o,s,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,n.attrs||null,r,n.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=$e.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):ah(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=oh(e,o,s.options);s.options&cs&&s.content.length==0&&(l|=cs);let c=$e.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):ah(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new ds(e,n,c,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Zi)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=o;c--)if(s(l-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function ZE(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&ih.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function XE(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function lh(t){let e={};for(let n in t)e[n]=t[n];return e}function ah(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Er{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=ea(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,c=0;for(;l<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<o.length;)i=o.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],u=this.serializeMark(d,s.isInline,n);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=us(ea(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&us(ea(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return us(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Er(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=ch(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return ch(e.marks)}}function ch(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ea(t){return t.document||window.document}const dh=new WeakMap;function QE(t){let e=dh.get(t);return e===void 0&&dh.set(t,e=eC(t)),e}function eC(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function us(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=QE(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let f in d)if(d[f]!=null){let h=f.indexOf(" ");h>0?c.setAttributeNS(f.slice(0,h),f.slice(h+1),d[f]):c.setAttribute(f,d[f])}}for(let f=u;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:p,contentDOM:m}=us(t,h,n,r);if(c.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:c,contentDOM:l}}const uh=65535,fh=Math.pow(2,16);function tC(t,e){return t+e*fh}function hh(t){return t&uh}function nC(t){return(t-(t&uh))/fh}const ph=1,mh=2,fs=4,gh=8;class ta{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&gh)>0}get deletedBefore(){return(this.delInfo&(ph|fs))>0}get deletedAfter(){return(this.delInfo&(mh|fs))>0}get deletedAcross(){return(this.delInfo&fs)>0}}class Bt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Bt.empty)return Bt.empty}recover(e){let n=0,r=hh(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+nC(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[l+o],u=this.ranges[l+s],f=c+d;if(e<=f){let h=d?e==c?-1:e==f?1:n:n,p=c+i+(h<0?0:u);if(r)return p;let m=e==(n<0?c:f)?null:tC(l/3,e-c),g=e==c?mh:e==f?ph:fs;return(n<0?e!=c:e!=f)&&(g|=gh),new ta(p,g,m)}i+=u-d}return r?e+i:new ta(e+i,0,null)}touches(e,n){let r=0,i=hh(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[l+o],u=c+d;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(l,l+d,c,c+u),o+=u-d}}invert(){return new Bt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Bt.empty:new Bt(e<0?[0,-e,0]:[0,0,e])}}Bt.empty=new Bt([]);class Qr{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new Qr(this.maps,this.mirror,e,n)}copy(){return new Qr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Qr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],l=s.mapResult(e,n);if(l.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new ta(e,i,null)}}const na=Object.create(null);class ut{getMap(){return Bt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=na[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in na)throw new RangeError("Duplicate use of step JSON ID "+e);return na[e]=n,n.prototype.jsonID=e,n}}class Ye{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Ye(e,null)}static fail(e){return new Ye(null,e)}static fromReplace(e,n,r,i){try{return Ye.ok(e.replace(n,r,i))}catch(o){if(o instanceof rs)return Ye.fail(o.message);throw o}}}function ra(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(ra(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return Z.fromArray(r)}class Yn extends ut{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new oe(ra(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Ye.fromReplace(e,this.from,this.to,o)}invert(){return new an(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Yn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Yn(n.from,n.to,e.markFromJSON(n.mark))}}ut.jsonID("addMark",Yn);class an extends ut{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new oe(ra(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Ye.fromReplace(e,this.from,this.to,r)}invert(){return new Yn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new an(n.pos,r.pos,this.mark)}merge(e){return e instanceof an&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new an(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new an(n.from,n.to,e.markFromJSON(n.mark))}}ut.jsonID("removeMark",an);class qn extends ut{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ye.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Ye.fromReplace(e,this.pos,this.pos+1,new oe(Z.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new qn(this.pos,n.marks[i]);return new qn(this.pos,this.mark)}}return new ei(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new qn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new qn(n.pos,e.markFromJSON(n.mark))}}ut.jsonID("addNodeMark",qn);class ei extends ut{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Ye.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Ye.fromReplace(e,this.pos,this.pos+1,new oe(Z.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new qn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ei(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ei(n.pos,e.markFromJSON(n.mark))}}ut.jsonID("removeNodeMark",ei);class Xe extends ut{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&ia(e,this.from,this.to)?Ye.fail("Structure replace would overwrite content"):Ye.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Bt([this.from,this.to-this.from,this.slice.size])}invert(e){return new Xe(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Xe(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Xe)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?oe.empty:new oe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Xe(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?oe.empty:new oe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Xe(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Xe(n.from,n.to,oe.fromJSON(e,n.slice),!!n.structure)}}ut.jsonID("replace",Xe);class Qe extends ut{constructor(e,n,r,i,o,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(ia(e,this.from,this.gapFrom)||ia(e,this.gapTo,this.to)))return Ye.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Ye.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Ye.fromReplace(e,this.from,this.to,r):Ye.fail("Content does not fit in gap")}getMap(){return new Bt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Qe(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Qe(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Qe(n.from,n.to,n.gapFrom,n.gapTo,oe.fromJSON(e,n.slice),n.insert,!!n.structure)}}ut.jsonID("replaceAround",Qe);function ia(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function rC(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+c.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[g])?s.to=p:i.push(s=new an(h,p,f[g])));l&&l.to==h?l.to=p:o.push(l=new Yn(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function iC(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof as){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,n);for(let u=0;u<c.length;u++){let f=c[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=d,h.step=o):i.push({style:f,from:Math.max(l,e),to:d,step:o})}}}),i.forEach(s=>t.step(new an(s.from,s.to,s.style)))}function oa(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Xe(l,u,oe.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new an(l,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new oe(Z.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new Xe(l+h.index,l+h.index+h[0].length,m))}}l=u}if(!r.validEnd){let c=r.fillBefore(Z.empty,!0);t.replace(l,l,new oe(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function oC(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ti(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!oC(i,o,s))break}return null}function sC(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),c=s,d=l,u=Z.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=Z.from(r.node(m).copy(u)),f++):c--;let h=Z.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=Z.from(i.node(m).copy(h)),p++):d++;t.step(new Qe(c,d,s,l,new oe(u.append(h),f,p),u.size-f,!0))}function sa(t,e,n=null,r=t){let i=lC(t,e),o=i&&aC(r,e);return o?i.map(yh).concat({type:e,attrs:n}).concat(o.map(yh)):null}function yh(t){return{type:t,attrs:null}}function lC(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function aC(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(n.child(d).type);return!c||!c.validEnd?null:s}function cC(t,e,n){let r=Z.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Z.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Qe(i,o,i,o,new oe(r,0,0),n.length,!0))}function dC(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&uC(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?d=!1:!p&&m&&(d=!0)}d===!1&&kh(t,s,l,o),oa(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let u=t.mapping.slice(o),f=u.map(l,1),h=u.map(l+s.nodeSize,1);return t.step(new Qe(f,h,f+1,h-1,new oe(Z.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&bh(t,s,l,o),!1}})}function bh(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function kh(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`