ed-widget 1.20.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ed-widget.js +1 -1
- package/npm/ed-widget.js +1 -1
- package/package.json +1 -1
package/dist/ed-widget.js
CHANGED
|
@@ -431,7 +431,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
431
431
|
html body {
|
|
432
432
|
overflow-y: hidden;
|
|
433
433
|
`.concat(u?"width: calc(100% - ".concat(s,"px);"):"",`
|
|
434
|
-
}`),a)}else vm(a);return function(){vm(a)}},[t,a])}var lK=!1;function cK(e){return lK}var eL=function(t){return t===!1?!1:!_o()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},yT=z.forwardRef(function(e,t){var n=e.open,r=e.autoLock,a=e.getContainer,s=e.debug,u=e.autoDestroy,f=u===void 0?!0:u,d=e.children,p=z.useState(n),m=ht(p,2),y=m[0],b=m[1],S=y||n;Ir(_o()||!n,"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR."),z.useEffect(function(){(f||n)&&b(n)},[n,f]);var w=z.useState(function(){return eL(a)}),C=ht(w,2),x=C[0],O=C[1];z.useEffect(function(){var te=eL(a);O(te??null)});var k=rK(S&&!x,s),N=ht(k,2),P=N[0],T=N[1],D=x??P;uK(r&&n&&_o()&&(D===P||D===document.body));var M=null;if(d&&J1(d)&&t){var U=d;M=U.ref}var H=Ex(M,t);if(!S||!_o()||x===void 0)return null;var B=D===!1||cK(),G=d;return t&&(G=z.cloneElement(d,{ref:H})),z.createElement(KD.Provider,{value:T},B?G:rN.createPortal(G,D))});yT.displayName="Portal";function fK(){var e=$e({},e_);return e.useId}var tL=0,nL=fK();const rL=nL?function(t){var n=nL();return t||n}:function(t){var n=z.useState("ssr-id"),r=ht(n,2),a=r[0],s=r[1];return z.useEffect(function(){var u=tL;tL+=1,s("rc_unique_".concat(u))},[]),t||a};var mf="RC_FORM_INTERNAL_HOOKS",mr=function(){Ir(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Dh=z.createContext({getFieldValue:mr,getFieldsValue:mr,getFieldError:mr,getFieldWarning:mr,getFieldsError:mr,isFieldsTouched:mr,isFieldTouched:mr,isFieldValidating:mr,isFieldsValidating:mr,resetFields:mr,setFields:mr,setFieldValue:mr,setFieldsValue:mr,validateFields:mr,submit:mr,getInternalHooks:function(){return mr(),{dispatch:mr,initEntityValue:mr,registerField:mr,useSubscribe:mr,setInitialValues:mr,destroyForm:mr,setCallbacks:mr,registerWatch:mr,getFields:mr,setValidateMessages:mr,setPreserve:mr,getInitialValue:mr}}}),R0=z.createContext(null);function bT(e){return e==null?[]:Array.isArray(e)?e:[e]}function dK(e){return e&&!!e._init}function ST(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var ET=ST();function hK(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function pK(e,t,n){if(xx())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&dm(a,n.prototype),a}function _T(e){var t=typeof Map=="function"?new Map:void 0;return _T=function(r){if(r===null||!hK(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,a)}function a(){return pK(r,arguments,hm(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),dm(a,r)},_T(e)}var iL={NODE_ENV:'"production"'},vK=/%[sdj%]/g,aL=function(){};typeof process<"u"&&iL&&iL.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(aL=function(t,n){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&n.every(function(r){return typeof r=="string"})&&console.warn(t,n)});function CT(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Co(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=0,s=n.length;if(typeof e=="function")return e.apply(null,n);if(typeof e=="string"){var u=e.replace(vK,function(f){if(f==="%%")return"%";if(a>=s)return f;switch(f){case"%s":return String(n[a++]);case"%d":return Number(n[a++]);case"%j":try{return JSON.stringify(n[a++])}catch{return"[Circular]"}break;default:return f}});return u}return e}function mK(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function vi(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||mK(t)&&typeof e=="string"&&!e)}function gK(e,t,n){var r=[],a=0,s=e.length;function u(f){r.push.apply(r,Ft(f||[])),a++,a===s&&n(r)}e.forEach(function(f){t(f,u)})}function oL(e,t,n){var r=0,a=e.length;function s(u){if(u&&u.length){n(u);return}var f=r;r=r+1,f<a?t(e[f],s):n([])}s([])}function yK(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,Ft(e[n]||[]))}),t}var sL=function(e){lf(n,e);var t=cf(n);function n(r,a){var s;return ma(this,n),s=t.call(this,"Async Validation Error"),Ee(dn(s),"errors",void 0),Ee(dn(s),"fields",void 0),s.errors=r,s.fields=a,s}return ga(n)}(_T(Error));function bK(e,t,n,r,a){if(t.first){var s=new Promise(function(b,S){var w=function(O){return r(O),O.length?S(new sL(O,CT(O))):b(a)},C=yK(e);oL(C,n,w)});return s.catch(function(b){return b}),s}var u=t.firstFields===!0?Object.keys(e):t.firstFields||[],f=Object.keys(e),d=f.length,p=0,m=[],y=new Promise(function(b,S){var w=function(x){if(m.push.apply(m,x),p++,p===d)return r(m),m.length?S(new sL(m,CT(m))):b(a)};f.length||(r(m),b(a)),f.forEach(function(C){var x=e[C];u.indexOf(C)!==-1?oL(x,n,w):gK(x,n,w)})});return y.catch(function(b){return b}),y}function SK(e){return!!(e&&e.message!==void 0)}function EK(e,t){for(var n=e,r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function uL(e,t){return function(n){var r;return e.fullFields?r=EK(t,e.fullFields):r=t[n.field||e.fullField],SK(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function lL(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];en(r)==="object"&&en(e[n])==="object"?e[n]=$e($e({},e[n]),r):e[n]=r}}return e}var Lh="enum",_K=function(t,n,r,a,s){t[Lh]=Array.isArray(t[Lh])?t[Lh]:[],t[Lh].indexOf(n)===-1&&a.push(Co(s.messages[Lh],t.fullField,t[Lh].join(", ")))},CK=function(t,n,r,a,s){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||a.push(Co(s.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var u=new RegExp(t.pattern);u.test(n)||a.push(Co(s.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},wK=function(t,n,r,a,s){var u=typeof t.len=="number",f=typeof t.min=="number",d=typeof t.max=="number",p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,m=n,y=null,b=typeof n=="number",S=typeof n=="string",w=Array.isArray(n);if(b?y="number":S?y="string":w&&(y="array"),!y)return!1;w&&(m=n.length),S&&(m=n.replace(p,"_").length),u?m!==t.len&&a.push(Co(s.messages[y].len,t.fullField,t.len)):f&&!d&&m<t.min?a.push(Co(s.messages[y].min,t.fullField,t.min)):d&&!f&&m>t.max?a.push(Co(s.messages[y].max,t.fullField,t.max)):f&&d&&(m<t.min||m>t.max)&&a.push(Co(s.messages[y].range,t.fullField,t.min,t.max))},cL=function(t,n,r,a,s,u){t.required&&(!r.hasOwnProperty(t.field)||vi(n,u||t.type))&&a.push(Co(s.messages.required,t.fullField))},O0;const xK=function(){if(O0)return O0;var e="[a-fA-F\\d:]",t=function(D){return D&&D.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",a=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],s="(?:%[0-9a-zA-Z]{1,})?",u="(?:".concat(a.join("|"),")").concat(s),f=new RegExp("(?:^".concat(n,"$)|(?:^").concat(u,"$)")),d=new RegExp("^".concat(n,"$")),p=new RegExp("^".concat(u,"$")),m=function(D){return D&&D.exact?f:new RegExp("(?:".concat(t(D)).concat(n).concat(t(D),")|(?:").concat(t(D)).concat(u).concat(t(D),")"),"g")};m.v4=function(T){return T&&T.exact?d:new RegExp("".concat(t(T)).concat(n).concat(t(T)),"g")},m.v6=function(T){return T&&T.exact?p:new RegExp("".concat(t(T)).concat(u).concat(t(T)),"g")};var y="(?:(?:[a-z]+:)?//)",b="(?:\\S+(?::\\S*)?@)?",S=m.v4().source,w=m.v6().source,C="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",x="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",O="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",k="(?::\\d{2,5})?",N='(?:[/?#][^\\s"]*)?',P="(?:".concat(y,"|www\\.)").concat(b,"(?:localhost|").concat(S,"|").concat(w,"|").concat(C).concat(x).concat(O,")").concat(k).concat(N);return O0=new RegExp("(?:^".concat(P,"$)"),"i"),O0};var fL={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},xm={integer:function(t){return xm.number(t)&&parseInt(t,10)===t},float:function(t){return xm.number(t)&&!xm.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return en(t)==="object"&&!xm.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(fL.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(xK())},hex:function(t){return typeof t=="string"&&!!t.match(fL.hex)}},TK=function(t,n,r,a,s){if(t.required&&n===void 0){cL(t,n,r,a,s);return}var u=["integer","float","array","regexp","object","method","email","number","date","url","hex"],f=t.type;u.indexOf(f)>-1?xm[f](n)||a.push(Co(s.messages.types[f],t.fullField,t.type)):f&&en(n)!==t.type&&a.push(Co(s.messages.types[f],t.fullField,t.type))},RK=function(t,n,r,a,s){(/^\s+$/.test(n)||n==="")&&a.push(Co(s.messages.whitespace,t.fullField))};const Tn={required:cL,whitespace:RK,type:TK,range:wK,enum:_K,pattern:CK};var OK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s)}r(u)},kK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(n==null&&!t.required)return r();Tn.required(t,n,a,u,s,"array"),n!=null&&(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s))}r(u)},AK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&Tn.type(t,n,a,u,s)}r(u)},NK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n,"date")&&!t.required)return r();if(Tn.required(t,n,a,u,s),!vi(n,"date")){var d;n instanceof Date?d=n:d=new Date(n),Tn.type(t,d,a,u,s),d&&Tn.range(t,d.getTime(),a,u,s)}}r(u)},DK="enum",LK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&Tn[DK](t,n,a,u,s)}r(u)},PK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s))}r(u)},MK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s))}r(u)},FK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&Tn.type(t,n,a,u,s)}r(u)},jK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(n===""&&(n=void 0),vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s))}r(u)},IK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&Tn.type(t,n,a,u,s)}r(u)},$K=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n,"string")&&!t.required)return r();Tn.required(t,n,a,u,s),vi(n,"string")||Tn.pattern(t,n,a,u,s)}r(u)},UK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),vi(n)||Tn.type(t,n,a,u,s)}r(u)},zK=function(t,n,r,a,s){var u=[],f=Array.isArray(n)?"array":en(n);Tn.required(t,n,a,u,s,f),r(u)},VK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n,"string")&&!t.required)return r();Tn.required(t,n,a,u,s,"string"),vi(n,"string")||(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s),Tn.pattern(t,n,a,u,s),t.whitespace===!0&&Tn.whitespace(t,n,a,u,s))}r(u)},wT=function(t,n,r,a,s){var u=t.type,f=[],d=t.required||!t.required&&a.hasOwnProperty(t.field);if(d){if(vi(n,u)&&!t.required)return r();Tn.required(t,n,a,f,s,u),vi(n,u)||Tn.type(t,n,a,f,s)}r(f)};const Tm={string:VK,method:FK,number:jK,boolean:AK,regexp:UK,integer:MK,float:PK,array:kK,object:IK,enum:LK,pattern:$K,date:NK,url:wT,hex:wT,email:wT,required:zK,any:OK};var Rm=function(){function e(t){ma(this,e),Ee(this,"rules",null),Ee(this,"_messages",ET),this.define(t)}return ga(e,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(en(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(a){var s=n[a];r.rules[a]=Array.isArray(s)?s:[s]})}},{key:"messages",value:function(n){return n&&(this._messages=lL(ST(),n)),this._messages}},{key:"validate",value:function(n){var r=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},u=n,f=a,d=s;if(typeof f=="function"&&(d=f,f={}),!this.rules||Object.keys(this.rules).length===0)return d&&d(null,u),Promise.resolve(u);function p(w){var C=[],x={};function O(N){if(Array.isArray(N)){var P;C=(P=C).concat.apply(P,Ft(N))}else C.push(N)}for(var k=0;k<w.length;k++)O(w[k]);C.length?(x=CT(C),d(C,x)):d(null,u)}if(f.messages){var m=this.messages();m===ET&&(m=ST()),lL(m,f.messages),f.messages=m}else f.messages=this.messages();var y={},b=f.keys||Object.keys(this.rules);b.forEach(function(w){var C=r.rules[w],x=u[w];C.forEach(function(O){var k=O;typeof k.transform=="function"&&(u===n&&(u=$e({},u)),x=u[w]=k.transform(x),x!=null&&(k.type=k.type||(Array.isArray(x)?"array":en(x)))),typeof k=="function"?k={validator:k}:k=$e({},k),k.validator=r.getValidationMethod(k),k.validator&&(k.field=w,k.fullField=k.fullField||w,k.type=r.getType(k),y[w]=y[w]||[],y[w].push({rule:k,value:x,source:u,field:w}))})});var S={};return bK(y,f,function(w,C){var x=w.rule,O=(x.type==="object"||x.type==="array")&&(en(x.fields)==="object"||en(x.defaultField)==="object");O=O&&(x.required||!x.required&&w.value),x.field=w.field;function k(M,U){return $e($e({},U),{},{fullField:"".concat(x.fullField,".").concat(M),fullFields:x.fullFields?[].concat(Ft(x.fullFields),[M]):[M]})}function N(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=Array.isArray(M)?M:[M];!f.suppressWarning&&U.length&&e.warning("async-validator:",U),U.length&&x.message!==void 0&&(U=[].concat(x.message));var H=U.map(uL(x,u));if(f.first&&H.length)return S[x.field]=1,C(H);if(!O)C(H);else{if(x.required&&!w.value)return x.message!==void 0?H=[].concat(x.message).map(uL(x,u)):f.error&&(H=[f.error(x,Co(f.messages.required,x.field))]),C(H);var B={};x.defaultField&&Object.keys(w.value).map(function(K){B[K]=x.defaultField}),B=$e($e({},B),w.rule.fields);var G={};Object.keys(B).forEach(function(K){var Q=B[K],Y=Array.isArray(Q)?Q:[Q];G[K]=Y.map(k.bind(null,K))});var te=new e(G);te.messages(f.messages),w.rule.options&&(w.rule.options.messages=f.messages,w.rule.options.error=f.error),te.validate(w.value,w.rule.options||f,function(K){var Q=[];H&&H.length&&Q.push.apply(Q,Ft(H)),K&&K.length&&Q.push.apply(Q,Ft(K)),C(Q.length?Q:null)})}}var P;if(x.asyncValidator)P=x.asyncValidator(x,w.value,N,w.source,f);else if(x.validator){try{P=x.validator(x,w.value,N,w.source,f)}catch(M){var T,D;(T=(D=console).error)===null||T===void 0||T.call(D,M),f.suppressValidatorError||setTimeout(function(){throw M},0),N(M.message)}P===!0?N():P===!1?N(typeof x.message=="function"?x.message(x.fullField||x.field):x.message||"".concat(x.fullField||x.field," fails")):P instanceof Array?N(P):P instanceof Error&&N(P.message)}P&&P.then&&P.then(function(){return N()},function(M){return N(M)})},function(w){p(w)},u)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!Tm.hasOwnProperty(n.type))throw new Error(Co("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),a=r.indexOf("message");return a!==-1&&r.splice(a,1),r.length===1&&r[0]==="required"?Tm.required:Tm[this.getType(n)]||void 0}}]),e}();Ee(Rm,"register",function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");Tm[t]=n}),Ee(Rm,"warning",aL),Ee(Rm,"messages",ET),Ee(Rm,"validators",Tm);var wo="'${name}' is not a valid ${type}",dL={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:wo,method:wo,array:wo,object:wo,number:wo,date:wo,boolean:wo,integer:wo,float:wo,regexp:wo,email:wo,url:wo,hex:wo},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},hL=Rm;function HK(e,t){return e.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return t[r]})}var pL="CODE_LOGIC_ERROR";function xT(e,t,n,r,a){return TT.apply(this,arguments)}function TT(){return TT=wm(Ms().mark(function e(t,n,r,a,s){var u,f,d,p,m,y,b,S,w;return Ms().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return u=$e({},r),delete u.ruleIndex,hL.warning=function(){},u.validator&&(f=u.validator,u.validator=function(){try{return f.apply(void 0,arguments)}catch(O){return console.error(O),Promise.reject(pL)}}),d=null,u&&u.type==="array"&&u.defaultField&&(d=u.defaultField,delete u.defaultField),p=new hL(Ee({},t,[u])),m=bm(dL,a.validateMessages),p.messages(m),y=[],x.prev=10,x.next=13,Promise.resolve(p.validate(Ee({},t,n),$e({},a)));case 13:x.next=18;break;case 15:x.prev=15,x.t0=x.catch(10),x.t0.errors&&(y=x.t0.errors.map(function(O,k){var N=O.message,P=N===pL?m.default:N;return z.isValidElement(P)?z.cloneElement(P,{key:"error_".concat(k)}):P}));case 18:if(!(!y.length&&d)){x.next=23;break}return x.next=21,Promise.all(n.map(function(O,k){return xT("".concat(t,".").concat(k),O,d,a,s)}));case 21:return b=x.sent,x.abrupt("return",b.reduce(function(O,k){return[].concat(Ft(O),Ft(k))},[]));case 23:return S=$e($e({},r),{},{name:t,enum:(r.enum||[]).join(", ")},s),w=y.map(function(O){return typeof O=="string"?HK(O,S):O}),x.abrupt("return",w);case 26:case"end":return x.stop()}},e,null,[[10,15]])})),TT.apply(this,arguments)}function qK(e,t,n,r,a,s){var u=e.join("."),f=n.map(function(m,y){var b=m.validator,S=$e($e({},m),{},{ruleIndex:y});return b&&(S.validator=function(w,C,x){var O=!1,k=function(){for(var T=arguments.length,D=new Array(T),M=0;M<T;M++)D[M]=arguments[M];Promise.resolve().then(function(){Ir(!O,"Your validator function has already return a promise. `callback` will be ignored."),O||x.apply(void 0,D)})},N=b(w,C,k);O=N&&typeof N.then=="function"&&typeof N.catch=="function",Ir(O,"`callback` is deprecated. Please return a promise instead."),O&&N.then(function(){x()}).catch(function(P){x(P||" ")})}),S}).sort(function(m,y){var b=m.warningOnly,S=m.ruleIndex,w=y.warningOnly,C=y.ruleIndex;return!!b==!!w?S-C:b?1:-1}),d;if(a===!0)d=new Promise(function(){var m=wm(Ms().mark(function y(b,S){var w,C,x;return Ms().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:w=0;case 1:if(!(w<f.length)){k.next=12;break}return C=f[w],k.next=5,xT(u,t,C,r,s);case 5:if(x=k.sent,!x.length){k.next=9;break}return S([{errors:x,rule:C}]),k.abrupt("return");case 9:w+=1,k.next=1;break;case 12:b([]);case 13:case"end":return k.stop()}},y)}));return function(y,b){return m.apply(this,arguments)}}());else{var p=f.map(function(m){return xT(u,t,m,r,s).then(function(y){return{errors:y,rule:m}})});d=(a?WK(p):BK(p)).then(function(m){return Promise.reject(m)})}return d.catch(function(m){return m}),d}function BK(e){return RT.apply(this,arguments)}function RT(){return RT=wm(Ms().mark(function e(t){return Ms().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.all(t).then(function(a){var s,u=(s=[]).concat.apply(s,Ft(a));return u}));case 1:case"end":return r.stop()}},e)})),RT.apply(this,arguments)}function WK(e){return OT.apply(this,arguments)}function OT(){return OT=wm(Ms().mark(function e(t){var n;return Ms().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return n=0,a.abrupt("return",new Promise(function(s){t.forEach(function(u){u.then(function(f){f.errors.length&&s([f]),n+=1,n===t.length&&s([])})})}));case 2:case"end":return a.stop()}},e)})),OT.apply(this,arguments)}function ei(e){return bT(e)}function vL(e,t){var n={};return t.forEach(function(r){var a=pu(e,r);n=Ls(n,r,a)}),n}function Ph(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e&&e.some(function(r){return mL(t,r,n)})}function mL(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!e||!t||!n&&e.length!==t.length?!1:t.every(function(r,a){return e[a]===r})}function GK(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||en(e)!=="object"||en(t)!=="object")return!1;var n=Object.keys(e),r=Object.keys(t),a=new Set([].concat(n,r));return Ft(a).every(function(s){var u=e[s],f=t[s];return typeof u=="function"&&typeof f=="function"?!0:u===f})}function QK(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&en(t.target)==="object"&&e in t.target?t.target[e]:t}function gL(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var a=e[t],s=t-n;return s>0?[].concat(Ft(e.slice(0,n)),[a],Ft(e.slice(n,t)),Ft(e.slice(t+1,r))):s<0?[].concat(Ft(e.slice(0,t)),Ft(e.slice(t+1,n+1)),[a],Ft(e.slice(n+1,r))):e}var YK=["name"],Go=[];function kT(e,t,n,r,a,s){return typeof e=="function"?e(t,n,"source"in s?{source:s.source}:{}):r!==a}var AT=function(e){lf(n,e);var t=cf(n);function n(r){var a;if(ma(this,n),a=t.call(this,r),Ee(dn(a),"state",{resetCount:0}),Ee(dn(a),"cancelRegisterFunc",null),Ee(dn(a),"mounted",!1),Ee(dn(a),"touched",!1),Ee(dn(a),"dirty",!1),Ee(dn(a),"validatePromise",void 0),Ee(dn(a),"prevValidating",void 0),Ee(dn(a),"errors",Go),Ee(dn(a),"warnings",Go),Ee(dn(a),"cancelRegister",function(){var d=a.props,p=d.preserve,m=d.isListField,y=d.name;a.cancelRegisterFunc&&a.cancelRegisterFunc(m,p,ei(y)),a.cancelRegisterFunc=null}),Ee(dn(a),"getNamePath",function(){var d=a.props,p=d.name,m=d.fieldContext,y=m.prefixName,b=y===void 0?[]:y;return p!==void 0?[].concat(Ft(b),Ft(p)):[]}),Ee(dn(a),"getRules",function(){var d=a.props,p=d.rules,m=p===void 0?[]:p,y=d.fieldContext;return m.map(function(b){return typeof b=="function"?b(y):b})}),Ee(dn(a),"refresh",function(){a.mounted&&a.setState(function(d){var p=d.resetCount;return{resetCount:p+1}})}),Ee(dn(a),"metaCache",null),Ee(dn(a),"triggerMetaEvent",function(d){var p=a.props.onMetaChange;if(p){var m=$e($e({},a.getMeta()),{},{destroy:d});AN(a.metaCache,m)||p(m),a.metaCache=m}else a.metaCache=null}),Ee(dn(a),"onStoreChange",function(d,p,m){var y=a.props,b=y.shouldUpdate,S=y.dependencies,w=S===void 0?[]:S,C=y.onReset,x=m.store,O=a.getNamePath(),k=a.getValue(d),N=a.getValue(x),P=p&&Ph(p,O);switch(m.type==="valueUpdate"&&m.source==="external"&&!AN(k,N)&&(a.touched=!0,a.dirty=!0,a.validatePromise=null,a.errors=Go,a.warnings=Go,a.triggerMetaEvent()),m.type){case"reset":if(!p||P){a.touched=!1,a.dirty=!1,a.validatePromise=void 0,a.errors=Go,a.warnings=Go,a.triggerMetaEvent(),C==null||C(),a.refresh();return}break;case"remove":{if(b&&kT(b,d,x,k,N,m)){a.reRender();return}break}case"setField":{var T=m.data;if(P){"touched"in T&&(a.touched=T.touched),"validating"in T&&!("originRCField"in T)&&(a.validatePromise=T.validating?Promise.resolve([]):null),"errors"in T&&(a.errors=T.errors||Go),"warnings"in T&&(a.warnings=T.warnings||Go),a.dirty=!0,a.triggerMetaEvent(),a.reRender();return}else if("value"in T&&Ph(p,O,!0)){a.reRender();return}if(b&&!O.length&&kT(b,d,x,k,N,m)){a.reRender();return}break}case"dependenciesUpdate":{var D=w.map(ei);if(D.some(function(M){return Ph(m.relatedFields,M)})){a.reRender();return}break}default:if(P||(!w.length||O.length||b)&&kT(b,d,x,k,N,m)){a.reRender();return}break}b===!0&&a.reRender()}),Ee(dn(a),"validateRules",function(d){var p=a.getNamePath(),m=a.getValue(),y=d||{},b=y.triggerName,S=y.validateOnly,w=S===void 0?!1:S,C=Promise.resolve().then(wm(Ms().mark(function x(){var O,k,N,P,T,D,M;return Ms().wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(a.mounted){H.next=2;break}return H.abrupt("return",[]);case 2:if(O=a.props,k=O.validateFirst,N=k===void 0?!1:k,P=O.messageVariables,T=O.validateDebounce,D=a.getRules(),b&&(D=D.filter(function(B){return B}).filter(function(B){var G=B.validateTrigger;if(!G)return!0;var te=bT(G);return te.includes(b)})),!(T&&b)){H.next=10;break}return H.next=8,new Promise(function(B){setTimeout(B,T)});case 8:if(a.validatePromise===C){H.next=10;break}return H.abrupt("return",[]);case 10:return M=qK(p,m,D,d,N,P),M.catch(function(B){return B}).then(function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Go;if(a.validatePromise===C){var G;a.validatePromise=null;var te=[],K=[];(G=B.forEach)===null||G===void 0||G.call(B,function(Q){var Y=Q.rule.warningOnly,J=Q.errors,ne=J===void 0?Go:J;Y?K.push.apply(K,Ft(ne)):te.push.apply(te,Ft(ne))}),a.errors=te,a.warnings=K,a.triggerMetaEvent(),a.reRender()}}),H.abrupt("return",M);case 13:case"end":return H.stop()}},x)})));return w||(a.validatePromise=C,a.dirty=!0,a.errors=Go,a.warnings=Go,a.triggerMetaEvent(),a.reRender()),C}),Ee(dn(a),"isFieldValidating",function(){return!!a.validatePromise}),Ee(dn(a),"isFieldTouched",function(){return a.touched}),Ee(dn(a),"isFieldDirty",function(){if(a.dirty||a.props.initialValue!==void 0)return!0;var d=a.props.fieldContext,p=d.getInternalHooks(mf),m=p.getInitialValue;return m(a.getNamePath())!==void 0}),Ee(dn(a),"getErrors",function(){return a.errors}),Ee(dn(a),"getWarnings",function(){return a.warnings}),Ee(dn(a),"isListField",function(){return a.props.isListField}),Ee(dn(a),"isList",function(){return a.props.isList}),Ee(dn(a),"isPreserve",function(){return a.props.preserve}),Ee(dn(a),"getMeta",function(){a.prevValidating=a.isFieldValidating();var d={touched:a.isFieldTouched(),validating:a.prevValidating,errors:a.errors,warnings:a.warnings,name:a.getNamePath(),validated:a.validatePromise===null};return d}),Ee(dn(a),"getOnlyChild",function(d){if(typeof d=="function"){var p=a.getMeta();return $e($e({},a.getOnlyChild(d(a.getControlled(),p,a.props.fieldContext))),{},{isFunction:!0})}var m=K1(d);return m.length!==1||!z.isValidElement(m[0])?{child:m,isFunction:!1}:{child:m[0],isFunction:!1}}),Ee(dn(a),"getValue",function(d){var p=a.props.fieldContext.getFieldsValue,m=a.getNamePath();return pu(d||p(!0),m)}),Ee(dn(a),"getControlled",function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=a.props,m=p.name,y=p.trigger,b=p.validateTrigger,S=p.getValueFromEvent,w=p.normalize,C=p.valuePropName,x=p.getValueProps,O=p.fieldContext,k=b!==void 0?b:O.validateTrigger,N=a.getNamePath(),P=O.getInternalHooks,T=O.getFieldsValue,D=P(mf),M=D.dispatch,U=a.getValue(),H=x||function(Q){return Ee({},C,Q)},B=d[y],G=m!==void 0?H(U):{};G&&Object.keys(G).forEach(function(Q){Ir(typeof G[Q]!="function","It's not recommended to generate dynamic function prop by `getValueProps`. Please pass it to child component directly (prop: ".concat(Q,")"))});var te=$e($e({},d),G);te[y]=function(){a.touched=!0,a.dirty=!0,a.triggerMetaEvent();for(var Q,Y=arguments.length,J=new Array(Y),ne=0;ne<Y;ne++)J[ne]=arguments[ne];S?Q=S.apply(void 0,J):Q=QK.apply(void 0,[C].concat(J)),w&&(Q=w(Q,U,T(!0))),Q!==U&&M({type:"updateValue",namePath:N,value:Q}),B&&B.apply(void 0,J)};var K=bT(k||[]);return K.forEach(function(Q){var Y=te[Q];te[Q]=function(){Y&&Y.apply(void 0,arguments);var J=a.props.rules;J&&J.length&&M({type:"validateField",namePath:N,triggerName:Q})}}),te}),r.fieldContext){var s=r.fieldContext.getInternalHooks,u=s(mf),f=u.initEntityValue;f(dn(a))}return a}return ga(n,[{key:"componentDidMount",value:function(){var a=this.props,s=a.shouldUpdate,u=a.fieldContext;if(this.mounted=!0,u){var f=u.getInternalHooks,d=f(mf),p=d.registerField;this.cancelRegisterFunc=p(this)}s===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var a=this.state.resetCount,s=this.props.children,u=this.getOnlyChild(s),f=u.child,d=u.isFunction,p;return d?p=f:z.isValidElement(f)?p=z.cloneElement(f,this.getControlled(f.props)):(Ir(!f,"`children` of Field is not validate ReactElement."),p=f),z.createElement(z.Fragment,{key:a},p)}}]),n}(z.Component);Ee(AT,"contextType",Dh),Ee(AT,"defaultProps",{trigger:"onChange",valuePropName:"value"});function yL(e){var t,n=e.name,r=df(e,YK),a=z.useContext(Dh),s=z.useContext(R0),u=n!==void 0?ei(n):void 0,f=(t=r.isListField)!==null&&t!==void 0?t:!!s,d="keep";return f||(d="_".concat((u||[]).join("_"))),r.preserve===!1&&f&&u.length<=1&&Ir(!1,"`preserve` should not apply on Form.List fields."),z.createElement(AT,du({key:d,name:u,isListField:f},r,{fieldContext:a}))}function XK(e){var t=e.name,n=e.initialValue,r=e.children,a=e.rules,s=e.validateTrigger,u=e.isListField,f=z.useContext(Dh),d=z.useContext(R0),p=z.useRef({keys:[],id:0}),m=p.current,y=z.useMemo(function(){var C=ei(f.prefixName)||[];return[].concat(Ft(C),Ft(ei(t)))},[f.prefixName,t]),b=z.useMemo(function(){return $e($e({},f),{},{prefixName:y})},[f,y]),S=z.useMemo(function(){return{getKey:function(x){var O=y.length,k=x[O];return[m.keys[k],x.slice(O+1)]}}},[y]);if(typeof r!="function")return Ir(!1,"Form.List only accepts function as children."),null;var w=function(x,O,k){var N=k.source;return N==="internal"?!1:x!==O};return z.createElement(R0.Provider,{value:S},z.createElement(Dh.Provider,{value:b},z.createElement(yL,{name:[],shouldUpdate:w,rules:a,validateTrigger:s,initialValue:n,isList:!0,isListField:u??!!d},function(C,x){var O=C.value,k=O===void 0?[]:O,N=C.onChange,P=f.getFieldValue,T=function(){var H=P(y||[]);return H||[]},D={add:function(H,B){var G=T();B>=0&&B<=G.length?(m.keys=[].concat(Ft(m.keys.slice(0,B)),[m.id],Ft(m.keys.slice(B))),N([].concat(Ft(G.slice(0,B)),[H],Ft(G.slice(B))))):((B<0||B>G.length)&&Ir(!1,"The second parameter of the add function should be a valid positive number."),m.keys=[].concat(Ft(m.keys),[m.id]),N([].concat(Ft(G),[H]))),m.id+=1},remove:function(H){var B=T(),G=new Set(Array.isArray(H)?H:[H]);G.size<=0||(m.keys=m.keys.filter(function(te,K){return!G.has(K)}),N(B.filter(function(te,K){return!G.has(K)})))},move:function(H,B){if(H!==B){var G=T();H<0||H>=G.length||B<0||B>=G.length||(m.keys=gL(m.keys,H,B),N(gL(G,H,B)))}}},M=k||[];return Array.isArray(M)||(M=[],Ir(!1,"Current value of '".concat(y.join(" > "),"' is not an array type."))),r(M.map(function(U,H){var B=m.keys[H];return B===void 0&&(m.keys[H]=m.id,B=m.keys[H],m.id+=1),{name:H,key:B,isListField:!0}}),D,x)})))}function KK(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(a,s){e.forEach(function(u,f){u.catch(function(d){return t=!0,d}).then(function(d){n-=1,r[f]=d,!(n>0)&&(t&&s(r),a(r))})})}):Promise.resolve([])}var bL="__@field_split__";function NT(e){return e.map(function(t){return"".concat(en(t),":").concat(t)}).join(bL)}var Mh=function(){function e(){ma(this,e),Ee(this,"kvs",new Map)}return ga(e,[{key:"set",value:function(n,r){this.kvs.set(NT(n),r)}},{key:"get",value:function(n){return this.kvs.get(NT(n))}},{key:"update",value:function(n,r){var a=this.get(n),s=r(a);s?this.set(n,s):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(NT(n))}},{key:"map",value:function(n){return Ft(this.kvs.entries()).map(function(r){var a=ht(r,2),s=a[0],u=a[1],f=s.split(bL);return n({key:f.map(function(d){var p=d.match(/^([^:]*):(.*)$/),m=ht(p,3),y=m[1],b=m[2];return y==="number"?Number(b):b}),value:u})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var a=r.key,s=r.value;return n[a.join(".")]=s,null}),n}}]),e}(),ZK=["name"],JK=ga(function e(t){var n=this;ma(this,e),Ee(this,"formHooked",!1),Ee(this,"forceRootUpdate",void 0),Ee(this,"subscribable",!0),Ee(this,"store",{}),Ee(this,"fieldEntities",[]),Ee(this,"initialValues",{}),Ee(this,"callbacks",{}),Ee(this,"validateMessages",null),Ee(this,"preserve",null),Ee(this,"lastValidatePromise",null),Ee(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),Ee(this,"getInternalHooks",function(r){return r===mf?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Ir(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),Ee(this,"useSubscribe",function(r){n.subscribable=r}),Ee(this,"prevWithoutPreserves",null),Ee(this,"setInitialValues",function(r,a){if(n.initialValues=r||{},a){var s,u=bm(r,n.store);(s=n.prevWithoutPreserves)===null||s===void 0||s.map(function(f){var d=f.key;u=Ls(u,d,pu(r,d))}),n.prevWithoutPreserves=null,n.updateStore(u)}}),Ee(this,"destroyForm",function(r){if(r)n.updateStore({});else{var a=new Mh;n.getFieldEntities(!0).forEach(function(s){n.isMergedPreserve(s.isPreserve())||a.set(s.getNamePath(),!0)}),n.prevWithoutPreserves=a}}),Ee(this,"getInitialValue",function(r){var a=pu(n.initialValues,r);return r.length?bm(a):a}),Ee(this,"setCallbacks",function(r){n.callbacks=r}),Ee(this,"setValidateMessages",function(r){n.validateMessages=r}),Ee(this,"setPreserve",function(r){n.preserve=r}),Ee(this,"watchList",[]),Ee(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(a){return a!==r})}}),Ee(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var a=n.getFieldsValue(),s=n.getFieldsValue(!0);n.watchList.forEach(function(u){u(a,s,r)})}}),Ee(this,"timeoutId",null),Ee(this,"warningUnhooked",function(){!n.timeoutId&&typeof window<"u"&&(n.timeoutId=setTimeout(function(){n.timeoutId=null,n.formHooked||Ir(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))}),Ee(this,"updateStore",function(r){n.store=r}),Ee(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(a){return a.getNamePath().length}):n.fieldEntities}),Ee(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=new Mh;return n.getFieldEntities(r).forEach(function(s){var u=s.getNamePath();a.set(u,s)}),a}),Ee(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var a=n.getFieldsMap(!0);return r.map(function(s){var u=ei(s);return a.get(u)||{INVALIDATE_NAME_PATH:ei(s)}})}),Ee(this,"getFieldsValue",function(r,a){n.warningUnhooked();var s,u,f;if(r===!0||Array.isArray(r)?(s=r,u=a):r&&en(r)==="object"&&(f=r.strict,u=r.filter),s===!0&&!u)return n.store;var d=n.getFieldEntitiesForNamePathList(Array.isArray(s)?s:null),p=[];return d.forEach(function(m){var y,b,S="INVALIDATE_NAME_PATH"in m?m.INVALIDATE_NAME_PATH:m.getNamePath();if(f){var w,C;if((w=(C=m).isList)!==null&&w!==void 0&&w.call(C))return}else if(!s&&(y=(b=m).isListField)!==null&&y!==void 0&&y.call(b))return;if(!u)p.push(S);else{var x="getMeta"in m?m.getMeta():null;u(x)&&p.push(S)}}),vL(n.store,p.map(ei))}),Ee(this,"getFieldValue",function(r){n.warningUnhooked();var a=ei(r);return pu(n.store,a)}),Ee(this,"getFieldsError",function(r){n.warningUnhooked();var a=n.getFieldEntitiesForNamePathList(r);return a.map(function(s,u){return s&&!("INVALIDATE_NAME_PATH"in s)?{name:s.getNamePath(),errors:s.getErrors(),warnings:s.getWarnings()}:{name:ei(r[u]),errors:[],warnings:[]}})}),Ee(this,"getFieldError",function(r){n.warningUnhooked();var a=ei(r),s=n.getFieldsError([a])[0];return s.errors}),Ee(this,"getFieldWarning",function(r){n.warningUnhooked();var a=ei(r),s=n.getFieldsError([a])[0];return s.warnings}),Ee(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];var u=a[0],f=a[1],d,p=!1;a.length===0?d=null:a.length===1?Array.isArray(u)?(d=u.map(ei),p=!1):(d=null,p=u):(d=u.map(ei),p=f);var m=n.getFieldEntities(!0),y=function(x){return x.isFieldTouched()};if(!d)return p?m.every(function(C){return y(C)||C.isList()}):m.some(y);var b=new Mh;d.forEach(function(C){b.set(C,[])}),m.forEach(function(C){var x=C.getNamePath();d.forEach(function(O){O.every(function(k,N){return x[N]===k})&&b.update(O,function(k){return[].concat(Ft(k),[C])})})});var S=function(x){return x.some(y)},w=b.map(function(C){var x=C.value;return x});return p?w.every(S):w.some(S)}),Ee(this,"isFieldTouched",function(r){return n.warningUnhooked(),n.isFieldsTouched([r])}),Ee(this,"isFieldsValidating",function(r){n.warningUnhooked();var a=n.getFieldEntities();if(!r)return a.some(function(u){return u.isFieldValidating()});var s=r.map(ei);return a.some(function(u){var f=u.getNamePath();return Ph(s,f)&&u.isFieldValidating()})}),Ee(this,"isFieldValidating",function(r){return n.warningUnhooked(),n.isFieldsValidating([r])}),Ee(this,"resetWithFieldInitialValue",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=new Mh,s=n.getFieldEntities(!0);s.forEach(function(d){var p=d.props.initialValue,m=d.getNamePath();if(p!==void 0){var y=a.get(m)||new Set;y.add({entity:d,value:p}),a.set(m,y)}});var u=function(p){p.forEach(function(m){var y=m.props.initialValue;if(y!==void 0){var b=m.getNamePath(),S=n.getInitialValue(b);if(S!==void 0)Ir(!1,"Form already set 'initialValues' with path '".concat(b.join("."),"'. Field can not overwrite it."));else{var w=a.get(b);if(w&&w.size>1)Ir(!1,"Multiple Field with path '".concat(b.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(w){var C=n.getFieldValue(b),x=m.isListField();!x&&(!r.skipExist||C===void 0)&&n.updateStore(Ls(n.store,b,Ft(w)[0].value))}}}})},f;r.entities?f=r.entities:r.namePathList?(f=[],r.namePathList.forEach(function(d){var p=a.get(d);if(p){var m;(m=f).push.apply(m,Ft(Ft(p).map(function(y){return y.entity})))}})):f=s,u(f)}),Ee(this,"resetFields",function(r){n.warningUnhooked();var a=n.store;if(!r){n.updateStore(bm(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(a,null,{type:"reset"}),n.notifyWatch();return}var s=r.map(ei);s.forEach(function(u){var f=n.getInitialValue(u);n.updateStore(Ls(n.store,u,f))}),n.resetWithFieldInitialValue({namePathList:s}),n.notifyObservers(a,s,{type:"reset"}),n.notifyWatch(s)}),Ee(this,"setFields",function(r){n.warningUnhooked();var a=n.store,s=[];r.forEach(function(u){var f=u.name,d=df(u,ZK),p=ei(f);s.push(p),"value"in d&&n.updateStore(Ls(n.store,p,d.value)),n.notifyObservers(a,[p],{type:"setField",data:u})}),n.notifyWatch(s)}),Ee(this,"getFields",function(){var r=n.getFieldEntities(!0),a=r.map(function(s){var u=s.getNamePath(),f=s.getMeta(),d=$e($e({},f),{},{name:u,value:n.getFieldValue(u)});return Object.defineProperty(d,"originRCField",{value:!0}),d});return a}),Ee(this,"initEntityValue",function(r){var a=r.props.initialValue;if(a!==void 0){var s=r.getNamePath(),u=pu(n.store,s);u===void 0&&n.updateStore(Ls(n.store,s,a))}}),Ee(this,"isMergedPreserve",function(r){var a=r!==void 0?r:n.preserve;return a??!0}),Ee(this,"registerField",function(r){n.fieldEntities.push(r);var a=r.getNamePath();if(n.notifyWatch([a]),r.props.initialValue!==void 0){var s=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(s,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(u,f){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(y){return y!==r}),!n.isMergedPreserve(f)&&(!u||d.length>1)){var p=u?void 0:n.getInitialValue(a);if(a.length&&n.getFieldValue(a)!==p&&n.fieldEntities.every(function(y){return!mL(y.getNamePath(),a)})){var m=n.store;n.updateStore(Ls(m,a,p,!0)),n.notifyObservers(m,[a],{type:"remove"}),n.triggerDependenciesUpdate(m,a)}}n.notifyWatch([a])}}),Ee(this,"dispatch",function(r){switch(r.type){case"updateValue":{var a=r.namePath,s=r.value;n.updateValue(a,s);break}case"validateField":{var u=r.namePath,f=r.triggerName;n.validateFields([u],{triggerName:f});break}}}),Ee(this,"notifyObservers",function(r,a,s){if(n.subscribable){var u=$e($e({},s),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(f){var d=f.onStoreChange;d(r,a,u)})}else n.forceRootUpdate()}),Ee(this,"triggerDependenciesUpdate",function(r,a){var s=n.getDependencyChildrenFields(a);return s.length&&n.validateFields(s),n.notifyObservers(r,s,{type:"dependenciesUpdate",relatedFields:[a].concat(Ft(s))}),s}),Ee(this,"updateValue",function(r,a){var s=ei(r),u=n.store;n.updateStore(Ls(n.store,s,a)),n.notifyObservers(u,[s],{type:"valueUpdate",source:"internal"}),n.notifyWatch([s]);var f=n.triggerDependenciesUpdate(u,s),d=n.callbacks.onValuesChange;if(d){var p=vL(n.store,[s]);d(p,n.getFieldsValue())}n.triggerOnFieldsChange([s].concat(Ft(f)))}),Ee(this,"setFieldsValue",function(r){n.warningUnhooked();var a=n.store;if(r){var s=bm(n.store,r);n.updateStore(s)}n.notifyObservers(a,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),Ee(this,"setFieldValue",function(r,a){n.setFields([{name:r,value:a,errors:[],warnings:[]}])}),Ee(this,"getDependencyChildrenFields",function(r){var a=new Set,s=[],u=new Mh;n.getFieldEntities().forEach(function(d){var p=d.props.dependencies;(p||[]).forEach(function(m){var y=ei(m);u.update(y,function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return b.add(d),b})})});var f=function d(p){var m=u.get(p)||new Set;m.forEach(function(y){if(!a.has(y)){a.add(y);var b=y.getNamePath();y.isFieldDirty()&&b.length&&(s.push(b),d(b))}})};return f(r),s}),Ee(this,"triggerOnFieldsChange",function(r,a){var s=n.callbacks.onFieldsChange;if(s){var u=n.getFields();if(a){var f=new Mh;a.forEach(function(p){var m=p.name,y=p.errors;f.set(m,y)}),u.forEach(function(p){p.errors=f.get(p.name)||p.errors})}var d=u.filter(function(p){var m=p.name;return Ph(r,m)});d.length&&s(d,u)}}),Ee(this,"validateFields",function(r,a){n.warningUnhooked();var s,u;Array.isArray(r)||typeof r=="string"||typeof a=="string"?(s=r,u=a):u=r;var f=!!s,d=f?s.map(ei):[],p=[],m=String(Date.now()),y=new Set,b=u||{},S=b.recursive,w=b.dirty;n.getFieldEntities(!0).forEach(function(k){if(f||d.push(k.getNamePath()),!(!k.props.rules||!k.props.rules.length)&&!(w&&!k.isFieldDirty())){var N=k.getNamePath();if(y.add(N.join(m)),!f||Ph(d,N,S)){var P=k.validateRules($e({validateMessages:$e($e({},dL),n.validateMessages)},u));p.push(P.then(function(){return{name:N,errors:[],warnings:[]}}).catch(function(T){var D,M=[],U=[];return(D=T.forEach)===null||D===void 0||D.call(T,function(H){var B=H.rule.warningOnly,G=H.errors;B?U.push.apply(U,Ft(G)):M.push.apply(M,Ft(G))}),M.length?Promise.reject({name:N,errors:M,warnings:U}):{name:N,errors:M,warnings:U}}))}}});var C=KK(p);n.lastValidatePromise=C,C.catch(function(k){return k}).then(function(k){var N=k.map(function(P){var T=P.name;return T});n.notifyObservers(n.store,N,{type:"validateFinish"}),n.triggerOnFieldsChange(N,k)});var x=C.then(function(){return n.lastValidatePromise===C?Promise.resolve(n.getFieldsValue(d)):Promise.reject([])}).catch(function(k){var N=k.filter(function(P){return P&&P.errors.length});return Promise.reject({values:n.getFieldsValue(d),errorFields:N,outOfDate:n.lastValidatePromise!==C})});x.catch(function(k){return k});var O=d.filter(function(k){return y.has(k.join(m))});return n.triggerOnFieldsChange(O),x}),Ee(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var a=n.callbacks.onFinish;if(a)try{a(r)}catch(s){console.error(s)}}).catch(function(r){var a=n.callbacks.onFinishFailed;a&&a(r)})}),this.forceRootUpdate=t});function SL(e){var t=z.useRef(),n=z.useState({}),r=ht(n,2),a=r[1];if(!t.current)if(e)t.current=e;else{var s=function(){a({})},u=new JK(s);t.current=u.getForm()}return[t.current]}var DT=z.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),eZ=function(t){var n=t.validateMessages,r=t.onFormChange,a=t.onFormFinish,s=t.children,u=z.useContext(DT),f=z.useRef({});return z.createElement(DT.Provider,{value:$e($e({},u),{},{validateMessages:$e($e({},u.validateMessages),n),triggerFormChange:function(p,m){r&&r(p,{changedFields:m,forms:f.current}),u.triggerFormChange(p,m)},triggerFormFinish:function(p,m){a&&a(p,{values:m,forms:f.current}),u.triggerFormFinish(p,m)},registerForm:function(p,m){p&&(f.current=$e($e({},f.current),{},Ee({},p,m))),u.registerForm(p,m)},unregisterForm:function(p){var m=$e({},f.current);delete m[p],f.current=m,u.unregisterForm(p)}})},s)},tZ=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],nZ=function(t,n){var r=t.name,a=t.initialValues,s=t.fields,u=t.form,f=t.preserve,d=t.children,p=t.component,m=p===void 0?"form":p,y=t.validateMessages,b=t.validateTrigger,S=b===void 0?"onChange":b,w=t.onValuesChange,C=t.onFieldsChange,x=t.onFinish,O=t.onFinishFailed,k=t.clearOnDestroy,N=df(t,tZ),P=z.useRef(null),T=z.useContext(DT),D=SL(u),M=ht(D,1),U=M[0],H=U.getInternalHooks(mf),B=H.useSubscribe,G=H.setInitialValues,te=H.setCallbacks,K=H.setValidateMessages,Q=H.setPreserve,Y=H.destroyForm;z.useImperativeHandle(n,function(){return $e($e({},U),{},{nativeElement:P.current})}),z.useEffect(function(){return T.registerForm(r,U),function(){T.unregisterForm(r)}},[T,U,r]),K($e($e({},T.validateMessages),y)),te({onValuesChange:w,onFieldsChange:function(ve){if(T.triggerFormChange(r,ve),C){for(var Ne=arguments.length,ke=new Array(Ne>1?Ne-1:0),Fe=1;Fe<Ne;Fe++)ke[Fe-1]=arguments[Fe];C.apply(void 0,[ve].concat(ke))}},onFinish:function(ve){T.triggerFormFinish(r,ve),x&&x(ve)},onFinishFailed:O}),Q(f);var J=z.useRef(null);G(a,!J.current),J.current||(J.current=!0),z.useEffect(function(){return function(){return Y(k)}},[]);var ne,ee=typeof d=="function";if(ee){var de=U.getFieldsValue(!0);ne=d(de,U)}else ne=d;B(!ee);var Z=z.useRef();z.useEffect(function(){GK(Z.current||[],s||[])||U.setFields(s||[]),Z.current=s},[s,U]);var oe=z.useMemo(function(){return $e($e({},U),{},{validateTrigger:S})},[U,S]),ge=z.createElement(R0.Provider,{value:null},z.createElement(Dh.Provider,{value:oe},ne));return m===!1?ge:z.createElement(m,du({},N,{ref:P,onSubmit:function(ve){ve.preventDefault(),ve.stopPropagation(),U.submit()},onReset:function(ve){var Ne;ve.preventDefault(),U.resetFields(),(Ne=N.onReset)===null||Ne===void 0||Ne.call(N,ve)}}),ge)};function EL(e){try{return JSON.stringify(e)}catch{return Math.random()}}var rZ=function(e){var t=e.join("__RC_FIELD_FORM_SPLIT__"),n=z.useRef(t);Ir(n.current===t,"`useWatch` is not support dynamic `namePath`. Please provide static instead.")};function iZ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],a=t[1],s=a===void 0?{}:a,u=dK(s)?{form:s}:s,f=u.form,d=z.useState(),p=ht(d,2),m=p[0],y=p[1],b=z.useMemo(function(){return EL(m)},[m]),S=z.useRef(b);S.current=b;var w=z.useContext(Dh),C=f||w,x=C&&C._init;Ir(t.length===2?f?x:!0:x,"useWatch requires a form instance since it can not auto detect from context.");var O=ei(r),k=z.useRef(O);return k.current=O,rZ(O),z.useEffect(function(){if(x){var N=C.getFieldsValue,P=C.getInternalHooks,T=P(mf),D=T.registerWatch,M=function(G,te){var K=u.preserve?te:G;return typeof r=="function"?r(K):pu(K,k.current)},U=D(function(B,G){var te=M(B,G),K=EL(te);S.current!==K&&(S.current=K,y(te))}),H=M(N(),N(!0));return m!==H&&y(H),U}},[x]),m}var aZ=z.forwardRef(nZ),Om=aZ;Om.FormProvider=eZ,Om.Field=yL,Om.List=XK,Om.useForm=SL,Om.useWatch=iZ;const LT=z.createContext({});LT.displayName="FormItemInputContext";const oZ=({children:e,status:t,override:n})=>{const r=z.useContext(LT),a=z.useMemo(()=>{const s=Object.assign({},r);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,r]);return z.createElement(LT.Provider,{value:a},e)},sZ=e=>{const{space:t,form:n,children:r}=e;if(r==null)return null;let a=r;return n&&(a=qe.createElement(oZ,{override:!0,status:!0},a)),t&&(a=qe.createElement(zX,null,a)),a},uZ=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};function lZ(e){var t=e.prefixCls,n=e.align,r=e.arrow,a=e.arrowPos,s=r||{},u=s.className,f=s.content,d=a.x,p=d===void 0?0:d,m=a.y,y=m===void 0?0:m,b=z.useRef();if(!n||!n.points)return null;var S={position:"absolute"};if(n.autoArrow!==!1){var w=n.points[0],C=n.points[1],x=w[0],O=w[1],k=C[0],N=C[1];x===k||!["t","b"].includes(x)?S.top=y:x==="t"?S.top=0:S.bottom=0,O===N||!["l","r"].includes(O)?S.left=p:O==="l"?S.left=0:S.right=0}return z.createElement("div",{ref:b,className:Pa("".concat(t,"-arrow"),u),style:S},f)}function cZ(e){var t=e.prefixCls,n=e.open,r=e.zIndex,a=e.mask,s=e.motion;return a?z.createElement(cT,du({},s,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(u){var f=u.className;return z.createElement("div",{style:{zIndex:r},className:Pa("".concat(t,"-mask"),f)})}):null}var _L=z.memo(function(e){var t=e.children;return t},function(e,t){return t.cache});_L.displayName="PopupContent";var CL=z.forwardRef(function(e,t){var n=e.popup,r=e.className,a=e.prefixCls,s=e.style,u=e.target,f=e.onVisibleChanged,d=e.open,p=e.keepDom,m=e.fresh,y=e.onClick,b=e.mask,S=e.arrow,w=e.arrowPos,C=e.align,x=e.motion,O=e.maskMotion,k=e.forceRender,N=e.getPopupContainer,P=e.autoDestroy,T=e.portal,D=e.zIndex,M=e.onMouseEnter,U=e.onMouseLeave,H=e.onPointerEnter,B=e.onPointerDownCapture,G=e.ready,te=e.offsetX,K=e.offsetY,Q=e.offsetR,Y=e.offsetB,J=e.onAlign,ne=e.onPrepare,ee=e.stretch,de=e.targetWidth,Z=e.targetHeight,oe=typeof n=="function"?n():n,ge=d||p,Se=(N==null?void 0:N.length)>0,ve=z.useState(!N||!Se),Ne=ht(ve,2),ke=Ne[0],Fe=Ne[1];if(Ma(function(){!ke&&Se&&u&&Fe(!0)},[ke,Se,u]),!ke)return null;var Ye="auto",He={left:"-1000vw",top:"-1000vh",right:Ye,bottom:Ye};if(G||!d){var me,De=C.points,se=C.dynamicInset||((me=C._experimental)===null||me===void 0?void 0:me.dynamicInset),Be=se&&De[0][1]==="r",Te=se&&De[0][0]==="b";Be?(He.right=Q,He.left=Ye):(He.left=te,He.right=Ye),Te?(He.bottom=Y,He.top=Ye):(He.top=K,He.bottom=Ye)}var Ke={};return ee&&(ee.includes("height")&&Z?Ke.height=Z:ee.includes("minHeight")&&Z&&(Ke.minHeight=Z),ee.includes("width")&&de?Ke.width=de:ee.includes("minWidth")&&de&&(Ke.minWidth=de)),d||(Ke.pointerEvents="none"),z.createElement(T,{open:k||ge,getContainer:N&&function(){return N(u)},autoDestroy:P},z.createElement(cZ,{prefixCls:a,open:d,zIndex:D,mask:b,motion:O}),z.createElement(r0,{onResize:J,disabled:!d},function(pt){return z.createElement(cT,du({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:k,leavedClassName:"".concat(a,"-hidden")},x,{onAppearPrepare:ne,onEnterPrepare:ne,visible:d,onVisibleChanged:function(yn){var Rn;x==null||(Rn=x.onVisibleChanged)===null||Rn===void 0||Rn.call(x,yn),f(yn)}}),function(It,yn){var Rn=It.className,mn=It.style,mt=Pa(a,Rn,r);return z.createElement("div",{ref:sN(pt,t,yn),className:mt,style:$e($e($e($e({"--arrow-x":"".concat(w.x||0,"px"),"--arrow-y":"".concat(w.y||0,"px")},He),Ke),mn),{},{boxSizing:"border-box",zIndex:D},s),onMouseEnter:M,onMouseLeave:U,onPointerEnter:H,onClick:y,onPointerDownCapture:B},S&&z.createElement(lZ,{prefixCls:a,arrow:S,arrowPos:w,align:C}),z.createElement(_L,{cache:!d&&!m},oe))})}))});CL.displayName="Popup";var wL=z.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,a=J1(n),s=z.useCallback(function(f){Sx(t,r?r(f):f)},[r]),u=Ex(s,_x(n));return a?z.cloneElement(n,{ref:u}):n});wL.displayName="TriggerWrapper";var xL=z.createContext(null);function TL(e){return e?Array.isArray(e)?e:[e]:[]}function fZ(e,t,n,r){return z.useMemo(function(){var a=TL(n??t),s=TL(r??t),u=new Set(a),f=new Set(s);return e&&(u.has("hover")&&(u.delete("hover"),u.add("click")),f.has("hover")&&(f.delete("hover"),f.add("click"))),[u,f]},[e,t,n,r])}function dZ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function hZ(e,t,n,r){for(var a=n.points,s=Object.keys(e),u=0;u<s.length;u+=1){var f,d=s[u];if(dZ((f=e[d])===null||f===void 0?void 0:f.points,a,r))return"".concat(t,"-placement-").concat(d)}return""}function RL(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function km(e){return e.ownerDocument.defaultView}function PT(e){for(var t=[],n=e==null?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var a=km(n).getComputedStyle(n),s=a.overflowX,u=a.overflowY,f=a.overflow;[s,u,f].some(function(d){return r.includes(d)})&&t.push(n),n=n.parentElement}return t}function Am(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(e)?t:e}function Nm(e){return Am(parseFloat(e),0)}function OL(e,t){var n=$e({},e);return(t||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var a=km(r).getComputedStyle(r),s=a.overflow,u=a.overflowClipMargin,f=a.borderTopWidth,d=a.borderBottomWidth,p=a.borderLeftWidth,m=a.borderRightWidth,y=r.getBoundingClientRect(),b=r.offsetHeight,S=r.clientHeight,w=r.offsetWidth,C=r.clientWidth,x=Nm(f),O=Nm(d),k=Nm(p),N=Nm(m),P=Am(Math.round(y.width/w*1e3)/1e3),T=Am(Math.round(y.height/b*1e3)/1e3),D=(w-C-k-N)*P,M=(b-S-x-O)*T,U=x*T,H=O*T,B=k*P,G=N*P,te=0,K=0;if(s==="clip"){var Q=Nm(u);te=Q*P,K=Q*T}var Y=y.x+B-te,J=y.y+U-K,ne=Y+y.width+2*te-B-G-D,ee=J+y.height+2*K-U-H-M;n.left=Math.max(n.left,Y),n.top=Math.max(n.top,J),n.right=Math.min(n.right,ne),n.bottom=Math.min(n.bottom,ee)}}),n}function kL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?e*(parseFloat(r[1])/100):parseFloat(n)}function AL(e,t){var n=t||[],r=ht(n,2),a=r[0],s=r[1];return[kL(e.width,a),kL(e.height,s)]}function NL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[e[0],e[1]]}function Fh(e,t){var n=t[0],r=t[1],a,s;return n==="t"?s=e.y:n==="b"?s=e.y+e.height:s=e.y+e.height/2,r==="l"?a=e.x:r==="r"?a=e.x+e.width:a=e.x+e.width/2,{x:a,y:s}}function Bl(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(r,a){return a===t?n[r]||"c":r}).join("")}function pZ(e,t,n,r,a,s,u){var f=z.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:a[r]||{}}),d=ht(f,2),p=d[0],m=d[1],y=z.useRef(0),b=z.useMemo(function(){return t?PT(t):[]},[t]),S=z.useRef({}),w=function(){S.current={}};e||w();var C=Wo(function(){if(t&&n&&e){let ri=function(Yi,bi){var so=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nn,xr=ve.x+Yi,Yn=ve.y+bi,mu=xr+Be,ji=Yn+se,ii=Math.max(xr,so.left),nt=Math.max(Yn,so.top),wt=Math.min(mu,so.right),Xn=Math.min(ji,so.bottom);return Math.max(0,(wt-ii)*(Xn-nt))},Ur=function(){Ct=ve.y+$n,Ht=Ct+se,Pt=ve.x+Pn,pr=Pt+Be};var k,N,P,T,D=t,M=D.ownerDocument,U=km(D),H=U.getComputedStyle(D),B=H.width,G=H.height,te=H.position,K=D.style.left,Q=D.style.top,Y=D.style.right,J=D.style.bottom,ne=D.style.overflow,ee=$e($e({},a[r]),s),de=M.createElement("div");(k=D.parentElement)===null||k===void 0||k.appendChild(de),de.style.left="".concat(D.offsetLeft,"px"),de.style.top="".concat(D.offsetTop,"px"),de.style.position=te,de.style.height="".concat(D.offsetHeight,"px"),de.style.width="".concat(D.offsetWidth,"px"),D.style.left="0",D.style.top="0",D.style.right="auto",D.style.bottom="auto",D.style.overflow="hidden";var Z;if(Array.isArray(n))Z={x:n[0],y:n[1],width:0,height:0};else{var oe,ge,Se=n.getBoundingClientRect();Se.x=(oe=Se.x)!==null&&oe!==void 0?oe:Se.left,Se.y=(ge=Se.y)!==null&&ge!==void 0?ge:Se.top,Z={x:Se.x,y:Se.y,width:Se.width,height:Se.height}}var ve=D.getBoundingClientRect();ve.x=(N=ve.x)!==null&&N!==void 0?N:ve.left,ve.y=(P=ve.y)!==null&&P!==void 0?P:ve.top;var Ne=M.documentElement,ke=Ne.clientWidth,Fe=Ne.clientHeight,Ye=Ne.scrollWidth,He=Ne.scrollHeight,me=Ne.scrollTop,De=Ne.scrollLeft,se=ve.height,Be=ve.width,Te=Z.height,Ke=Z.width,pt={left:0,top:0,right:ke,bottom:Fe},It={left:-De,top:-me,right:Ye-De,bottom:He-me},yn=ee.htmlRegion,Rn="visible",mn="visibleFirst";yn!=="scroll"&&yn!==mn&&(yn=Rn);var mt=yn===mn,Ot=OL(It,b),Xe=OL(pt,b),Nn=yn===Rn?Xe:Ot,Bt=mt?Xe:Nn;D.style.left="auto",D.style.top="auto",D.style.right="0",D.style.bottom="0";var On=D.getBoundingClientRect();D.style.left=K,D.style.top=Q,D.style.right=Y,D.style.bottom=J,D.style.overflow=ne,(T=D.parentElement)===null||T===void 0||T.removeChild(de);var hr=Am(Math.round(Be/parseFloat(B)*1e3)/1e3),ur=Am(Math.round(se/parseFloat(G)*1e3)/1e3);if(hr===0||ur===0||fm(n)&&!$X(n))return;var Lt=ee.offset,Qe=ee.targetOffset,Ze=AL(ve,Lt),lt=ht(Ze,2),At=lt[0],an=lt[1],er=AL(Z,Qe),Dn=ht(er,2),Bn=Dn[0],Ln=Dn[1];Z.x-=Bn,Z.y-=Ln;var Qn=ee.points||[],Wn=ht(Qn,2),Fa=Wn[0],Li=Wn[1],Pr=NL(Li),Mr=NL(Fa),ro=Fh(Z,Pr),Fr=Fh(ve,Mr),mi=$e({},ee),Pn=ro.x-Fr.x+At,$n=ro.y-Fr.y+an,Or=ri(Pn,$n),kr=ri(Pn,$n,Xe),ti=Fh(Z,["t","l"]),Sr=Fh(ve,["t","l"]),io=Fh(Z,["b","r"]),ja=Fh(ve,["b","r"]),Pi=ee.overflow||{},ae=Pi.adjustX,ze=Pi.adjustY,Je=Pi.shiftX,it=Pi.shiftY,Yt=function(bi){return typeof bi=="boolean"?bi:bi>=0},Ct,Ht,Pt,pr;Ur();var Mn=Yt(ze),tr=Mr[0]===Pr[0];if(Mn&&Mr[0]==="t"&&(Ht>Bt.bottom||S.current.bt)){var kn=$n;tr?kn-=se-Te:kn=ti.y-ja.y-an;var ni=ri(Pn,kn),Gi=ri(Pn,kn,Xe);ni>Or||ni===Or&&(!mt||Gi>=kr)?(S.current.bt=!0,$n=kn,an=-an,mi.points=[Bl(Mr,0),Bl(Pr,0)]):S.current.bt=!1}if(Mn&&Mr[0]==="b"&&(Ct<Bt.top||S.current.tb)){var bn=$n;tr?bn+=se-Te:bn=io.y-Sr.y-an;var zt=ri(Pn,bn),Ia=ri(Pn,bn,Xe);zt>Or||zt===Or&&(!mt||Ia>=kr)?(S.current.tb=!0,$n=bn,an=-an,mi.points=[Bl(Mr,0),Bl(Pr,0)]):S.current.tb=!1}var xo=Yt(ae),Yo=Mr[1]===Pr[1];if(xo&&Mr[1]==="l"&&(pr>Bt.right||S.current.rl)){var gi=Pn;Yo?gi-=Be-Ke:gi=ti.x-ja.x-At;var To=ri(gi,$n),ao=ri(gi,$n,Xe);To>Or||To===Or&&(!mt||ao>=kr)?(S.current.rl=!0,Pn=gi,At=-At,mi.points=[Bl(Mr,1),Bl(Pr,1)]):S.current.rl=!1}if(xo&&Mr[1]==="r"&&(Pt<Bt.left||S.current.lr)){var Qi=Pn;Yo?Qi+=Be-Ke:Qi=io.x-Sr.x-At;var Xo=ri(Qi,$n),Ko=ri(Qi,$n,Xe);Xo>Or||Xo===Or&&(!mt||Ko>=kr)?(S.current.lr=!0,Pn=Qi,At=-At,mi.points=[Bl(Mr,1),Bl(Pr,1)]):S.current.lr=!1}Ur();var Mi=Je===!0?0:Je;typeof Mi=="number"&&(Pt<Xe.left&&(Pn-=Pt-Xe.left-At,Z.x+Ke<Xe.left+Mi&&(Pn+=Z.x-Xe.left+Ke-Mi)),pr>Xe.right&&(Pn-=pr-Xe.right-At,Z.x>Xe.right-Mi&&(Pn+=Z.x-Xe.right+Mi)));var yi=it===!0?0:it;typeof yi=="number"&&(Ct<Xe.top&&($n-=Ct-Xe.top-an,Z.y+Te<Xe.top+yi&&($n+=Z.y-Xe.top+Te-yi)),Ht>Xe.bottom&&($n-=Ht-Xe.bottom-an,Z.y>Xe.bottom-yi&&($n+=Z.y-Xe.bottom+yi)));var ya=ve.x+Pn,ba=ya+Be,$r=ve.y+$n,oo=$r+se,Fi=Z.x,Ro=Fi+Ke,$a=Z.y,Oo=$a+Te,Zo=Math.max(ya,Fi),Jo=Math.min(ba,Ro),es=(Zo+Jo)/2,vu=es-ya,Ua=Math.max($r,$a),ko=Math.min(oo,Oo),Sa=(Ua+ko)/2,un=Sa-$r;u==null||u(t,mi);var ts=On.right-ve.x-(Pn+ve.width),qr=On.bottom-ve.y-($n+ve.height);hr===1&&(Pn=Math.round(Pn),ts=Math.round(ts)),ur===1&&($n=Math.round($n),qr=Math.round(qr));var Nt={ready:!0,offsetX:Pn/hr,offsetY:$n/ur,offsetR:ts/hr,offsetB:qr/ur,arrowX:vu/hr,arrowY:un/ur,scaleX:hr,scaleY:ur,align:mi};m(Nt)}}),x=function(){y.current+=1;var N=y.current;Promise.resolve().then(function(){y.current===N&&C()})},O=function(){m(function(N){return $e($e({},N),{},{ready:!1})})};return Ma(O,[r]),Ma(function(){e||O()},[e]),[p.ready,p.offsetX,p.offsetY,p.offsetR,p.offsetB,p.arrowX,p.arrowY,p.scaleX,p.scaleY,p.align,x]}function vZ(e,t,n,r,a){Ma(function(){if(e&&t&&n){let y=function(){r(),a()};var s=t,u=n,f=PT(s),d=PT(u),p=km(u),m=new Set([p].concat(Ft(f),Ft(d)));return m.forEach(function(b){b.addEventListener("scroll",y,{passive:!0})}),p.addEventListener("resize",y,{passive:!0}),r(),function(){m.forEach(function(b){b.removeEventListener("scroll",y),p.removeEventListener("resize",y)})}}},[e,t,n])}function mZ(e,t,n,r,a,s,u,f){var d=z.useRef(e);d.current=e;var p=z.useRef(!1);z.useEffect(function(){if(t&&r&&(!a||s)){var y=function(){p.current=!1},b=function(P){var T;d.current&&!u(((T=P.composedPath)===null||T===void 0||(T=T.call(P))===null||T===void 0?void 0:T[0])||P.target)&&!p.current&&f(!1)},S=km(r);S.addEventListener("pointerdown",y,!0),S.addEventListener("mousedown",b,!0),S.addEventListener("contextmenu",b,!0);var w=mT(n);w&&(w.addEventListener("mousedown",b,!0),w.addEventListener("contextmenu",b,!0));{var C,x,O=n==null||(C=n.getRootNode)===null||C===void 0?void 0:C.call(n),k=(x=r.getRootNode)===null||x===void 0?void 0:x.call(r);_h(O===k,"trigger element and popup element should in same shadow root.")}return function(){S.removeEventListener("pointerdown",y,!0),S.removeEventListener("mousedown",b,!0),S.removeEventListener("contextmenu",b,!0),w&&(w.removeEventListener("mousedown",b,!0),w.removeEventListener("contextmenu",b,!0))}}},[t,n,r,a,s]);function m(){p.current=!0}return m}var gZ=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function yZ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yT,t=z.forwardRef(function(n,r){var a=n.prefixCls,s=a===void 0?"rc-trigger-popup":a,u=n.children,f=n.action,d=f===void 0?"hover":f,p=n.showAction,m=n.hideAction,y=n.popupVisible,b=n.defaultPopupVisible,S=n.onPopupVisibleChange,w=n.afterPopupVisibleChange,C=n.mouseEnterDelay,x=n.mouseLeaveDelay,O=x===void 0?.1:x,k=n.focusDelay,N=n.blurDelay,P=n.mask,T=n.maskClosable,D=T===void 0?!0:T,M=n.getPopupContainer,U=n.forceRender,H=n.autoDestroy,B=n.destroyPopupOnHide,G=n.popup,te=n.popupClassName,K=n.popupStyle,Q=n.popupPlacement,Y=n.builtinPlacements,J=Y===void 0?{}:Y,ne=n.popupAlign,ee=n.zIndex,de=n.stretch,Z=n.getPopupClassNameFromAlign,oe=n.fresh,ge=n.alignPoint,Se=n.onPopupClick,ve=n.onPopupAlign,Ne=n.arrow,ke=n.popupMotion,Fe=n.maskMotion,Ye=n.popupTransitionName,He=n.popupAnimation,me=n.maskTransitionName,De=n.maskAnimation,se=n.className,Be=n.getTriggerDOMNode,Te=df(n,gZ),Ke=H||B||!1,pt=z.useState(!1),It=ht(pt,2),yn=It[0],Rn=It[1];Ma(function(){Rn(uZ())},[]);var mn=z.useRef({}),mt=z.useContext(xL),Ot=z.useMemo(function(){return{registerSubPopup:function(wt,Xn){mn.current[wt]=Xn,mt==null||mt.registerSubPopup(wt,Xn)}}},[mt]),Xe=rL(),Nn=z.useState(null),Bt=ht(Nn,2),On=Bt[0],hr=Bt[1],ur=z.useRef(null),Lt=Wo(function(nt){ur.current=nt,fm(nt)&&On!==nt&&hr(nt),mt==null||mt.registerSubPopup(Xe,nt)}),Qe=z.useState(null),Ze=ht(Qe,2),lt=Ze[0],At=Ze[1],an=z.useRef(null),er=Wo(function(nt){fm(nt)&<!==nt&&(At(nt),an.current=nt)}),Dn=z.Children.only(u),Bn=(Dn==null?void 0:Dn.props)||{},Ln={},Qn=Wo(function(nt){var wt,Xn,Tr=lt;return(Tr==null?void 0:Tr.contains(nt))||((wt=mT(Tr))===null||wt===void 0?void 0:wt.host)===nt||nt===Tr||(On==null?void 0:On.contains(nt))||((Xn=mT(On))===null||Xn===void 0?void 0:Xn.host)===nt||nt===On||Object.values(mn.current).some(function(lr){return(lr==null?void 0:lr.contains(nt))||nt===lr})}),Wn=RL(s,ke,He,Ye),Fa=RL(s,Fe,De,me),Li=z.useState(b||!1),Pr=ht(Li,2),Mr=Pr[0],ro=Pr[1],Fr=y??Mr,mi=Wo(function(nt){y===void 0&&ro(nt)});Ma(function(){ro(y||!1)},[y]);var Pn=z.useRef(Fr);Pn.current=Fr;var $n=z.useRef([]);$n.current=[];var Or=Wo(function(nt){var wt;mi(nt),((wt=$n.current[$n.current.length-1])!==null&&wt!==void 0?wt:Fr)!==nt&&($n.current.push(nt),S==null||S(nt))}),kr=z.useRef(),ti=function(){clearTimeout(kr.current)},Sr=function(wt){var Xn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ti(),Xn===0?Or(wt):kr.current=setTimeout(function(){Or(wt)},Xn*1e3)};z.useEffect(function(){return ti},[]);var io=z.useState(!1),ja=ht(io,2),Pi=ja[0],ae=ja[1];Ma(function(nt){(!nt||Fr)&&ae(!0)},[Fr]);var ze=z.useState(null),Je=ht(ze,2),it=Je[0],Yt=Je[1],Ct=z.useState(null),Ht=ht(Ct,2),Pt=Ht[0],pr=Ht[1],Mn=function(wt){pr([wt.clientX,wt.clientY])},tr=pZ(Fr,On,ge&&Pt!==null?Pt:lt,Q,J,ne,ve),kn=ht(tr,11),ni=kn[0],Gi=kn[1],bn=kn[2],zt=kn[3],Ia=kn[4],xo=kn[5],Yo=kn[6],gi=kn[7],To=kn[8],ao=kn[9],Qi=kn[10],Xo=fZ(yn,d,p,m),Ko=ht(Xo,2),Mi=Ko[0],yi=Ko[1],ya=Mi.has("click"),ba=yi.has("click")||yi.has("contextMenu"),$r=Wo(function(){Pi||Qi()}),oo=function(){Pn.current&&ge&&ba&&Sr(!1)};vZ(Fr,lt,On,$r,oo),Ma(function(){$r()},[Pt,Q]),Ma(function(){Fr&&!(J!=null&&J[Q])&&$r()},[JSON.stringify(ne)]);var Fi=z.useMemo(function(){var nt=hZ(J,s,ao,ge);return Pa(nt,Z==null?void 0:Z(ao))},[ao,Z,J,s,ge]);z.useImperativeHandle(r,function(){return{nativeElement:an.current,popupElement:ur.current,forceAlign:$r}});var Ro=z.useState(0),$a=ht(Ro,2),Oo=$a[0],Zo=$a[1],Jo=z.useState(0),es=ht(Jo,2),vu=es[0],Ua=es[1],ko=function(){if(de&<){var wt=lt.getBoundingClientRect();Zo(wt.width),Ua(wt.height)}},Sa=function(){ko(),$r()},un=function(wt){ae(!1),Qi(),w==null||w(wt)},ts=function(){return new Promise(function(wt){ko(),Yt(function(){return wt})})};Ma(function(){it&&(Qi(),it(),Yt(null))},[it]);function qr(nt,wt,Xn,Tr){Ln[nt]=function(lr){var Ao;Tr==null||Tr(lr),Sr(wt,Xn);for(var Bu=arguments.length,Sn=new Array(Bu>1?Bu-1:0),hn=1;hn<Bu;hn++)Sn[hn-1]=arguments[hn];(Ao=Bn[nt])===null||Ao===void 0||Ao.call.apply(Ao,[Bn,lr].concat(Sn))}}(ya||ba)&&(Ln.onClick=function(nt){var wt;Pn.current&&ba?Sr(!1):!Pn.current&&ya&&(Mn(nt),Sr(!0));for(var Xn=arguments.length,Tr=new Array(Xn>1?Xn-1:0),lr=1;lr<Xn;lr++)Tr[lr-1]=arguments[lr];(wt=Bn.onClick)===null||wt===void 0||wt.call.apply(wt,[Bn,nt].concat(Tr))});var Nt=mZ(Fr,ba,lt,On,P,D,Qn,Sr),ri=Mi.has("hover"),Ur=yi.has("hover"),Yi,bi;ri&&(qr("onMouseEnter",!0,C,function(nt){Mn(nt)}),qr("onPointerEnter",!0,C,function(nt){Mn(nt)}),Yi=function(wt){(Fr||Pi)&&On!==null&&On!==void 0&&On.contains(wt.target)&&Sr(!0,C)},ge&&(Ln.onMouseMove=function(nt){var wt;(wt=Bn.onMouseMove)===null||wt===void 0||wt.call(Bn,nt)})),Ur&&(qr("onMouseLeave",!1,O),qr("onPointerLeave",!1,O),bi=function(){Sr(!1,O)}),Mi.has("focus")&&qr("onFocus",!0,k),yi.has("focus")&&qr("onBlur",!1,N),Mi.has("contextMenu")&&(Ln.onContextMenu=function(nt){var wt;Pn.current&&yi.has("contextMenu")?Sr(!1):(Mn(nt),Sr(!0)),nt.preventDefault();for(var Xn=arguments.length,Tr=new Array(Xn>1?Xn-1:0),lr=1;lr<Xn;lr++)Tr[lr-1]=arguments[lr];(wt=Bn.onContextMenu)===null||wt===void 0||wt.call.apply(wt,[Bn,nt].concat(Tr))}),se&&(Ln.className=Pa(Bn.className,se));var so=$e($e({},Bn),Ln),xr={},Yn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Yn.forEach(function(nt){Te[nt]&&(xr[nt]=function(){for(var wt,Xn=arguments.length,Tr=new Array(Xn),lr=0;lr<Xn;lr++)Tr[lr]=arguments[lr];(wt=so[nt])===null||wt===void 0||wt.call.apply(wt,[so].concat(Tr)),Te[nt].apply(Te,Tr)})});var mu=z.cloneElement(Dn,$e($e({},so),xr)),ji={x:xo,y:Yo},ii=Ne?$e({},Ne!==!0?Ne:{}):null;return z.createElement(z.Fragment,null,z.createElement(r0,{disabled:!Fr,ref:er,onResize:Sa},z.createElement(wL,{getTriggerDOMNode:Be},mu)),z.createElement(xL.Provider,{value:Ot},z.createElement(CL,{portal:e,ref:Lt,prefixCls:s,popup:G,className:Pa(te,Fi),style:K,target:lt,onMouseEnter:Yi,onMouseLeave:bi,onPointerEnter:Yi,zIndex:ee,open:Fr,keepDom:Pi,fresh:oe,onClick:Se,onPointerDownCapture:Nt,mask:P,motion:Wn,maskMotion:Fa,onVisibleChanged:un,onPrepare:ts,forceRender:U,autoDestroy:Ke,getPopupContainer:M,align:ao,arrow:ii,arrowPos:ji,ready:ni,offsetX:Gi,offsetY:bn,offsetR:zt,offsetB:Ia,onAlign:$r,stretch:de,targetWidth:Oo/gi,targetHeight:vu/To})))});return t.displayName="Trigger",t}const bZ=yZ(yT);function DL(e){var t=e.children,n=e.prefixCls,r=e.id,a=e.overlayInnerStyle,s=e.bodyClassName,u=e.className,f=e.style;return z.createElement("div",{className:Pa("".concat(n,"-content"),u),style:f},z.createElement("div",{className:Pa("".concat(n,"-inner"),s),id:r,role:"tooltip",style:a},typeof t=="function"?t():t))}var jh={shiftX:64,adjustY:1},Ih={adjustX:1,shiftY:!0},Qo=[0,0],SZ={left:{points:["cr","cl"],overflow:Ih,offset:[-4,0],targetOffset:Qo},right:{points:["cl","cr"],overflow:Ih,offset:[4,0],targetOffset:Qo},top:{points:["bc","tc"],overflow:jh,offset:[0,-4],targetOffset:Qo},bottom:{points:["tc","bc"],overflow:jh,offset:[0,4],targetOffset:Qo},topLeft:{points:["bl","tl"],overflow:jh,offset:[0,-4],targetOffset:Qo},leftTop:{points:["tr","tl"],overflow:Ih,offset:[-4,0],targetOffset:Qo},topRight:{points:["br","tr"],overflow:jh,offset:[0,-4],targetOffset:Qo},rightTop:{points:["tl","tr"],overflow:Ih,offset:[4,0],targetOffset:Qo},bottomRight:{points:["tr","br"],overflow:jh,offset:[0,4],targetOffset:Qo},rightBottom:{points:["bl","br"],overflow:Ih,offset:[4,0],targetOffset:Qo},bottomLeft:{points:["tl","bl"],overflow:jh,offset:[0,4],targetOffset:Qo},leftBottom:{points:["br","bl"],overflow:Ih,offset:[-4,0],targetOffset:Qo}},EZ=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],_Z=function(t,n){var r=t.overlayClassName,a=t.trigger,s=a===void 0?["hover"]:a,u=t.mouseEnterDelay,f=u===void 0?0:u,d=t.mouseLeaveDelay,p=d===void 0?.1:d,m=t.overlayStyle,y=t.prefixCls,b=y===void 0?"rc-tooltip":y,S=t.children,w=t.onVisibleChange,C=t.afterVisibleChange,x=t.transitionName,O=t.animation,k=t.motion,N=t.placement,P=N===void 0?"right":N,T=t.align,D=T===void 0?{}:T,M=t.destroyTooltipOnHide,U=M===void 0?!1:M,H=t.defaultVisible,B=t.getTooltipContainer,G=t.overlayInnerStyle;t.arrowContent;var te=t.overlay,K=t.id,Q=t.showArrow,Y=Q===void 0?!0:Q,J=t.classNames,ne=t.styles,ee=df(t,EZ),de=rL(K),Z=z.useRef(null);z.useImperativeHandle(n,function(){return Z.current});var oe=$e({},ee);"visible"in t&&(oe.popupVisible=t.visible);var ge=function(){return z.createElement(DL,{key:"content",prefixCls:b,id:de,bodyClassName:J==null?void 0:J.body,overlayInnerStyle:$e($e({},G),ne==null?void 0:ne.body)},te)},Se=function(){var Ne=z.Children.only(S),ke=(Ne==null?void 0:Ne.props)||{},Fe=$e($e({},ke),{},{"aria-describedby":te?de:null});return z.cloneElement(S,Fe)};return z.createElement(bZ,du({popupClassName:Pa(r,J==null?void 0:J.root),prefixCls:b,popup:ge,action:s,builtinPlacements:SZ,popupPlacement:P,ref:Z,popupAlign:D,getPopupContainer:B,onPopupVisibleChange:w,afterPopupVisibleChange:C,popupTransitionName:x,popupAnimation:O,popupMotion:k,defaultPopupVisible:H,autoDestroy:U,mouseLeaveDelay:p,popupStyle:$e($e({},m),ne==null?void 0:ne.root),mouseEnterDelay:f,arrow:Y},oe),Se())};const CZ=z.forwardRef(_Z);function wZ(e){const{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,a=t/2,s=0,u=a,f=r*1/Math.sqrt(2),d=a-r*(1-1/Math.sqrt(2)),p=a-n*(1/Math.sqrt(2)),m=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),y=2*a-p,b=m,S=2*a-f,w=d,C=2*a-s,x=u,O=a*Math.sqrt(2)+r*(Math.sqrt(2)-2),k=r*(Math.sqrt(2)-1),N=`polygon(${k}px 100%, 50% ${k}px, ${2*a-k}px 100%, ${k}px 100%)`,P=`path('M ${s} ${u} A ${r} ${r} 0 0 0 ${f} ${d} L ${p} ${m} A ${n} ${n} 0 0 1 ${y} ${b} L ${S} ${w} A ${r} ${r} 0 0 0 ${C} ${x} Z')`;return{arrowShadowWidth:O,arrowPath:P,arrowPolygon:N}}const xZ=(e,t,n)=>{const{sizePopupArrow:r,arrowPolygon:a,arrowPath:s,arrowShadowWidth:u,borderRadiusXS:f,calc:d}=e;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:d(r).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[a,s]},content:'""'},"&::after":{content:'""',position:"absolute",width:u,height:u,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${hf(f)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},LL=8;function PL(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?LL:r}}function k0(e,t){return e?t:{}}function TZ(e,t,n){const{componentCls:r,boxShadowPopoverArrow:a,arrowOffsetVertical:s,arrowOffsetHorizontal:u}=e,{arrowDistance:f=0,arrowPlacement:d={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},xZ(e,t,a)),{"&:before":{background:t}})]},k0(!!d.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:f,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":u,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:u}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${hf(u)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:u}}}})),k0(!!d.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:f,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":u,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:u}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${hf(u)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:u}}}})),k0(!!d.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:f},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:s},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:s}})),k0(!!d.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:f},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:s},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:s}}))}}function RZ(e,t,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const a=r&&typeof r=="object"?r:{},s={};switch(e){case"top":case"bottom":s.shiftX=t.arrowOffsetHorizontal*2+n,s.shiftY=!0,s.adjustY=!0;break;case"left":case"right":s.shiftY=t.arrowOffsetVertical*2+n,s.shiftX=!0,s.adjustX=!0;break}const u=Object.assign(Object.assign({},s),a);return u.shiftX||(u.adjustX=!0),u.shiftY||(u.adjustY=!0),u}const ML={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},OZ={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},kZ=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function AZ(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:a,borderRadius:s}=e,u=t/2,f={};return Object.keys(ML).forEach(d=>{const p=r&&OZ[d]||ML[d],m=Object.assign(Object.assign({},p),{offset:[0,0],dynamicInset:!0});switch(f[d]=m,kZ.has(d)&&(m.autoArrow=!1),d){case"top":case"topLeft":case"topRight":m.offset[1]=-u-a;break;case"bottom":case"bottomLeft":case"bottomRight":m.offset[1]=u+a;break;case"left":case"leftTop":case"leftBottom":m.offset[0]=-u-a;break;case"right":case"rightTop":case"rightBottom":m.offset[0]=u+a;break}const y=PL({contentRadius:s,limitVerticalRadius:!0});if(r)switch(d){case"topLeft":case"bottomLeft":m.offset[0]=-y.arrowOffsetHorizontal-u;break;case"topRight":case"bottomRight":m.offset[0]=y.arrowOffsetHorizontal+u;break;case"leftTop":case"rightTop":m.offset[1]=-y.arrowOffsetHorizontal*2+u;break;case"leftBottom":case"rightBottom":m.offset[1]=y.arrowOffsetHorizontal*2-u;break}m.overflow=RZ(d,y,t,n),m.htmlRegion="visibleFirst"}),f}const NZ=e=>{const{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:a,tooltipBg:s,tooltipBorderRadius:u,zIndexPopup:f,controlHeight:d,boxShadowSecondary:p,paddingSM:m,paddingXS:y,arrowOffsetHorizontal:b,sizePopupArrow:S}=e,w=t(u).add(S).add(b).equal(),C=t(u).mul(2).add(S).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},rX(e)),{position:"absolute",zIndex:f,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":s,[`${n}-inner`]:{minWidth:C,minHeight:d,padding:`${hf(e.calc(m).div(2).equal())} ${hf(y)}`,color:a,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:s,borderRadius:u,boxShadow:p,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:w},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:e.min(u,LL)}},[`${n}-content`]:{position:"relative"}}),lX(e,(x,{darkColor:O})=>({[`&${n}-${x}`]:{[`${n}-inner`]:{backgroundColor:O},[`${n}-arrow`]:{"--antd-arrow-background-color":O}}}))),{"&-rtl":{direction:"rtl"}})},TZ(e,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},DZ=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},PL({contentRadius:e.borderRadius,limitVerticalRadius:!0})),wZ(S0(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)}))),FL=(e,t=!0)=>uX("Tooltip",r=>{const{borderRadius:a,colorTextLightSolid:s,colorBgSpotlight:u}=r,f=S0(r,{tooltipMaxWidth:250,tooltipColor:s,tooltipBorderRadius:a,tooltipBg:u});return[NZ(f),nK(r,"zoom-big-fast")]},DZ,{resetStyle:!1,injectStyle:t})(e),LZ=E0.map(e=>`${e}-inverse`);function PZ(e,t=!0){return t?[].concat(Ft(LZ),Ft(E0)).includes(e):E0.includes(e)}function jL(e,t){const n=PZ(t),r=Pa({[`${e}-${t}`]:t&&n}),a={},s={};return t&&!n&&(a.background=t,s["--antd-arrow-background-color"]=t),{className:r,overlayStyle:a,arrowStyle:s}}const MZ=e=>{const{prefixCls:t,className:n,placement:r="top",title:a,color:s,overlayInnerStyle:u}=e,{getPrefixCls:f}=z.useContext(_m),d=f("tooltip",t),[p,m,y]=FL(d),b=jL(d,s),S=b.arrowStyle,w=Object.assign(Object.assign({},u),b.overlayStyle),C=Pa(m,y,d,`${d}-pure`,`${d}-placement-${r}`,n,b.className);return p(z.createElement("div",{className:C,style:S},z.createElement("div",{className:`${d}-arrow`}),z.createElement(DL,Object.assign({},e,{className:m,prefixCls:d,overlayInnerStyle:w}),a)))};var FZ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};const MT=z.forwardRef((e,t)=>{var n,r;const{prefixCls:a,openClassName:s,getTooltipContainer:u,color:f,overlayInnerStyle:d,children:p,afterOpenChange:m,afterVisibleChange:y,destroyTooltipOnHide:b,destroyOnHidden:S,arrow:w=!0,title:C,overlay:x,builtinPlacements:O,arrowPointAtCenter:k=!1,autoAdjustOverflow:N=!0,motion:P,getPopupContainer:T,placement:D="top",mouseEnterDelay:M=.1,mouseLeaveDelay:U=.1,overlayStyle:H,rootClassName:B,overlayClassName:G,styles:te,classNames:K}=e,Q=FZ(e,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","destroyOnHidden","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),Y=!!w,[,J]=uT(),{getPopupContainer:ne,getPrefixCls:ee,direction:de,className:Z,style:oe,classNames:ge,styles:Se}=$Y("tooltip"),ve=uD("Tooltip"),Ne=z.useRef(null),ke=()=>{var Ze;(Ze=Ne.current)===null||Ze===void 0||Ze.forceAlign()};z.useImperativeHandle(t,()=>{var Ze,lt;return{forceAlign:ke,forcePopupAlign:()=>{ve.deprecated(!1,"forcePopupAlign","forceAlign"),ke()},nativeElement:(Ze=Ne.current)===null||Ze===void 0?void 0:Ze.nativeElement,popupElement:(lt=Ne.current)===null||lt===void 0?void 0:lt.popupElement}}),[["visible","open"],["defaultVisible","defaultOpen"],["onVisibleChange","onOpenChange"],["afterVisibleChange","afterOpenChange"],["destroyTooltipOnHide","destroyOnHidden"],["arrowPointAtCenter","arrow={{ pointAtCenter: true }}"],["overlayStyle","styles={{ root: {} }}"],["overlayInnerStyle","styles={{ body: {} }}"],["overlayClassName",'classNames={{ root: "" }}']].forEach(([Ze,lt])=>{ve.deprecated(!(Ze in e),Ze,lt)}),ve(!b||typeof b=="boolean","usage","`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly."),ve(!w||typeof w=="boolean"||!("arrowPointAtCenter"in w),"deprecated","`arrowPointAtCenter` in `arrow` is deprecated. Please use `pointAtCenter` instead.");const[Fe,Ye]=qY(!1,{value:(n=e.open)!==null&&n!==void 0?n:e.visible,defaultValue:(r=e.defaultOpen)!==null&&r!==void 0?r:e.defaultVisible}),He=!C&&!x&&C!==0,me=Ze=>{var lt,At;Ye(He?!1:Ze),He||((lt=e.onOpenChange)===null||lt===void 0||lt.call(e,Ze),(At=e.onVisibleChange)===null||At===void 0||At.call(e,Ze))},De=z.useMemo(()=>{var Ze,lt;let At=k;return typeof w=="object"&&(At=(lt=(Ze=w.pointAtCenter)!==null&&Ze!==void 0?Ze:w.arrowPointAtCenter)!==null&<!==void 0?lt:k),O||AZ({arrowPointAtCenter:At,autoAdjustOverflow:N,arrowWidth:Y?J.sizePopupArrow:0,borderRadius:J.borderRadius,offset:J.marginXXS})},[k,w,O,J]),se=z.useMemo(()=>C===0?C:x||C||"",[x,C]),Be=z.createElement(sZ,{space:!0},typeof se=="function"?se():se),Te=ee("tooltip",a),Ke=ee(),pt=e["data-popover-inject"];let It=Fe;!("open"in e)&&!("visible"in e)&&He&&(It=!1);const yn=z.isValidElement(p)&&!NX(p)?p:z.createElement("span",null,p),Rn=yn.props,mn=!Rn.className||typeof Rn.className=="string"?Pa(Rn.className,s||`${Te}-open`):Rn.className,[mt,Ot,Xe]=FL(Te,!pt),Nn=jL(Te,f),Bt=Nn.arrowStyle,On=Pa(G,{[`${Te}-rtl`]:de==="rtl"},Nn.className,B,Ot,Xe,Z,ge.root,K==null?void 0:K.root),hr=Pa(ge.body,K==null?void 0:K.body),[ur,Lt]=jX("Tooltip",Q.zIndex),Qe=z.createElement(CZ,Object.assign({},Q,{zIndex:ur,showArrow:Y,placement:D,mouseEnterDelay:M,mouseLeaveDelay:U,prefixCls:Te,classNames:{root:On,body:hr},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Bt),Se.root),oe),H),te==null?void 0:te.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},Se.body),d),te==null?void 0:te.body),Nn.overlayStyle)},getTooltipContainer:T||u||ne,ref:Ne,builtinPlacements:De,overlay:Be,visible:It,onVisibleChange:me,afterVisibleChange:m??y,arrowContent:z.createElement("span",{className:`${Te}-arrow-content`}),motion:{motionName:IX(Ke,"zoom-big-fast",e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:S??!!b}),It?LX(yn,{className:mn}):yn);return mt(z.createElement(gT.Provider,{value:Lt},Qe))});MT.displayName="Tooltip",MT._InternalPanelDoNotUseOrYouWillBeFired=MZ;const jZ=async(e,t)=>{const{policy:n,file:r}=e||{};return(await nx(n,r)).success?{name:e==null?void 0:e.name,title:r==null?void 0:r.name,size:r==null?void 0:r.size,sub_type:t,type:"conversation_activity_attachment"}:{}},IZ=async(e,t)=>{var r;const n=[];try{const a=[];for(let s=0;s<e.length;s+=1)(r=e[s])!=null&&r.id||a.push(jZ(e[s],t));n.push(...await Promise.all(a))}catch(a){console.error("Error occurred during file upload:",a),Zr("error","File upload fails","top-left")}return n},$Z=["image/jpeg","image/png","application/pdf"],UZ=({conversationId:e,handleCreateMessage:t})=>{const n=z.useRef(null),r=z.useRef(null),a=z.useRef(null),[s,u]=z.useState(""),[f,d]=z.useState([]),[p,m]=z.useState(!1),{handleCreateOrUpdateRealtimeStatus:y}=G7(),b=async T=>{var G;const D=T==null?void 0:T.name,M=(G=D==null?void 0:D.split)==null?void 0:G.call(D,"."),U=Jt.last(M),H=`${Vw()}.${U}`,B=await tx({name:H,sub_type:e,type:"conversation_activity_attachment"});return B!=null&&B.url?{name:H,file:T,title:D,policy:B}:(Zr("error",`${D} cannot be uploaded`,"top-left"),null)},S=async T=>{T.preventDefault();const D=5*1024*1024,M=Array.from(T.target.files);let U="";if(Jt.forEach(M,H=>{if(!$Z.includes(H.type)){U=`${H.name} is not supported. `;return}if(H.size>D){U="Each file must be under 5MB";return}}),U){Zr("error",U,"top-left");return}try{const H=[];for(let G=0;G<M.length;G+=1)H.push(b(M[G]));const B=await Promise.all(H);d(G=>[...G,...B.filter(te=>te!==null)])}catch(H){console.error("Error occurred while fetching policies:",H)}a.current.value=null},w=T=>{d(D=>D.filter((M,U)=>U!==T)),a.current&&(a.current.value="")};z.useEffect(()=>{const T=n.current,D=r.current;if(T&&D){T.style.height="auto";const U=D.offsetWidth*.5,H=Math.min(T.scrollHeight,U);T.style.height=`${H}px`,D.style.height=`${H+16}px`,T.style.overflowY=T.scrollHeight>U?"auto":"hidden"}},[s,f]);const C=f.slice(0,5),x=Math.max(0,f.length-5),O=async T=>{if(T&&T.preventDefault(),!(!s&&!f.length)){m(!0);try{const D=Jt.size(f)&&await IZ(f,e);await t({message:s,is_customer_reply:!0,...D&&{files:D}}),u(""),d([])}catch(D){console.error("Error sending message:",D)}finally{m(!1)}}},k=z.useMemo(()=>!jV(s)&&!Jt.size(f),[s,f]),N=async T=>{T?await y({conversation_id:e,is_writing_reply:!0}):await y({conversation_id:e,is_writing_reply:!1})},P=T=>{T.key==="Enter"&&!T.shiftKey&&!p&&(T.preventDefault(),O(T))};return F.jsxs(F.Fragment,{children:[f.length>0&&F.jsxs("div",{className:"ed-flex ed-flex-wrap ed-items-center ed-gap-2 ed-mb-2",children:[C.map((T,D)=>F.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2 ed-text-12 ed-font-medium ed-text-border-regular ed-bg-white-light ed-p-1.5 ed-rounded-full",children:[F.jsx("span",{className:"ed-truncate ed-max-w-[100px]",children:T.name}),F.jsx("button",{type:"button",onClick:()=>w(D),className:"ed-text-border hover:ed-text-border-dark ed-flex-shrink-0",children:F.jsx(cu,{size:14})})]},T)),x>0&&F.jsxs("span",{className:"ed-text-12 ed-text-border-regular",children:["+",x," ",x===1?"item":"items"]})]}),F.jsxs("div",{ref:r,className:"ed-border ed-border-border-light ed-rounded-3xl ed-flex ed-justify-between ed-transition-all ed-duration-200",style:{padding:"8px 16px"},children:[F.jsx("div",{className:"ed-flex-1 ed-flex ed-flex-col ed-min-w-0",children:F.jsx("textarea",{ref:n,value:s,onBlur:()=>N(!1),onChange:T=>u(T.target.value),onFocus:()=>N(!0),onKeyDown:T=>P(T),rows:1,className:"ed-w-full ed-text-14 ed-min-h-[24px] ed-resize-none ed-overflow-x-auto ed-outline-none ed-bg-transparent no-scrollbar",placeholder:"Enter your message",disabled:p})}),F.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2.5 ed-ml-2 ed-flex-shrink-0",children:[F.jsx("input",{type:"file",ref:a,onChange:S,className:"ed-hidden",accept:".pdf, .png, .jpeg, .jpg",multiple:!0,disabled:p}),F.jsx(MT,{title:"Supported file types: jpg, png, pdf (max 5MB)",children:F.jsx("button",{type:"button",onClick:()=>{var T;return(T=a.current)==null?void 0:T.click()},className:"ed-text-border hover:ed-text-border-dark",children:F.jsx(xw,{className:"ed-size-5 ed-cursor-pointer"})})}),F.jsx("button",{onClick:O,type:"button",disabled:k||p,children:p?F.jsx(Zw,{className:"ed-size-5"}):F.jsx(kw,{className:`${k?"ed-text-border":"ed-text-brand"} ed-size-5`})})]})]})]})},IL=({from:e="knowledge-base",isAuthenticated:t,onSubmit:n,reqId:r,setFeedbackForTheArticle:a,userData:s})=>{var T,D,M;const[u,f]=z.useState([]),[d,p]=z.useState(!1),[m,y]=z.useState({}),b=e==="message",S=b?{contact_person_name:s==null?void 0:s.contact_person_name,contact_person_email:s==null?void 0:s.contact_person_email,ticket_title:m==null?void 0:m.ticket_title,ticket_activity:m==null?void 0:m.ticket_activity}:m,[w,{loading:C}]=Zc(V7),x=async()=>{var U,H;try{if(p(!0),Jt.size(u)&&Jt.size(u)>5){Zr("error","You can upload maximum 5 files","top-right");return}const B=[],G=[];Jt.forEach(u,K=>{const Q=`${Vw()}.${Jt.last(Jt.split(K.name,"."))}`;B.push({name:Q,title:K.name,size:K.size,type:"ticket_activity_attachment"}),G.push({file:K,name:Q})});const{data:te}=await w({variables:{inputData:{...S,...r,ticket_activity_files:B}}});if((U=te==null?void 0:te.createATicketForPortal)!=null&&U.id){let K=[];if(Jt.size(G)){const Q=G.map(async J=>{var ne;try{const ee=await tx({name:J.name,type:"ticket_activity_attachment",sub_type:(ne=te==null?void 0:te.createATicketForPortal)==null?void 0:ne.id});if(ee!=null&&ee.error)return Zr("error",`Failed to process ${J.name}`,"top-right"),null;const{key:de,url:Z,file:oe,success:ge}=await nx({key:ee.key,url:ee.url},J.file);return ge?{key:de,url:Z,file:oe}:null}catch(ee){return console.error(`Error processing file ${J.name}:`,ee),Zr("error",`Failed to upload ${J.name}`,"top-right"),null}});K=(await Promise.all(Q)).filter(Boolean)}n&&n({ticket_id:(H=te==null?void 0:te.createATicketForPortal)==null?void 0:H.id,ticket_title:S.ticket_title,ticket_activity:S.ticket_activity,ticket_activity_files:K})}}catch(B){Zr("error","Something went wrong","top-right"),console.error("error",B)}finally{p(!1)}},O=(U,H)=>{y(B=>({...B,[U]:H}))},k=MC(m.contact_person_email),N=!t&&(!((T=m.contact_person_name)!=null&&T.trim())||!k||!m.contact_person_email)||!((D=m.ticket_title)!=null&&D.trim())||!((M=m.ticket_activity)!=null&&M.trim()),P=()=>C||d?!0:N;return F.jsxs("div",{className:`ed-px-5 ed-pb-5 ${b&&"ed-bg-white-light ed-rounded-md ed-py-2 ed-max-w-full md:ed-max-w-[85%] ed-ml-auto"}`,children:[!b&&F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"ed-flex ed-items-start ed-justify-between ed-pt-5 ed-sticky ed-top-0 ed-bg-white",children:[F.jsx("h5",{className:"ed-text-18 ed-font-semibold ed-text-border-dark ed-mb-5",children:"Get in touch"}),F.jsx(cu,{size:24,className:"ed-text-border-dark ed-cursor-pointer",onClick:()=>a(U=>({...U,notHelpfulModal:!1}))})]}),F.jsx("p",{className:"ed-text-14 ed-font-medium ed-text-border-regular ed-mt-5 ed-mb-4 ed-inline-block ed-w-11/12",children:"Tell us how can we make our product more useful for you."})]}),F.jsxs("div",{className:"ed-space-y-4 ed-mb-6",children:[!t&&F.jsxs(F.Fragment,{children:[F.jsx(Sh,{isRequired:!0,label:"Name",placeholder:"Enter your name",value:m.contact_person_name,onChange:U=>O("contact_person_name",U.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"contact_person_name"}),F.jsx(Sh,{isRequired:!0,type:"email",label:"Email",placeholder:"Enter your email",value:m.contact_person_email,onChange:U=>O("contact_person_email",U.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"contact_person_email"}),(m==null?void 0:m.contact_person_email)&&!k&&F.jsx("span",{className:"ed-text-red ed-font-12",children:"Please enter a valid email address!"})]}),F.jsx(Sh,{isRequired:!0,label:"Subject",placeholder:"Tell us what this feedback is about",value:m.ticket_title,onChange:U=>O("ticket_title",U.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"ticket_title"}),F.jsx(I7,{label:`${t?"Summary":"Description"}`,isRequired:!0,placeholder:"Add more details for us to resolve the issue",value:m.ticket_activity,onChange:U=>O("ticket_activity",U.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"ticket_activity"}),F.jsx(U7,{subtitle:"Supported file types: jpg, png, pdf (max 5MB)",selectedFiles:u,setSelectedFiles:f})]}),F.jsx("div",{className:"ed-flex ed-justify-end",children:F.jsx(bh,{title:"Submit",loaderText:"Submitting",fullWidthBtn:!0,disabled:P(),loader:C||d,callBack:x})})]})};var FT={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GET_CONVERSATION_ACTIVITIES_FOR_PORTAL"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"queryData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ConversationActivitiesForPortalQueryInputType"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"optionData"}},type:{kind:"NamedType",name:{kind:"Name",value:"OptionDataType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getConversationActivitiesForPortal"},arguments:[{kind:"Argument",name:{kind:"Name",value:"queryData"},value:{kind:"Variable",name:{kind:"Name",value:"queryData"}}},{kind:"Argument",name:{kind:"Name",value:"optionData"},value:{kind:"Variable",name:{kind:"Name",value:"optionData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_customer_reply"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"author"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"last_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"first_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"avatar_file"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"files"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"log"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sub_context"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"new_assignee"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"last_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"first_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"meta_data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filtered_rows"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total_rows"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:765}};FT.loc.source={body:`query GET_CONVERSATION_ACTIVITIES_FOR_PORTAL(
|
|
434
|
+
}`),a)}else vm(a);return function(){vm(a)}},[t,a])}var lK=!1;function cK(e){return lK}var eL=function(t){return t===!1?!1:!_o()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},yT=z.forwardRef(function(e,t){var n=e.open,r=e.autoLock,a=e.getContainer,s=e.debug,u=e.autoDestroy,f=u===void 0?!0:u,d=e.children,p=z.useState(n),m=ht(p,2),y=m[0],b=m[1],S=y||n;Ir(_o()||!n,"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR."),z.useEffect(function(){(f||n)&&b(n)},[n,f]);var w=z.useState(function(){return eL(a)}),C=ht(w,2),x=C[0],O=C[1];z.useEffect(function(){var te=eL(a);O(te??null)});var k=rK(S&&!x,s),N=ht(k,2),P=N[0],T=N[1],D=x??P;uK(r&&n&&_o()&&(D===P||D===document.body));var M=null;if(d&&J1(d)&&t){var U=d;M=U.ref}var H=Ex(M,t);if(!S||!_o()||x===void 0)return null;var B=D===!1||cK(),G=d;return t&&(G=z.cloneElement(d,{ref:H})),z.createElement(KD.Provider,{value:T},B?G:rN.createPortal(G,D))});yT.displayName="Portal";function fK(){var e=$e({},e_);return e.useId}var tL=0,nL=fK();const rL=nL?function(t){var n=nL();return t||n}:function(t){var n=z.useState("ssr-id"),r=ht(n,2),a=r[0],s=r[1];return z.useEffect(function(){var u=tL;tL+=1,s("rc_unique_".concat(u))},[]),t||a};var mf="RC_FORM_INTERNAL_HOOKS",mr=function(){Ir(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Dh=z.createContext({getFieldValue:mr,getFieldsValue:mr,getFieldError:mr,getFieldWarning:mr,getFieldsError:mr,isFieldsTouched:mr,isFieldTouched:mr,isFieldValidating:mr,isFieldsValidating:mr,resetFields:mr,setFields:mr,setFieldValue:mr,setFieldsValue:mr,validateFields:mr,submit:mr,getInternalHooks:function(){return mr(),{dispatch:mr,initEntityValue:mr,registerField:mr,useSubscribe:mr,setInitialValues:mr,destroyForm:mr,setCallbacks:mr,registerWatch:mr,getFields:mr,setValidateMessages:mr,setPreserve:mr,getInitialValue:mr}}}),R0=z.createContext(null);function bT(e){return e==null?[]:Array.isArray(e)?e:[e]}function dK(e){return e&&!!e._init}function ST(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var ET=ST();function hK(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function pK(e,t,n){if(xx())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&dm(a,n.prototype),a}function _T(e){var t=typeof Map=="function"?new Map:void 0;return _T=function(r){if(r===null||!hK(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,a)}function a(){return pK(r,arguments,hm(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),dm(a,r)},_T(e)}var iL={NODE_ENV:'"production"'},vK=/%[sdj%]/g,aL=function(){};typeof process<"u"&&iL&&iL.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(aL=function(t,n){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&n.every(function(r){return typeof r=="string"})&&console.warn(t,n)});function CT(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Co(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=0,s=n.length;if(typeof e=="function")return e.apply(null,n);if(typeof e=="string"){var u=e.replace(vK,function(f){if(f==="%%")return"%";if(a>=s)return f;switch(f){case"%s":return String(n[a++]);case"%d":return Number(n[a++]);case"%j":try{return JSON.stringify(n[a++])}catch{return"[Circular]"}break;default:return f}});return u}return e}function mK(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function vi(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||mK(t)&&typeof e=="string"&&!e)}function gK(e,t,n){var r=[],a=0,s=e.length;function u(f){r.push.apply(r,Ft(f||[])),a++,a===s&&n(r)}e.forEach(function(f){t(f,u)})}function oL(e,t,n){var r=0,a=e.length;function s(u){if(u&&u.length){n(u);return}var f=r;r=r+1,f<a?t(e[f],s):n([])}s([])}function yK(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,Ft(e[n]||[]))}),t}var sL=function(e){lf(n,e);var t=cf(n);function n(r,a){var s;return ma(this,n),s=t.call(this,"Async Validation Error"),Ee(dn(s),"errors",void 0),Ee(dn(s),"fields",void 0),s.errors=r,s.fields=a,s}return ga(n)}(_T(Error));function bK(e,t,n,r,a){if(t.first){var s=new Promise(function(b,S){var w=function(O){return r(O),O.length?S(new sL(O,CT(O))):b(a)},C=yK(e);oL(C,n,w)});return s.catch(function(b){return b}),s}var u=t.firstFields===!0?Object.keys(e):t.firstFields||[],f=Object.keys(e),d=f.length,p=0,m=[],y=new Promise(function(b,S){var w=function(x){if(m.push.apply(m,x),p++,p===d)return r(m),m.length?S(new sL(m,CT(m))):b(a)};f.length||(r(m),b(a)),f.forEach(function(C){var x=e[C];u.indexOf(C)!==-1?oL(x,n,w):gK(x,n,w)})});return y.catch(function(b){return b}),y}function SK(e){return!!(e&&e.message!==void 0)}function EK(e,t){for(var n=e,r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function uL(e,t){return function(n){var r;return e.fullFields?r=EK(t,e.fullFields):r=t[n.field||e.fullField],SK(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function lL(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];en(r)==="object"&&en(e[n])==="object"?e[n]=$e($e({},e[n]),r):e[n]=r}}return e}var Lh="enum",_K=function(t,n,r,a,s){t[Lh]=Array.isArray(t[Lh])?t[Lh]:[],t[Lh].indexOf(n)===-1&&a.push(Co(s.messages[Lh],t.fullField,t[Lh].join(", ")))},CK=function(t,n,r,a,s){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||a.push(Co(s.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var u=new RegExp(t.pattern);u.test(n)||a.push(Co(s.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},wK=function(t,n,r,a,s){var u=typeof t.len=="number",f=typeof t.min=="number",d=typeof t.max=="number",p=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,m=n,y=null,b=typeof n=="number",S=typeof n=="string",w=Array.isArray(n);if(b?y="number":S?y="string":w&&(y="array"),!y)return!1;w&&(m=n.length),S&&(m=n.replace(p,"_").length),u?m!==t.len&&a.push(Co(s.messages[y].len,t.fullField,t.len)):f&&!d&&m<t.min?a.push(Co(s.messages[y].min,t.fullField,t.min)):d&&!f&&m>t.max?a.push(Co(s.messages[y].max,t.fullField,t.max)):f&&d&&(m<t.min||m>t.max)&&a.push(Co(s.messages[y].range,t.fullField,t.min,t.max))},cL=function(t,n,r,a,s,u){t.required&&(!r.hasOwnProperty(t.field)||vi(n,u||t.type))&&a.push(Co(s.messages.required,t.fullField))},O0;const xK=function(){if(O0)return O0;var e="[a-fA-F\\d:]",t=function(D){return D&&D.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",a=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],s="(?:%[0-9a-zA-Z]{1,})?",u="(?:".concat(a.join("|"),")").concat(s),f=new RegExp("(?:^".concat(n,"$)|(?:^").concat(u,"$)")),d=new RegExp("^".concat(n,"$")),p=new RegExp("^".concat(u,"$")),m=function(D){return D&&D.exact?f:new RegExp("(?:".concat(t(D)).concat(n).concat(t(D),")|(?:").concat(t(D)).concat(u).concat(t(D),")"),"g")};m.v4=function(T){return T&&T.exact?d:new RegExp("".concat(t(T)).concat(n).concat(t(T)),"g")},m.v6=function(T){return T&&T.exact?p:new RegExp("".concat(t(T)).concat(u).concat(t(T)),"g")};var y="(?:(?:[a-z]+:)?//)",b="(?:\\S+(?::\\S*)?@)?",S=m.v4().source,w=m.v6().source,C="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",x="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",O="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",k="(?::\\d{2,5})?",N='(?:[/?#][^\\s"]*)?',P="(?:".concat(y,"|www\\.)").concat(b,"(?:localhost|").concat(S,"|").concat(w,"|").concat(C).concat(x).concat(O,")").concat(k).concat(N);return O0=new RegExp("(?:^".concat(P,"$)"),"i"),O0};var fL={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},xm={integer:function(t){return xm.number(t)&&parseInt(t,10)===t},float:function(t){return xm.number(t)&&!xm.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return en(t)==="object"&&!xm.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(fL.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(xK())},hex:function(t){return typeof t=="string"&&!!t.match(fL.hex)}},TK=function(t,n,r,a,s){if(t.required&&n===void 0){cL(t,n,r,a,s);return}var u=["integer","float","array","regexp","object","method","email","number","date","url","hex"],f=t.type;u.indexOf(f)>-1?xm[f](n)||a.push(Co(s.messages.types[f],t.fullField,t.type)):f&&en(n)!==t.type&&a.push(Co(s.messages.types[f],t.fullField,t.type))},RK=function(t,n,r,a,s){(/^\s+$/.test(n)||n==="")&&a.push(Co(s.messages.whitespace,t.fullField))};const Tn={required:cL,whitespace:RK,type:TK,range:wK,enum:_K,pattern:CK};var OK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s)}r(u)},kK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(n==null&&!t.required)return r();Tn.required(t,n,a,u,s,"array"),n!=null&&(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s))}r(u)},AK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&Tn.type(t,n,a,u,s)}r(u)},NK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n,"date")&&!t.required)return r();if(Tn.required(t,n,a,u,s),!vi(n,"date")){var d;n instanceof Date?d=n:d=new Date(n),Tn.type(t,d,a,u,s),d&&Tn.range(t,d.getTime(),a,u,s)}}r(u)},DK="enum",LK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&Tn[DK](t,n,a,u,s)}r(u)},PK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s))}r(u)},MK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s))}r(u)},FK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&Tn.type(t,n,a,u,s)}r(u)},jK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(n===""&&(n=void 0),vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s))}r(u)},IK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),n!==void 0&&Tn.type(t,n,a,u,s)}r(u)},$K=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n,"string")&&!t.required)return r();Tn.required(t,n,a,u,s),vi(n,"string")||Tn.pattern(t,n,a,u,s)}r(u)},UK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n)&&!t.required)return r();Tn.required(t,n,a,u,s),vi(n)||Tn.type(t,n,a,u,s)}r(u)},zK=function(t,n,r,a,s){var u=[],f=Array.isArray(n)?"array":en(n);Tn.required(t,n,a,u,s,f),r(u)},VK=function(t,n,r,a,s){var u=[],f=t.required||!t.required&&a.hasOwnProperty(t.field);if(f){if(vi(n,"string")&&!t.required)return r();Tn.required(t,n,a,u,s,"string"),vi(n,"string")||(Tn.type(t,n,a,u,s),Tn.range(t,n,a,u,s),Tn.pattern(t,n,a,u,s),t.whitespace===!0&&Tn.whitespace(t,n,a,u,s))}r(u)},wT=function(t,n,r,a,s){var u=t.type,f=[],d=t.required||!t.required&&a.hasOwnProperty(t.field);if(d){if(vi(n,u)&&!t.required)return r();Tn.required(t,n,a,f,s,u),vi(n,u)||Tn.type(t,n,a,f,s)}r(f)};const Tm={string:VK,method:FK,number:jK,boolean:AK,regexp:UK,integer:MK,float:PK,array:kK,object:IK,enum:LK,pattern:$K,date:NK,url:wT,hex:wT,email:wT,required:zK,any:OK};var Rm=function(){function e(t){ma(this,e),Ee(this,"rules",null),Ee(this,"_messages",ET),this.define(t)}return ga(e,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(en(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(a){var s=n[a];r.rules[a]=Array.isArray(s)?s:[s]})}},{key:"messages",value:function(n){return n&&(this._messages=lL(ST(),n)),this._messages}},{key:"validate",value:function(n){var r=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},u=n,f=a,d=s;if(typeof f=="function"&&(d=f,f={}),!this.rules||Object.keys(this.rules).length===0)return d&&d(null,u),Promise.resolve(u);function p(w){var C=[],x={};function O(N){if(Array.isArray(N)){var P;C=(P=C).concat.apply(P,Ft(N))}else C.push(N)}for(var k=0;k<w.length;k++)O(w[k]);C.length?(x=CT(C),d(C,x)):d(null,u)}if(f.messages){var m=this.messages();m===ET&&(m=ST()),lL(m,f.messages),f.messages=m}else f.messages=this.messages();var y={},b=f.keys||Object.keys(this.rules);b.forEach(function(w){var C=r.rules[w],x=u[w];C.forEach(function(O){var k=O;typeof k.transform=="function"&&(u===n&&(u=$e({},u)),x=u[w]=k.transform(x),x!=null&&(k.type=k.type||(Array.isArray(x)?"array":en(x)))),typeof k=="function"?k={validator:k}:k=$e({},k),k.validator=r.getValidationMethod(k),k.validator&&(k.field=w,k.fullField=k.fullField||w,k.type=r.getType(k),y[w]=y[w]||[],y[w].push({rule:k,value:x,source:u,field:w}))})});var S={};return bK(y,f,function(w,C){var x=w.rule,O=(x.type==="object"||x.type==="array")&&(en(x.fields)==="object"||en(x.defaultField)==="object");O=O&&(x.required||!x.required&&w.value),x.field=w.field;function k(M,U){return $e($e({},U),{},{fullField:"".concat(x.fullField,".").concat(M),fullFields:x.fullFields?[].concat(Ft(x.fullFields),[M]):[M]})}function N(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],U=Array.isArray(M)?M:[M];!f.suppressWarning&&U.length&&e.warning("async-validator:",U),U.length&&x.message!==void 0&&(U=[].concat(x.message));var H=U.map(uL(x,u));if(f.first&&H.length)return S[x.field]=1,C(H);if(!O)C(H);else{if(x.required&&!w.value)return x.message!==void 0?H=[].concat(x.message).map(uL(x,u)):f.error&&(H=[f.error(x,Co(f.messages.required,x.field))]),C(H);var B={};x.defaultField&&Object.keys(w.value).map(function(K){B[K]=x.defaultField}),B=$e($e({},B),w.rule.fields);var G={};Object.keys(B).forEach(function(K){var Q=B[K],Y=Array.isArray(Q)?Q:[Q];G[K]=Y.map(k.bind(null,K))});var te=new e(G);te.messages(f.messages),w.rule.options&&(w.rule.options.messages=f.messages,w.rule.options.error=f.error),te.validate(w.value,w.rule.options||f,function(K){var Q=[];H&&H.length&&Q.push.apply(Q,Ft(H)),K&&K.length&&Q.push.apply(Q,Ft(K)),C(Q.length?Q:null)})}}var P;if(x.asyncValidator)P=x.asyncValidator(x,w.value,N,w.source,f);else if(x.validator){try{P=x.validator(x,w.value,N,w.source,f)}catch(M){var T,D;(T=(D=console).error)===null||T===void 0||T.call(D,M),f.suppressValidatorError||setTimeout(function(){throw M},0),N(M.message)}P===!0?N():P===!1?N(typeof x.message=="function"?x.message(x.fullField||x.field):x.message||"".concat(x.fullField||x.field," fails")):P instanceof Array?N(P):P instanceof Error&&N(P.message)}P&&P.then&&P.then(function(){return N()},function(M){return N(M)})},function(w){p(w)},u)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!Tm.hasOwnProperty(n.type))throw new Error(Co("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),a=r.indexOf("message");return a!==-1&&r.splice(a,1),r.length===1&&r[0]==="required"?Tm.required:Tm[this.getType(n)]||void 0}}]),e}();Ee(Rm,"register",function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");Tm[t]=n}),Ee(Rm,"warning",aL),Ee(Rm,"messages",ET),Ee(Rm,"validators",Tm);var wo="'${name}' is not a valid ${type}",dL={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:wo,method:wo,array:wo,object:wo,number:wo,date:wo,boolean:wo,integer:wo,float:wo,regexp:wo,email:wo,url:wo,hex:wo},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},hL=Rm;function HK(e,t){return e.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return t[r]})}var pL="CODE_LOGIC_ERROR";function xT(e,t,n,r,a){return TT.apply(this,arguments)}function TT(){return TT=wm(Ms().mark(function e(t,n,r,a,s){var u,f,d,p,m,y,b,S,w;return Ms().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return u=$e({},r),delete u.ruleIndex,hL.warning=function(){},u.validator&&(f=u.validator,u.validator=function(){try{return f.apply(void 0,arguments)}catch(O){return console.error(O),Promise.reject(pL)}}),d=null,u&&u.type==="array"&&u.defaultField&&(d=u.defaultField,delete u.defaultField),p=new hL(Ee({},t,[u])),m=bm(dL,a.validateMessages),p.messages(m),y=[],x.prev=10,x.next=13,Promise.resolve(p.validate(Ee({},t,n),$e({},a)));case 13:x.next=18;break;case 15:x.prev=15,x.t0=x.catch(10),x.t0.errors&&(y=x.t0.errors.map(function(O,k){var N=O.message,P=N===pL?m.default:N;return z.isValidElement(P)?z.cloneElement(P,{key:"error_".concat(k)}):P}));case 18:if(!(!y.length&&d)){x.next=23;break}return x.next=21,Promise.all(n.map(function(O,k){return xT("".concat(t,".").concat(k),O,d,a,s)}));case 21:return b=x.sent,x.abrupt("return",b.reduce(function(O,k){return[].concat(Ft(O),Ft(k))},[]));case 23:return S=$e($e({},r),{},{name:t,enum:(r.enum||[]).join(", ")},s),w=y.map(function(O){return typeof O=="string"?HK(O,S):O}),x.abrupt("return",w);case 26:case"end":return x.stop()}},e,null,[[10,15]])})),TT.apply(this,arguments)}function qK(e,t,n,r,a,s){var u=e.join("."),f=n.map(function(m,y){var b=m.validator,S=$e($e({},m),{},{ruleIndex:y});return b&&(S.validator=function(w,C,x){var O=!1,k=function(){for(var T=arguments.length,D=new Array(T),M=0;M<T;M++)D[M]=arguments[M];Promise.resolve().then(function(){Ir(!O,"Your validator function has already return a promise. `callback` will be ignored."),O||x.apply(void 0,D)})},N=b(w,C,k);O=N&&typeof N.then=="function"&&typeof N.catch=="function",Ir(O,"`callback` is deprecated. Please return a promise instead."),O&&N.then(function(){x()}).catch(function(P){x(P||" ")})}),S}).sort(function(m,y){var b=m.warningOnly,S=m.ruleIndex,w=y.warningOnly,C=y.ruleIndex;return!!b==!!w?S-C:b?1:-1}),d;if(a===!0)d=new Promise(function(){var m=wm(Ms().mark(function y(b,S){var w,C,x;return Ms().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:w=0;case 1:if(!(w<f.length)){k.next=12;break}return C=f[w],k.next=5,xT(u,t,C,r,s);case 5:if(x=k.sent,!x.length){k.next=9;break}return S([{errors:x,rule:C}]),k.abrupt("return");case 9:w+=1,k.next=1;break;case 12:b([]);case 13:case"end":return k.stop()}},y)}));return function(y,b){return m.apply(this,arguments)}}());else{var p=f.map(function(m){return xT(u,t,m,r,s).then(function(y){return{errors:y,rule:m}})});d=(a?WK(p):BK(p)).then(function(m){return Promise.reject(m)})}return d.catch(function(m){return m}),d}function BK(e){return RT.apply(this,arguments)}function RT(){return RT=wm(Ms().mark(function e(t){return Ms().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.all(t).then(function(a){var s,u=(s=[]).concat.apply(s,Ft(a));return u}));case 1:case"end":return r.stop()}},e)})),RT.apply(this,arguments)}function WK(e){return OT.apply(this,arguments)}function OT(){return OT=wm(Ms().mark(function e(t){var n;return Ms().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return n=0,a.abrupt("return",new Promise(function(s){t.forEach(function(u){u.then(function(f){f.errors.length&&s([f]),n+=1,n===t.length&&s([])})})}));case 2:case"end":return a.stop()}},e)})),OT.apply(this,arguments)}function ei(e){return bT(e)}function vL(e,t){var n={};return t.forEach(function(r){var a=pu(e,r);n=Ls(n,r,a)}),n}function Ph(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e&&e.some(function(r){return mL(t,r,n)})}function mL(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!e||!t||!n&&e.length!==t.length?!1:t.every(function(r,a){return e[a]===r})}function GK(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||en(e)!=="object"||en(t)!=="object")return!1;var n=Object.keys(e),r=Object.keys(t),a=new Set([].concat(n,r));return Ft(a).every(function(s){var u=e[s],f=t[s];return typeof u=="function"&&typeof f=="function"?!0:u===f})}function QK(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&en(t.target)==="object"&&e in t.target?t.target[e]:t}function gL(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var a=e[t],s=t-n;return s>0?[].concat(Ft(e.slice(0,n)),[a],Ft(e.slice(n,t)),Ft(e.slice(t+1,r))):s<0?[].concat(Ft(e.slice(0,t)),Ft(e.slice(t+1,n+1)),[a],Ft(e.slice(n+1,r))):e}var YK=["name"],Go=[];function kT(e,t,n,r,a,s){return typeof e=="function"?e(t,n,"source"in s?{source:s.source}:{}):r!==a}var AT=function(e){lf(n,e);var t=cf(n);function n(r){var a;if(ma(this,n),a=t.call(this,r),Ee(dn(a),"state",{resetCount:0}),Ee(dn(a),"cancelRegisterFunc",null),Ee(dn(a),"mounted",!1),Ee(dn(a),"touched",!1),Ee(dn(a),"dirty",!1),Ee(dn(a),"validatePromise",void 0),Ee(dn(a),"prevValidating",void 0),Ee(dn(a),"errors",Go),Ee(dn(a),"warnings",Go),Ee(dn(a),"cancelRegister",function(){var d=a.props,p=d.preserve,m=d.isListField,y=d.name;a.cancelRegisterFunc&&a.cancelRegisterFunc(m,p,ei(y)),a.cancelRegisterFunc=null}),Ee(dn(a),"getNamePath",function(){var d=a.props,p=d.name,m=d.fieldContext,y=m.prefixName,b=y===void 0?[]:y;return p!==void 0?[].concat(Ft(b),Ft(p)):[]}),Ee(dn(a),"getRules",function(){var d=a.props,p=d.rules,m=p===void 0?[]:p,y=d.fieldContext;return m.map(function(b){return typeof b=="function"?b(y):b})}),Ee(dn(a),"refresh",function(){a.mounted&&a.setState(function(d){var p=d.resetCount;return{resetCount:p+1}})}),Ee(dn(a),"metaCache",null),Ee(dn(a),"triggerMetaEvent",function(d){var p=a.props.onMetaChange;if(p){var m=$e($e({},a.getMeta()),{},{destroy:d});AN(a.metaCache,m)||p(m),a.metaCache=m}else a.metaCache=null}),Ee(dn(a),"onStoreChange",function(d,p,m){var y=a.props,b=y.shouldUpdate,S=y.dependencies,w=S===void 0?[]:S,C=y.onReset,x=m.store,O=a.getNamePath(),k=a.getValue(d),N=a.getValue(x),P=p&&Ph(p,O);switch(m.type==="valueUpdate"&&m.source==="external"&&!AN(k,N)&&(a.touched=!0,a.dirty=!0,a.validatePromise=null,a.errors=Go,a.warnings=Go,a.triggerMetaEvent()),m.type){case"reset":if(!p||P){a.touched=!1,a.dirty=!1,a.validatePromise=void 0,a.errors=Go,a.warnings=Go,a.triggerMetaEvent(),C==null||C(),a.refresh();return}break;case"remove":{if(b&&kT(b,d,x,k,N,m)){a.reRender();return}break}case"setField":{var T=m.data;if(P){"touched"in T&&(a.touched=T.touched),"validating"in T&&!("originRCField"in T)&&(a.validatePromise=T.validating?Promise.resolve([]):null),"errors"in T&&(a.errors=T.errors||Go),"warnings"in T&&(a.warnings=T.warnings||Go),a.dirty=!0,a.triggerMetaEvent(),a.reRender();return}else if("value"in T&&Ph(p,O,!0)){a.reRender();return}if(b&&!O.length&&kT(b,d,x,k,N,m)){a.reRender();return}break}case"dependenciesUpdate":{var D=w.map(ei);if(D.some(function(M){return Ph(m.relatedFields,M)})){a.reRender();return}break}default:if(P||(!w.length||O.length||b)&&kT(b,d,x,k,N,m)){a.reRender();return}break}b===!0&&a.reRender()}),Ee(dn(a),"validateRules",function(d){var p=a.getNamePath(),m=a.getValue(),y=d||{},b=y.triggerName,S=y.validateOnly,w=S===void 0?!1:S,C=Promise.resolve().then(wm(Ms().mark(function x(){var O,k,N,P,T,D,M;return Ms().wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(a.mounted){H.next=2;break}return H.abrupt("return",[]);case 2:if(O=a.props,k=O.validateFirst,N=k===void 0?!1:k,P=O.messageVariables,T=O.validateDebounce,D=a.getRules(),b&&(D=D.filter(function(B){return B}).filter(function(B){var G=B.validateTrigger;if(!G)return!0;var te=bT(G);return te.includes(b)})),!(T&&b)){H.next=10;break}return H.next=8,new Promise(function(B){setTimeout(B,T)});case 8:if(a.validatePromise===C){H.next=10;break}return H.abrupt("return",[]);case 10:return M=qK(p,m,D,d,N,P),M.catch(function(B){return B}).then(function(){var B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Go;if(a.validatePromise===C){var G;a.validatePromise=null;var te=[],K=[];(G=B.forEach)===null||G===void 0||G.call(B,function(Q){var Y=Q.rule.warningOnly,J=Q.errors,ne=J===void 0?Go:J;Y?K.push.apply(K,Ft(ne)):te.push.apply(te,Ft(ne))}),a.errors=te,a.warnings=K,a.triggerMetaEvent(),a.reRender()}}),H.abrupt("return",M);case 13:case"end":return H.stop()}},x)})));return w||(a.validatePromise=C,a.dirty=!0,a.errors=Go,a.warnings=Go,a.triggerMetaEvent(),a.reRender()),C}),Ee(dn(a),"isFieldValidating",function(){return!!a.validatePromise}),Ee(dn(a),"isFieldTouched",function(){return a.touched}),Ee(dn(a),"isFieldDirty",function(){if(a.dirty||a.props.initialValue!==void 0)return!0;var d=a.props.fieldContext,p=d.getInternalHooks(mf),m=p.getInitialValue;return m(a.getNamePath())!==void 0}),Ee(dn(a),"getErrors",function(){return a.errors}),Ee(dn(a),"getWarnings",function(){return a.warnings}),Ee(dn(a),"isListField",function(){return a.props.isListField}),Ee(dn(a),"isList",function(){return a.props.isList}),Ee(dn(a),"isPreserve",function(){return a.props.preserve}),Ee(dn(a),"getMeta",function(){a.prevValidating=a.isFieldValidating();var d={touched:a.isFieldTouched(),validating:a.prevValidating,errors:a.errors,warnings:a.warnings,name:a.getNamePath(),validated:a.validatePromise===null};return d}),Ee(dn(a),"getOnlyChild",function(d){if(typeof d=="function"){var p=a.getMeta();return $e($e({},a.getOnlyChild(d(a.getControlled(),p,a.props.fieldContext))),{},{isFunction:!0})}var m=K1(d);return m.length!==1||!z.isValidElement(m[0])?{child:m,isFunction:!1}:{child:m[0],isFunction:!1}}),Ee(dn(a),"getValue",function(d){var p=a.props.fieldContext.getFieldsValue,m=a.getNamePath();return pu(d||p(!0),m)}),Ee(dn(a),"getControlled",function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=a.props,m=p.name,y=p.trigger,b=p.validateTrigger,S=p.getValueFromEvent,w=p.normalize,C=p.valuePropName,x=p.getValueProps,O=p.fieldContext,k=b!==void 0?b:O.validateTrigger,N=a.getNamePath(),P=O.getInternalHooks,T=O.getFieldsValue,D=P(mf),M=D.dispatch,U=a.getValue(),H=x||function(Q){return Ee({},C,Q)},B=d[y],G=m!==void 0?H(U):{};G&&Object.keys(G).forEach(function(Q){Ir(typeof G[Q]!="function","It's not recommended to generate dynamic function prop by `getValueProps`. Please pass it to child component directly (prop: ".concat(Q,")"))});var te=$e($e({},d),G);te[y]=function(){a.touched=!0,a.dirty=!0,a.triggerMetaEvent();for(var Q,Y=arguments.length,J=new Array(Y),ne=0;ne<Y;ne++)J[ne]=arguments[ne];S?Q=S.apply(void 0,J):Q=QK.apply(void 0,[C].concat(J)),w&&(Q=w(Q,U,T(!0))),Q!==U&&M({type:"updateValue",namePath:N,value:Q}),B&&B.apply(void 0,J)};var K=bT(k||[]);return K.forEach(function(Q){var Y=te[Q];te[Q]=function(){Y&&Y.apply(void 0,arguments);var J=a.props.rules;J&&J.length&&M({type:"validateField",namePath:N,triggerName:Q})}}),te}),r.fieldContext){var s=r.fieldContext.getInternalHooks,u=s(mf),f=u.initEntityValue;f(dn(a))}return a}return ga(n,[{key:"componentDidMount",value:function(){var a=this.props,s=a.shouldUpdate,u=a.fieldContext;if(this.mounted=!0,u){var f=u.getInternalHooks,d=f(mf),p=d.registerField;this.cancelRegisterFunc=p(this)}s===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var a=this.state.resetCount,s=this.props.children,u=this.getOnlyChild(s),f=u.child,d=u.isFunction,p;return d?p=f:z.isValidElement(f)?p=z.cloneElement(f,this.getControlled(f.props)):(Ir(!f,"`children` of Field is not validate ReactElement."),p=f),z.createElement(z.Fragment,{key:a},p)}}]),n}(z.Component);Ee(AT,"contextType",Dh),Ee(AT,"defaultProps",{trigger:"onChange",valuePropName:"value"});function yL(e){var t,n=e.name,r=df(e,YK),a=z.useContext(Dh),s=z.useContext(R0),u=n!==void 0?ei(n):void 0,f=(t=r.isListField)!==null&&t!==void 0?t:!!s,d="keep";return f||(d="_".concat((u||[]).join("_"))),r.preserve===!1&&f&&u.length<=1&&Ir(!1,"`preserve` should not apply on Form.List fields."),z.createElement(AT,du({key:d,name:u,isListField:f},r,{fieldContext:a}))}function XK(e){var t=e.name,n=e.initialValue,r=e.children,a=e.rules,s=e.validateTrigger,u=e.isListField,f=z.useContext(Dh),d=z.useContext(R0),p=z.useRef({keys:[],id:0}),m=p.current,y=z.useMemo(function(){var C=ei(f.prefixName)||[];return[].concat(Ft(C),Ft(ei(t)))},[f.prefixName,t]),b=z.useMemo(function(){return $e($e({},f),{},{prefixName:y})},[f,y]),S=z.useMemo(function(){return{getKey:function(x){var O=y.length,k=x[O];return[m.keys[k],x.slice(O+1)]}}},[y]);if(typeof r!="function")return Ir(!1,"Form.List only accepts function as children."),null;var w=function(x,O,k){var N=k.source;return N==="internal"?!1:x!==O};return z.createElement(R0.Provider,{value:S},z.createElement(Dh.Provider,{value:b},z.createElement(yL,{name:[],shouldUpdate:w,rules:a,validateTrigger:s,initialValue:n,isList:!0,isListField:u??!!d},function(C,x){var O=C.value,k=O===void 0?[]:O,N=C.onChange,P=f.getFieldValue,T=function(){var H=P(y||[]);return H||[]},D={add:function(H,B){var G=T();B>=0&&B<=G.length?(m.keys=[].concat(Ft(m.keys.slice(0,B)),[m.id],Ft(m.keys.slice(B))),N([].concat(Ft(G.slice(0,B)),[H],Ft(G.slice(B))))):((B<0||B>G.length)&&Ir(!1,"The second parameter of the add function should be a valid positive number."),m.keys=[].concat(Ft(m.keys),[m.id]),N([].concat(Ft(G),[H]))),m.id+=1},remove:function(H){var B=T(),G=new Set(Array.isArray(H)?H:[H]);G.size<=0||(m.keys=m.keys.filter(function(te,K){return!G.has(K)}),N(B.filter(function(te,K){return!G.has(K)})))},move:function(H,B){if(H!==B){var G=T();H<0||H>=G.length||B<0||B>=G.length||(m.keys=gL(m.keys,H,B),N(gL(G,H,B)))}}},M=k||[];return Array.isArray(M)||(M=[],Ir(!1,"Current value of '".concat(y.join(" > "),"' is not an array type."))),r(M.map(function(U,H){var B=m.keys[H];return B===void 0&&(m.keys[H]=m.id,B=m.keys[H],m.id+=1),{name:H,key:B,isListField:!0}}),D,x)})))}function KK(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(a,s){e.forEach(function(u,f){u.catch(function(d){return t=!0,d}).then(function(d){n-=1,r[f]=d,!(n>0)&&(t&&s(r),a(r))})})}):Promise.resolve([])}var bL="__@field_split__";function NT(e){return e.map(function(t){return"".concat(en(t),":").concat(t)}).join(bL)}var Mh=function(){function e(){ma(this,e),Ee(this,"kvs",new Map)}return ga(e,[{key:"set",value:function(n,r){this.kvs.set(NT(n),r)}},{key:"get",value:function(n){return this.kvs.get(NT(n))}},{key:"update",value:function(n,r){var a=this.get(n),s=r(a);s?this.set(n,s):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(NT(n))}},{key:"map",value:function(n){return Ft(this.kvs.entries()).map(function(r){var a=ht(r,2),s=a[0],u=a[1],f=s.split(bL);return n({key:f.map(function(d){var p=d.match(/^([^:]*):(.*)$/),m=ht(p,3),y=m[1],b=m[2];return y==="number"?Number(b):b}),value:u})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var a=r.key,s=r.value;return n[a.join(".")]=s,null}),n}}]),e}(),ZK=["name"],JK=ga(function e(t){var n=this;ma(this,e),Ee(this,"formHooked",!1),Ee(this,"forceRootUpdate",void 0),Ee(this,"subscribable",!0),Ee(this,"store",{}),Ee(this,"fieldEntities",[]),Ee(this,"initialValues",{}),Ee(this,"callbacks",{}),Ee(this,"validateMessages",null),Ee(this,"preserve",null),Ee(this,"lastValidatePromise",null),Ee(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),Ee(this,"getInternalHooks",function(r){return r===mf?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Ir(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),Ee(this,"useSubscribe",function(r){n.subscribable=r}),Ee(this,"prevWithoutPreserves",null),Ee(this,"setInitialValues",function(r,a){if(n.initialValues=r||{},a){var s,u=bm(r,n.store);(s=n.prevWithoutPreserves)===null||s===void 0||s.map(function(f){var d=f.key;u=Ls(u,d,pu(r,d))}),n.prevWithoutPreserves=null,n.updateStore(u)}}),Ee(this,"destroyForm",function(r){if(r)n.updateStore({});else{var a=new Mh;n.getFieldEntities(!0).forEach(function(s){n.isMergedPreserve(s.isPreserve())||a.set(s.getNamePath(),!0)}),n.prevWithoutPreserves=a}}),Ee(this,"getInitialValue",function(r){var a=pu(n.initialValues,r);return r.length?bm(a):a}),Ee(this,"setCallbacks",function(r){n.callbacks=r}),Ee(this,"setValidateMessages",function(r){n.validateMessages=r}),Ee(this,"setPreserve",function(r){n.preserve=r}),Ee(this,"watchList",[]),Ee(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(a){return a!==r})}}),Ee(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var a=n.getFieldsValue(),s=n.getFieldsValue(!0);n.watchList.forEach(function(u){u(a,s,r)})}}),Ee(this,"timeoutId",null),Ee(this,"warningUnhooked",function(){!n.timeoutId&&typeof window<"u"&&(n.timeoutId=setTimeout(function(){n.timeoutId=null,n.formHooked||Ir(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))}),Ee(this,"updateStore",function(r){n.store=r}),Ee(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(a){return a.getNamePath().length}):n.fieldEntities}),Ee(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=new Mh;return n.getFieldEntities(r).forEach(function(s){var u=s.getNamePath();a.set(u,s)}),a}),Ee(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var a=n.getFieldsMap(!0);return r.map(function(s){var u=ei(s);return a.get(u)||{INVALIDATE_NAME_PATH:ei(s)}})}),Ee(this,"getFieldsValue",function(r,a){n.warningUnhooked();var s,u,f;if(r===!0||Array.isArray(r)?(s=r,u=a):r&&en(r)==="object"&&(f=r.strict,u=r.filter),s===!0&&!u)return n.store;var d=n.getFieldEntitiesForNamePathList(Array.isArray(s)?s:null),p=[];return d.forEach(function(m){var y,b,S="INVALIDATE_NAME_PATH"in m?m.INVALIDATE_NAME_PATH:m.getNamePath();if(f){var w,C;if((w=(C=m).isList)!==null&&w!==void 0&&w.call(C))return}else if(!s&&(y=(b=m).isListField)!==null&&y!==void 0&&y.call(b))return;if(!u)p.push(S);else{var x="getMeta"in m?m.getMeta():null;u(x)&&p.push(S)}}),vL(n.store,p.map(ei))}),Ee(this,"getFieldValue",function(r){n.warningUnhooked();var a=ei(r);return pu(n.store,a)}),Ee(this,"getFieldsError",function(r){n.warningUnhooked();var a=n.getFieldEntitiesForNamePathList(r);return a.map(function(s,u){return s&&!("INVALIDATE_NAME_PATH"in s)?{name:s.getNamePath(),errors:s.getErrors(),warnings:s.getWarnings()}:{name:ei(r[u]),errors:[],warnings:[]}})}),Ee(this,"getFieldError",function(r){n.warningUnhooked();var a=ei(r),s=n.getFieldsError([a])[0];return s.errors}),Ee(this,"getFieldWarning",function(r){n.warningUnhooked();var a=ei(r),s=n.getFieldsError([a])[0];return s.warnings}),Ee(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];var u=a[0],f=a[1],d,p=!1;a.length===0?d=null:a.length===1?Array.isArray(u)?(d=u.map(ei),p=!1):(d=null,p=u):(d=u.map(ei),p=f);var m=n.getFieldEntities(!0),y=function(x){return x.isFieldTouched()};if(!d)return p?m.every(function(C){return y(C)||C.isList()}):m.some(y);var b=new Mh;d.forEach(function(C){b.set(C,[])}),m.forEach(function(C){var x=C.getNamePath();d.forEach(function(O){O.every(function(k,N){return x[N]===k})&&b.update(O,function(k){return[].concat(Ft(k),[C])})})});var S=function(x){return x.some(y)},w=b.map(function(C){var x=C.value;return x});return p?w.every(S):w.some(S)}),Ee(this,"isFieldTouched",function(r){return n.warningUnhooked(),n.isFieldsTouched([r])}),Ee(this,"isFieldsValidating",function(r){n.warningUnhooked();var a=n.getFieldEntities();if(!r)return a.some(function(u){return u.isFieldValidating()});var s=r.map(ei);return a.some(function(u){var f=u.getNamePath();return Ph(s,f)&&u.isFieldValidating()})}),Ee(this,"isFieldValidating",function(r){return n.warningUnhooked(),n.isFieldsValidating([r])}),Ee(this,"resetWithFieldInitialValue",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=new Mh,s=n.getFieldEntities(!0);s.forEach(function(d){var p=d.props.initialValue,m=d.getNamePath();if(p!==void 0){var y=a.get(m)||new Set;y.add({entity:d,value:p}),a.set(m,y)}});var u=function(p){p.forEach(function(m){var y=m.props.initialValue;if(y!==void 0){var b=m.getNamePath(),S=n.getInitialValue(b);if(S!==void 0)Ir(!1,"Form already set 'initialValues' with path '".concat(b.join("."),"'. Field can not overwrite it."));else{var w=a.get(b);if(w&&w.size>1)Ir(!1,"Multiple Field with path '".concat(b.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(w){var C=n.getFieldValue(b),x=m.isListField();!x&&(!r.skipExist||C===void 0)&&n.updateStore(Ls(n.store,b,Ft(w)[0].value))}}}})},f;r.entities?f=r.entities:r.namePathList?(f=[],r.namePathList.forEach(function(d){var p=a.get(d);if(p){var m;(m=f).push.apply(m,Ft(Ft(p).map(function(y){return y.entity})))}})):f=s,u(f)}),Ee(this,"resetFields",function(r){n.warningUnhooked();var a=n.store;if(!r){n.updateStore(bm(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(a,null,{type:"reset"}),n.notifyWatch();return}var s=r.map(ei);s.forEach(function(u){var f=n.getInitialValue(u);n.updateStore(Ls(n.store,u,f))}),n.resetWithFieldInitialValue({namePathList:s}),n.notifyObservers(a,s,{type:"reset"}),n.notifyWatch(s)}),Ee(this,"setFields",function(r){n.warningUnhooked();var a=n.store,s=[];r.forEach(function(u){var f=u.name,d=df(u,ZK),p=ei(f);s.push(p),"value"in d&&n.updateStore(Ls(n.store,p,d.value)),n.notifyObservers(a,[p],{type:"setField",data:u})}),n.notifyWatch(s)}),Ee(this,"getFields",function(){var r=n.getFieldEntities(!0),a=r.map(function(s){var u=s.getNamePath(),f=s.getMeta(),d=$e($e({},f),{},{name:u,value:n.getFieldValue(u)});return Object.defineProperty(d,"originRCField",{value:!0}),d});return a}),Ee(this,"initEntityValue",function(r){var a=r.props.initialValue;if(a!==void 0){var s=r.getNamePath(),u=pu(n.store,s);u===void 0&&n.updateStore(Ls(n.store,s,a))}}),Ee(this,"isMergedPreserve",function(r){var a=r!==void 0?r:n.preserve;return a??!0}),Ee(this,"registerField",function(r){n.fieldEntities.push(r);var a=r.getNamePath();if(n.notifyWatch([a]),r.props.initialValue!==void 0){var s=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(s,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(u,f){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(y){return y!==r}),!n.isMergedPreserve(f)&&(!u||d.length>1)){var p=u?void 0:n.getInitialValue(a);if(a.length&&n.getFieldValue(a)!==p&&n.fieldEntities.every(function(y){return!mL(y.getNamePath(),a)})){var m=n.store;n.updateStore(Ls(m,a,p,!0)),n.notifyObservers(m,[a],{type:"remove"}),n.triggerDependenciesUpdate(m,a)}}n.notifyWatch([a])}}),Ee(this,"dispatch",function(r){switch(r.type){case"updateValue":{var a=r.namePath,s=r.value;n.updateValue(a,s);break}case"validateField":{var u=r.namePath,f=r.triggerName;n.validateFields([u],{triggerName:f});break}}}),Ee(this,"notifyObservers",function(r,a,s){if(n.subscribable){var u=$e($e({},s),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(f){var d=f.onStoreChange;d(r,a,u)})}else n.forceRootUpdate()}),Ee(this,"triggerDependenciesUpdate",function(r,a){var s=n.getDependencyChildrenFields(a);return s.length&&n.validateFields(s),n.notifyObservers(r,s,{type:"dependenciesUpdate",relatedFields:[a].concat(Ft(s))}),s}),Ee(this,"updateValue",function(r,a){var s=ei(r),u=n.store;n.updateStore(Ls(n.store,s,a)),n.notifyObservers(u,[s],{type:"valueUpdate",source:"internal"}),n.notifyWatch([s]);var f=n.triggerDependenciesUpdate(u,s),d=n.callbacks.onValuesChange;if(d){var p=vL(n.store,[s]);d(p,n.getFieldsValue())}n.triggerOnFieldsChange([s].concat(Ft(f)))}),Ee(this,"setFieldsValue",function(r){n.warningUnhooked();var a=n.store;if(r){var s=bm(n.store,r);n.updateStore(s)}n.notifyObservers(a,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),Ee(this,"setFieldValue",function(r,a){n.setFields([{name:r,value:a,errors:[],warnings:[]}])}),Ee(this,"getDependencyChildrenFields",function(r){var a=new Set,s=[],u=new Mh;n.getFieldEntities().forEach(function(d){var p=d.props.dependencies;(p||[]).forEach(function(m){var y=ei(m);u.update(y,function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return b.add(d),b})})});var f=function d(p){var m=u.get(p)||new Set;m.forEach(function(y){if(!a.has(y)){a.add(y);var b=y.getNamePath();y.isFieldDirty()&&b.length&&(s.push(b),d(b))}})};return f(r),s}),Ee(this,"triggerOnFieldsChange",function(r,a){var s=n.callbacks.onFieldsChange;if(s){var u=n.getFields();if(a){var f=new Mh;a.forEach(function(p){var m=p.name,y=p.errors;f.set(m,y)}),u.forEach(function(p){p.errors=f.get(p.name)||p.errors})}var d=u.filter(function(p){var m=p.name;return Ph(r,m)});d.length&&s(d,u)}}),Ee(this,"validateFields",function(r,a){n.warningUnhooked();var s,u;Array.isArray(r)||typeof r=="string"||typeof a=="string"?(s=r,u=a):u=r;var f=!!s,d=f?s.map(ei):[],p=[],m=String(Date.now()),y=new Set,b=u||{},S=b.recursive,w=b.dirty;n.getFieldEntities(!0).forEach(function(k){if(f||d.push(k.getNamePath()),!(!k.props.rules||!k.props.rules.length)&&!(w&&!k.isFieldDirty())){var N=k.getNamePath();if(y.add(N.join(m)),!f||Ph(d,N,S)){var P=k.validateRules($e({validateMessages:$e($e({},dL),n.validateMessages)},u));p.push(P.then(function(){return{name:N,errors:[],warnings:[]}}).catch(function(T){var D,M=[],U=[];return(D=T.forEach)===null||D===void 0||D.call(T,function(H){var B=H.rule.warningOnly,G=H.errors;B?U.push.apply(U,Ft(G)):M.push.apply(M,Ft(G))}),M.length?Promise.reject({name:N,errors:M,warnings:U}):{name:N,errors:M,warnings:U}}))}}});var C=KK(p);n.lastValidatePromise=C,C.catch(function(k){return k}).then(function(k){var N=k.map(function(P){var T=P.name;return T});n.notifyObservers(n.store,N,{type:"validateFinish"}),n.triggerOnFieldsChange(N,k)});var x=C.then(function(){return n.lastValidatePromise===C?Promise.resolve(n.getFieldsValue(d)):Promise.reject([])}).catch(function(k){var N=k.filter(function(P){return P&&P.errors.length});return Promise.reject({values:n.getFieldsValue(d),errorFields:N,outOfDate:n.lastValidatePromise!==C})});x.catch(function(k){return k});var O=d.filter(function(k){return y.has(k.join(m))});return n.triggerOnFieldsChange(O),x}),Ee(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var a=n.callbacks.onFinish;if(a)try{a(r)}catch(s){console.error(s)}}).catch(function(r){var a=n.callbacks.onFinishFailed;a&&a(r)})}),this.forceRootUpdate=t});function SL(e){var t=z.useRef(),n=z.useState({}),r=ht(n,2),a=r[1];if(!t.current)if(e)t.current=e;else{var s=function(){a({})},u=new JK(s);t.current=u.getForm()}return[t.current]}var DT=z.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),eZ=function(t){var n=t.validateMessages,r=t.onFormChange,a=t.onFormFinish,s=t.children,u=z.useContext(DT),f=z.useRef({});return z.createElement(DT.Provider,{value:$e($e({},u),{},{validateMessages:$e($e({},u.validateMessages),n),triggerFormChange:function(p,m){r&&r(p,{changedFields:m,forms:f.current}),u.triggerFormChange(p,m)},triggerFormFinish:function(p,m){a&&a(p,{values:m,forms:f.current}),u.triggerFormFinish(p,m)},registerForm:function(p,m){p&&(f.current=$e($e({},f.current),{},Ee({},p,m))),u.registerForm(p,m)},unregisterForm:function(p){var m=$e({},f.current);delete m[p],f.current=m,u.unregisterForm(p)}})},s)},tZ=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],nZ=function(t,n){var r=t.name,a=t.initialValues,s=t.fields,u=t.form,f=t.preserve,d=t.children,p=t.component,m=p===void 0?"form":p,y=t.validateMessages,b=t.validateTrigger,S=b===void 0?"onChange":b,w=t.onValuesChange,C=t.onFieldsChange,x=t.onFinish,O=t.onFinishFailed,k=t.clearOnDestroy,N=df(t,tZ),P=z.useRef(null),T=z.useContext(DT),D=SL(u),M=ht(D,1),U=M[0],H=U.getInternalHooks(mf),B=H.useSubscribe,G=H.setInitialValues,te=H.setCallbacks,K=H.setValidateMessages,Q=H.setPreserve,Y=H.destroyForm;z.useImperativeHandle(n,function(){return $e($e({},U),{},{nativeElement:P.current})}),z.useEffect(function(){return T.registerForm(r,U),function(){T.unregisterForm(r)}},[T,U,r]),K($e($e({},T.validateMessages),y)),te({onValuesChange:w,onFieldsChange:function(ve){if(T.triggerFormChange(r,ve),C){for(var Ne=arguments.length,ke=new Array(Ne>1?Ne-1:0),Fe=1;Fe<Ne;Fe++)ke[Fe-1]=arguments[Fe];C.apply(void 0,[ve].concat(ke))}},onFinish:function(ve){T.triggerFormFinish(r,ve),x&&x(ve)},onFinishFailed:O}),Q(f);var J=z.useRef(null);G(a,!J.current),J.current||(J.current=!0),z.useEffect(function(){return function(){return Y(k)}},[]);var ne,ee=typeof d=="function";if(ee){var de=U.getFieldsValue(!0);ne=d(de,U)}else ne=d;B(!ee);var Z=z.useRef();z.useEffect(function(){GK(Z.current||[],s||[])||U.setFields(s||[]),Z.current=s},[s,U]);var oe=z.useMemo(function(){return $e($e({},U),{},{validateTrigger:S})},[U,S]),ge=z.createElement(R0.Provider,{value:null},z.createElement(Dh.Provider,{value:oe},ne));return m===!1?ge:z.createElement(m,du({},N,{ref:P,onSubmit:function(ve){ve.preventDefault(),ve.stopPropagation(),U.submit()},onReset:function(ve){var Ne;ve.preventDefault(),U.resetFields(),(Ne=N.onReset)===null||Ne===void 0||Ne.call(N,ve)}}),ge)};function EL(e){try{return JSON.stringify(e)}catch{return Math.random()}}var rZ=function(e){var t=e.join("__RC_FIELD_FORM_SPLIT__"),n=z.useRef(t);Ir(n.current===t,"`useWatch` is not support dynamic `namePath`. Please provide static instead.")};function iZ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],a=t[1],s=a===void 0?{}:a,u=dK(s)?{form:s}:s,f=u.form,d=z.useState(),p=ht(d,2),m=p[0],y=p[1],b=z.useMemo(function(){return EL(m)},[m]),S=z.useRef(b);S.current=b;var w=z.useContext(Dh),C=f||w,x=C&&C._init;Ir(t.length===2?f?x:!0:x,"useWatch requires a form instance since it can not auto detect from context.");var O=ei(r),k=z.useRef(O);return k.current=O,rZ(O),z.useEffect(function(){if(x){var N=C.getFieldsValue,P=C.getInternalHooks,T=P(mf),D=T.registerWatch,M=function(G,te){var K=u.preserve?te:G;return typeof r=="function"?r(K):pu(K,k.current)},U=D(function(B,G){var te=M(B,G),K=EL(te);S.current!==K&&(S.current=K,y(te))}),H=M(N(),N(!0));return m!==H&&y(H),U}},[x]),m}var aZ=z.forwardRef(nZ),Om=aZ;Om.FormProvider=eZ,Om.Field=yL,Om.List=XK,Om.useForm=SL,Om.useWatch=iZ;const LT=z.createContext({});LT.displayName="FormItemInputContext";const oZ=({children:e,status:t,override:n})=>{const r=z.useContext(LT),a=z.useMemo(()=>{const s=Object.assign({},r);return n&&delete s.isFormItemInput,t&&(delete s.status,delete s.hasFeedback,delete s.feedbackIcon),s},[t,n,r]);return z.createElement(LT.Provider,{value:a},e)},sZ=e=>{const{space:t,form:n,children:r}=e;if(r==null)return null;let a=r;return n&&(a=qe.createElement(oZ,{override:!0,status:!0},a)),t&&(a=qe.createElement(zX,null,a)),a},uZ=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};function lZ(e){var t=e.prefixCls,n=e.align,r=e.arrow,a=e.arrowPos,s=r||{},u=s.className,f=s.content,d=a.x,p=d===void 0?0:d,m=a.y,y=m===void 0?0:m,b=z.useRef();if(!n||!n.points)return null;var S={position:"absolute"};if(n.autoArrow!==!1){var w=n.points[0],C=n.points[1],x=w[0],O=w[1],k=C[0],N=C[1];x===k||!["t","b"].includes(x)?S.top=y:x==="t"?S.top=0:S.bottom=0,O===N||!["l","r"].includes(O)?S.left=p:O==="l"?S.left=0:S.right=0}return z.createElement("div",{ref:b,className:Pa("".concat(t,"-arrow"),u),style:S},f)}function cZ(e){var t=e.prefixCls,n=e.open,r=e.zIndex,a=e.mask,s=e.motion;return a?z.createElement(cT,du({},s,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(u){var f=u.className;return z.createElement("div",{style:{zIndex:r},className:Pa("".concat(t,"-mask"),f)})}):null}var _L=z.memo(function(e){var t=e.children;return t},function(e,t){return t.cache});_L.displayName="PopupContent";var CL=z.forwardRef(function(e,t){var n=e.popup,r=e.className,a=e.prefixCls,s=e.style,u=e.target,f=e.onVisibleChanged,d=e.open,p=e.keepDom,m=e.fresh,y=e.onClick,b=e.mask,S=e.arrow,w=e.arrowPos,C=e.align,x=e.motion,O=e.maskMotion,k=e.forceRender,N=e.getPopupContainer,P=e.autoDestroy,T=e.portal,D=e.zIndex,M=e.onMouseEnter,U=e.onMouseLeave,H=e.onPointerEnter,B=e.onPointerDownCapture,G=e.ready,te=e.offsetX,K=e.offsetY,Q=e.offsetR,Y=e.offsetB,J=e.onAlign,ne=e.onPrepare,ee=e.stretch,de=e.targetWidth,Z=e.targetHeight,oe=typeof n=="function"?n():n,ge=d||p,Se=(N==null?void 0:N.length)>0,ve=z.useState(!N||!Se),Ne=ht(ve,2),ke=Ne[0],Fe=Ne[1];if(Ma(function(){!ke&&Se&&u&&Fe(!0)},[ke,Se,u]),!ke)return null;var Ye="auto",He={left:"-1000vw",top:"-1000vh",right:Ye,bottom:Ye};if(G||!d){var me,De=C.points,se=C.dynamicInset||((me=C._experimental)===null||me===void 0?void 0:me.dynamicInset),Be=se&&De[0][1]==="r",Te=se&&De[0][0]==="b";Be?(He.right=Q,He.left=Ye):(He.left=te,He.right=Ye),Te?(He.bottom=Y,He.top=Ye):(He.top=K,He.bottom=Ye)}var Ke={};return ee&&(ee.includes("height")&&Z?Ke.height=Z:ee.includes("minHeight")&&Z&&(Ke.minHeight=Z),ee.includes("width")&&de?Ke.width=de:ee.includes("minWidth")&&de&&(Ke.minWidth=de)),d||(Ke.pointerEvents="none"),z.createElement(T,{open:k||ge,getContainer:N&&function(){return N(u)},autoDestroy:P},z.createElement(cZ,{prefixCls:a,open:d,zIndex:D,mask:b,motion:O}),z.createElement(r0,{onResize:J,disabled:!d},function(pt){return z.createElement(cT,du({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:k,leavedClassName:"".concat(a,"-hidden")},x,{onAppearPrepare:ne,onEnterPrepare:ne,visible:d,onVisibleChanged:function(yn){var Rn;x==null||(Rn=x.onVisibleChanged)===null||Rn===void 0||Rn.call(x,yn),f(yn)}}),function(It,yn){var Rn=It.className,mn=It.style,mt=Pa(a,Rn,r);return z.createElement("div",{ref:sN(pt,t,yn),className:mt,style:$e($e($e($e({"--arrow-x":"".concat(w.x||0,"px"),"--arrow-y":"".concat(w.y||0,"px")},He),Ke),mn),{},{boxSizing:"border-box",zIndex:D},s),onMouseEnter:M,onMouseLeave:U,onPointerEnter:H,onClick:y,onPointerDownCapture:B},S&&z.createElement(lZ,{prefixCls:a,arrow:S,arrowPos:w,align:C}),z.createElement(_L,{cache:!d&&!m},oe))})}))});CL.displayName="Popup";var wL=z.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,a=J1(n),s=z.useCallback(function(f){Sx(t,r?r(f):f)},[r]),u=Ex(s,_x(n));return a?z.cloneElement(n,{ref:u}):n});wL.displayName="TriggerWrapper";var xL=z.createContext(null);function TL(e){return e?Array.isArray(e)?e:[e]:[]}function fZ(e,t,n,r){return z.useMemo(function(){var a=TL(n??t),s=TL(r??t),u=new Set(a),f=new Set(s);return e&&(u.has("hover")&&(u.delete("hover"),u.add("click")),f.has("hover")&&(f.delete("hover"),f.add("click"))),[u,f]},[e,t,n,r])}function dZ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function hZ(e,t,n,r){for(var a=n.points,s=Object.keys(e),u=0;u<s.length;u+=1){var f,d=s[u];if(dZ((f=e[d])===null||f===void 0?void 0:f.points,a,r))return"".concat(t,"-placement-").concat(d)}return""}function RL(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function km(e){return e.ownerDocument.defaultView}function PT(e){for(var t=[],n=e==null?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var a=km(n).getComputedStyle(n),s=a.overflowX,u=a.overflowY,f=a.overflow;[s,u,f].some(function(d){return r.includes(d)})&&t.push(n),n=n.parentElement}return t}function Am(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(e)?t:e}function Nm(e){return Am(parseFloat(e),0)}function OL(e,t){var n=$e({},e);return(t||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var a=km(r).getComputedStyle(r),s=a.overflow,u=a.overflowClipMargin,f=a.borderTopWidth,d=a.borderBottomWidth,p=a.borderLeftWidth,m=a.borderRightWidth,y=r.getBoundingClientRect(),b=r.offsetHeight,S=r.clientHeight,w=r.offsetWidth,C=r.clientWidth,x=Nm(f),O=Nm(d),k=Nm(p),N=Nm(m),P=Am(Math.round(y.width/w*1e3)/1e3),T=Am(Math.round(y.height/b*1e3)/1e3),D=(w-C-k-N)*P,M=(b-S-x-O)*T,U=x*T,H=O*T,B=k*P,G=N*P,te=0,K=0;if(s==="clip"){var Q=Nm(u);te=Q*P,K=Q*T}var Y=y.x+B-te,J=y.y+U-K,ne=Y+y.width+2*te-B-G-D,ee=J+y.height+2*K-U-H-M;n.left=Math.max(n.left,Y),n.top=Math.max(n.top,J),n.right=Math.min(n.right,ne),n.bottom=Math.min(n.bottom,ee)}}),n}function kL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?e*(parseFloat(r[1])/100):parseFloat(n)}function AL(e,t){var n=t||[],r=ht(n,2),a=r[0],s=r[1];return[kL(e.width,a),kL(e.height,s)]}function NL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[e[0],e[1]]}function Fh(e,t){var n=t[0],r=t[1],a,s;return n==="t"?s=e.y:n==="b"?s=e.y+e.height:s=e.y+e.height/2,r==="l"?a=e.x:r==="r"?a=e.x+e.width:a=e.x+e.width/2,{x:a,y:s}}function Bl(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(r,a){return a===t?n[r]||"c":r}).join("")}function pZ(e,t,n,r,a,s,u){var f=z.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:a[r]||{}}),d=ht(f,2),p=d[0],m=d[1],y=z.useRef(0),b=z.useMemo(function(){return t?PT(t):[]},[t]),S=z.useRef({}),w=function(){S.current={}};e||w();var C=Wo(function(){if(t&&n&&e){let ri=function(Yi,bi){var so=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nn,xr=ve.x+Yi,Yn=ve.y+bi,mu=xr+Be,ji=Yn+se,ii=Math.max(xr,so.left),nt=Math.max(Yn,so.top),wt=Math.min(mu,so.right),Xn=Math.min(ji,so.bottom);return Math.max(0,(wt-ii)*(Xn-nt))},Ur=function(){Ct=ve.y+$n,Ht=Ct+se,Pt=ve.x+Pn,pr=Pt+Be};var k,N,P,T,D=t,M=D.ownerDocument,U=km(D),H=U.getComputedStyle(D),B=H.width,G=H.height,te=H.position,K=D.style.left,Q=D.style.top,Y=D.style.right,J=D.style.bottom,ne=D.style.overflow,ee=$e($e({},a[r]),s),de=M.createElement("div");(k=D.parentElement)===null||k===void 0||k.appendChild(de),de.style.left="".concat(D.offsetLeft,"px"),de.style.top="".concat(D.offsetTop,"px"),de.style.position=te,de.style.height="".concat(D.offsetHeight,"px"),de.style.width="".concat(D.offsetWidth,"px"),D.style.left="0",D.style.top="0",D.style.right="auto",D.style.bottom="auto",D.style.overflow="hidden";var Z;if(Array.isArray(n))Z={x:n[0],y:n[1],width:0,height:0};else{var oe,ge,Se=n.getBoundingClientRect();Se.x=(oe=Se.x)!==null&&oe!==void 0?oe:Se.left,Se.y=(ge=Se.y)!==null&&ge!==void 0?ge:Se.top,Z={x:Se.x,y:Se.y,width:Se.width,height:Se.height}}var ve=D.getBoundingClientRect();ve.x=(N=ve.x)!==null&&N!==void 0?N:ve.left,ve.y=(P=ve.y)!==null&&P!==void 0?P:ve.top;var Ne=M.documentElement,ke=Ne.clientWidth,Fe=Ne.clientHeight,Ye=Ne.scrollWidth,He=Ne.scrollHeight,me=Ne.scrollTop,De=Ne.scrollLeft,se=ve.height,Be=ve.width,Te=Z.height,Ke=Z.width,pt={left:0,top:0,right:ke,bottom:Fe},It={left:-De,top:-me,right:Ye-De,bottom:He-me},yn=ee.htmlRegion,Rn="visible",mn="visibleFirst";yn!=="scroll"&&yn!==mn&&(yn=Rn);var mt=yn===mn,Ot=OL(It,b),Xe=OL(pt,b),Nn=yn===Rn?Xe:Ot,Bt=mt?Xe:Nn;D.style.left="auto",D.style.top="auto",D.style.right="0",D.style.bottom="0";var On=D.getBoundingClientRect();D.style.left=K,D.style.top=Q,D.style.right=Y,D.style.bottom=J,D.style.overflow=ne,(T=D.parentElement)===null||T===void 0||T.removeChild(de);var hr=Am(Math.round(Be/parseFloat(B)*1e3)/1e3),ur=Am(Math.round(se/parseFloat(G)*1e3)/1e3);if(hr===0||ur===0||fm(n)&&!$X(n))return;var Lt=ee.offset,Qe=ee.targetOffset,Ze=AL(ve,Lt),lt=ht(Ze,2),At=lt[0],an=lt[1],er=AL(Z,Qe),Dn=ht(er,2),Bn=Dn[0],Ln=Dn[1];Z.x-=Bn,Z.y-=Ln;var Qn=ee.points||[],Wn=ht(Qn,2),Fa=Wn[0],Li=Wn[1],Pr=NL(Li),Mr=NL(Fa),ro=Fh(Z,Pr),Fr=Fh(ve,Mr),mi=$e({},ee),Pn=ro.x-Fr.x+At,$n=ro.y-Fr.y+an,Or=ri(Pn,$n),kr=ri(Pn,$n,Xe),ti=Fh(Z,["t","l"]),Sr=Fh(ve,["t","l"]),io=Fh(Z,["b","r"]),ja=Fh(ve,["b","r"]),Pi=ee.overflow||{},ae=Pi.adjustX,ze=Pi.adjustY,Je=Pi.shiftX,it=Pi.shiftY,Yt=function(bi){return typeof bi=="boolean"?bi:bi>=0},Ct,Ht,Pt,pr;Ur();var Mn=Yt(ze),tr=Mr[0]===Pr[0];if(Mn&&Mr[0]==="t"&&(Ht>Bt.bottom||S.current.bt)){var kn=$n;tr?kn-=se-Te:kn=ti.y-ja.y-an;var ni=ri(Pn,kn),Gi=ri(Pn,kn,Xe);ni>Or||ni===Or&&(!mt||Gi>=kr)?(S.current.bt=!0,$n=kn,an=-an,mi.points=[Bl(Mr,0),Bl(Pr,0)]):S.current.bt=!1}if(Mn&&Mr[0]==="b"&&(Ct<Bt.top||S.current.tb)){var bn=$n;tr?bn+=se-Te:bn=io.y-Sr.y-an;var zt=ri(Pn,bn),Ia=ri(Pn,bn,Xe);zt>Or||zt===Or&&(!mt||Ia>=kr)?(S.current.tb=!0,$n=bn,an=-an,mi.points=[Bl(Mr,0),Bl(Pr,0)]):S.current.tb=!1}var xo=Yt(ae),Yo=Mr[1]===Pr[1];if(xo&&Mr[1]==="l"&&(pr>Bt.right||S.current.rl)){var gi=Pn;Yo?gi-=Be-Ke:gi=ti.x-ja.x-At;var To=ri(gi,$n),ao=ri(gi,$n,Xe);To>Or||To===Or&&(!mt||ao>=kr)?(S.current.rl=!0,Pn=gi,At=-At,mi.points=[Bl(Mr,1),Bl(Pr,1)]):S.current.rl=!1}if(xo&&Mr[1]==="r"&&(Pt<Bt.left||S.current.lr)){var Qi=Pn;Yo?Qi+=Be-Ke:Qi=io.x-Sr.x-At;var Xo=ri(Qi,$n),Ko=ri(Qi,$n,Xe);Xo>Or||Xo===Or&&(!mt||Ko>=kr)?(S.current.lr=!0,Pn=Qi,At=-At,mi.points=[Bl(Mr,1),Bl(Pr,1)]):S.current.lr=!1}Ur();var Mi=Je===!0?0:Je;typeof Mi=="number"&&(Pt<Xe.left&&(Pn-=Pt-Xe.left-At,Z.x+Ke<Xe.left+Mi&&(Pn+=Z.x-Xe.left+Ke-Mi)),pr>Xe.right&&(Pn-=pr-Xe.right-At,Z.x>Xe.right-Mi&&(Pn+=Z.x-Xe.right+Mi)));var yi=it===!0?0:it;typeof yi=="number"&&(Ct<Xe.top&&($n-=Ct-Xe.top-an,Z.y+Te<Xe.top+yi&&($n+=Z.y-Xe.top+Te-yi)),Ht>Xe.bottom&&($n-=Ht-Xe.bottom-an,Z.y>Xe.bottom-yi&&($n+=Z.y-Xe.bottom+yi)));var ya=ve.x+Pn,ba=ya+Be,$r=ve.y+$n,oo=$r+se,Fi=Z.x,Ro=Fi+Ke,$a=Z.y,Oo=$a+Te,Zo=Math.max(ya,Fi),Jo=Math.min(ba,Ro),es=(Zo+Jo)/2,vu=es-ya,Ua=Math.max($r,$a),ko=Math.min(oo,Oo),Sa=(Ua+ko)/2,un=Sa-$r;u==null||u(t,mi);var ts=On.right-ve.x-(Pn+ve.width),qr=On.bottom-ve.y-($n+ve.height);hr===1&&(Pn=Math.round(Pn),ts=Math.round(ts)),ur===1&&($n=Math.round($n),qr=Math.round(qr));var Nt={ready:!0,offsetX:Pn/hr,offsetY:$n/ur,offsetR:ts/hr,offsetB:qr/ur,arrowX:vu/hr,arrowY:un/ur,scaleX:hr,scaleY:ur,align:mi};m(Nt)}}),x=function(){y.current+=1;var N=y.current;Promise.resolve().then(function(){y.current===N&&C()})},O=function(){m(function(N){return $e($e({},N),{},{ready:!1})})};return Ma(O,[r]),Ma(function(){e||O()},[e]),[p.ready,p.offsetX,p.offsetY,p.offsetR,p.offsetB,p.arrowX,p.arrowY,p.scaleX,p.scaleY,p.align,x]}function vZ(e,t,n,r,a){Ma(function(){if(e&&t&&n){let y=function(){r(),a()};var s=t,u=n,f=PT(s),d=PT(u),p=km(u),m=new Set([p].concat(Ft(f),Ft(d)));return m.forEach(function(b){b.addEventListener("scroll",y,{passive:!0})}),p.addEventListener("resize",y,{passive:!0}),r(),function(){m.forEach(function(b){b.removeEventListener("scroll",y),p.removeEventListener("resize",y)})}}},[e,t,n])}function mZ(e,t,n,r,a,s,u,f){var d=z.useRef(e);d.current=e;var p=z.useRef(!1);z.useEffect(function(){if(t&&r&&(!a||s)){var y=function(){p.current=!1},b=function(P){var T;d.current&&!u(((T=P.composedPath)===null||T===void 0||(T=T.call(P))===null||T===void 0?void 0:T[0])||P.target)&&!p.current&&f(!1)},S=km(r);S.addEventListener("pointerdown",y,!0),S.addEventListener("mousedown",b,!0),S.addEventListener("contextmenu",b,!0);var w=mT(n);w&&(w.addEventListener("mousedown",b,!0),w.addEventListener("contextmenu",b,!0));{var C,x,O=n==null||(C=n.getRootNode)===null||C===void 0?void 0:C.call(n),k=(x=r.getRootNode)===null||x===void 0?void 0:x.call(r);_h(O===k,"trigger element and popup element should in same shadow root.")}return function(){S.removeEventListener("pointerdown",y,!0),S.removeEventListener("mousedown",b,!0),S.removeEventListener("contextmenu",b,!0),w&&(w.removeEventListener("mousedown",b,!0),w.removeEventListener("contextmenu",b,!0))}}},[t,n,r,a,s]);function m(){p.current=!0}return m}var gZ=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function yZ(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yT,t=z.forwardRef(function(n,r){var a=n.prefixCls,s=a===void 0?"rc-trigger-popup":a,u=n.children,f=n.action,d=f===void 0?"hover":f,p=n.showAction,m=n.hideAction,y=n.popupVisible,b=n.defaultPopupVisible,S=n.onPopupVisibleChange,w=n.afterPopupVisibleChange,C=n.mouseEnterDelay,x=n.mouseLeaveDelay,O=x===void 0?.1:x,k=n.focusDelay,N=n.blurDelay,P=n.mask,T=n.maskClosable,D=T===void 0?!0:T,M=n.getPopupContainer,U=n.forceRender,H=n.autoDestroy,B=n.destroyPopupOnHide,G=n.popup,te=n.popupClassName,K=n.popupStyle,Q=n.popupPlacement,Y=n.builtinPlacements,J=Y===void 0?{}:Y,ne=n.popupAlign,ee=n.zIndex,de=n.stretch,Z=n.getPopupClassNameFromAlign,oe=n.fresh,ge=n.alignPoint,Se=n.onPopupClick,ve=n.onPopupAlign,Ne=n.arrow,ke=n.popupMotion,Fe=n.maskMotion,Ye=n.popupTransitionName,He=n.popupAnimation,me=n.maskTransitionName,De=n.maskAnimation,se=n.className,Be=n.getTriggerDOMNode,Te=df(n,gZ),Ke=H||B||!1,pt=z.useState(!1),It=ht(pt,2),yn=It[0],Rn=It[1];Ma(function(){Rn(uZ())},[]);var mn=z.useRef({}),mt=z.useContext(xL),Ot=z.useMemo(function(){return{registerSubPopup:function(wt,Xn){mn.current[wt]=Xn,mt==null||mt.registerSubPopup(wt,Xn)}}},[mt]),Xe=rL(),Nn=z.useState(null),Bt=ht(Nn,2),On=Bt[0],hr=Bt[1],ur=z.useRef(null),Lt=Wo(function(nt){ur.current=nt,fm(nt)&&On!==nt&&hr(nt),mt==null||mt.registerSubPopup(Xe,nt)}),Qe=z.useState(null),Ze=ht(Qe,2),lt=Ze[0],At=Ze[1],an=z.useRef(null),er=Wo(function(nt){fm(nt)&<!==nt&&(At(nt),an.current=nt)}),Dn=z.Children.only(u),Bn=(Dn==null?void 0:Dn.props)||{},Ln={},Qn=Wo(function(nt){var wt,Xn,Tr=lt;return(Tr==null?void 0:Tr.contains(nt))||((wt=mT(Tr))===null||wt===void 0?void 0:wt.host)===nt||nt===Tr||(On==null?void 0:On.contains(nt))||((Xn=mT(On))===null||Xn===void 0?void 0:Xn.host)===nt||nt===On||Object.values(mn.current).some(function(lr){return(lr==null?void 0:lr.contains(nt))||nt===lr})}),Wn=RL(s,ke,He,Ye),Fa=RL(s,Fe,De,me),Li=z.useState(b||!1),Pr=ht(Li,2),Mr=Pr[0],ro=Pr[1],Fr=y??Mr,mi=Wo(function(nt){y===void 0&&ro(nt)});Ma(function(){ro(y||!1)},[y]);var Pn=z.useRef(Fr);Pn.current=Fr;var $n=z.useRef([]);$n.current=[];var Or=Wo(function(nt){var wt;mi(nt),((wt=$n.current[$n.current.length-1])!==null&&wt!==void 0?wt:Fr)!==nt&&($n.current.push(nt),S==null||S(nt))}),kr=z.useRef(),ti=function(){clearTimeout(kr.current)},Sr=function(wt){var Xn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;ti(),Xn===0?Or(wt):kr.current=setTimeout(function(){Or(wt)},Xn*1e3)};z.useEffect(function(){return ti},[]);var io=z.useState(!1),ja=ht(io,2),Pi=ja[0],ae=ja[1];Ma(function(nt){(!nt||Fr)&&ae(!0)},[Fr]);var ze=z.useState(null),Je=ht(ze,2),it=Je[0],Yt=Je[1],Ct=z.useState(null),Ht=ht(Ct,2),Pt=Ht[0],pr=Ht[1],Mn=function(wt){pr([wt.clientX,wt.clientY])},tr=pZ(Fr,On,ge&&Pt!==null?Pt:lt,Q,J,ne,ve),kn=ht(tr,11),ni=kn[0],Gi=kn[1],bn=kn[2],zt=kn[3],Ia=kn[4],xo=kn[5],Yo=kn[6],gi=kn[7],To=kn[8],ao=kn[9],Qi=kn[10],Xo=fZ(yn,d,p,m),Ko=ht(Xo,2),Mi=Ko[0],yi=Ko[1],ya=Mi.has("click"),ba=yi.has("click")||yi.has("contextMenu"),$r=Wo(function(){Pi||Qi()}),oo=function(){Pn.current&&ge&&ba&&Sr(!1)};vZ(Fr,lt,On,$r,oo),Ma(function(){$r()},[Pt,Q]),Ma(function(){Fr&&!(J!=null&&J[Q])&&$r()},[JSON.stringify(ne)]);var Fi=z.useMemo(function(){var nt=hZ(J,s,ao,ge);return Pa(nt,Z==null?void 0:Z(ao))},[ao,Z,J,s,ge]);z.useImperativeHandle(r,function(){return{nativeElement:an.current,popupElement:ur.current,forceAlign:$r}});var Ro=z.useState(0),$a=ht(Ro,2),Oo=$a[0],Zo=$a[1],Jo=z.useState(0),es=ht(Jo,2),vu=es[0],Ua=es[1],ko=function(){if(de&<){var wt=lt.getBoundingClientRect();Zo(wt.width),Ua(wt.height)}},Sa=function(){ko(),$r()},un=function(wt){ae(!1),Qi(),w==null||w(wt)},ts=function(){return new Promise(function(wt){ko(),Yt(function(){return wt})})};Ma(function(){it&&(Qi(),it(),Yt(null))},[it]);function qr(nt,wt,Xn,Tr){Ln[nt]=function(lr){var Ao;Tr==null||Tr(lr),Sr(wt,Xn);for(var Bu=arguments.length,Sn=new Array(Bu>1?Bu-1:0),hn=1;hn<Bu;hn++)Sn[hn-1]=arguments[hn];(Ao=Bn[nt])===null||Ao===void 0||Ao.call.apply(Ao,[Bn,lr].concat(Sn))}}(ya||ba)&&(Ln.onClick=function(nt){var wt;Pn.current&&ba?Sr(!1):!Pn.current&&ya&&(Mn(nt),Sr(!0));for(var Xn=arguments.length,Tr=new Array(Xn>1?Xn-1:0),lr=1;lr<Xn;lr++)Tr[lr-1]=arguments[lr];(wt=Bn.onClick)===null||wt===void 0||wt.call.apply(wt,[Bn,nt].concat(Tr))});var Nt=mZ(Fr,ba,lt,On,P,D,Qn,Sr),ri=Mi.has("hover"),Ur=yi.has("hover"),Yi,bi;ri&&(qr("onMouseEnter",!0,C,function(nt){Mn(nt)}),qr("onPointerEnter",!0,C,function(nt){Mn(nt)}),Yi=function(wt){(Fr||Pi)&&On!==null&&On!==void 0&&On.contains(wt.target)&&Sr(!0,C)},ge&&(Ln.onMouseMove=function(nt){var wt;(wt=Bn.onMouseMove)===null||wt===void 0||wt.call(Bn,nt)})),Ur&&(qr("onMouseLeave",!1,O),qr("onPointerLeave",!1,O),bi=function(){Sr(!1,O)}),Mi.has("focus")&&qr("onFocus",!0,k),yi.has("focus")&&qr("onBlur",!1,N),Mi.has("contextMenu")&&(Ln.onContextMenu=function(nt){var wt;Pn.current&&yi.has("contextMenu")?Sr(!1):(Mn(nt),Sr(!0)),nt.preventDefault();for(var Xn=arguments.length,Tr=new Array(Xn>1?Xn-1:0),lr=1;lr<Xn;lr++)Tr[lr-1]=arguments[lr];(wt=Bn.onContextMenu)===null||wt===void 0||wt.call.apply(wt,[Bn,nt].concat(Tr))}),se&&(Ln.className=Pa(Bn.className,se));var so=$e($e({},Bn),Ln),xr={},Yn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Yn.forEach(function(nt){Te[nt]&&(xr[nt]=function(){for(var wt,Xn=arguments.length,Tr=new Array(Xn),lr=0;lr<Xn;lr++)Tr[lr]=arguments[lr];(wt=so[nt])===null||wt===void 0||wt.call.apply(wt,[so].concat(Tr)),Te[nt].apply(Te,Tr)})});var mu=z.cloneElement(Dn,$e($e({},so),xr)),ji={x:xo,y:Yo},ii=Ne?$e({},Ne!==!0?Ne:{}):null;return z.createElement(z.Fragment,null,z.createElement(r0,{disabled:!Fr,ref:er,onResize:Sa},z.createElement(wL,{getTriggerDOMNode:Be},mu)),z.createElement(xL.Provider,{value:Ot},z.createElement(CL,{portal:e,ref:Lt,prefixCls:s,popup:G,className:Pa(te,Fi),style:K,target:lt,onMouseEnter:Yi,onMouseLeave:bi,onPointerEnter:Yi,zIndex:ee,open:Fr,keepDom:Pi,fresh:oe,onClick:Se,onPointerDownCapture:Nt,mask:P,motion:Wn,maskMotion:Fa,onVisibleChanged:un,onPrepare:ts,forceRender:U,autoDestroy:Ke,getPopupContainer:M,align:ao,arrow:ii,arrowPos:ji,ready:ni,offsetX:Gi,offsetY:bn,offsetR:zt,offsetB:Ia,onAlign:$r,stretch:de,targetWidth:Oo/gi,targetHeight:vu/To})))});return t.displayName="Trigger",t}const bZ=yZ(yT);function DL(e){var t=e.children,n=e.prefixCls,r=e.id,a=e.overlayInnerStyle,s=e.bodyClassName,u=e.className,f=e.style;return z.createElement("div",{className:Pa("".concat(n,"-content"),u),style:f},z.createElement("div",{className:Pa("".concat(n,"-inner"),s),id:r,role:"tooltip",style:a},typeof t=="function"?t():t))}var jh={shiftX:64,adjustY:1},Ih={adjustX:1,shiftY:!0},Qo=[0,0],SZ={left:{points:["cr","cl"],overflow:Ih,offset:[-4,0],targetOffset:Qo},right:{points:["cl","cr"],overflow:Ih,offset:[4,0],targetOffset:Qo},top:{points:["bc","tc"],overflow:jh,offset:[0,-4],targetOffset:Qo},bottom:{points:["tc","bc"],overflow:jh,offset:[0,4],targetOffset:Qo},topLeft:{points:["bl","tl"],overflow:jh,offset:[0,-4],targetOffset:Qo},leftTop:{points:["tr","tl"],overflow:Ih,offset:[-4,0],targetOffset:Qo},topRight:{points:["br","tr"],overflow:jh,offset:[0,-4],targetOffset:Qo},rightTop:{points:["tl","tr"],overflow:Ih,offset:[4,0],targetOffset:Qo},bottomRight:{points:["tr","br"],overflow:jh,offset:[0,4],targetOffset:Qo},rightBottom:{points:["bl","br"],overflow:Ih,offset:[4,0],targetOffset:Qo},bottomLeft:{points:["tl","bl"],overflow:jh,offset:[0,4],targetOffset:Qo},leftBottom:{points:["br","bl"],overflow:Ih,offset:[-4,0],targetOffset:Qo}},EZ=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],_Z=function(t,n){var r=t.overlayClassName,a=t.trigger,s=a===void 0?["hover"]:a,u=t.mouseEnterDelay,f=u===void 0?0:u,d=t.mouseLeaveDelay,p=d===void 0?.1:d,m=t.overlayStyle,y=t.prefixCls,b=y===void 0?"rc-tooltip":y,S=t.children,w=t.onVisibleChange,C=t.afterVisibleChange,x=t.transitionName,O=t.animation,k=t.motion,N=t.placement,P=N===void 0?"right":N,T=t.align,D=T===void 0?{}:T,M=t.destroyTooltipOnHide,U=M===void 0?!1:M,H=t.defaultVisible,B=t.getTooltipContainer,G=t.overlayInnerStyle;t.arrowContent;var te=t.overlay,K=t.id,Q=t.showArrow,Y=Q===void 0?!0:Q,J=t.classNames,ne=t.styles,ee=df(t,EZ),de=rL(K),Z=z.useRef(null);z.useImperativeHandle(n,function(){return Z.current});var oe=$e({},ee);"visible"in t&&(oe.popupVisible=t.visible);var ge=function(){return z.createElement(DL,{key:"content",prefixCls:b,id:de,bodyClassName:J==null?void 0:J.body,overlayInnerStyle:$e($e({},G),ne==null?void 0:ne.body)},te)},Se=function(){var Ne=z.Children.only(S),ke=(Ne==null?void 0:Ne.props)||{},Fe=$e($e({},ke),{},{"aria-describedby":te?de:null});return z.cloneElement(S,Fe)};return z.createElement(bZ,du({popupClassName:Pa(r,J==null?void 0:J.root),prefixCls:b,popup:ge,action:s,builtinPlacements:SZ,popupPlacement:P,ref:Z,popupAlign:D,getPopupContainer:B,onPopupVisibleChange:w,afterPopupVisibleChange:C,popupTransitionName:x,popupAnimation:O,popupMotion:k,defaultPopupVisible:H,autoDestroy:U,mouseLeaveDelay:p,popupStyle:$e($e({},m),ne==null?void 0:ne.root),mouseEnterDelay:f,arrow:Y},oe),Se())};const CZ=z.forwardRef(_Z);function wZ(e){const{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,a=t/2,s=0,u=a,f=r*1/Math.sqrt(2),d=a-r*(1-1/Math.sqrt(2)),p=a-n*(1/Math.sqrt(2)),m=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),y=2*a-p,b=m,S=2*a-f,w=d,C=2*a-s,x=u,O=a*Math.sqrt(2)+r*(Math.sqrt(2)-2),k=r*(Math.sqrt(2)-1),N=`polygon(${k}px 100%, 50% ${k}px, ${2*a-k}px 100%, ${k}px 100%)`,P=`path('M ${s} ${u} A ${r} ${r} 0 0 0 ${f} ${d} L ${p} ${m} A ${n} ${n} 0 0 1 ${y} ${b} L ${S} ${w} A ${r} ${r} 0 0 0 ${C} ${x} Z')`;return{arrowShadowWidth:O,arrowPath:P,arrowPolygon:N}}const xZ=(e,t,n)=>{const{sizePopupArrow:r,arrowPolygon:a,arrowPath:s,arrowShadowWidth:u,borderRadiusXS:f,calc:d}=e;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:d(r).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[a,s]},content:'""'},"&::after":{content:'""',position:"absolute",width:u,height:u,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${hf(f)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},LL=8;function PL(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?LL:r}}function k0(e,t){return e?t:{}}function TZ(e,t,n){const{componentCls:r,boxShadowPopoverArrow:a,arrowOffsetVertical:s,arrowOffsetHorizontal:u}=e,{arrowDistance:f=0,arrowPlacement:d={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},xZ(e,t,a)),{"&:before":{background:t}})]},k0(!!d.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:f,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":u,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:u}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${hf(u)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:u}}}})),k0(!!d.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:f,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":u,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:u}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${hf(u)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:u}}}})),k0(!!d.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:f},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:s},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:s}})),k0(!!d.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:f},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:s},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:s}}))}}function RZ(e,t,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const a=r&&typeof r=="object"?r:{},s={};switch(e){case"top":case"bottom":s.shiftX=t.arrowOffsetHorizontal*2+n,s.shiftY=!0,s.adjustY=!0;break;case"left":case"right":s.shiftY=t.arrowOffsetVertical*2+n,s.shiftX=!0,s.adjustX=!0;break}const u=Object.assign(Object.assign({},s),a);return u.shiftX||(u.adjustX=!0),u.shiftY||(u.adjustY=!0),u}const ML={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},OZ={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},kZ=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function AZ(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:a,borderRadius:s}=e,u=t/2,f={};return Object.keys(ML).forEach(d=>{const p=r&&OZ[d]||ML[d],m=Object.assign(Object.assign({},p),{offset:[0,0],dynamicInset:!0});switch(f[d]=m,kZ.has(d)&&(m.autoArrow=!1),d){case"top":case"topLeft":case"topRight":m.offset[1]=-u-a;break;case"bottom":case"bottomLeft":case"bottomRight":m.offset[1]=u+a;break;case"left":case"leftTop":case"leftBottom":m.offset[0]=-u-a;break;case"right":case"rightTop":case"rightBottom":m.offset[0]=u+a;break}const y=PL({contentRadius:s,limitVerticalRadius:!0});if(r)switch(d){case"topLeft":case"bottomLeft":m.offset[0]=-y.arrowOffsetHorizontal-u;break;case"topRight":case"bottomRight":m.offset[0]=y.arrowOffsetHorizontal+u;break;case"leftTop":case"rightTop":m.offset[1]=-y.arrowOffsetHorizontal*2+u;break;case"leftBottom":case"rightBottom":m.offset[1]=y.arrowOffsetHorizontal*2-u;break}m.overflow=RZ(d,y,t,n),m.htmlRegion="visibleFirst"}),f}const NZ=e=>{const{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:a,tooltipBg:s,tooltipBorderRadius:u,zIndexPopup:f,controlHeight:d,boxShadowSecondary:p,paddingSM:m,paddingXS:y,arrowOffsetHorizontal:b,sizePopupArrow:S}=e,w=t(u).add(S).add(b).equal(),C=t(u).mul(2).add(S).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},rX(e)),{position:"absolute",zIndex:f,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":s,[`${n}-inner`]:{minWidth:C,minHeight:d,padding:`${hf(e.calc(m).div(2).equal())} ${hf(y)}`,color:a,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:s,borderRadius:u,boxShadow:p,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:w},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:e.min(u,LL)}},[`${n}-content`]:{position:"relative"}}),lX(e,(x,{darkColor:O})=>({[`&${n}-${x}`]:{[`${n}-inner`]:{backgroundColor:O},[`${n}-arrow`]:{"--antd-arrow-background-color":O}}}))),{"&-rtl":{direction:"rtl"}})},TZ(e,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},DZ=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},PL({contentRadius:e.borderRadius,limitVerticalRadius:!0})),wZ(S0(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)}))),FL=(e,t=!0)=>uX("Tooltip",r=>{const{borderRadius:a,colorTextLightSolid:s,colorBgSpotlight:u}=r,f=S0(r,{tooltipMaxWidth:250,tooltipColor:s,tooltipBorderRadius:a,tooltipBg:u});return[NZ(f),nK(r,"zoom-big-fast")]},DZ,{resetStyle:!1,injectStyle:t})(e),LZ=E0.map(e=>`${e}-inverse`);function PZ(e,t=!0){return t?[].concat(Ft(LZ),Ft(E0)).includes(e):E0.includes(e)}function jL(e,t){const n=PZ(t),r=Pa({[`${e}-${t}`]:t&&n}),a={},s={};return t&&!n&&(a.background=t,s["--antd-arrow-background-color"]=t),{className:r,overlayStyle:a,arrowStyle:s}}const MZ=e=>{const{prefixCls:t,className:n,placement:r="top",title:a,color:s,overlayInnerStyle:u}=e,{getPrefixCls:f}=z.useContext(_m),d=f("tooltip",t),[p,m,y]=FL(d),b=jL(d,s),S=b.arrowStyle,w=Object.assign(Object.assign({},u),b.overlayStyle),C=Pa(m,y,d,`${d}-pure`,`${d}-placement-${r}`,n,b.className);return p(z.createElement("div",{className:C,style:S},z.createElement("div",{className:`${d}-arrow`}),z.createElement(DL,Object.assign({},e,{className:m,prefixCls:d,overlayInnerStyle:w}),a)))};var FZ=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};const MT=z.forwardRef((e,t)=>{var n,r;const{prefixCls:a,openClassName:s,getTooltipContainer:u,color:f,overlayInnerStyle:d,children:p,afterOpenChange:m,afterVisibleChange:y,destroyTooltipOnHide:b,destroyOnHidden:S,arrow:w=!0,title:C,overlay:x,builtinPlacements:O,arrowPointAtCenter:k=!1,autoAdjustOverflow:N=!0,motion:P,getPopupContainer:T,placement:D="top",mouseEnterDelay:M=.1,mouseLeaveDelay:U=.1,overlayStyle:H,rootClassName:B,overlayClassName:G,styles:te,classNames:K}=e,Q=FZ(e,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","destroyOnHidden","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),Y=!!w,[,J]=uT(),{getPopupContainer:ne,getPrefixCls:ee,direction:de,className:Z,style:oe,classNames:ge,styles:Se}=$Y("tooltip"),ve=uD("Tooltip"),Ne=z.useRef(null),ke=()=>{var Ze;(Ze=Ne.current)===null||Ze===void 0||Ze.forceAlign()};z.useImperativeHandle(t,()=>{var Ze,lt;return{forceAlign:ke,forcePopupAlign:()=>{ve.deprecated(!1,"forcePopupAlign","forceAlign"),ke()},nativeElement:(Ze=Ne.current)===null||Ze===void 0?void 0:Ze.nativeElement,popupElement:(lt=Ne.current)===null||lt===void 0?void 0:lt.popupElement}}),[["visible","open"],["defaultVisible","defaultOpen"],["onVisibleChange","onOpenChange"],["afterVisibleChange","afterOpenChange"],["destroyTooltipOnHide","destroyOnHidden"],["arrowPointAtCenter","arrow={{ pointAtCenter: true }}"],["overlayStyle","styles={{ root: {} }}"],["overlayInnerStyle","styles={{ body: {} }}"],["overlayClassName",'classNames={{ root: "" }}']].forEach(([Ze,lt])=>{ve.deprecated(!(Ze in e),Ze,lt)}),ve(!b||typeof b=="boolean","usage","`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly."),ve(!w||typeof w=="boolean"||!("arrowPointAtCenter"in w),"deprecated","`arrowPointAtCenter` in `arrow` is deprecated. Please use `pointAtCenter` instead.");const[Fe,Ye]=qY(!1,{value:(n=e.open)!==null&&n!==void 0?n:e.visible,defaultValue:(r=e.defaultOpen)!==null&&r!==void 0?r:e.defaultVisible}),He=!C&&!x&&C!==0,me=Ze=>{var lt,At;Ye(He?!1:Ze),He||((lt=e.onOpenChange)===null||lt===void 0||lt.call(e,Ze),(At=e.onVisibleChange)===null||At===void 0||At.call(e,Ze))},De=z.useMemo(()=>{var Ze,lt;let At=k;return typeof w=="object"&&(At=(lt=(Ze=w.pointAtCenter)!==null&&Ze!==void 0?Ze:w.arrowPointAtCenter)!==null&<!==void 0?lt:k),O||AZ({arrowPointAtCenter:At,autoAdjustOverflow:N,arrowWidth:Y?J.sizePopupArrow:0,borderRadius:J.borderRadius,offset:J.marginXXS})},[k,w,O,J]),se=z.useMemo(()=>C===0?C:x||C||"",[x,C]),Be=z.createElement(sZ,{space:!0},typeof se=="function"?se():se),Te=ee("tooltip",a),Ke=ee(),pt=e["data-popover-inject"];let It=Fe;!("open"in e)&&!("visible"in e)&&He&&(It=!1);const yn=z.isValidElement(p)&&!NX(p)?p:z.createElement("span",null,p),Rn=yn.props,mn=!Rn.className||typeof Rn.className=="string"?Pa(Rn.className,s||`${Te}-open`):Rn.className,[mt,Ot,Xe]=FL(Te,!pt),Nn=jL(Te,f),Bt=Nn.arrowStyle,On=Pa(G,{[`${Te}-rtl`]:de==="rtl"},Nn.className,B,Ot,Xe,Z,ge.root,K==null?void 0:K.root),hr=Pa(ge.body,K==null?void 0:K.body),[ur,Lt]=jX("Tooltip",Q.zIndex),Qe=z.createElement(CZ,Object.assign({},Q,{zIndex:ur,showArrow:Y,placement:D,mouseEnterDelay:M,mouseLeaveDelay:U,prefixCls:Te,classNames:{root:On,body:hr},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Bt),Se.root),oe),H),te==null?void 0:te.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},Se.body),d),te==null?void 0:te.body),Nn.overlayStyle)},getTooltipContainer:T||u||ne,ref:Ne,builtinPlacements:De,overlay:Be,visible:It,onVisibleChange:me,afterVisibleChange:m??y,arrowContent:z.createElement("span",{className:`${Te}-arrow-content`}),motion:{motionName:IX(Ke,"zoom-big-fast",e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:S??!!b}),It?LX(yn,{className:mn}):yn);return mt(z.createElement(gT.Provider,{value:Lt},Qe))});MT.displayName="Tooltip",MT._InternalPanelDoNotUseOrYouWillBeFired=MZ;const jZ=async(e,t)=>{const{policy:n,file:r}=e||{};return(await nx(n,r)).success?{name:e==null?void 0:e.name,title:r==null?void 0:r.name,size:r==null?void 0:r.size,sub_type:t,type:"conversation_activity_attachment"}:{}},IZ=async(e,t)=>{var r;const n=[];try{const a=[];for(let s=0;s<e.length;s+=1)(r=e[s])!=null&&r.id||a.push(jZ(e[s],t));n.push(...await Promise.all(a))}catch(a){console.error("Error occurred during file upload:",a),Zr("error","File upload fails","top-left")}return n},$Z=["image/jpeg","image/png","application/pdf"],UZ=({conversationId:e,handleCreateMessage:t})=>{const n=z.useRef(null),r=z.useRef(null),a=z.useRef(null),[s,u]=z.useState(""),[f,d]=z.useState([]),[p,m]=z.useState(!1),{handleCreateOrUpdateRealtimeStatus:y}=G7(),b=async T=>{var G;const D=T==null?void 0:T.name,M=(G=D==null?void 0:D.split)==null?void 0:G.call(D,"."),U=Jt.last(M),H=`${Vw()}.${U}`,B=await tx({name:H,sub_type:e,type:"conversation_activity_attachment"});return B!=null&&B.url?{name:H,file:T,title:D,policy:B}:(Zr("error",`${D} cannot be uploaded`,"top-left"),null)},S=async T=>{T.preventDefault();const D=5*1024*1024,M=Array.from(T.target.files);let U="";if(Jt.forEach(M,H=>{if(!$Z.includes(H.type)){U=`${H.name} is not supported. `;return}if(H.size>D){U="Each file must be under 5MB";return}}),U){Zr("error",U,"top-left");return}try{const H=[];for(let G=0;G<M.length;G+=1)H.push(b(M[G]));const B=await Promise.all(H);d(G=>[...G,...B.filter(te=>te!==null)])}catch(H){console.error("Error occurred while fetching policies:",H)}a.current.value=null},w=T=>{d(D=>D.filter((M,U)=>U!==T)),a.current&&(a.current.value="")};z.useEffect(()=>{const T=n.current,D=r.current;if(T&&D){T.style.height="auto";const U=D.offsetWidth*.5,H=Math.min(T.scrollHeight,U);T.style.height=`${H}px`,D.style.height=`${H+16}px`,T.style.overflowY=T.scrollHeight>U?"auto":"hidden"}},[s,f]);const C=f.slice(0,5),x=Math.max(0,f.length-5),O=async T=>{if(T&&T.preventDefault(),!(!s&&!f.length)){m(!0);try{const D=Jt.size(f)&&await IZ(f,e);await t({message:s,is_customer_reply:!0,...D&&{files:D}}),u(""),d([]),setTimeout(()=>{n.current&&n.current.focus()},150)}catch(D){console.error("Error sending message:",D)}finally{m(!1)}}},k=z.useMemo(()=>!jV(s)&&!Jt.size(f)||p,[s,f,p]),N=async T=>{T?await y({conversation_id:e,is_writing_reply:!0}):await y({conversation_id:e,is_writing_reply:!1})},P=T=>{T.key==="Enter"&&!T.shiftKey&&!p&&!k&&(T.preventDefault(),O(T))};return F.jsxs(F.Fragment,{children:[f.length>0&&F.jsxs("div",{className:"ed-flex ed-flex-wrap ed-items-center ed-gap-2 ed-mb-2",children:[C.map((T,D)=>F.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2 ed-text-12 ed-font-medium ed-text-border-regular ed-bg-white-light ed-p-1.5 ed-rounded-full",children:[F.jsx("span",{className:"ed-truncate ed-max-w-[100px]",children:T.name}),F.jsx("button",{type:"button",onClick:()=>w(D),className:"ed-text-border hover:ed-text-border-dark ed-flex-shrink-0",children:F.jsx(cu,{size:14})})]},T)),x>0&&F.jsxs("span",{className:"ed-text-12 ed-text-border-regular",children:["+",x," ",x===1?"item":"items"]})]}),F.jsxs("div",{ref:r,className:"ed-border ed-border-border-light ed-rounded-3xl ed-flex ed-justify-between ed-transition-all ed-duration-200",style:{padding:"8px 16px"},children:[F.jsx("div",{className:"ed-flex-1 ed-flex ed-flex-col ed-min-w-0",children:F.jsx("textarea",{ref:n,value:s,onBlur:()=>N(!1),onChange:T=>u(T.target.value),onFocus:()=>N(!0),onKeyDown:T=>P(T),rows:1,className:"ed-w-full ed-text-14 ed-min-h-[24px] ed-resize-none ed-overflow-x-auto ed-outline-none ed-bg-transparent no-scrollbar",placeholder:"Enter your message",disabled:p})}),F.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2.5 ed-ml-2 ed-flex-shrink-0",children:[F.jsx("input",{type:"file",ref:a,onChange:S,className:"ed-hidden",accept:".pdf, .png, .jpeg, .jpg",multiple:!0,disabled:p}),F.jsx(MT,{title:"Supported file types: jpg, png, pdf (max 5MB)",children:F.jsx("button",{type:"button",onClick:()=>{var T;return(T=a.current)==null?void 0:T.click()},className:"ed-text-border hover:ed-text-border-dark",children:F.jsx(xw,{className:"ed-size-5 ed-cursor-pointer"})})}),F.jsx("button",{onClick:O,type:"button",disabled:k,children:p?F.jsx(Zw,{className:"ed-size-5"}):F.jsx(kw,{className:`${k?"ed-text-border":"ed-text-brand"} ed-size-5`})})]})]})]})},IL=({from:e="knowledge-base",isAuthenticated:t,onSubmit:n,reqId:r,setFeedbackForTheArticle:a,userData:s})=>{var T,D,M;const[u,f]=z.useState([]),[d,p]=z.useState(!1),[m,y]=z.useState({}),b=e==="message",S=b?{contact_person_name:s==null?void 0:s.contact_person_name,contact_person_email:s==null?void 0:s.contact_person_email,ticket_title:m==null?void 0:m.ticket_title,ticket_activity:m==null?void 0:m.ticket_activity}:m,[w,{loading:C}]=Zc(V7),x=async()=>{var U,H;try{if(p(!0),Jt.size(u)&&Jt.size(u)>5){Zr("error","You can upload maximum 5 files","top-right");return}const B=[],G=[];Jt.forEach(u,K=>{const Q=`${Vw()}.${Jt.last(Jt.split(K.name,"."))}`;B.push({name:Q,title:K.name,size:K.size,type:"ticket_activity_attachment"}),G.push({file:K,name:Q})});const{data:te}=await w({variables:{inputData:{...S,...r,ticket_activity_files:B}}});if((U=te==null?void 0:te.createATicketForPortal)!=null&&U.id){let K=[];if(Jt.size(G)){const Q=G.map(async J=>{var ne;try{const ee=await tx({name:J.name,type:"ticket_activity_attachment",sub_type:(ne=te==null?void 0:te.createATicketForPortal)==null?void 0:ne.id});if(ee!=null&&ee.error)return Zr("error",`Failed to process ${J.name}`,"top-right"),null;const{key:de,url:Z,file:oe,success:ge}=await nx({key:ee.key,url:ee.url},J.file);return ge?{key:de,url:Z,file:oe}:null}catch(ee){return console.error(`Error processing file ${J.name}:`,ee),Zr("error",`Failed to upload ${J.name}`,"top-right"),null}});K=(await Promise.all(Q)).filter(Boolean)}n&&n({ticket_id:(H=te==null?void 0:te.createATicketForPortal)==null?void 0:H.id,ticket_title:S.ticket_title,ticket_activity:S.ticket_activity,ticket_activity_files:K})}}catch(B){Zr("error","Something went wrong","top-right"),console.error("error",B)}finally{p(!1)}},O=(U,H)=>{y(B=>({...B,[U]:H}))},k=MC(m.contact_person_email),N=!t&&(!((T=m.contact_person_name)!=null&&T.trim())||!k||!m.contact_person_email)||!((D=m.ticket_title)!=null&&D.trim())||!((M=m.ticket_activity)!=null&&M.trim()),P=()=>C||d?!0:N;return F.jsxs("div",{className:`ed-px-5 ed-pb-5 ${b&&"ed-bg-white-light ed-rounded-md ed-py-2 ed-max-w-full md:ed-max-w-[85%] ed-ml-auto"}`,children:[!b&&F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"ed-flex ed-items-start ed-justify-between ed-pt-5 ed-sticky ed-top-0 ed-bg-white",children:[F.jsx("h5",{className:"ed-text-18 ed-font-semibold ed-text-border-dark ed-mb-5",children:"Get in touch"}),F.jsx(cu,{size:24,className:"ed-text-border-dark ed-cursor-pointer",onClick:()=>a(U=>({...U,notHelpfulModal:!1}))})]}),F.jsx("p",{className:"ed-text-14 ed-font-medium ed-text-border-regular ed-mt-5 ed-mb-4 ed-inline-block ed-w-11/12",children:"Tell us how can we make our product more useful for you."})]}),F.jsxs("div",{className:"ed-space-y-4 ed-mb-6",children:[!t&&F.jsxs(F.Fragment,{children:[F.jsx(Sh,{isRequired:!0,label:"Name",placeholder:"Enter your name",value:m.contact_person_name,onChange:U=>O("contact_person_name",U.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"contact_person_name"}),F.jsx(Sh,{isRequired:!0,type:"email",label:"Email",placeholder:"Enter your email",value:m.contact_person_email,onChange:U=>O("contact_person_email",U.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"contact_person_email"}),(m==null?void 0:m.contact_person_email)&&!k&&F.jsx("span",{className:"ed-text-red ed-font-12",children:"Please enter a valid email address!"})]}),F.jsx(Sh,{isRequired:!0,label:"Subject",placeholder:"Tell us what this feedback is about",value:m.ticket_title,onChange:U=>O("ticket_title",U.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"ticket_title"}),F.jsx(I7,{label:`${t?"Summary":"Description"}`,isRequired:!0,placeholder:"Add more details for us to resolve the issue",value:m.ticket_activity,onChange:U=>O("ticket_activity",U.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"ticket_activity"}),F.jsx(U7,{subtitle:"Supported file types: jpg, png, pdf (max 5MB)",selectedFiles:u,setSelectedFiles:f})]}),F.jsx("div",{className:"ed-flex ed-justify-end",children:F.jsx(bh,{title:"Submit",loaderText:"Submitting",fullWidthBtn:!0,disabled:P(),loader:C||d,callBack:x})})]})};var FT={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GET_CONVERSATION_ACTIVITIES_FOR_PORTAL"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"queryData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ConversationActivitiesForPortalQueryInputType"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"optionData"}},type:{kind:"NamedType",name:{kind:"Name",value:"OptionDataType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getConversationActivitiesForPortal"},arguments:[{kind:"Argument",name:{kind:"Name",value:"queryData"},value:{kind:"Variable",name:{kind:"Name",value:"queryData"}}},{kind:"Argument",name:{kind:"Name",value:"optionData"},value:{kind:"Variable",name:{kind:"Name",value:"optionData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_customer_reply"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"author"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"last_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"first_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"avatar_file"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"files"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"log"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sub_context"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"new_assignee"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"last_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"first_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"meta_data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filtered_rows"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total_rows"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:765}};FT.loc.source={body:`query GET_CONVERSATION_ACTIVITIES_FOR_PORTAL(
|
|
435
435
|
$queryData: ConversationActivitiesForPortalQueryInputType!
|
|
436
436
|
$optionData: OptionDataType
|
|
437
437
|
) {
|
package/npm/ed-widget.js
CHANGED
|
@@ -251,7 +251,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
251
251
|
html body {
|
|
252
252
|
overflow-y: hidden;
|
|
253
253
|
`.concat(o?"width: calc(100% - ".concat(a,"px);"):"",`
|
|
254
|
-
}`),i)}else Cu(i);return function(){Cu(i)}},[t,i])}var FL=!1;function DL(e){return FL}var OS=function(t){return t===!1?!1:!ar()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},Cm=G.forwardRef(function(e,t){var n=e.open,r=e.autoLock,i=e.getContainer,a=e.debug,o=e.autoDestroy,u=o===void 0?!0:o,l=e.children,f=G.useState(n),d=ke(f,2),h=d[0],p=d[1],m=h||n;Gt(ar()||!n,"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR."),G.useEffect(function(){(u||n)&&p(n)},[n,u]);var y=G.useState(function(){return OS(i)}),g=ke(y,2),b=g[0],w=g[1];G.useEffect(function(){var H=OS(i);w(H??null)});var S=RL(m&&!b,a),C=ke(S,2),T=C[0],_=C[1],x=b??T;IL(r&&n&&ar()&&(x===T||x===document.body));var k=null;if(l&&_c(l)&&t){var A=l;k=A.ref}var N=kv(k,t);if(!m||!ar()||b===void 0)return null;var I=x===!1||DL(),F=l;return t&&(F=G.cloneElement(l,{ref:N})),G.createElement(xS.Provider,{value:_},I?F:wi.createPortal(F,x))});Cm.displayName="Portal";function ML(){var e=de({},G);return e.useId}var kS=0,RS=ML();const AS=RS?function(t){var n=RS();return t||n}:function(t){var n=G.useState("ssr-id"),r=ke(n,2),i=r[0],a=r[1];return G.useEffect(function(){var o=kS;kS+=1,a("rc_unique_".concat(o))},[]),t||i};var Wa="RC_FORM_INTERNAL_HOOKS",Pt=function(){Gt(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},rs=G.createContext({getFieldValue:Pt,getFieldsValue:Pt,getFieldError:Pt,getFieldWarning:Pt,getFieldsError:Pt,isFieldsTouched:Pt,isFieldTouched:Pt,isFieldValidating:Pt,isFieldsValidating:Pt,resetFields:Pt,setFields:Pt,setFieldValue:Pt,setFieldsValue:Pt,validateFields:Pt,submit:Pt,getInternalHooks:function(){return Pt(),{dispatch:Pt,initEntityValue:Pt,registerField:Pt,useSubscribe:Pt,setInitialValues:Pt,destroyForm:Pt,setCallbacks:Pt,registerWatch:Pt,getFields:Pt,setValidateMessages:Pt,setPreserve:Pt,getInitialValue:Pt}}}),Qc=G.createContext(null);function Tm(e){return e==null?[]:Array.isArray(e)?e:[e]}function jL(e){return e&&!!e._init}function Om(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var km=Om();function $L(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function VL(e,t,n){if(Nv())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&Eu(i,n.prototype),i}function Rm(e){var t=typeof Map=="function"?new Map:void 0;return Rm=function(r){if(r===null||!$L(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return VL(r,arguments,Su(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Eu(i,r)},Rm(e)}var PS={NODE_ENV:'"production"'},qL=/%[sdj%]/g,NS=function(){};typeof process<"u"&&PS&&PS.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(NS=function(t,n){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&n.every(function(r){return typeof r=="string"})&&console.warn(t,n)});function Am(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function or(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=0,a=n.length;if(typeof e=="function")return e.apply(null,n);if(typeof e=="string"){var o=e.replace(qL,function(u){if(u==="%%")return"%";if(i>=a)return u;switch(u){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return u}});return o}return e}function UL(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function ln(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||UL(t)&&typeof e=="string"&&!e)}function zL(e,t,n){var r=[],i=0,a=e.length;function o(u){r.push.apply(r,De(u||[])),i++,i===a&&n(r)}e.forEach(function(u){t(u,o)})}function LS(e,t,n){var r=0,i=e.length;function a(o){if(o&&o.length){n(o);return}var u=r;r=r+1,u<i?t(e[u],a):n([])}a([])}function HL(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,De(e[n]||[]))}),t}var IS=function(e){$a(n,e);var t=Va(n);function n(r,i){var a;return An(this,n),a=t.call(this,"Async Validation Error"),re(nt(a),"errors",void 0),re(nt(a),"fields",void 0),a.errors=r,a.fields=i,a}return Pn(n)}(Rm(Error));function BL(e,t,n,r,i){if(t.first){var a=new Promise(function(p,m){var y=function(w){return r(w),w.length?m(new IS(w,Am(w))):p(i)},g=HL(e);LS(g,n,y)});return a.catch(function(p){return p}),a}var o=t.firstFields===!0?Object.keys(e):t.firstFields||[],u=Object.keys(e),l=u.length,f=0,d=[],h=new Promise(function(p,m){var y=function(b){if(d.push.apply(d,b),f++,f===l)return r(d),d.length?m(new IS(d,Am(d))):p(i)};u.length||(r(d),p(i)),u.forEach(function(g){var b=e[g];o.indexOf(g)!==-1?LS(b,n,y):zL(b,n,y)})});return h.catch(function(p){return p}),h}function WL(e){return!!(e&&e.message!==void 0)}function GL(e,t){for(var n=e,r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function FS(e,t){return function(n){var r;return e.fullFields?r=GL(t,e.fullFields):r=t[n.field||e.fullField],WL(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function DS(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];Qe(r)==="object"&&Qe(e[n])==="object"?e[n]=de(de({},e[n]),r):e[n]=r}}return e}var is="enum",QL=function(t,n,r,i,a){t[is]=Array.isArray(t[is])?t[is]:[],t[is].indexOf(n)===-1&&i.push(or(a.messages[is],t.fullField,t[is].join(", ")))},YL=function(t,n,r,i,a){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push(or(a.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var o=new RegExp(t.pattern);o.test(n)||i.push(or(a.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},KL=function(t,n,r,i,a){var o=typeof t.len=="number",u=typeof t.min=="number",l=typeof t.max=="number",f=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=n,h=null,p=typeof n=="number",m=typeof n=="string",y=Array.isArray(n);if(p?h="number":m?h="string":y&&(h="array"),!h)return!1;y&&(d=n.length),m&&(d=n.replace(f,"_").length),o?d!==t.len&&i.push(or(a.messages[h].len,t.fullField,t.len)):u&&!l&&d<t.min?i.push(or(a.messages[h].min,t.fullField,t.min)):l&&!u&&d>t.max?i.push(or(a.messages[h].max,t.fullField,t.max)):u&&l&&(d<t.min||d>t.max)&&i.push(or(a.messages[h].range,t.fullField,t.min,t.max))},MS=function(t,n,r,i,a,o){t.required&&(!r.hasOwnProperty(t.field)||ln(n,o||t.type))&&i.push(or(a.messages.required,t.fullField))},Yc;const XL=function(){if(Yc)return Yc;var e="[a-fA-F\\d:]",t=function(x){return x&&x.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],a="(?:%[0-9a-zA-Z]{1,})?",o="(?:".concat(i.join("|"),")").concat(a),u=new RegExp("(?:^".concat(n,"$)|(?:^").concat(o,"$)")),l=new RegExp("^".concat(n,"$")),f=new RegExp("^".concat(o,"$")),d=function(x){return x&&x.exact?u:new RegExp("(?:".concat(t(x)).concat(n).concat(t(x),")|(?:").concat(t(x)).concat(o).concat(t(x),")"),"g")};d.v4=function(_){return _&&_.exact?l:new RegExp("".concat(t(_)).concat(n).concat(t(_)),"g")},d.v6=function(_){return _&&_.exact?f:new RegExp("".concat(t(_)).concat(o).concat(t(_)),"g")};var h="(?:(?:[a-z]+:)?//)",p="(?:\\S+(?::\\S*)?@)?",m=d.v4().source,y=d.v6().source,g="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",b="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",w="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",S="(?::\\d{2,5})?",C='(?:[/?#][^\\s"]*)?',T="(?:".concat(h,"|www\\.)").concat(p,"(?:localhost|").concat(m,"|").concat(y,"|").concat(g).concat(b).concat(w,")").concat(S).concat(C);return Yc=new RegExp("(?:^".concat(T,"$)"),"i"),Yc};var jS={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Fu={integer:function(t){return Fu.number(t)&&parseInt(t,10)===t},float:function(t){return Fu.number(t)&&!Fu.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return Qe(t)==="object"&&!Fu.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(jS.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(XL())},hex:function(t){return typeof t=="string"&&!!t.match(jS.hex)}},ZL=function(t,n,r,i,a){if(t.required&&n===void 0){MS(t,n,r,i,a);return}var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],u=t.type;o.indexOf(u)>-1?Fu[u](n)||i.push(or(a.messages.types[u],t.fullField,t.type)):u&&Qe(n)!==t.type&&i.push(or(a.messages.types[u],t.fullField,t.type))},JL=function(t,n,r,i,a){(/^\s+$/.test(n)||n==="")&&i.push(or(a.messages.whitespace,t.fullField))};const ut={required:MS,whitespace:JL,type:ZL,range:KL,enum:QL,pattern:YL};var eI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a)}r(o)},tI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(n==null&&!t.required)return r();ut.required(t,n,i,o,a,"array"),n!=null&&(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a))}r(o)},nI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&ut.type(t,n,i,o,a)}r(o)},rI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n,"date")&&!t.required)return r();if(ut.required(t,n,i,o,a),!ln(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),ut.type(t,l,i,o,a),l&&ut.range(t,l.getTime(),i,o,a)}}r(o)},iI="enum",aI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&ut[iI](t,n,i,o,a)}r(o)},oI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a))}r(o)},sI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a))}r(o)},uI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&ut.type(t,n,i,o,a)}r(o)},lI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(n===""&&(n=void 0),ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a))}r(o)},cI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&ut.type(t,n,i,o,a)}r(o)},fI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n,"string")&&!t.required)return r();ut.required(t,n,i,o,a),ln(n,"string")||ut.pattern(t,n,i,o,a)}r(o)},dI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),ln(n)||ut.type(t,n,i,o,a)}r(o)},hI=function(t,n,r,i,a){var o=[],u=Array.isArray(n)?"array":Qe(n);ut.required(t,n,i,o,a,u),r(o)},pI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n,"string")&&!t.required)return r();ut.required(t,n,i,o,a,"string"),ln(n,"string")||(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a),ut.pattern(t,n,i,o,a),t.whitespace===!0&&ut.whitespace(t,n,i,o,a))}r(o)},Pm=function(t,n,r,i,a){var o=t.type,u=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(ln(n,o)&&!t.required)return r();ut.required(t,n,i,u,a,o),ln(n,o)||ut.type(t,n,i,u,a)}r(u)};const Du={string:pI,method:uI,number:lI,boolean:nI,regexp:dI,integer:sI,float:oI,array:tI,object:cI,enum:aI,pattern:fI,date:rI,url:Pm,hex:Pm,email:Pm,required:hI,any:eI};var Mu=function(){function e(t){An(this,e),re(this,"rules",null),re(this,"_messages",km),this.define(t)}return Pn(e,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(Qe(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var a=n[i];r.rules[i]=Array.isArray(a)?a:[a]})}},{key:"messages",value:function(n){return n&&(this._messages=DS(Om(),n)),this._messages}},{key:"validate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},o=n,u=i,l=a;if(typeof u=="function"&&(l=u,u={}),!this.rules||Object.keys(this.rules).length===0)return l&&l(null,o),Promise.resolve(o);function f(y){var g=[],b={};function w(C){if(Array.isArray(C)){var T;g=(T=g).concat.apply(T,De(C))}else g.push(C)}for(var S=0;S<y.length;S++)w(y[S]);g.length?(b=Am(g),l(g,b)):l(null,o)}if(u.messages){var d=this.messages();d===km&&(d=Om()),DS(d,u.messages),u.messages=d}else u.messages=this.messages();var h={},p=u.keys||Object.keys(this.rules);p.forEach(function(y){var g=r.rules[y],b=o[y];g.forEach(function(w){var S=w;typeof S.transform=="function"&&(o===n&&(o=de({},o)),b=o[y]=S.transform(b),b!=null&&(S.type=S.type||(Array.isArray(b)?"array":Qe(b)))),typeof S=="function"?S={validator:S}:S=de({},S),S.validator=r.getValidationMethod(S),S.validator&&(S.field=y,S.fullField=S.fullField||y,S.type=r.getType(S),h[y]=h[y]||[],h[y].push({rule:S,value:b,source:o,field:y}))})});var m={};return BL(h,u,function(y,g){var b=y.rule,w=(b.type==="object"||b.type==="array")&&(Qe(b.fields)==="object"||Qe(b.defaultField)==="object");w=w&&(b.required||!b.required&&y.value),b.field=y.field;function S(k,A){return de(de({},A),{},{fullField:"".concat(b.fullField,".").concat(k),fullFields:b.fullFields?[].concat(De(b.fullFields),[k]):[k]})}function C(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=Array.isArray(k)?k:[k];!u.suppressWarning&&A.length&&e.warning("async-validator:",A),A.length&&b.message!==void 0&&(A=[].concat(b.message));var N=A.map(FS(b,o));if(u.first&&N.length)return m[b.field]=1,g(N);if(!w)g(N);else{if(b.required&&!y.value)return b.message!==void 0?N=[].concat(b.message).map(FS(b,o)):u.error&&(N=[u.error(b,or(u.messages.required,b.field))]),g(N);var I={};b.defaultField&&Object.keys(y.value).map(function(V){I[V]=b.defaultField}),I=de(de({},I),y.rule.fields);var F={};Object.keys(I).forEach(function(V){var D=I[V],j=Array.isArray(D)?D:[D];F[V]=j.map(S.bind(null,V))});var H=new e(F);H.messages(u.messages),y.rule.options&&(y.rule.options.messages=u.messages,y.rule.options.error=u.error),H.validate(y.value,y.rule.options||u,function(V){var D=[];N&&N.length&&D.push.apply(D,De(N)),V&&V.length&&D.push.apply(D,De(V)),g(D.length?D:null)})}}var T;if(b.asyncValidator)T=b.asyncValidator(b,y.value,C,y.source,u);else if(b.validator){try{T=b.validator(b,y.value,C,y.source,u)}catch(k){var _,x;(_=(x=console).error)===null||_===void 0||_.call(x,k),u.suppressValidatorError||setTimeout(function(){throw k},0),C(k.message)}T===!0?C():T===!1?C(typeof b.message=="function"?b.message(b.fullField||b.field):b.message||"".concat(b.fullField||b.field," fails")):T instanceof Array?C(T):T instanceof Error&&C(T.message)}T&&T.then&&T.then(function(){return C()},function(k){return C(k)})},function(y){f(y)},o)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!Du.hasOwnProperty(n.type))throw new Error(or("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),i=r.indexOf("message");return i!==-1&&r.splice(i,1),r.length===1&&r[0]==="required"?Du.required:Du[this.getType(n)]||void 0}}]),e}();re(Mu,"register",function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");Du[t]=n}),re(Mu,"warning",NS),re(Mu,"messages",km),re(Mu,"validators",Du);var sr="'${name}' is not a valid ${type}",$S={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:sr,method:sr,array:sr,object:sr,number:sr,date:sr,boolean:sr,integer:sr,float:sr,regexp:sr,email:sr,url:sr,hex:sr},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},VS=Mu;function vI(e,t){return e.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return t[r]})}var qS="CODE_LOGIC_ERROR";function Nm(e,t,n,r,i){return Lm.apply(this,arguments)}function Lm(){return Lm=Iu(Yr().mark(function e(t,n,r,i,a){var o,u,l,f,d,h,p,m,y;return Yr().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return o=de({},r),delete o.ruleIndex,VS.warning=function(){},o.validator&&(u=o.validator,o.validator=function(){try{return u.apply(void 0,arguments)}catch(w){return console.error(w),Promise.reject(qS)}}),l=null,o&&o.type==="array"&&o.defaultField&&(l=o.defaultField,delete o.defaultField),f=new VS(re({},t,[o])),d=Ru($S,i.validateMessages),f.messages(d),h=[],b.prev=10,b.next=13,Promise.resolve(f.validate(re({},t,n),de({},i)));case 13:b.next=18;break;case 15:b.prev=15,b.t0=b.catch(10),b.t0.errors&&(h=b.t0.errors.map(function(w,S){var C=w.message,T=C===qS?d.default:C;return G.isValidElement(T)?G.cloneElement(T,{key:"error_".concat(S)}):T}));case 18:if(!(!h.length&&l)){b.next=23;break}return b.next=21,Promise.all(n.map(function(w,S){return Nm("".concat(t,".").concat(S),w,l,i,a)}));case 21:return p=b.sent,b.abrupt("return",p.reduce(function(w,S){return[].concat(De(w),De(S))},[]));case 23:return m=de(de({},r),{},{name:t,enum:(r.enum||[]).join(", ")},a),y=h.map(function(w){return typeof w=="string"?vI(w,m):w}),b.abrupt("return",y);case 26:case"end":return b.stop()}},e,null,[[10,15]])})),Lm.apply(this,arguments)}function mI(e,t,n,r,i,a){var o=e.join("."),u=n.map(function(d,h){var p=d.validator,m=de(de({},d),{},{ruleIndex:h});return p&&(m.validator=function(y,g,b){var w=!1,S=function(){for(var _=arguments.length,x=new Array(_),k=0;k<_;k++)x[k]=arguments[k];Promise.resolve().then(function(){Gt(!w,"Your validator function has already return a promise. `callback` will be ignored."),w||b.apply(void 0,x)})},C=p(y,g,S);w=C&&typeof C.then=="function"&&typeof C.catch=="function",Gt(w,"`callback` is deprecated. Please return a promise instead."),w&&C.then(function(){b()}).catch(function(T){b(T||" ")})}),m}).sort(function(d,h){var p=d.warningOnly,m=d.ruleIndex,y=h.warningOnly,g=h.ruleIndex;return!!p==!!y?m-g:p?1:-1}),l;if(i===!0)l=new Promise(function(){var d=Iu(Yr().mark(function h(p,m){var y,g,b;return Yr().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:y=0;case 1:if(!(y<u.length)){S.next=12;break}return g=u[y],S.next=5,Nm(o,t,g,r,a);case 5:if(b=S.sent,!b.length){S.next=9;break}return m([{errors:b,rule:g}]),S.abrupt("return");case 9:y+=1,S.next=1;break;case 12:p([]);case 13:case"end":return S.stop()}},h)}));return function(h,p){return d.apply(this,arguments)}}());else{var f=u.map(function(d){return Nm(o,t,d,r,a).then(function(h){return{errors:h,rule:d}})});l=(i?yI(f):gI(f)).then(function(d){return Promise.reject(d)})}return l.catch(function(d){return d}),l}function gI(e){return Im.apply(this,arguments)}function Im(){return Im=Iu(Yr().mark(function e(t){return Yr().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.all(t).then(function(i){var a,o=(a=[]).concat.apply(a,De(i));return o}));case 1:case"end":return r.stop()}},e)})),Im.apply(this,arguments)}function yI(e){return Fm.apply(this,arguments)}function Fm(){return Fm=Iu(Yr().mark(function e(t){var n;return Yr().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return n=0,i.abrupt("return",new Promise(function(a){t.forEach(function(o){o.then(function(u){u.errors.length&&a([u]),n+=1,n===t.length&&a([])})})}));case 2:case"end":return i.stop()}},e)})),Fm.apply(this,arguments)}function nn(e){return Tm(e)}function US(e,t){var n={};return t.forEach(function(r){var i=si(e,r);n=Gr(n,r,i)}),n}function as(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e&&e.some(function(r){return zS(t,r,n)})}function zS(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!e||!t||!n&&e.length!==t.length?!1:t.every(function(r,i){return e[i]===r})}function bI(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||Qe(e)!=="object"||Qe(t)!=="object")return!1;var n=Object.keys(e),r=Object.keys(t),i=new Set([].concat(n,r));return De(i).every(function(a){var o=e[a],u=t[a];return typeof o=="function"&&typeof u=="function"?!0:o===u})}function _I(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&Qe(t.target)==="object"&&e in t.target?t.target[e]:t}function HS(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var i=e[t],a=t-n;return a>0?[].concat(De(e.slice(0,n)),[i],De(e.slice(n,t)),De(e.slice(t+1,r))):a<0?[].concat(De(e.slice(0,t)),De(e.slice(t+1,n+1)),[i],De(e.slice(n+1,r))):e}var wI=["name"],Tr=[];function Dm(e,t,n,r,i,a){return typeof e=="function"?e(t,n,"source"in a?{source:a.source}:{}):r!==i}var Mm=function(e){$a(n,e);var t=Va(n);function n(r){var i;if(An(this,n),i=t.call(this,r),re(nt(i),"state",{resetCount:0}),re(nt(i),"cancelRegisterFunc",null),re(nt(i),"mounted",!1),re(nt(i),"touched",!1),re(nt(i),"dirty",!1),re(nt(i),"validatePromise",void 0),re(nt(i),"prevValidating",void 0),re(nt(i),"errors",Tr),re(nt(i),"warnings",Tr),re(nt(i),"cancelRegister",function(){var l=i.props,f=l.preserve,d=l.isListField,h=l.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(d,f,nn(h)),i.cancelRegisterFunc=null}),re(nt(i),"getNamePath",function(){var l=i.props,f=l.name,d=l.fieldContext,h=d.prefixName,p=h===void 0?[]:h;return f!==void 0?[].concat(De(p),De(f)):[]}),re(nt(i),"getRules",function(){var l=i.props,f=l.rules,d=f===void 0?[]:f,h=l.fieldContext;return d.map(function(p){return typeof p=="function"?p(h):p})}),re(nt(i),"refresh",function(){i.mounted&&i.setState(function(l){var f=l.resetCount;return{resetCount:f+1}})}),re(nt(i),"metaCache",null),re(nt(i),"triggerMetaEvent",function(l){var f=i.props.onMetaChange;if(f){var d=de(de({},i.getMeta()),{},{destroy:l});rE(i.metaCache,d)||f(d),i.metaCache=d}else i.metaCache=null}),re(nt(i),"onStoreChange",function(l,f,d){var h=i.props,p=h.shouldUpdate,m=h.dependencies,y=m===void 0?[]:m,g=h.onReset,b=d.store,w=i.getNamePath(),S=i.getValue(l),C=i.getValue(b),T=f&&as(f,w);switch(d.type==="valueUpdate"&&d.source==="external"&&!rE(S,C)&&(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=Tr,i.warnings=Tr,i.triggerMetaEvent()),d.type){case"reset":if(!f||T){i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=Tr,i.warnings=Tr,i.triggerMetaEvent(),g==null||g(),i.refresh();return}break;case"remove":{if(p&&Dm(p,l,b,S,C,d)){i.reRender();return}break}case"setField":{var _=d.data;if(T){"touched"in _&&(i.touched=_.touched),"validating"in _&&!("originRCField"in _)&&(i.validatePromise=_.validating?Promise.resolve([]):null),"errors"in _&&(i.errors=_.errors||Tr),"warnings"in _&&(i.warnings=_.warnings||Tr),i.dirty=!0,i.triggerMetaEvent(),i.reRender();return}else if("value"in _&&as(f,w,!0)){i.reRender();return}if(p&&!w.length&&Dm(p,l,b,S,C,d)){i.reRender();return}break}case"dependenciesUpdate":{var x=y.map(nn);if(x.some(function(k){return as(d.relatedFields,k)})){i.reRender();return}break}default:if(T||(!y.length||w.length||p)&&Dm(p,l,b,S,C,d)){i.reRender();return}break}p===!0&&i.reRender()}),re(nt(i),"validateRules",function(l){var f=i.getNamePath(),d=i.getValue(),h=l||{},p=h.triggerName,m=h.validateOnly,y=m===void 0?!1:m,g=Promise.resolve().then(Iu(Yr().mark(function b(){var w,S,C,T,_,x,k;return Yr().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(i.mounted){N.next=2;break}return N.abrupt("return",[]);case 2:if(w=i.props,S=w.validateFirst,C=S===void 0?!1:S,T=w.messageVariables,_=w.validateDebounce,x=i.getRules(),p&&(x=x.filter(function(I){return I}).filter(function(I){var F=I.validateTrigger;if(!F)return!0;var H=Tm(F);return H.includes(p)})),!(_&&p)){N.next=10;break}return N.next=8,new Promise(function(I){setTimeout(I,_)});case 8:if(i.validatePromise===g){N.next=10;break}return N.abrupt("return",[]);case 10:return k=mI(f,d,x,l,C,T),k.catch(function(I){return I}).then(function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tr;if(i.validatePromise===g){var F;i.validatePromise=null;var H=[],V=[];(F=I.forEach)===null||F===void 0||F.call(I,function(D){var j=D.rule.warningOnly,z=D.errors,Q=z===void 0?Tr:z;j?V.push.apply(V,De(Q)):H.push.apply(H,De(Q))}),i.errors=H,i.warnings=V,i.triggerMetaEvent(),i.reRender()}}),N.abrupt("return",k);case 13:case"end":return N.stop()}},b)})));return y||(i.validatePromise=g,i.dirty=!0,i.errors=Tr,i.warnings=Tr,i.triggerMetaEvent(),i.reRender()),g}),re(nt(i),"isFieldValidating",function(){return!!i.validatePromise}),re(nt(i),"isFieldTouched",function(){return i.touched}),re(nt(i),"isFieldDirty",function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var l=i.props.fieldContext,f=l.getInternalHooks(Wa),d=f.getInitialValue;return d(i.getNamePath())!==void 0}),re(nt(i),"getErrors",function(){return i.errors}),re(nt(i),"getWarnings",function(){return i.warnings}),re(nt(i),"isListField",function(){return i.props.isListField}),re(nt(i),"isList",function(){return i.props.isList}),re(nt(i),"isPreserve",function(){return i.props.preserve}),re(nt(i),"getMeta",function(){i.prevValidating=i.isFieldValidating();var l={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:i.validatePromise===null};return l}),re(nt(i),"getOnlyChild",function(l){if(typeof l=="function"){var f=i.getMeta();return de(de({},i.getOnlyChild(l(i.getControlled(),f,i.props.fieldContext))),{},{isFunction:!0})}var d=yc(l);return d.length!==1||!G.isValidElement(d[0])?{child:d,isFunction:!1}:{child:d[0],isFunction:!1}}),re(nt(i),"getValue",function(l){var f=i.props.fieldContext.getFieldsValue,d=i.getNamePath();return si(l||f(!0),d)}),re(nt(i),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=i.props,d=f.name,h=f.trigger,p=f.validateTrigger,m=f.getValueFromEvent,y=f.normalize,g=f.valuePropName,b=f.getValueProps,w=f.fieldContext,S=p!==void 0?p:w.validateTrigger,C=i.getNamePath(),T=w.getInternalHooks,_=w.getFieldsValue,x=T(Wa),k=x.dispatch,A=i.getValue(),N=b||function(D){return re({},g,D)},I=l[h],F=d!==void 0?N(A):{};F&&Object.keys(F).forEach(function(D){Gt(typeof F[D]!="function","It's not recommended to generate dynamic function prop by `getValueProps`. Please pass it to child component directly (prop: ".concat(D,")"))});var H=de(de({},l),F);H[h]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var D,j=arguments.length,z=new Array(j),Q=0;Q<j;Q++)z[Q]=arguments[Q];m?D=m.apply(void 0,z):D=_I.apply(void 0,[g].concat(z)),y&&(D=y(D,A,_(!0))),D!==A&&k({type:"updateValue",namePath:C,value:D}),I&&I.apply(void 0,z)};var V=Tm(S||[]);return V.forEach(function(D){var j=H[D];H[D]=function(){j&&j.apply(void 0,arguments);var z=i.props.rules;z&&z.length&&k({type:"validateField",namePath:C,triggerName:D})}}),H}),r.fieldContext){var a=r.fieldContext.getInternalHooks,o=a(Wa),u=o.initEntityValue;u(nt(i))}return i}return Pn(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.shouldUpdate,o=i.fieldContext;if(this.mounted=!0,o){var u=o.getInternalHooks,l=u(Wa),f=l.registerField;this.cancelRegisterFunc=f(this)}a===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var i=this.state.resetCount,a=this.props.children,o=this.getOnlyChild(a),u=o.child,l=o.isFunction,f;return l?f=u:G.isValidElement(u)?f=G.cloneElement(u,this.getControlled(u.props)):(Gt(!u,"`children` of Field is not validate ReactElement."),f=u),G.createElement(G.Fragment,{key:i},f)}}]),n}(G.Component);re(Mm,"contextType",rs),re(Mm,"defaultProps",{trigger:"onChange",valuePropName:"value"});function BS(e){var t,n=e.name,r=Ua(e,wI),i=G.useContext(rs),a=G.useContext(Qc),o=n!==void 0?nn(n):void 0,u=(t=r.isListField)!==null&&t!==void 0?t:!!a,l="keep";return u||(l="_".concat((o||[]).join("_"))),r.preserve===!1&&u&&o.length<=1&&Gt(!1,"`preserve` should not apply on Form.List fields."),G.createElement(Mm,ai({key:l,name:o,isListField:u},r,{fieldContext:i}))}function EI(e){var t=e.name,n=e.initialValue,r=e.children,i=e.rules,a=e.validateTrigger,o=e.isListField,u=G.useContext(rs),l=G.useContext(Qc),f=G.useRef({keys:[],id:0}),d=f.current,h=G.useMemo(function(){var g=nn(u.prefixName)||[];return[].concat(De(g),De(nn(t)))},[u.prefixName,t]),p=G.useMemo(function(){return de(de({},u),{},{prefixName:h})},[u,h]),m=G.useMemo(function(){return{getKey:function(b){var w=h.length,S=b[w];return[d.keys[S],b.slice(w+1)]}}},[h]);if(typeof r!="function")return Gt(!1,"Form.List only accepts function as children."),null;var y=function(b,w,S){var C=S.source;return C==="internal"?!1:b!==w};return G.createElement(Qc.Provider,{value:m},G.createElement(rs.Provider,{value:p},G.createElement(BS,{name:[],shouldUpdate:y,rules:i,validateTrigger:a,initialValue:n,isList:!0,isListField:o??!!l},function(g,b){var w=g.value,S=w===void 0?[]:w,C=g.onChange,T=u.getFieldValue,_=function(){var N=T(h||[]);return N||[]},x={add:function(N,I){var F=_();I>=0&&I<=F.length?(d.keys=[].concat(De(d.keys.slice(0,I)),[d.id],De(d.keys.slice(I))),C([].concat(De(F.slice(0,I)),[N],De(F.slice(I))))):((I<0||I>F.length)&&Gt(!1,"The second parameter of the add function should be a valid positive number."),d.keys=[].concat(De(d.keys),[d.id]),C([].concat(De(F),[N]))),d.id+=1},remove:function(N){var I=_(),F=new Set(Array.isArray(N)?N:[N]);F.size<=0||(d.keys=d.keys.filter(function(H,V){return!F.has(V)}),C(I.filter(function(H,V){return!F.has(V)})))},move:function(N,I){if(N!==I){var F=_();N<0||N>=F.length||I<0||I>=F.length||(d.keys=HS(d.keys,N,I),C(HS(F,N,I)))}}},k=S||[];return Array.isArray(k)||(k=[],Gt(!1,"Current value of '".concat(h.join(" > "),"' is not an array type."))),r(k.map(function(A,N){var I=d.keys[N];return I===void 0&&(d.keys[N]=d.id,I=d.keys[N],d.id+=1),{name:N,key:I,isListField:!0}}),x,b)})))}function SI(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,a){e.forEach(function(o,u){o.catch(function(l){return t=!0,l}).then(function(l){n-=1,r[u]=l,!(n>0)&&(t&&a(r),i(r))})})}):Promise.resolve([])}var WS="__@field_split__";function jm(e){return e.map(function(t){return"".concat(Qe(t),":").concat(t)}).join(WS)}var os=function(){function e(){An(this,e),re(this,"kvs",new Map)}return Pn(e,[{key:"set",value:function(n,r){this.kvs.set(jm(n),r)}},{key:"get",value:function(n){return this.kvs.get(jm(n))}},{key:"update",value:function(n,r){var i=this.get(n),a=r(i);a?this.set(n,a):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(jm(n))}},{key:"map",value:function(n){return De(this.kvs.entries()).map(function(r){var i=ke(r,2),a=i[0],o=i[1],u=a.split(WS);return n({key:u.map(function(l){var f=l.match(/^([^:]*):(.*)$/),d=ke(f,3),h=d[1],p=d[2];return h==="number"?Number(p):p}),value:o})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,a=r.value;return n[i.join(".")]=a,null}),n}}]),e}(),xI=["name"],CI=Pn(function e(t){var n=this;An(this,e),re(this,"formHooked",!1),re(this,"forceRootUpdate",void 0),re(this,"subscribable",!0),re(this,"store",{}),re(this,"fieldEntities",[]),re(this,"initialValues",{}),re(this,"callbacks",{}),re(this,"validateMessages",null),re(this,"preserve",null),re(this,"lastValidatePromise",null),re(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),re(this,"getInternalHooks",function(r){return r===Wa?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Gt(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),re(this,"useSubscribe",function(r){n.subscribable=r}),re(this,"prevWithoutPreserves",null),re(this,"setInitialValues",function(r,i){if(n.initialValues=r||{},i){var a,o=Ru(r,n.store);(a=n.prevWithoutPreserves)===null||a===void 0||a.map(function(u){var l=u.key;o=Gr(o,l,si(r,l))}),n.prevWithoutPreserves=null,n.updateStore(o)}}),re(this,"destroyForm",function(r){if(r)n.updateStore({});else{var i=new os;n.getFieldEntities(!0).forEach(function(a){n.isMergedPreserve(a.isPreserve())||i.set(a.getNamePath(),!0)}),n.prevWithoutPreserves=i}}),re(this,"getInitialValue",function(r){var i=si(n.initialValues,r);return r.length?Ru(i):i}),re(this,"setCallbacks",function(r){n.callbacks=r}),re(this,"setValidateMessages",function(r){n.validateMessages=r}),re(this,"setPreserve",function(r){n.preserve=r}),re(this,"watchList",[]),re(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}}),re(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue(),a=n.getFieldsValue(!0);n.watchList.forEach(function(o){o(i,a,r)})}}),re(this,"timeoutId",null),re(this,"warningUnhooked",function(){!n.timeoutId&&typeof window<"u"&&(n.timeoutId=setTimeout(function(){n.timeoutId=null,n.formHooked||Gt(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))}),re(this,"updateStore",function(r){n.store=r}),re(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(i){return i.getNamePath().length}):n.fieldEntities}),re(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new os;return n.getFieldEntities(r).forEach(function(a){var o=a.getNamePath();i.set(o,a)}),i}),re(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(a){var o=nn(a);return i.get(o)||{INVALIDATE_NAME_PATH:nn(a)}})}),re(this,"getFieldsValue",function(r,i){n.warningUnhooked();var a,o,u;if(r===!0||Array.isArray(r)?(a=r,o=i):r&&Qe(r)==="object"&&(u=r.strict,o=r.filter),a===!0&&!o)return n.store;var l=n.getFieldEntitiesForNamePathList(Array.isArray(a)?a:null),f=[];return l.forEach(function(d){var h,p,m="INVALIDATE_NAME_PATH"in d?d.INVALIDATE_NAME_PATH:d.getNamePath();if(u){var y,g;if((y=(g=d).isList)!==null&&y!==void 0&&y.call(g))return}else if(!a&&(h=(p=d).isListField)!==null&&h!==void 0&&h.call(p))return;if(!o)f.push(m);else{var b="getMeta"in d?d.getMeta():null;o(b)&&f.push(m)}}),US(n.store,f.map(nn))}),re(this,"getFieldValue",function(r){n.warningUnhooked();var i=nn(r);return si(n.store,i)}),re(this,"getFieldsError",function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(a,o){return a&&!("INVALIDATE_NAME_PATH"in a)?{name:a.getNamePath(),errors:a.getErrors(),warnings:a.getWarnings()}:{name:nn(r[o]),errors:[],warnings:[]}})}),re(this,"getFieldError",function(r){n.warningUnhooked();var i=nn(r),a=n.getFieldsError([i])[0];return a.errors}),re(this,"getFieldWarning",function(r){n.warningUnhooked();var i=nn(r),a=n.getFieldsError([i])[0];return a.warnings}),re(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i[0],u=i[1],l,f=!1;i.length===0?l=null:i.length===1?Array.isArray(o)?(l=o.map(nn),f=!1):(l=null,f=o):(l=o.map(nn),f=u);var d=n.getFieldEntities(!0),h=function(b){return b.isFieldTouched()};if(!l)return f?d.every(function(g){return h(g)||g.isList()}):d.some(h);var p=new os;l.forEach(function(g){p.set(g,[])}),d.forEach(function(g){var b=g.getNamePath();l.forEach(function(w){w.every(function(S,C){return b[C]===S})&&p.update(w,function(S){return[].concat(De(S),[g])})})});var m=function(b){return b.some(h)},y=p.map(function(g){var b=g.value;return b});return f?y.every(m):y.some(m)}),re(this,"isFieldTouched",function(r){return n.warningUnhooked(),n.isFieldsTouched([r])}),re(this,"isFieldsValidating",function(r){n.warningUnhooked();var i=n.getFieldEntities();if(!r)return i.some(function(o){return o.isFieldValidating()});var a=r.map(nn);return i.some(function(o){var u=o.getNamePath();return as(a,u)&&o.isFieldValidating()})}),re(this,"isFieldValidating",function(r){return n.warningUnhooked(),n.isFieldsValidating([r])}),re(this,"resetWithFieldInitialValue",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new os,a=n.getFieldEntities(!0);a.forEach(function(l){var f=l.props.initialValue,d=l.getNamePath();if(f!==void 0){var h=i.get(d)||new Set;h.add({entity:l,value:f}),i.set(d,h)}});var o=function(f){f.forEach(function(d){var h=d.props.initialValue;if(h!==void 0){var p=d.getNamePath(),m=n.getInitialValue(p);if(m!==void 0)Gt(!1,"Form already set 'initialValues' with path '".concat(p.join("."),"'. Field can not overwrite it."));else{var y=i.get(p);if(y&&y.size>1)Gt(!1,"Multiple Field with path '".concat(p.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(y){var g=n.getFieldValue(p),b=d.isListField();!b&&(!r.skipExist||g===void 0)&&n.updateStore(Gr(n.store,p,De(y)[0].value))}}}})},u;r.entities?u=r.entities:r.namePathList?(u=[],r.namePathList.forEach(function(l){var f=i.get(l);if(f){var d;(d=u).push.apply(d,De(De(f).map(function(h){return h.entity})))}})):u=a,o(u)}),re(this,"resetFields",function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(Ru(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var a=r.map(nn);a.forEach(function(o){var u=n.getInitialValue(o);n.updateStore(Gr(n.store,o,u))}),n.resetWithFieldInitialValue({namePathList:a}),n.notifyObservers(i,a,{type:"reset"}),n.notifyWatch(a)}),re(this,"setFields",function(r){n.warningUnhooked();var i=n.store,a=[];r.forEach(function(o){var u=o.name,l=Ua(o,xI),f=nn(u);a.push(f),"value"in l&&n.updateStore(Gr(n.store,f,l.value)),n.notifyObservers(i,[f],{type:"setField",data:o})}),n.notifyWatch(a)}),re(this,"getFields",function(){var r=n.getFieldEntities(!0),i=r.map(function(a){var o=a.getNamePath(),u=a.getMeta(),l=de(de({},u),{},{name:o,value:n.getFieldValue(o)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return i}),re(this,"initEntityValue",function(r){var i=r.props.initialValue;if(i!==void 0){var a=r.getNamePath(),o=si(n.store,a);o===void 0&&n.updateStore(Gr(n.store,a,i))}}),re(this,"isMergedPreserve",function(r){var i=r!==void 0?r:n.preserve;return i??!0}),re(this,"registerField",function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var a=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(a,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(o,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(h){return h!==r}),!n.isMergedPreserve(u)&&(!o||l.length>1)){var f=o?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==f&&n.fieldEntities.every(function(h){return!zS(h.getNamePath(),i)})){var d=n.store;n.updateStore(Gr(d,i,f,!0)),n.notifyObservers(d,[i],{type:"remove"}),n.triggerDependenciesUpdate(d,i)}}n.notifyWatch([i])}}),re(this,"dispatch",function(r){switch(r.type){case"updateValue":{var i=r.namePath,a=r.value;n.updateValue(i,a);break}case"validateField":{var o=r.namePath,u=r.triggerName;n.validateFields([o],{triggerName:u});break}}}),re(this,"notifyObservers",function(r,i,a){if(n.subscribable){var o=de(de({},a),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(u){var l=u.onStoreChange;l(r,i,o)})}else n.forceRootUpdate()}),re(this,"triggerDependenciesUpdate",function(r,i){var a=n.getDependencyChildrenFields(i);return a.length&&n.validateFields(a),n.notifyObservers(r,a,{type:"dependenciesUpdate",relatedFields:[i].concat(De(a))}),a}),re(this,"updateValue",function(r,i){var a=nn(r),o=n.store;n.updateStore(Gr(n.store,a,i)),n.notifyObservers(o,[a],{type:"valueUpdate",source:"internal"}),n.notifyWatch([a]);var u=n.triggerDependenciesUpdate(o,a),l=n.callbacks.onValuesChange;if(l){var f=US(n.store,[a]);l(f,n.getFieldsValue())}n.triggerOnFieldsChange([a].concat(De(u)))}),re(this,"setFieldsValue",function(r){n.warningUnhooked();var i=n.store;if(r){var a=Ru(n.store,r);n.updateStore(a)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),re(this,"setFieldValue",function(r,i){n.setFields([{name:r,value:i,errors:[],warnings:[]}])}),re(this,"getDependencyChildrenFields",function(r){var i=new Set,a=[],o=new os;n.getFieldEntities().forEach(function(l){var f=l.props.dependencies;(f||[]).forEach(function(d){var h=nn(d);o.update(h,function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return p.add(l),p})})});var u=function l(f){var d=o.get(f)||new Set;d.forEach(function(h){if(!i.has(h)){i.add(h);var p=h.getNamePath();h.isFieldDirty()&&p.length&&(a.push(p),l(p))}})};return u(r),a}),re(this,"triggerOnFieldsChange",function(r,i){var a=n.callbacks.onFieldsChange;if(a){var o=n.getFields();if(i){var u=new os;i.forEach(function(f){var d=f.name,h=f.errors;u.set(d,h)}),o.forEach(function(f){f.errors=u.get(f.name)||f.errors})}var l=o.filter(function(f){var d=f.name;return as(r,d)});l.length&&a(l,o)}}),re(this,"validateFields",function(r,i){n.warningUnhooked();var a,o;Array.isArray(r)||typeof r=="string"||typeof i=="string"?(a=r,o=i):o=r;var u=!!a,l=u?a.map(nn):[],f=[],d=String(Date.now()),h=new Set,p=o||{},m=p.recursive,y=p.dirty;n.getFieldEntities(!0).forEach(function(S){if(u||l.push(S.getNamePath()),!(!S.props.rules||!S.props.rules.length)&&!(y&&!S.isFieldDirty())){var C=S.getNamePath();if(h.add(C.join(d)),!u||as(l,C,m)){var T=S.validateRules(de({validateMessages:de(de({},$S),n.validateMessages)},o));f.push(T.then(function(){return{name:C,errors:[],warnings:[]}}).catch(function(_){var x,k=[],A=[];return(x=_.forEach)===null||x===void 0||x.call(_,function(N){var I=N.rule.warningOnly,F=N.errors;I?A.push.apply(A,De(F)):k.push.apply(k,De(F))}),k.length?Promise.reject({name:C,errors:k,warnings:A}):{name:C,errors:k,warnings:A}}))}}});var g=SI(f);n.lastValidatePromise=g,g.catch(function(S){return S}).then(function(S){var C=S.map(function(T){var _=T.name;return _});n.notifyObservers(n.store,C,{type:"validateFinish"}),n.triggerOnFieldsChange(C,S)});var b=g.then(function(){return n.lastValidatePromise===g?Promise.resolve(n.getFieldsValue(l)):Promise.reject([])}).catch(function(S){var C=S.filter(function(T){return T&&T.errors.length});return Promise.reject({values:n.getFieldsValue(l),errorFields:C,outOfDate:n.lastValidatePromise!==g})});b.catch(function(S){return S});var w=l.filter(function(S){return h.has(S.join(d))});return n.triggerOnFieldsChange(w),b}),re(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(a){console.error(a)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})}),this.forceRootUpdate=t});function GS(e){var t=G.useRef(),n=G.useState({}),r=ke(n,2),i=r[1];if(!t.current)if(e)t.current=e;else{var a=function(){i({})},o=new CI(a);t.current=o.getForm()}return[t.current]}var $m=G.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),TI=function(t){var n=t.validateMessages,r=t.onFormChange,i=t.onFormFinish,a=t.children,o=G.useContext($m),u=G.useRef({});return G.createElement($m.Provider,{value:de(de({},o),{},{validateMessages:de(de({},o.validateMessages),n),triggerFormChange:function(f,d){r&&r(f,{changedFields:d,forms:u.current}),o.triggerFormChange(f,d)},triggerFormFinish:function(f,d){i&&i(f,{values:d,forms:u.current}),o.triggerFormFinish(f,d)},registerForm:function(f,d){f&&(u.current=de(de({},u.current),{},re({},f,d))),o.registerForm(f,d)},unregisterForm:function(f){var d=de({},u.current);delete d[f],u.current=d,o.unregisterForm(f)}})},a)},OI=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],kI=function(t,n){var r=t.name,i=t.initialValues,a=t.fields,o=t.form,u=t.preserve,l=t.children,f=t.component,d=f===void 0?"form":f,h=t.validateMessages,p=t.validateTrigger,m=p===void 0?"onChange":p,y=t.onValuesChange,g=t.onFieldsChange,b=t.onFinish,w=t.onFinishFailed,S=t.clearOnDestroy,C=Ua(t,OI),T=G.useRef(null),_=G.useContext($m),x=GS(o),k=ke(x,1),A=k[0],N=A.getInternalHooks(Wa),I=N.useSubscribe,F=N.setInitialValues,H=N.setCallbacks,V=N.setValidateMessages,D=N.setPreserve,j=N.destroyForm;G.useImperativeHandle(n,function(){return de(de({},A),{},{nativeElement:T.current})}),G.useEffect(function(){return _.registerForm(r,A),function(){_.unregisterForm(r)}},[_,A,r]),V(de(de({},_.validateMessages),h)),H({onValuesChange:y,onFieldsChange:function(te){if(_.triggerFormChange(r,te),g){for(var fe=arguments.length,le=new Array(fe>1?fe-1:0),me=1;me<fe;me++)le[me-1]=arguments[me];g.apply(void 0,[te].concat(le))}},onFinish:function(te){_.triggerFormFinish(r,te),b&&b(te)},onFinishFailed:w}),D(u);var z=G.useRef(null);F(i,!z.current),z.current||(z.current=!0),G.useEffect(function(){return function(){return j(S)}},[]);var Q,q=typeof l=="function";if(q){var J=A.getFieldsValue(!0);Q=l(J,A)}else Q=l;I(!q);var $=G.useRef();G.useEffect(function(){bI($.current||[],a||[])||A.setFields(a||[]),$.current=a},[a,A]);var Y=G.useMemo(function(){return de(de({},A),{},{validateTrigger:m})},[A,m]),ae=G.createElement(Qc.Provider,{value:null},G.createElement(rs.Provider,{value:Y},Q));return d===!1?ae:G.createElement(d,ai({},C,{ref:T,onSubmit:function(te){te.preventDefault(),te.stopPropagation(),A.submit()},onReset:function(te){var fe;te.preventDefault(),A.resetFields(),(fe=C.onReset)===null||fe===void 0||fe.call(C,te)}}),ae)};function QS(e){try{return JSON.stringify(e)}catch{return Math.random()}}var RI=function(e){var t=e.join("__RC_FIELD_FORM_SPLIT__"),n=M.useRef(t);Gt(n.current===t,"`useWatch` is not support dynamic `namePath`. Please provide static instead.")};function AI(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],i=t[1],a=i===void 0?{}:i,o=jL(a)?{form:a}:a,u=o.form,l=M.useState(),f=ke(l,2),d=f[0],h=f[1],p=M.useMemo(function(){return QS(d)},[d]),m=M.useRef(p);m.current=p;var y=M.useContext(rs),g=u||y,b=g&&g._init;Gt(t.length===2?u?b:!0:b,"useWatch requires a form instance since it can not auto detect from context.");var w=nn(r),S=M.useRef(w);return S.current=w,RI(w),M.useEffect(function(){if(b){var C=g.getFieldsValue,T=g.getInternalHooks,_=T(Wa),x=_.registerWatch,k=function(F,H){var V=o.preserve?H:F;return typeof r=="function"?r(V):si(V,S.current)},A=x(function(I,F){var H=k(I,F),V=QS(H);m.current!==V&&(m.current=V,h(H))}),N=k(C(),C(!0));return d!==N&&h(N),A}},[b]),d}var PI=G.forwardRef(kI),ju=PI;ju.FormProvider=TI,ju.Field=BS,ju.List=EI,ju.useForm=GS,ju.useWatch=AI;const Vm=G.createContext({});Vm.displayName="FormItemInputContext";const NI=({children:e,status:t,override:n})=>{const r=G.useContext(Vm),i=G.useMemo(()=>{const a=Object.assign({},r);return n&&delete a.isFormItemInput,t&&(delete a.status,delete a.hasFeedback,delete a.feedbackIcon),a},[t,n,r]);return G.createElement(Vm.Provider,{value:i},e)},LI=e=>{const{space:t,form:n,children:r}=e;if(r==null)return null;let i=r;return n&&(i=M.createElement(NI,{override:!0,status:!0},i)),t&&(i=M.createElement(hL,null,i)),i},II=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};function FI(e){var t=e.prefixCls,n=e.align,r=e.arrow,i=e.arrowPos,a=r||{},o=a.className,u=a.content,l=i.x,f=l===void 0?0:l,d=i.y,h=d===void 0?0:d,p=G.useRef();if(!n||!n.points)return null;var m={position:"absolute"};if(n.autoArrow!==!1){var y=n.points[0],g=n.points[1],b=y[0],w=y[1],S=g[0],C=g[1];b===S||!["t","b"].includes(b)?m.top=h:b==="t"?m.top=0:m.bottom=0,w===C||!["l","r"].includes(w)?m.left=f:w==="l"?m.left=0:m.right=0}return G.createElement("div",{ref:p,className:Mn("".concat(t,"-arrow"),o),style:m},u)}function DI(e){var t=e.prefixCls,n=e.open,r=e.zIndex,i=e.mask,a=e.motion;return i?G.createElement(gm,ai({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(o){var u=o.className;return G.createElement("div",{style:{zIndex:r},className:Mn("".concat(t,"-mask"),u)})}):null}var YS=G.memo(function(e){var t=e.children;return t},function(e,t){return t.cache});YS.displayName="PopupContent";var KS=G.forwardRef(function(e,t){var n=e.popup,r=e.className,i=e.prefixCls,a=e.style,o=e.target,u=e.onVisibleChanged,l=e.open,f=e.keepDom,d=e.fresh,h=e.onClick,p=e.mask,m=e.arrow,y=e.arrowPos,g=e.align,b=e.motion,w=e.maskMotion,S=e.forceRender,C=e.getPopupContainer,T=e.autoDestroy,_=e.portal,x=e.zIndex,k=e.onMouseEnter,A=e.onMouseLeave,N=e.onPointerEnter,I=e.onPointerDownCapture,F=e.ready,H=e.offsetX,V=e.offsetY,D=e.offsetR,j=e.offsetB,z=e.onAlign,Q=e.onPrepare,q=e.stretch,J=e.targetWidth,$=e.targetHeight,Y=typeof n=="function"?n():n,ae=l||f,ie=(C==null?void 0:C.length)>0,te=G.useState(!C||!ie),fe=ke(te,2),le=fe[0],me=fe[1];if(jn(function(){!le&&ie&&o&&me(!0)},[le,ie,o]),!le)return null;var _e="auto",be={left:"-1000vw",top:"-1000vh",right:_e,bottom:_e};if(F||!l){var ne,ve=g.points,K=g.dynamicInset||((ne=g._experimental)===null||ne===void 0?void 0:ne.dynamicInset),we=K&&ve[0][1]==="r",ue=K&&ve[0][0]==="b";we?(be.right=D,be.left=_e):(be.left=H,be.right=_e),ue?(be.bottom=j,be.top=_e):(be.top=V,be.bottom=_e)}var Te={};return q&&(q.includes("height")&&$?Te.height=$:q.includes("minHeight")&&$&&(Te.minHeight=$),q.includes("width")&&J?Te.width=J:q.includes("minWidth")&&J&&(Te.minWidth=J)),l||(Te.pointerEvents="none"),G.createElement(_,{open:S||ae,getContainer:C&&function(){return C(o)},autoDestroy:T},G.createElement(DI,{prefixCls:i,open:l,zIndex:x,mask:p,motion:w}),G.createElement(xc,{onResize:z,disabled:!l},function(Le){return G.createElement(gm,ai({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:S,leavedClassName:"".concat(i,"-hidden")},b,{onAppearPrepare:Q,onEnterPrepare:Q,visible:l,onVisibleChanged:function(xt){var Ot;b==null||(Ot=b.onVisibleChanged)===null||Ot===void 0||Ot.call(b,xt),u(xt)}}),function(Je,xt){var Ot=Je.className,Vt=Je.style,Me=Mn(i,Ot,r);return G.createElement("div",{ref:Iw(Le,t,xt),className:Me,style:de(de(de(de({"--arrow-x":"".concat(y.x||0,"px"),"--arrow-y":"".concat(y.y||0,"px")},be),Te),Vt),{},{boxSizing:"border-box",zIndex:x},a),onMouseEnter:k,onMouseLeave:A,onPointerEnter:N,onClick:h,onPointerDownCapture:I},m&&G.createElement(FI,{prefixCls:i,arrow:m,arrowPos:y,align:g}),G.createElement(YS,{cache:!l&&!d},Y))})}))});KS.displayName="Popup";var XS=G.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,i=_c(n),a=G.useCallback(function(u){Ov(t,r?r(u):u)},[r]),o=kv(a,Rv(n));return i?G.cloneElement(n,{ref:o}):n});XS.displayName="TriggerWrapper";var ZS=G.createContext(null);function JS(e){return e?Array.isArray(e)?e:[e]:[]}function MI(e,t,n,r){return G.useMemo(function(){var i=JS(n??t),a=JS(r??t),o=new Set(i),u=new Set(a);return e&&(o.has("hover")&&(o.delete("hover"),o.add("click")),u.has("hover")&&(u.delete("hover"),u.add("click"))),[o,u]},[e,t,n,r])}function jI(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function $I(e,t,n,r){for(var i=n.points,a=Object.keys(e),o=0;o<a.length;o+=1){var u,l=a[o];if(jI((u=e[l])===null||u===void 0?void 0:u.points,i,r))return"".concat(t,"-placement-").concat(l)}return""}function ex(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function $u(e){return e.ownerDocument.defaultView}function qm(e){for(var t=[],n=e==null?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=$u(n).getComputedStyle(n),a=i.overflowX,o=i.overflowY,u=i.overflow;[a,o,u].some(function(l){return r.includes(l)})&&t.push(n),n=n.parentElement}return t}function Vu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(e)?t:e}function qu(e){return Vu(parseFloat(e),0)}function tx(e,t){var n=de({},e);return(t||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var i=$u(r).getComputedStyle(r),a=i.overflow,o=i.overflowClipMargin,u=i.borderTopWidth,l=i.borderBottomWidth,f=i.borderLeftWidth,d=i.borderRightWidth,h=r.getBoundingClientRect(),p=r.offsetHeight,m=r.clientHeight,y=r.offsetWidth,g=r.clientWidth,b=qu(u),w=qu(l),S=qu(f),C=qu(d),T=Vu(Math.round(h.width/y*1e3)/1e3),_=Vu(Math.round(h.height/p*1e3)/1e3),x=(y-g-S-C)*T,k=(p-m-b-w)*_,A=b*_,N=w*_,I=S*T,F=C*T,H=0,V=0;if(a==="clip"){var D=qu(o);H=D*T,V=D*_}var j=h.x+I-H,z=h.y+A-V,Q=j+h.width+2*H-I-F-x,q=z+h.height+2*V-A-N-k;n.left=Math.max(n.left,j),n.top=Math.max(n.top,z),n.right=Math.min(n.right,Q),n.bottom=Math.min(n.bottom,q)}}),n}function nx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?e*(parseFloat(r[1])/100):parseFloat(n)}function rx(e,t){var n=t||[],r=ke(n,2),i=r[0],a=r[1];return[nx(e.width,i),nx(e.height,a)]}function ix(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[e[0],e[1]]}function ss(e,t){var n=t[0],r=t[1],i,a;return n==="t"?a=e.y:n==="b"?a=e.y+e.height:a=e.y+e.height/2,r==="l"?i=e.x:r==="r"?i=e.x+e.width:i=e.x+e.width/2,{x:i,y:a}}function oa(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(r,i){return i===t?n[r]||"c":r}).join("")}function VI(e,t,n,r,i,a,o){var u=G.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:i[r]||{}}),l=ke(u,2),f=l[0],d=l[1],h=G.useRef(0),p=G.useMemo(function(){return t?qm(t):[]},[t]),m=G.useRef({}),y=function(){m.current={}};e||y();var g=Cr(function(){if(t&&n&&e){let qn=function(Ai,mi){var gi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:jt,eo=te.x+Ai,to=te.y+mi,Uu=eo+we,zu=to+K,Hu=Math.max(eo,gi.left),Ae=Math.max(to,gi.top),Fe=Math.min(Uu,gi.right),$t=Math.min(zu,gi.bottom);return Math.max(0,(Fe-Hu)*($t-Ae))},Ja=function(){at=te.y+Rt,Be=at+K,qe=te.x+vt,zt=qe+we};var S,C,T,_,x=t,k=x.ownerDocument,A=$u(x),N=A.getComputedStyle(x),I=N.width,F=N.height,H=N.position,V=x.style.left,D=x.style.top,j=x.style.right,z=x.style.bottom,Q=x.style.overflow,q=de(de({},i[r]),a),J=k.createElement("div");(S=x.parentElement)===null||S===void 0||S.appendChild(J),J.style.left="".concat(x.offsetLeft,"px"),J.style.top="".concat(x.offsetTop,"px"),J.style.position=H,J.style.height="".concat(x.offsetHeight,"px"),J.style.width="".concat(x.offsetWidth,"px"),x.style.left="0",x.style.top="0",x.style.right="auto",x.style.bottom="auto",x.style.overflow="hidden";var $;if(Array.isArray(n))$={x:n[0],y:n[1],width:0,height:0};else{var Y,ae,ie=n.getBoundingClientRect();ie.x=(Y=ie.x)!==null&&Y!==void 0?Y:ie.left,ie.y=(ae=ie.y)!==null&&ae!==void 0?ae:ie.top,$={x:ie.x,y:ie.y,width:ie.width,height:ie.height}}var te=x.getBoundingClientRect();te.x=(C=te.x)!==null&&C!==void 0?C:te.left,te.y=(T=te.y)!==null&&T!==void 0?T:te.top;var fe=k.documentElement,le=fe.clientWidth,me=fe.clientHeight,_e=fe.scrollWidth,be=fe.scrollHeight,ne=fe.scrollTop,ve=fe.scrollLeft,K=te.height,we=te.width,ue=$.height,Te=$.width,Le={left:0,top:0,right:le,bottom:me},Je={left:-ve,top:-ne,right:_e-ve,bottom:be-ne},xt=q.htmlRegion,Ot="visible",Vt="visibleFirst";xt!=="scroll"&&xt!==Vt&&(xt=Ot);var Me=xt===Vt,et=tx(Je,p),Ee=tx(Le,p),jt=xt===Ot?Ee:et,Ct=Me?Ee:jt;x.style.left="auto",x.style.top="auto",x.style.right="0",x.style.bottom="0";var Qt=x.getBoundingClientRect();x.style.left=V,x.style.top=D,x.style.right=j,x.style.bottom=z,x.style.overflow=Q,(_=x.parentElement)===null||_===void 0||_.removeChild(J);var un=Vu(Math.round(we/parseFloat(I)*1e3)/1e3),Yt=Vu(Math.round(K/parseFloat(F)*1e3)/1e3);if(un===0||Yt===0||wu(n)&&!fL(n))return;var He=q.offset,Zt=q.targetOffset,kt=rx(te,He),pt=ke(kt,2),Ut=pt[0],mn=pt[1],Ti=rx($,Zt),ur=ke(Ti,2),gn=ur[0],Qn=ur[1];$.x-=gn,$.y-=Qn;var sa=q.points||[],lr=ke(sa,2),ui=lr[0],li=lr[1],$n=ix(li),En=ix(ui),ci=ss($,$n),cn=ss(te,En),Yn=de({},q),vt=ci.x-cn.x+Ut,Rt=ci.y-cn.y+mn,Vn=qn(vt,Rt),Kn=qn(vt,Rt,Ee),fi=ss($,["t","l"]),yn=ss(te,["t","l"]),ua=ss($,["b","r"]),Oi=ss(te,["b","r"]),kr=q.overflow||{},B=kr.adjustX,ye=kr.adjustY,Se=kr.shiftX,Ie=kr.shiftY,it=function(mi){return typeof mi=="boolean"?mi:mi>=0},at,Be,qe,zt;Ja();var mt=it(ye),It=En[0]===$n[0];if(mt&&En[0]==="t"&&(Be>Ct.bottom||m.current.bt)){var ht=Rt;It?ht-=K-ue:ht=fi.y-Oi.y-mn;var Nn=qn(vt,ht),cr=qn(vt,ht,Ee);Nn>Vn||Nn===Vn&&(!Me||cr>=Kn)?(m.current.bt=!0,Rt=ht,mn=-mn,Yn.points=[oa(En,0),oa($n,0)]):m.current.bt=!1}if(mt&&En[0]==="b"&&(at<Ct.top||m.current.tb)){var Ft=Rt;It?Ft+=K-ue:Ft=ua.y-yn.y-mn;var di=qn(vt,Ft),Ga=qn(vt,Ft,Ee);di>Vn||di===Vn&&(!Me||Ga>=Kn)?(m.current.tb=!0,Rt=Ft,mn=-mn,Yn.points=[oa(En,0),oa($n,0)]):m.current.tb=!1}var la=it(B),Qa=En[1]===$n[1];if(la&&En[1]==="l"&&(zt>Ct.right||m.current.rl)){var hi=vt;Qa?hi-=we-Te:hi=fi.x-Oi.x-Ut;var Ya=qn(hi,Rt),ca=qn(hi,Rt,Ee);Ya>Vn||Ya===Vn&&(!Me||ca>=Kn)?(m.current.rl=!0,vt=hi,Ut=-Ut,Yn.points=[oa(En,1),oa($n,1)]):m.current.rl=!1}if(la&&En[1]==="r"&&(qe<Ct.left||m.current.lr)){var Kr=vt;Qa?Kr+=we-Te:Kr=ua.x-yn.x-Ut;var cs=qn(Kr,Rt),fs=qn(Kr,Rt,Ee);cs>Vn||cs===Vn&&(!Me||fs>=Kn)?(m.current.lr=!0,vt=Kr,Ut=-Ut,Yn.points=[oa(En,1),oa($n,1)]):m.current.lr=!1}Ja();var fr=Se===!0?0:Se;typeof fr=="number"&&(qe<Ee.left&&(vt-=qe-Ee.left-Ut,$.x+Te<Ee.left+fr&&(vt+=$.x-Ee.left+Te-fr)),zt>Ee.right&&(vt-=zt-Ee.right-Ut,$.x>Ee.right-fr&&(vt+=$.x-Ee.right+fr)));var Xn=Ie===!0?0:Ie;typeof Xn=="number"&&(at<Ee.top&&(Rt-=at-Ee.top-mn,$.y+ue<Ee.top+Xn&&(Rt+=$.y-Ee.top+ue-Xn)),Be>Ee.bottom&&(Rt-=Be-Ee.bottom-mn,$.y>Ee.bottom-Xn&&(Rt+=$.y-Ee.bottom+Xn)));var ki=te.x+vt,pi=ki+we,Rr=te.y+Rt,ds=Rr+K,Ri=$.x,hs=Ri+Te,Ka=$.y,ps=Ka+ue,vs=Math.max(ki,Ri),Xa=Math.min(pi,hs),ms=(vs+Xa)/2,gs=ms-ki,Za=Math.max(Rr,Ka),fa=Math.min(ds,ps),vi=(Za+fa)/2,ys=vi-Rr;o==null||o(t,Yn);var da=Qt.right-te.x-(vt+te.width),Ar=Qt.bottom-te.y-(Rt+te.height);un===1&&(vt=Math.round(vt),da=Math.round(da)),Yt===1&&(Rt=Math.round(Rt),Ar=Math.round(Ar));var bs={ready:!0,offsetX:vt/un,offsetY:Rt/Yt,offsetR:da/un,offsetB:Ar/Yt,arrowX:gs/un,arrowY:ys/Yt,scaleX:un,scaleY:Yt,align:Yn};d(bs)}}),b=function(){h.current+=1;var C=h.current;Promise.resolve().then(function(){h.current===C&&g()})},w=function(){d(function(C){return de(de({},C),{},{ready:!1})})};return jn(w,[r]),jn(function(){e||w()},[e]),[f.ready,f.offsetX,f.offsetY,f.offsetR,f.offsetB,f.arrowX,f.arrowY,f.scaleX,f.scaleY,f.align,b]}function qI(e,t,n,r,i){jn(function(){if(e&&t&&n){let h=function(){r(),i()};var a=t,o=n,u=qm(a),l=qm(o),f=$u(o),d=new Set([f].concat(De(u),De(l)));return d.forEach(function(p){p.addEventListener("scroll",h,{passive:!0})}),f.addEventListener("resize",h,{passive:!0}),r(),function(){d.forEach(function(p){p.removeEventListener("scroll",h),f.removeEventListener("resize",h)})}}},[e,t,n])}function UI(e,t,n,r,i,a,o,u){var l=G.useRef(e);l.current=e;var f=G.useRef(!1);G.useEffect(function(){if(t&&r&&(!i||a)){var h=function(){f.current=!1},p=function(T){var _;l.current&&!o(((_=T.composedPath)===null||_===void 0||(_=_.call(T))===null||_===void 0?void 0:_[0])||T.target)&&!f.current&&u(!1)},m=$u(r);m.addEventListener("pointerdown",h,!0),m.addEventListener("mousedown",p,!0),m.addEventListener("contextmenu",p,!0);var y=Sm(n);y&&(y.addEventListener("mousedown",p,!0),y.addEventListener("contextmenu",p,!0));{var g,b,w=n==null||(g=n.getRootNode)===null||g===void 0?void 0:g.call(n),S=(b=r.getRootNode)===null||b===void 0?void 0:b.call(r);Go(w===S,"trigger element and popup element should in same shadow root.")}return function(){m.removeEventListener("pointerdown",h,!0),m.removeEventListener("mousedown",p,!0),m.removeEventListener("contextmenu",p,!0),y&&(y.removeEventListener("mousedown",p,!0),y.removeEventListener("contextmenu",p,!0))}}},[t,n,r,i,a]);function d(){f.current=!0}return d}var zI=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function HI(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Cm,t=G.forwardRef(function(n,r){var i=n.prefixCls,a=i===void 0?"rc-trigger-popup":i,o=n.children,u=n.action,l=u===void 0?"hover":u,f=n.showAction,d=n.hideAction,h=n.popupVisible,p=n.defaultPopupVisible,m=n.onPopupVisibleChange,y=n.afterPopupVisibleChange,g=n.mouseEnterDelay,b=n.mouseLeaveDelay,w=b===void 0?.1:b,S=n.focusDelay,C=n.blurDelay,T=n.mask,_=n.maskClosable,x=_===void 0?!0:_,k=n.getPopupContainer,A=n.forceRender,N=n.autoDestroy,I=n.destroyPopupOnHide,F=n.popup,H=n.popupClassName,V=n.popupStyle,D=n.popupPlacement,j=n.builtinPlacements,z=j===void 0?{}:j,Q=n.popupAlign,q=n.zIndex,J=n.stretch,$=n.getPopupClassNameFromAlign,Y=n.fresh,ae=n.alignPoint,ie=n.onPopupClick,te=n.onPopupAlign,fe=n.arrow,le=n.popupMotion,me=n.maskMotion,_e=n.popupTransitionName,be=n.popupAnimation,ne=n.maskTransitionName,ve=n.maskAnimation,K=n.className,we=n.getTriggerDOMNode,ue=Ua(n,zI),Te=N||I||!1,Le=G.useState(!1),Je=ke(Le,2),xt=Je[0],Ot=Je[1];jn(function(){Ot(II())},[]);var Vt=G.useRef({}),Me=G.useContext(ZS),et=G.useMemo(function(){return{registerSubPopup:function(Fe,$t){Vt.current[Fe]=$t,Me==null||Me.registerSubPopup(Fe,$t)}}},[Me]),Ee=AS(),jt=G.useState(null),Ct=ke(jt,2),Qt=Ct[0],un=Ct[1],Yt=G.useRef(null),He=Cr(function(Ae){Yt.current=Ae,wu(Ae)&&Qt!==Ae&&un(Ae),Me==null||Me.registerSubPopup(Ee,Ae)}),Zt=G.useState(null),kt=ke(Zt,2),pt=kt[0],Ut=kt[1],mn=G.useRef(null),Ti=Cr(function(Ae){wu(Ae)&&pt!==Ae&&(Ut(Ae),mn.current=Ae)}),ur=G.Children.only(o),gn=(ur==null?void 0:ur.props)||{},Qn={},sa=Cr(function(Ae){var Fe,$t,rn=pt;return(rn==null?void 0:rn.contains(Ae))||((Fe=Sm(rn))===null||Fe===void 0?void 0:Fe.host)===Ae||Ae===rn||(Qt==null?void 0:Qt.contains(Ae))||(($t=Sm(Qt))===null||$t===void 0?void 0:$t.host)===Ae||Ae===Qt||Object.values(Vt.current).some(function(Ht){return(Ht==null?void 0:Ht.contains(Ae))||Ae===Ht})}),lr=ex(a,le,be,_e),ui=ex(a,me,ve,ne),li=G.useState(p||!1),$n=ke(li,2),En=$n[0],ci=$n[1],cn=h??En,Yn=Cr(function(Ae){h===void 0&&ci(Ae)});jn(function(){ci(h||!1)},[h]);var vt=G.useRef(cn);vt.current=cn;var Rt=G.useRef([]);Rt.current=[];var Vn=Cr(function(Ae){var Fe;Yn(Ae),((Fe=Rt.current[Rt.current.length-1])!==null&&Fe!==void 0?Fe:cn)!==Ae&&(Rt.current.push(Ae),m==null||m(Ae))}),Kn=G.useRef(),fi=function(){clearTimeout(Kn.current)},yn=function(Fe){var $t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;fi(),$t===0?Vn(Fe):Kn.current=setTimeout(function(){Vn(Fe)},$t*1e3)};G.useEffect(function(){return fi},[]);var ua=G.useState(!1),Oi=ke(ua,2),kr=Oi[0],B=Oi[1];jn(function(Ae){(!Ae||cn)&&B(!0)},[cn]);var ye=G.useState(null),Se=ke(ye,2),Ie=Se[0],it=Se[1],at=G.useState(null),Be=ke(at,2),qe=Be[0],zt=Be[1],mt=function(Fe){zt([Fe.clientX,Fe.clientY])},It=VI(cn,Qt,ae&&qe!==null?qe:pt,D,z,Q,te),ht=ke(It,11),Nn=ht[0],cr=ht[1],Ft=ht[2],di=ht[3],Ga=ht[4],la=ht[5],Qa=ht[6],hi=ht[7],Ya=ht[8],ca=ht[9],Kr=ht[10],cs=MI(xt,l,f,d),fs=ke(cs,2),fr=fs[0],Xn=fs[1],ki=fr.has("click"),pi=Xn.has("click")||Xn.has("contextMenu"),Rr=Cr(function(){kr||Kr()}),ds=function(){vt.current&&ae&&pi&&yn(!1)};qI(cn,pt,Qt,Rr,ds),jn(function(){Rr()},[qe,D]),jn(function(){cn&&!(z!=null&&z[D])&&Rr()},[JSON.stringify(Q)]);var Ri=G.useMemo(function(){var Ae=$I(z,a,ca,ae);return Mn(Ae,$==null?void 0:$(ca))},[ca,$,z,a,ae]);G.useImperativeHandle(r,function(){return{nativeElement:mn.current,popupElement:Yt.current,forceAlign:Rr}});var hs=G.useState(0),Ka=ke(hs,2),ps=Ka[0],vs=Ka[1],Xa=G.useState(0),ms=ke(Xa,2),gs=ms[0],Za=ms[1],fa=function(){if(J&&pt){var Fe=pt.getBoundingClientRect();vs(Fe.width),Za(Fe.height)}},vi=function(){fa(),Rr()},ys=function(Fe){B(!1),Kr(),y==null||y(Fe)},da=function(){return new Promise(function(Fe){fa(),it(function(){return Fe})})};jn(function(){Ie&&(Kr(),Ie(),it(null))},[Ie]);function Ar(Ae,Fe,$t,rn){Qn[Ae]=function(Ht){var _s;rn==null||rn(Ht),yn(Fe,$t);for(var Bu=arguments.length,Nt=new Array(Bu>1?Bu-1:0),gt=1;gt<Bu;gt++)Nt[gt-1]=arguments[gt];(_s=gn[Ae])===null||_s===void 0||_s.call.apply(_s,[gn,Ht].concat(Nt))}}(ki||pi)&&(Qn.onClick=function(Ae){var Fe;vt.current&&pi?yn(!1):!vt.current&&ki&&(mt(Ae),yn(!0));for(var $t=arguments.length,rn=new Array($t>1?$t-1:0),Ht=1;Ht<$t;Ht++)rn[Ht-1]=arguments[Ht];(Fe=gn.onClick)===null||Fe===void 0||Fe.call.apply(Fe,[gn,Ae].concat(rn))});var bs=UI(cn,pi,pt,Qt,T,x,sa,yn),qn=fr.has("hover"),Ja=Xn.has("hover"),Ai,mi;qn&&(Ar("onMouseEnter",!0,g,function(Ae){mt(Ae)}),Ar("onPointerEnter",!0,g,function(Ae){mt(Ae)}),Ai=function(Fe){(cn||kr)&&Qt!==null&&Qt!==void 0&&Qt.contains(Fe.target)&&yn(!0,g)},ae&&(Qn.onMouseMove=function(Ae){var Fe;(Fe=gn.onMouseMove)===null||Fe===void 0||Fe.call(gn,Ae)})),Ja&&(Ar("onMouseLeave",!1,w),Ar("onPointerLeave",!1,w),mi=function(){yn(!1,w)}),fr.has("focus")&&Ar("onFocus",!0,S),Xn.has("focus")&&Ar("onBlur",!1,C),fr.has("contextMenu")&&(Qn.onContextMenu=function(Ae){var Fe;vt.current&&Xn.has("contextMenu")?yn(!1):(mt(Ae),yn(!0)),Ae.preventDefault();for(var $t=arguments.length,rn=new Array($t>1?$t-1:0),Ht=1;Ht<$t;Ht++)rn[Ht-1]=arguments[Ht];(Fe=gn.onContextMenu)===null||Fe===void 0||Fe.call.apply(Fe,[gn,Ae].concat(rn))}),K&&(Qn.className=Mn(gn.className,K));var gi=de(de({},gn),Qn),eo={},to=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];to.forEach(function(Ae){ue[Ae]&&(eo[Ae]=function(){for(var Fe,$t=arguments.length,rn=new Array($t),Ht=0;Ht<$t;Ht++)rn[Ht]=arguments[Ht];(Fe=gi[Ae])===null||Fe===void 0||Fe.call.apply(Fe,[gi].concat(rn)),ue[Ae].apply(ue,rn)})});var Uu=G.cloneElement(ur,de(de({},gi),eo)),zu={x:la,y:Qa},Hu=fe?de({},fe!==!0?fe:{}):null;return G.createElement(G.Fragment,null,G.createElement(xc,{disabled:!cn,ref:Ti,onResize:vi},G.createElement(XS,{getTriggerDOMNode:we},Uu)),G.createElement(ZS.Provider,{value:et},G.createElement(KS,{portal:e,ref:He,prefixCls:a,popup:F,className:Mn(H,Ri),style:V,target:pt,onMouseEnter:Ai,onMouseLeave:mi,onPointerEnter:Ai,zIndex:q,open:cn,keepDom:kr,fresh:Y,onClick:ie,onPointerDownCapture:bs,mask:T,motion:lr,maskMotion:ui,onVisibleChanged:ys,onPrepare:da,forceRender:A,autoDestroy:Te,getPopupContainer:k,align:ca,arrow:Hu,arrowPos:zu,ready:Nn,offsetX:cr,offsetY:Ft,offsetR:di,offsetB:Ga,onAlign:Rr,stretch:J,targetWidth:ps/hi,targetHeight:gs/Ya})))});return t.displayName="Trigger",t}const BI=HI(Cm);function ax(e){var t=e.children,n=e.prefixCls,r=e.id,i=e.overlayInnerStyle,a=e.bodyClassName,o=e.className,u=e.style;return G.createElement("div",{className:Mn("".concat(n,"-content"),o),style:u},G.createElement("div",{className:Mn("".concat(n,"-inner"),a),id:r,role:"tooltip",style:i},typeof t=="function"?t():t))}var us={shiftX:64,adjustY:1},ls={adjustX:1,shiftY:!0},Or=[0,0],WI={left:{points:["cr","cl"],overflow:ls,offset:[-4,0],targetOffset:Or},right:{points:["cl","cr"],overflow:ls,offset:[4,0],targetOffset:Or},top:{points:["bc","tc"],overflow:us,offset:[0,-4],targetOffset:Or},bottom:{points:["tc","bc"],overflow:us,offset:[0,4],targetOffset:Or},topLeft:{points:["bl","tl"],overflow:us,offset:[0,-4],targetOffset:Or},leftTop:{points:["tr","tl"],overflow:ls,offset:[-4,0],targetOffset:Or},topRight:{points:["br","tr"],overflow:us,offset:[0,-4],targetOffset:Or},rightTop:{points:["tl","tr"],overflow:ls,offset:[4,0],targetOffset:Or},bottomRight:{points:["tr","br"],overflow:us,offset:[0,4],targetOffset:Or},rightBottom:{points:["bl","br"],overflow:ls,offset:[4,0],targetOffset:Or},bottomLeft:{points:["tl","bl"],overflow:us,offset:[0,4],targetOffset:Or},leftBottom:{points:["br","bl"],overflow:ls,offset:[-4,0],targetOffset:Or}},GI=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],QI=function(t,n){var r=t.overlayClassName,i=t.trigger,a=i===void 0?["hover"]:i,o=t.mouseEnterDelay,u=o===void 0?0:o,l=t.mouseLeaveDelay,f=l===void 0?.1:l,d=t.overlayStyle,h=t.prefixCls,p=h===void 0?"rc-tooltip":h,m=t.children,y=t.onVisibleChange,g=t.afterVisibleChange,b=t.transitionName,w=t.animation,S=t.motion,C=t.placement,T=C===void 0?"right":C,_=t.align,x=_===void 0?{}:_,k=t.destroyTooltipOnHide,A=k===void 0?!1:k,N=t.defaultVisible,I=t.getTooltipContainer,F=t.overlayInnerStyle;t.arrowContent;var H=t.overlay,V=t.id,D=t.showArrow,j=D===void 0?!0:D,z=t.classNames,Q=t.styles,q=Ua(t,GI),J=AS(V),$=M.useRef(null);M.useImperativeHandle(n,function(){return $.current});var Y=de({},q);"visible"in t&&(Y.popupVisible=t.visible);var ae=function(){return G.createElement(ax,{key:"content",prefixCls:p,id:J,bodyClassName:z==null?void 0:z.body,overlayInnerStyle:de(de({},F),Q==null?void 0:Q.body)},H)},ie=function(){var fe=G.Children.only(m),le=(fe==null?void 0:fe.props)||{},me=de(de({},le),{},{"aria-describedby":H?J:null});return G.cloneElement(m,me)};return G.createElement(BI,ai({popupClassName:Mn(r,z==null?void 0:z.root),prefixCls:p,popup:ae,action:a,builtinPlacements:WI,popupPlacement:T,ref:$,popupAlign:x,getPopupContainer:I,onPopupVisibleChange:y,afterPopupVisibleChange:g,popupTransitionName:b,popupAnimation:w,popupMotion:S,defaultPopupVisible:N,autoDestroy:A,mouseLeaveDelay:f,popupStyle:de(de({},d),Q==null?void 0:Q.root),mouseEnterDelay:u,arrow:j},Y),ie())};const YI=M.forwardRef(QI);function KI(e){const{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,i=t/2,a=0,o=i,u=r*1/Math.sqrt(2),l=i-r*(1-1/Math.sqrt(2)),f=i-n*(1/Math.sqrt(2)),d=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),h=2*i-f,p=d,m=2*i-u,y=l,g=2*i-a,b=o,w=i*Math.sqrt(2)+r*(Math.sqrt(2)-2),S=r*(Math.sqrt(2)-1),C=`polygon(${S}px 100%, 50% ${S}px, ${2*i-S}px 100%, ${S}px 100%)`,T=`path('M ${a} ${o} A ${r} ${r} 0 0 0 ${u} ${l} L ${f} ${d} A ${n} ${n} 0 0 1 ${h} ${p} L ${m} ${y} A ${r} ${r} 0 0 0 ${g} ${b} Z')`;return{arrowShadowWidth:w,arrowPath:T,arrowPolygon:C}}const XI=(e,t,n)=>{const{sizePopupArrow:r,arrowPolygon:i,arrowPath:a,arrowShadowWidth:o,borderRadiusXS:u,calc:l}=e;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:l(r).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[i,a]},content:'""'},"&::after":{content:'""',position:"absolute",width:o,height:o,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${za(u)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},ox=8;function sx(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?ox:r}}function Kc(e,t){return e?t:{}}function ZI(e,t,n){const{componentCls:r,boxShadowPopoverArrow:i,arrowOffsetVertical:a,arrowOffsetHorizontal:o}=e,{arrowDistance:u=0,arrowPlacement:l={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},XI(e,t,i)),{"&:before":{background:t}})]},Kc(!!l.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:u,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":o,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:o}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${za(o)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:o}}}})),Kc(!!l.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:u,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":o,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:o}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${za(o)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:o}}}})),Kc(!!l.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:u},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:a},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:a}})),Kc(!!l.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:u},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:a},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:a}}))}}function JI(e,t,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const i=r&&typeof r=="object"?r:{},a={};switch(e){case"top":case"bottom":a.shiftX=t.arrowOffsetHorizontal*2+n,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=t.arrowOffsetVertical*2+n,a.shiftX=!0,a.adjustX=!0;break}const o=Object.assign(Object.assign({},a),i);return o.shiftX||(o.adjustX=!0),o.shiftY||(o.adjustY=!0),o}const ux={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},eF={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},tF=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function nF(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:a}=e,o=t/2,u={};return Object.keys(ux).forEach(l=>{const f=r&&eF[l]||ux[l],d=Object.assign(Object.assign({},f),{offset:[0,0],dynamicInset:!0});switch(u[l]=d,tF.has(l)&&(d.autoArrow=!1),l){case"top":case"topLeft":case"topRight":d.offset[1]=-o-i;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=o+i;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-o-i;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=o+i;break}const h=sx({contentRadius:a,limitVerticalRadius:!0});if(r)switch(l){case"topLeft":case"bottomLeft":d.offset[0]=-h.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":d.offset[0]=h.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":d.offset[1]=-h.arrowOffsetHorizontal*2+o;break;case"leftBottom":case"rightBottom":d.offset[1]=h.arrowOffsetHorizontal*2-o;break}d.overflow=JI(l,h,t,n),d.htmlRegion="visibleFirst"}),u}const rF=e=>{const{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:i,tooltipBg:a,tooltipBorderRadius:o,zIndexPopup:u,controlHeight:l,boxShadowSecondary:f,paddingSM:d,paddingXS:h,arrowOffsetHorizontal:p,sizePopupArrow:m}=e,y=t(o).add(m).add(p).equal(),g=t(o).mul(2).add(m).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},RN(e)),{position:"absolute",zIndex:u,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":a,[`${n}-inner`]:{minWidth:g,minHeight:l,padding:`${za(e.calc(d).div(2).equal())} ${za(h)}`,color:i,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:o,boxShadow:f,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:y},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:e.min(o,ox)}},[`${n}-content`]:{position:"relative"}}),FN(e,(b,{darkColor:w})=>({[`&${n}-${b}`]:{[`${n}-inner`]:{backgroundColor:w},[`${n}-arrow`]:{"--antd-arrow-background-color":w}}}))),{"&-rtl":{direction:"rtl"}})},ZI(e,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},iF=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},sx({contentRadius:e.borderRadius,limitVerticalRadius:!0})),KI(qc(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)}))),lx=(e,t=!0)=>IN("Tooltip",r=>{const{borderRadius:i,colorTextLightSolid:a,colorBgSpotlight:o}=r,u=qc(r,{tooltipMaxWidth:250,tooltipColor:a,tooltipBorderRadius:i,tooltipBg:o});return[rF(u),kL(r,"zoom-big-fast")]},iF,{resetStyle:!1,injectStyle:t})(e),aF=Uc.map(e=>`${e}-inverse`);function oF(e,t=!0){return t?[].concat(De(aF),De(Uc)).includes(e):Uc.includes(e)}function cx(e,t){const n=oF(t),r=Mn({[`${e}-${t}`]:t&&n}),i={},a={};return t&&!n&&(i.background=t,a["--antd-arrow-background-color"]=t),{className:r,overlayStyle:i,arrowStyle:a}}const sF=e=>{const{prefixCls:t,className:n,placement:r="top",title:i,color:a,overlayInnerStyle:o}=e,{getPrefixCls:u}=G.useContext(Nu),l=u("tooltip",t),[f,d,h]=lx(l),p=cx(l,a),m=p.arrowStyle,y=Object.assign(Object.assign({},o),p.overlayStyle),g=Mn(d,h,l,`${l}-pure`,`${l}-placement-${r}`,n,p.className);return f(G.createElement("div",{className:g,style:m},G.createElement("div",{className:`${l}-arrow`}),G.createElement(ax,Object.assign({},e,{className:d,prefixCls:l,overlayInnerStyle:y}),i)))};var uF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Um=G.forwardRef((e,t)=>{var n,r;const{prefixCls:i,openClassName:a,getTooltipContainer:o,color:u,overlayInnerStyle:l,children:f,afterOpenChange:d,afterVisibleChange:h,destroyTooltipOnHide:p,destroyOnHidden:m,arrow:y=!0,title:g,overlay:b,builtinPlacements:w,arrowPointAtCenter:S=!1,autoAdjustOverflow:C=!0,motion:T,getPopupContainer:_,placement:x="top",mouseEnterDelay:k=.1,mouseLeaveDelay:A=.1,overlayStyle:N,rootClassName:I,overlayClassName:F,styles:H,classNames:V}=e,D=uF(e,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","destroyOnHidden","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),j=!!y,[,z]=vm(),{getPopupContainer:Q,getPrefixCls:q,direction:J,className:$,style:Y,classNames:ae,styles:ie}=fN("tooltip"),te=FE("Tooltip"),fe=G.useRef(null),le=()=>{var kt;(kt=fe.current)===null||kt===void 0||kt.forceAlign()};G.useImperativeHandle(t,()=>{var kt,pt;return{forceAlign:le,forcePopupAlign:()=>{te.deprecated(!1,"forcePopupAlign","forceAlign"),le()},nativeElement:(kt=fe.current)===null||kt===void 0?void 0:kt.nativeElement,popupElement:(pt=fe.current)===null||pt===void 0?void 0:pt.popupElement}}),[["visible","open"],["defaultVisible","defaultOpen"],["onVisibleChange","onOpenChange"],["afterVisibleChange","afterOpenChange"],["destroyTooltipOnHide","destroyOnHidden"],["arrowPointAtCenter","arrow={{ pointAtCenter: true }}"],["overlayStyle","styles={{ root: {} }}"],["overlayInnerStyle","styles={{ body: {} }}"],["overlayClassName",'classNames={{ root: "" }}']].forEach(([kt,pt])=>{te.deprecated(!(kt in e),kt,pt)}),te(!p||typeof p=="boolean","usage","`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly."),te(!y||typeof y=="boolean"||!("arrowPointAtCenter"in y),"deprecated","`arrowPointAtCenter` in `arrow` is deprecated. Please use `pointAtCenter` instead.");const[me,_e]=mN(!1,{value:(n=e.open)!==null&&n!==void 0?n:e.visible,defaultValue:(r=e.defaultOpen)!==null&&r!==void 0?r:e.defaultVisible}),be=!g&&!b&&g!==0,ne=kt=>{var pt,Ut;_e(be?!1:kt),be||((pt=e.onOpenChange)===null||pt===void 0||pt.call(e,kt),(Ut=e.onVisibleChange)===null||Ut===void 0||Ut.call(e,kt))},ve=G.useMemo(()=>{var kt,pt;let Ut=S;return typeof y=="object"&&(Ut=(pt=(kt=y.pointAtCenter)!==null&&kt!==void 0?kt:y.arrowPointAtCenter)!==null&&pt!==void 0?pt:S),w||nF({arrowPointAtCenter:Ut,autoAdjustOverflow:C,arrowWidth:j?z.sizePopupArrow:0,borderRadius:z.borderRadius,offset:z.marginXXS})},[S,y,w,z]),K=G.useMemo(()=>g===0?g:b||g||"",[b,g]),we=G.createElement(LI,{space:!0},typeof K=="function"?K():K),ue=q("tooltip",i),Te=q(),Le=e["data-popover-inject"];let Je=me;!("open"in e)&&!("visible"in e)&&be&&(Je=!1);const xt=G.isValidElement(f)&&!rL(f)?f:G.createElement("span",null,f),Ot=xt.props,Vt=!Ot.className||typeof Ot.className=="string"?Mn(Ot.className,a||`${ue}-open`):Ot.className,[Me,et,Ee]=lx(ue,!Le),jt=cx(ue,u),Ct=jt.arrowStyle,Qt=Mn(F,{[`${ue}-rtl`]:J==="rtl"},jt.className,I,et,Ee,$,ae.root,V==null?void 0:V.root),un=Mn(ae.body,V==null?void 0:V.body),[Yt,He]=lL("Tooltip",D.zIndex),Zt=G.createElement(YI,Object.assign({},D,{zIndex:Yt,showArrow:j,placement:x,mouseEnterDelay:k,mouseLeaveDelay:A,prefixCls:ue,classNames:{root:Qt,body:un},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ct),ie.root),Y),N),H==null?void 0:H.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},ie.body),l),H==null?void 0:H.body),jt.overlayStyle)},getTooltipContainer:_||o||Q,ref:fe,builtinPlacements:ve,overlay:we,visible:Je,onVisibleChange:ne,afterVisibleChange:d??h,arrowContent:G.createElement("span",{className:`${ue}-arrow-content`}),motion:{motionName:cL(Te,"zoom-big-fast",e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:m??!!p}),Je?aL(xt,{className:Vt}):xt);return Me(G.createElement(xm.Provider,{value:He},Zt))});Um.displayName="Tooltip",Um._InternalPanelDoNotUseOrYouWillBeFired=sF;const lF=async(e,t)=>{const{policy:n,file:r}=e||{};return(await lv(n,r)).success?{name:e==null?void 0:e.name,title:r==null?void 0:r.name,size:r==null?void 0:r.size,sub_type:t,type:"conversation_activity_attachment"}:{}},cF=async(e,t)=>{var r;const n=[];try{const i=[];for(let a=0;a<e.length;a+=1)(r=e[a])!=null&&r.id||i.push(lF(e[a],t));n.push(...await Promise.all(i))}catch(i){console.error("Error occurred during file upload:",i),en("error","File upload fails","top-left")}return n},fF=["image/jpeg","image/png","application/pdf"],dF=({conversationId:e,handleCreateMessage:t})=>{const n=M.useRef(null),r=M.useRef(null),i=M.useRef(null),[a,o]=M.useState(""),[u,l]=M.useState([]),[f,d]=M.useState(!1),{handleCreateOrUpdateRealtimeStatus:h}=Ew(),p=async _=>{var F;const x=_==null?void 0:_.name,k=(F=x==null?void 0:x.split)==null?void 0:F.call(x,"."),A=Ge.last(k),N=`${Yp()}.${A}`,I=await uv({name:N,sub_type:e,type:"conversation_activity_attachment"});return I!=null&&I.url?{name:N,file:_,title:x,policy:I}:(en("error",`${x} cannot be uploaded`,"top-left"),null)},m=async _=>{_.preventDefault();const x=5*1024*1024,k=Array.from(_.target.files);let A="";if(Ge.forEach(k,N=>{if(!fF.includes(N.type)){A=`${N.name} is not supported. `;return}if(N.size>x){A="Each file must be under 5MB";return}}),A){en("error",A,"top-left");return}try{const N=[];for(let F=0;F<k.length;F+=1)N.push(p(k[F]));const I=await Promise.all(N);l(F=>[...F,...I.filter(H=>H!==null)])}catch(N){console.error("Error occurred while fetching policies:",N)}i.current.value=null},y=_=>{l(x=>x.filter((k,A)=>A!==_)),i.current&&(i.current.value="")};M.useEffect(()=>{const _=n.current,x=r.current;if(_&&x){_.style.height="auto";const A=x.offsetWidth*.5,N=Math.min(_.scrollHeight,A);_.style.height=`${N}px`,x.style.height=`${N+16}px`,_.style.overflowY=_.scrollHeight>A?"auto":"hidden"}},[a,u]);const g=u.slice(0,5),b=Math.max(0,u.length-5),w=async _=>{if(_&&_.preventDefault(),!(!a&&!u.length)){d(!0);try{const x=Ge.size(u)&&await cF(u,e);await t({message:a,is_customer_reply:!0,...x&&{files:x}}),o(""),l([])}catch(x){console.error("Error sending message:",x)}finally{d(!1)}}},S=M.useMemo(()=>!lk(a)&&!Ge.size(u),[a,u]),C=async _=>{_?await h({conversation_id:e,is_writing_reply:!0}):await h({conversation_id:e,is_writing_reply:!1})},T=_=>{_.key==="Enter"&&!_.shiftKey&&!f&&(_.preventDefault(),w(_))};return O.jsxs(O.Fragment,{children:[u.length>0&&O.jsxs("div",{className:"ed-flex ed-flex-wrap ed-items-center ed-gap-2 ed-mb-2",children:[g.map((_,x)=>O.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2 ed-text-12 ed-font-medium ed-text-border-regular ed-bg-white-light ed-p-1.5 ed-rounded-full",children:[O.jsx("span",{className:"ed-truncate ed-max-w-[100px]",children:_.name}),O.jsx("button",{type:"button",onClick:()=>y(x),className:"ed-text-border hover:ed-text-border-dark ed-flex-shrink-0",children:O.jsx(ri,{size:14})})]},_)),b>0&&O.jsxs("span",{className:"ed-text-12 ed-text-border-regular",children:["+",b," ",b===1?"item":"items"]})]}),O.jsxs("div",{ref:r,className:"ed-border ed-border-border-light ed-rounded-3xl ed-flex ed-justify-between ed-transition-all ed-duration-200",style:{padding:"8px 16px"},children:[O.jsx("div",{className:"ed-flex-1 ed-flex ed-flex-col ed-min-w-0",children:O.jsx("textarea",{ref:n,value:a,onBlur:()=>C(!1),onChange:_=>o(_.target.value),onFocus:()=>C(!0),onKeyDown:_=>T(_),rows:1,className:"ed-w-full ed-text-14 ed-min-h-[24px] ed-resize-none ed-overflow-x-auto ed-outline-none ed-bg-transparent no-scrollbar",placeholder:"Enter your message",disabled:f})}),O.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2.5 ed-ml-2 ed-flex-shrink-0",children:[O.jsx("input",{type:"file",ref:i,onChange:m,className:"ed-hidden",accept:".pdf, .png, .jpeg, .jpg",multiple:!0,disabled:f}),O.jsx(Um,{title:"Supported file types: jpg, png, pdf (max 5MB)",children:O.jsx("button",{type:"button",onClick:()=>{var _;return(_=i.current)==null?void 0:_.click()},className:"ed-text-border hover:ed-text-border-dark",children:O.jsx(Np,{className:"ed-size-5 ed-cursor-pointer"})})}),O.jsx("button",{onClick:w,type:"button",disabled:S||f,children:f?O.jsx(av,{className:"ed-size-5"}):O.jsx(Dp,{className:`${S?"ed-text-border":"ed-text-brand"} ed-size-5`})})]})]})]})},fx=({from:e="knowledge-base",isAuthenticated:t,onSubmit:n,reqId:r,setFeedbackForTheArticle:i,userData:a})=>{var _,x,k;const[o,u]=M.useState([]),[l,f]=M.useState(!1),[d,h]=M.useState({}),p=e==="message",m=p?{contact_person_name:a==null?void 0:a.contact_person_name,contact_person_email:a==null?void 0:a.contact_person_email,ticket_title:d==null?void 0:d.ticket_title,ticket_activity:d==null?void 0:d.ticket_activity}:d,[y,{loading:g}]=Ra(gw),b=async()=>{var A,N;try{if(f(!0),Ge.size(o)&&Ge.size(o)>5){en("error","You can upload maximum 5 files","top-right");return}const I=[],F=[];Ge.forEach(o,V=>{const D=`${Yp()}.${Ge.last(Ge.split(V.name,"."))}`;I.push({name:D,title:V.name,size:V.size,type:"ticket_activity_attachment"}),F.push({file:V,name:D})});const{data:H}=await y({variables:{inputData:{...m,...r,ticket_activity_files:I}}});if((A=H==null?void 0:H.createATicketForPortal)!=null&&A.id){let V=[];if(Ge.size(F)){const D=F.map(async z=>{var Q;try{const q=await uv({name:z.name,type:"ticket_activity_attachment",sub_type:(Q=H==null?void 0:H.createATicketForPortal)==null?void 0:Q.id});if(q!=null&&q.error)return en("error",`Failed to process ${z.name}`,"top-right"),null;const{key:J,url:$,file:Y,success:ae}=await lv({key:q.key,url:q.url},z.file);return ae?{key:J,url:$,file:Y}:null}catch(q){return console.error(`Error processing file ${z.name}:`,q),en("error",`Failed to upload ${z.name}`,"top-right"),null}});V=(await Promise.all(D)).filter(Boolean)}n&&n({ticket_id:(N=H==null?void 0:H.createATicketForPortal)==null?void 0:N.id,ticket_title:m.ticket_title,ticket_activity:m.ticket_activity,ticket_activity_files:V})}}catch(I){en("error","Something went wrong","top-right"),console.error("error",I)}finally{f(!1)}},w=(A,N)=>{h(I=>({...I,[A]:N}))},S=Uh(d.contact_person_email),C=!t&&(!((_=d.contact_person_name)!=null&&_.trim())||!S||!d.contact_person_email)||!((x=d.ticket_title)!=null&&x.trim())||!((k=d.ticket_activity)!=null&&k.trim()),T=()=>g||l?!0:C;return O.jsxs("div",{className:`ed-px-5 ed-pb-5 ${p&&"ed-bg-white-light ed-rounded-md ed-py-2 ed-max-w-full md:ed-max-w-[85%] ed-ml-auto"}`,children:[!p&&O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"ed-flex ed-items-start ed-justify-between ed-pt-5 ed-sticky ed-top-0 ed-bg-white",children:[O.jsx("h5",{className:"ed-text-18 ed-font-semibold ed-text-border-dark ed-mb-5",children:"Get in touch"}),O.jsx(ri,{size:24,className:"ed-text-border-dark ed-cursor-pointer",onClick:()=>i(A=>({...A,notHelpfulModal:!1}))})]}),O.jsx("p",{className:"ed-text-14 ed-font-medium ed-text-border-regular ed-mt-5 ed-mb-4 ed-inline-block ed-w-11/12",children:"Tell us how can we make our product more useful for you."})]}),O.jsxs("div",{className:"ed-space-y-4 ed-mb-6",children:[!t&&O.jsxs(O.Fragment,{children:[O.jsx(Bo,{isRequired:!0,label:"Name",placeholder:"Enter your name",value:d.contact_person_name,onChange:A=>w("contact_person_name",A.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"contact_person_name"}),O.jsx(Bo,{isRequired:!0,type:"email",label:"Email",placeholder:"Enter your email",value:d.contact_person_email,onChange:A=>w("contact_person_email",A.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"contact_person_email"}),(d==null?void 0:d.contact_person_email)&&!S&&O.jsx("span",{className:"ed-text-red ed-font-12",children:"Please enter a valid email address!"})]}),O.jsx(Bo,{isRequired:!0,label:"Subject",placeholder:"Tell us what this feedback is about",value:d.ticket_title,onChange:A=>w("ticket_title",A.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"ticket_title"}),O.jsx(hw,{label:`${t?"Summary":"Description"}`,isRequired:!0,placeholder:"Add more details for us to resolve the issue",value:d.ticket_activity,onChange:A=>w("ticket_activity",A.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"ticket_activity"}),O.jsx(vw,{subtitle:"Supported file types: jpg, png, pdf (max 5MB)",selectedFiles:o,setSelectedFiles:u})]}),O.jsx("div",{className:"ed-flex ed-justify-end",children:O.jsx(Ho,{title:"Submit",loaderText:"Submitting",fullWidthBtn:!0,disabled:T(),loader:g||l,callBack:b})})]})};var zm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GET_CONVERSATION_ACTIVITIES_FOR_PORTAL"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"queryData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ConversationActivitiesForPortalQueryInputType"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"optionData"}},type:{kind:"NamedType",name:{kind:"Name",value:"OptionDataType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getConversationActivitiesForPortal"},arguments:[{kind:"Argument",name:{kind:"Name",value:"queryData"},value:{kind:"Variable",name:{kind:"Name",value:"queryData"}}},{kind:"Argument",name:{kind:"Name",value:"optionData"},value:{kind:"Variable",name:{kind:"Name",value:"optionData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_customer_reply"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"author"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"last_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"first_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"avatar_file"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"files"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"log"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sub_context"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"new_assignee"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"last_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"first_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"meta_data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filtered_rows"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total_rows"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:765}};zm.loc.source={body:`query GET_CONVERSATION_ACTIVITIES_FOR_PORTAL(
|
|
254
|
+
}`),i)}else Cu(i);return function(){Cu(i)}},[t,i])}var FL=!1;function DL(e){return FL}var OS=function(t){return t===!1?!1:!ar()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},Cm=G.forwardRef(function(e,t){var n=e.open,r=e.autoLock,i=e.getContainer,a=e.debug,o=e.autoDestroy,u=o===void 0?!0:o,l=e.children,f=G.useState(n),d=ke(f,2),h=d[0],p=d[1],m=h||n;Gt(ar()||!n,"Portal only work in client side. Please call 'useEffect' to show Portal instead default render in SSR."),G.useEffect(function(){(u||n)&&p(n)},[n,u]);var y=G.useState(function(){return OS(i)}),g=ke(y,2),b=g[0],w=g[1];G.useEffect(function(){var H=OS(i);w(H??null)});var S=RL(m&&!b,a),C=ke(S,2),T=C[0],_=C[1],x=b??T;IL(r&&n&&ar()&&(x===T||x===document.body));var k=null;if(l&&_c(l)&&t){var A=l;k=A.ref}var N=kv(k,t);if(!m||!ar()||b===void 0)return null;var I=x===!1||DL(),F=l;return t&&(F=G.cloneElement(l,{ref:N})),G.createElement(xS.Provider,{value:_},I?F:wi.createPortal(F,x))});Cm.displayName="Portal";function ML(){var e=de({},G);return e.useId}var kS=0,RS=ML();const AS=RS?function(t){var n=RS();return t||n}:function(t){var n=G.useState("ssr-id"),r=ke(n,2),i=r[0],a=r[1];return G.useEffect(function(){var o=kS;kS+=1,a("rc_unique_".concat(o))},[]),t||i};var Wa="RC_FORM_INTERNAL_HOOKS",Pt=function(){Gt(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},rs=G.createContext({getFieldValue:Pt,getFieldsValue:Pt,getFieldError:Pt,getFieldWarning:Pt,getFieldsError:Pt,isFieldsTouched:Pt,isFieldTouched:Pt,isFieldValidating:Pt,isFieldsValidating:Pt,resetFields:Pt,setFields:Pt,setFieldValue:Pt,setFieldsValue:Pt,validateFields:Pt,submit:Pt,getInternalHooks:function(){return Pt(),{dispatch:Pt,initEntityValue:Pt,registerField:Pt,useSubscribe:Pt,setInitialValues:Pt,destroyForm:Pt,setCallbacks:Pt,registerWatch:Pt,getFields:Pt,setValidateMessages:Pt,setPreserve:Pt,getInitialValue:Pt}}}),Qc=G.createContext(null);function Tm(e){return e==null?[]:Array.isArray(e)?e:[e]}function jL(e){return e&&!!e._init}function Om(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var km=Om();function $L(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function VL(e,t,n){if(Nv())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&Eu(i,n.prototype),i}function Rm(e){var t=typeof Map=="function"?new Map:void 0;return Rm=function(r){if(r===null||!$L(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return VL(r,arguments,Su(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Eu(i,r)},Rm(e)}var PS={NODE_ENV:'"production"'},qL=/%[sdj%]/g,NS=function(){};typeof process<"u"&&PS&&PS.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(NS=function(t,n){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&n.every(function(r){return typeof r=="string"})&&console.warn(t,n)});function Am(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function or(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=0,a=n.length;if(typeof e=="function")return e.apply(null,n);if(typeof e=="string"){var o=e.replace(qL,function(u){if(u==="%%")return"%";if(i>=a)return u;switch(u){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return u}});return o}return e}function UL(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function ln(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||UL(t)&&typeof e=="string"&&!e)}function zL(e,t,n){var r=[],i=0,a=e.length;function o(u){r.push.apply(r,De(u||[])),i++,i===a&&n(r)}e.forEach(function(u){t(u,o)})}function LS(e,t,n){var r=0,i=e.length;function a(o){if(o&&o.length){n(o);return}var u=r;r=r+1,u<i?t(e[u],a):n([])}a([])}function HL(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,De(e[n]||[]))}),t}var IS=function(e){$a(n,e);var t=Va(n);function n(r,i){var a;return An(this,n),a=t.call(this,"Async Validation Error"),re(nt(a),"errors",void 0),re(nt(a),"fields",void 0),a.errors=r,a.fields=i,a}return Pn(n)}(Rm(Error));function BL(e,t,n,r,i){if(t.first){var a=new Promise(function(p,m){var y=function(w){return r(w),w.length?m(new IS(w,Am(w))):p(i)},g=HL(e);LS(g,n,y)});return a.catch(function(p){return p}),a}var o=t.firstFields===!0?Object.keys(e):t.firstFields||[],u=Object.keys(e),l=u.length,f=0,d=[],h=new Promise(function(p,m){var y=function(b){if(d.push.apply(d,b),f++,f===l)return r(d),d.length?m(new IS(d,Am(d))):p(i)};u.length||(r(d),p(i)),u.forEach(function(g){var b=e[g];o.indexOf(g)!==-1?LS(b,n,y):zL(b,n,y)})});return h.catch(function(p){return p}),h}function WL(e){return!!(e&&e.message!==void 0)}function GL(e,t){for(var n=e,r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function FS(e,t){return function(n){var r;return e.fullFields?r=GL(t,e.fullFields):r=t[n.field||e.fullField],WL(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function DS(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];Qe(r)==="object"&&Qe(e[n])==="object"?e[n]=de(de({},e[n]),r):e[n]=r}}return e}var is="enum",QL=function(t,n,r,i,a){t[is]=Array.isArray(t[is])?t[is]:[],t[is].indexOf(n)===-1&&i.push(or(a.messages[is],t.fullField,t[is].join(", ")))},YL=function(t,n,r,i,a){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push(or(a.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var o=new RegExp(t.pattern);o.test(n)||i.push(or(a.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},KL=function(t,n,r,i,a){var o=typeof t.len=="number",u=typeof t.min=="number",l=typeof t.max=="number",f=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=n,h=null,p=typeof n=="number",m=typeof n=="string",y=Array.isArray(n);if(p?h="number":m?h="string":y&&(h="array"),!h)return!1;y&&(d=n.length),m&&(d=n.replace(f,"_").length),o?d!==t.len&&i.push(or(a.messages[h].len,t.fullField,t.len)):u&&!l&&d<t.min?i.push(or(a.messages[h].min,t.fullField,t.min)):l&&!u&&d>t.max?i.push(or(a.messages[h].max,t.fullField,t.max)):u&&l&&(d<t.min||d>t.max)&&i.push(or(a.messages[h].range,t.fullField,t.min,t.max))},MS=function(t,n,r,i,a,o){t.required&&(!r.hasOwnProperty(t.field)||ln(n,o||t.type))&&i.push(or(a.messages.required,t.fullField))},Yc;const XL=function(){if(Yc)return Yc;var e="[a-fA-F\\d:]",t=function(x){return x&&x.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",i=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],a="(?:%[0-9a-zA-Z]{1,})?",o="(?:".concat(i.join("|"),")").concat(a),u=new RegExp("(?:^".concat(n,"$)|(?:^").concat(o,"$)")),l=new RegExp("^".concat(n,"$")),f=new RegExp("^".concat(o,"$")),d=function(x){return x&&x.exact?u:new RegExp("(?:".concat(t(x)).concat(n).concat(t(x),")|(?:").concat(t(x)).concat(o).concat(t(x),")"),"g")};d.v4=function(_){return _&&_.exact?l:new RegExp("".concat(t(_)).concat(n).concat(t(_)),"g")},d.v6=function(_){return _&&_.exact?f:new RegExp("".concat(t(_)).concat(o).concat(t(_)),"g")};var h="(?:(?:[a-z]+:)?//)",p="(?:\\S+(?::\\S*)?@)?",m=d.v4().source,y=d.v6().source,g="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",b="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",w="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",S="(?::\\d{2,5})?",C='(?:[/?#][^\\s"]*)?',T="(?:".concat(h,"|www\\.)").concat(p,"(?:localhost|").concat(m,"|").concat(y,"|").concat(g).concat(b).concat(w,")").concat(S).concat(C);return Yc=new RegExp("(?:^".concat(T,"$)"),"i"),Yc};var jS={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Fu={integer:function(t){return Fu.number(t)&&parseInt(t,10)===t},float:function(t){return Fu.number(t)&&!Fu.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return Qe(t)==="object"&&!Fu.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(jS.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(XL())},hex:function(t){return typeof t=="string"&&!!t.match(jS.hex)}},ZL=function(t,n,r,i,a){if(t.required&&n===void 0){MS(t,n,r,i,a);return}var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],u=t.type;o.indexOf(u)>-1?Fu[u](n)||i.push(or(a.messages.types[u],t.fullField,t.type)):u&&Qe(n)!==t.type&&i.push(or(a.messages.types[u],t.fullField,t.type))},JL=function(t,n,r,i,a){(/^\s+$/.test(n)||n==="")&&i.push(or(a.messages.whitespace,t.fullField))};const ut={required:MS,whitespace:JL,type:ZL,range:KL,enum:QL,pattern:YL};var eI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a)}r(o)},tI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(n==null&&!t.required)return r();ut.required(t,n,i,o,a,"array"),n!=null&&(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a))}r(o)},nI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&ut.type(t,n,i,o,a)}r(o)},rI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n,"date")&&!t.required)return r();if(ut.required(t,n,i,o,a),!ln(n,"date")){var l;n instanceof Date?l=n:l=new Date(n),ut.type(t,l,i,o,a),l&&ut.range(t,l.getTime(),i,o,a)}}r(o)},iI="enum",aI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&ut[iI](t,n,i,o,a)}r(o)},oI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a))}r(o)},sI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a))}r(o)},uI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&ut.type(t,n,i,o,a)}r(o)},lI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(n===""&&(n=void 0),ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a))}r(o)},cI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),n!==void 0&&ut.type(t,n,i,o,a)}r(o)},fI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n,"string")&&!t.required)return r();ut.required(t,n,i,o,a),ln(n,"string")||ut.pattern(t,n,i,o,a)}r(o)},dI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n)&&!t.required)return r();ut.required(t,n,i,o,a),ln(n)||ut.type(t,n,i,o,a)}r(o)},hI=function(t,n,r,i,a){var o=[],u=Array.isArray(n)?"array":Qe(n);ut.required(t,n,i,o,a,u),r(o)},pI=function(t,n,r,i,a){var o=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(ln(n,"string")&&!t.required)return r();ut.required(t,n,i,o,a,"string"),ln(n,"string")||(ut.type(t,n,i,o,a),ut.range(t,n,i,o,a),ut.pattern(t,n,i,o,a),t.whitespace===!0&&ut.whitespace(t,n,i,o,a))}r(o)},Pm=function(t,n,r,i,a){var o=t.type,u=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(ln(n,o)&&!t.required)return r();ut.required(t,n,i,u,a,o),ln(n,o)||ut.type(t,n,i,u,a)}r(u)};const Du={string:pI,method:uI,number:lI,boolean:nI,regexp:dI,integer:sI,float:oI,array:tI,object:cI,enum:aI,pattern:fI,date:rI,url:Pm,hex:Pm,email:Pm,required:hI,any:eI};var Mu=function(){function e(t){An(this,e),re(this,"rules",null),re(this,"_messages",km),this.define(t)}return Pn(e,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(Qe(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var a=n[i];r.rules[i]=Array.isArray(a)?a:[a]})}},{key:"messages",value:function(n){return n&&(this._messages=DS(Om(),n)),this._messages}},{key:"validate",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},o=n,u=i,l=a;if(typeof u=="function"&&(l=u,u={}),!this.rules||Object.keys(this.rules).length===0)return l&&l(null,o),Promise.resolve(o);function f(y){var g=[],b={};function w(C){if(Array.isArray(C)){var T;g=(T=g).concat.apply(T,De(C))}else g.push(C)}for(var S=0;S<y.length;S++)w(y[S]);g.length?(b=Am(g),l(g,b)):l(null,o)}if(u.messages){var d=this.messages();d===km&&(d=Om()),DS(d,u.messages),u.messages=d}else u.messages=this.messages();var h={},p=u.keys||Object.keys(this.rules);p.forEach(function(y){var g=r.rules[y],b=o[y];g.forEach(function(w){var S=w;typeof S.transform=="function"&&(o===n&&(o=de({},o)),b=o[y]=S.transform(b),b!=null&&(S.type=S.type||(Array.isArray(b)?"array":Qe(b)))),typeof S=="function"?S={validator:S}:S=de({},S),S.validator=r.getValidationMethod(S),S.validator&&(S.field=y,S.fullField=S.fullField||y,S.type=r.getType(S),h[y]=h[y]||[],h[y].push({rule:S,value:b,source:o,field:y}))})});var m={};return BL(h,u,function(y,g){var b=y.rule,w=(b.type==="object"||b.type==="array")&&(Qe(b.fields)==="object"||Qe(b.defaultField)==="object");w=w&&(b.required||!b.required&&y.value),b.field=y.field;function S(k,A){return de(de({},A),{},{fullField:"".concat(b.fullField,".").concat(k),fullFields:b.fullFields?[].concat(De(b.fullFields),[k]):[k]})}function C(){var k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],A=Array.isArray(k)?k:[k];!u.suppressWarning&&A.length&&e.warning("async-validator:",A),A.length&&b.message!==void 0&&(A=[].concat(b.message));var N=A.map(FS(b,o));if(u.first&&N.length)return m[b.field]=1,g(N);if(!w)g(N);else{if(b.required&&!y.value)return b.message!==void 0?N=[].concat(b.message).map(FS(b,o)):u.error&&(N=[u.error(b,or(u.messages.required,b.field))]),g(N);var I={};b.defaultField&&Object.keys(y.value).map(function(V){I[V]=b.defaultField}),I=de(de({},I),y.rule.fields);var F={};Object.keys(I).forEach(function(V){var D=I[V],j=Array.isArray(D)?D:[D];F[V]=j.map(S.bind(null,V))});var H=new e(F);H.messages(u.messages),y.rule.options&&(y.rule.options.messages=u.messages,y.rule.options.error=u.error),H.validate(y.value,y.rule.options||u,function(V){var D=[];N&&N.length&&D.push.apply(D,De(N)),V&&V.length&&D.push.apply(D,De(V)),g(D.length?D:null)})}}var T;if(b.asyncValidator)T=b.asyncValidator(b,y.value,C,y.source,u);else if(b.validator){try{T=b.validator(b,y.value,C,y.source,u)}catch(k){var _,x;(_=(x=console).error)===null||_===void 0||_.call(x,k),u.suppressValidatorError||setTimeout(function(){throw k},0),C(k.message)}T===!0?C():T===!1?C(typeof b.message=="function"?b.message(b.fullField||b.field):b.message||"".concat(b.fullField||b.field," fails")):T instanceof Array?C(T):T instanceof Error&&C(T.message)}T&&T.then&&T.then(function(){return C()},function(k){return C(k)})},function(y){f(y)},o)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!Du.hasOwnProperty(n.type))throw new Error(or("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),i=r.indexOf("message");return i!==-1&&r.splice(i,1),r.length===1&&r[0]==="required"?Du.required:Du[this.getType(n)]||void 0}}]),e}();re(Mu,"register",function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");Du[t]=n}),re(Mu,"warning",NS),re(Mu,"messages",km),re(Mu,"validators",Du);var sr="'${name}' is not a valid ${type}",$S={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:sr,method:sr,array:sr,object:sr,number:sr,date:sr,boolean:sr,integer:sr,float:sr,regexp:sr,email:sr,url:sr,hex:sr},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},VS=Mu;function vI(e,t){return e.replace(/\\?\$\{\w+\}/g,function(n){if(n.startsWith("\\"))return n.slice(1);var r=n.slice(2,-1);return t[r]})}var qS="CODE_LOGIC_ERROR";function Nm(e,t,n,r,i){return Lm.apply(this,arguments)}function Lm(){return Lm=Iu(Yr().mark(function e(t,n,r,i,a){var o,u,l,f,d,h,p,m,y;return Yr().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return o=de({},r),delete o.ruleIndex,VS.warning=function(){},o.validator&&(u=o.validator,o.validator=function(){try{return u.apply(void 0,arguments)}catch(w){return console.error(w),Promise.reject(qS)}}),l=null,o&&o.type==="array"&&o.defaultField&&(l=o.defaultField,delete o.defaultField),f=new VS(re({},t,[o])),d=Ru($S,i.validateMessages),f.messages(d),h=[],b.prev=10,b.next=13,Promise.resolve(f.validate(re({},t,n),de({},i)));case 13:b.next=18;break;case 15:b.prev=15,b.t0=b.catch(10),b.t0.errors&&(h=b.t0.errors.map(function(w,S){var C=w.message,T=C===qS?d.default:C;return G.isValidElement(T)?G.cloneElement(T,{key:"error_".concat(S)}):T}));case 18:if(!(!h.length&&l)){b.next=23;break}return b.next=21,Promise.all(n.map(function(w,S){return Nm("".concat(t,".").concat(S),w,l,i,a)}));case 21:return p=b.sent,b.abrupt("return",p.reduce(function(w,S){return[].concat(De(w),De(S))},[]));case 23:return m=de(de({},r),{},{name:t,enum:(r.enum||[]).join(", ")},a),y=h.map(function(w){return typeof w=="string"?vI(w,m):w}),b.abrupt("return",y);case 26:case"end":return b.stop()}},e,null,[[10,15]])})),Lm.apply(this,arguments)}function mI(e,t,n,r,i,a){var o=e.join("."),u=n.map(function(d,h){var p=d.validator,m=de(de({},d),{},{ruleIndex:h});return p&&(m.validator=function(y,g,b){var w=!1,S=function(){for(var _=arguments.length,x=new Array(_),k=0;k<_;k++)x[k]=arguments[k];Promise.resolve().then(function(){Gt(!w,"Your validator function has already return a promise. `callback` will be ignored."),w||b.apply(void 0,x)})},C=p(y,g,S);w=C&&typeof C.then=="function"&&typeof C.catch=="function",Gt(w,"`callback` is deprecated. Please return a promise instead."),w&&C.then(function(){b()}).catch(function(T){b(T||" ")})}),m}).sort(function(d,h){var p=d.warningOnly,m=d.ruleIndex,y=h.warningOnly,g=h.ruleIndex;return!!p==!!y?m-g:p?1:-1}),l;if(i===!0)l=new Promise(function(){var d=Iu(Yr().mark(function h(p,m){var y,g,b;return Yr().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:y=0;case 1:if(!(y<u.length)){S.next=12;break}return g=u[y],S.next=5,Nm(o,t,g,r,a);case 5:if(b=S.sent,!b.length){S.next=9;break}return m([{errors:b,rule:g}]),S.abrupt("return");case 9:y+=1,S.next=1;break;case 12:p([]);case 13:case"end":return S.stop()}},h)}));return function(h,p){return d.apply(this,arguments)}}());else{var f=u.map(function(d){return Nm(o,t,d,r,a).then(function(h){return{errors:h,rule:d}})});l=(i?yI(f):gI(f)).then(function(d){return Promise.reject(d)})}return l.catch(function(d){return d}),l}function gI(e){return Im.apply(this,arguments)}function Im(){return Im=Iu(Yr().mark(function e(t){return Yr().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.all(t).then(function(i){var a,o=(a=[]).concat.apply(a,De(i));return o}));case 1:case"end":return r.stop()}},e)})),Im.apply(this,arguments)}function yI(e){return Fm.apply(this,arguments)}function Fm(){return Fm=Iu(Yr().mark(function e(t){var n;return Yr().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return n=0,i.abrupt("return",new Promise(function(a){t.forEach(function(o){o.then(function(u){u.errors.length&&a([u]),n+=1,n===t.length&&a([])})})}));case 2:case"end":return i.stop()}},e)})),Fm.apply(this,arguments)}function nn(e){return Tm(e)}function US(e,t){var n={};return t.forEach(function(r){var i=si(e,r);n=Gr(n,r,i)}),n}function as(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e&&e.some(function(r){return zS(t,r,n)})}function zS(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!e||!t||!n&&e.length!==t.length?!1:t.every(function(r,i){return e[i]===r})}function bI(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||Qe(e)!=="object"||Qe(t)!=="object")return!1;var n=Object.keys(e),r=Object.keys(t),i=new Set([].concat(n,r));return De(i).every(function(a){var o=e[a],u=t[a];return typeof o=="function"&&typeof u=="function"?!0:o===u})}function _I(e){var t=arguments.length<=1?void 0:arguments[1];return t&&t.target&&Qe(t.target)==="object"&&e in t.target?t.target[e]:t}function HS(e,t,n){var r=e.length;if(t<0||t>=r||n<0||n>=r)return e;var i=e[t],a=t-n;return a>0?[].concat(De(e.slice(0,n)),[i],De(e.slice(n,t)),De(e.slice(t+1,r))):a<0?[].concat(De(e.slice(0,t)),De(e.slice(t+1,n+1)),[i],De(e.slice(n+1,r))):e}var wI=["name"],Tr=[];function Dm(e,t,n,r,i,a){return typeof e=="function"?e(t,n,"source"in a?{source:a.source}:{}):r!==i}var Mm=function(e){$a(n,e);var t=Va(n);function n(r){var i;if(An(this,n),i=t.call(this,r),re(nt(i),"state",{resetCount:0}),re(nt(i),"cancelRegisterFunc",null),re(nt(i),"mounted",!1),re(nt(i),"touched",!1),re(nt(i),"dirty",!1),re(nt(i),"validatePromise",void 0),re(nt(i),"prevValidating",void 0),re(nt(i),"errors",Tr),re(nt(i),"warnings",Tr),re(nt(i),"cancelRegister",function(){var l=i.props,f=l.preserve,d=l.isListField,h=l.name;i.cancelRegisterFunc&&i.cancelRegisterFunc(d,f,nn(h)),i.cancelRegisterFunc=null}),re(nt(i),"getNamePath",function(){var l=i.props,f=l.name,d=l.fieldContext,h=d.prefixName,p=h===void 0?[]:h;return f!==void 0?[].concat(De(p),De(f)):[]}),re(nt(i),"getRules",function(){var l=i.props,f=l.rules,d=f===void 0?[]:f,h=l.fieldContext;return d.map(function(p){return typeof p=="function"?p(h):p})}),re(nt(i),"refresh",function(){i.mounted&&i.setState(function(l){var f=l.resetCount;return{resetCount:f+1}})}),re(nt(i),"metaCache",null),re(nt(i),"triggerMetaEvent",function(l){var f=i.props.onMetaChange;if(f){var d=de(de({},i.getMeta()),{},{destroy:l});rE(i.metaCache,d)||f(d),i.metaCache=d}else i.metaCache=null}),re(nt(i),"onStoreChange",function(l,f,d){var h=i.props,p=h.shouldUpdate,m=h.dependencies,y=m===void 0?[]:m,g=h.onReset,b=d.store,w=i.getNamePath(),S=i.getValue(l),C=i.getValue(b),T=f&&as(f,w);switch(d.type==="valueUpdate"&&d.source==="external"&&!rE(S,C)&&(i.touched=!0,i.dirty=!0,i.validatePromise=null,i.errors=Tr,i.warnings=Tr,i.triggerMetaEvent()),d.type){case"reset":if(!f||T){i.touched=!1,i.dirty=!1,i.validatePromise=void 0,i.errors=Tr,i.warnings=Tr,i.triggerMetaEvent(),g==null||g(),i.refresh();return}break;case"remove":{if(p&&Dm(p,l,b,S,C,d)){i.reRender();return}break}case"setField":{var _=d.data;if(T){"touched"in _&&(i.touched=_.touched),"validating"in _&&!("originRCField"in _)&&(i.validatePromise=_.validating?Promise.resolve([]):null),"errors"in _&&(i.errors=_.errors||Tr),"warnings"in _&&(i.warnings=_.warnings||Tr),i.dirty=!0,i.triggerMetaEvent(),i.reRender();return}else if("value"in _&&as(f,w,!0)){i.reRender();return}if(p&&!w.length&&Dm(p,l,b,S,C,d)){i.reRender();return}break}case"dependenciesUpdate":{var x=y.map(nn);if(x.some(function(k){return as(d.relatedFields,k)})){i.reRender();return}break}default:if(T||(!y.length||w.length||p)&&Dm(p,l,b,S,C,d)){i.reRender();return}break}p===!0&&i.reRender()}),re(nt(i),"validateRules",function(l){var f=i.getNamePath(),d=i.getValue(),h=l||{},p=h.triggerName,m=h.validateOnly,y=m===void 0?!1:m,g=Promise.resolve().then(Iu(Yr().mark(function b(){var w,S,C,T,_,x,k;return Yr().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(i.mounted){N.next=2;break}return N.abrupt("return",[]);case 2:if(w=i.props,S=w.validateFirst,C=S===void 0?!1:S,T=w.messageVariables,_=w.validateDebounce,x=i.getRules(),p&&(x=x.filter(function(I){return I}).filter(function(I){var F=I.validateTrigger;if(!F)return!0;var H=Tm(F);return H.includes(p)})),!(_&&p)){N.next=10;break}return N.next=8,new Promise(function(I){setTimeout(I,_)});case 8:if(i.validatePromise===g){N.next=10;break}return N.abrupt("return",[]);case 10:return k=mI(f,d,x,l,C,T),k.catch(function(I){return I}).then(function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tr;if(i.validatePromise===g){var F;i.validatePromise=null;var H=[],V=[];(F=I.forEach)===null||F===void 0||F.call(I,function(D){var j=D.rule.warningOnly,z=D.errors,Q=z===void 0?Tr:z;j?V.push.apply(V,De(Q)):H.push.apply(H,De(Q))}),i.errors=H,i.warnings=V,i.triggerMetaEvent(),i.reRender()}}),N.abrupt("return",k);case 13:case"end":return N.stop()}},b)})));return y||(i.validatePromise=g,i.dirty=!0,i.errors=Tr,i.warnings=Tr,i.triggerMetaEvent(),i.reRender()),g}),re(nt(i),"isFieldValidating",function(){return!!i.validatePromise}),re(nt(i),"isFieldTouched",function(){return i.touched}),re(nt(i),"isFieldDirty",function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var l=i.props.fieldContext,f=l.getInternalHooks(Wa),d=f.getInitialValue;return d(i.getNamePath())!==void 0}),re(nt(i),"getErrors",function(){return i.errors}),re(nt(i),"getWarnings",function(){return i.warnings}),re(nt(i),"isListField",function(){return i.props.isListField}),re(nt(i),"isList",function(){return i.props.isList}),re(nt(i),"isPreserve",function(){return i.props.preserve}),re(nt(i),"getMeta",function(){i.prevValidating=i.isFieldValidating();var l={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath(),validated:i.validatePromise===null};return l}),re(nt(i),"getOnlyChild",function(l){if(typeof l=="function"){var f=i.getMeta();return de(de({},i.getOnlyChild(l(i.getControlled(),f,i.props.fieldContext))),{},{isFunction:!0})}var d=yc(l);return d.length!==1||!G.isValidElement(d[0])?{child:d,isFunction:!1}:{child:d[0],isFunction:!1}}),re(nt(i),"getValue",function(l){var f=i.props.fieldContext.getFieldsValue,d=i.getNamePath();return si(l||f(!0),d)}),re(nt(i),"getControlled",function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=i.props,d=f.name,h=f.trigger,p=f.validateTrigger,m=f.getValueFromEvent,y=f.normalize,g=f.valuePropName,b=f.getValueProps,w=f.fieldContext,S=p!==void 0?p:w.validateTrigger,C=i.getNamePath(),T=w.getInternalHooks,_=w.getFieldsValue,x=T(Wa),k=x.dispatch,A=i.getValue(),N=b||function(D){return re({},g,D)},I=l[h],F=d!==void 0?N(A):{};F&&Object.keys(F).forEach(function(D){Gt(typeof F[D]!="function","It's not recommended to generate dynamic function prop by `getValueProps`. Please pass it to child component directly (prop: ".concat(D,")"))});var H=de(de({},l),F);H[h]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var D,j=arguments.length,z=new Array(j),Q=0;Q<j;Q++)z[Q]=arguments[Q];m?D=m.apply(void 0,z):D=_I.apply(void 0,[g].concat(z)),y&&(D=y(D,A,_(!0))),D!==A&&k({type:"updateValue",namePath:C,value:D}),I&&I.apply(void 0,z)};var V=Tm(S||[]);return V.forEach(function(D){var j=H[D];H[D]=function(){j&&j.apply(void 0,arguments);var z=i.props.rules;z&&z.length&&k({type:"validateField",namePath:C,triggerName:D})}}),H}),r.fieldContext){var a=r.fieldContext.getInternalHooks,o=a(Wa),u=o.initEntityValue;u(nt(i))}return i}return Pn(n,[{key:"componentDidMount",value:function(){var i=this.props,a=i.shouldUpdate,o=i.fieldContext;if(this.mounted=!0,o){var u=o.getInternalHooks,l=u(Wa),f=l.registerField;this.cancelRegisterFunc=f(this)}a===!0&&this.reRender()}},{key:"componentWillUnmount",value:function(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}},{key:"reRender",value:function(){this.mounted&&this.forceUpdate()}},{key:"render",value:function(){var i=this.state.resetCount,a=this.props.children,o=this.getOnlyChild(a),u=o.child,l=o.isFunction,f;return l?f=u:G.isValidElement(u)?f=G.cloneElement(u,this.getControlled(u.props)):(Gt(!u,"`children` of Field is not validate ReactElement."),f=u),G.createElement(G.Fragment,{key:i},f)}}]),n}(G.Component);re(Mm,"contextType",rs),re(Mm,"defaultProps",{trigger:"onChange",valuePropName:"value"});function BS(e){var t,n=e.name,r=Ua(e,wI),i=G.useContext(rs),a=G.useContext(Qc),o=n!==void 0?nn(n):void 0,u=(t=r.isListField)!==null&&t!==void 0?t:!!a,l="keep";return u||(l="_".concat((o||[]).join("_"))),r.preserve===!1&&u&&o.length<=1&&Gt(!1,"`preserve` should not apply on Form.List fields."),G.createElement(Mm,ai({key:l,name:o,isListField:u},r,{fieldContext:i}))}function EI(e){var t=e.name,n=e.initialValue,r=e.children,i=e.rules,a=e.validateTrigger,o=e.isListField,u=G.useContext(rs),l=G.useContext(Qc),f=G.useRef({keys:[],id:0}),d=f.current,h=G.useMemo(function(){var g=nn(u.prefixName)||[];return[].concat(De(g),De(nn(t)))},[u.prefixName,t]),p=G.useMemo(function(){return de(de({},u),{},{prefixName:h})},[u,h]),m=G.useMemo(function(){return{getKey:function(b){var w=h.length,S=b[w];return[d.keys[S],b.slice(w+1)]}}},[h]);if(typeof r!="function")return Gt(!1,"Form.List only accepts function as children."),null;var y=function(b,w,S){var C=S.source;return C==="internal"?!1:b!==w};return G.createElement(Qc.Provider,{value:m},G.createElement(rs.Provider,{value:p},G.createElement(BS,{name:[],shouldUpdate:y,rules:i,validateTrigger:a,initialValue:n,isList:!0,isListField:o??!!l},function(g,b){var w=g.value,S=w===void 0?[]:w,C=g.onChange,T=u.getFieldValue,_=function(){var N=T(h||[]);return N||[]},x={add:function(N,I){var F=_();I>=0&&I<=F.length?(d.keys=[].concat(De(d.keys.slice(0,I)),[d.id],De(d.keys.slice(I))),C([].concat(De(F.slice(0,I)),[N],De(F.slice(I))))):((I<0||I>F.length)&&Gt(!1,"The second parameter of the add function should be a valid positive number."),d.keys=[].concat(De(d.keys),[d.id]),C([].concat(De(F),[N]))),d.id+=1},remove:function(N){var I=_(),F=new Set(Array.isArray(N)?N:[N]);F.size<=0||(d.keys=d.keys.filter(function(H,V){return!F.has(V)}),C(I.filter(function(H,V){return!F.has(V)})))},move:function(N,I){if(N!==I){var F=_();N<0||N>=F.length||I<0||I>=F.length||(d.keys=HS(d.keys,N,I),C(HS(F,N,I)))}}},k=S||[];return Array.isArray(k)||(k=[],Gt(!1,"Current value of '".concat(h.join(" > "),"' is not an array type."))),r(k.map(function(A,N){var I=d.keys[N];return I===void 0&&(d.keys[N]=d.id,I=d.keys[N],d.id+=1),{name:N,key:I,isListField:!0}}),x,b)})))}function SI(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,a){e.forEach(function(o,u){o.catch(function(l){return t=!0,l}).then(function(l){n-=1,r[u]=l,!(n>0)&&(t&&a(r),i(r))})})}):Promise.resolve([])}var WS="__@field_split__";function jm(e){return e.map(function(t){return"".concat(Qe(t),":").concat(t)}).join(WS)}var os=function(){function e(){An(this,e),re(this,"kvs",new Map)}return Pn(e,[{key:"set",value:function(n,r){this.kvs.set(jm(n),r)}},{key:"get",value:function(n){return this.kvs.get(jm(n))}},{key:"update",value:function(n,r){var i=this.get(n),a=r(i);a?this.set(n,a):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(jm(n))}},{key:"map",value:function(n){return De(this.kvs.entries()).map(function(r){var i=ke(r,2),a=i[0],o=i[1],u=a.split(WS);return n({key:u.map(function(l){var f=l.match(/^([^:]*):(.*)$/),d=ke(f,3),h=d[1],p=d[2];return h==="number"?Number(p):p}),value:o})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,a=r.value;return n[i.join(".")]=a,null}),n}}]),e}(),xI=["name"],CI=Pn(function e(t){var n=this;An(this,e),re(this,"formHooked",!1),re(this,"forceRootUpdate",void 0),re(this,"subscribable",!0),re(this,"store",{}),re(this,"fieldEntities",[]),re(this,"initialValues",{}),re(this,"callbacks",{}),re(this,"validateMessages",null),re(this,"preserve",null),re(this,"lastValidatePromise",null),re(this,"getForm",function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}}),re(this,"getInternalHooks",function(r){return r===Wa?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Gt(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),re(this,"useSubscribe",function(r){n.subscribable=r}),re(this,"prevWithoutPreserves",null),re(this,"setInitialValues",function(r,i){if(n.initialValues=r||{},i){var a,o=Ru(r,n.store);(a=n.prevWithoutPreserves)===null||a===void 0||a.map(function(u){var l=u.key;o=Gr(o,l,si(r,l))}),n.prevWithoutPreserves=null,n.updateStore(o)}}),re(this,"destroyForm",function(r){if(r)n.updateStore({});else{var i=new os;n.getFieldEntities(!0).forEach(function(a){n.isMergedPreserve(a.isPreserve())||i.set(a.getNamePath(),!0)}),n.prevWithoutPreserves=i}}),re(this,"getInitialValue",function(r){var i=si(n.initialValues,r);return r.length?Ru(i):i}),re(this,"setCallbacks",function(r){n.callbacks=r}),re(this,"setValidateMessages",function(r){n.validateMessages=r}),re(this,"setPreserve",function(r){n.preserve=r}),re(this,"watchList",[]),re(this,"registerWatch",function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}}),re(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue(),a=n.getFieldsValue(!0);n.watchList.forEach(function(o){o(i,a,r)})}}),re(this,"timeoutId",null),re(this,"warningUnhooked",function(){!n.timeoutId&&typeof window<"u"&&(n.timeoutId=setTimeout(function(){n.timeoutId=null,n.formHooked||Gt(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))}),re(this,"updateStore",function(r){n.store=r}),re(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(i){return i.getNamePath().length}):n.fieldEntities}),re(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new os;return n.getFieldEntities(r).forEach(function(a){var o=a.getNamePath();i.set(o,a)}),i}),re(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(a){var o=nn(a);return i.get(o)||{INVALIDATE_NAME_PATH:nn(a)}})}),re(this,"getFieldsValue",function(r,i){n.warningUnhooked();var a,o,u;if(r===!0||Array.isArray(r)?(a=r,o=i):r&&Qe(r)==="object"&&(u=r.strict,o=r.filter),a===!0&&!o)return n.store;var l=n.getFieldEntitiesForNamePathList(Array.isArray(a)?a:null),f=[];return l.forEach(function(d){var h,p,m="INVALIDATE_NAME_PATH"in d?d.INVALIDATE_NAME_PATH:d.getNamePath();if(u){var y,g;if((y=(g=d).isList)!==null&&y!==void 0&&y.call(g))return}else if(!a&&(h=(p=d).isListField)!==null&&h!==void 0&&h.call(p))return;if(!o)f.push(m);else{var b="getMeta"in d?d.getMeta():null;o(b)&&f.push(m)}}),US(n.store,f.map(nn))}),re(this,"getFieldValue",function(r){n.warningUnhooked();var i=nn(r);return si(n.store,i)}),re(this,"getFieldsError",function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(a,o){return a&&!("INVALIDATE_NAME_PATH"in a)?{name:a.getNamePath(),errors:a.getErrors(),warnings:a.getWarnings()}:{name:nn(r[o]),errors:[],warnings:[]}})}),re(this,"getFieldError",function(r){n.warningUnhooked();var i=nn(r),a=n.getFieldsError([i])[0];return a.errors}),re(this,"getFieldWarning",function(r){n.warningUnhooked();var i=nn(r),a=n.getFieldsError([i])[0];return a.warnings}),re(this,"isFieldsTouched",function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var o=i[0],u=i[1],l,f=!1;i.length===0?l=null:i.length===1?Array.isArray(o)?(l=o.map(nn),f=!1):(l=null,f=o):(l=o.map(nn),f=u);var d=n.getFieldEntities(!0),h=function(b){return b.isFieldTouched()};if(!l)return f?d.every(function(g){return h(g)||g.isList()}):d.some(h);var p=new os;l.forEach(function(g){p.set(g,[])}),d.forEach(function(g){var b=g.getNamePath();l.forEach(function(w){w.every(function(S,C){return b[C]===S})&&p.update(w,function(S){return[].concat(De(S),[g])})})});var m=function(b){return b.some(h)},y=p.map(function(g){var b=g.value;return b});return f?y.every(m):y.some(m)}),re(this,"isFieldTouched",function(r){return n.warningUnhooked(),n.isFieldsTouched([r])}),re(this,"isFieldsValidating",function(r){n.warningUnhooked();var i=n.getFieldEntities();if(!r)return i.some(function(o){return o.isFieldValidating()});var a=r.map(nn);return i.some(function(o){var u=o.getNamePath();return as(a,u)&&o.isFieldValidating()})}),re(this,"isFieldValidating",function(r){return n.warningUnhooked(),n.isFieldsValidating([r])}),re(this,"resetWithFieldInitialValue",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new os,a=n.getFieldEntities(!0);a.forEach(function(l){var f=l.props.initialValue,d=l.getNamePath();if(f!==void 0){var h=i.get(d)||new Set;h.add({entity:l,value:f}),i.set(d,h)}});var o=function(f){f.forEach(function(d){var h=d.props.initialValue;if(h!==void 0){var p=d.getNamePath(),m=n.getInitialValue(p);if(m!==void 0)Gt(!1,"Form already set 'initialValues' with path '".concat(p.join("."),"'. Field can not overwrite it."));else{var y=i.get(p);if(y&&y.size>1)Gt(!1,"Multiple Field with path '".concat(p.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(y){var g=n.getFieldValue(p),b=d.isListField();!b&&(!r.skipExist||g===void 0)&&n.updateStore(Gr(n.store,p,De(y)[0].value))}}}})},u;r.entities?u=r.entities:r.namePathList?(u=[],r.namePathList.forEach(function(l){var f=i.get(l);if(f){var d;(d=u).push.apply(d,De(De(f).map(function(h){return h.entity})))}})):u=a,o(u)}),re(this,"resetFields",function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(Ru(n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var a=r.map(nn);a.forEach(function(o){var u=n.getInitialValue(o);n.updateStore(Gr(n.store,o,u))}),n.resetWithFieldInitialValue({namePathList:a}),n.notifyObservers(i,a,{type:"reset"}),n.notifyWatch(a)}),re(this,"setFields",function(r){n.warningUnhooked();var i=n.store,a=[];r.forEach(function(o){var u=o.name,l=Ua(o,xI),f=nn(u);a.push(f),"value"in l&&n.updateStore(Gr(n.store,f,l.value)),n.notifyObservers(i,[f],{type:"setField",data:o})}),n.notifyWatch(a)}),re(this,"getFields",function(){var r=n.getFieldEntities(!0),i=r.map(function(a){var o=a.getNamePath(),u=a.getMeta(),l=de(de({},u),{},{name:o,value:n.getFieldValue(o)});return Object.defineProperty(l,"originRCField",{value:!0}),l});return i}),re(this,"initEntityValue",function(r){var i=r.props.initialValue;if(i!==void 0){var a=r.getNamePath(),o=si(n.store,a);o===void 0&&n.updateStore(Gr(n.store,a,i))}}),re(this,"isMergedPreserve",function(r){var i=r!==void 0?r:n.preserve;return i??!0}),re(this,"registerField",function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var a=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(a,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(o,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(h){return h!==r}),!n.isMergedPreserve(u)&&(!o||l.length>1)){var f=o?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==f&&n.fieldEntities.every(function(h){return!zS(h.getNamePath(),i)})){var d=n.store;n.updateStore(Gr(d,i,f,!0)),n.notifyObservers(d,[i],{type:"remove"}),n.triggerDependenciesUpdate(d,i)}}n.notifyWatch([i])}}),re(this,"dispatch",function(r){switch(r.type){case"updateValue":{var i=r.namePath,a=r.value;n.updateValue(i,a);break}case"validateField":{var o=r.namePath,u=r.triggerName;n.validateFields([o],{triggerName:u});break}}}),re(this,"notifyObservers",function(r,i,a){if(n.subscribable){var o=de(de({},a),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(u){var l=u.onStoreChange;l(r,i,o)})}else n.forceRootUpdate()}),re(this,"triggerDependenciesUpdate",function(r,i){var a=n.getDependencyChildrenFields(i);return a.length&&n.validateFields(a),n.notifyObservers(r,a,{type:"dependenciesUpdate",relatedFields:[i].concat(De(a))}),a}),re(this,"updateValue",function(r,i){var a=nn(r),o=n.store;n.updateStore(Gr(n.store,a,i)),n.notifyObservers(o,[a],{type:"valueUpdate",source:"internal"}),n.notifyWatch([a]);var u=n.triggerDependenciesUpdate(o,a),l=n.callbacks.onValuesChange;if(l){var f=US(n.store,[a]);l(f,n.getFieldsValue())}n.triggerOnFieldsChange([a].concat(De(u)))}),re(this,"setFieldsValue",function(r){n.warningUnhooked();var i=n.store;if(r){var a=Ru(n.store,r);n.updateStore(a)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()}),re(this,"setFieldValue",function(r,i){n.setFields([{name:r,value:i,errors:[],warnings:[]}])}),re(this,"getDependencyChildrenFields",function(r){var i=new Set,a=[],o=new os;n.getFieldEntities().forEach(function(l){var f=l.props.dependencies;(f||[]).forEach(function(d){var h=nn(d);o.update(h,function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return p.add(l),p})})});var u=function l(f){var d=o.get(f)||new Set;d.forEach(function(h){if(!i.has(h)){i.add(h);var p=h.getNamePath();h.isFieldDirty()&&p.length&&(a.push(p),l(p))}})};return u(r),a}),re(this,"triggerOnFieldsChange",function(r,i){var a=n.callbacks.onFieldsChange;if(a){var o=n.getFields();if(i){var u=new os;i.forEach(function(f){var d=f.name,h=f.errors;u.set(d,h)}),o.forEach(function(f){f.errors=u.get(f.name)||f.errors})}var l=o.filter(function(f){var d=f.name;return as(r,d)});l.length&&a(l,o)}}),re(this,"validateFields",function(r,i){n.warningUnhooked();var a,o;Array.isArray(r)||typeof r=="string"||typeof i=="string"?(a=r,o=i):o=r;var u=!!a,l=u?a.map(nn):[],f=[],d=String(Date.now()),h=new Set,p=o||{},m=p.recursive,y=p.dirty;n.getFieldEntities(!0).forEach(function(S){if(u||l.push(S.getNamePath()),!(!S.props.rules||!S.props.rules.length)&&!(y&&!S.isFieldDirty())){var C=S.getNamePath();if(h.add(C.join(d)),!u||as(l,C,m)){var T=S.validateRules(de({validateMessages:de(de({},$S),n.validateMessages)},o));f.push(T.then(function(){return{name:C,errors:[],warnings:[]}}).catch(function(_){var x,k=[],A=[];return(x=_.forEach)===null||x===void 0||x.call(_,function(N){var I=N.rule.warningOnly,F=N.errors;I?A.push.apply(A,De(F)):k.push.apply(k,De(F))}),k.length?Promise.reject({name:C,errors:k,warnings:A}):{name:C,errors:k,warnings:A}}))}}});var g=SI(f);n.lastValidatePromise=g,g.catch(function(S){return S}).then(function(S){var C=S.map(function(T){var _=T.name;return _});n.notifyObservers(n.store,C,{type:"validateFinish"}),n.triggerOnFieldsChange(C,S)});var b=g.then(function(){return n.lastValidatePromise===g?Promise.resolve(n.getFieldsValue(l)):Promise.reject([])}).catch(function(S){var C=S.filter(function(T){return T&&T.errors.length});return Promise.reject({values:n.getFieldsValue(l),errorFields:C,outOfDate:n.lastValidatePromise!==g})});b.catch(function(S){return S});var w=l.filter(function(S){return h.has(S.join(d))});return n.triggerOnFieldsChange(w),b}),re(this,"submit",function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(a){console.error(a)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})}),this.forceRootUpdate=t});function GS(e){var t=G.useRef(),n=G.useState({}),r=ke(n,2),i=r[1];if(!t.current)if(e)t.current=e;else{var a=function(){i({})},o=new CI(a);t.current=o.getForm()}return[t.current]}var $m=G.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),TI=function(t){var n=t.validateMessages,r=t.onFormChange,i=t.onFormFinish,a=t.children,o=G.useContext($m),u=G.useRef({});return G.createElement($m.Provider,{value:de(de({},o),{},{validateMessages:de(de({},o.validateMessages),n),triggerFormChange:function(f,d){r&&r(f,{changedFields:d,forms:u.current}),o.triggerFormChange(f,d)},triggerFormFinish:function(f,d){i&&i(f,{values:d,forms:u.current}),o.triggerFormFinish(f,d)},registerForm:function(f,d){f&&(u.current=de(de({},u.current),{},re({},f,d))),o.registerForm(f,d)},unregisterForm:function(f){var d=de({},u.current);delete d[f],u.current=d,o.unregisterForm(f)}})},a)},OI=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed","clearOnDestroy"],kI=function(t,n){var r=t.name,i=t.initialValues,a=t.fields,o=t.form,u=t.preserve,l=t.children,f=t.component,d=f===void 0?"form":f,h=t.validateMessages,p=t.validateTrigger,m=p===void 0?"onChange":p,y=t.onValuesChange,g=t.onFieldsChange,b=t.onFinish,w=t.onFinishFailed,S=t.clearOnDestroy,C=Ua(t,OI),T=G.useRef(null),_=G.useContext($m),x=GS(o),k=ke(x,1),A=k[0],N=A.getInternalHooks(Wa),I=N.useSubscribe,F=N.setInitialValues,H=N.setCallbacks,V=N.setValidateMessages,D=N.setPreserve,j=N.destroyForm;G.useImperativeHandle(n,function(){return de(de({},A),{},{nativeElement:T.current})}),G.useEffect(function(){return _.registerForm(r,A),function(){_.unregisterForm(r)}},[_,A,r]),V(de(de({},_.validateMessages),h)),H({onValuesChange:y,onFieldsChange:function(te){if(_.triggerFormChange(r,te),g){for(var fe=arguments.length,le=new Array(fe>1?fe-1:0),me=1;me<fe;me++)le[me-1]=arguments[me];g.apply(void 0,[te].concat(le))}},onFinish:function(te){_.triggerFormFinish(r,te),b&&b(te)},onFinishFailed:w}),D(u);var z=G.useRef(null);F(i,!z.current),z.current||(z.current=!0),G.useEffect(function(){return function(){return j(S)}},[]);var Q,q=typeof l=="function";if(q){var J=A.getFieldsValue(!0);Q=l(J,A)}else Q=l;I(!q);var $=G.useRef();G.useEffect(function(){bI($.current||[],a||[])||A.setFields(a||[]),$.current=a},[a,A]);var Y=G.useMemo(function(){return de(de({},A),{},{validateTrigger:m})},[A,m]),ae=G.createElement(Qc.Provider,{value:null},G.createElement(rs.Provider,{value:Y},Q));return d===!1?ae:G.createElement(d,ai({},C,{ref:T,onSubmit:function(te){te.preventDefault(),te.stopPropagation(),A.submit()},onReset:function(te){var fe;te.preventDefault(),A.resetFields(),(fe=C.onReset)===null||fe===void 0||fe.call(C,te)}}),ae)};function QS(e){try{return JSON.stringify(e)}catch{return Math.random()}}var RI=function(e){var t=e.join("__RC_FIELD_FORM_SPLIT__"),n=M.useRef(t);Gt(n.current===t,"`useWatch` is not support dynamic `namePath`. Please provide static instead.")};function AI(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],i=t[1],a=i===void 0?{}:i,o=jL(a)?{form:a}:a,u=o.form,l=M.useState(),f=ke(l,2),d=f[0],h=f[1],p=M.useMemo(function(){return QS(d)},[d]),m=M.useRef(p);m.current=p;var y=M.useContext(rs),g=u||y,b=g&&g._init;Gt(t.length===2?u?b:!0:b,"useWatch requires a form instance since it can not auto detect from context.");var w=nn(r),S=M.useRef(w);return S.current=w,RI(w),M.useEffect(function(){if(b){var C=g.getFieldsValue,T=g.getInternalHooks,_=T(Wa),x=_.registerWatch,k=function(F,H){var V=o.preserve?H:F;return typeof r=="function"?r(V):si(V,S.current)},A=x(function(I,F){var H=k(I,F),V=QS(H);m.current!==V&&(m.current=V,h(H))}),N=k(C(),C(!0));return d!==N&&h(N),A}},[b]),d}var PI=G.forwardRef(kI),ju=PI;ju.FormProvider=TI,ju.Field=BS,ju.List=EI,ju.useForm=GS,ju.useWatch=AI;const Vm=G.createContext({});Vm.displayName="FormItemInputContext";const NI=({children:e,status:t,override:n})=>{const r=G.useContext(Vm),i=G.useMemo(()=>{const a=Object.assign({},r);return n&&delete a.isFormItemInput,t&&(delete a.status,delete a.hasFeedback,delete a.feedbackIcon),a},[t,n,r]);return G.createElement(Vm.Provider,{value:i},e)},LI=e=>{const{space:t,form:n,children:r}=e;if(r==null)return null;let i=r;return n&&(i=M.createElement(NI,{override:!0,status:!0},i)),t&&(i=M.createElement(hL,null,i)),i},II=function(){if(typeof navigator>"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};function FI(e){var t=e.prefixCls,n=e.align,r=e.arrow,i=e.arrowPos,a=r||{},o=a.className,u=a.content,l=i.x,f=l===void 0?0:l,d=i.y,h=d===void 0?0:d,p=G.useRef();if(!n||!n.points)return null;var m={position:"absolute"};if(n.autoArrow!==!1){var y=n.points[0],g=n.points[1],b=y[0],w=y[1],S=g[0],C=g[1];b===S||!["t","b"].includes(b)?m.top=h:b==="t"?m.top=0:m.bottom=0,w===C||!["l","r"].includes(w)?m.left=f:w==="l"?m.left=0:m.right=0}return G.createElement("div",{ref:p,className:Mn("".concat(t,"-arrow"),o),style:m},u)}function DI(e){var t=e.prefixCls,n=e.open,r=e.zIndex,i=e.mask,a=e.motion;return i?G.createElement(gm,ai({},a,{motionAppear:!0,visible:n,removeOnLeave:!0}),function(o){var u=o.className;return G.createElement("div",{style:{zIndex:r},className:Mn("".concat(t,"-mask"),u)})}):null}var YS=G.memo(function(e){var t=e.children;return t},function(e,t){return t.cache});YS.displayName="PopupContent";var KS=G.forwardRef(function(e,t){var n=e.popup,r=e.className,i=e.prefixCls,a=e.style,o=e.target,u=e.onVisibleChanged,l=e.open,f=e.keepDom,d=e.fresh,h=e.onClick,p=e.mask,m=e.arrow,y=e.arrowPos,g=e.align,b=e.motion,w=e.maskMotion,S=e.forceRender,C=e.getPopupContainer,T=e.autoDestroy,_=e.portal,x=e.zIndex,k=e.onMouseEnter,A=e.onMouseLeave,N=e.onPointerEnter,I=e.onPointerDownCapture,F=e.ready,H=e.offsetX,V=e.offsetY,D=e.offsetR,j=e.offsetB,z=e.onAlign,Q=e.onPrepare,q=e.stretch,J=e.targetWidth,$=e.targetHeight,Y=typeof n=="function"?n():n,ae=l||f,ie=(C==null?void 0:C.length)>0,te=G.useState(!C||!ie),fe=ke(te,2),le=fe[0],me=fe[1];if(jn(function(){!le&&ie&&o&&me(!0)},[le,ie,o]),!le)return null;var _e="auto",be={left:"-1000vw",top:"-1000vh",right:_e,bottom:_e};if(F||!l){var ne,ve=g.points,K=g.dynamicInset||((ne=g._experimental)===null||ne===void 0?void 0:ne.dynamicInset),we=K&&ve[0][1]==="r",ue=K&&ve[0][0]==="b";we?(be.right=D,be.left=_e):(be.left=H,be.right=_e),ue?(be.bottom=j,be.top=_e):(be.top=V,be.bottom=_e)}var Te={};return q&&(q.includes("height")&&$?Te.height=$:q.includes("minHeight")&&$&&(Te.minHeight=$),q.includes("width")&&J?Te.width=J:q.includes("minWidth")&&J&&(Te.minWidth=J)),l||(Te.pointerEvents="none"),G.createElement(_,{open:S||ae,getContainer:C&&function(){return C(o)},autoDestroy:T},G.createElement(DI,{prefixCls:i,open:l,zIndex:x,mask:p,motion:w}),G.createElement(xc,{onResize:z,disabled:!l},function(Le){return G.createElement(gm,ai({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:S,leavedClassName:"".concat(i,"-hidden")},b,{onAppearPrepare:Q,onEnterPrepare:Q,visible:l,onVisibleChanged:function(xt){var Ot;b==null||(Ot=b.onVisibleChanged)===null||Ot===void 0||Ot.call(b,xt),u(xt)}}),function(Je,xt){var Ot=Je.className,Vt=Je.style,Me=Mn(i,Ot,r);return G.createElement("div",{ref:Iw(Le,t,xt),className:Me,style:de(de(de(de({"--arrow-x":"".concat(y.x||0,"px"),"--arrow-y":"".concat(y.y||0,"px")},be),Te),Vt),{},{boxSizing:"border-box",zIndex:x},a),onMouseEnter:k,onMouseLeave:A,onPointerEnter:N,onClick:h,onPointerDownCapture:I},m&&G.createElement(FI,{prefixCls:i,arrow:m,arrowPos:y,align:g}),G.createElement(YS,{cache:!l&&!d},Y))})}))});KS.displayName="Popup";var XS=G.forwardRef(function(e,t){var n=e.children,r=e.getTriggerDOMNode,i=_c(n),a=G.useCallback(function(u){Ov(t,r?r(u):u)},[r]),o=kv(a,Rv(n));return i?G.cloneElement(n,{ref:o}):n});XS.displayName="TriggerWrapper";var ZS=G.createContext(null);function JS(e){return e?Array.isArray(e)?e:[e]:[]}function MI(e,t,n,r){return G.useMemo(function(){var i=JS(n??t),a=JS(r??t),o=new Set(i),u=new Set(a);return e&&(o.has("hover")&&(o.delete("hover"),o.add("click")),u.has("hover")&&(u.delete("hover"),u.add("click"))),[o,u]},[e,t,n,r])}function jI(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0;return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function $I(e,t,n,r){for(var i=n.points,a=Object.keys(e),o=0;o<a.length;o+=1){var u,l=a[o];if(jI((u=e[l])===null||u===void 0?void 0:u.points,i,r))return"".concat(t,"-placement-").concat(l)}return""}function ex(e,t,n,r){return t||(n?{motionName:"".concat(e,"-").concat(n)}:r?{motionName:r}:null)}function $u(e){return e.ownerDocument.defaultView}function qm(e){for(var t=[],n=e==null?void 0:e.parentElement,r=["hidden","scroll","clip","auto"];n;){var i=$u(n).getComputedStyle(n),a=i.overflowX,o=i.overflowY,u=i.overflow;[a,o,u].some(function(l){return r.includes(l)})&&t.push(n),n=n.parentElement}return t}function Vu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(e)?t:e}function qu(e){return Vu(parseFloat(e),0)}function tx(e,t){var n=de({},e);return(t||[]).forEach(function(r){if(!(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)){var i=$u(r).getComputedStyle(r),a=i.overflow,o=i.overflowClipMargin,u=i.borderTopWidth,l=i.borderBottomWidth,f=i.borderLeftWidth,d=i.borderRightWidth,h=r.getBoundingClientRect(),p=r.offsetHeight,m=r.clientHeight,y=r.offsetWidth,g=r.clientWidth,b=qu(u),w=qu(l),S=qu(f),C=qu(d),T=Vu(Math.round(h.width/y*1e3)/1e3),_=Vu(Math.round(h.height/p*1e3)/1e3),x=(y-g-S-C)*T,k=(p-m-b-w)*_,A=b*_,N=w*_,I=S*T,F=C*T,H=0,V=0;if(a==="clip"){var D=qu(o);H=D*T,V=D*_}var j=h.x+I-H,z=h.y+A-V,Q=j+h.width+2*H-I-F-x,q=z+h.height+2*V-A-N-k;n.left=Math.max(n.left,j),n.top=Math.max(n.top,z),n.right=Math.min(n.right,Q),n.bottom=Math.min(n.bottom,q)}}),n}function nx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n="".concat(t),r=n.match(/^(.*)\%$/);return r?e*(parseFloat(r[1])/100):parseFloat(n)}function rx(e,t){var n=t||[],r=ke(n,2),i=r[0],a=r[1];return[nx(e.width,i),nx(e.height,a)]}function ix(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[e[0],e[1]]}function ss(e,t){var n=t[0],r=t[1],i,a;return n==="t"?a=e.y:n==="b"?a=e.y+e.height:a=e.y+e.height/2,r==="l"?i=e.x:r==="r"?i=e.x+e.width:i=e.x+e.width/2,{x:i,y:a}}function oa(e,t){var n={t:"b",b:"t",l:"r",r:"l"};return e.map(function(r,i){return i===t?n[r]||"c":r}).join("")}function VI(e,t,n,r,i,a,o){var u=G.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:i[r]||{}}),l=ke(u,2),f=l[0],d=l[1],h=G.useRef(0),p=G.useMemo(function(){return t?qm(t):[]},[t]),m=G.useRef({}),y=function(){m.current={}};e||y();var g=Cr(function(){if(t&&n&&e){let qn=function(Ai,mi){var gi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:jt,eo=te.x+Ai,to=te.y+mi,Uu=eo+we,zu=to+K,Hu=Math.max(eo,gi.left),Ae=Math.max(to,gi.top),Fe=Math.min(Uu,gi.right),$t=Math.min(zu,gi.bottom);return Math.max(0,(Fe-Hu)*($t-Ae))},Ja=function(){at=te.y+Rt,Be=at+K,qe=te.x+vt,zt=qe+we};var S,C,T,_,x=t,k=x.ownerDocument,A=$u(x),N=A.getComputedStyle(x),I=N.width,F=N.height,H=N.position,V=x.style.left,D=x.style.top,j=x.style.right,z=x.style.bottom,Q=x.style.overflow,q=de(de({},i[r]),a),J=k.createElement("div");(S=x.parentElement)===null||S===void 0||S.appendChild(J),J.style.left="".concat(x.offsetLeft,"px"),J.style.top="".concat(x.offsetTop,"px"),J.style.position=H,J.style.height="".concat(x.offsetHeight,"px"),J.style.width="".concat(x.offsetWidth,"px"),x.style.left="0",x.style.top="0",x.style.right="auto",x.style.bottom="auto",x.style.overflow="hidden";var $;if(Array.isArray(n))$={x:n[0],y:n[1],width:0,height:0};else{var Y,ae,ie=n.getBoundingClientRect();ie.x=(Y=ie.x)!==null&&Y!==void 0?Y:ie.left,ie.y=(ae=ie.y)!==null&&ae!==void 0?ae:ie.top,$={x:ie.x,y:ie.y,width:ie.width,height:ie.height}}var te=x.getBoundingClientRect();te.x=(C=te.x)!==null&&C!==void 0?C:te.left,te.y=(T=te.y)!==null&&T!==void 0?T:te.top;var fe=k.documentElement,le=fe.clientWidth,me=fe.clientHeight,_e=fe.scrollWidth,be=fe.scrollHeight,ne=fe.scrollTop,ve=fe.scrollLeft,K=te.height,we=te.width,ue=$.height,Te=$.width,Le={left:0,top:0,right:le,bottom:me},Je={left:-ve,top:-ne,right:_e-ve,bottom:be-ne},xt=q.htmlRegion,Ot="visible",Vt="visibleFirst";xt!=="scroll"&&xt!==Vt&&(xt=Ot);var Me=xt===Vt,et=tx(Je,p),Ee=tx(Le,p),jt=xt===Ot?Ee:et,Ct=Me?Ee:jt;x.style.left="auto",x.style.top="auto",x.style.right="0",x.style.bottom="0";var Qt=x.getBoundingClientRect();x.style.left=V,x.style.top=D,x.style.right=j,x.style.bottom=z,x.style.overflow=Q,(_=x.parentElement)===null||_===void 0||_.removeChild(J);var un=Vu(Math.round(we/parseFloat(I)*1e3)/1e3),Yt=Vu(Math.round(K/parseFloat(F)*1e3)/1e3);if(un===0||Yt===0||wu(n)&&!fL(n))return;var He=q.offset,Zt=q.targetOffset,kt=rx(te,He),pt=ke(kt,2),Ut=pt[0],mn=pt[1],Ti=rx($,Zt),ur=ke(Ti,2),gn=ur[0],Qn=ur[1];$.x-=gn,$.y-=Qn;var sa=q.points||[],lr=ke(sa,2),ui=lr[0],li=lr[1],$n=ix(li),En=ix(ui),ci=ss($,$n),cn=ss(te,En),Yn=de({},q),vt=ci.x-cn.x+Ut,Rt=ci.y-cn.y+mn,Vn=qn(vt,Rt),Kn=qn(vt,Rt,Ee),fi=ss($,["t","l"]),yn=ss(te,["t","l"]),ua=ss($,["b","r"]),Oi=ss(te,["b","r"]),kr=q.overflow||{},B=kr.adjustX,ye=kr.adjustY,Se=kr.shiftX,Ie=kr.shiftY,it=function(mi){return typeof mi=="boolean"?mi:mi>=0},at,Be,qe,zt;Ja();var mt=it(ye),It=En[0]===$n[0];if(mt&&En[0]==="t"&&(Be>Ct.bottom||m.current.bt)){var ht=Rt;It?ht-=K-ue:ht=fi.y-Oi.y-mn;var Nn=qn(vt,ht),cr=qn(vt,ht,Ee);Nn>Vn||Nn===Vn&&(!Me||cr>=Kn)?(m.current.bt=!0,Rt=ht,mn=-mn,Yn.points=[oa(En,0),oa($n,0)]):m.current.bt=!1}if(mt&&En[0]==="b"&&(at<Ct.top||m.current.tb)){var Ft=Rt;It?Ft+=K-ue:Ft=ua.y-yn.y-mn;var di=qn(vt,Ft),Ga=qn(vt,Ft,Ee);di>Vn||di===Vn&&(!Me||Ga>=Kn)?(m.current.tb=!0,Rt=Ft,mn=-mn,Yn.points=[oa(En,0),oa($n,0)]):m.current.tb=!1}var la=it(B),Qa=En[1]===$n[1];if(la&&En[1]==="l"&&(zt>Ct.right||m.current.rl)){var hi=vt;Qa?hi-=we-Te:hi=fi.x-Oi.x-Ut;var Ya=qn(hi,Rt),ca=qn(hi,Rt,Ee);Ya>Vn||Ya===Vn&&(!Me||ca>=Kn)?(m.current.rl=!0,vt=hi,Ut=-Ut,Yn.points=[oa(En,1),oa($n,1)]):m.current.rl=!1}if(la&&En[1]==="r"&&(qe<Ct.left||m.current.lr)){var Kr=vt;Qa?Kr+=we-Te:Kr=ua.x-yn.x-Ut;var cs=qn(Kr,Rt),fs=qn(Kr,Rt,Ee);cs>Vn||cs===Vn&&(!Me||fs>=Kn)?(m.current.lr=!0,vt=Kr,Ut=-Ut,Yn.points=[oa(En,1),oa($n,1)]):m.current.lr=!1}Ja();var fr=Se===!0?0:Se;typeof fr=="number"&&(qe<Ee.left&&(vt-=qe-Ee.left-Ut,$.x+Te<Ee.left+fr&&(vt+=$.x-Ee.left+Te-fr)),zt>Ee.right&&(vt-=zt-Ee.right-Ut,$.x>Ee.right-fr&&(vt+=$.x-Ee.right+fr)));var Xn=Ie===!0?0:Ie;typeof Xn=="number"&&(at<Ee.top&&(Rt-=at-Ee.top-mn,$.y+ue<Ee.top+Xn&&(Rt+=$.y-Ee.top+ue-Xn)),Be>Ee.bottom&&(Rt-=Be-Ee.bottom-mn,$.y>Ee.bottom-Xn&&(Rt+=$.y-Ee.bottom+Xn)));var ki=te.x+vt,pi=ki+we,Rr=te.y+Rt,ds=Rr+K,Ri=$.x,hs=Ri+Te,Ka=$.y,ps=Ka+ue,vs=Math.max(ki,Ri),Xa=Math.min(pi,hs),ms=(vs+Xa)/2,gs=ms-ki,Za=Math.max(Rr,Ka),fa=Math.min(ds,ps),vi=(Za+fa)/2,ys=vi-Rr;o==null||o(t,Yn);var da=Qt.right-te.x-(vt+te.width),Ar=Qt.bottom-te.y-(Rt+te.height);un===1&&(vt=Math.round(vt),da=Math.round(da)),Yt===1&&(Rt=Math.round(Rt),Ar=Math.round(Ar));var bs={ready:!0,offsetX:vt/un,offsetY:Rt/Yt,offsetR:da/un,offsetB:Ar/Yt,arrowX:gs/un,arrowY:ys/Yt,scaleX:un,scaleY:Yt,align:Yn};d(bs)}}),b=function(){h.current+=1;var C=h.current;Promise.resolve().then(function(){h.current===C&&g()})},w=function(){d(function(C){return de(de({},C),{},{ready:!1})})};return jn(w,[r]),jn(function(){e||w()},[e]),[f.ready,f.offsetX,f.offsetY,f.offsetR,f.offsetB,f.arrowX,f.arrowY,f.scaleX,f.scaleY,f.align,b]}function qI(e,t,n,r,i){jn(function(){if(e&&t&&n){let h=function(){r(),i()};var a=t,o=n,u=qm(a),l=qm(o),f=$u(o),d=new Set([f].concat(De(u),De(l)));return d.forEach(function(p){p.addEventListener("scroll",h,{passive:!0})}),f.addEventListener("resize",h,{passive:!0}),r(),function(){d.forEach(function(p){p.removeEventListener("scroll",h),f.removeEventListener("resize",h)})}}},[e,t,n])}function UI(e,t,n,r,i,a,o,u){var l=G.useRef(e);l.current=e;var f=G.useRef(!1);G.useEffect(function(){if(t&&r&&(!i||a)){var h=function(){f.current=!1},p=function(T){var _;l.current&&!o(((_=T.composedPath)===null||_===void 0||(_=_.call(T))===null||_===void 0?void 0:_[0])||T.target)&&!f.current&&u(!1)},m=$u(r);m.addEventListener("pointerdown",h,!0),m.addEventListener("mousedown",p,!0),m.addEventListener("contextmenu",p,!0);var y=Sm(n);y&&(y.addEventListener("mousedown",p,!0),y.addEventListener("contextmenu",p,!0));{var g,b,w=n==null||(g=n.getRootNode)===null||g===void 0?void 0:g.call(n),S=(b=r.getRootNode)===null||b===void 0?void 0:b.call(r);Go(w===S,"trigger element and popup element should in same shadow root.")}return function(){m.removeEventListener("pointerdown",h,!0),m.removeEventListener("mousedown",p,!0),m.removeEventListener("contextmenu",p,!0),y&&(y.removeEventListener("mousedown",p,!0),y.removeEventListener("contextmenu",p,!0))}}},[t,n,r,i,a]);function d(){f.current=!0}return d}var zI=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function HI(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Cm,t=G.forwardRef(function(n,r){var i=n.prefixCls,a=i===void 0?"rc-trigger-popup":i,o=n.children,u=n.action,l=u===void 0?"hover":u,f=n.showAction,d=n.hideAction,h=n.popupVisible,p=n.defaultPopupVisible,m=n.onPopupVisibleChange,y=n.afterPopupVisibleChange,g=n.mouseEnterDelay,b=n.mouseLeaveDelay,w=b===void 0?.1:b,S=n.focusDelay,C=n.blurDelay,T=n.mask,_=n.maskClosable,x=_===void 0?!0:_,k=n.getPopupContainer,A=n.forceRender,N=n.autoDestroy,I=n.destroyPopupOnHide,F=n.popup,H=n.popupClassName,V=n.popupStyle,D=n.popupPlacement,j=n.builtinPlacements,z=j===void 0?{}:j,Q=n.popupAlign,q=n.zIndex,J=n.stretch,$=n.getPopupClassNameFromAlign,Y=n.fresh,ae=n.alignPoint,ie=n.onPopupClick,te=n.onPopupAlign,fe=n.arrow,le=n.popupMotion,me=n.maskMotion,_e=n.popupTransitionName,be=n.popupAnimation,ne=n.maskTransitionName,ve=n.maskAnimation,K=n.className,we=n.getTriggerDOMNode,ue=Ua(n,zI),Te=N||I||!1,Le=G.useState(!1),Je=ke(Le,2),xt=Je[0],Ot=Je[1];jn(function(){Ot(II())},[]);var Vt=G.useRef({}),Me=G.useContext(ZS),et=G.useMemo(function(){return{registerSubPopup:function(Fe,$t){Vt.current[Fe]=$t,Me==null||Me.registerSubPopup(Fe,$t)}}},[Me]),Ee=AS(),jt=G.useState(null),Ct=ke(jt,2),Qt=Ct[0],un=Ct[1],Yt=G.useRef(null),He=Cr(function(Ae){Yt.current=Ae,wu(Ae)&&Qt!==Ae&&un(Ae),Me==null||Me.registerSubPopup(Ee,Ae)}),Zt=G.useState(null),kt=ke(Zt,2),pt=kt[0],Ut=kt[1],mn=G.useRef(null),Ti=Cr(function(Ae){wu(Ae)&&pt!==Ae&&(Ut(Ae),mn.current=Ae)}),ur=G.Children.only(o),gn=(ur==null?void 0:ur.props)||{},Qn={},sa=Cr(function(Ae){var Fe,$t,rn=pt;return(rn==null?void 0:rn.contains(Ae))||((Fe=Sm(rn))===null||Fe===void 0?void 0:Fe.host)===Ae||Ae===rn||(Qt==null?void 0:Qt.contains(Ae))||(($t=Sm(Qt))===null||$t===void 0?void 0:$t.host)===Ae||Ae===Qt||Object.values(Vt.current).some(function(Ht){return(Ht==null?void 0:Ht.contains(Ae))||Ae===Ht})}),lr=ex(a,le,be,_e),ui=ex(a,me,ve,ne),li=G.useState(p||!1),$n=ke(li,2),En=$n[0],ci=$n[1],cn=h??En,Yn=Cr(function(Ae){h===void 0&&ci(Ae)});jn(function(){ci(h||!1)},[h]);var vt=G.useRef(cn);vt.current=cn;var Rt=G.useRef([]);Rt.current=[];var Vn=Cr(function(Ae){var Fe;Yn(Ae),((Fe=Rt.current[Rt.current.length-1])!==null&&Fe!==void 0?Fe:cn)!==Ae&&(Rt.current.push(Ae),m==null||m(Ae))}),Kn=G.useRef(),fi=function(){clearTimeout(Kn.current)},yn=function(Fe){var $t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;fi(),$t===0?Vn(Fe):Kn.current=setTimeout(function(){Vn(Fe)},$t*1e3)};G.useEffect(function(){return fi},[]);var ua=G.useState(!1),Oi=ke(ua,2),kr=Oi[0],B=Oi[1];jn(function(Ae){(!Ae||cn)&&B(!0)},[cn]);var ye=G.useState(null),Se=ke(ye,2),Ie=Se[0],it=Se[1],at=G.useState(null),Be=ke(at,2),qe=Be[0],zt=Be[1],mt=function(Fe){zt([Fe.clientX,Fe.clientY])},It=VI(cn,Qt,ae&&qe!==null?qe:pt,D,z,Q,te),ht=ke(It,11),Nn=ht[0],cr=ht[1],Ft=ht[2],di=ht[3],Ga=ht[4],la=ht[5],Qa=ht[6],hi=ht[7],Ya=ht[8],ca=ht[9],Kr=ht[10],cs=MI(xt,l,f,d),fs=ke(cs,2),fr=fs[0],Xn=fs[1],ki=fr.has("click"),pi=Xn.has("click")||Xn.has("contextMenu"),Rr=Cr(function(){kr||Kr()}),ds=function(){vt.current&&ae&&pi&&yn(!1)};qI(cn,pt,Qt,Rr,ds),jn(function(){Rr()},[qe,D]),jn(function(){cn&&!(z!=null&&z[D])&&Rr()},[JSON.stringify(Q)]);var Ri=G.useMemo(function(){var Ae=$I(z,a,ca,ae);return Mn(Ae,$==null?void 0:$(ca))},[ca,$,z,a,ae]);G.useImperativeHandle(r,function(){return{nativeElement:mn.current,popupElement:Yt.current,forceAlign:Rr}});var hs=G.useState(0),Ka=ke(hs,2),ps=Ka[0],vs=Ka[1],Xa=G.useState(0),ms=ke(Xa,2),gs=ms[0],Za=ms[1],fa=function(){if(J&&pt){var Fe=pt.getBoundingClientRect();vs(Fe.width),Za(Fe.height)}},vi=function(){fa(),Rr()},ys=function(Fe){B(!1),Kr(),y==null||y(Fe)},da=function(){return new Promise(function(Fe){fa(),it(function(){return Fe})})};jn(function(){Ie&&(Kr(),Ie(),it(null))},[Ie]);function Ar(Ae,Fe,$t,rn){Qn[Ae]=function(Ht){var _s;rn==null||rn(Ht),yn(Fe,$t);for(var Bu=arguments.length,Nt=new Array(Bu>1?Bu-1:0),gt=1;gt<Bu;gt++)Nt[gt-1]=arguments[gt];(_s=gn[Ae])===null||_s===void 0||_s.call.apply(_s,[gn,Ht].concat(Nt))}}(ki||pi)&&(Qn.onClick=function(Ae){var Fe;vt.current&&pi?yn(!1):!vt.current&&ki&&(mt(Ae),yn(!0));for(var $t=arguments.length,rn=new Array($t>1?$t-1:0),Ht=1;Ht<$t;Ht++)rn[Ht-1]=arguments[Ht];(Fe=gn.onClick)===null||Fe===void 0||Fe.call.apply(Fe,[gn,Ae].concat(rn))});var bs=UI(cn,pi,pt,Qt,T,x,sa,yn),qn=fr.has("hover"),Ja=Xn.has("hover"),Ai,mi;qn&&(Ar("onMouseEnter",!0,g,function(Ae){mt(Ae)}),Ar("onPointerEnter",!0,g,function(Ae){mt(Ae)}),Ai=function(Fe){(cn||kr)&&Qt!==null&&Qt!==void 0&&Qt.contains(Fe.target)&&yn(!0,g)},ae&&(Qn.onMouseMove=function(Ae){var Fe;(Fe=gn.onMouseMove)===null||Fe===void 0||Fe.call(gn,Ae)})),Ja&&(Ar("onMouseLeave",!1,w),Ar("onPointerLeave",!1,w),mi=function(){yn(!1,w)}),fr.has("focus")&&Ar("onFocus",!0,S),Xn.has("focus")&&Ar("onBlur",!1,C),fr.has("contextMenu")&&(Qn.onContextMenu=function(Ae){var Fe;vt.current&&Xn.has("contextMenu")?yn(!1):(mt(Ae),yn(!0)),Ae.preventDefault();for(var $t=arguments.length,rn=new Array($t>1?$t-1:0),Ht=1;Ht<$t;Ht++)rn[Ht-1]=arguments[Ht];(Fe=gn.onContextMenu)===null||Fe===void 0||Fe.call.apply(Fe,[gn,Ae].concat(rn))}),K&&(Qn.className=Mn(gn.className,K));var gi=de(de({},gn),Qn),eo={},to=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];to.forEach(function(Ae){ue[Ae]&&(eo[Ae]=function(){for(var Fe,$t=arguments.length,rn=new Array($t),Ht=0;Ht<$t;Ht++)rn[Ht]=arguments[Ht];(Fe=gi[Ae])===null||Fe===void 0||Fe.call.apply(Fe,[gi].concat(rn)),ue[Ae].apply(ue,rn)})});var Uu=G.cloneElement(ur,de(de({},gi),eo)),zu={x:la,y:Qa},Hu=fe?de({},fe!==!0?fe:{}):null;return G.createElement(G.Fragment,null,G.createElement(xc,{disabled:!cn,ref:Ti,onResize:vi},G.createElement(XS,{getTriggerDOMNode:we},Uu)),G.createElement(ZS.Provider,{value:et},G.createElement(KS,{portal:e,ref:He,prefixCls:a,popup:F,className:Mn(H,Ri),style:V,target:pt,onMouseEnter:Ai,onMouseLeave:mi,onPointerEnter:Ai,zIndex:q,open:cn,keepDom:kr,fresh:Y,onClick:ie,onPointerDownCapture:bs,mask:T,motion:lr,maskMotion:ui,onVisibleChanged:ys,onPrepare:da,forceRender:A,autoDestroy:Te,getPopupContainer:k,align:ca,arrow:Hu,arrowPos:zu,ready:Nn,offsetX:cr,offsetY:Ft,offsetR:di,offsetB:Ga,onAlign:Rr,stretch:J,targetWidth:ps/hi,targetHeight:gs/Ya})))});return t.displayName="Trigger",t}const BI=HI(Cm);function ax(e){var t=e.children,n=e.prefixCls,r=e.id,i=e.overlayInnerStyle,a=e.bodyClassName,o=e.className,u=e.style;return G.createElement("div",{className:Mn("".concat(n,"-content"),o),style:u},G.createElement("div",{className:Mn("".concat(n,"-inner"),a),id:r,role:"tooltip",style:i},typeof t=="function"?t():t))}var us={shiftX:64,adjustY:1},ls={adjustX:1,shiftY:!0},Or=[0,0],WI={left:{points:["cr","cl"],overflow:ls,offset:[-4,0],targetOffset:Or},right:{points:["cl","cr"],overflow:ls,offset:[4,0],targetOffset:Or},top:{points:["bc","tc"],overflow:us,offset:[0,-4],targetOffset:Or},bottom:{points:["tc","bc"],overflow:us,offset:[0,4],targetOffset:Or},topLeft:{points:["bl","tl"],overflow:us,offset:[0,-4],targetOffset:Or},leftTop:{points:["tr","tl"],overflow:ls,offset:[-4,0],targetOffset:Or},topRight:{points:["br","tr"],overflow:us,offset:[0,-4],targetOffset:Or},rightTop:{points:["tl","tr"],overflow:ls,offset:[4,0],targetOffset:Or},bottomRight:{points:["tr","br"],overflow:us,offset:[0,4],targetOffset:Or},rightBottom:{points:["bl","br"],overflow:ls,offset:[4,0],targetOffset:Or},bottomLeft:{points:["tl","bl"],overflow:us,offset:[0,4],targetOffset:Or},leftBottom:{points:["br","bl"],overflow:ls,offset:[-4,0],targetOffset:Or}},GI=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],QI=function(t,n){var r=t.overlayClassName,i=t.trigger,a=i===void 0?["hover"]:i,o=t.mouseEnterDelay,u=o===void 0?0:o,l=t.mouseLeaveDelay,f=l===void 0?.1:l,d=t.overlayStyle,h=t.prefixCls,p=h===void 0?"rc-tooltip":h,m=t.children,y=t.onVisibleChange,g=t.afterVisibleChange,b=t.transitionName,w=t.animation,S=t.motion,C=t.placement,T=C===void 0?"right":C,_=t.align,x=_===void 0?{}:_,k=t.destroyTooltipOnHide,A=k===void 0?!1:k,N=t.defaultVisible,I=t.getTooltipContainer,F=t.overlayInnerStyle;t.arrowContent;var H=t.overlay,V=t.id,D=t.showArrow,j=D===void 0?!0:D,z=t.classNames,Q=t.styles,q=Ua(t,GI),J=AS(V),$=M.useRef(null);M.useImperativeHandle(n,function(){return $.current});var Y=de({},q);"visible"in t&&(Y.popupVisible=t.visible);var ae=function(){return G.createElement(ax,{key:"content",prefixCls:p,id:J,bodyClassName:z==null?void 0:z.body,overlayInnerStyle:de(de({},F),Q==null?void 0:Q.body)},H)},ie=function(){var fe=G.Children.only(m),le=(fe==null?void 0:fe.props)||{},me=de(de({},le),{},{"aria-describedby":H?J:null});return G.cloneElement(m,me)};return G.createElement(BI,ai({popupClassName:Mn(r,z==null?void 0:z.root),prefixCls:p,popup:ae,action:a,builtinPlacements:WI,popupPlacement:T,ref:$,popupAlign:x,getPopupContainer:I,onPopupVisibleChange:y,afterPopupVisibleChange:g,popupTransitionName:b,popupAnimation:w,popupMotion:S,defaultPopupVisible:N,autoDestroy:A,mouseLeaveDelay:f,popupStyle:de(de({},d),Q==null?void 0:Q.root),mouseEnterDelay:u,arrow:j},Y),ie())};const YI=M.forwardRef(QI);function KI(e){const{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,i=t/2,a=0,o=i,u=r*1/Math.sqrt(2),l=i-r*(1-1/Math.sqrt(2)),f=i-n*(1/Math.sqrt(2)),d=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),h=2*i-f,p=d,m=2*i-u,y=l,g=2*i-a,b=o,w=i*Math.sqrt(2)+r*(Math.sqrt(2)-2),S=r*(Math.sqrt(2)-1),C=`polygon(${S}px 100%, 50% ${S}px, ${2*i-S}px 100%, ${S}px 100%)`,T=`path('M ${a} ${o} A ${r} ${r} 0 0 0 ${u} ${l} L ${f} ${d} A ${n} ${n} 0 0 1 ${h} ${p} L ${m} ${y} A ${r} ${r} 0 0 0 ${g} ${b} Z')`;return{arrowShadowWidth:w,arrowPath:T,arrowPolygon:C}}const XI=(e,t,n)=>{const{sizePopupArrow:r,arrowPolygon:i,arrowPath:a,arrowShadowWidth:o,borderRadiusXS:u,calc:l}=e;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:l(r).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[i,a]},content:'""'},"&::after":{content:'""',position:"absolute",width:o,height:o,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${za(u)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},ox=8;function sx(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?ox:r}}function Kc(e,t){return e?t:{}}function ZI(e,t,n){const{componentCls:r,boxShadowPopoverArrow:i,arrowOffsetVertical:a,arrowOffsetHorizontal:o}=e,{arrowDistance:u=0,arrowPlacement:l={left:!0,right:!0,top:!0,bottom:!0}}={};return{[r]:Object.assign(Object.assign(Object.assign(Object.assign({[`${r}-arrow`]:[Object.assign(Object.assign({position:"absolute",zIndex:1,display:"block"},XI(e,t,i)),{"&:before":{background:t}})]},Kc(!!l.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:u,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{"--arrow-offset-horizontal":o,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:o}}},"&-placement-topRight":{"--arrow-offset-horizontal":`calc(100% - ${za(o)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:o}}}})),Kc(!!l.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:u,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{"--arrow-offset-horizontal":o,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:o}}},"&-placement-bottomRight":{"--arrow-offset-horizontal":`calc(100% - ${za(o)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:o}}}})),Kc(!!l.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:u},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:a},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:a}})),Kc(!!l.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:u},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:a},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:a}}))}}function JI(e,t,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const i=r&&typeof r=="object"?r:{},a={};switch(e){case"top":case"bottom":a.shiftX=t.arrowOffsetHorizontal*2+n,a.shiftY=!0,a.adjustY=!0;break;case"left":case"right":a.shiftY=t.arrowOffsetVertical*2+n,a.shiftX=!0,a.adjustX=!0;break}const o=Object.assign(Object.assign({},a),i);return o.shiftX||(o.adjustX=!0),o.shiftY||(o.adjustY=!0),o}const ux={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},eF={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},tF=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function nF(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:i,borderRadius:a}=e,o=t/2,u={};return Object.keys(ux).forEach(l=>{const f=r&&eF[l]||ux[l],d=Object.assign(Object.assign({},f),{offset:[0,0],dynamicInset:!0});switch(u[l]=d,tF.has(l)&&(d.autoArrow=!1),l){case"top":case"topLeft":case"topRight":d.offset[1]=-o-i;break;case"bottom":case"bottomLeft":case"bottomRight":d.offset[1]=o+i;break;case"left":case"leftTop":case"leftBottom":d.offset[0]=-o-i;break;case"right":case"rightTop":case"rightBottom":d.offset[0]=o+i;break}const h=sx({contentRadius:a,limitVerticalRadius:!0});if(r)switch(l){case"topLeft":case"bottomLeft":d.offset[0]=-h.arrowOffsetHorizontal-o;break;case"topRight":case"bottomRight":d.offset[0]=h.arrowOffsetHorizontal+o;break;case"leftTop":case"rightTop":d.offset[1]=-h.arrowOffsetHorizontal*2+o;break;case"leftBottom":case"rightBottom":d.offset[1]=h.arrowOffsetHorizontal*2-o;break}d.overflow=JI(l,h,t,n),d.htmlRegion="visibleFirst"}),u}const rF=e=>{const{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:i,tooltipBg:a,tooltipBorderRadius:o,zIndexPopup:u,controlHeight:l,boxShadowSecondary:f,paddingSM:d,paddingXS:h,arrowOffsetHorizontal:p,sizePopupArrow:m}=e,y=t(o).add(m).add(p).equal(),g=t(o).mul(2).add(m).equal();return[{[n]:Object.assign(Object.assign(Object.assign(Object.assign({},RN(e)),{position:"absolute",zIndex:u,display:"block",width:"max-content",maxWidth:r,visibility:"visible","--valid-offset-x":"var(--arrow-offset-horizontal, var(--arrow-x))",transformOrigin:["var(--valid-offset-x, 50%)","var(--arrow-y, 50%)"].join(" "),"&-hidden":{display:"none"},"--antd-arrow-background-color":a,[`${n}-inner`]:{minWidth:g,minHeight:l,padding:`${za(e.calc(d).div(2).equal())} ${za(h)}`,color:i,textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:a,borderRadius:o,boxShadow:f,boxSizing:"border-box"},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:y},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:e.min(o,ox)}},[`${n}-content`]:{position:"relative"}}),FN(e,(b,{darkColor:w})=>({[`&${n}-${b}`]:{[`${n}-inner`]:{backgroundColor:w},[`${n}-arrow`]:{"--antd-arrow-background-color":w}}}))),{"&-rtl":{direction:"rtl"}})},ZI(e,"var(--antd-arrow-background-color)"),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}}]},iF=e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+70},sx({contentRadius:e.borderRadius,limitVerticalRadius:!0})),KI(qc(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)}))),lx=(e,t=!0)=>IN("Tooltip",r=>{const{borderRadius:i,colorTextLightSolid:a,colorBgSpotlight:o}=r,u=qc(r,{tooltipMaxWidth:250,tooltipColor:a,tooltipBorderRadius:i,tooltipBg:o});return[rF(u),kL(r,"zoom-big-fast")]},iF,{resetStyle:!1,injectStyle:t})(e),aF=Uc.map(e=>`${e}-inverse`);function oF(e,t=!0){return t?[].concat(De(aF),De(Uc)).includes(e):Uc.includes(e)}function cx(e,t){const n=oF(t),r=Mn({[`${e}-${t}`]:t&&n}),i={},a={};return t&&!n&&(i.background=t,a["--antd-arrow-background-color"]=t),{className:r,overlayStyle:i,arrowStyle:a}}const sF=e=>{const{prefixCls:t,className:n,placement:r="top",title:i,color:a,overlayInnerStyle:o}=e,{getPrefixCls:u}=G.useContext(Nu),l=u("tooltip",t),[f,d,h]=lx(l),p=cx(l,a),m=p.arrowStyle,y=Object.assign(Object.assign({},o),p.overlayStyle),g=Mn(d,h,l,`${l}-pure`,`${l}-placement-${r}`,n,p.className);return f(G.createElement("div",{className:g,style:m},G.createElement("div",{className:`${l}-arrow`}),G.createElement(ax,Object.assign({},e,{className:d,prefixCls:l,overlayInnerStyle:y}),i)))};var uF=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Um=G.forwardRef((e,t)=>{var n,r;const{prefixCls:i,openClassName:a,getTooltipContainer:o,color:u,overlayInnerStyle:l,children:f,afterOpenChange:d,afterVisibleChange:h,destroyTooltipOnHide:p,destroyOnHidden:m,arrow:y=!0,title:g,overlay:b,builtinPlacements:w,arrowPointAtCenter:S=!1,autoAdjustOverflow:C=!0,motion:T,getPopupContainer:_,placement:x="top",mouseEnterDelay:k=.1,mouseLeaveDelay:A=.1,overlayStyle:N,rootClassName:I,overlayClassName:F,styles:H,classNames:V}=e,D=uF(e,["prefixCls","openClassName","getTooltipContainer","color","overlayInnerStyle","children","afterOpenChange","afterVisibleChange","destroyTooltipOnHide","destroyOnHidden","arrow","title","overlay","builtinPlacements","arrowPointAtCenter","autoAdjustOverflow","motion","getPopupContainer","placement","mouseEnterDelay","mouseLeaveDelay","overlayStyle","rootClassName","overlayClassName","styles","classNames"]),j=!!y,[,z]=vm(),{getPopupContainer:Q,getPrefixCls:q,direction:J,className:$,style:Y,classNames:ae,styles:ie}=fN("tooltip"),te=FE("Tooltip"),fe=G.useRef(null),le=()=>{var kt;(kt=fe.current)===null||kt===void 0||kt.forceAlign()};G.useImperativeHandle(t,()=>{var kt,pt;return{forceAlign:le,forcePopupAlign:()=>{te.deprecated(!1,"forcePopupAlign","forceAlign"),le()},nativeElement:(kt=fe.current)===null||kt===void 0?void 0:kt.nativeElement,popupElement:(pt=fe.current)===null||pt===void 0?void 0:pt.popupElement}}),[["visible","open"],["defaultVisible","defaultOpen"],["onVisibleChange","onOpenChange"],["afterVisibleChange","afterOpenChange"],["destroyTooltipOnHide","destroyOnHidden"],["arrowPointAtCenter","arrow={{ pointAtCenter: true }}"],["overlayStyle","styles={{ root: {} }}"],["overlayInnerStyle","styles={{ body: {} }}"],["overlayClassName",'classNames={{ root: "" }}']].forEach(([kt,pt])=>{te.deprecated(!(kt in e),kt,pt)}),te(!p||typeof p=="boolean","usage","`destroyTooltipOnHide` no need config `keepParent` anymore. Please use `boolean` value directly."),te(!y||typeof y=="boolean"||!("arrowPointAtCenter"in y),"deprecated","`arrowPointAtCenter` in `arrow` is deprecated. Please use `pointAtCenter` instead.");const[me,_e]=mN(!1,{value:(n=e.open)!==null&&n!==void 0?n:e.visible,defaultValue:(r=e.defaultOpen)!==null&&r!==void 0?r:e.defaultVisible}),be=!g&&!b&&g!==0,ne=kt=>{var pt,Ut;_e(be?!1:kt),be||((pt=e.onOpenChange)===null||pt===void 0||pt.call(e,kt),(Ut=e.onVisibleChange)===null||Ut===void 0||Ut.call(e,kt))},ve=G.useMemo(()=>{var kt,pt;let Ut=S;return typeof y=="object"&&(Ut=(pt=(kt=y.pointAtCenter)!==null&&kt!==void 0?kt:y.arrowPointAtCenter)!==null&&pt!==void 0?pt:S),w||nF({arrowPointAtCenter:Ut,autoAdjustOverflow:C,arrowWidth:j?z.sizePopupArrow:0,borderRadius:z.borderRadius,offset:z.marginXXS})},[S,y,w,z]),K=G.useMemo(()=>g===0?g:b||g||"",[b,g]),we=G.createElement(LI,{space:!0},typeof K=="function"?K():K),ue=q("tooltip",i),Te=q(),Le=e["data-popover-inject"];let Je=me;!("open"in e)&&!("visible"in e)&&be&&(Je=!1);const xt=G.isValidElement(f)&&!rL(f)?f:G.createElement("span",null,f),Ot=xt.props,Vt=!Ot.className||typeof Ot.className=="string"?Mn(Ot.className,a||`${ue}-open`):Ot.className,[Me,et,Ee]=lx(ue,!Le),jt=cx(ue,u),Ct=jt.arrowStyle,Qt=Mn(F,{[`${ue}-rtl`]:J==="rtl"},jt.className,I,et,Ee,$,ae.root,V==null?void 0:V.root),un=Mn(ae.body,V==null?void 0:V.body),[Yt,He]=lL("Tooltip",D.zIndex),Zt=G.createElement(YI,Object.assign({},D,{zIndex:Yt,showArrow:j,placement:x,mouseEnterDelay:k,mouseLeaveDelay:A,prefixCls:ue,classNames:{root:Qt,body:un},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ct),ie.root),Y),N),H==null?void 0:H.root),body:Object.assign(Object.assign(Object.assign(Object.assign({},ie.body),l),H==null?void 0:H.body),jt.overlayStyle)},getTooltipContainer:_||o||Q,ref:fe,builtinPlacements:ve,overlay:we,visible:Je,onVisibleChange:ne,afterVisibleChange:d??h,arrowContent:G.createElement("span",{className:`${ue}-arrow-content`}),motion:{motionName:cL(Te,"zoom-big-fast",e.transitionName),motionDeadline:1e3},destroyTooltipOnHide:m??!!p}),Je?aL(xt,{className:Vt}):xt);return Me(G.createElement(xm.Provider,{value:He},Zt))});Um.displayName="Tooltip",Um._InternalPanelDoNotUseOrYouWillBeFired=sF;const lF=async(e,t)=>{const{policy:n,file:r}=e||{};return(await lv(n,r)).success?{name:e==null?void 0:e.name,title:r==null?void 0:r.name,size:r==null?void 0:r.size,sub_type:t,type:"conversation_activity_attachment"}:{}},cF=async(e,t)=>{var r;const n=[];try{const i=[];for(let a=0;a<e.length;a+=1)(r=e[a])!=null&&r.id||i.push(lF(e[a],t));n.push(...await Promise.all(i))}catch(i){console.error("Error occurred during file upload:",i),en("error","File upload fails","top-left")}return n},fF=["image/jpeg","image/png","application/pdf"],dF=({conversationId:e,handleCreateMessage:t})=>{const n=M.useRef(null),r=M.useRef(null),i=M.useRef(null),[a,o]=M.useState(""),[u,l]=M.useState([]),[f,d]=M.useState(!1),{handleCreateOrUpdateRealtimeStatus:h}=Ew(),p=async _=>{var F;const x=_==null?void 0:_.name,k=(F=x==null?void 0:x.split)==null?void 0:F.call(x,"."),A=Ge.last(k),N=`${Yp()}.${A}`,I=await uv({name:N,sub_type:e,type:"conversation_activity_attachment"});return I!=null&&I.url?{name:N,file:_,title:x,policy:I}:(en("error",`${x} cannot be uploaded`,"top-left"),null)},m=async _=>{_.preventDefault();const x=5*1024*1024,k=Array.from(_.target.files);let A="";if(Ge.forEach(k,N=>{if(!fF.includes(N.type)){A=`${N.name} is not supported. `;return}if(N.size>x){A="Each file must be under 5MB";return}}),A){en("error",A,"top-left");return}try{const N=[];for(let F=0;F<k.length;F+=1)N.push(p(k[F]));const I=await Promise.all(N);l(F=>[...F,...I.filter(H=>H!==null)])}catch(N){console.error("Error occurred while fetching policies:",N)}i.current.value=null},y=_=>{l(x=>x.filter((k,A)=>A!==_)),i.current&&(i.current.value="")};M.useEffect(()=>{const _=n.current,x=r.current;if(_&&x){_.style.height="auto";const A=x.offsetWidth*.5,N=Math.min(_.scrollHeight,A);_.style.height=`${N}px`,x.style.height=`${N+16}px`,_.style.overflowY=_.scrollHeight>A?"auto":"hidden"}},[a,u]);const g=u.slice(0,5),b=Math.max(0,u.length-5),w=async _=>{if(_&&_.preventDefault(),!(!a&&!u.length)){d(!0);try{const x=Ge.size(u)&&await cF(u,e);await t({message:a,is_customer_reply:!0,...x&&{files:x}}),o(""),l([]),setTimeout(()=>{n.current&&n.current.focus()},150)}catch(x){console.error("Error sending message:",x)}finally{d(!1)}}},S=M.useMemo(()=>!lk(a)&&!Ge.size(u)||f,[a,u,f]),C=async _=>{_?await h({conversation_id:e,is_writing_reply:!0}):await h({conversation_id:e,is_writing_reply:!1})},T=_=>{_.key==="Enter"&&!_.shiftKey&&!f&&!S&&(_.preventDefault(),w(_))};return O.jsxs(O.Fragment,{children:[u.length>0&&O.jsxs("div",{className:"ed-flex ed-flex-wrap ed-items-center ed-gap-2 ed-mb-2",children:[g.map((_,x)=>O.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2 ed-text-12 ed-font-medium ed-text-border-regular ed-bg-white-light ed-p-1.5 ed-rounded-full",children:[O.jsx("span",{className:"ed-truncate ed-max-w-[100px]",children:_.name}),O.jsx("button",{type:"button",onClick:()=>y(x),className:"ed-text-border hover:ed-text-border-dark ed-flex-shrink-0",children:O.jsx(ri,{size:14})})]},_)),b>0&&O.jsxs("span",{className:"ed-text-12 ed-text-border-regular",children:["+",b," ",b===1?"item":"items"]})]}),O.jsxs("div",{ref:r,className:"ed-border ed-border-border-light ed-rounded-3xl ed-flex ed-justify-between ed-transition-all ed-duration-200",style:{padding:"8px 16px"},children:[O.jsx("div",{className:"ed-flex-1 ed-flex ed-flex-col ed-min-w-0",children:O.jsx("textarea",{ref:n,value:a,onBlur:()=>C(!1),onChange:_=>o(_.target.value),onFocus:()=>C(!0),onKeyDown:_=>T(_),rows:1,className:"ed-w-full ed-text-14 ed-min-h-[24px] ed-resize-none ed-overflow-x-auto ed-outline-none ed-bg-transparent no-scrollbar",placeholder:"Enter your message",disabled:f})}),O.jsxs("div",{className:"ed-flex ed-items-center ed-gap-2.5 ed-ml-2 ed-flex-shrink-0",children:[O.jsx("input",{type:"file",ref:i,onChange:m,className:"ed-hidden",accept:".pdf, .png, .jpeg, .jpg",multiple:!0,disabled:f}),O.jsx(Um,{title:"Supported file types: jpg, png, pdf (max 5MB)",children:O.jsx("button",{type:"button",onClick:()=>{var _;return(_=i.current)==null?void 0:_.click()},className:"ed-text-border hover:ed-text-border-dark",children:O.jsx(Np,{className:"ed-size-5 ed-cursor-pointer"})})}),O.jsx("button",{onClick:w,type:"button",disabled:S,children:f?O.jsx(av,{className:"ed-size-5"}):O.jsx(Dp,{className:`${S?"ed-text-border":"ed-text-brand"} ed-size-5`})})]})]})]})},fx=({from:e="knowledge-base",isAuthenticated:t,onSubmit:n,reqId:r,setFeedbackForTheArticle:i,userData:a})=>{var _,x,k;const[o,u]=M.useState([]),[l,f]=M.useState(!1),[d,h]=M.useState({}),p=e==="message",m=p?{contact_person_name:a==null?void 0:a.contact_person_name,contact_person_email:a==null?void 0:a.contact_person_email,ticket_title:d==null?void 0:d.ticket_title,ticket_activity:d==null?void 0:d.ticket_activity}:d,[y,{loading:g}]=Ra(gw),b=async()=>{var A,N;try{if(f(!0),Ge.size(o)&&Ge.size(o)>5){en("error","You can upload maximum 5 files","top-right");return}const I=[],F=[];Ge.forEach(o,V=>{const D=`${Yp()}.${Ge.last(Ge.split(V.name,"."))}`;I.push({name:D,title:V.name,size:V.size,type:"ticket_activity_attachment"}),F.push({file:V,name:D})});const{data:H}=await y({variables:{inputData:{...m,...r,ticket_activity_files:I}}});if((A=H==null?void 0:H.createATicketForPortal)!=null&&A.id){let V=[];if(Ge.size(F)){const D=F.map(async z=>{var Q;try{const q=await uv({name:z.name,type:"ticket_activity_attachment",sub_type:(Q=H==null?void 0:H.createATicketForPortal)==null?void 0:Q.id});if(q!=null&&q.error)return en("error",`Failed to process ${z.name}`,"top-right"),null;const{key:J,url:$,file:Y,success:ae}=await lv({key:q.key,url:q.url},z.file);return ae?{key:J,url:$,file:Y}:null}catch(q){return console.error(`Error processing file ${z.name}:`,q),en("error",`Failed to upload ${z.name}`,"top-right"),null}});V=(await Promise.all(D)).filter(Boolean)}n&&n({ticket_id:(N=H==null?void 0:H.createATicketForPortal)==null?void 0:N.id,ticket_title:m.ticket_title,ticket_activity:m.ticket_activity,ticket_activity_files:V})}}catch(I){en("error","Something went wrong","top-right"),console.error("error",I)}finally{f(!1)}},w=(A,N)=>{h(I=>({...I,[A]:N}))},S=Uh(d.contact_person_email),C=!t&&(!((_=d.contact_person_name)!=null&&_.trim())||!S||!d.contact_person_email)||!((x=d.ticket_title)!=null&&x.trim())||!((k=d.ticket_activity)!=null&&k.trim()),T=()=>g||l?!0:C;return O.jsxs("div",{className:`ed-px-5 ed-pb-5 ${p&&"ed-bg-white-light ed-rounded-md ed-py-2 ed-max-w-full md:ed-max-w-[85%] ed-ml-auto"}`,children:[!p&&O.jsxs(O.Fragment,{children:[O.jsxs("div",{className:"ed-flex ed-items-start ed-justify-between ed-pt-5 ed-sticky ed-top-0 ed-bg-white",children:[O.jsx("h5",{className:"ed-text-18 ed-font-semibold ed-text-border-dark ed-mb-5",children:"Get in touch"}),O.jsx(ri,{size:24,className:"ed-text-border-dark ed-cursor-pointer",onClick:()=>i(A=>({...A,notHelpfulModal:!1}))})]}),O.jsx("p",{className:"ed-text-14 ed-font-medium ed-text-border-regular ed-mt-5 ed-mb-4 ed-inline-block ed-w-11/12",children:"Tell us how can we make our product more useful for you."})]}),O.jsxs("div",{className:"ed-space-y-4 ed-mb-6",children:[!t&&O.jsxs(O.Fragment,{children:[O.jsx(Bo,{isRequired:!0,label:"Name",placeholder:"Enter your name",value:d.contact_person_name,onChange:A=>w("contact_person_name",A.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"contact_person_name"}),O.jsx(Bo,{isRequired:!0,type:"email",label:"Email",placeholder:"Enter your email",value:d.contact_person_email,onChange:A=>w("contact_person_email",A.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"contact_person_email"}),(d==null?void 0:d.contact_person_email)&&!S&&O.jsx("span",{className:"ed-text-red ed-font-12",children:"Please enter a valid email address!"})]}),O.jsx(Bo,{isRequired:!0,label:"Subject",placeholder:"Tell us what this feedback is about",value:d.ticket_title,onChange:A=>w("ticket_title",A.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"ticket_title"}),O.jsx(hw,{label:`${t?"Summary":"Description"}`,isRequired:!0,placeholder:"Add more details for us to resolve the issue",value:d.ticket_activity,onChange:A=>w("ticket_activity",A.target.value),stylings:{placeholderStyle:"placeholder:text-14 placeholder:font-medium placeholder:text-border"},name:"ticket_activity"}),O.jsx(vw,{subtitle:"Supported file types: jpg, png, pdf (max 5MB)",selectedFiles:o,setSelectedFiles:u})]}),O.jsx("div",{className:"ed-flex ed-justify-end",children:O.jsx(Ho,{title:"Submit",loaderText:"Submitting",fullWidthBtn:!0,disabled:T(),loader:g||l,callBack:b})})]})};var zm={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GET_CONVERSATION_ACTIVITIES_FOR_PORTAL"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"queryData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ConversationActivitiesForPortalQueryInputType"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"optionData"}},type:{kind:"NamedType",name:{kind:"Name",value:"OptionDataType"}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"getConversationActivitiesForPortal"},arguments:[{kind:"Argument",name:{kind:"Name",value:"queryData"},value:{kind:"Variable",name:{kind:"Name",value:"queryData"}}},{kind:"Argument",name:{kind:"Name",value:"optionData"},value:{kind:"Variable",name:{kind:"Name",value:"optionData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"message"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"is_customer_reply"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"author"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"last_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"first_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"avatar_file"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]}]}}]}},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"files"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"key"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"log"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sub_context"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"new_assignee"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"last_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"first_name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]}]}}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"meta_data"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filtered_rows"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"total_rows"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:765}};zm.loc.source={body:`query GET_CONVERSATION_ACTIVITIES_FOR_PORTAL(
|
|
255
255
|
$queryData: ConversationActivitiesForPortalQueryInputType!
|
|
256
256
|
$optionData: OptionDataType
|
|
257
257
|
) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ed-widget",
|
|
3
3
|
"description": "A flexible and lightweight EasyDesk chat widget for React apps and websites. Supports both React integration and CDN-based embedding for fast, real-time customer support.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.21.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Gain Solutions AS",
|
|
7
7
|
"license": "MIT",
|