Files
appco_dist/.output/public/_nuxt/BS3cW_7I.js
T
2025-07-27 10:51:22 +03:30

2 lines
14 KiB
JavaScript

import{aA as Ve,aB as xe,ao as Me,aq as We,aC as ke,aD as je,aE as qe,aF as _e,aG as Ne,r as Te,aH as le,H as X,K as Re,s as He,a1 as ie,aI as N,aJ as de,ae as De,d as $e,aK as ze,aL as Ke,k as V,aM as Ue,aN as Xe,aO as Ye,aP as Ge,C as Qe,aQ as fe,aR as Z,aS as B,aT as he,aU as me,aV as Ze,aW as ne,aX as ge,aY as Je}from"./vNwORUzZ.js";import{t as ve,v as Be,d as Ie,_ as et,u as tt,a as nt,c as pe,b as ae,g as be,e as rt}from"./DqKiPENw.js";import{i as Le}from"./DrLtTiRh.js";import{S as it,c as we}from"./BUvaVjO_.js";import{a as at}from"./J4AUU9v5.js";import{i as lt,b as st,l as ot}from"./BKLKMWf2.js";import{i as ut}from"./y7aiIjb0.js";import{f as ct}from"./BZwHMXHs.js";import{u as dt,F as ce}from"./C1A0Ol0M.js";function ye(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function Fe(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function se(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r=getComputedStyle(e,null);return Fe(r.overflowY,t)||Fe(r.overflowX,t)||function(a){var n=function(i){if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch{return null}}(a);return!!n&&(n.clientHeight<a.scrollHeight||n.clientWidth<a.scrollWidth)}(e)}return!1}function re(e,t,r,a,n,i,u,h){return i<e&&u>t||i>e&&u<t?0:i<=e&&h<=r||u>=t&&h>=r?i-e-a:u>t&&h<r||i<e&&h>r?u-t+n:0}var Pe=function(e,t){var r=window,a=t.scrollMode,n=t.block,i=t.inline,u=t.boundary,h=t.skipOverflowHiddenElements,b=typeof u=="function"?u:function(Ce){return Ce!==u};if(!ye(e))throw new TypeError("Invalid target");for(var E,I,O=document.scrollingElement||document.documentElement,M=[],y=e;ye(y)&&b(y);){if((y=(I=(E=y).parentElement)==null?E.getRootNode().host||null:I)===O){M.push(y);break}y!=null&&y===document.body&&se(y)&&!se(document.documentElement)||y!=null&&se(y,h)&&M.push(y)}for(var k=r.visualViewport?r.visualViewport.width:innerWidth,L=r.visualViewport?r.visualViewport.height:innerHeight,x=window.scrollX||pageXOffset,T=window.scrollY||pageYOffset,C=e.getBoundingClientRect(),s=C.height,l=C.width,g=C.top,c=C.right,f=C.bottom,d=C.left,F=n==="start"||n==="nearest"?g:n==="end"?f:g+s/2,v=i==="center"?d+l/2:i==="end"?c:d,P=[],W=0;W<M.length;W++){var p=M[W],j=p.getBoundingClientRect(),R=j.height,H=j.width,o=j.top,m=j.right,w=j.bottom,S=j.left;if(a==="if-needed"&&g>=0&&d>=0&&f<=L&&c<=k&&g>=o&&f<=w&&d>=S&&c<=m)return P;var _=getComputedStyle(p),$=parseInt(_.borderLeftWidth,10),U=parseInt(_.borderTopWidth,10),q=parseInt(_.borderRightWidth,10),D=parseInt(_.borderBottomWidth,10),A=0,z=0,G="offsetWidth"in p?p.offsetWidth-p.clientWidth-$-q:0,K="offsetHeight"in p?p.offsetHeight-p.clientHeight-U-D:0,Q="offsetWidth"in p?p.offsetWidth===0?0:H/p.offsetWidth:0,ee="offsetHeight"in p?p.offsetHeight===0?0:R/p.offsetHeight:0;if(O===p)A=n==="start"?F:n==="end"?F-L:n==="nearest"?re(T,T+L,L,U,D,T+F,T+F+s,s):F-L/2,z=i==="start"?v:i==="center"?v-k/2:i==="end"?v-k:re(x,x+k,k,$,q,x+v,x+v+l,l),A=Math.max(0,A+T),z=Math.max(0,z+x);else{A=n==="start"?F-o-U:n==="end"?F-w+D+K:n==="nearest"?re(o,w,R,U,D+K,F,F+s,s):F-(o+R/2)+K/2,z=i==="start"?v-S-$:i==="center"?v-(S+H/2)+G/2:i==="end"?v-m+q+G:re(S,m,H,$,q+G,v,v+l,l);var te=p.scrollLeft,J=p.scrollTop;F+=J-(A=Math.max(0,Math.min(J+A/ee,p.scrollHeight-R/ee+K))),v+=te-(z=Math.max(0,Math.min(te+z/Q,p.scrollWidth-H/Q+G)))}P.push({el:p,top:A,left:z})}return P};function Se(e){return e===Object(e)&&Object.keys(e).length!==0}function ft(e,t){t===void 0&&(t="auto");var r="scrollBehavior"in document.body.style;e.forEach(function(a){var n=a.el,i=a.top,u=a.left;n.scroll&&r?n.scroll({top:i,left:u,behavior:t}):(n.scrollTop=i,n.scrollLeft=u)})}function ht(e){return e===!1?{block:"end",inline:"nearest"}:Se(e)?e:{block:"start",inline:"nearest"}}function mt(e,t){var r=e.isConnected||e.ownerDocument.documentElement.contains(e);if(Se(t)&&typeof t.behavior=="function")return t.behavior(r?Pe(e,t):[]);if(r){var a=ht(t);return ft(Pe(e,a),a.behavior)}}function gt(e,t,r){var a=-1,n=e.length;t<0&&(t=-t>n?0:n+t),r=r>n?n:r,r<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(n);++a<n;)i[a]=e[a+t];return i}var oe=function(){return Ve.Date.now()},vt="Expected a function",pt=Math.max,bt=Math.min;function wt(e,t,r){var a,n,i,u,h,b,E=0,I=!1,O=!1,M=!0;if(typeof e!="function")throw new TypeError(vt);t=ve(t)||0,xe(r)&&(I=!!r.leading,O="maxWait"in r,i=O?pt(ve(r.maxWait)||0,t):i,M="trailing"in r?!!r.trailing:M);function y(c){var f=a,d=n;return a=n=void 0,E=c,u=e.apply(d,f),u}function k(c){return E=c,h=setTimeout(T,t),I?y(c):u}function L(c){var f=c-b,d=c-E,F=t-f;return O?bt(F,i-d):F}function x(c){var f=c-b,d=c-E;return b===void 0||f>=t||f<0||O&&d>=i}function T(){var c=oe();if(x(c))return C(c);h=setTimeout(T,L(c))}function C(c){return h=void 0,M&&a?y(c):(a=n=void 0,u)}function s(){h!==void 0&&clearTimeout(h),E=0,a=b=n=h=void 0}function l(){return h===void 0?u:C(oe())}function g(){var c=oe(),f=x(c);if(a=arguments,n=this,b=c,f){if(h===void 0)return k(b);if(O)return clearTimeout(h),h=setTimeout(T,t),y(b)}return h===void 0&&(h=setTimeout(T,t)),u}return g.cancel=s,g.flush=l,g}var yt=Math.min;function Ft(e,t,r){for(var a=at,n=e[0].length,i=e.length,u=i,h=Array(i),b=1/0,E=[];u--;){var I=e[u];b=yt(I.length,b),h[u]=n>=120&&I.length>=120?new it(u&&I):void 0}I=e[0];var O=-1,M=h[0];e:for(;++O<n&&E.length<b;){var y=I[O],k=y;if(y=y!==0?y:0,!(M?we(M,k):a(E,k))){for(u=i;--u;){var L=h[u];if(!(L?we(L,k):a(e[u],k)))continue e}M&&M.push(k),E.push(y)}}return E}function Pt(e){return lt(e)?e:[]}var Et=st(function(e){var t=Me(e,Pt);return t.length&&t[0]===e[0]?Ft(t):[]});function Ot(e,t){return t.length<2?e:We(e,gt(t,0,-1))}function Mt(e,t){return t=ke(t,e),e=Ot(e,t),e==null||delete e[je(ot(t))]}function kt(e){return ut(e)?void 0:e}var Tt=1,It=2,Lt=4,St=ct(function(e,t){var r={};if(e==null)return r;var a=!1;t=Me(t,function(i){return i=ke(i,e),a||(a=i.length>1),i}),qe(e,_e(e),r),a&&(r=Ne(r,Tt|It|Lt,kt));for(var n=t.length;n--;)Mt(r,t[n]);return r});function Ae(e){let t=!1,r=e.length;const a=[];return e.length?new Promise((n,i)=>{e.forEach((u,h)=>{u.catch(b=>(t=!0,b)).then(b=>{r-=1,a[h]=b,!(r>0)&&(t&&i(a),n(a))})})}):Promise.resolve([])}function Ee(e){let t=!1;return e&&e.length&&e.every(r=>r.required?(t=!0,!1):!0),t}function Oe(e){return e==null?[]:Array.isArray(e)?e:[e]}function ue(e,t,r){let a=e;t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");const n=t.split(".");let i=0;for(let u=n.length;i<u-1&&!(!a&&!r);++i){const h=n[i];if(h in a)a=a[h];else{if(r)throw new Error("please transfer a valid name path to validate!");break}}return{o:a,k:n[i],v:a?a[n[i]]:null,isValid:a&&n[i]in a}}function At(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Te({}),r=arguments.length>2?arguments[2]:void 0;const a=le(X(e)),n=Re({}),i=He([]),u=s=>{N(X(e),N(N({},le(a)),s)),De(()=>{Object.keys(n).forEach(l=>{n[l]={autoLink:!1,required:Ee(X(t)[l])}})})},h=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1?arguments[1]:void 0;return l.length?s.filter(g=>{const c=Oe(g.trigger||"change");return Et(c,l).length}):s};let b=null;const E=function(s){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=arguments.length>2?arguments[2]:void 0;const c=[],f={};for(let v=0;v<s.length;v++){const P=s[v],W=ue(X(e),P,g);if(!W.isValid)continue;f[P]=W.v;const p=h(X(t)[P],Oe(l&&l.trigger));p.length&&c.push(I(P,W.v,p,l||{}).then(()=>({name:P,errors:[],warnings:[]})).catch(j=>{const R=[],H=[];return j.forEach(o=>{let{rule:{warningOnly:m},errors:w}=o;m?H.push(...w):R.push(...w)}),R.length?Promise.reject({name:P,errors:R,warnings:H}):{name:P,errors:R,warnings:H}}))}const d=Ae(c);b=d;const F=d.then(()=>b===d?Promise.resolve(f):Promise.reject([])).catch(v=>{const P=v.filter(W=>W&&W.errors.length);return P.length?Promise.reject({values:f,errorFields:P,outOfDate:b!==d}):Promise.resolve(f)});return F.catch(v=>v),F},I=function(s,l,g){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const f=Be([s],l,g,N({validateMessages:Ie},c),!!c.validateFirst);return n[s]?(n[s].validateStatus="validating",f.catch(d=>d).then(function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];var F;if(n[s].validateStatus==="validating"){const v=d.filter(P=>P&&P.errors.length);n[s].validateStatus=v.length?"error":"success",n[s].help=v.length?v.map(P=>P.errors):null,(F=r==null?void 0:r.onValidate)===null||F===void 0||F.call(r,s,!v.length,v.length?de(n[s].help[0]):null)}}),f):f.catch(d=>d)},O=(s,l)=>{let g=[],c=!0;s?Array.isArray(s)?g=s:g=[s]:(c=!1,g=i.value);const f=E(g,l||{},c);return f.catch(d=>d),f},M=s=>{let l=[];s?Array.isArray(s)?l=s:l=[s]:l=i.value,l.forEach(g=>{n[g]&&N(n[g],{validateStatus:"",help:null})})},y=s=>{const l={autoLink:!1},g=[],c=Array.isArray(s)?s:[s];for(let f=0;f<c.length;f++){const d=c[f];(d==null?void 0:d.validateStatus)==="error"&&(l.validateStatus="error",d.help&&g.push(d.help)),l.required=l.required||(d==null?void 0:d.required)}return l.help=g,l};let k=a,L=!0;const x=s=>{const l=[];i.value.forEach(g=>{const c=ue(s,g,!1),f=ue(k,g,!1);(L&&(r==null?void 0:r.immediate)&&c.isValid||!Le(c.v,f.v))&&l.push(g)}),O(l,{trigger:"change"}),L=!1,k=le(de(s))},T=r==null?void 0:r.debounce;let C=!0;return ie(t,()=>{i.value=t?Object.keys(X(t)):[],!C&&r&&r.validateOnRuleChange&&O(),C=!1},{deep:!0,immediate:!0}),ie(i,()=>{const s={};i.value.forEach(l=>{s[l]=N({},n[l],{autoLink:!1,required:Ee(X(t)[l])}),delete n[l]});for(const l in n)Object.prototype.hasOwnProperty.call(n,l)&&delete n[l];N(n,s)},{immediate:!0}),ie(e,T&&T.wait?wt(x,T.wait,St(T,["wait"])):x,{immediate:r&&!!r.immediate,deep:!0}),{modelRef:e,rulesRef:t,initialModel:a,validateInfos:n,resetFields:u,validate:O,validateField:I,mergeValidateInfo:y,clearValidate:M}}const Ct=()=>({layout:ge.oneOf(Je("horizontal","inline","vertical")),labelCol:ne(),wrapperCol:ne(),colon:B(),labelAlign:he(),labelWrap:B(),prefixCls:String,requiredMark:me([String,Boolean]),hideRequiredMark:B(),model:ge.object,rules:ne(),validateMessages:ne(),validateOnRuleChange:B(),scrollToFirstError:Ze(),onSubmit:Z(),name:String,validateTrigger:me([String,Array]),size:he(),disabled:B(),onValuesChange:Z(),onFieldsChange:Z(),onFinish:Z(),onFinishFailed:Z(),onValidate:Z()});function Vt(e,t){return Le(ae(e),ae(t))}const Y=$e({compatConfig:{MODE:3},name:"AForm",inheritAttrs:!1,props:ze(Ct(),{layout:"horizontal",hideRequiredMark:!1,colon:!0}),Item:et,useForm:At,setup(e,t){let{emit:r,slots:a,expose:n,attrs:i}=t;const{prefixCls:u,direction:h,form:b,size:E,disabled:I}=Ke("form",e),O=V(()=>e.requiredMark===""||e.requiredMark),M=V(()=>{var o;return O.value!==void 0?O.value:b&&((o=b.value)===null||o===void 0?void 0:o.requiredMark)!==void 0?b.value.requiredMark:!e.hideRequiredMark});Ue(E),Xe(I);const y=V(()=>{var o,m;return(o=e.colon)!==null&&o!==void 0?o:(m=b.value)===null||m===void 0?void 0:m.colon}),{validateMessages:k}=Ye(),L=V(()=>N(N(N({},Ie),k.value),e.validateMessages)),[x,T]=tt(u),C=V(()=>Ge(u.value,{[`${u.value}-${e.layout}`]:!0,[`${u.value}-hide-required-mark`]:M.value===!1,[`${u.value}-rtl`]:h.value==="rtl",[`${u.value}-${E.value}`]:E.value},T.value)),s=Te(),l={},g=(o,m)=>{l[o]=m},c=o=>{delete l[o]},f=o=>{const m=!!o,w=m?ae(o).map(be):[];return m?Object.values(l).filter(S=>w.findIndex(_=>Vt(_,S.fieldName.value))>-1):Object.values(l)},d=o=>{e.model&&f(o).forEach(m=>{m.resetField()})},F=o=>{f(o).forEach(m=>{m.clearValidate()})},v=o=>{const{scrollToFirstError:m}=e;if(r("finishFailed",o),m&&o.errorFields.length){let w={};typeof m=="object"&&(w=m),W(o.errorFields[0].name,w)}},P=function(){return R(...arguments)},W=function(o){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const w=f(o?[o]:void 0);if(w.length){const S=w[0].fieldId.value,_=S?document.getElementById(S):null;_&&mt(_,N({scrollMode:"if-needed",block:"nearest"},m))}},p=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(o===!0){const m=[];return Object.values(l).forEach(w=>{let{namePath:S}=w;m.push(S.value)}),pe(e.model,m)}else return pe(e.model,o)},j=(o,m)=>{if(!e.model)return Promise.reject("Form `model` is required for validateFields to work.");const w=!!o,S=w?ae(o).map(be):[],_=[];Object.values(l).forEach(q=>{var D;if(w||S.push(q.namePath.value),!(!((D=q.rules)===null||D===void 0)&&D.value.length))return;const A=q.namePath.value;if(!w||rt(S,A)){const z=q.validateRules(N({validateMessages:L.value},m));_.push(z.then(()=>({name:A,errors:[],warnings:[]})).catch(G=>{const K=[],Q=[];return G.forEach(ee=>{let{rule:{warningOnly:te},errors:J}=ee;te?Q.push(...J):K.push(...J)}),K.length?Promise.reject({name:A,errors:K,warnings:Q}):{name:A,errors:K,warnings:Q}}))}});const $=Ae(_);s.value=$;const U=$.then(()=>s.value===$?Promise.resolve(p(S)):Promise.reject([])).catch(q=>{const D=q.filter(A=>A&&A.errors.length);return Promise.reject({values:p(S),errorFields:D,outOfDate:s.value!==$})});return U.catch(q=>q),U},R=function(){return j(...arguments)},H=o=>{o.preventDefault(),o.stopPropagation(),r("submit",o),e.model&&j().then(w=>{r("finish",w)}).catch(w=>{v(w)})};return n({resetFields:d,clearValidate:F,validateFields:j,getFieldsValue:p,validate:P,scrollToField:W}),nt({model:V(()=>e.model),name:V(()=>e.name),labelAlign:V(()=>e.labelAlign),labelCol:V(()=>e.labelCol),labelWrap:V(()=>e.labelWrap),wrapperCol:V(()=>e.wrapperCol),vertical:V(()=>e.layout==="vertical"),colon:y,requiredMark:M,validateTrigger:V(()=>e.validateTrigger),rules:V(()=>e.rules),addField:g,removeField:c,onValidate:(o,m,w)=>{r("validate",o,m,w)},validateMessages:L}),ie(()=>e.rules,()=>{e.validateOnRuleChange&&j()}),()=>{var o;return x(Qe("form",fe(fe({},i),{},{onSubmit:H,class:[C.value,i.class]}),[(o=a.default)===null||o===void 0?void 0:o.call(a)]))}}});Y.useInjectFormItemContext=dt;Y.ItemRest=ce;Y.install=function(e){return e.component(Y.name,Y),e.component(Y.Item.name,Y.Item),e.component(ce.name,ce),e};export{Y as F,Mt as b,wt as d};