@payloadcms/ui 3.36.0-canary.8 → 3.36.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/exports/client/index.js +11 -11
- package/dist/exports/client/index.js.map +3 -3
- package/dist/fields/Relationship/index.d.ts.map +1 -1
- package/dist/fields/Relationship/index.js +50 -33
- package/dist/fields/Relationship/index.js.map +1 -1
- package/dist/utilities/copyDataFromLocale.d.ts.map +1 -1
- package/dist/utilities/copyDataFromLocale.js +17 -6
- package/dist/utilities/copyDataFromLocale.js.map +1 -1
- package/package.json +5 -5
|
@@ -10,7 +10,7 @@ function require(m) {
|
|
|
10
10
|
}
|
|
11
11
|
// Workaround end
|
|
12
12
|
|
|
13
|
-
import{a as Wf,b as H,c as Hf,d as St,e as SD,f as ID,g as zf,h as RD,i as _D}from"./chunk-QPA2ZA5J.js";import{a as pt,b as ol,c as Gf,d as k,e as Li,f as dv,g as mv,h as Fs,i as Cu,j as wD,k as fv,l as DD,m as FD,n as AD}from"./chunk-OA4JPMVI.js";import{c as wr,d as uv,e as Ds}from"./chunk-5LKBKI4T.js";var Sv=wr(bt=>{"use strict";function Zf(t,e){var o=t.length;t.push(e);e:for(;0<o;){var n=o-1>>>1,r=t[n];if(0<wu(r,e))t[n]=e,t[o]=r,o=n;else break e}}function Sr(t){return t.length===0?null:t[0]}function Iu(t){if(t.length===0)return null;var e=t[0],o=t.pop();if(o!==e){t[0]=o;e:for(var n=0,r=t.length,s=r>>>1;n<s;){var i=2*(n+1)-1,a=t[i],l=i+1,c=t[l];if(0>wu(a,o))l<r&&0>wu(c,a)?(t[n]=c,t[l]=o,n=l):(t[n]=a,t[i]=o,n=i);else if(l<r&&0>wu(c,o))t[n]=c,t[l]=o,n=l;else break e}}return e}function wu(t,e){var o=t.sortIndex-e.sortIndex;return o!==0?o:t.id-e.id}bt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(pv=performance,bt.unstable_now=function(){return pv.now()}):(Xf=Date,hv=Xf.now(),bt.unstable_now=function(){return Xf.now()-hv});var pv,Xf,hv,Zr=[],Wn=[],TD=1,ar=null,yo=3,Ru=!1,As=!1,nl=!1,vv=typeof setTimeout=="function"?setTimeout:null,xv=typeof clearTimeout=="function"?clearTimeout:null,gv=typeof setImmediate<"u"?setImmediate:null;function Su(t){for(var e=Sr(Wn);e!==null;){if(e.callback===null)Iu(Wn);else if(e.startTime<=t)Iu(Wn),e.sortIndex=e.expirationTime,Zf(Zr,e);else break;e=Sr(Wn)}}function Jf(t){if(nl=!1,Su(t),!As)if(Sr(Zr)!==null)As=!0,qf();else{var e=Sr(Wn);e!==null&&Qf(Jf,e.startTime-t)}}var _u=!1,sl=-1,yv=5,Cv=-1;function wv(){return!(bt.unstable_now()-Cv<yv)}function Uf(){if(_u){var t=bt.unstable_now();Cv=t;var e=!0;try{e:{As=!1,nl&&(nl=!1,xv(sl),sl=-1),Ru=!0;var o=yo;try{t:{for(Su(t),ar=Sr(Zr);ar!==null&&!(ar.expirationTime>t&&wv());){var n=ar.callback;if(typeof n=="function"){ar.callback=null,yo=ar.priorityLevel;var r=n(ar.expirationTime<=t);if(t=bt.unstable_now(),typeof r=="function"){ar.callback=r,Su(t),e=!0;break t}ar===Sr(Zr)&&Iu(Zr),Su(t)}else Iu(Zr);ar=Sr(Zr)}if(ar!==null)e=!0;else{var s=Sr(Wn);s!==null&&Qf(Jf,s.startTime-t),e=!1}}break e}finally{ar=null,yo=o,Ru=!1}e=void 0}}finally{e?rl():_u=!1}}}var rl;typeof gv=="function"?rl=function(){gv(Uf)}:typeof MessageChannel<"u"?(Yf=new MessageChannel,bv=Yf.port2,Yf.port1.onmessage=Uf,rl=function(){bv.postMessage(null)}):rl=function(){vv(Uf,0)};var Yf,bv;function qf(){_u||(_u=!0,rl())}function Qf(t,e){sl=vv(function(){t(bt.unstable_now())},e)}bt.unstable_IdlePriority=5;bt.unstable_ImmediatePriority=1;bt.unstable_LowPriority=4;bt.unstable_NormalPriority=3;bt.unstable_Profiling=null;bt.unstable_UserBlockingPriority=2;bt.unstable_cancelCallback=function(t){t.callback=null};bt.unstable_continueExecution=function(){As||Ru||(As=!0,qf())};bt.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):yv=0<t?Math.floor(1e3/t):5};bt.unstable_getCurrentPriorityLevel=function(){return yo};bt.unstable_getFirstCallbackNode=function(){return Sr(Zr)};bt.unstable_next=function(t){switch(yo){case 1:case 2:case 3:var e=3;break;default:e=yo}var o=yo;yo=e;try{return t()}finally{yo=o}};bt.unstable_pauseExecution=function(){};bt.unstable_requestPaint=function(){};bt.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var o=yo;yo=t;try{return e()}finally{yo=o}};bt.unstable_scheduleCallback=function(t,e,o){var n=bt.unstable_now();switch(typeof o=="object"&&o!==null?(o=o.delay,o=typeof o=="number"&&0<o?n+o:n):o=n,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=o+r,t={id:TD++,callback:e,priorityLevel:t,startTime:o,expirationTime:r,sortIndex:-1},o>n?(t.sortIndex=o,Zf(Wn,t),Sr(Zr)===null&&t===Sr(Wn)&&(nl?(xv(sl),sl=-1):nl=!0,Qf(Jf,o-n))):(t.sortIndex=r,Zf(Zr,t),As||Ru||(As=!0,qf())),t};bt.unstable_shouldYield=wv;bt.unstable_wrapCallback=function(t){var e=yo;return function(){var o=yo;yo=e;try{return t.apply(this,arguments)}finally{yo=o}}}});var Rv=wr((ZW,Iv)=>{"use strict";Iv.exports=Sv()});var yC=wr(dt=>{"use strict";var lo=typeof Symbol=="function"&&Symbol.for,Ah=lo?Symbol.for("react.element"):60103,Th=lo?Symbol.for("react.portal"):60106,jd=lo?Symbol.for("react.fragment"):60107,Od=lo?Symbol.for("react.strict_mode"):60108,Md=lo?Symbol.for("react.profiler"):60114,Bd=lo?Symbol.for("react.provider"):60109,Vd=lo?Symbol.for("react.context"):60110,Eh=lo?Symbol.for("react.async_mode"):60111,Gd=lo?Symbol.for("react.concurrent_mode"):60111,Wd=lo?Symbol.for("react.forward_ref"):60112,Hd=lo?Symbol.for("react.suspense"):60113,d6=lo?Symbol.for("react.suspense_list"):60120,zd=lo?Symbol.for("react.memo"):60115,Xd=lo?Symbol.for("react.lazy"):60116,m6=lo?Symbol.for("react.block"):60121,f6=lo?Symbol.for("react.fundamental"):60117,p6=lo?Symbol.for("react.responder"):60118,h6=lo?Symbol.for("react.scope"):60119;function er(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Ah:switch(t=t.type,t){case Eh:case Gd:case jd:case Md:case Od:case Hd:return t;default:switch(t=t&&t.$$typeof,t){case Vd:case Wd:case Xd:case zd:case Bd:return t;default:return e}}case Th:return e}}}function xC(t){return er(t)===Gd}dt.AsyncMode=Eh;dt.ConcurrentMode=Gd;dt.ContextConsumer=Vd;dt.ContextProvider=Bd;dt.Element=Ah;dt.ForwardRef=Wd;dt.Fragment=jd;dt.Lazy=Xd;dt.Memo=zd;dt.Portal=Th;dt.Profiler=Md;dt.StrictMode=Od;dt.Suspense=Hd;dt.isAsyncMode=function(t){return xC(t)||er(t)===Eh};dt.isConcurrentMode=xC;dt.isContextConsumer=function(t){return er(t)===Vd};dt.isContextProvider=function(t){return er(t)===Bd};dt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ah};dt.isForwardRef=function(t){return er(t)===Wd};dt.isFragment=function(t){return er(t)===jd};dt.isLazy=function(t){return er(t)===Xd};dt.isMemo=function(t){return er(t)===zd};dt.isPortal=function(t){return er(t)===Th};dt.isProfiler=function(t){return er(t)===Md};dt.isStrictMode=function(t){return er(t)===Od};dt.isSuspense=function(t){return er(t)===Hd};dt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===jd||t===Gd||t===Md||t===Od||t===Hd||t===d6||typeof t=="object"&&t!==null&&(t.$$typeof===Xd||t.$$typeof===zd||t.$$typeof===Bd||t.$$typeof===Vd||t.$$typeof===Wd||t.$$typeof===f6||t.$$typeof===p6||t.$$typeof===h6||t.$$typeof===m6)};dt.typeOf=er});var wC=wr((Mse,CC)=>{"use strict";CC.exports=yC()});var AC=wr((Bse,FC)=>{"use strict";var Ph=wC(),g6={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},b6={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},v6={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_C={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Nh={};Nh[Ph.ForwardRef]=v6;Nh[Ph.Memo]=_C;function SC(t){return Ph.isMemo(t)?_C:Nh[t.$$typeof]||g6}var x6=Object.defineProperty,y6=Object.getOwnPropertyNames,IC=Object.getOwnPropertySymbols,C6=Object.getOwnPropertyDescriptor,w6=Object.getPrototypeOf,RC=Object.prototype;function DC(t,e,o){if(typeof e!="string"){if(RC){var n=w6(e);n&&n!==RC&&DC(t,n,o)}var r=y6(e);IC&&(r=r.concat(IC(e)));for(var s=SC(t),i=SC(e),a=0;a<r.length;++a){var l=r[a];if(!b6[l]&&!(o&&o[l])&&!(i&&i[l])&&!(s&&s[l])){var c=C6(e,l);try{x6(t,l,c)}catch{}}}}return t}FC.exports=DC});var fg=wr((wue,W2)=>{var mg=Math.floor(Math.random()*16777215),O2=ht.index=parseInt(Math.random()*16777215,10),M2=(typeof process>"u"||typeof process.pid!="number"?Math.floor(Math.random()*1e5):process.pid)%65535,B2=(()=>{try{return _Buffer}catch{try{return Buffer}catch{return null}}})(),lm=function(t){return!!(t!=null&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))},G2=[];for(Go=0;Go<256;Go++)G2[Go]=(Go<=15?"0":"")+Go.toString(16);var Go,V2=new RegExp("^[0-9a-fA-F]{24}$"),rc=[];Go=0;for(;Go<10;)rc[48+Go]=Go++;for(;Go<16;)rc[55+Go]=rc[87+Go]=Go++;function ht(t){if(!(this instanceof ht))return new ht(t);if(t&&(t instanceof ht||t._bsontype==="ObjectID"))return t;if(this._bsontype="ObjectID",t==null||typeof t=="number"){this.id=this.generate(t);return}var e=ht.isValid(t);if(!e&&t!=null)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(e&&typeof t=="string"&&t.length===24)return ht.createFromHexString(t);if(t!=null&&t.length===12)this.id=t;else{if(t!=null&&typeof t.toHexString=="function")return t;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}}W2.exports=ht;ht.default=ht;ht.createFromTime=function(t){return t=parseInt(t,10)%4294967295,new ht(g9(8,t)+"0000000000000000")};ht.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var e="",o=0;o<24;)e+=String.fromCharCode(rc[t.charCodeAt(o++)]<<4|rc[t.charCodeAt(o++)]);return new ht(e)};ht.isValid=function(t){return t==null?!1:typeof t=="number"?!0:typeof t=="string"?t.length===12||t.length===24&&V2.test(t):t instanceof ht?!0:lm(t)?ht.isValid(t.toString("hex")):typeof t.toHexString=="function"&&B2&&(t.id instanceof B2||typeof t.id=="string")?t.id.length===12||t.id.length===24&&V2.test(t.id):!1};ht.prototype={constructor:ht,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(this.id.length===24)return this.id;if(lm(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=G2[this.id.charCodeAt(e)];return t},equals:function(t){return t instanceof ht?this.toString()===t.toString():typeof t=="string"&&ht.isValid(t)&&t.length===12&&lm(this.id)?t===this.id.toString("binary"):typeof t=="string"&&ht.isValid(t)&&t.length===24?t.toLowerCase()===this.toHexString():typeof t=="string"&&ht.isValid(t)&&t.length===12?t===this.id:t!=null&&(t instanceof ht||t.toHexString)?t.toHexString()===this.toHexString():!1},getTimestamp:function(){var t=new Date,e;return lm(this.id)?e=this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:e=this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(Math.floor(e)*1e3),t},generate:function(t){typeof t!="number"&&(t=~~(Date.now()/1e3)),t=parseInt(t,10)%4294967295;var e=h9();return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255,mg>>16&255,mg>>8&255,mg&255,M2>>8&255,M2&255,e>>16&255,e>>8&255,e&255)}};function h9(){return O2=(O2+1)%16777215}function g9(t,e){return e=e.toString(16),e.length===t?e:"00000000".substring(e.length,t)+e}var b9=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";ht.prototype[b9]=function(){return"ObjectID("+this+")"};ht.prototype.toJSON=ht.prototype.toHexString;ht.prototype.toString=ht.prototype.toHexString});var eb=wr((kve,yS)=>{function Kg(t){return t===void 0}function pk(t){return t===null}function hk(t){return typeof t=="boolean"}function Pm(t){return t===Object(t)}function vS(t){return Array.isArray(t)}function gk(t){return t instanceof Date}function xS(t,e){return e?Pm(t)&&!Kg(t.uri):Pm(t)&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.slice=="function"}function bk(t,e){return xS(t,e)&&typeof t.name=="string"&&(Pm(t.lastModifiedDate)||typeof t.lastModified=="number")}function ci(t){return Kg(t)?!1:t}function Qg(t,e,o,n){e=e||{},o=o||new FormData,e.indices=ci(e.indices),e.nullsAsUndefineds=ci(e.nullsAsUndefineds),e.booleansAsIntegers=ci(e.booleansAsIntegers),e.allowEmptyArrays=ci(e.allowEmptyArrays),e.noAttributesWithArrayNotation=ci(e.noAttributesWithArrayNotation),e.noFilesWithArrayNotation=ci(e.noFilesWithArrayNotation),e.dotsForObjectNotation=ci(e.dotsForObjectNotation);let r=typeof o.getParts=="function";return Kg(t)||(pk(t)?e.nullsAsUndefineds||o.append(n,""):hk(t)?e.booleansAsIntegers?o.append(n,t?1:0):o.append(n,t):vS(t)?t.length?t.forEach((s,i)=>{let a=n+"["+(e.indices?i:"")+"]";(e.noAttributesWithArrayNotation||e.noFilesWithArrayNotation&&bk(s,r))&&(a=n),Qg(s,e,o,a)}):e.allowEmptyArrays&&o.append(e.noAttributesWithArrayNotation?n:n+"[]",""):gk(t)?o.append(n,t.toISOString()):Pm(t)&&!xS(t,r)?Object.keys(t).forEach(s=>{let i=t[s];if(vS(i))for(;s.length>2&&s.lastIndexOf("[]")===s.length-2;)s=s.substring(0,s.length-2);let a=n?e.dotsForObjectNotation?n+"."+s:n+"["+s+"]":s;Qg(i,e,o,a)}):o.append(n,t)),o}yS.exports={serialize:Qg}});var y4=wr((BFe,x4)=>{(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(o,n){return o<<n|o>>>32-n},rotr:function(o,n){return o<<32-n|o>>>n},endian:function(o){if(o.constructor==Number)return e.rotl(o,8)&16711935|e.rotl(o,24)&4278255360;for(var n=0;n<o.length;n++)o[n]=e.endian(o[n]);return o},randomBytes:function(o){for(var n=[];o>0;o--)n.push(Math.floor(Math.random()*256));return n},bytesToWords:function(o){for(var n=[],r=0,s=0;r<o.length;r++,s+=8)n[s>>>5]|=o[r]<<24-s%32;return n},wordsToBytes:function(o){for(var n=[],r=0;r<o.length*32;r+=8)n.push(o[r>>>5]>>>24-r%32&255);return n},bytesToHex:function(o){for(var n=[],r=0;r<o.length;r++)n.push((o[r]>>>4).toString(16)),n.push((o[r]&15).toString(16));return n.join("")},hexToBytes:function(o){for(var n=[],r=0;r<o.length;r+=2)n.push(parseInt(o.substr(r,2),16));return n},bytesToBase64:function(o){for(var n=[],r=0;r<o.length;r+=3)for(var s=o[r]<<16|o[r+1]<<8|o[r+2],i=0;i<4;i++)r*8+i*6<=o.length*8?n.push(t.charAt(s>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(o){o=o.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],r=0,s=0;r<o.length;s=++r%4)s!=0&&n.push((t.indexOf(o.charAt(r-1))&Math.pow(2,-2*s+8)-1)<<s*2|t.indexOf(o.charAt(r))>>>6-s*2);return n}};x4.exports=e})()});var Wb=wr((VFe,C4)=>{var Gb={utf8:{stringToBytes:function(t){return Gb.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Gb.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],o=0;o<t.length;o++)e.push(t.charCodeAt(o)&255);return e},bytesToString:function(t){for(var e=[],o=0;o<t.length;o++)e.push(String.fromCharCode(t[o]));return e.join("")}}};C4.exports=Gb});var I4=wr((GFe,S4)=>{S4.exports=function(t){return t!=null&&(w4(t)||FB(t)||!!t._isBuffer)};function w4(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function FB(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&w4(t.slice(0,0))}});var _4=wr((WFe,R4)=>{(function(){var t=y4(),e=Wb().utf8,o=I4(),n=Wb().bin,r=function(s,i){s.constructor==String?i&&i.encoding==="binary"?s=n.stringToBytes(s):s=e.stringToBytes(s):o(s)?s=Array.prototype.slice.call(s,0):!Array.isArray(s)&&s.constructor!==Uint8Array&&(s=s.toString());for(var a=t.bytesToWords(s),l=s.length*8,c=1732584193,u=-271733879,d=-1732584194,f=271733878,m=0;m<a.length;m++)a[m]=(a[m]<<8|a[m]>>>24)&16711935|(a[m]<<24|a[m]>>>8)&4278255360;a[l>>>5]|=128<<l%32,a[(l+64>>>9<<4)+14]=l;for(var h=r._ff,p=r._gg,g=r._hh,b=r._ii,m=0;m<a.length;m+=16){var v=c,x=u,y=d,C=f;c=h(c,u,d,f,a[m+0],7,-680876936),f=h(f,c,u,d,a[m+1],12,-389564586),d=h(d,f,c,u,a[m+2],17,606105819),u=h(u,d,f,c,a[m+3],22,-1044525330),c=h(c,u,d,f,a[m+4],7,-176418897),f=h(f,c,u,d,a[m+5],12,1200080426),d=h(d,f,c,u,a[m+6],17,-1473231341),u=h(u,d,f,c,a[m+7],22,-45705983),c=h(c,u,d,f,a[m+8],7,1770035416),f=h(f,c,u,d,a[m+9],12,-1958414417),d=h(d,f,c,u,a[m+10],17,-42063),u=h(u,d,f,c,a[m+11],22,-1990404162),c=h(c,u,d,f,a[m+12],7,1804603682),f=h(f,c,u,d,a[m+13],12,-40341101),d=h(d,f,c,u,a[m+14],17,-1502002290),u=h(u,d,f,c,a[m+15],22,1236535329),c=p(c,u,d,f,a[m+1],5,-165796510),f=p(f,c,u,d,a[m+6],9,-1069501632),d=p(d,f,c,u,a[m+11],14,643717713),u=p(u,d,f,c,a[m+0],20,-373897302),c=p(c,u,d,f,a[m+5],5,-701558691),f=p(f,c,u,d,a[m+10],9,38016083),d=p(d,f,c,u,a[m+15],14,-660478335),u=p(u,d,f,c,a[m+4],20,-405537848),c=p(c,u,d,f,a[m+9],5,568446438),f=p(f,c,u,d,a[m+14],9,-1019803690),d=p(d,f,c,u,a[m+3],14,-187363961),u=p(u,d,f,c,a[m+8],20,1163531501),c=p(c,u,d,f,a[m+13],5,-1444681467),f=p(f,c,u,d,a[m+2],9,-51403784),d=p(d,f,c,u,a[m+7],14,1735328473),u=p(u,d,f,c,a[m+12],20,-1926607734),c=g(c,u,d,f,a[m+5],4,-378558),f=g(f,c,u,d,a[m+8],11,-2022574463),d=g(d,f,c,u,a[m+11],16,1839030562),u=g(u,d,f,c,a[m+14],23,-35309556),c=g(c,u,d,f,a[m+1],4,-1530992060),f=g(f,c,u,d,a[m+4],11,1272893353),d=g(d,f,c,u,a[m+7],16,-155497632),u=g(u,d,f,c,a[m+10],23,-1094730640),c=g(c,u,d,f,a[m+13],4,681279174),f=g(f,c,u,d,a[m+0],11,-358537222),d=g(d,f,c,u,a[m+3],16,-722521979),u=g(u,d,f,c,a[m+6],23,76029189),c=g(c,u,d,f,a[m+9],4,-640364487),f=g(f,c,u,d,a[m+12],11,-421815835),d=g(d,f,c,u,a[m+15],16,530742520),u=g(u,d,f,c,a[m+2],23,-995338651),c=b(c,u,d,f,a[m+0],6,-198630844),f=b(f,c,u,d,a[m+7],10,1126891415),d=b(d,f,c,u,a[m+14],15,-1416354905),u=b(u,d,f,c,a[m+5],21,-57434055),c=b(c,u,d,f,a[m+12],6,1700485571),f=b(f,c,u,d,a[m+3],10,-1894986606),d=b(d,f,c,u,a[m+10],15,-1051523),u=b(u,d,f,c,a[m+1],21,-2054922799),c=b(c,u,d,f,a[m+8],6,1873313359),f=b(f,c,u,d,a[m+15],10,-30611744),d=b(d,f,c,u,a[m+6],15,-1560198380),u=b(u,d,f,c,a[m+13],21,1309151649),c=b(c,u,d,f,a[m+4],6,-145523070),f=b(f,c,u,d,a[m+11],10,-1120210379),d=b(d,f,c,u,a[m+2],15,718787259),u=b(u,d,f,c,a[m+9],21,-343485551),c=c+v>>>0,u=u+x>>>0,d=d+y>>>0,f=f+C>>>0}return t.endian([c,u,d,f])};r._ff=function(s,i,a,l,c,u,d){var f=s+(i&a|~i&l)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._gg=function(s,i,a,l,c,u,d){var f=s+(i&l|a&~l)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._hh=function(s,i,a,l,c,u,d){var f=s+(i^a^l)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._ii=function(s,i,a,l,c,u,d){var f=s+(a^(i|~l))+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._blocksize=16,r._digestsize=16,R4.exports=function(s,i){if(s==null)throw new Error("Illegal argument "+s);var a=t.wordsToBytes(r(s,i));return i&&i.asBytes?a:i&&i.asString?n.bytesToString(a):t.bytesToHex(a)}})()});import{jsx as sp}from"react/jsx-runtime";import"react";function oe({CustomComponent:t,Fallback:e}){return t!==void 0?t:e}import{jsx as WD}from"react/jsx-runtime";import Av from"react";import{createContext as Hn,use as zn}from"react";var il=Ds(Rv(),1);import{createElement as ED,createContext as PD,useContext as ND,useEffect as LD,useLayoutEffect as $D,useReducer as kD,useRef as Kf,useState as jD}from"react";var Du=Symbol(),OD=Symbol(),MD=typeof window>"u"||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent),_v=MD?LD:$D,BD=il.unstable_runWithPriority?t=>{try{(0,il.unstable_runWithPriority)(il.unstable_NormalPriority,t)}catch(e){if(e.message==="Not implemented.")t();else throw e}}:t=>t(),VD=t=>({value:o,children:n})=>{let r=Kf(o),s=Kf(0),[i,a]=jD(null);i&&(i(o),a(null));let l=Kf();if(!l.current){let c=new Set,u=(d,f)=>{s.current+=1;let m={n:s.current};f?.suspense&&(m.n*=-1,m.p=new Promise(h=>{a(()=>p=>{m.v=p,delete m.p,h(p)})})),c.forEach(h=>h(m)),d()};l.current={[Du]:{v:r,n:s,l:c,u}}}return _v(()=>{r.current=o,s.current+=1,BD(()=>{l.current[Du].l.forEach(c=>{c({n:s.current,v:o})})})},[o]),ED(t,{value:l.current},n)},GD=t=>t;function Dv(t){let e=PD({[Du]:{v:{current:t},n:{current:-1},l:new Set,u:o=>o()}});return e[OD]=e.Provider,e.Provider=VD(e.Provider),delete e.Consumer,e}function ep(t,e){let o=ND(t)[Du],{v:{current:n},n:{current:r},l:s}=o,i=e(n),[a,l]=kD((c,u)=>{if(!u)return[n,i];if("p"in u)throw u.p;if(u.n===r)return Object.is(c[1],i)?c:[n,i];try{if("v"in u){if(Object.is(c[0],u.v))return c;let d=e(u.v);return Object.is(c[1],d)?c:[u.v,d]}}catch{}return[...c]},[n,i]);return Object.is(a[1],i)||l(),_v(()=>(s.add(l),()=>{s.delete(l)}),[s]),a[1]}function Fv(t){return ep(t,GD)}var Fu=Hn({}),Au=Hn({}),Tu=Hn({}),Eu=Hn(!1),Pu=Hn(!1),tp=Hn(!1),Nu=Hn(!1),op=Hn(!1),al=Dv([{},()=>null]),Oe=()=>zn(Fu),$i=()=>zn(Au),Lu=()=>zn(Tu),Xt=()=>zn(Eu),lr=()=>zn(Pu),rp=()=>zn(tp),Ut=()=>zn(Nu),Ts=()=>zn(op),Et=t=>ep(al,t),ki=()=>Fv(al);var Tv=Av.createContext({data:{},path:"",rowNumber:void 0}),np=({children:t,path:e,rowNumber:o})=>{"use no memo";let{getDataByPath:n,getSiblingData:r}=Lu(),s=r(e),a=n(e)||s;return WD(Tv,{value:{data:a,path:e,rowNumber:o},children:t})},HD=()=>Av.use(Tv);var zD="row-label",dn=t=>{let{className:e,CustomComponent:o,label:n,path:r,rowNumber:s}=t;return sp(np,{path:r,rowNumber:s,children:sp(oe,{CustomComponent:o,Fallback:typeof n=="string"?sp("span",{className:[zD,e].filter(Boolean).join(" "),style:{pointerEvents:"none"},children:n}):n})})};import{c as iM}from"react/compiler-runtime";import{jsx as uo,jsxs as vi}from"react/jsx-runtime";import{getTranslation as Fb}from"@payloadcms/translations";import aM from"react";import{jsx as lp,jsxs as rF}from"react/jsx-runtime";import kv from"react";import{jsx as KD}from"react/jsx-runtime";import $v from"next/link.js";import{useRouter as eF}from"next/navigation.js";import"react";import{c as XD}from"react/compiler-runtime";import{jsx as UD}from"react/jsx-runtime";import ip,{startTransition as YD,useEffect as ZD,useOptimistic as JD,useRef as Ev}from"react";var ap=t=>{let e=XD(11),{children:o}=t,[n,r]=JD(!1),[s,i]=ip.useState(0),a=Ev(s),l=Ev(null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{l.current=setInterval(()=>{let g=a.current+(.93-a.current)*Math.random()*.2*Math.pow(Math.log(1+(1-a.current)*.75),.75);i(g),a.current=g},250)},e[0]=c):c=e[0];let u=c,d,f;e[1]!==n?(d=()=>{i(0),a.current=0,n?u():l.current&&clearInterval(l.current)},f=[n,u],e[1]=n,e[2]=d,e[3]=f):(d=e[2],f=e[3]),ZD(d,f);let m;e[4]!==r?(m=g=>{YD(()=>{r(!0),typeof g=="function"&&g()})},e[4]=r,e[5]=m):m=e[5];let h=m,p;return e[6]!==o||e[7]!==n||e[8]!==h||e[9]!==s?(p=UD(Pv,{value:{isTransitioning:n,startRouteTransition:h,transitionProgress:s},children:o}),e[6]=o,e[7]=n,e[8]=h,e[9]=s,e[10]=p):p=e[10],p},Pv=ip.createContext({isTransitioning:!1,startRouteTransition:()=>{},transitionProgress:0}),st=()=>ip.use(Pv);var qD=/https?|ftp|gopher|file/;function Nv(t){return typeof t=="string"||typeof t=="number"&&!isNaN(t)||typeof t=="boolean"?String(t):""}function QD(t){let e=new URLSearchParams;return Object.entries(t).forEach(([o,n])=>{Array.isArray(n)?n.forEach(r=>e.append(o,Nv(r))):e.set(o,Nv(n))}),e}function Lv(t){let{auth:e}=t,{hostname:o}=t,n=t.protocol||"",r=t.pathname||"",s=t.hash||"",i=t.query||"",a=!1;e=e?encodeURIComponent(e).replace(/%3A/i,":")+"@":"",t.host?a=e+t.host:o&&(a=e+(~o.indexOf(":")?`[${o}]`:o),t.port&&(a+=":"+t.port)),i&&typeof i=="object"&&(i=String(QD(i)));let l=t.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),t.slashes||(!n||qD.test(n))&&a!==!1?(a="//"+(a||""),r&&r[0]!=="/"&&(r="/"+r)):a||(a=""),s&&s[0]!=="#"&&(s="#"+s),l&&l[0]!=="?"&&(l="?"+l),r=r.replace(/[?#]/g,encodeURIComponent),l=l.replace("#","%23"),`${n}${a}${r}${l}${s}`}var tF=$v.default||$v;function oF(t){let o=t.currentTarget.getAttribute("target");return o&&o!=="_self"||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&t.nativeEvent.which===2}var no=({children:t,href:e,onClick:o,preventDefault:n=!0,ref:r,replace:s,scroll:i,...a})=>{let l=eF(),{startRouteTransition:c}=st();return KD(tF,{href:e,onClick:u=>{oF(u)||(o&&o(u),n&&u.preventDefault(),c(()=>{let d=typeof e=="string"?e:Lv(e);s?l.replace(d,{scroll:i}):l.push(d,{scroll:i})}))},ref:r,...a,children:t})};var Es="banner",Ir=({type:t="default",alignIcon:e="right",children:o,className:n,icon:r,onClick:s,to:i})=>{let a=[Es,`${Es}--type-${t}`,n&&n,i&&`${Es}--has-link`,(i||s)&&`${Es}--has-action`,r&&`${Es}--has-icon`,r&&`${Es}--align-icon-${e}`].filter(Boolean).join(" "),l="div";return s&&!i&&(l="button"),i&&(l=no),rF(l,{className:a,href:i||null,onClick:s,children:[r&&e==="left"&&lp(kv.Fragment,{children:r}),lp("span",{className:`${Es}__content`,children:o}),r&&e==="right"&&lp(kv.Fragment,{children:r})]})};import{jsx as Uo,jsxs as Bu}from"react/jsx-runtime";import wF,{Fragment as SF,isValidElement as IF}from"react";import{jsx as jv}from"react/jsx-runtime";import"react";var Ze=({ariaLabel:t,className:e,direction:o,size:n})=>jv("svg",{"aria-label":t,className:["icon icon--chevron",e,n&&`icon--size-${n}`].filter(Boolean).join(" "),height:"100%",style:{transform:o==="left"?"rotate(90deg)":o==="right"?"rotate(-90deg)":o==="up"?"rotate(180deg)":void 0},viewBox:"0 0 20 20",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:jv("path",{className:"stroke",d:"M14 8L10 12L6 8",strokeLinecap:"square"})});import{jsx as Ov}from"react/jsx-runtime";import"react";var Rr=({className:t})=>Ov("svg",{className:[t,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Ov("path",{className:"stroke",d:"M9.68531 4.62938H5.2634C4.92833 4.62938 4.60698 4.76248 4.37004 4.99942C4.13311 5.23635 4 5.5577 4 5.89278V14.7366C4 15.0717 4.13311 15.393 4.37004 15.63C4.60698 15.8669 4.92833 16 5.2634 16H14.1072C14.4423 16 14.7636 15.8669 15.0006 15.63C15.2375 15.393 15.3706 15.0717 15.3706 14.7366V10.3147M13.7124 4.39249C13.9637 4.14118 14.3046 4 14.66 4C15.0154 4 15.3562 4.14118 15.6075 4.39249C15.8588 4.6438 16 4.98464 16 5.34004C16 5.69544 15.8588 6.03629 15.6075 6.28759L9.91399 11.9817C9.76399 12.1316 9.57868 12.2413 9.37515 12.3008L7.56027 12.8314C7.50591 12.8472 7.44829 12.8482 7.39344 12.8341C7.33859 12.8201 7.28853 12.7915 7.24849 12.7515C7.20845 12.7115 7.17991 12.6614 7.16586 12.6066C7.15181 12.5517 7.15276 12.4941 7.16861 12.4397L7.69924 10.6249C7.75896 10.4215 7.86888 10.2364 8.01888 10.0866L13.7124 4.39249Z",strokeLinecap:"square"})});import{jsx as Mv}from"react/jsx-runtime";import"react";var cp=()=>Mv("svg",{"aria-hidden":"true",className:"graphic link icon icon--link",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Mv("path",{className:"stroke",d:"M7.99999 13.3333H6.66666C5.78261 13.3333 4.93476 12.9821 4.30964 12.357C3.68452 11.7319 3.33333 10.884 3.33333 9.99999C3.33333 9.11593 3.68452 8.26809 4.30964 7.64297C4.93476 7.01785 5.78261 6.66666 6.66666 6.66666H7.99999M12 6.66666H13.3333C14.2174 6.66666 15.0652 7.01785 15.6904 7.64297C16.3155 8.26809 16.6667 9.11593 16.6667 9.99999C16.6667 10.884 16.3155 11.7319 15.6904 12.357C15.0652 12.9821 14.2174 13.3333 13.3333 13.3333H12M7.33333 9.99999H12.6667",strokeLinecap:"square"})});import{jsx as Bv}from"react/jsx-runtime";import"react";var jo=()=>Bv("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Bv("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})});import{jsx as Vv}from"react/jsx-runtime";import"react";var up=()=>Vv("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Vv("path",{className:"stroke",d:"M7.33334 4L4.66667 6.66667M4.66667 6.66667L7.33334 9.33333M4.66667 6.66667H15.3333M12.6667 16L15.3333 13.3333M15.3333 13.3333L12.6667 10.6667M15.3333 13.3333H4.66667",strokeLinecap:"square"})});import{jsx as Ps,jsxs as pp}from"react/jsx-runtime";var Me={};uv(Me,{Button:()=>mp,ButtonGroup:()=>dp,Divider:()=>Gv,GroupLabel:()=>$u});import{jsx as ku}from"react/jsx-runtime";import"react";import{jsx as nF}from"react/jsx-runtime";import"react";var sF="popup-divider",Gv=()=>nF("hr",{className:sF});import{jsx as iF}from"react/jsx-runtime";import"react";var aF="popup-list-group-label",$u=({label:t})=>iF("p",{className:aF,children:t});var ll="popup-button-list",dp=({buttonSize:t="default",children:e,className:o,textAlign:n="left"})=>{let r=[ll,o,`${ll}__text-align--${n}`,`${ll}__button-size--${t}`].filter(Boolean).join(" ");return ku("div",{className:r,children:e})},mp=({id:t,active:e,children:o,className:n,disabled:r,href:s,onClick:i})=>{let a=[`${ll}__button`,e&&`${ll}__button--selected`,n].filter(Boolean).join(" ");if(!r){if(s)return ku(no,{className:a,href:s,id:t,onClick:l=>{i&&i(l)},prefetch:!1,children:o});if(i)return ku("button",{className:a,id:t,onClick:l=>{i&&i(l)},type:"button",children:o})}return ku("div",{className:a,id:t,children:o})};var Xn={};uv(Xn,{WindowInfo:()=>zv,WindowInfoContext:()=>ji,WindowInfoProvider:()=>Yv,useWindowInfo:()=>Co,withWindowInfo:()=>Zv});import{useContext as cF}from"react";import{createContext as lF}from"react";var ji=lF({});var Co=()=>cF(ji);import Wv,{Fragment as Hv}from"react";var zv=t=>{let{children:e}=t,o=Co();return e?typeof e=="function"?Wv.createElement(Hv,null,e(o)):Wv.createElement(Hv,null,e):null};import uF,{useCallback as Xv,useEffect as Uv,useReducer as dF,useRef as mF}from"react";var fF=(t,e)=>{let{payload:{breakpoints:o,animationRef:n}}=e;n.current=null;let{eventsFired:r}=t,{documentElement:{style:s,clientWidth:i,clientHeight:a}}=document,{innerWidth:l,innerHeight:c}=window,u=`${i/100}px`,d=`${a/100}px`,f=o?Object.keys(o).reduce((h,p)=>Object.assign(Object.assign({},h),{[p]:window.matchMedia(o[p]).matches}),{}):{},m={width:l,height:c,"--vw":u,"--vh":d,breakpoints:f,eventsFired:r+1};return s.setProperty("--vw",u),s.setProperty("--vh",d),m},Yv=t=>{let{breakpoints:e,children:o}=t,n=mF(null),[r,s]=dF(fF,{width:void 0,height:void 0,"--vw":"","--vh":"",breakpoints:{},eventsFired:0}),i=Xv(()=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}}))},[e]),a=Xv(()=>{setTimeout(()=>{i()},500)},[i]);return Uv(()=>(window.addEventListener("resize",i),window.addEventListener("orientationchange",a),()=>{window.removeEventListener("resize",i),window.removeEventListener("orientationchange",a)}),[i,a]),Uv(()=>{r.eventsFired===0&&s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}})},[e,r]),uF.createElement(ji.Provider,{value:Object.assign({},r)},o&&o)};import pF from"react";var Zv=t=>o=>{let n=Co();return pF.createElement(t,Object.assign({},o,{windowInfo:n}))};import{useCallback as Qv,useEffect as ju,useRef as vF,useState as hp}from"react";import{c as hF}from"react/compiler-runtime";import{useEffect as gF,useRef as bF,useState as Jv}from"react";var mn=(t,e)=>{let o=hF(14),n;o[0]!==t?(n=t===void 0?{}:t,o[0]=t,o[1]=n):n=o[1];let{root:r,rootMargin:s,threshold:i}=n,a=r===void 0?null:r,l=s===void 0?"0px":s,c=i===void 0?0:i,[u,d]=Jv(),[f,m]=Jv(null),h;o[2]!==e||o[3]!==a||o[4]!==l||o[5]!==c?(h=typeof window<"u"&&"IntersectionObserver"in window&&!e?new window.IntersectionObserver(x=>{let[y]=x;return d(y)},{root:a,rootMargin:l,threshold:c}):null,o[2]=e,o[3]=a,o[4]=l,o[5]=c,o[6]=h):h=o[6];let p=bF(h),g,b;o[7]!==e||o[8]!==f?(g=()=>{if(e)return;let{current:x}=p;return x.disconnect(),f&&x.observe(f),()=>x.disconnect()},b=[f,e],o[7]=e,o[8]=f,o[9]=g,o[10]=b):(g=o[9],b=o[10]),gF(g,b);let v;return o[11]!==u||o[12]!==f?(v=[m,u,f],o[11]=u,o[12]=f,o[13]=v):v=o[13],v};import{jsx as qv}from"react/jsx-runtime";import"react";var cl="popup-button",fp=t=>{let{active:e,button:o,buttonType:n,className:r,disabled:s,noBackground:i,setActive:a,size:l}=t,c=[cl,r,`${cl}--${n}`,!i&&`${cl}--background`,l&&`${cl}--size-${l}`,s&&`${cl}--disabled`].filter(Boolean).join(" "),u=()=>{a(!e)};return n==="none"?null:n==="custom"?qv("div",{className:c,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},role:"button",tabIndex:0,children:o}):qv("button",{className:c,disabled:s,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},tabIndex:0,type:"button",children:o})};var Oo="popup",ho=t=>{let{id:e,boundingRef:o,button:n,buttonClassName:r,buttonSize:s,buttonType:i="default",caret:a=!0,children:l,className:c,disabled:u,forceOpen:d,horizontalAlign:f="left",initActive:m=!1,noBackground:h,onToggleOpen:p,render:g,showOnHover:b=!1,showScrollbar:v=!1,size:x="medium",verticalAlign:y="top"}=t,{height:C,width:S}=Co(),[w,D]=mn({root:o?.current||null,rootMargin:"-100px 0px 0px 0px",threshold:1}),_=vF(null),[A,F]=hp(m),[R,I]=hp(y),[E,T]=hp(f),$=Qv(({horizontal:P=!1,vertical:L=!1})=>{if(_.current){let V=_.current.getBoundingClientRect(),{bottom:M,left:O,right:B,top:G}=V,X=100,Z=document.documentElement.clientWidth,te=document.documentElement.clientHeight,U=0;o?.current&&({bottom:te,left:U,right:Z,top:X}=o.current.getBoundingClientRect()),P&&(B>Z&&O>U?T("right"):O<U&&B<Z&&T("left")),L&&(G<X&&M<te?I("bottom"):M>te&&G>X&&I("top"))}},[o]),j=Qv(P=>{_.current.contains(P.target)||F(!1)},[_]);ju(()=>{$({horizontal:!0})},[D,$,S]),ju(()=>{$({vertical:!0})},[D,$,C]),ju(()=>(typeof p=="function"&&p(A),A?document.addEventListener("mousedown",j):document.removeEventListener("mousedown",j),()=>{document.removeEventListener("mousedown",j)}),[A,j,p]),ju(()=>{F(d)},[d]);let N=[Oo,c,`${Oo}--size-${x}`,s&&`${Oo}--button-size-${s}`,`${Oo}--v-align-${R}`,`${Oo}--h-align-${E}`,A&&`${Oo}--active`,v&&`${Oo}--show-scrollbar`].filter(Boolean).join(" ");return pp("div",{className:N,id:e,children:[Ps("div",{className:`${Oo}__trigger-wrap`,children:b?Ps("div",{className:`${Oo}__on-hover-watch`,onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),children:Ps(fp,{active:A,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:F,size:s})}):Ps(fp,{active:A,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:F,size:s})}),pp("div",{className:`${Oo}__content`,ref:_,children:[Ps("div",{className:`${Oo}__hide-scrollbar`,ref:w,children:Ps("div",{className:`${Oo}__scroll-container`,children:pp("div",{className:`${Oo}__scroll-content`,children:[g&&g({close:()=>F(!1)}),l]})})}),a&&Ps("div",{className:`${Oo}__caret`})]})]})};import{c as xF}from"react/compiler-runtime";import{jsx as Ou,jsxs as yF}from"react/jsx-runtime";import gp,{useEffect as Kv}from"react";var go=t=>{let e=xF(26),{alignCaret:o,boundingRef:n,children:r,className:s,delay:i,position:a,show:l,staticPositioning:c}=t,u=o===void 0?"center":o,d=i===void 0?350:i,f=l===void 0?!0:l,m=c===void 0?!1:c,[h,p]=gp.useState(f),[g,b]=gp.useState("top"),v=CF,x=n?.current||null,y;e[0]!==x?(y={root:x,rootMargin:"-145px 0px 0px 100px",threshold:0},e[0]=x,e[1]=y):y=e[1];let[C,S]=mn(y,m),w,D;e[2]!==d||e[3]!==f?(w=()=>{let R;return d&&f?R=setTimeout(()=>{p(f)},d):p(f),()=>{R&&clearTimeout(R)}},D=[f,d],e[2]=d,e[3]=f,e[4]=w,e[5]=D):(w=e[4],D=e[5]),Kv(w,D);let _;e[6]!==S?.isIntersecting||e[7]!==m?(_=()=>{m||b(S?.isIntersecting?"top":"bottom")},e[6]=S?.isIntersecting,e[7]=m,e[8]=_):_=e[8];let A;e[9]!==S||e[10]!==m?(A=[S,m],e[9]=S,e[10]=m,e[11]=A):A=e[11],Kv(_,A);let F;if(e[12]!==u||e[13]!==r||e[14]!==s||e[15]!==g||e[16]!==a||e[17]!==C||e[18]!==h||e[19]!==m){let R=h&&"tooltip--show",I=`tooltip--caret-${u}`,E=`tooltip--position-${a||g}`,T;e[21]!==s||e[22]!==R||e[23]!==I||e[24]!==E?(T=["tooltip",s,R,I,E].filter(Boolean),e[21]=s,e[22]=R,e[23]=I,e[24]=E,e[25]=T):T=e[25],F=yF(gp.Fragment,{children:[!m&&Ou("aside",{"aria-hidden":"true",className:["tooltip",s,`tooltip--caret-${u}`,"tooltip--position-top"].filter(Boolean).join(" "),ref:C,style:{opacity:"0"},children:Ou("div",{className:"tooltip-content",children:r})}),Ou("aside",{className:T.join(" "),title:v(r),children:Ou("div",{className:"tooltip-content",children:r})})]}),e[12]=u,e[13]=r,e[14]=s,e[15]=g,e[16]=a,e[17]=C,e[18]=h,e[19]=m,e[20]=F}else F=e[20];return F};function CF(t){return typeof t=="string"?t:""}var RF={chevron:Ze,edit:Rr,link:cp,plus:jo,swap:up,x:pt},so="btn",Mu=({children:t,icon:e,showTooltip:o,tooltip:n})=>{let r=RF[e];return Bu(SF,{children:[n&&Uo(go,{className:`${so}__tooltip`,show:o,children:n}),Bu("span",{className:`${so}__content`,children:[t&&Uo("span",{className:`${so}__label`,children:t}),e&&Bu("span",{className:`${so}__icon`,children:[IF(e)&&e,r&&Uo(r,{})]})]})]})},ne=t=>{let{id:e,type:o="button","aria-label":n,buttonStyle:r="primary",children:s,className:i,disabled:a,el:l="button",enableSubMenu:c,icon:u,iconPosition:d="right",iconStyle:f="without-border",newTab:m,onClick:h,onMouseDown:p,ref:g,round:b,size:v="medium",SubMenuPopupContent:x,to:y,tooltip:C,url:S}=t,[w,D]=wF.useState(!1),_=[so,i&&i,u&&`${so}--icon`,f&&`${so}--icon-style-${f}`,u&&!s&&`${so}--icon-only`,v&&`${so}--size-${v}`,u&&d&&`${so}--icon-position-${d}`,C&&`${so}--has-tooltip`,!x&&`${so}--withoutPopup`].filter(Boolean).join(" ");function A(T){D(!1),o!=="submit"&&h&&T.preventDefault(),h&&h(T)}let F=[r&&`${so}--style-${r}`,a&&`${so}--disabled`,b&&`${so}--round`,x?`${so}--withPopup`:`${so}--withoutPopup`].filter(Boolean).join(" "),R={id:e,type:o,"aria-disabled":a,"aria-label":n,className:x?_:[_,F].join(" "),disabled:a,onClick:a?void 0:A,onMouseDown:a?void 0:p,onPointerEnter:C?()=>D(!0):void 0,onPointerLeave:C?()=>D(!1):void 0,rel:m?"noopener noreferrer":void 0,target:m?"_blank":void 0},I,E;switch(l){case"anchor":I=Uo("a",{...R,href:a?void 0:S,ref:g,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})});break;case"link":a&&(I=Uo("div",{...R,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})})),I=Uo(no,{...R,href:y||S,prefetch:E,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})});break;default:I=Uo(l,{ref:g,type:"submit",...R,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})});break}return x?Bu("div",{className:F,children:[I,Uo(ho,{button:Uo(Ze,{}),buttonSize:v,className:a&&!c?`${so}--popup-disabled`:"",disabled:a&&!c,horizontalAlign:"right",id:`${e}-popup`,noBackground:!0,render:({close:T})=>x({close:()=>T()}),size:"large",verticalAlign:"bottom"})]}):I};import{c as tA}from"react/compiler-runtime";import{jsx as oA}from"react/jsx-runtime";import{Fragment as rA}from"react";import{c as eA}from"react/compiler-runtime";import s0,{useMemo as Gu,useRef as xp,useEffect as Wu,useState as NF,useContext as LF}from"react";import{useDndContext as $F,getClientRect as kF,useDroppable as jF,useDraggable as OF,closestCorners as MF,getFirstCollision as BF,getScrollableAncestors as VF,KeyboardCode as Un}from"@dnd-kit/core";import{useMemo as e0,useLayoutEffect as _F,useEffect as DF,useRef as sX,useCallback as iX}from"react";function t0(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e0(()=>n=>{e.forEach(r=>r(n))},e)}var FF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function AF(t){let e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function TF(t){return"nodeType"in t}function EF(t){var e,o;return t?AF(t)?t:TF(t)&&(e=(o=t.ownerDocument)==null?void 0:o.defaultView)!=null?e:window:window}var vp=FF?_F:DF;var bp={};function o0(t,e){return e0(()=>{if(e)return e;let o=bp[t]==null?0:bp[t]+1;return bp[t]=o,t+"-"+o},[t,e])}function PF(t){return function(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce((s,i)=>{let a=Object.entries(i);for(let[l,c]of a){let u=s[l];u!=null&&(s[l]=u+t*c)}return s},{...e})}}var r0=PF(-1);function n0(t){if(!t)return!1;let{KeyboardEvent:e}=EF(t.target);return e&&t instanceof e}var ul=Object.freeze({Translate:{toString(t){if(!t)return;let{x:e,y:o}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:e,scaleY:o}=t;return"scaleX("+e+") scaleY("+o+")"}},Transform:{toString(t){if(t)return[ul.Translate.toString(t),ul.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:o,easing:n}=t;return e+" "+o+"ms "+n}}});function zu(t,e,o){let n=t.slice();return n.splice(o<0?n.length+o:o,0,n.splice(e,1)[0]),n}function GF(t,e){return t.reduce((o,n,r)=>{let s=e.get(n);return s&&(o[r]=s),o},Array(t.length))}function Vu(t){return t!==null&&t>=0}function WF(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}function HF(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}var i0=t=>{let{rects:e,activeIndex:o,overIndex:n,index:r}=t,s=zu(e,n,o),i=e[r],a=s[r];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}};var a0="Sortable",l0=s0.createContext({activeIndex:-1,containerId:a0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:i0,disabled:{draggable:!1,droppable:!1}});function c0(t){let{children:e,id:o,items:n,strategy:r=i0,disabled:s=!1}=t,{active:i,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=$F(),d=o0(a0,o),f=a.rect!==null,m=Gu(()=>n.map(S=>typeof S=="object"&&"id"in S?S.id:S),[n]),h=i!=null,p=i?m.indexOf(i.id):-1,g=c?m.indexOf(c.id):-1,b=xp(m),v=!WF(m,b.current),x=g!==-1&&p===-1||v,y=HF(s);vp(()=>{v&&h&&u(m)},[v,m,h,u]),Wu(()=>{b.current=m},[m]);let C=Gu(()=>({activeIndex:p,containerId:d,disabled:y,disableTransforms:x,items:m,overIndex:g,useDragOverlay:f,sortedRects:GF(m,l),strategy:r}),[p,d,y.draggable,y.droppable,x,m,g,l,f,r]);return s0.createElement(l0.Provider,{value:C},e)}var zF=t=>{let{id:e,items:o,activeIndex:n,overIndex:r}=t;return zu(o,n,r).indexOf(e)},XF=t=>{let{containerId:e,isSorting:o,wasDragging:n,index:r,items:s,newIndex:i,previousItems:a,previousContainerId:l,transition:c}=t;return!c||!n||a!==s&&r===i?!1:o?!0:i!==r&&e===l},UF={duration:200,easing:"ease"},u0="transform",YF=ul.Transition.toString({property:u0,duration:0,easing:"linear"}),ZF={roleDescription:"sortable"};function JF(t){let{disabled:e,index:o,node:n,rect:r}=t,[s,i]=NF(null),a=xp(o);return vp(()=>{if(!e&&o!==a.current&&n.current){let l=r.current;if(l){let c=kF(n.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&i(u)}}o!==a.current&&(a.current=o)},[e,o,n,r]),Wu(()=>{s&&i(null)},[s]),s}function d0(t){let{animateLayoutChanges:e=XF,attributes:o,disabled:n,data:r,getNewIndex:s=zF,id:i,strategy:a,resizeObserverConfig:l,transition:c=UF}=t,{items:u,containerId:d,activeIndex:f,disabled:m,disableTransforms:h,sortedRects:p,overIndex:g,useDragOverlay:b,strategy:v}=LF(l0),x=qF(n,m),y=u.indexOf(i),C=Gu(()=>({sortable:{containerId:d,index:y,items:u},...r}),[d,r,y,u]),S=Gu(()=>u.slice(u.indexOf(i)),[u,i]),{rect:w,node:D,isOver:_,setNodeRef:A}=jF({id:i,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...l}}),{active:F,activatorEvent:R,activeNodeRect:I,attributes:E,setNodeRef:T,listeners:$,isDragging:j,over:N,setActivatorNodeRef:P,transform:L}=OF({id:i,data:C,attributes:{...ZF,...o},disabled:x.draggable}),V=t0(A,T),M=!!F,O=M&&!h&&Vu(f)&&Vu(g),B=!b&&j,G=B&&O?L:null,Z=O?G??(a??v)({rects:p,activeNodeRect:I,activeIndex:f,overIndex:g,index:y}):null,te=Vu(f)&&Vu(g)?s({id:i,items:u,activeIndex:f,overIndex:g}):y,U=F?.id,z=xp({activeId:U,items:u,newIndex:te,containerId:d}),le=u!==z.current.items,J=e({active:F,containerId:d,isDragging:j,isSorting:M,id:i,index:y,items:u,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:c,wasDragging:z.current.activeId!=null}),ce=JF({disabled:!J,index:y,node:D,rect:w});return Wu(()=>{M&&z.current.newIndex!==te&&(z.current.newIndex=te),d!==z.current.containerId&&(z.current.containerId=d),u!==z.current.items&&(z.current.items=u)},[M,te,d,u]),Wu(()=>{if(U===z.current.activeId)return;if(U&&!z.current.activeId){z.current.activeId=U;return}let q=setTimeout(()=>{z.current.activeId=U},50);return()=>clearTimeout(q)},[U]),{active:F,activeIndex:f,attributes:E,data:C,rect:w,index:y,newIndex:te,items:u,isOver:_,isSorting:M,isDragging:j,listeners:$,node:D,overIndex:g,over:N,setNodeRef:V,setActivatorNodeRef:P,setDroppableNodeRef:A,setDraggableNodeRef:T,transform:ce??Z,transition:re()};function re(){if(ce||le&&z.current.newIndex===y)return YF;if(!(B&&!n0(R)||!c)&&(M||J))return ul.Transition.toString({...c,property:u0})}}function qF(t,e){var o,n;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(o=t?.draggable)!=null?o:e.draggable,droppable:(n=t?.droppable)!=null?n:e.droppable}}function Hu(t){if(!t)return!1;let e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}var QF=[Un.Down,Un.Right,Un.Up,Un.Left],m0=(t,e)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:s,over:i,scrollableAncestors:a}}=e;if(QF.includes(t.code)){if(t.preventDefault(),!o||!n)return;let l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;let f=r.get(d.id);if(f)switch(t.code){case Un.Down:n.top<f.top&&l.push(d);break;case Un.Up:n.top>f.top&&l.push(d);break;case Un.Left:n.left>f.left&&l.push(d);break;case Un.Right:n.left<f.left&&l.push(d);break}});let c=MF({active:o,collisionRect:n,droppableRects:r,droppableContainers:l,pointerCoordinates:null}),u=BF(c,"id");if(u===i?.id&&c.length>1&&(u=c[1].id),u!=null){let d=s.get(o.id),f=s.get(u),m=f?r.get(f.id):null,h=f?.node.current;if(h&&m&&d&&f){let g=VF(h).some((S,w)=>a[w]!==S),b=f0(d,f),v=KF(d,f),x=g||!b?{x:0,y:0}:{x:v?n.width-m.width:0,y:v?n.height-m.height:0},y={x:m.left,y:m.top};return x.x&&x.y?y:r0(y,x)}}}};function f0(t,e){return!Hu(t)||!Hu(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function KF(t,e){return!Hu(t)||!Hu(e)||!f0(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}var Oi=t=>{let e=eA(17),{id:o,disabled:n}=t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={duration:250,easing:"cubic-bezier(0, 0.2, 0.2, 1)"},e[0]=r):r=e[0];let s;e[1]!==n||e[2]!==o?(s={id:o,disabled:n,transition:r},e[1]=n,e[2]=o,e[3]=s):s=e[3];let{attributes:i,isDragging:a,listeners:l,setNodeRef:c,transform:u,transition:d}=d0(s),f=a?"grabbing":"grab",m;e[4]!==f||e[5]!==d?(m={cursor:f,transition:d},e[4]=f,e[5]=d,e[6]=m):m=e[6];let h;e[7]!==i||e[8]!==m?(h={...i,style:m},e[7]=i,e[8]=m,e[9]=h):h=e[9];let p=u&&`translate3d(${u.x}px, ${u.y}px, 0)`,g;return e[10]!==a||e[11]!==l||e[12]!==c||e[13]!==h||e[14]!==p||e[15]!==d?(g={attributes:h,isDragging:a,listeners:l,setNodeRef:c,transform:p,transition:d},e[10]=a,e[11]=l,e[12]=c,e[13]=h,e[14]=p,e[15]=d,e[16]=g):g=e[16],g};var Jr=t=>{let e=tA(12),{id:o,children:n,disabled:r}=t,s;e[0]!==r||e[1]!==o?(s={id:o,disabled:r},e[0]=r,e[1]=o,e[2]=s):s=e[2];let{attributes:i,isDragging:a,listeners:l,setNodeRef:c,transform:u,transition:d}=Oi(s),f=a?"grabbing":"grab",m;return e[3]!==i||e[4]!==n||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==f||e[9]!==u||e[10]!==d?(m=oA(rA,{children:n({attributes:{...i,style:{cursor:f}},isDragging:a,listeners:l,setNodeRef:c,transform:u,transition:d})}),e[3]=i,e[4]=n,e[5]=a,e[6]=l,e[7]=c,e[8]=f,e[9]=u,e[10]=d,e[11]=m):m=e[11],m};import{c as nA}from"react/compiler-runtime";import{jsx as yp}from"react/jsx-runtime";import{closestCenter as sA,DndContext as iA,KeyboardSensor as aA,PointerSensor as lA,useDroppable as cA,useSensor as p0,useSensors as uA}from"@dnd-kit/core";import{useId as dA}from"react";var cr=t=>{let e=nA(18),{children:o,className:n,ids:r,onDragEnd:s,onDragStart:i}=t,a=dA(),l;e[0]!==a?(l={id:a},e[0]=a,e[1]=l):l=e[1];let{setNodeRef:c}=cA(l),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u={activationConstraint:{distance:5}},e[2]=u):u=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={coordinateGetter:m0},e[3]=d):d=e[3];let f=uA(p0(lA,u),p0(aA,d)),m;e[4]!==r||e[5]!==s?(m=v=>{let{active:x,over:y}=v;v.activatorEvent.stopPropagation(),!(!x||!y)&&typeof s=="function"&&s({event:v,moveFromIndex:r.findIndex(C=>C===x.id),moveToIndex:r.findIndex(C=>C===y.id)})},e[4]=r,e[5]=s,e[6]=m):m=e[6];let h=m,p;e[7]!==i?(p=v=>{let{active:x}=v;x&&typeof i=="function"&&i({id:x.id,event:v})},e[7]=i,e[8]=p):p=e[8];let g=p,b;return e[9]!==o||e[10]!==n||e[11]!==h||e[12]!==g||e[13]!==a||e[14]!==r||e[15]!==f||e[16]!==c?(b=yp(iA,{collisionDetection:sA,id:a,onDragEnd:h,onDragStart:g,sensors:f,children:yp(c0,{items:r,children:yp("div",{className:n,ref:c,children:o})})}),e[9]=o,e[10]=n,e[11]=h,e[12]=g,e[13]=a,e[14]=r,e[15]=f,e[16]=c,e[17]=b):b=e[17],b};import{jsx as h0,jsxs as mA}from"react/jsx-runtime";import"react";var Xu="error-pill",io=t=>{let{className:e,count:o,i18n:n,withMessage:r}=t,s=!r&&o<99,i=[Xu,s&&`${Xu}--fixed-width`,e&&e].filter(Boolean).join(" ");return o===0?null:h0("div",{className:i,children:mA("div",{className:`${Xu}__content`,children:[h0("span",{className:`${Xu}__count`,children:o}),r&&` ${o>1?n.t("general:errors"):n.t("general:error")}`]})})};import{c as fA}from"react/compiler-runtime";import{jsx as pA}from"react/jsx-runtime";import{getTranslation as hA}from"@payloadcms/translations";import"react";var g0="field-description",Be=t=>{let e=fA(8),{className:o,description:n,marginPlacement:r,path:s}=t,{i18n:i}=k();if(n){let a=`field-description-${s?.replace(/\./g,"__")}`,l=r&&`${g0}--margin-${r}`,c;e[0]!==o||e[1]!==a||e[2]!==l?(c=[g0,o,a,l].filter(Boolean),e[0]=o,e[1]=a,e[2]=l,e[3]=c):c=e[3];let u=c.join(" "),d;return e[4]!==n||e[5]!==i||e[6]!==u?(d=pA("div",{className:u,children:hA(n,i)}),e[4]=n,e[5]=i,e[6]=u,e[7]=d):d=e[7],d}return null};import{c as gA}from"react/compiler-runtime";import{jsx as bA}from"react/jsx-runtime";import"react";var vA="field-error",He=t=>{let e=gA(7),{alignCaret:o,message:n,path:r,showError:s}=t,i=o===void 0?"right":o,a=Xt(),l;e[0]!==r?(l=p=>{let[g]=p;return g&&g?.[r]||null},e[0]=r,e[1]=l):l=e[1];let c=Et(l),u;e[2]!==c?(u=c||{},e[2]=c,e[3]=u):u=e[3];let{errorMessage:d,valid:f}=u,m=n||d;if((s||a&&f===!1)&&m?.length){let p;return e[4]!==i||e[5]!==m?(p=bA(go,{alignCaret:i,className:vA,delay:0,staticPositioning:!0,children:m}),e[4]=i,e[5]=m,e[6]=p):p=e[6],p}return null};import{c as rE}from"react/compiler-runtime";import{jsx as nE,jsxs as ux}from"react/jsx-runtime";import{getTranslation as sE}from"@payloadcms/translations";import"react";import{c as xA}from"react/compiler-runtime";import{jsx as yA}from"react/jsx-runtime";import{createContext as CA,use as wA}from"react";var b0=CA(0),Ns=t=>{let e=xA(3),{children:o}=t,r=ct()+1,s;return e[0]!==o||e[1]!==r?(s=yA(b0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},ct=()=>wA(b0);import{c as JT}from"react/compiler-runtime";import{jsx as nx}from"react/jsx-runtime";import{useSearchParams as qT}from"next/navigation.js";import QT,{createContext as ix,use as ax,useEffect as sx,useRef as KT,useState as eE}from"react";var Yn=(t,e)=>!t?.locales||t.locales.length===0?null:t.locales.find(o=>o?.code===e);import{jsx as BT}from"react/jsx-runtime";import{jsx as Ap}from"react/jsx-runtime";import{useRef as F0,useEffect as ks,useState as Tp}from"react";import kA from"react-dom";function Se(){return Se=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)({}).hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},Se.apply(null,arguments)}function Mi(t,e){if(t==null)return{};var o={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;o[n]=t[n]}return o}function Bi(t,e){return Bi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,n){return o.__proto__=n,o},Bi(t,e)}function Uu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Bi(t,e)}function Cp(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function wp(t,e){t.classList?t.classList.add(e):Cp(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function v0(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Sp(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=v0(t.className,e):t.setAttribute("class",v0(t.className&&t.className.baseVal||"",e))}import y0 from"react";import Zu from"react";import Ju from"react-dom";var Ip={disabled:!1};import SA from"react";var Rp=SA.createContext(null);var Yu=function(e){return e.scrollTop};var dl="unmounted",Ls="exited",$s="entering",Gi="entered",_p="exiting",fn=function(t){Uu(e,t);function e(n,r){var s;s=t.call(this,n,r)||this;var i=r,a=i&&!i.isMounting?n.enter:n.appear,l;return s.appearStatus=null,n.in?a?(l=Ls,s.appearStatus=$s):l=Gi:n.unmountOnExit||n.mountOnEnter?l=dl:l=Ls,s.state={status:l},s.nextCallback=null,s}e.getDerivedStateFromProps=function(r,s){var i=r.in;return i&&s.status===dl?{status:Ls}:null};var o=e.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(r){var s=null;if(r!==this.props){var i=this.state.status;this.props.in?i!==$s&&i!==Gi&&(s=$s):(i===$s||i===Gi)&&(s=_p)}this.updateStatus(!1,s)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var r=this.props.timeout,s,i,a;return s=i=a=r,r!=null&&typeof r!="number"&&(s=r.exit,i=r.enter,a=r.appear!==void 0?r.appear:i),{exit:s,enter:i,appear:a}},o.updateStatus=function(r,s){if(r===void 0&&(r=!1),s!==null)if(this.cancelNextCallback(),s===$s){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:Ju.findDOMNode(this);i&&Yu(i)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ls&&this.setState({status:dl})},o.performEnter=function(r){var s=this,i=this.props.enter,a=this.context?this.context.isMounting:r,l=this.props.nodeRef?[a]:[Ju.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!r&&!i||Ip.disabled){this.safeSetState({status:Gi},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:$s},function(){s.props.onEntering(c,u),s.onTransitionEnd(f,function(){s.safeSetState({status:Gi},function(){s.props.onEntered(c,u)})})})},o.performExit=function(){var r=this,s=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:Ju.findDOMNode(this);if(!s||Ip.disabled){this.safeSetState({status:Ls},function(){r.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:_p},function(){r.props.onExiting(a),r.onTransitionEnd(i.exit,function(){r.safeSetState({status:Ls},function(){r.props.onExited(a)})})})},o.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(r,s){s=this.setNextCallback(s),this.setState(r,s)},o.setNextCallback=function(r){var s=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,s.nextCallback=null,r(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},o.onTransitionEnd=function(r,s){this.setNextCallback(s);var i=this.props.nodeRef?this.props.nodeRef.current:Ju.findDOMNode(this),a=r==null&&!this.props.addEndListener;if(!i||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},o.render=function(){var r=this.state.status;if(r===dl)return null;var s=this.props,i=s.children,a=s.in,l=s.mountOnEnter,c=s.unmountOnExit,u=s.appear,d=s.enter,f=s.exit,m=s.timeout,h=s.addEndListener,p=s.onEnter,g=s.onEntering,b=s.onEntered,v=s.onExit,x=s.onExiting,y=s.onExited,C=s.nodeRef,S=Mi(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Zu.createElement(Rp.Provider,{value:null},typeof i=="function"?i(r,S):Zu.cloneElement(Zu.Children.only(i),S))},e}(Zu.Component);fn.contextType=Rp;fn.propTypes={};function Vi(){}fn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vi,onEntering:Vi,onEntered:Vi,onExit:Vi,onExiting:Vi,onExited:Vi};fn.UNMOUNTED=dl;fn.EXITED=Ls;fn.ENTERING=$s;fn.ENTERED=Gi;fn.EXITING=_p;var x0=fn;var IA=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return wp(e,n)})},Dp=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return Sp(e,n)})},Fp=function(t){Uu(e,t);function e(){for(var n,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=t.call.apply(t,[this].concat(s))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(a,l){var c=n.resolveArguments(a,l),u=c[0],d=c[1];n.removeClasses(u,"exit"),n.addClass(u,d?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(a,l)},n.onEntering=function(a,l){var c=n.resolveArguments(a,l),u=c[0],d=c[1],f=d?"appear":"enter";n.addClass(u,f,"active"),n.props.onEntering&&n.props.onEntering(a,l)},n.onEntered=function(a,l){var c=n.resolveArguments(a,l),u=c[0],d=c[1],f=d?"appear":"enter";n.removeClasses(u,f),n.addClass(u,f,"done"),n.props.onEntered&&n.props.onEntered(a,l)},n.onExit=function(a){var l=n.resolveArguments(a),c=l[0];n.removeClasses(c,"appear"),n.removeClasses(c,"enter"),n.addClass(c,"exit","base"),n.props.onExit&&n.props.onExit(a)},n.onExiting=function(a){var l=n.resolveArguments(a),c=l[0];n.addClass(c,"exit","active"),n.props.onExiting&&n.props.onExiting(a)},n.onExited=function(a){var l=n.resolveArguments(a),c=l[0];n.removeClasses(c,"exit"),n.addClass(c,"exit","done"),n.props.onExited&&n.props.onExited(a)},n.resolveArguments=function(a,l){return n.props.nodeRef?[n.props.nodeRef.current,a]:[a,l]},n.getClassNames=function(a){var l=n.props.classNames,c=typeof l=="string",u=c&&l?l+"-":"",d=c?""+u+a:l[a],f=c?d+"-active":l[a+"Active"],m=c?d+"-done":l[a+"Done"];return{baseClassName:d,activeClassName:f,doneClassName:m}},n}var o=e.prototype;return o.addClass=function(r,s,i){var a=this.getClassNames(s)[i+"ClassName"],l=this.getClassNames("enter"),c=l.doneClassName;s==="appear"&&i==="done"&&c&&(a+=" "+c),i==="active"&&r&&Yu(r),a&&(this.appliedClasses[s][i]=a,IA(r,a))},o.removeClasses=function(r,s){var i=this.appliedClasses[s],a=i.base,l=i.active,c=i.done;this.appliedClasses[s]={},a&&Dp(r,a),l&&Dp(r,l),c&&Dp(r,c)},o.render=function(){var r=this.props,s=r.classNames,i=Mi(r,["classNames"]);return y0.createElement(x0,Se({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(y0.Component);Fp.defaultProps={classNames:""};Fp.propTypes={};var ml=Fp;function C0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}import{useContext as _A}from"react";import{createContext as RA}from"react";var qu=RA({});var ue=()=>_A(qu);var Qu=t=>t?{appear:`${t}--appear`,appearActive:`${t}--appearActive`,appearDone:`${t}--appearDone`,enter:`${t}--enter`,enterActive:`${t}--enterActive`,enterDone:`${t}--enterDone`,exit:`${t}--exit`,exitActive:`${t}--exitActive`,exitDone:`${t}--exitDone`}:{};wD();function w0(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,n)}return o}function S0(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?w0(Object(o),!0).forEach(function(n){DA(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):w0(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function DA(t,e,o){return e=AA(e),e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function FA(t,e){if(typeof t!="object"||t===null)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AA(t){var e=FA(t,"string");return typeof e=="symbol"?e:String(e)}var I0={activateTrap:function(e,o){if(e.length>0){var n=e[e.length-1];n!==o&&n.pause()}var r=e.indexOf(o);r===-1||e.splice(r,1),e.push(o)},deactivateTrap:function(e,o){var n=e.indexOf(o);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},TA=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},EA=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},pl=function(e){return e?.key==="Tab"||e?.keyCode===9},PA=function(e){return pl(e)&&!e.shiftKey},NA=function(e){return pl(e)&&e.shiftKey},R0=function(e){return setTimeout(e,0)},_0=function(e,o){var n=-1;return e.every(function(r,s){return o(r)?(n=s,!1):!0}),n},fl=function(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return typeof e=="function"?e.apply(void 0,n):e},Ku=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},LA=[],D0=function(e,o){var n=o?.document||document,r=o?.trapStack||LA,s=S0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:PA,isKeyBackward:NA},o),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function(R,I,E){return R&&R[I]!==void 0?R[I]:s[E||I]},c=function(R,I){var E=typeof I?.composedPath=="function"?I.composedPath():void 0;return i.containerGroups.findIndex(function(T){var $=T.container,j=T.tabbableNodes;return $.contains(R)||E?.includes($)||j.find(function(N){return N===R})})},u=function(R){var I=s[R];if(typeof I=="function"){for(var E=arguments.length,T=new Array(E>1?E-1:0),$=1;$<E;$++)T[$-1]=arguments[$];I=I.apply(void 0,T)}if(I===!0&&(I=void 0),!I){if(I===void 0||I===!1)return I;throw new Error("`".concat(R,"` was specified but was not a node, or did not return a node"))}var j=I;if(typeof I=="string"&&(j=n.querySelector(I),!j))throw new Error("`".concat(R,"` as selector refers to no known node"));return j},d=function(){var R=u("initialFocus");if(R===!1)return!1;if(R===void 0||!Cu(R,s.tabbableOptions))if(c(n.activeElement)>=0)R=n.activeElement;else{var I=i.tabbableGroups[0],E=I&&I.firstTabbableNode;R=E||u("fallbackFocus")}if(!R)throw new Error("Your focus-trap needs to have at least one focusable element");return R},f=function(){if(i.containerGroups=i.containers.map(function(R){var I=dv(R,s.tabbableOptions),E=mv(R,s.tabbableOptions),T=I.length>0?I[0]:void 0,$=I.length>0?I[I.length-1]:void 0,j=E.find(function(L){return Fs(L)}),N=E.slice().reverse().find(function(L){return Fs(L)}),P=!!I.find(function(L){return Li(L)>0});return{container:R,tabbableNodes:I,focusableNodes:E,posTabIndexesFound:P,firstTabbableNode:T,lastTabbableNode:$,firstDomTabbableNode:j,lastDomTabbableNode:N,nextTabbableNode:function(V){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,O=I.indexOf(V);return O<0?M?E.slice(E.indexOf(V)+1).find(function(B){return Fs(B)}):E.slice(0,E.indexOf(V)).reverse().find(function(B){return Fs(B)}):I[O+(M?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(R){return R.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(R){return R.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function F(R){var I=R.activeElement;if(I)return I.shadowRoot&&I.shadowRoot.activeElement!==null?F(I.shadowRoot):I},h=function F(R){if(R!==!1&&R!==m(document)){if(!R||!R.focus){F(d());return}R.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=R,TA(R)&&R.select()}},p=function(R){var I=u("setReturnFocus",R);return I||(I===!1?!1:R)},g=function(R){var I=R.target,E=R.event,T=R.isBackward,$=T===void 0?!1:T;I=I||Ku(E),f();var j=null;if(i.tabbableGroups.length>0){var N=c(I,E),P=N>=0?i.containerGroups[N]:void 0;if(N<0)$?j=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:j=i.tabbableGroups[0].firstTabbableNode;else if($){var L=_0(i.tabbableGroups,function(X){var Z=X.firstTabbableNode;return I===Z});if(L<0&&(P.container===I||Cu(I,s.tabbableOptions)&&!Fs(I,s.tabbableOptions)&&!P.nextTabbableNode(I,!1))&&(L=N),L>=0){var V=L===0?i.tabbableGroups.length-1:L-1,M=i.tabbableGroups[V];j=Li(I)>=0?M.lastTabbableNode:M.lastDomTabbableNode}else pl(E)||(j=P.nextTabbableNode(I,!1))}else{var O=_0(i.tabbableGroups,function(X){var Z=X.lastTabbableNode;return I===Z});if(O<0&&(P.container===I||Cu(I,s.tabbableOptions)&&!Fs(I,s.tabbableOptions)&&!P.nextTabbableNode(I))&&(O=N),O>=0){var B=O===i.tabbableGroups.length-1?0:O+1,G=i.tabbableGroups[B];j=Li(I)>=0?G.firstTabbableNode:G.firstDomTabbableNode}else pl(E)||(j=P.nextTabbableNode(I))}}else j=u("fallbackFocus");return j},b=function(R){var I=Ku(R);if(!(c(I,R)>=0)){if(fl(s.clickOutsideDeactivates,R)){a.deactivate({returnFocus:s.returnFocusOnDeactivate});return}fl(s.allowOutsideClick,R)||R.preventDefault()}},v=function(R){var I=Ku(R),E=c(I,R)>=0;if(E||I instanceof Document)E&&(i.mostRecentlyFocusedNode=I);else{R.stopImmediatePropagation();var T,$=!0;if(i.mostRecentlyFocusedNode)if(Li(i.mostRecentlyFocusedNode)>0){var j=c(i.mostRecentlyFocusedNode),N=i.containerGroups[j].tabbableNodes;if(N.length>0){var P=N.findIndex(function(L){return L===i.mostRecentlyFocusedNode});P>=0&&(s.isKeyForward(i.recentNavEvent)?P+1<N.length&&(T=N[P+1],$=!1):P-1>=0&&(T=N[P-1],$=!1))}}else i.containerGroups.some(function(L){return L.tabbableNodes.some(function(V){return Li(V)>0})})||($=!1);else $=!1;$&&(T=g({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),h(T||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},x=function(R){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=R;var E=g({event:R,isBackward:I});E&&(pl(R)&&R.preventDefault(),h(E))},y=function(R){if(EA(R)&&fl(s.escapeDeactivates,R)!==!1){R.preventDefault(),a.deactivate();return}(s.isKeyForward(R)||s.isKeyBackward(R))&&x(R,s.isKeyBackward(R))},C=function(R){var I=Ku(R);c(I,R)>=0||fl(s.clickOutsideDeactivates,R)||fl(s.allowOutsideClick,R)||(R.preventDefault(),R.stopImmediatePropagation())},S=function(){if(i.active)return I0.activateTrap(r,a),i.delayInitialFocusTimer=s.delayInitialFocus?R0(function(){h(d())}):h(d()),n.addEventListener("focusin",v,!0),n.addEventListener("mousedown",b,{capture:!0,passive:!1}),n.addEventListener("touchstart",b,{capture:!0,passive:!1}),n.addEventListener("click",C,{capture:!0,passive:!1}),n.addEventListener("keydown",y,{capture:!0,passive:!1}),a},w=function(){if(i.active)return n.removeEventListener("focusin",v,!0),n.removeEventListener("mousedown",b,!0),n.removeEventListener("touchstart",b,!0),n.removeEventListener("click",C,!0),n.removeEventListener("keydown",y,!0),a},D=function(R){var I=R.some(function(E){var T=Array.from(E.removedNodes);return T.some(function($){return $===i.mostRecentlyFocusedNode})});I&&h(d())},_=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(D):void 0,A=function(){_&&(_.disconnect(),i.active&&!i.paused&&i.containers.map(function(R){_.observe(R,{subtree:!0,childList:!0})}))};return a={get active(){return i.active},get paused(){return i.paused},activate:function(R){if(i.active)return this;var I=l(R,"onActivate"),E=l(R,"onPostActivate"),T=l(R,"checkCanFocusTrap");T||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=n.activeElement,I?.();var $=function(){T&&f(),S(),A(),E?.()};return T?(T(i.containers.concat()).then($,$),this):($(),this)},deactivate:function(R){if(!i.active)return this;var I=S0({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},R);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,w(),i.active=!1,i.paused=!1,A(),I0.deactivateTrap(r,a);var E=l(I,"onDeactivate"),T=l(I,"onPostDeactivate"),$=l(I,"checkCanReturnFocus"),j=l(I,"returnFocus","returnFocusOnDeactivate");E?.();var N=function(){R0(function(){j&&h(p(i.nodeFocusedBeforeActivation)),T?.()})};return j&&$?($(p(i.nodeFocusedBeforeActivation)).then(N,N),this):(N(),this)},pause:function(R){if(i.paused||!i.active)return this;var I=l(R,"onPause"),E=l(R,"onPostPause");return i.paused=!0,I?.(),w(),A(),E?.(),this},unpause:function(R){if(!i.paused||!i.active)return this;var I=l(R,"onUnpause"),E=l(R,"onPostUnpause");return i.paused=!1,I?.(),f(),S(),A(),E?.(),this},updateContainerElements:function(R){var I=[].concat(R).filter(Boolean);return i.containers=I.map(function(E){return typeof E=="string"?n.querySelector(E):E}),i.active&&f(),A(),this}},a.updateContainerElements(e),a};var $A=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(o[n[r]]=t[n[r]]);return o},pn="modal-item",A0=(t,e)=>n=>{let r=ue(),s=F0(null),[i,a]=Tp(!1),l=F0(!1),[c,u]=Tp(null),{modalState:d,classPrefix:f,containerRef:m,transTime:h,setCloseOnBlur:p,setBodyScrollLock:g,openModal:b}=r,{className:v,htmlElement:x="dialog",slug:y="",closeOnBlur:C=!0,lockBodyScroll:S=!0,classPrefix:w,onEnter:D,onEntering:_,onEntered:A,onExit:F,onExiting:R,onExited:I,openOnInit:E,trapFocus:T=!0,focusTrapOptions:$={}}=n,j=$A(n,["className","htmlElement","slug","closeOnBlur","lockBodyScroll","classPrefix","onEnter","onEntering","onEntered","onExit","onExiting","onExited","openOnInit","trapFocus","focusTrapOptions"]),N=w||f,P=e||y,L=d[P]&&d[P].isOpen;ks(()=>{if(T){let O=s.current;if(l.current===!1&&O){let B=D0(O,Object.assign(Object.assign({},$),{fallbackFocus:$?.fallbackFocus||O,allowOutsideClick:typeof $.allowOutsideClick<"u"?$.allowOutsideClick:!0}));u(B),l.current=!0}}},[T,i,$]),ks(()=>{a(!0)},[]),ks(()=>(c&&(L?c.activate():c.deactivate()),()=>{c&&c.deactivate()}),[L,c]),ks(()=>{L&&p(C)},[L,C,p]),ks(()=>{let O=s.current;return O&&g(!!(L&&S),O),()=>{O&&g(!1,O)}},[L,S,g]);let[V,M]=Tp(L);if(ks(()=>{L?M(L):setTimeout(()=>M(!1),h)},[L,h]),ks(()=>{E&&b(P)},[P,E,b]),m.current){let O=N?`${N}__${pn}`:pn,B=[O,`${O}--slug-${P}`,v].filter(Boolean).join(" "),G=Object.assign({role:x!=="dialog"?"dialog":void 0,open:x==="dialog"?V||L:void 0,"aria-modal":!0,"aria-label":j["aria-labelledby"]?void 0:P},j);return kA.createPortal(Ap(ml,{nodeRef:s,timeout:h,in:L,classNames:Qu(O),appear:!0,onEnter:D,onEntering:_,onEntered:A,onExit:F,onExiting:R,onExited:I,children:Ap(x,Object.assign({ref:s,id:j?.id||P,className:B},G,{children:Ap(t,Object.assign({},n,{isOpen:L,modal:r}))}))}),m.current)}return null};import{jsx as T0}from"react/jsx-runtime";import{Fragment as E0}from"react";var jA=t=>{let{children:e}=t;return e?typeof e=="function"?T0(E0,{children:e(t)}):T0(E0,{children:e}):null},Yo=A0(jA);import{jsx as P0}from"react/jsx-runtime";var OA=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(o[n[r]]=t[n[r]]);return o},hn="modal-container",Ep=t=>{let{oneModalIsOpen:e,classPrefix:o,transTime:n,setContainerRef:r,containerRef:s,closeAllModals:i,closeOnBlur:a}=ue(),{className:l,htmlElement:c="div",children:u,onClick:d}=t,f=OA(t,["className","htmlElement","children","onClick"]),m=o?`${o}__${hn}`:hn,h=[m,l].filter(Boolean).join(" "),p=Object.assign(Object.assign({},f),{onClick:g=>{a&&i(),typeof d=="function"&&d(g)}});return P0(ml,{nodeRef:s,in:e,timeout:n,classNames:Qu(m),appear:!0,children:P0(c,Object.assign({className:h,ref:r},p,{children:u&&u}))})};import{jsx as M0,jsxs as XA}from"react/jsx-runtime";import{Fragment as UA,useState as rd,useRef as B0,useEffect as nd,useCallback as Zn,useReducer as YA}from"react";function MA(t){if(Array.isArray(t)){for(var e=0,o=Array(t.length);e<t.length;e++)o[e]=t[e];return o}else return Array.from(t)}var Np=!1;typeof window<"u"&&(Pp={get passive(){Np=!0}},window.addEventListener("testPassive",null,Pp),window.removeEventListener("testPassive",null,Pp));var Pp,ed=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),Os=[],td=!1,N0=-1,hl=void 0,js=void 0,gl=void 0,L0=function(e){return Os.some(function(o){return!!(o.options.allowTouchMove&&o.options.allowTouchMove(e))})},od=function(e){var o=e||window.event;return L0(o.target)||o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)},BA=function(e){if(gl===void 0){var o=!!e&&e.reserveScrollBarGap===!0,n=window.innerWidth-document.documentElement.clientWidth;if(o&&n>0){var r=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);gl=document.body.style.paddingRight,document.body.style.paddingRight=r+n+"px"}}hl===void 0&&(hl=document.body.style.overflow,document.body.style.overflow="hidden")},VA=function(){gl!==void 0&&(document.body.style.paddingRight=gl,gl=void 0),hl!==void 0&&(document.body.style.overflow=hl,hl=void 0)},GA=function(){return window.requestAnimationFrame(function(){if(js===void 0){js={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var e=window,o=e.scrollY,n=e.scrollX,r=e.innerHeight;document.body.style.position="fixed",document.body.style.top=-o,document.body.style.left=-n,setTimeout(function(){return window.requestAnimationFrame(function(){var s=r-window.innerHeight;s&&o>=r&&(document.body.style.top=-(o+s))})},300)}})},WA=function(){if(js!==void 0){var e=-parseInt(document.body.style.top,10),o=-parseInt(document.body.style.left,10);document.body.style.position=js.position,document.body.style.top=js.top,document.body.style.left=js.left,window.scrollTo(o,e),js=void 0}},HA=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},zA=function(e,o){var n=e.targetTouches[0].clientY-N0;return L0(e.target)?!1:o&&o.scrollTop===0&&n>0||HA(o)&&n<0?od(e):(e.stopPropagation(),!0)},$0=function(e,o){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Os.some(function(r){return r.targetElement===e})){var n={targetElement:e,options:o||{}};Os=[].concat(MA(Os),[n]),ed?GA():BA(o),ed&&(e.ontouchstart=function(r){r.targetTouches.length===1&&(N0=r.targetTouches[0].clientY)},e.ontouchmove=function(r){r.targetTouches.length===1&&zA(r,e)},td||(document.addEventListener("touchmove",od,Np?{passive:!1}:void 0),td=!0))}};var k0=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Os=Os.filter(function(o){return o.targetElement!==e}),ed&&(e.ontouchstart=null,e.ontouchmove=null,td&&Os.length===0&&(document.removeEventListener("touchmove",od,Np?{passive:!1}:void 0),td=!1)),ed?WA():VA()};var j0=({classPrefix:t,zIndex:e})=>{let o=t?`${t}__`:"";return`
|
|
13
|
+
import{a as Wf,b as H,c as Hf,d as St,e as SD,f as ID,g as zf,h as RD,i as _D}from"./chunk-QPA2ZA5J.js";import{a as pt,b as ol,c as Gf,d as k,e as Li,f as dv,g as mv,h as Fs,i as Cu,j as wD,k as fv,l as DD,m as FD,n as AD}from"./chunk-OA4JPMVI.js";import{c as Sr,d as uv,e as Ds}from"./chunk-5LKBKI4T.js";var Sv=Sr(bt=>{"use strict";function Zf(t,e){var o=t.length;t.push(e);e:for(;0<o;){var n=o-1>>>1,r=t[n];if(0<wu(r,e))t[n]=e,t[o]=r,o=n;else break e}}function Ir(t){return t.length===0?null:t[0]}function Iu(t){if(t.length===0)return null;var e=t[0],o=t.pop();if(o!==e){t[0]=o;e:for(var n=0,r=t.length,s=r>>>1;n<s;){var i=2*(n+1)-1,a=t[i],l=i+1,c=t[l];if(0>wu(a,o))l<r&&0>wu(c,a)?(t[n]=c,t[l]=o,n=l):(t[n]=a,t[i]=o,n=i);else if(l<r&&0>wu(c,o))t[n]=c,t[l]=o,n=l;else break e}}return e}function wu(t,e){var o=t.sortIndex-e.sortIndex;return o!==0?o:t.id-e.id}bt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(pv=performance,bt.unstable_now=function(){return pv.now()}):(Xf=Date,hv=Xf.now(),bt.unstable_now=function(){return Xf.now()-hv});var pv,Xf,hv,Zr=[],Wn=[],TD=1,ar=null,yo=3,Ru=!1,As=!1,nl=!1,vv=typeof setTimeout=="function"?setTimeout:null,xv=typeof clearTimeout=="function"?clearTimeout:null,gv=typeof setImmediate<"u"?setImmediate:null;function Su(t){for(var e=Ir(Wn);e!==null;){if(e.callback===null)Iu(Wn);else if(e.startTime<=t)Iu(Wn),e.sortIndex=e.expirationTime,Zf(Zr,e);else break;e=Ir(Wn)}}function Jf(t){if(nl=!1,Su(t),!As)if(Ir(Zr)!==null)As=!0,qf();else{var e=Ir(Wn);e!==null&&Qf(Jf,e.startTime-t)}}var _u=!1,sl=-1,yv=5,Cv=-1;function wv(){return!(bt.unstable_now()-Cv<yv)}function Uf(){if(_u){var t=bt.unstable_now();Cv=t;var e=!0;try{e:{As=!1,nl&&(nl=!1,xv(sl),sl=-1),Ru=!0;var o=yo;try{t:{for(Su(t),ar=Ir(Zr);ar!==null&&!(ar.expirationTime>t&&wv());){var n=ar.callback;if(typeof n=="function"){ar.callback=null,yo=ar.priorityLevel;var r=n(ar.expirationTime<=t);if(t=bt.unstable_now(),typeof r=="function"){ar.callback=r,Su(t),e=!0;break t}ar===Ir(Zr)&&Iu(Zr),Su(t)}else Iu(Zr);ar=Ir(Zr)}if(ar!==null)e=!0;else{var s=Ir(Wn);s!==null&&Qf(Jf,s.startTime-t),e=!1}}break e}finally{ar=null,yo=o,Ru=!1}e=void 0}}finally{e?rl():_u=!1}}}var rl;typeof gv=="function"?rl=function(){gv(Uf)}:typeof MessageChannel<"u"?(Yf=new MessageChannel,bv=Yf.port2,Yf.port1.onmessage=Uf,rl=function(){bv.postMessage(null)}):rl=function(){vv(Uf,0)};var Yf,bv;function qf(){_u||(_u=!0,rl())}function Qf(t,e){sl=vv(function(){t(bt.unstable_now())},e)}bt.unstable_IdlePriority=5;bt.unstable_ImmediatePriority=1;bt.unstable_LowPriority=4;bt.unstable_NormalPriority=3;bt.unstable_Profiling=null;bt.unstable_UserBlockingPriority=2;bt.unstable_cancelCallback=function(t){t.callback=null};bt.unstable_continueExecution=function(){As||Ru||(As=!0,qf())};bt.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):yv=0<t?Math.floor(1e3/t):5};bt.unstable_getCurrentPriorityLevel=function(){return yo};bt.unstable_getFirstCallbackNode=function(){return Ir(Zr)};bt.unstable_next=function(t){switch(yo){case 1:case 2:case 3:var e=3;break;default:e=yo}var o=yo;yo=e;try{return t()}finally{yo=o}};bt.unstable_pauseExecution=function(){};bt.unstable_requestPaint=function(){};bt.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var o=yo;yo=t;try{return e()}finally{yo=o}};bt.unstable_scheduleCallback=function(t,e,o){var n=bt.unstable_now();switch(typeof o=="object"&&o!==null?(o=o.delay,o=typeof o=="number"&&0<o?n+o:n):o=n,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=o+r,t={id:TD++,callback:e,priorityLevel:t,startTime:o,expirationTime:r,sortIndex:-1},o>n?(t.sortIndex=o,Zf(Wn,t),Ir(Zr)===null&&t===Ir(Wn)&&(nl?(xv(sl),sl=-1):nl=!0,Qf(Jf,o-n))):(t.sortIndex=r,Zf(Zr,t),As||Ru||(As=!0,qf())),t};bt.unstable_shouldYield=wv;bt.unstable_wrapCallback=function(t){var e=yo;return function(){var o=yo;yo=e;try{return t.apply(this,arguments)}finally{yo=o}}}});var Rv=Sr((ZW,Iv)=>{"use strict";Iv.exports=Sv()});var yC=Sr(dt=>{"use strict";var lo=typeof Symbol=="function"&&Symbol.for,Ah=lo?Symbol.for("react.element"):60103,Th=lo?Symbol.for("react.portal"):60106,jd=lo?Symbol.for("react.fragment"):60107,Od=lo?Symbol.for("react.strict_mode"):60108,Md=lo?Symbol.for("react.profiler"):60114,Bd=lo?Symbol.for("react.provider"):60109,Vd=lo?Symbol.for("react.context"):60110,Eh=lo?Symbol.for("react.async_mode"):60111,Gd=lo?Symbol.for("react.concurrent_mode"):60111,Wd=lo?Symbol.for("react.forward_ref"):60112,Hd=lo?Symbol.for("react.suspense"):60113,d6=lo?Symbol.for("react.suspense_list"):60120,zd=lo?Symbol.for("react.memo"):60115,Xd=lo?Symbol.for("react.lazy"):60116,m6=lo?Symbol.for("react.block"):60121,f6=lo?Symbol.for("react.fundamental"):60117,p6=lo?Symbol.for("react.responder"):60118,h6=lo?Symbol.for("react.scope"):60119;function er(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Ah:switch(t=t.type,t){case Eh:case Gd:case jd:case Md:case Od:case Hd:return t;default:switch(t=t&&t.$$typeof,t){case Vd:case Wd:case Xd:case zd:case Bd:return t;default:return e}}case Th:return e}}}function xC(t){return er(t)===Gd}dt.AsyncMode=Eh;dt.ConcurrentMode=Gd;dt.ContextConsumer=Vd;dt.ContextProvider=Bd;dt.Element=Ah;dt.ForwardRef=Wd;dt.Fragment=jd;dt.Lazy=Xd;dt.Memo=zd;dt.Portal=Th;dt.Profiler=Md;dt.StrictMode=Od;dt.Suspense=Hd;dt.isAsyncMode=function(t){return xC(t)||er(t)===Eh};dt.isConcurrentMode=xC;dt.isContextConsumer=function(t){return er(t)===Vd};dt.isContextProvider=function(t){return er(t)===Bd};dt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ah};dt.isForwardRef=function(t){return er(t)===Wd};dt.isFragment=function(t){return er(t)===jd};dt.isLazy=function(t){return er(t)===Xd};dt.isMemo=function(t){return er(t)===zd};dt.isPortal=function(t){return er(t)===Th};dt.isProfiler=function(t){return er(t)===Md};dt.isStrictMode=function(t){return er(t)===Od};dt.isSuspense=function(t){return er(t)===Hd};dt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===jd||t===Gd||t===Md||t===Od||t===Hd||t===d6||typeof t=="object"&&t!==null&&(t.$$typeof===Xd||t.$$typeof===zd||t.$$typeof===Bd||t.$$typeof===Vd||t.$$typeof===Wd||t.$$typeof===f6||t.$$typeof===p6||t.$$typeof===h6||t.$$typeof===m6)};dt.typeOf=er});var wC=Sr((Mse,CC)=>{"use strict";CC.exports=yC()});var AC=Sr((Bse,FC)=>{"use strict";var Ph=wC(),g6={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},b6={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},v6={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_C={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Nh={};Nh[Ph.ForwardRef]=v6;Nh[Ph.Memo]=_C;function SC(t){return Ph.isMemo(t)?_C:Nh[t.$$typeof]||g6}var x6=Object.defineProperty,y6=Object.getOwnPropertyNames,IC=Object.getOwnPropertySymbols,C6=Object.getOwnPropertyDescriptor,w6=Object.getPrototypeOf,RC=Object.prototype;function DC(t,e,o){if(typeof e!="string"){if(RC){var n=w6(e);n&&n!==RC&&DC(t,n,o)}var r=y6(e);IC&&(r=r.concat(IC(e)));for(var s=SC(t),i=SC(e),a=0;a<r.length;++a){var l=r[a];if(!b6[l]&&!(o&&o[l])&&!(i&&i[l])&&!(s&&s[l])){var c=C6(e,l);try{x6(t,l,c)}catch{}}}}return t}FC.exports=DC});var fg=Sr((wue,W2)=>{var mg=Math.floor(Math.random()*16777215),O2=ht.index=parseInt(Math.random()*16777215,10),M2=(typeof process>"u"||typeof process.pid!="number"?Math.floor(Math.random()*1e5):process.pid)%65535,B2=(()=>{try{return _Buffer}catch{try{return Buffer}catch{return null}}})(),lm=function(t){return!!(t!=null&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))},G2=[];for(Go=0;Go<256;Go++)G2[Go]=(Go<=15?"0":"")+Go.toString(16);var Go,V2=new RegExp("^[0-9a-fA-F]{24}$"),rc=[];Go=0;for(;Go<10;)rc[48+Go]=Go++;for(;Go<16;)rc[55+Go]=rc[87+Go]=Go++;function ht(t){if(!(this instanceof ht))return new ht(t);if(t&&(t instanceof ht||t._bsontype==="ObjectID"))return t;if(this._bsontype="ObjectID",t==null||typeof t=="number"){this.id=this.generate(t);return}var e=ht.isValid(t);if(!e&&t!=null)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(e&&typeof t=="string"&&t.length===24)return ht.createFromHexString(t);if(t!=null&&t.length===12)this.id=t;else{if(t!=null&&typeof t.toHexString=="function")return t;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}}W2.exports=ht;ht.default=ht;ht.createFromTime=function(t){return t=parseInt(t,10)%4294967295,new ht(g9(8,t)+"0000000000000000")};ht.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var e="",o=0;o<24;)e+=String.fromCharCode(rc[t.charCodeAt(o++)]<<4|rc[t.charCodeAt(o++)]);return new ht(e)};ht.isValid=function(t){return t==null?!1:typeof t=="number"?!0:typeof t=="string"?t.length===12||t.length===24&&V2.test(t):t instanceof ht?!0:lm(t)?ht.isValid(t.toString("hex")):typeof t.toHexString=="function"&&B2&&(t.id instanceof B2||typeof t.id=="string")?t.id.length===12||t.id.length===24&&V2.test(t.id):!1};ht.prototype={constructor:ht,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(this.id.length===24)return this.id;if(lm(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=G2[this.id.charCodeAt(e)];return t},equals:function(t){return t instanceof ht?this.toString()===t.toString():typeof t=="string"&&ht.isValid(t)&&t.length===12&&lm(this.id)?t===this.id.toString("binary"):typeof t=="string"&&ht.isValid(t)&&t.length===24?t.toLowerCase()===this.toHexString():typeof t=="string"&&ht.isValid(t)&&t.length===12?t===this.id:t!=null&&(t instanceof ht||t.toHexString)?t.toHexString()===this.toHexString():!1},getTimestamp:function(){var t=new Date,e;return lm(this.id)?e=this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:e=this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(Math.floor(e)*1e3),t},generate:function(t){typeof t!="number"&&(t=~~(Date.now()/1e3)),t=parseInt(t,10)%4294967295;var e=h9();return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255,mg>>16&255,mg>>8&255,mg&255,M2>>8&255,M2&255,e>>16&255,e>>8&255,e&255)}};function h9(){return O2=(O2+1)%16777215}function g9(t,e){return e=e.toString(16),e.length===t?e:"00000000".substring(e.length,t)+e}var b9=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";ht.prototype[b9]=function(){return"ObjectID("+this+")"};ht.prototype.toJSON=ht.prototype.toHexString;ht.prototype.toString=ht.prototype.toHexString});var eb=Sr((kve,yS)=>{function Kg(t){return t===void 0}function pk(t){return t===null}function hk(t){return typeof t=="boolean"}function Pm(t){return t===Object(t)}function vS(t){return Array.isArray(t)}function gk(t){return t instanceof Date}function xS(t,e){return e?Pm(t)&&!Kg(t.uri):Pm(t)&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.slice=="function"}function bk(t,e){return xS(t,e)&&typeof t.name=="string"&&(Pm(t.lastModifiedDate)||typeof t.lastModified=="number")}function ci(t){return Kg(t)?!1:t}function Qg(t,e,o,n){e=e||{},o=o||new FormData,e.indices=ci(e.indices),e.nullsAsUndefineds=ci(e.nullsAsUndefineds),e.booleansAsIntegers=ci(e.booleansAsIntegers),e.allowEmptyArrays=ci(e.allowEmptyArrays),e.noAttributesWithArrayNotation=ci(e.noAttributesWithArrayNotation),e.noFilesWithArrayNotation=ci(e.noFilesWithArrayNotation),e.dotsForObjectNotation=ci(e.dotsForObjectNotation);let r=typeof o.getParts=="function";return Kg(t)||(pk(t)?e.nullsAsUndefineds||o.append(n,""):hk(t)?e.booleansAsIntegers?o.append(n,t?1:0):o.append(n,t):vS(t)?t.length?t.forEach((s,i)=>{let a=n+"["+(e.indices?i:"")+"]";(e.noAttributesWithArrayNotation||e.noFilesWithArrayNotation&&bk(s,r))&&(a=n),Qg(s,e,o,a)}):e.allowEmptyArrays&&o.append(e.noAttributesWithArrayNotation?n:n+"[]",""):gk(t)?o.append(n,t.toISOString()):Pm(t)&&!xS(t,r)?Object.keys(t).forEach(s=>{let i=t[s];if(vS(i))for(;s.length>2&&s.lastIndexOf("[]")===s.length-2;)s=s.substring(0,s.length-2);let a=n?e.dotsForObjectNotation?n+"."+s:n+"["+s+"]":s;Qg(i,e,o,a)}):o.append(n,t)),o}yS.exports={serialize:Qg}});var y4=Sr((BFe,x4)=>{(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(o,n){return o<<n|o>>>32-n},rotr:function(o,n){return o<<32-n|o>>>n},endian:function(o){if(o.constructor==Number)return e.rotl(o,8)&16711935|e.rotl(o,24)&4278255360;for(var n=0;n<o.length;n++)o[n]=e.endian(o[n]);return o},randomBytes:function(o){for(var n=[];o>0;o--)n.push(Math.floor(Math.random()*256));return n},bytesToWords:function(o){for(var n=[],r=0,s=0;r<o.length;r++,s+=8)n[s>>>5]|=o[r]<<24-s%32;return n},wordsToBytes:function(o){for(var n=[],r=0;r<o.length*32;r+=8)n.push(o[r>>>5]>>>24-r%32&255);return n},bytesToHex:function(o){for(var n=[],r=0;r<o.length;r++)n.push((o[r]>>>4).toString(16)),n.push((o[r]&15).toString(16));return n.join("")},hexToBytes:function(o){for(var n=[],r=0;r<o.length;r+=2)n.push(parseInt(o.substr(r,2),16));return n},bytesToBase64:function(o){for(var n=[],r=0;r<o.length;r+=3)for(var s=o[r]<<16|o[r+1]<<8|o[r+2],i=0;i<4;i++)r*8+i*6<=o.length*8?n.push(t.charAt(s>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(o){o=o.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],r=0,s=0;r<o.length;s=++r%4)s!=0&&n.push((t.indexOf(o.charAt(r-1))&Math.pow(2,-2*s+8)-1)<<s*2|t.indexOf(o.charAt(r))>>>6-s*2);return n}};x4.exports=e})()});var Wb=Sr((VFe,C4)=>{var Gb={utf8:{stringToBytes:function(t){return Gb.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Gb.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],o=0;o<t.length;o++)e.push(t.charCodeAt(o)&255);return e},bytesToString:function(t){for(var e=[],o=0;o<t.length;o++)e.push(String.fromCharCode(t[o]));return e.join("")}}};C4.exports=Gb});var I4=Sr((GFe,S4)=>{S4.exports=function(t){return t!=null&&(w4(t)||FB(t)||!!t._isBuffer)};function w4(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function FB(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&w4(t.slice(0,0))}});var _4=Sr((WFe,R4)=>{(function(){var t=y4(),e=Wb().utf8,o=I4(),n=Wb().bin,r=function(s,i){s.constructor==String?i&&i.encoding==="binary"?s=n.stringToBytes(s):s=e.stringToBytes(s):o(s)?s=Array.prototype.slice.call(s,0):!Array.isArray(s)&&s.constructor!==Uint8Array&&(s=s.toString());for(var a=t.bytesToWords(s),l=s.length*8,c=1732584193,u=-271733879,d=-1732584194,f=271733878,m=0;m<a.length;m++)a[m]=(a[m]<<8|a[m]>>>24)&16711935|(a[m]<<24|a[m]>>>8)&4278255360;a[l>>>5]|=128<<l%32,a[(l+64>>>9<<4)+14]=l;for(var h=r._ff,p=r._gg,g=r._hh,b=r._ii,m=0;m<a.length;m+=16){var v=c,x=u,y=d,C=f;c=h(c,u,d,f,a[m+0],7,-680876936),f=h(f,c,u,d,a[m+1],12,-389564586),d=h(d,f,c,u,a[m+2],17,606105819),u=h(u,d,f,c,a[m+3],22,-1044525330),c=h(c,u,d,f,a[m+4],7,-176418897),f=h(f,c,u,d,a[m+5],12,1200080426),d=h(d,f,c,u,a[m+6],17,-1473231341),u=h(u,d,f,c,a[m+7],22,-45705983),c=h(c,u,d,f,a[m+8],7,1770035416),f=h(f,c,u,d,a[m+9],12,-1958414417),d=h(d,f,c,u,a[m+10],17,-42063),u=h(u,d,f,c,a[m+11],22,-1990404162),c=h(c,u,d,f,a[m+12],7,1804603682),f=h(f,c,u,d,a[m+13],12,-40341101),d=h(d,f,c,u,a[m+14],17,-1502002290),u=h(u,d,f,c,a[m+15],22,1236535329),c=p(c,u,d,f,a[m+1],5,-165796510),f=p(f,c,u,d,a[m+6],9,-1069501632),d=p(d,f,c,u,a[m+11],14,643717713),u=p(u,d,f,c,a[m+0],20,-373897302),c=p(c,u,d,f,a[m+5],5,-701558691),f=p(f,c,u,d,a[m+10],9,38016083),d=p(d,f,c,u,a[m+15],14,-660478335),u=p(u,d,f,c,a[m+4],20,-405537848),c=p(c,u,d,f,a[m+9],5,568446438),f=p(f,c,u,d,a[m+14],9,-1019803690),d=p(d,f,c,u,a[m+3],14,-187363961),u=p(u,d,f,c,a[m+8],20,1163531501),c=p(c,u,d,f,a[m+13],5,-1444681467),f=p(f,c,u,d,a[m+2],9,-51403784),d=p(d,f,c,u,a[m+7],14,1735328473),u=p(u,d,f,c,a[m+12],20,-1926607734),c=g(c,u,d,f,a[m+5],4,-378558),f=g(f,c,u,d,a[m+8],11,-2022574463),d=g(d,f,c,u,a[m+11],16,1839030562),u=g(u,d,f,c,a[m+14],23,-35309556),c=g(c,u,d,f,a[m+1],4,-1530992060),f=g(f,c,u,d,a[m+4],11,1272893353),d=g(d,f,c,u,a[m+7],16,-155497632),u=g(u,d,f,c,a[m+10],23,-1094730640),c=g(c,u,d,f,a[m+13],4,681279174),f=g(f,c,u,d,a[m+0],11,-358537222),d=g(d,f,c,u,a[m+3],16,-722521979),u=g(u,d,f,c,a[m+6],23,76029189),c=g(c,u,d,f,a[m+9],4,-640364487),f=g(f,c,u,d,a[m+12],11,-421815835),d=g(d,f,c,u,a[m+15],16,530742520),u=g(u,d,f,c,a[m+2],23,-995338651),c=b(c,u,d,f,a[m+0],6,-198630844),f=b(f,c,u,d,a[m+7],10,1126891415),d=b(d,f,c,u,a[m+14],15,-1416354905),u=b(u,d,f,c,a[m+5],21,-57434055),c=b(c,u,d,f,a[m+12],6,1700485571),f=b(f,c,u,d,a[m+3],10,-1894986606),d=b(d,f,c,u,a[m+10],15,-1051523),u=b(u,d,f,c,a[m+1],21,-2054922799),c=b(c,u,d,f,a[m+8],6,1873313359),f=b(f,c,u,d,a[m+15],10,-30611744),d=b(d,f,c,u,a[m+6],15,-1560198380),u=b(u,d,f,c,a[m+13],21,1309151649),c=b(c,u,d,f,a[m+4],6,-145523070),f=b(f,c,u,d,a[m+11],10,-1120210379),d=b(d,f,c,u,a[m+2],15,718787259),u=b(u,d,f,c,a[m+9],21,-343485551),c=c+v>>>0,u=u+x>>>0,d=d+y>>>0,f=f+C>>>0}return t.endian([c,u,d,f])};r._ff=function(s,i,a,l,c,u,d){var f=s+(i&a|~i&l)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._gg=function(s,i,a,l,c,u,d){var f=s+(i&l|a&~l)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._hh=function(s,i,a,l,c,u,d){var f=s+(i^a^l)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._ii=function(s,i,a,l,c,u,d){var f=s+(a^(i|~l))+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._blocksize=16,r._digestsize=16,R4.exports=function(s,i){if(s==null)throw new Error("Illegal argument "+s);var a=t.wordsToBytes(r(s,i));return i&&i.asBytes?a:i&&i.asString?n.bytesToString(a):t.bytesToHex(a)}})()});import{jsx as sp}from"react/jsx-runtime";import"react";function oe({CustomComponent:t,Fallback:e}){return t!==void 0?t:e}import{jsx as WD}from"react/jsx-runtime";import Av from"react";import{createContext as Hn,use as zn}from"react";var il=Ds(Rv(),1);import{createElement as ED,createContext as PD,useContext as ND,useEffect as LD,useLayoutEffect as $D,useReducer as kD,useRef as Kf,useState as jD}from"react";var Du=Symbol(),OD=Symbol(),MD=typeof window>"u"||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent),_v=MD?LD:$D,BD=il.unstable_runWithPriority?t=>{try{(0,il.unstable_runWithPriority)(il.unstable_NormalPriority,t)}catch(e){if(e.message==="Not implemented.")t();else throw e}}:t=>t(),VD=t=>({value:o,children:n})=>{let r=Kf(o),s=Kf(0),[i,a]=jD(null);i&&(i(o),a(null));let l=Kf();if(!l.current){let c=new Set,u=(d,f)=>{s.current+=1;let m={n:s.current};f?.suspense&&(m.n*=-1,m.p=new Promise(h=>{a(()=>p=>{m.v=p,delete m.p,h(p)})})),c.forEach(h=>h(m)),d()};l.current={[Du]:{v:r,n:s,l:c,u}}}return _v(()=>{r.current=o,s.current+=1,BD(()=>{l.current[Du].l.forEach(c=>{c({n:s.current,v:o})})})},[o]),ED(t,{value:l.current},n)},GD=t=>t;function Dv(t){let e=PD({[Du]:{v:{current:t},n:{current:-1},l:new Set,u:o=>o()}});return e[OD]=e.Provider,e.Provider=VD(e.Provider),delete e.Consumer,e}function ep(t,e){let o=ND(t)[Du],{v:{current:n},n:{current:r},l:s}=o,i=e(n),[a,l]=kD((c,u)=>{if(!u)return[n,i];if("p"in u)throw u.p;if(u.n===r)return Object.is(c[1],i)?c:[n,i];try{if("v"in u){if(Object.is(c[0],u.v))return c;let d=e(u.v);return Object.is(c[1],d)?c:[u.v,d]}}catch{}return[...c]},[n,i]);return Object.is(a[1],i)||l(),_v(()=>(s.add(l),()=>{s.delete(l)}),[s]),a[1]}function Fv(t){return ep(t,GD)}var Fu=Hn({}),Au=Hn({}),Tu=Hn({}),Eu=Hn(!1),Pu=Hn(!1),tp=Hn(!1),Nu=Hn(!1),op=Hn(!1),al=Dv([{},()=>null]),Oe=()=>zn(Fu),$i=()=>zn(Au),Lu=()=>zn(Tu),Xt=()=>zn(Eu),lr=()=>zn(Pu),rp=()=>zn(tp),Ut=()=>zn(Nu),Ts=()=>zn(op),Et=t=>ep(al,t),ki=()=>Fv(al);var Tv=Av.createContext({data:{},path:"",rowNumber:void 0}),np=({children:t,path:e,rowNumber:o})=>{"use no memo";let{getDataByPath:n,getSiblingData:r}=Lu(),s=r(e),a=n(e)||s;return WD(Tv,{value:{data:a,path:e,rowNumber:o},children:t})},HD=()=>Av.use(Tv);var zD="row-label",dn=t=>{let{className:e,CustomComponent:o,label:n,path:r,rowNumber:s}=t;return sp(np,{path:r,rowNumber:s,children:sp(oe,{CustomComponent:o,Fallback:typeof n=="string"?sp("span",{className:[zD,e].filter(Boolean).join(" "),style:{pointerEvents:"none"},children:n}):n})})};import{c as iM}from"react/compiler-runtime";import{jsx as uo,jsxs as vi}from"react/jsx-runtime";import{getTranslation as Fb}from"@payloadcms/translations";import aM from"react";import{jsx as lp,jsxs as rF}from"react/jsx-runtime";import kv from"react";import{jsx as KD}from"react/jsx-runtime";import $v from"next/link.js";import{useRouter as eF}from"next/navigation.js";import"react";import{c as XD}from"react/compiler-runtime";import{jsx as UD}from"react/jsx-runtime";import ip,{startTransition as YD,useEffect as ZD,useOptimistic as JD,useRef as Ev}from"react";var ap=t=>{let e=XD(11),{children:o}=t,[n,r]=JD(!1),[s,i]=ip.useState(0),a=Ev(s),l=Ev(null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{l.current=setInterval(()=>{let g=a.current+(.93-a.current)*Math.random()*.2*Math.pow(Math.log(1+(1-a.current)*.75),.75);i(g),a.current=g},250)},e[0]=c):c=e[0];let u=c,d,f;e[1]!==n?(d=()=>{i(0),a.current=0,n?u():l.current&&clearInterval(l.current)},f=[n,u],e[1]=n,e[2]=d,e[3]=f):(d=e[2],f=e[3]),ZD(d,f);let m;e[4]!==r?(m=g=>{YD(()=>{r(!0),typeof g=="function"&&g()})},e[4]=r,e[5]=m):m=e[5];let h=m,p;return e[6]!==o||e[7]!==n||e[8]!==h||e[9]!==s?(p=UD(Pv,{value:{isTransitioning:n,startRouteTransition:h,transitionProgress:s},children:o}),e[6]=o,e[7]=n,e[8]=h,e[9]=s,e[10]=p):p=e[10],p},Pv=ip.createContext({isTransitioning:!1,startRouteTransition:()=>{},transitionProgress:0}),st=()=>ip.use(Pv);var qD=/https?|ftp|gopher|file/;function Nv(t){return typeof t=="string"||typeof t=="number"&&!isNaN(t)||typeof t=="boolean"?String(t):""}function QD(t){let e=new URLSearchParams;return Object.entries(t).forEach(([o,n])=>{Array.isArray(n)?n.forEach(r=>e.append(o,Nv(r))):e.set(o,Nv(n))}),e}function Lv(t){let{auth:e}=t,{hostname:o}=t,n=t.protocol||"",r=t.pathname||"",s=t.hash||"",i=t.query||"",a=!1;e=e?encodeURIComponent(e).replace(/%3A/i,":")+"@":"",t.host?a=e+t.host:o&&(a=e+(~o.indexOf(":")?`[${o}]`:o),t.port&&(a+=":"+t.port)),i&&typeof i=="object"&&(i=String(QD(i)));let l=t.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),t.slashes||(!n||qD.test(n))&&a!==!1?(a="//"+(a||""),r&&r[0]!=="/"&&(r="/"+r)):a||(a=""),s&&s[0]!=="#"&&(s="#"+s),l&&l[0]!=="?"&&(l="?"+l),r=r.replace(/[?#]/g,encodeURIComponent),l=l.replace("#","%23"),`${n}${a}${r}${l}${s}`}var tF=$v.default||$v;function oF(t){let o=t.currentTarget.getAttribute("target");return o&&o!=="_self"||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&t.nativeEvent.which===2}var no=({children:t,href:e,onClick:o,preventDefault:n=!0,ref:r,replace:s,scroll:i,...a})=>{let l=eF(),{startRouteTransition:c}=st();return KD(tF,{href:e,onClick:u=>{oF(u)||(o&&o(u),n&&u.preventDefault(),c(()=>{let d=typeof e=="string"?e:Lv(e);s?l.replace(d,{scroll:i}):l.push(d,{scroll:i})}))},ref:r,...a,children:t})};var Es="banner",Rr=({type:t="default",alignIcon:e="right",children:o,className:n,icon:r,onClick:s,to:i})=>{let a=[Es,`${Es}--type-${t}`,n&&n,i&&`${Es}--has-link`,(i||s)&&`${Es}--has-action`,r&&`${Es}--has-icon`,r&&`${Es}--align-icon-${e}`].filter(Boolean).join(" "),l="div";return s&&!i&&(l="button"),i&&(l=no),rF(l,{className:a,href:i||null,onClick:s,children:[r&&e==="left"&&lp(kv.Fragment,{children:r}),lp("span",{className:`${Es}__content`,children:o}),r&&e==="right"&&lp(kv.Fragment,{children:r})]})};import{jsx as Uo,jsxs as Bu}from"react/jsx-runtime";import wF,{Fragment as SF,isValidElement as IF}from"react";import{jsx as jv}from"react/jsx-runtime";import"react";var Ze=({ariaLabel:t,className:e,direction:o,size:n})=>jv("svg",{"aria-label":t,className:["icon icon--chevron",e,n&&`icon--size-${n}`].filter(Boolean).join(" "),height:"100%",style:{transform:o==="left"?"rotate(90deg)":o==="right"?"rotate(-90deg)":o==="up"?"rotate(180deg)":void 0},viewBox:"0 0 20 20",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:jv("path",{className:"stroke",d:"M14 8L10 12L6 8",strokeLinecap:"square"})});import{jsx as Ov}from"react/jsx-runtime";import"react";var _r=({className:t})=>Ov("svg",{className:[t,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Ov("path",{className:"stroke",d:"M9.68531 4.62938H5.2634C4.92833 4.62938 4.60698 4.76248 4.37004 4.99942C4.13311 5.23635 4 5.5577 4 5.89278V14.7366C4 15.0717 4.13311 15.393 4.37004 15.63C4.60698 15.8669 4.92833 16 5.2634 16H14.1072C14.4423 16 14.7636 15.8669 15.0006 15.63C15.2375 15.393 15.3706 15.0717 15.3706 14.7366V10.3147M13.7124 4.39249C13.9637 4.14118 14.3046 4 14.66 4C15.0154 4 15.3562 4.14118 15.6075 4.39249C15.8588 4.6438 16 4.98464 16 5.34004C16 5.69544 15.8588 6.03629 15.6075 6.28759L9.91399 11.9817C9.76399 12.1316 9.57868 12.2413 9.37515 12.3008L7.56027 12.8314C7.50591 12.8472 7.44829 12.8482 7.39344 12.8341C7.33859 12.8201 7.28853 12.7915 7.24849 12.7515C7.20845 12.7115 7.17991 12.6614 7.16586 12.6066C7.15181 12.5517 7.15276 12.4941 7.16861 12.4397L7.69924 10.6249C7.75896 10.4215 7.86888 10.2364 8.01888 10.0866L13.7124 4.39249Z",strokeLinecap:"square"})});import{jsx as Mv}from"react/jsx-runtime";import"react";var cp=()=>Mv("svg",{"aria-hidden":"true",className:"graphic link icon icon--link",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Mv("path",{className:"stroke",d:"M7.99999 13.3333H6.66666C5.78261 13.3333 4.93476 12.9821 4.30964 12.357C3.68452 11.7319 3.33333 10.884 3.33333 9.99999C3.33333 9.11593 3.68452 8.26809 4.30964 7.64297C4.93476 7.01785 5.78261 6.66666 6.66666 6.66666H7.99999M12 6.66666H13.3333C14.2174 6.66666 15.0652 7.01785 15.6904 7.64297C16.3155 8.26809 16.6667 9.11593 16.6667 9.99999C16.6667 10.884 16.3155 11.7319 15.6904 12.357C15.0652 12.9821 14.2174 13.3333 13.3333 13.3333H12M7.33333 9.99999H12.6667",strokeLinecap:"square"})});import{jsx as Bv}from"react/jsx-runtime";import"react";var jo=()=>Bv("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Bv("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})});import{jsx as Vv}from"react/jsx-runtime";import"react";var up=()=>Vv("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Vv("path",{className:"stroke",d:"M7.33334 4L4.66667 6.66667M4.66667 6.66667L7.33334 9.33333M4.66667 6.66667H15.3333M12.6667 16L15.3333 13.3333M15.3333 13.3333L12.6667 10.6667M15.3333 13.3333H4.66667",strokeLinecap:"square"})});import{jsx as Ps,jsxs as pp}from"react/jsx-runtime";var Me={};uv(Me,{Button:()=>mp,ButtonGroup:()=>dp,Divider:()=>Gv,GroupLabel:()=>$u});import{jsx as ku}from"react/jsx-runtime";import"react";import{jsx as nF}from"react/jsx-runtime";import"react";var sF="popup-divider",Gv=()=>nF("hr",{className:sF});import{jsx as iF}from"react/jsx-runtime";import"react";var aF="popup-list-group-label",$u=({label:t})=>iF("p",{className:aF,children:t});var ll="popup-button-list",dp=({buttonSize:t="default",children:e,className:o,textAlign:n="left"})=>{let r=[ll,o,`${ll}__text-align--${n}`,`${ll}__button-size--${t}`].filter(Boolean).join(" ");return ku("div",{className:r,children:e})},mp=({id:t,active:e,children:o,className:n,disabled:r,href:s,onClick:i})=>{let a=[`${ll}__button`,e&&`${ll}__button--selected`,n].filter(Boolean).join(" ");if(!r){if(s)return ku(no,{className:a,href:s,id:t,onClick:l=>{i&&i(l)},prefetch:!1,children:o});if(i)return ku("button",{className:a,id:t,onClick:l=>{i&&i(l)},type:"button",children:o})}return ku("div",{className:a,id:t,children:o})};var Xn={};uv(Xn,{WindowInfo:()=>zv,WindowInfoContext:()=>ji,WindowInfoProvider:()=>Yv,useWindowInfo:()=>Co,withWindowInfo:()=>Zv});import{useContext as cF}from"react";import{createContext as lF}from"react";var ji=lF({});var Co=()=>cF(ji);import Wv,{Fragment as Hv}from"react";var zv=t=>{let{children:e}=t,o=Co();return e?typeof e=="function"?Wv.createElement(Hv,null,e(o)):Wv.createElement(Hv,null,e):null};import uF,{useCallback as Xv,useEffect as Uv,useReducer as dF,useRef as mF}from"react";var fF=(t,e)=>{let{payload:{breakpoints:o,animationRef:n}}=e;n.current=null;let{eventsFired:r}=t,{documentElement:{style:s,clientWidth:i,clientHeight:a}}=document,{innerWidth:l,innerHeight:c}=window,u=`${i/100}px`,d=`${a/100}px`,f=o?Object.keys(o).reduce((h,p)=>Object.assign(Object.assign({},h),{[p]:window.matchMedia(o[p]).matches}),{}):{},m={width:l,height:c,"--vw":u,"--vh":d,breakpoints:f,eventsFired:r+1};return s.setProperty("--vw",u),s.setProperty("--vh",d),m},Yv=t=>{let{breakpoints:e,children:o}=t,n=mF(null),[r,s]=dF(fF,{width:void 0,height:void 0,"--vw":"","--vh":"",breakpoints:{},eventsFired:0}),i=Xv(()=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}}))},[e]),a=Xv(()=>{setTimeout(()=>{i()},500)},[i]);return Uv(()=>(window.addEventListener("resize",i),window.addEventListener("orientationchange",a),()=>{window.removeEventListener("resize",i),window.removeEventListener("orientationchange",a)}),[i,a]),Uv(()=>{r.eventsFired===0&&s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}})},[e,r]),uF.createElement(ji.Provider,{value:Object.assign({},r)},o&&o)};import pF from"react";var Zv=t=>o=>{let n=Co();return pF.createElement(t,Object.assign({},o,{windowInfo:n}))};import{useCallback as Qv,useEffect as ju,useRef as vF,useState as hp}from"react";import{c as hF}from"react/compiler-runtime";import{useEffect as gF,useRef as bF,useState as Jv}from"react";var mn=(t,e)=>{let o=hF(14),n;o[0]!==t?(n=t===void 0?{}:t,o[0]=t,o[1]=n):n=o[1];let{root:r,rootMargin:s,threshold:i}=n,a=r===void 0?null:r,l=s===void 0?"0px":s,c=i===void 0?0:i,[u,d]=Jv(),[f,m]=Jv(null),h;o[2]!==e||o[3]!==a||o[4]!==l||o[5]!==c?(h=typeof window<"u"&&"IntersectionObserver"in window&&!e?new window.IntersectionObserver(x=>{let[y]=x;return d(y)},{root:a,rootMargin:l,threshold:c}):null,o[2]=e,o[3]=a,o[4]=l,o[5]=c,o[6]=h):h=o[6];let p=bF(h),g,b;o[7]!==e||o[8]!==f?(g=()=>{if(e)return;let{current:x}=p;return x.disconnect(),f&&x.observe(f),()=>x.disconnect()},b=[f,e],o[7]=e,o[8]=f,o[9]=g,o[10]=b):(g=o[9],b=o[10]),gF(g,b);let v;return o[11]!==u||o[12]!==f?(v=[m,u,f],o[11]=u,o[12]=f,o[13]=v):v=o[13],v};import{jsx as qv}from"react/jsx-runtime";import"react";var cl="popup-button",fp=t=>{let{active:e,button:o,buttonType:n,className:r,disabled:s,noBackground:i,setActive:a,size:l}=t,c=[cl,r,`${cl}--${n}`,!i&&`${cl}--background`,l&&`${cl}--size-${l}`,s&&`${cl}--disabled`].filter(Boolean).join(" "),u=()=>{a(!e)};return n==="none"?null:n==="custom"?qv("div",{className:c,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},role:"button",tabIndex:0,children:o}):qv("button",{className:c,disabled:s,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},tabIndex:0,type:"button",children:o})};var Oo="popup",ho=t=>{let{id:e,boundingRef:o,button:n,buttonClassName:r,buttonSize:s,buttonType:i="default",caret:a=!0,children:l,className:c,disabled:u,forceOpen:d,horizontalAlign:f="left",initActive:m=!1,noBackground:h,onToggleOpen:p,render:g,showOnHover:b=!1,showScrollbar:v=!1,size:x="medium",verticalAlign:y="top"}=t,{height:C,width:S}=Co(),[w,D]=mn({root:o?.current||null,rootMargin:"-100px 0px 0px 0px",threshold:1}),_=vF(null),[A,F]=hp(m),[R,I]=hp(y),[E,T]=hp(f),$=Qv(({horizontal:P=!1,vertical:L=!1})=>{if(_.current){let V=_.current.getBoundingClientRect(),{bottom:M,left:O,right:B,top:G}=V,X=100,Z=document.documentElement.clientWidth,te=document.documentElement.clientHeight,U=0;o?.current&&({bottom:te,left:U,right:Z,top:X}=o.current.getBoundingClientRect()),P&&(B>Z&&O>U?T("right"):O<U&&B<Z&&T("left")),L&&(G<X&&M<te?I("bottom"):M>te&&G>X&&I("top"))}},[o]),j=Qv(P=>{_.current.contains(P.target)||F(!1)},[_]);ju(()=>{$({horizontal:!0})},[D,$,S]),ju(()=>{$({vertical:!0})},[D,$,C]),ju(()=>(typeof p=="function"&&p(A),A?document.addEventListener("mousedown",j):document.removeEventListener("mousedown",j),()=>{document.removeEventListener("mousedown",j)}),[A,j,p]),ju(()=>{F(d)},[d]);let N=[Oo,c,`${Oo}--size-${x}`,s&&`${Oo}--button-size-${s}`,`${Oo}--v-align-${R}`,`${Oo}--h-align-${E}`,A&&`${Oo}--active`,v&&`${Oo}--show-scrollbar`].filter(Boolean).join(" ");return pp("div",{className:N,id:e,children:[Ps("div",{className:`${Oo}__trigger-wrap`,children:b?Ps("div",{className:`${Oo}__on-hover-watch`,onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),children:Ps(fp,{active:A,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:F,size:s})}):Ps(fp,{active:A,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:F,size:s})}),pp("div",{className:`${Oo}__content`,ref:_,children:[Ps("div",{className:`${Oo}__hide-scrollbar`,ref:w,children:Ps("div",{className:`${Oo}__scroll-container`,children:pp("div",{className:`${Oo}__scroll-content`,children:[g&&g({close:()=>F(!1)}),l]})})}),a&&Ps("div",{className:`${Oo}__caret`})]})]})};import{c as xF}from"react/compiler-runtime";import{jsx as Ou,jsxs as yF}from"react/jsx-runtime";import gp,{useEffect as Kv}from"react";var go=t=>{let e=xF(26),{alignCaret:o,boundingRef:n,children:r,className:s,delay:i,position:a,show:l,staticPositioning:c}=t,u=o===void 0?"center":o,d=i===void 0?350:i,f=l===void 0?!0:l,m=c===void 0?!1:c,[h,p]=gp.useState(f),[g,b]=gp.useState("top"),v=CF,x=n?.current||null,y;e[0]!==x?(y={root:x,rootMargin:"-145px 0px 0px 100px",threshold:0},e[0]=x,e[1]=y):y=e[1];let[C,S]=mn(y,m),w,D;e[2]!==d||e[3]!==f?(w=()=>{let R;return d&&f?R=setTimeout(()=>{p(f)},d):p(f),()=>{R&&clearTimeout(R)}},D=[f,d],e[2]=d,e[3]=f,e[4]=w,e[5]=D):(w=e[4],D=e[5]),Kv(w,D);let _;e[6]!==S?.isIntersecting||e[7]!==m?(_=()=>{m||b(S?.isIntersecting?"top":"bottom")},e[6]=S?.isIntersecting,e[7]=m,e[8]=_):_=e[8];let A;e[9]!==S||e[10]!==m?(A=[S,m],e[9]=S,e[10]=m,e[11]=A):A=e[11],Kv(_,A);let F;if(e[12]!==u||e[13]!==r||e[14]!==s||e[15]!==g||e[16]!==a||e[17]!==C||e[18]!==h||e[19]!==m){let R=h&&"tooltip--show",I=`tooltip--caret-${u}`,E=`tooltip--position-${a||g}`,T;e[21]!==s||e[22]!==R||e[23]!==I||e[24]!==E?(T=["tooltip",s,R,I,E].filter(Boolean),e[21]=s,e[22]=R,e[23]=I,e[24]=E,e[25]=T):T=e[25],F=yF(gp.Fragment,{children:[!m&&Ou("aside",{"aria-hidden":"true",className:["tooltip",s,`tooltip--caret-${u}`,"tooltip--position-top"].filter(Boolean).join(" "),ref:C,style:{opacity:"0"},children:Ou("div",{className:"tooltip-content",children:r})}),Ou("aside",{className:T.join(" "),title:v(r),children:Ou("div",{className:"tooltip-content",children:r})})]}),e[12]=u,e[13]=r,e[14]=s,e[15]=g,e[16]=a,e[17]=C,e[18]=h,e[19]=m,e[20]=F}else F=e[20];return F};function CF(t){return typeof t=="string"?t:""}var RF={chevron:Ze,edit:_r,link:cp,plus:jo,swap:up,x:pt},so="btn",Mu=({children:t,icon:e,showTooltip:o,tooltip:n})=>{let r=RF[e];return Bu(SF,{children:[n&&Uo(go,{className:`${so}__tooltip`,show:o,children:n}),Bu("span",{className:`${so}__content`,children:[t&&Uo("span",{className:`${so}__label`,children:t}),e&&Bu("span",{className:`${so}__icon`,children:[IF(e)&&e,r&&Uo(r,{})]})]})]})},ne=t=>{let{id:e,type:o="button","aria-label":n,buttonStyle:r="primary",children:s,className:i,disabled:a,el:l="button",enableSubMenu:c,icon:u,iconPosition:d="right",iconStyle:f="without-border",newTab:m,onClick:h,onMouseDown:p,ref:g,round:b,size:v="medium",SubMenuPopupContent:x,to:y,tooltip:C,url:S}=t,[w,D]=wF.useState(!1),_=[so,i&&i,u&&`${so}--icon`,f&&`${so}--icon-style-${f}`,u&&!s&&`${so}--icon-only`,v&&`${so}--size-${v}`,u&&d&&`${so}--icon-position-${d}`,C&&`${so}--has-tooltip`,!x&&`${so}--withoutPopup`].filter(Boolean).join(" ");function A(T){D(!1),o!=="submit"&&h&&T.preventDefault(),h&&h(T)}let F=[r&&`${so}--style-${r}`,a&&`${so}--disabled`,b&&`${so}--round`,x?`${so}--withPopup`:`${so}--withoutPopup`].filter(Boolean).join(" "),R={id:e,type:o,"aria-disabled":a,"aria-label":n,className:x?_:[_,F].join(" "),disabled:a,onClick:a?void 0:A,onMouseDown:a?void 0:p,onPointerEnter:C?()=>D(!0):void 0,onPointerLeave:C?()=>D(!1):void 0,rel:m?"noopener noreferrer":void 0,target:m?"_blank":void 0},I,E;switch(l){case"anchor":I=Uo("a",{...R,href:a?void 0:S,ref:g,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})});break;case"link":a&&(I=Uo("div",{...R,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})})),I=Uo(no,{...R,href:y||S,prefetch:E,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})});break;default:I=Uo(l,{ref:g,type:"submit",...R,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})});break}return x?Bu("div",{className:F,children:[I,Uo(ho,{button:Uo(Ze,{}),buttonSize:v,className:a&&!c?`${so}--popup-disabled`:"",disabled:a&&!c,horizontalAlign:"right",id:`${e}-popup`,noBackground:!0,render:({close:T})=>x({close:()=>T()}),size:"large",verticalAlign:"bottom"})]}):I};import{c as tA}from"react/compiler-runtime";import{jsx as oA}from"react/jsx-runtime";import{Fragment as rA}from"react";import{c as eA}from"react/compiler-runtime";import s0,{useMemo as Gu,useRef as xp,useEffect as Wu,useState as NF,useContext as LF}from"react";import{useDndContext as $F,getClientRect as kF,useDroppable as jF,useDraggable as OF,closestCorners as MF,getFirstCollision as BF,getScrollableAncestors as VF,KeyboardCode as Un}from"@dnd-kit/core";import{useMemo as e0,useLayoutEffect as _F,useEffect as DF,useRef as sX,useCallback as iX}from"react";function t0(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e0(()=>n=>{e.forEach(r=>r(n))},e)}var FF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function AF(t){let e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function TF(t){return"nodeType"in t}function EF(t){var e,o;return t?AF(t)?t:TF(t)&&(e=(o=t.ownerDocument)==null?void 0:o.defaultView)!=null?e:window:window}var vp=FF?_F:DF;var bp={};function o0(t,e){return e0(()=>{if(e)return e;let o=bp[t]==null?0:bp[t]+1;return bp[t]=o,t+"-"+o},[t,e])}function PF(t){return function(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return n.reduce((s,i)=>{let a=Object.entries(i);for(let[l,c]of a){let u=s[l];u!=null&&(s[l]=u+t*c)}return s},{...e})}}var r0=PF(-1);function n0(t){if(!t)return!1;let{KeyboardEvent:e}=EF(t.target);return e&&t instanceof e}var ul=Object.freeze({Translate:{toString(t){if(!t)return;let{x:e,y:o}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:e,scaleY:o}=t;return"scaleX("+e+") scaleY("+o+")"}},Transform:{toString(t){if(t)return[ul.Translate.toString(t),ul.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:o,easing:n}=t;return e+" "+o+"ms "+n}}});function zu(t,e,o){let n=t.slice();return n.splice(o<0?n.length+o:o,0,n.splice(e,1)[0]),n}function GF(t,e){return t.reduce((o,n,r)=>{let s=e.get(n);return s&&(o[r]=s),o},Array(t.length))}function Vu(t){return t!==null&&t>=0}function WF(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}function HF(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}var i0=t=>{let{rects:e,activeIndex:o,overIndex:n,index:r}=t,s=zu(e,n,o),i=e[r],a=s[r];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}};var a0="Sortable",l0=s0.createContext({activeIndex:-1,containerId:a0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:i0,disabled:{draggable:!1,droppable:!1}});function c0(t){let{children:e,id:o,items:n,strategy:r=i0,disabled:s=!1}=t,{active:i,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=$F(),d=o0(a0,o),f=a.rect!==null,m=Gu(()=>n.map(S=>typeof S=="object"&&"id"in S?S.id:S),[n]),h=i!=null,p=i?m.indexOf(i.id):-1,g=c?m.indexOf(c.id):-1,b=xp(m),v=!WF(m,b.current),x=g!==-1&&p===-1||v,y=HF(s);vp(()=>{v&&h&&u(m)},[v,m,h,u]),Wu(()=>{b.current=m},[m]);let C=Gu(()=>({activeIndex:p,containerId:d,disabled:y,disableTransforms:x,items:m,overIndex:g,useDragOverlay:f,sortedRects:GF(m,l),strategy:r}),[p,d,y.draggable,y.droppable,x,m,g,l,f,r]);return s0.createElement(l0.Provider,{value:C},e)}var zF=t=>{let{id:e,items:o,activeIndex:n,overIndex:r}=t;return zu(o,n,r).indexOf(e)},XF=t=>{let{containerId:e,isSorting:o,wasDragging:n,index:r,items:s,newIndex:i,previousItems:a,previousContainerId:l,transition:c}=t;return!c||!n||a!==s&&r===i?!1:o?!0:i!==r&&e===l},UF={duration:200,easing:"ease"},u0="transform",YF=ul.Transition.toString({property:u0,duration:0,easing:"linear"}),ZF={roleDescription:"sortable"};function JF(t){let{disabled:e,index:o,node:n,rect:r}=t,[s,i]=NF(null),a=xp(o);return vp(()=>{if(!e&&o!==a.current&&n.current){let l=r.current;if(l){let c=kF(n.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&i(u)}}o!==a.current&&(a.current=o)},[e,o,n,r]),Wu(()=>{s&&i(null)},[s]),s}function d0(t){let{animateLayoutChanges:e=XF,attributes:o,disabled:n,data:r,getNewIndex:s=zF,id:i,strategy:a,resizeObserverConfig:l,transition:c=UF}=t,{items:u,containerId:d,activeIndex:f,disabled:m,disableTransforms:h,sortedRects:p,overIndex:g,useDragOverlay:b,strategy:v}=LF(l0),x=qF(n,m),y=u.indexOf(i),C=Gu(()=>({sortable:{containerId:d,index:y,items:u},...r}),[d,r,y,u]),S=Gu(()=>u.slice(u.indexOf(i)),[u,i]),{rect:w,node:D,isOver:_,setNodeRef:A}=jF({id:i,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...l}}),{active:F,activatorEvent:R,activeNodeRect:I,attributes:E,setNodeRef:T,listeners:$,isDragging:j,over:N,setActivatorNodeRef:P,transform:L}=OF({id:i,data:C,attributes:{...ZF,...o},disabled:x.draggable}),V=t0(A,T),M=!!F,O=M&&!h&&Vu(f)&&Vu(g),B=!b&&j,G=B&&O?L:null,Z=O?G??(a??v)({rects:p,activeNodeRect:I,activeIndex:f,overIndex:g,index:y}):null,te=Vu(f)&&Vu(g)?s({id:i,items:u,activeIndex:f,overIndex:g}):y,U=F?.id,z=xp({activeId:U,items:u,newIndex:te,containerId:d}),ce=u!==z.current.items,J=e({active:F,containerId:d,isDragging:j,isSorting:M,id:i,index:y,items:u,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:c,wasDragging:z.current.activeId!=null}),ue=JF({disabled:!J,index:y,node:D,rect:w});return Wu(()=>{M&&z.current.newIndex!==te&&(z.current.newIndex=te),d!==z.current.containerId&&(z.current.containerId=d),u!==z.current.items&&(z.current.items=u)},[M,te,d,u]),Wu(()=>{if(U===z.current.activeId)return;if(U&&!z.current.activeId){z.current.activeId=U;return}let q=setTimeout(()=>{z.current.activeId=U},50);return()=>clearTimeout(q)},[U]),{active:F,activeIndex:f,attributes:E,data:C,rect:w,index:y,newIndex:te,items:u,isOver:_,isSorting:M,isDragging:j,listeners:$,node:D,overIndex:g,over:N,setNodeRef:V,setActivatorNodeRef:P,setDroppableNodeRef:A,setDraggableNodeRef:T,transform:ue??Z,transition:re()};function re(){if(ue||ce&&z.current.newIndex===y)return YF;if(!(B&&!n0(R)||!c)&&(M||J))return ul.Transition.toString({...c,property:u0})}}function qF(t,e){var o,n;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(o=t?.draggable)!=null?o:e.draggable,droppable:(n=t?.droppable)!=null?n:e.droppable}}function Hu(t){if(!t)return!1;let e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}var QF=[Un.Down,Un.Right,Un.Up,Un.Left],m0=(t,e)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:s,over:i,scrollableAncestors:a}}=e;if(QF.includes(t.code)){if(t.preventDefault(),!o||!n)return;let l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;let f=r.get(d.id);if(f)switch(t.code){case Un.Down:n.top<f.top&&l.push(d);break;case Un.Up:n.top>f.top&&l.push(d);break;case Un.Left:n.left>f.left&&l.push(d);break;case Un.Right:n.left<f.left&&l.push(d);break}});let c=MF({active:o,collisionRect:n,droppableRects:r,droppableContainers:l,pointerCoordinates:null}),u=BF(c,"id");if(u===i?.id&&c.length>1&&(u=c[1].id),u!=null){let d=s.get(o.id),f=s.get(u),m=f?r.get(f.id):null,h=f?.node.current;if(h&&m&&d&&f){let g=VF(h).some((S,w)=>a[w]!==S),b=f0(d,f),v=KF(d,f),x=g||!b?{x:0,y:0}:{x:v?n.width-m.width:0,y:v?n.height-m.height:0},y={x:m.left,y:m.top};return x.x&&x.y?y:r0(y,x)}}}};function f0(t,e){return!Hu(t)||!Hu(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function KF(t,e){return!Hu(t)||!Hu(e)||!f0(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}var Oi=t=>{let e=eA(17),{id:o,disabled:n}=t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={duration:250,easing:"cubic-bezier(0, 0.2, 0.2, 1)"},e[0]=r):r=e[0];let s;e[1]!==n||e[2]!==o?(s={id:o,disabled:n,transition:r},e[1]=n,e[2]=o,e[3]=s):s=e[3];let{attributes:i,isDragging:a,listeners:l,setNodeRef:c,transform:u,transition:d}=d0(s),f=a?"grabbing":"grab",m;e[4]!==f||e[5]!==d?(m={cursor:f,transition:d},e[4]=f,e[5]=d,e[6]=m):m=e[6];let h;e[7]!==i||e[8]!==m?(h={...i,style:m},e[7]=i,e[8]=m,e[9]=h):h=e[9];let p=u&&`translate3d(${u.x}px, ${u.y}px, 0)`,g;return e[10]!==a||e[11]!==l||e[12]!==c||e[13]!==h||e[14]!==p||e[15]!==d?(g={attributes:h,isDragging:a,listeners:l,setNodeRef:c,transform:p,transition:d},e[10]=a,e[11]=l,e[12]=c,e[13]=h,e[14]=p,e[15]=d,e[16]=g):g=e[16],g};var Jr=t=>{let e=tA(12),{id:o,children:n,disabled:r}=t,s;e[0]!==r||e[1]!==o?(s={id:o,disabled:r},e[0]=r,e[1]=o,e[2]=s):s=e[2];let{attributes:i,isDragging:a,listeners:l,setNodeRef:c,transform:u,transition:d}=Oi(s),f=a?"grabbing":"grab",m;return e[3]!==i||e[4]!==n||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==f||e[9]!==u||e[10]!==d?(m=oA(rA,{children:n({attributes:{...i,style:{cursor:f}},isDragging:a,listeners:l,setNodeRef:c,transform:u,transition:d})}),e[3]=i,e[4]=n,e[5]=a,e[6]=l,e[7]=c,e[8]=f,e[9]=u,e[10]=d,e[11]=m):m=e[11],m};import{c as nA}from"react/compiler-runtime";import{jsx as yp}from"react/jsx-runtime";import{closestCenter as sA,DndContext as iA,KeyboardSensor as aA,PointerSensor as lA,useDroppable as cA,useSensor as p0,useSensors as uA}from"@dnd-kit/core";import{useId as dA}from"react";var cr=t=>{let e=nA(18),{children:o,className:n,ids:r,onDragEnd:s,onDragStart:i}=t,a=dA(),l;e[0]!==a?(l={id:a},e[0]=a,e[1]=l):l=e[1];let{setNodeRef:c}=cA(l),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u={activationConstraint:{distance:5}},e[2]=u):u=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={coordinateGetter:m0},e[3]=d):d=e[3];let f=uA(p0(lA,u),p0(aA,d)),m;e[4]!==r||e[5]!==s?(m=v=>{let{active:x,over:y}=v;v.activatorEvent.stopPropagation(),!(!x||!y)&&typeof s=="function"&&s({event:v,moveFromIndex:r.findIndex(C=>C===x.id),moveToIndex:r.findIndex(C=>C===y.id)})},e[4]=r,e[5]=s,e[6]=m):m=e[6];let h=m,p;e[7]!==i?(p=v=>{let{active:x}=v;x&&typeof i=="function"&&i({id:x.id,event:v})},e[7]=i,e[8]=p):p=e[8];let g=p,b;return e[9]!==o||e[10]!==n||e[11]!==h||e[12]!==g||e[13]!==a||e[14]!==r||e[15]!==f||e[16]!==c?(b=yp(iA,{collisionDetection:sA,id:a,onDragEnd:h,onDragStart:g,sensors:f,children:yp(c0,{items:r,children:yp("div",{className:n,ref:c,children:o})})}),e[9]=o,e[10]=n,e[11]=h,e[12]=g,e[13]=a,e[14]=r,e[15]=f,e[16]=c,e[17]=b):b=e[17],b};import{jsx as h0,jsxs as mA}from"react/jsx-runtime";import"react";var Xu="error-pill",io=t=>{let{className:e,count:o,i18n:n,withMessage:r}=t,s=!r&&o<99,i=[Xu,s&&`${Xu}--fixed-width`,e&&e].filter(Boolean).join(" ");return o===0?null:h0("div",{className:i,children:mA("div",{className:`${Xu}__content`,children:[h0("span",{className:`${Xu}__count`,children:o}),r&&` ${o>1?n.t("general:errors"):n.t("general:error")}`]})})};import{c as fA}from"react/compiler-runtime";import{jsx as pA}from"react/jsx-runtime";import{getTranslation as hA}from"@payloadcms/translations";import"react";var g0="field-description",Be=t=>{let e=fA(8),{className:o,description:n,marginPlacement:r,path:s}=t,{i18n:i}=k();if(n){let a=`field-description-${s?.replace(/\./g,"__")}`,l=r&&`${g0}--margin-${r}`,c;e[0]!==o||e[1]!==a||e[2]!==l?(c=[g0,o,a,l].filter(Boolean),e[0]=o,e[1]=a,e[2]=l,e[3]=c):c=e[3];let u=c.join(" "),d;return e[4]!==n||e[5]!==i||e[6]!==u?(d=pA("div",{className:u,children:hA(n,i)}),e[4]=n,e[5]=i,e[6]=u,e[7]=d):d=e[7],d}return null};import{c as gA}from"react/compiler-runtime";import{jsx as bA}from"react/jsx-runtime";import"react";var vA="field-error",He=t=>{let e=gA(7),{alignCaret:o,message:n,path:r,showError:s}=t,i=o===void 0?"right":o,a=Xt(),l;e[0]!==r?(l=p=>{let[g]=p;return g&&g?.[r]||null},e[0]=r,e[1]=l):l=e[1];let c=Et(l),u;e[2]!==c?(u=c||{},e[2]=c,e[3]=u):u=e[3];let{errorMessage:d,valid:f}=u,m=n||d;if((s||a&&f===!1)&&m?.length){let p;return e[4]!==i||e[5]!==m?(p=bA(go,{alignCaret:i,className:vA,delay:0,staticPositioning:!0,children:m}),e[4]=i,e[5]=m,e[6]=p):p=e[6],p}return null};import{c as rE}from"react/compiler-runtime";import{jsx as nE,jsxs as ux}from"react/jsx-runtime";import{getTranslation as sE}from"@payloadcms/translations";import"react";import{c as xA}from"react/compiler-runtime";import{jsx as yA}from"react/jsx-runtime";import{createContext as CA,use as wA}from"react";var b0=CA(0),Ns=t=>{let e=xA(3),{children:o}=t,r=ct()+1,s;return e[0]!==o||e[1]!==r?(s=yA(b0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},ct=()=>wA(b0);import{c as JT}from"react/compiler-runtime";import{jsx as nx}from"react/jsx-runtime";import{useSearchParams as qT}from"next/navigation.js";import QT,{createContext as ix,use as ax,useEffect as sx,useRef as KT,useState as eE}from"react";var Yn=(t,e)=>!t?.locales||t.locales.length===0?null:t.locales.find(o=>o?.code===e);import{jsx as BT}from"react/jsx-runtime";import{jsx as Ap}from"react/jsx-runtime";import{useRef as F0,useEffect as ks,useState as Tp}from"react";import kA from"react-dom";function Ie(){return Ie=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)({}).hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},Ie.apply(null,arguments)}function Mi(t,e){if(t==null)return{};var o={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;o[n]=t[n]}return o}function Bi(t,e){return Bi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,n){return o.__proto__=n,o},Bi(t,e)}function Uu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Bi(t,e)}function Cp(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function wp(t,e){t.classList?t.classList.add(e):Cp(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function v0(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Sp(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=v0(t.className,e):t.setAttribute("class",v0(t.className&&t.className.baseVal||"",e))}import y0 from"react";import Zu from"react";import Ju from"react-dom";var Ip={disabled:!1};import SA from"react";var Rp=SA.createContext(null);var Yu=function(e){return e.scrollTop};var dl="unmounted",Ls="exited",$s="entering",Gi="entered",_p="exiting",fn=function(t){Uu(e,t);function e(n,r){var s;s=t.call(this,n,r)||this;var i=r,a=i&&!i.isMounting?n.enter:n.appear,l;return s.appearStatus=null,n.in?a?(l=Ls,s.appearStatus=$s):l=Gi:n.unmountOnExit||n.mountOnEnter?l=dl:l=Ls,s.state={status:l},s.nextCallback=null,s}e.getDerivedStateFromProps=function(r,s){var i=r.in;return i&&s.status===dl?{status:Ls}:null};var o=e.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(r){var s=null;if(r!==this.props){var i=this.state.status;this.props.in?i!==$s&&i!==Gi&&(s=$s):(i===$s||i===Gi)&&(s=_p)}this.updateStatus(!1,s)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var r=this.props.timeout,s,i,a;return s=i=a=r,r!=null&&typeof r!="number"&&(s=r.exit,i=r.enter,a=r.appear!==void 0?r.appear:i),{exit:s,enter:i,appear:a}},o.updateStatus=function(r,s){if(r===void 0&&(r=!1),s!==null)if(this.cancelNextCallback(),s===$s){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:Ju.findDOMNode(this);i&&Yu(i)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ls&&this.setState({status:dl})},o.performEnter=function(r){var s=this,i=this.props.enter,a=this.context?this.context.isMounting:r,l=this.props.nodeRef?[a]:[Ju.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!r&&!i||Ip.disabled){this.safeSetState({status:Gi},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:$s},function(){s.props.onEntering(c,u),s.onTransitionEnd(f,function(){s.safeSetState({status:Gi},function(){s.props.onEntered(c,u)})})})},o.performExit=function(){var r=this,s=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:Ju.findDOMNode(this);if(!s||Ip.disabled){this.safeSetState({status:Ls},function(){r.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:_p},function(){r.props.onExiting(a),r.onTransitionEnd(i.exit,function(){r.safeSetState({status:Ls},function(){r.props.onExited(a)})})})},o.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(r,s){s=this.setNextCallback(s),this.setState(r,s)},o.setNextCallback=function(r){var s=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,s.nextCallback=null,r(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},o.onTransitionEnd=function(r,s){this.setNextCallback(s);var i=this.props.nodeRef?this.props.nodeRef.current:Ju.findDOMNode(this),a=r==null&&!this.props.addEndListener;if(!i||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},o.render=function(){var r=this.state.status;if(r===dl)return null;var s=this.props,i=s.children,a=s.in,l=s.mountOnEnter,c=s.unmountOnExit,u=s.appear,d=s.enter,f=s.exit,m=s.timeout,h=s.addEndListener,p=s.onEnter,g=s.onEntering,b=s.onEntered,v=s.onExit,x=s.onExiting,y=s.onExited,C=s.nodeRef,S=Mi(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Zu.createElement(Rp.Provider,{value:null},typeof i=="function"?i(r,S):Zu.cloneElement(Zu.Children.only(i),S))},e}(Zu.Component);fn.contextType=Rp;fn.propTypes={};function Vi(){}fn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vi,onEntering:Vi,onEntered:Vi,onExit:Vi,onExiting:Vi,onExited:Vi};fn.UNMOUNTED=dl;fn.EXITED=Ls;fn.ENTERING=$s;fn.ENTERED=Gi;fn.EXITING=_p;var x0=fn;var IA=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return wp(e,n)})},Dp=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return Sp(e,n)})},Fp=function(t){Uu(e,t);function e(){for(var n,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=t.call.apply(t,[this].concat(s))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(a,l){var c=n.resolveArguments(a,l),u=c[0],d=c[1];n.removeClasses(u,"exit"),n.addClass(u,d?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(a,l)},n.onEntering=function(a,l){var c=n.resolveArguments(a,l),u=c[0],d=c[1],f=d?"appear":"enter";n.addClass(u,f,"active"),n.props.onEntering&&n.props.onEntering(a,l)},n.onEntered=function(a,l){var c=n.resolveArguments(a,l),u=c[0],d=c[1],f=d?"appear":"enter";n.removeClasses(u,f),n.addClass(u,f,"done"),n.props.onEntered&&n.props.onEntered(a,l)},n.onExit=function(a){var l=n.resolveArguments(a),c=l[0];n.removeClasses(c,"appear"),n.removeClasses(c,"enter"),n.addClass(c,"exit","base"),n.props.onExit&&n.props.onExit(a)},n.onExiting=function(a){var l=n.resolveArguments(a),c=l[0];n.addClass(c,"exit","active"),n.props.onExiting&&n.props.onExiting(a)},n.onExited=function(a){var l=n.resolveArguments(a),c=l[0];n.removeClasses(c,"exit"),n.addClass(c,"exit","done"),n.props.onExited&&n.props.onExited(a)},n.resolveArguments=function(a,l){return n.props.nodeRef?[n.props.nodeRef.current,a]:[a,l]},n.getClassNames=function(a){var l=n.props.classNames,c=typeof l=="string",u=c&&l?l+"-":"",d=c?""+u+a:l[a],f=c?d+"-active":l[a+"Active"],m=c?d+"-done":l[a+"Done"];return{baseClassName:d,activeClassName:f,doneClassName:m}},n}var o=e.prototype;return o.addClass=function(r,s,i){var a=this.getClassNames(s)[i+"ClassName"],l=this.getClassNames("enter"),c=l.doneClassName;s==="appear"&&i==="done"&&c&&(a+=" "+c),i==="active"&&r&&Yu(r),a&&(this.appliedClasses[s][i]=a,IA(r,a))},o.removeClasses=function(r,s){var i=this.appliedClasses[s],a=i.base,l=i.active,c=i.done;this.appliedClasses[s]={},a&&Dp(r,a),l&&Dp(r,l),c&&Dp(r,c)},o.render=function(){var r=this.props,s=r.classNames,i=Mi(r,["classNames"]);return y0.createElement(x0,Ie({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(y0.Component);Fp.defaultProps={classNames:""};Fp.propTypes={};var ml=Fp;function C0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}import{useContext as _A}from"react";import{createContext as RA}from"react";var qu=RA({});var de=()=>_A(qu);var Qu=t=>t?{appear:`${t}--appear`,appearActive:`${t}--appearActive`,appearDone:`${t}--appearDone`,enter:`${t}--enter`,enterActive:`${t}--enterActive`,enterDone:`${t}--enterDone`,exit:`${t}--exit`,exitActive:`${t}--exitActive`,exitDone:`${t}--exitDone`}:{};wD();function w0(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,n)}return o}function S0(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?w0(Object(o),!0).forEach(function(n){DA(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):w0(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function DA(t,e,o){return e=AA(e),e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function FA(t,e){if(typeof t!="object"||t===null)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AA(t){var e=FA(t,"string");return typeof e=="symbol"?e:String(e)}var I0={activateTrap:function(e,o){if(e.length>0){var n=e[e.length-1];n!==o&&n.pause()}var r=e.indexOf(o);r===-1||e.splice(r,1),e.push(o)},deactivateTrap:function(e,o){var n=e.indexOf(o);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},TA=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},EA=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},pl=function(e){return e?.key==="Tab"||e?.keyCode===9},PA=function(e){return pl(e)&&!e.shiftKey},NA=function(e){return pl(e)&&e.shiftKey},R0=function(e){return setTimeout(e,0)},_0=function(e,o){var n=-1;return e.every(function(r,s){return o(r)?(n=s,!1):!0}),n},fl=function(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return typeof e=="function"?e.apply(void 0,n):e},Ku=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},LA=[],D0=function(e,o){var n=o?.document||document,r=o?.trapStack||LA,s=S0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:PA,isKeyBackward:NA},o),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function(R,I,E){return R&&R[I]!==void 0?R[I]:s[E||I]},c=function(R,I){var E=typeof I?.composedPath=="function"?I.composedPath():void 0;return i.containerGroups.findIndex(function(T){var $=T.container,j=T.tabbableNodes;return $.contains(R)||E?.includes($)||j.find(function(N){return N===R})})},u=function(R){var I=s[R];if(typeof I=="function"){for(var E=arguments.length,T=new Array(E>1?E-1:0),$=1;$<E;$++)T[$-1]=arguments[$];I=I.apply(void 0,T)}if(I===!0&&(I=void 0),!I){if(I===void 0||I===!1)return I;throw new Error("`".concat(R,"` was specified but was not a node, or did not return a node"))}var j=I;if(typeof I=="string"&&(j=n.querySelector(I),!j))throw new Error("`".concat(R,"` as selector refers to no known node"));return j},d=function(){var R=u("initialFocus");if(R===!1)return!1;if(R===void 0||!Cu(R,s.tabbableOptions))if(c(n.activeElement)>=0)R=n.activeElement;else{var I=i.tabbableGroups[0],E=I&&I.firstTabbableNode;R=E||u("fallbackFocus")}if(!R)throw new Error("Your focus-trap needs to have at least one focusable element");return R},f=function(){if(i.containerGroups=i.containers.map(function(R){var I=dv(R,s.tabbableOptions),E=mv(R,s.tabbableOptions),T=I.length>0?I[0]:void 0,$=I.length>0?I[I.length-1]:void 0,j=E.find(function(L){return Fs(L)}),N=E.slice().reverse().find(function(L){return Fs(L)}),P=!!I.find(function(L){return Li(L)>0});return{container:R,tabbableNodes:I,focusableNodes:E,posTabIndexesFound:P,firstTabbableNode:T,lastTabbableNode:$,firstDomTabbableNode:j,lastDomTabbableNode:N,nextTabbableNode:function(V){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,O=I.indexOf(V);return O<0?M?E.slice(E.indexOf(V)+1).find(function(B){return Fs(B)}):E.slice(0,E.indexOf(V)).reverse().find(function(B){return Fs(B)}):I[O+(M?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(R){return R.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(R){return R.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function F(R){var I=R.activeElement;if(I)return I.shadowRoot&&I.shadowRoot.activeElement!==null?F(I.shadowRoot):I},h=function F(R){if(R!==!1&&R!==m(document)){if(!R||!R.focus){F(d());return}R.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=R,TA(R)&&R.select()}},p=function(R){var I=u("setReturnFocus",R);return I||(I===!1?!1:R)},g=function(R){var I=R.target,E=R.event,T=R.isBackward,$=T===void 0?!1:T;I=I||Ku(E),f();var j=null;if(i.tabbableGroups.length>0){var N=c(I,E),P=N>=0?i.containerGroups[N]:void 0;if(N<0)$?j=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:j=i.tabbableGroups[0].firstTabbableNode;else if($){var L=_0(i.tabbableGroups,function(X){var Z=X.firstTabbableNode;return I===Z});if(L<0&&(P.container===I||Cu(I,s.tabbableOptions)&&!Fs(I,s.tabbableOptions)&&!P.nextTabbableNode(I,!1))&&(L=N),L>=0){var V=L===0?i.tabbableGroups.length-1:L-1,M=i.tabbableGroups[V];j=Li(I)>=0?M.lastTabbableNode:M.lastDomTabbableNode}else pl(E)||(j=P.nextTabbableNode(I,!1))}else{var O=_0(i.tabbableGroups,function(X){var Z=X.lastTabbableNode;return I===Z});if(O<0&&(P.container===I||Cu(I,s.tabbableOptions)&&!Fs(I,s.tabbableOptions)&&!P.nextTabbableNode(I))&&(O=N),O>=0){var B=O===i.tabbableGroups.length-1?0:O+1,G=i.tabbableGroups[B];j=Li(I)>=0?G.firstTabbableNode:G.firstDomTabbableNode}else pl(E)||(j=P.nextTabbableNode(I))}}else j=u("fallbackFocus");return j},b=function(R){var I=Ku(R);if(!(c(I,R)>=0)){if(fl(s.clickOutsideDeactivates,R)){a.deactivate({returnFocus:s.returnFocusOnDeactivate});return}fl(s.allowOutsideClick,R)||R.preventDefault()}},v=function(R){var I=Ku(R),E=c(I,R)>=0;if(E||I instanceof Document)E&&(i.mostRecentlyFocusedNode=I);else{R.stopImmediatePropagation();var T,$=!0;if(i.mostRecentlyFocusedNode)if(Li(i.mostRecentlyFocusedNode)>0){var j=c(i.mostRecentlyFocusedNode),N=i.containerGroups[j].tabbableNodes;if(N.length>0){var P=N.findIndex(function(L){return L===i.mostRecentlyFocusedNode});P>=0&&(s.isKeyForward(i.recentNavEvent)?P+1<N.length&&(T=N[P+1],$=!1):P-1>=0&&(T=N[P-1],$=!1))}}else i.containerGroups.some(function(L){return L.tabbableNodes.some(function(V){return Li(V)>0})})||($=!1);else $=!1;$&&(T=g({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),h(T||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},x=function(R){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=R;var E=g({event:R,isBackward:I});E&&(pl(R)&&R.preventDefault(),h(E))},y=function(R){if(EA(R)&&fl(s.escapeDeactivates,R)!==!1){R.preventDefault(),a.deactivate();return}(s.isKeyForward(R)||s.isKeyBackward(R))&&x(R,s.isKeyBackward(R))},C=function(R){var I=Ku(R);c(I,R)>=0||fl(s.clickOutsideDeactivates,R)||fl(s.allowOutsideClick,R)||(R.preventDefault(),R.stopImmediatePropagation())},S=function(){if(i.active)return I0.activateTrap(r,a),i.delayInitialFocusTimer=s.delayInitialFocus?R0(function(){h(d())}):h(d()),n.addEventListener("focusin",v,!0),n.addEventListener("mousedown",b,{capture:!0,passive:!1}),n.addEventListener("touchstart",b,{capture:!0,passive:!1}),n.addEventListener("click",C,{capture:!0,passive:!1}),n.addEventListener("keydown",y,{capture:!0,passive:!1}),a},w=function(){if(i.active)return n.removeEventListener("focusin",v,!0),n.removeEventListener("mousedown",b,!0),n.removeEventListener("touchstart",b,!0),n.removeEventListener("click",C,!0),n.removeEventListener("keydown",y,!0),a},D=function(R){var I=R.some(function(E){var T=Array.from(E.removedNodes);return T.some(function($){return $===i.mostRecentlyFocusedNode})});I&&h(d())},_=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(D):void 0,A=function(){_&&(_.disconnect(),i.active&&!i.paused&&i.containers.map(function(R){_.observe(R,{subtree:!0,childList:!0})}))};return a={get active(){return i.active},get paused(){return i.paused},activate:function(R){if(i.active)return this;var I=l(R,"onActivate"),E=l(R,"onPostActivate"),T=l(R,"checkCanFocusTrap");T||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=n.activeElement,I?.();var $=function(){T&&f(),S(),A(),E?.()};return T?(T(i.containers.concat()).then($,$),this):($(),this)},deactivate:function(R){if(!i.active)return this;var I=S0({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},R);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,w(),i.active=!1,i.paused=!1,A(),I0.deactivateTrap(r,a);var E=l(I,"onDeactivate"),T=l(I,"onPostDeactivate"),$=l(I,"checkCanReturnFocus"),j=l(I,"returnFocus","returnFocusOnDeactivate");E?.();var N=function(){R0(function(){j&&h(p(i.nodeFocusedBeforeActivation)),T?.()})};return j&&$?($(p(i.nodeFocusedBeforeActivation)).then(N,N),this):(N(),this)},pause:function(R){if(i.paused||!i.active)return this;var I=l(R,"onPause"),E=l(R,"onPostPause");return i.paused=!0,I?.(),w(),A(),E?.(),this},unpause:function(R){if(!i.paused||!i.active)return this;var I=l(R,"onUnpause"),E=l(R,"onPostUnpause");return i.paused=!1,I?.(),f(),S(),A(),E?.(),this},updateContainerElements:function(R){var I=[].concat(R).filter(Boolean);return i.containers=I.map(function(E){return typeof E=="string"?n.querySelector(E):E}),i.active&&f(),A(),this}},a.updateContainerElements(e),a};var $A=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(o[n[r]]=t[n[r]]);return o},pn="modal-item",A0=(t,e)=>n=>{let r=de(),s=F0(null),[i,a]=Tp(!1),l=F0(!1),[c,u]=Tp(null),{modalState:d,classPrefix:f,containerRef:m,transTime:h,setCloseOnBlur:p,setBodyScrollLock:g,openModal:b}=r,{className:v,htmlElement:x="dialog",slug:y="",closeOnBlur:C=!0,lockBodyScroll:S=!0,classPrefix:w,onEnter:D,onEntering:_,onEntered:A,onExit:F,onExiting:R,onExited:I,openOnInit:E,trapFocus:T=!0,focusTrapOptions:$={}}=n,j=$A(n,["className","htmlElement","slug","closeOnBlur","lockBodyScroll","classPrefix","onEnter","onEntering","onEntered","onExit","onExiting","onExited","openOnInit","trapFocus","focusTrapOptions"]),N=w||f,P=e||y,L=d[P]&&d[P].isOpen;ks(()=>{if(T){let O=s.current;if(l.current===!1&&O){let B=D0(O,Object.assign(Object.assign({},$),{fallbackFocus:$?.fallbackFocus||O,allowOutsideClick:typeof $.allowOutsideClick<"u"?$.allowOutsideClick:!0}));u(B),l.current=!0}}},[T,i,$]),ks(()=>{a(!0)},[]),ks(()=>(c&&(L?c.activate():c.deactivate()),()=>{c&&c.deactivate()}),[L,c]),ks(()=>{L&&p(C)},[L,C,p]),ks(()=>{let O=s.current;return O&&g(!!(L&&S),O),()=>{O&&g(!1,O)}},[L,S,g]);let[V,M]=Tp(L);if(ks(()=>{L?M(L):setTimeout(()=>M(!1),h)},[L,h]),ks(()=>{E&&b(P)},[P,E,b]),m.current){let O=N?`${N}__${pn}`:pn,B=[O,`${O}--slug-${P}`,v].filter(Boolean).join(" "),G=Object.assign({role:x!=="dialog"?"dialog":void 0,open:x==="dialog"?V||L:void 0,"aria-modal":!0,"aria-label":j["aria-labelledby"]?void 0:P},j);return kA.createPortal(Ap(ml,{nodeRef:s,timeout:h,in:L,classNames:Qu(O),appear:!0,onEnter:D,onEntering:_,onEntered:A,onExit:F,onExiting:R,onExited:I,children:Ap(x,Object.assign({ref:s,id:j?.id||P,className:B},G,{children:Ap(t,Object.assign({},n,{isOpen:L,modal:r}))}))}),m.current)}return null};import{jsx as T0}from"react/jsx-runtime";import{Fragment as E0}from"react";var jA=t=>{let{children:e}=t;return e?typeof e=="function"?T0(E0,{children:e(t)}):T0(E0,{children:e}):null},Yo=A0(jA);import{jsx as P0}from"react/jsx-runtime";var OA=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(o[n[r]]=t[n[r]]);return o},hn="modal-container",Ep=t=>{let{oneModalIsOpen:e,classPrefix:o,transTime:n,setContainerRef:r,containerRef:s,closeAllModals:i,closeOnBlur:a}=de(),{className:l,htmlElement:c="div",children:u,onClick:d}=t,f=OA(t,["className","htmlElement","children","onClick"]),m=o?`${o}__${hn}`:hn,h=[m,l].filter(Boolean).join(" "),p=Object.assign(Object.assign({},f),{onClick:g=>{a&&i(),typeof d=="function"&&d(g)}});return P0(ml,{nodeRef:s,in:e,timeout:n,classNames:Qu(m),appear:!0,children:P0(c,Object.assign({className:h,ref:r},p,{children:u&&u}))})};import{jsx as M0,jsxs as XA}from"react/jsx-runtime";import{Fragment as UA,useState as rd,useRef as B0,useEffect as nd,useCallback as Zn,useReducer as YA}from"react";function MA(t){if(Array.isArray(t)){for(var e=0,o=Array(t.length);e<t.length;e++)o[e]=t[e];return o}else return Array.from(t)}var Np=!1;typeof window<"u"&&(Pp={get passive(){Np=!0}},window.addEventListener("testPassive",null,Pp),window.removeEventListener("testPassive",null,Pp));var Pp,ed=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),Os=[],td=!1,N0=-1,hl=void 0,js=void 0,gl=void 0,L0=function(e){return Os.some(function(o){return!!(o.options.allowTouchMove&&o.options.allowTouchMove(e))})},od=function(e){var o=e||window.event;return L0(o.target)||o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)},BA=function(e){if(gl===void 0){var o=!!e&&e.reserveScrollBarGap===!0,n=window.innerWidth-document.documentElement.clientWidth;if(o&&n>0){var r=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);gl=document.body.style.paddingRight,document.body.style.paddingRight=r+n+"px"}}hl===void 0&&(hl=document.body.style.overflow,document.body.style.overflow="hidden")},VA=function(){gl!==void 0&&(document.body.style.paddingRight=gl,gl=void 0),hl!==void 0&&(document.body.style.overflow=hl,hl=void 0)},GA=function(){return window.requestAnimationFrame(function(){if(js===void 0){js={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var e=window,o=e.scrollY,n=e.scrollX,r=e.innerHeight;document.body.style.position="fixed",document.body.style.top=-o,document.body.style.left=-n,setTimeout(function(){return window.requestAnimationFrame(function(){var s=r-window.innerHeight;s&&o>=r&&(document.body.style.top=-(o+s))})},300)}})},WA=function(){if(js!==void 0){var e=-parseInt(document.body.style.top,10),o=-parseInt(document.body.style.left,10);document.body.style.position=js.position,document.body.style.top=js.top,document.body.style.left=js.left,window.scrollTo(o,e),js=void 0}},HA=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},zA=function(e,o){var n=e.targetTouches[0].clientY-N0;return L0(e.target)?!1:o&&o.scrollTop===0&&n>0||HA(o)&&n<0?od(e):(e.stopPropagation(),!0)},$0=function(e,o){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Os.some(function(r){return r.targetElement===e})){var n={targetElement:e,options:o||{}};Os=[].concat(MA(Os),[n]),ed?GA():BA(o),ed&&(e.ontouchstart=function(r){r.targetTouches.length===1&&(N0=r.targetTouches[0].clientY)},e.ontouchmove=function(r){r.targetTouches.length===1&&zA(r,e)},td||(document.addEventListener("touchmove",od,Np?{passive:!1}:void 0),td=!0))}};var k0=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Os=Os.filter(function(o){return o.targetElement!==e}),ed&&(e.ontouchstart=null,e.ontouchmove=null,td&&Os.length===0&&(document.removeEventListener("touchmove",od,Np?{passive:!1}:void 0),td=!1)),ed?WA():VA()};var j0=({classPrefix:t,zIndex:e})=>{let o=t?`${t}__`:"";return`
|
|
14
14
|
.${o}${hn} {
|
|
15
15
|
top: 0;
|
|
16
16
|
right: 0;
|
|
@@ -44,18 +44,18 @@ import{a as Wf,b as H,c as Hf,d as St,e as SD,f as ID,g as zf,h as RD,i as _D}fr
|
|
|
44
44
|
.${o}${pn}--exit {
|
|
45
45
|
visibility: visible;
|
|
46
46
|
}
|
|
47
|
-
`};var O0=(t,e)=>{let o=Object.assign({},t),{type:n,payload:r}=e;switch(n){case"UPDATE_MODAL":{let{slug:s}=r;s&&(o[s]=Object.assign(Object.assign({},o[s]),r));break}case"OPEN_MODAL":{let{slug:s}=r;s&&(s in o&&o[s].isOpen||(o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:Date.now(),isOpen:!0})));break}case"TOGGLE_MODAL":{let{slug:s}=r;if(s){let i=s in o&&o[s].isOpen;o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:i?void 0:Date.now(),isOpen:!i})}break}case"CLOSE_MODAL":{let{slug:s}=r;s&&(o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:void 0,isOpen:!1}));break}case"REMOVE_MODAL":{let{slug:s}=r;s&&s in o&&delete o[s];break}case"CLOSE_LATEST_MODAL":{let s=Object.keys(o).reduce((i,a)=>{let l=o[a];return l.isOpen&&typeof l.openedOn=="number"&&(!i||typeof i.openedOn=="number"&&l.openedOn>i.openedOn)?l:i},void 0);s&&(o[s.slug]=Object.assign(Object.assign({},o[s.slug]),{isOpen:!1,openedOn:void 0}));break}case"CLOSE_ALL_MODALS":{o=Object.entries(o).reduce((s,[i,a])=>(s[i]=Object.assign(Object.assign({},a),{isOpen:!1,openedOn:void 0}),s),{});break}default:break}return o};var ZA=()=>{if(typeof window<"u")return new URLSearchParams(window.location.search)},JA=()=>{let t=ZA(),e=[];if(t){let o=t.get("modal");o&&(o.includes(",")?e=o.split(","):e=[o])}return e},Lp=t=>{let{classPrefix:e,minifyCSS:o=!0,generateCSS:n=!0,zIndex:r=9999,handleParamChange:s,children:i,transTime:a=250}=t,l=B0(null),[c,u]=YA(O0,{},()=>JA().reduce((T,$)=>(T[$]={slug:$,isOpen:!0,openedOn:Date.now()},T),{})),[d,f]=rd(!1),[m,h]=rd(!1),[p,g]=rd(!1),[b,v]=rd(""),x=B0(!1),y=Zn(I=>{I.keyCode===27&&u({type:"CLOSE_LATEST_MODAL"})},[]);nd(()=>(x.current||(document.addEventListener("keydown",I=>y(I),!1),x.current=!0),()=>{x.current&&document.removeEventListener("keydown",I=>y(I),!1)}),[y]),nd(()=>{if(n){let I="";I=j0({classPrefix:e,zIndex:r}),o&&(I=I.replace(/\n/g,"").replace(/\s\s+/g," ")),v(I)}},[n,o,r,e]),nd(()=>{if(typeof s=="function"&&s(c),typeof s=="boolean"&&s){let I=Object.keys(c).filter(j=>c[j].isOpen),E=new URLSearchParams;for(let j of I)E.append("modal",j);let T=E.toString()?`?${E}`:"",$=`${window.location.pathname}${T}`;window.history.pushState({},"",$)}},[c,s]),nd(()=>{let I=Object.keys(c).some(E=>c[E].isOpen);f(I)},[c]);let C=Zn((I,E)=>{E&&(I?($0(E),g(!0)):(k0(E),g(!1)))},[]),S=Zn(I=>{l.current=I},[]),w=Zn(I=>{u({type:"OPEN_MODAL",payload:{slug:I}})},[]),D=Zn(I=>{u({type:"CLOSE_MODAL",payload:{slug:I}})},[]),_=Zn(()=>{u({type:"CLOSE_ALL_MODALS"})},[]),A=Zn(I=>{u({type:"TOGGLE_MODAL",payload:{slug:I}})},[]),F=Zn(I=>c[I]&&c[I].isOpen,[c]),R=Object.assign({},t);return delete R.children,XA(UA,{children:[n&&M0("style",{dangerouslySetInnerHTML:{__html:b}}),M0(qu.Provider,{value:Object.assign(Object.assign({},R),{transTime:a,containerRef:l,modalState:c,oneModalIsOpen:d,isModalOpen:F,closeOnBlur:m,bodyScrollIsLocked:p,classPrefix:e,closeAllModals:_,setCloseOnBlur:h,openModal:w,closeModal:D,toggleModal:A,setBodyScrollLock:C,setContainerRef:S}),children:i})]})};import{usePathname as VT,useRouter as GT}from"next/navigation.js";import{formatAdminURL as WT}from"payload/shared";import*as Q0 from"qs-esm";import J0,{createContext as HT,use as zT,useCallback as Ms,useEffect as cd,useState as xl}from"react";import xe,{forwardRef as qA,isValidElement as $p}from"react";import QA from"react-dom";import Mo from"react";import V0 from"react";import lT from"react";var KA=t=>{switch(t){case"success":return oT;case"info":return nT;case"warning":return rT;case"error":return sT;default:return null}},eT=Array(12).fill(0),tT=({visible:t,className:e})=>Mo.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Mo.createElement("div",{className:"sonner-spinner"},eT.map((o,n)=>Mo.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),oT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),rT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),nT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),sT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),iT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Mo.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Mo.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aT=()=>{let[t,e]=V0.useState(document.hidden);return V0.useEffect(()=>{let o=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),t},kp=1,cT=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:o,...n}=t,r=typeof t?.id=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:kp++,s=this.toasts.find(a=>a.id===r),i=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(a=>a.id===r?(this.publish({...a,...t,id:r,title:o}),{...a,...t,id:r,dismissible:i,title:o}):a):this.addToast({title:o,...n,dismissible:i,id:r}),r},this.dismiss=t=>(t||this.toasts.forEach(e=>{this.subscribers.forEach(o=>o({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let o;e.loading!==void 0&&(o=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),r=o!==void 0,s,i=n.then(async l=>{if(s=["resolve",l],lT.isValidElement(l))r=!1,this.create({id:o,type:"default",message:l});else if(dT(l)&&!l.ok){r=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:o,type:"error",message:c,description:u})}else if(e.success!==void 0){r=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:o,type:"success",message:c,description:u})}}).catch(async l=>{if(s=["reject",l],e.error!==void 0){r=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:o,type:"error",message:c,description:u})}}).finally(()=>{var l;r&&(this.dismiss(o),o=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,c)=>i.then(()=>s[0]==="reject"?c(s[1]):l(s[1])).catch(c));return typeof o!="string"&&typeof o!="number"?{unwrap:a}:Object.assign(o,{unwrap:a})},this.custom=(t,e)=>{let o=e?.id||kp++;return this.create({jsx:t(o),id:o,...e}),o},this.subscribers=[],this.toasts=[]}},Zo=new cT,uT=(t,e)=>{let o=e?.id||kp++;return Zo.addToast({title:t,...e,id:o}),o},dT=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",mT=uT,fT=()=>Zo.toasts,me=Object.assign(mT,{success:Zo.success,info:Zo.info,warning:Zo.warning,error:Zo.error,custom:Zo.custom,message:Zo.message,promise:Zo.promise,dismiss:Zo.dismiss,loading:Zo.loading},{getHistory:fT});function pT(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}pT(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
48
|
-
`);function sd(t){return t.label!==void 0}var hT=3,gT="32px",bT="16px",G0=4e3,vT=356,xT=14,yT=20,CT=200;function _r(...t){return t.filter(Boolean).join(" ")}function wT(t){let[e,o]=t.split("-"),n=[];return e&&n.push(e),o&&n.push(o),n}var ST=t=>{var e,o,n,r,s,i,a,l,c,u,d;let{invert:f,toast:m,unstyled:h,interacting:p,setHeights:g,visibleToasts:b,heights:v,index:x,toasts:y,expanded:C,removeToast:S,defaultRichColors:w,closeButton:D,style:_,cancelButtonStyle:A,actionButtonStyle:F,className:R="",descriptionClassName:I="",duration:E,position:T,gap:$,loadingIcon:j,expandByDefault:N,classNames:P,icons:L,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:M}=t,[O,B]=xe.useState(null),[G,X]=xe.useState(null),[Z,te]=xe.useState(!1),[U,z]=xe.useState(!1),[le,J]=xe.useState(!1),[ce,re]=xe.useState(!1),[q,pe]=xe.useState(!1),[he,Re]=xe.useState(0),[ge,Ve]=xe.useState(0),Q=xe.useRef(m.duration||E||G0),Le=xe.useRef(null),_e=xe.useRef(null),ae=x===0,se=x+1<=b,Y=m.type,ie=m.dismissible!==!1,de=m.className||"",Ce=m.descriptionClassName||"",ze=xe.useMemo(()=>v.findIndex(be=>be.toastId===m.id)||0,[v,m.id]),$e=xe.useMemo(()=>{var be;return(be=m.closeButton)!=null?be:D},[m.closeButton,D]),ot=xe.useMemo(()=>m.duration||E||G0,[m.duration,E]),Xe=xe.useRef(0),Ue=xe.useRef(0),ft=xe.useRef(0),Qt=xe.useRef(null),[Ge,Je]=T.split("-"),Ye=xe.useMemo(()=>v.reduce((be,K,W)=>W>=ze?be:be+K.height,0),[v,ze]),xt=aT(),jt=m.invert||f,gt=Y==="loading";Ue.current=xe.useMemo(()=>ze*$+Ye,[ze,Ye]),xe.useEffect(()=>{Q.current=ot},[ot]),xe.useEffect(()=>{te(!0)},[]),xe.useEffect(()=>{let be=_e.current;if(be){let K=be.getBoundingClientRect().height;return Ve(K),g(W=>[{toastId:m.id,height:K,position:m.position},...W]),()=>g(W=>W.filter(ee=>ee.toastId!==m.id))}},[g,m.id]),xe.useLayoutEffect(()=>{if(!Z)return;let be=_e.current,K=be.style.height;be.style.height="auto";let W=be.getBoundingClientRect().height;be.style.height=K,Ve(W),g(ee=>ee.find(fe=>fe.toastId===m.id)?ee.map(fe=>fe.toastId===m.id?{...fe,height:W}:fe):[{toastId:m.id,height:W,position:m.position},...ee])},[Z,m.title,m.description,g,m.id]);let qe=xe.useCallback(()=>{z(!0),Re(Ue.current),g(be=>be.filter(K=>K.toastId!==m.id)),setTimeout(()=>{S(m)},CT)},[m,S,g,Ue]);xe.useEffect(()=>{if(m.promise&&Y==="loading"||m.duration===1/0||m.type==="loading")return;let be;return C||p||M&&xt?(()=>{if(ft.current<Xe.current){let K=new Date().getTime()-Xe.current;Q.current=Q.current-K}ft.current=new Date().getTime()})():Q.current!==1/0&&(Xe.current=new Date().getTime(),be=setTimeout(()=>{var K;(K=m.onAutoClose)==null||K.call(m,m),qe()},Q.current)),()=>clearTimeout(be)},[C,p,m,Y,M,xt,qe]),xe.useEffect(()=>{m.delete&&qe()},[qe,m.delete]);function Tt(){var be,K,W;return L!=null&&L.loading?xe.createElement("div",{className:_r(P?.loader,(be=m?.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":Y==="loading"},L.loading):j?xe.createElement("div",{className:_r(P?.loader,(K=m?.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":Y==="loading"},j):xe.createElement(tT,{className:_r(P?.loader,(W=m?.classNames)==null?void 0:W.loader),visible:Y==="loading"})}return xe.createElement("li",{tabIndex:0,ref:_e,className:_r(R,de,P?.toast,(e=m?.classNames)==null?void 0:e.toast,P?.default,P?.[Y],(o=m?.classNames)==null?void 0:o[Y]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:w,"data-styled":!(m.jsx||m.unstyled||h),"data-mounted":Z,"data-promise":!!m.promise,"data-swiped":q,"data-removed":U,"data-visible":se,"data-y-position":Ge,"data-x-position":Je,"data-index":x,"data-front":ae,"data-swiping":le,"data-dismissible":ie,"data-type":Y,"data-invert":jt,"data-swipe-out":ce,"data-swipe-direction":G,"data-expanded":!!(C||N&&Z),style:{"--index":x,"--toasts-before":x,"--z-index":y.length-x,"--offset":`${U?he:Ue.current}px`,"--initial-height":N?"auto":`${ge}px`,..._,...m.style},onPointerDown:be=>{gt||!ie||(Le.current=new Date,Re(Ue.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(J(!0),Qt.current={x:be.clientX,y:be.clientY}))},onPointerUp:()=>{var be,K,W,ee;if(ce||!ie)return;Qt.current=null;let fe=Number(((be=_e.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ae=Number(((K=_e.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ne=new Date().getTime()-((W=Le.current)==null?void 0:W.getTime()),we=O==="x"?fe:Ae,We=Math.abs(we)/Ne;if(Math.abs(we)>=yT||We>.11){Re(Ue.current),(ee=m.onDismiss)==null||ee.call(m,m),X(O==="x"?fe>0?"right":"left":Ae>0?"down":"up"),qe(),re(!0),pe(!1);return}J(!1),B(null)},onPointerMove:be=>{var K,W,ee,fe;if(!Qt.current||!ie||((K=window.getSelection())==null?void 0:K.toString().length)>0)return;let Ae=be.clientY-Qt.current.y,Ne=be.clientX-Qt.current.x,we=(W=t.swipeDirections)!=null?W:wT(T);!O&&(Math.abs(Ne)>1||Math.abs(Ae)>1)&&B(Math.abs(Ne)>Math.abs(Ae)?"x":"y");let We={x:0,y:0};O==="y"?(we.includes("top")||we.includes("bottom"))&&(we.includes("top")&&Ae<0||we.includes("bottom")&&Ae>0)&&(We.y=Ae):O==="x"&&(we.includes("left")||we.includes("right"))&&(we.includes("left")&&Ne<0||we.includes("right")&&Ne>0)&&(We.x=Ne),(Math.abs(We.x)>0||Math.abs(We.y)>0)&&pe(!0),(ee=_e.current)==null||ee.style.setProperty("--swipe-amount-x",`${We.x}px`),(fe=_e.current)==null||fe.style.setProperty("--swipe-amount-y",`${We.y}px`)}},$e&&!m.jsx?xe.createElement("button",{"aria-label":V,"data-disabled":gt,"data-close-button":!0,onClick:gt||!ie?()=>{}:()=>{var be;qe(),(be=m.onDismiss)==null||be.call(m,m)},className:_r(P?.closeButton,(r=m?.classNames)==null?void 0:r.closeButton)},(s=L?.close)!=null?s:iT):null,m.jsx||$p(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:xe.createElement(xe.Fragment,null,Y||m.icon||m.promise?xe.createElement("div",{"data-icon":"",className:_r(P?.icon,(i=m?.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Tt():null,m.type!=="loading"?m.icon||L?.[Y]||KA(Y):null):null,xe.createElement("div",{"data-content":"",className:_r(P?.content,(a=m?.classNames)==null?void 0:a.content)},xe.createElement("div",{"data-title":"",className:_r(P?.title,(l=m?.classNames)==null?void 0:l.title)},typeof m.title=="function"?m.title():m.title),m.description?xe.createElement("div",{"data-description":"",className:_r(I,Ce,P?.description,(c=m?.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),$p(m.cancel)?m.cancel:m.cancel&&sd(m.cancel)?xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||A,onClick:be=>{var K,W;sd(m.cancel)&&ie&&((W=(K=m.cancel).onClick)==null||W.call(K,be),qe())},className:_r(P?.cancelButton,(u=m?.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,$p(m.action)?m.action:m.action&&sd(m.action)?xe.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||F,onClick:be=>{var K,W;sd(m.action)&&((W=(K=m.action).onClick)==null||W.call(K,be),!be.defaultPrevented&&qe())},className:_r(P?.actionButton,(d=m?.classNames)==null?void 0:d.actionButton)},m.action.label):null))};function W0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function IT(t,e){let o={};return[t,e].forEach((n,r)=>{let s=r===1,i=s?"--mobile-offset":"--offset",a=s?bT:gT;function l(c){["top","right","bottom","left"].forEach(u=>{o[`${i}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?o[`${i}-${c}`]=a:o[`${i}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(a)}),o}var H0=qA(function(t,e){let{invert:o,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:m,visibleToasts:h=hT,toastOptions:p,dir:g=W0(),gap:b=xT,loadingIcon:v,icons:x,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:C}=t,[S,w]=xe.useState([]),D=xe.useMemo(()=>Array.from(new Set([n].concat(S.filter(M=>M.position).map(M=>M.position)))),[S,n]),[_,A]=xe.useState([]),[F,R]=xe.useState(!1),[I,E]=xe.useState(!1),[T,$]=xe.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),j=xe.useRef(null),N=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=xe.useRef(null),L=xe.useRef(!1),V=xe.useCallback(M=>{w(O=>{var B;return(B=O.find(G=>G.id===M.id))!=null&&B.delete||Zo.dismiss(M.id),O.filter(({id:G})=>G!==M.id)})},[]);return xe.useEffect(()=>Zo.subscribe(M=>{if(M.dismiss){w(O=>O.map(B=>B.id===M.id?{...B,delete:!0}:B));return}setTimeout(()=>{QA.flushSync(()=>{w(O=>{let B=O.findIndex(G=>G.id===M.id);return B!==-1?[...O.slice(0,B),{...O[B],...M},...O.slice(B+1)]:[M,...O]})})})}),[]),xe.useEffect(()=>{if(u!=="system"){$(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{$(O?"dark":"light")})}catch{M.addListener(({matches:B})=>{try{$(B?"dark":"light")}catch(G){console.error(G)}})}},[u]),xe.useEffect(()=>{S.length<=1&&R(!1)},[S]),xe.useEffect(()=>{let M=O=>{var B,G;r.every(X=>O[X]||O.code===X)&&(R(!0),(B=j.current)==null||B.focus()),O.code==="Escape"&&(document.activeElement===j.current||(G=j.current)!=null&&G.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[r]),xe.useEffect(()=>{if(j.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,L.current=!1)}},[j.current]),xe.createElement("section",{ref:e,"aria-label":`${y} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((M,O)=>{var B;let[G,X]=M.split("-");return S.length?xe.createElement("ol",{key:M,dir:g==="auto"?W0():g,tabIndex:-1,ref:j,className:a,"data-sonner-toaster":!0,"data-theme":T,"data-y-position":G,"data-lifted":F&&S.length>1&&!s,"data-x-position":X,style:{"--front-toast-height":`${((B=_[0])==null?void 0:B.height)||0}px`,"--width":`${vT}px`,"--gap":`${b}px`,...m,...IT(l,c)},onBlur:Z=>{L.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(L.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||L.current||(L.current=!0,P.current=Z.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{I||R(!1)},onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},S.filter(Z=>!Z.position&&O===0||Z.position===M).map((Z,te)=>{var U,z;return xe.createElement(ST,{key:Z.id,icons:x,index:te,toast:Z,defaultRichColors:d,duration:(U=p?.duration)!=null?U:f,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:o,visibleToasts:h,closeButton:(z=p?.closeButton)!=null?z:i,interacting:I,position:M,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:V,toasts:S.filter(le=>le.position==Z.position),heights:_.filter(le=>le.position==Z.position),setHeights:A,expandByDefault:s,gap:b,loadingIcon:v,expanded:F,pauseWhenPageIsHidden:C,swipeDirections:t.swipeDirections})})):null}))});import{c as NT}from"react/compiler-runtime";import{jsx as LT}from"react/jsx-runtime";import{useRouter as $T}from"next/navigation.js";import{formatAdminURL as kT}from"payload/shared";import"react";import{c as ET}from"react/compiler-runtime";import{jsx as vl,jsxs as Bp}from"react/jsx-runtime";import PT from"react";import{c as Op}from"react/compiler-runtime";import{jsx as gn,jsxs as ad}from"react/jsx-runtime";import{createContext as FT,use as AT,useEffect as z0,useState as X0}from"react";import{jsx as RT}from"react/jsx-runtime";import"react";var id="gutter",Bo=t=>{let{children:e,className:o,left:n=!0,negativeLeft:r=!1,negativeRight:s=!1,ref:i,right:a=!0}=t,l=n&&!r,c=a&&!s;return RT("div",{className:[l&&`${id}--left`,c&&`${id}--right`,r&&`${id}--negative-left`,s&&`${id}--negative-right`,o].filter(Boolean).join(" "),ref:i,children:e})};import{c as _T}from"react/compiler-runtime";import{useId as DT}from"react";var bl=t=>{let e=_T(3),o=DT(),n=ct(),r=`${t}-${o}`,s;return e[0]!==n||e[1]!==r?(s=jp({slug:r,depth:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};var Dr="drawer",Mp=100,jp=({slug:t,depth:e})=>`drawer_${e}_${t}`,ur=t=>{let e=Op(17),o,n,r,s,i,a;e[0]!==t?({slug:a,children:o,className:n,disabled:r,onClick:s,...i}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=a):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],a=e[6]);let{openModal:l}=ue(),c;e[7]!==s||e[8]!==l||e[9]!==a?(c=f=>{l(a),typeof s=="function"&&s(f)},e[7]=s,e[8]=l,e[9]=a,e[10]=c):c=e[10];let u=c,d;return e[11]!==o||e[12]!==n||e[13]!==r||e[14]!==u||e[15]!==i?(d=gn("button",{className:n,disabled:r,onClick:u,type:"button",...i,children:o}),e[11]=o,e[12]=n,e[13]=r,e[14]=u,e[15]=i,e[16]=d):d=e[16],d},Pt=t=>{let e=Op(26),{slug:o,children:n,className:r,gutter:s,Header:i,hoverTitle:a,title:l}=t,c=s===void 0?!0:s,{t:u}=k(),{closeModal:d,modalState:f}=ue(),m=Wi(),[h,p]=X0(!1),[g,b]=X0(!1),v,x;e[0]!==f||e[1]!==o?(v=()=>{p(f[o]?.isOpen)},x=[o,f],e[0]=f,e[1]=o,e[2]=v,e[3]=x):(v=e[2],x=e[3]),z0(v,x);let y,C;if(e[4]!==h?(y=()=>{b(h)},C=[h],e[4]=h,e[5]=y,e[6]=C):(y=e[5],C=e[6]),z0(y,C),h){let S=g&&`${Dr}--is-open`,w=m>1&&`${Dr}--nested`,D;e[7]!==r||e[8]!==S||e[9]!==w?(D=[r,Dr,S,w].filter(Boolean),e[7]=r,e[8]=S,e[9]=w,e[10]=D):D=e[10];let _=D.join(" "),A=Mp+m,F;if(e[11]!==i||e[12]!==n||e[13]!==d||e[14]!==m||e[15]!==c||e[16]!==a||e[17]!==o||e[18]!==u||e[19]!==A||e[20]!==_||e[21]!==l){let R;e[23]!==d||e[24]!==o?(R=()=>d(o),e[23]=d,e[24]=o,e[25]=R):R=e[25],F=gn(TT,{children:ad(Yo,{className:_,slug:o,style:{zIndex:A},children:[(!m||m===1)&&gn("div",{className:`${Dr}__blur-bg`}),gn("button",{"aria-label":u("general:close"),className:`${Dr}__close`,id:`close-drawer__${o}`,onClick:R,type:"button"}),ad("div",{className:`${Dr}__content`,style:{width:`calc(100% - (${m} * var(--gutter-h)))`},children:[gn("div",{className:`${Dr}__blur-bg-content`}),ad(Bo,{className:`${Dr}__content-children`,left:c,right:c,children:[i,i===void 0&&ad("div",{className:`${Dr}__header`,children:[gn("h2",{className:`${Dr}__header__title`,title:a?l:null,children:l}),gn("button",{"aria-label":u("general:close"),className:`${Dr}__header__close`,id:`close-drawer__${o}`,onClick:()=>d(o),type:"button",children:gn(pt,{})})]}),n]})]})]})}),e[11]=i,e[12]=n,e[13]=d,e[14]=m,e[15]=c,e[16]=a,e[17]=o,e[18]=u,e[19]=A,e[20]=_,e[21]=l,e[22]=F}else F=e[22];return F}return null},U0=FT(1),TT=t=>{let e=Op(3),{children:o}=t,r=Wi()+1,s;return e[0]!==o||e[1]!==r?(s=gn(U0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},Wi=()=>AT(U0);var ld="confirmation-modal";function It(t){let e=ET(33),{body:o,cancelLabel:n,className:r,confirmingLabel:s,confirmLabel:i,heading:a,modalSlug:l,onCancel:c,onConfirm:u}=t,d=Wi(),[f,m]=PT.useState(!1),{closeModal:h}=ue(),{t:p}=k(),g;e[0]!==h||e[1]!==f||e[2]!==l||e[3]!==u?(g=async()=>{f||(m(!0),typeof u=="function"&&await u(),m(!1),h(l))},e[0]=h,e[1]=f,e[2]=l,e[3]=u,e[4]=g):g=e[4];let b=g,v;e[5]!==h||e[6]!==f||e[7]!==l||e[8]!==c?(v=()=>{f||(h(l),typeof c=="function"&&c())},e[5]=h,e[6]=f,e[7]=l,e[8]=c,e[9]=v):v=e[9];let x=v,y;e[10]!==r?(y=[ld,r].filter(Boolean),e[10]=r,e[11]=y):y=e[11];let C=y.join(" "),S=Mp+d,w;if(e[12]!==o||e[13]!==n||e[14]!==i||e[15]!==f||e[16]!==s||e[17]!==a||e[18]!==l||e[19]!==x||e[20]!==b||e[21]!==p||e[22]!==C||e[23]!==S){let D;e[25]!==n||e[26]!==p?(D=n||p("general:cancel"),e[25]=n,e[26]=p,e[27]=D):D=e[27];let _;e[28]!==i||e[29]!==f||e[30]!==s||e[31]!==p?(_=f?s||`${p("general:loading")}...`:i||p("general:confirm"),e[28]=i,e[29]=f,e[30]=s,e[31]=p,e[32]=_):_=e[32],w=vl(Yo,{className:C,slug:l,style:{zIndex:S},children:Bp("div",{className:`${ld}__wrapper`,children:[Bp("div",{className:`${ld}__content`,children:[vl("h1",{children:a}),vl("p",{children:o})]}),Bp("div",{className:`${ld}__controls`,children:[vl(ne,{buttonStyle:"secondary",disabled:f,id:"confirm-cancel",onClick:x,size:"large",type:"button",children:D}),vl(ne,{id:"confirm-action",onClick:b,size:"large",children:_})]})]})}),e[12]=o,e[13]=n,e[14]=i,e[15]=f,e[16]=s,e[17]=a,e[18]=l,e[19]=x,e[20]=b,e[21]=p,e[22]=C,e[23]=S,e[24]=w}else w=e[24];return w}var Vp="stay-logged-in",Y0=()=>{let t=NT(11),{refreshCookie:e}=De(),o=$T(),{config:n}=H(),{admin:r,routes:s}=n,{routes:i}=r,{logout:a}=i,{admin:l}=s,{t:c}=k(),{startRouteTransition:u}=st(),d;t[0]!==l||t[1]!==a||t[2]!==o||t[3]!==u?(d=()=>u(()=>o.push(kT({adminRoute:l,path:a}))),t[0]=l,t[1]=a,t[2]=o,t[3]=u,t[4]=d):d=t[4];let f=d,m;t[5]!==e?(m=()=>{e()},t[5]=e,t[6]=m):m=t[6];let h=m,p;return t[7]!==h||t[8]!==f||t[9]!==c?(p=LT(It,{body:c("authentication:youAreInactive"),cancelLabel:c("authentication:stayLoggedIn"),confirmLabel:c("authentication:logOut"),heading:c("authentication:stayLoggedIn"),modalSlug:Vp,onCancel:h,onConfirm:f}),t[7]=h,t[8]=f,t[9]=c,t[10]=p):p=t[10],p};import{c as jT}from"react/compiler-runtime";import{useEffect as OT,useState as MT}from"react";function Jo(t,e){let o=jT(4),[n,r]=MT(t),s,i;return o[0]!==e||o[1]!==t?(s=()=>{let a=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(a)}},i=[t,e],o[0]=e,o[1]=t,o[2]=s,o[3]=i):(s=o[2],i=o[3]),OT(s,i),n}import*as Z0 from"qs-esm";var Qe={delete:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"delete"};return fetch(t,n)},get:(t,e={headers:{}})=>{let o="";return e.params&&(o=Z0.stringify(e.params,{addQueryPrefix:!0})),fetch(`${t}${o}`,{credentials:"include",...e})},patch:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"PATCH"};return fetch(t,n)},post:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"post"};return fetch(`${t}`,n)},put:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"put"};return fetch(t,n)}};var K0=HT({}),q0=2147483647;function Gp({children:t,permissions:e,user:o}){let[n,r]=xl(o),[s,i]=xl(),[a,l]=xl(),c=VT(),u=GT(),{config:d}=H(),{admin:{routes:{inactivity:f},user:m},routes:{admin:h,api:p},serverURL:g}=d,[b,v]=xl(e),{i18n:x}=k(),{closeAllModals:y,openModal:C}=ue(),[S,w]=xl(0),D=Jo(S,1e4),_=J0.useRef(null),{startRouteTransition:A}=st(),F=n?.id,R=Ms(()=>{A(()=>u.replace(WT({adminRoute:h,path:`${f}${window.location.pathname.startsWith(h)?`?redirect=${encodeURIComponent(window.location.pathname)}`:""}`}))),y()},[u,h,f,y,A]),I=Ms(()=>{i(void 0),l(void 0),clearTimeout(_.current)},[]),E=Ms(L=>{L?.user?(r(L.user),i(L.token),l(L.exp)):(r(null),I())},[I]),T=Ms(L=>{let V=Math.round(new Date().getTime()/1e3),M=(typeof a=="number"?a:0)-V;return(L||a&&M<120)&&(_.current=setTimeout(()=>{async function O(){try{let B=await Qe.post(`${g}${p}/${m}/refresh-token?refresh`,{headers:{"Accept-Language":x.language}});if(B.status===200){let G=await B.json();E(G)}else E(null),R()}catch(B){me.error(B.message)}}O()},1e3)),()=>{clearTimeout(_.current)}},[p,x.language,R,g,E,a,m]),$=Ms(async L=>{try{let V=await Qe.post(`${g}${p}/${m}/refresh-token`,{headers:{"Accept-Language":x.language}});if(V.status===200){let M=await V.json();return L||E(M),M.user}return E(null),R(),null}catch(V){return me.error(`Refreshing token failed: ${V.message}`),null}},[p,x.language,R,g,E,m]),j=Ms(async()=>{try{return await Qe.post(`${g}${p}/${n.collection}/logout`),E(null),I(),!0}catch(L){return me.error(`Logging out failed: ${L.message}`),!1}},[p,I,g,E,n]),N=Ms(async({locale:L}={})=>{let V=Q0.stringify({locale:L},{addQueryPrefix:!0});try{let M=await Qe.get(`${g}${p}/access${V}`,{headers:{"Accept-Language":x.language}});if(M.status===200){let O=await M.json();v(O)}else throw new Error(`Fetching permissions failed with status code ${M.status}`)}catch(M){me.error(`Refreshing permissions failed: ${M.message}`)}},[g,p,x]),P=J0.useCallback(async()=>{try{let L=await Qe.get(`${g}${p}/${m}/me`,{credentials:"include",headers:{"Accept-Language":x.language}});if(L.status===200){let V=await L.json(),M=null;return E(V),M}}catch(L){me.error(`Fetching user failed: ${L.message}`)}return null},[g,p,m,x.language,E]);return cd(()=>{P()},[P]),cd(()=>{F&&T()},[D,T,F]),cd(()=>{w(Date.now())},[c]),cd(()=>{let L,V,M=Math.round(new Date().getTime()/1e3),O=typeof a=="number"?a-M:0,B=Math.max(Math.min((O-60)*1e3,q0),0),G=Math.max(Math.min(O*1e3,q0),0);if(!n){clearTimeout(L),clearTimeout(V);return}return O>0&&(L=setTimeout(()=>{C(Vp)},B),V=setTimeout(()=>{E(null),R()},G)),()=>{L&&clearTimeout(L),V&&clearTimeout(V)}},[a,C,x,E,n,R]),BT(K0,{value:{fetchFullUser:P,logOut:j,permissions:b,refreshCookie:T,refreshCookieAsync:$,refreshPermissions:N,setPermissions:v,setUser:E,token:s,user:n},children:t})}var De=()=>zT(K0);import{jsx as XT}from"react/jsx-runtime";import{dequal as ex}from"dequal/lite";import{createContext as UT,use as YT,useCallback as tx,useEffect as ZT,useRef as Hp}from"react";function Wp(t,e){let o={...t};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&!Array.isArray(e[n])&&t[n]?o[n]=Wp(t[n],e[n]):o[n]=e[n]);return o}var rx=UT({}),ox=(t,e)=>({body:JSON.stringify({value:t}),headers:{"Accept-Language":e,"Content-Type":"application/json"}}),zp=({children:t})=>{let e=Hp({}),o=Hp({}),n=Hp({}),{config:r}=H(),{user:s}=De(),{i18n:i}=k(),{routes:{api:a},serverURL:l}=r;ZT(()=>{s||(o.current={})},[s]);let c=tx(async d=>{let f=o.current;if(typeof f[d]<"u")return f[d];let m=new Promise(h=>{(async()=>{let p=await Qe.get(`${l}${a}/payload-preferences/${d}`,{headers:{"Accept-Language":i.language}}),g=null;p.status===200&&(g=(await p.json()).value),o.current[d]=g,h(g)})()});return f[d]=m,m},[i.language,a,o,l]),u=tx(async(d,f,m=!1)=>{if(m===!1){o.current[d]=f,await Qe.post(`${l}${a}/payload-preferences/${d}`,ox(f,i.language));return}let h=f,p=await c(d);if(typeof f=="object"&&typeof p=="object"&&typeof h=="object"){if(p&&(h=Wp(p,h)),ex(h,p))return;n.current[d]={...n.current[d],...h}}else{if(h===p)return;n.current[d]=h}let g=async()=>{ex(n.current[d],o.current[d])||(o.current[d]=n.current[d],await Qe.post(`${l}${a}/payload-preferences/${d}`,ox(o.current[d],i.language)),delete n.current[d])};setTimeout(()=>{g()})},[a,c,i.language,n,l]);return e.current.getPreference=c,e.current.setPreference=u,XT(rx,{value:e.current,children:t})},Fo=()=>YT(rx);var lx=ix({}),cx=ix({localeIsLoading:!1,setLocaleIsLoading:t=>{}}),tE=async(t,e)=>await fetch(`${e}/payload-preferences/${t}`,{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"})?.then(o=>o.json()),Xp=t=>{let e=JT(27),{children:o,locale:n}=t,{config:r}=H(),{localization:s,routes:i,serverURL:a}=r,l=s===void 0?!1:s,{api:c}=i,{user:u}=De(),d=l?l.defaultLocale:"en",{getPreference:f}=Fo(),m=qT(),h;e[0]!==m?(h=m.get("locale"),e[0]=m,e[1]=h):h=e[1];let p=h,g;e[2]!==d||e[3]!==n||e[4]!==p||e[5]!==l?(g=()=>!l||l&&!l.locales.length?{}:Yn(l,p)||Yn(l,n)||Yn(l,d)||Yn(l,l.locales[0].code),e[2]=d,e[3]=n,e[4]=p,e[5]=l,e[6]=g):g=e[6];let[b,v]=QT.useState(g),[x,y]=eE(!1),C=KT(b),S,w;e[7]!==b?(S=()=>{b.code!==C.current.code&&y(!1),C.current=b},w=[b],e[7]=b,e[8]=S,e[9]=w):(S=e[8],w=e[9]),sx(S,w);let D=`${a}${c}`,_;e[10]!==d||e[11]!==D||e[12]!==p||e[13]!==l||e[14]!==u?.id?(_=()=>{(async function(){if(l&&u?.id){let T=p||await tE("locale",D)?.then(oE),$=Yn(l,T)||Yn(l,d)||Yn(l,l?.locales?.[0]?.code);$&&v($)}})()},e[10]=d,e[11]=D,e[12]=p,e[13]=l,e[14]=u?.id,e[15]=_):_=e[15];let A=u?.id,F;e[16]!==d||e[17]!==D||e[18]!==f||e[19]!==p||e[20]!==l||e[21]!==A?(F=[d,f,l,D,p,A],e[16]=d,e[17]=D,e[18]=f,e[19]=p,e[20]=l,e[21]=A,e[22]=F):F=e[22],sx(_,F);let R;return e[23]!==o||e[24]!==x||e[25]!==b?(R=nx(lx,{value:b,children:nx(cx,{value:{localeIsLoading:x,setLocaleIsLoading:y},children:o})}),e[23]=o,e[24]=x,e[25]=b,e[26]=R):R=e[26],R},ud=()=>ax(cx),Pe=()=>ax(lx);function oE(t){return t.value}var dd=(t,e,o)=>`field-${t?.replace(/\./g,"__")}${e>1?`-${e}`:""}${o?`-${o}`:""}`;var ve=t=>{let e=rE(25),{as:o,hideLocale:n,htmlFor:r,label:s,localized:i,path:a,required:l,unstyled:c}=t,u=o===void 0?"label":o,d=n===void 0?!1:n,f=i===void 0?!1:i,m=l===void 0?!1:l,h=c===void 0?!1:c,{uuid:p}=Oe(),g=ct(),b;e[0]!==g||e[1]!==r||e[2]!==a||e[3]!==p?(b=r||dd(a,g,p),e[0]=g,e[1]=r,e[2]=a,e[3]=p,e[4]=b):b=e[4];let v=b,{i18n:x}=k(),{code:y,label:C}=Pe();if(s){let S=`field-label ${h?"unstyled":""}`,w;if(e[5]!==u||e[6]!==y||e[7]!==d||e[8]!==v||e[9]!==x||e[10]!==s||e[11]!==C||e[12]!==f||e[13]!==m||e[14]!==S||e[15]!==h){let D;e[17]!==m||e[18]!==h?(D=m&&!h&&nE("span",{className:"required",children:"*"}),e[17]=m,e[18]=h,e[19]=D):D=e[19];let _;e[20]!==y||e[21]!==d||e[22]!==C||e[23]!==f?(_=f&&!d&&ux("span",{className:"localized",children:["\u2014 ",typeof C=="string"?C:y]}),e[20]=y,e[21]=d,e[22]=C,e[23]=f,e[24]=_):_=e[24],w=ux(u,{className:S,htmlFor:v,children:[sE(s,x),D,_]}),e[5]=u,e[6]=y,e[7]=d,e[8]=v,e[9]=x,e[10]=s,e[11]=C,e[12]=f,e[13]=m,e[14]=S,e[15]=h,e[16]=w}else w=e[16];return w}return null};var md=({collapsed:t,rowID:e,rows:o})=>o.reduce((n,r)=>(e===r.id&&(r.collapsed=t),r.collapsed&&n.collapsedIDs.push(r.id),n.updatedRows.push(r),n),{collapsedIDs:[],updatedRows:[]}),fd=({collapsed:t,rows:e})=>e.reduce((o,n)=>(n.collapsed=t,t&&o.collapsedIDs.push(n.id),o.updatedRows.push(n),o),{collapsedIDs:[],updatedRows:[]});import{c as UE}from"react/compiler-runtime";import{jsx as sy}from"react/jsx-runtime";import*as iy from"react";import{jsx as Dl,jsxs as HE}from"react/jsx-runtime";import{useCallback as ny,useMemo as zE}from"react";import{c as VE}from"react/compiler-runtime";import{useRef as ey}from"react";import{c as iE}from"react/compiler-runtime";import{useEffect as aE,useRef as lE}from"react";var Bs=(t,e,o)=>{let n=iE(9),r;n[0]!==o?(r=o===void 0?[]:o,n[0]=o,n[1]=r):r=n[1];let s=r,i;n[2]===Symbol.for("react.memo_cache_sentinel")?(i=Date.now(),n[2]=i):i=n[2];let a=lE(i),l;n[3]!==t||n[4]!==e?(l=()=>{let u=setTimeout(()=>{Date.now()-a.current>=e&&(t(),a.current=Date.now())},e-(Date.now()-a.current));return()=>{clearTimeout(u)}},n[3]=t,n[4]=e,n[5]=l):l=n[5];let c;n[6]!==e||n[7]!==s?(c=[e,...s],n[6]=e,n[7]=s,n[8]=c):c=n[8],aE(l,c)};import{jsx as rh}from"react/jsx-runtime";import*as Jx from"qs-esm";import Yx,{createContext as NE,use as LE,useCallback as Yi,useEffect as Zx,useMemo as $E,useRef as kE,useState as qo}from"react";import{getTranslation as AE}from"@payloadcms/translations";var cE={},yl={};function Hi(t,e){try{let n=(cE[t]||=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format)(e).split("GMT")[1]||"";return n in yl?yl[n]:dx(n,n.split(":"))}catch{if(t in yl)return yl[t];let o=t?.match(uE);return o?dx(t,o.slice(1)):NaN}}var uE=/([+-]\d\d):?(\d\d)?/;function dx(t,e){let o=+e[0],n=+(e[1]||0);return yl[t]=o>0?o*60+n:o*60-n}var Mt=class t extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Hi(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),fx(this,NaN),Up(this)):this.setTime(Date.now())}static tz(e,...o){return o.length?new t(...o,e):new t(Date.now(),e)}withTimeZone(e){return new t(+this,e)}getTimezoneOffset(){return-Hi(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Up(this),+this}[Symbol.for("constructDateFrom")](e){return new t(+new Date(e),this.timeZone)}},mx=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!mx.test(t))return;let e=t.replace(mx,"$1UTC");Mt.prototype[e]&&(t.startsWith("get")?Mt.prototype[t]=function(){return this.internal[e]()}:(Mt.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),dE(this),+this},Mt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Up(this),+this}))});function Up(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function dE(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),fx(t)}function fx(t){let e=Hi(t.timeZone,t),o=new Date(+t);o.setUTCHours(o.getUTCHours()-1);let n=-new Date(+t).getTimezoneOffset(),r=-new Date(+o).getTimezoneOffset(),s=n-r,i=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();s&&i&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+s);let a=n-e;a&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+a);let l=Hi(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-l,d=l!==e,f=u-a;if(d&&f){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+f);let m=Hi(t.timeZone,t),h=l-m;h&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+h),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+h))}}var mE=Math.pow(10,8)*24*60*60*1e3,gJ=-mE,pd=6048e5,px=864e5;var Cl=43200,Yp=1440;var fE=3600;var hx=fE*24,bJ=hx*7,pE=hx*365.2425,hE=pE/12,vJ=hE*3,Zp=Symbol.for("constructDateFrom");function ao(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Zp in t?t[Zp](e):t instanceof Date?new t.constructor(e):new Date(e)}function Ke(t,e){return ao(e||t,t)}var gE={};function qr(){return gE}function bn(t,e){let o=qr(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,r=Ke(t,e?.in),s=r.getDay(),i=(s<n?7:0)+s-n;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Vs(t,e){return bn(t,{...e,weekStartsOn:1})}function hd(t,e){let o=Ke(t,e?.in),n=o.getFullYear(),r=ao(o,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let s=Vs(r),i=ao(o,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let a=Vs(i);return o.getTime()>=s.getTime()?n+1:o.getTime()>=a.getTime()?n:n-1}function zi(t){let e=Ke(t),o=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return o.setUTCFullYear(e.getFullYear()),+t-+o}function Jn(t,...e){let o=ao.bind(null,t||e.find(n=>typeof n=="object"));return e.map(o)}function Jp(t,e){let o=Ke(t,e?.in);return o.setHours(0,0,0,0),o}function gx(t,e,o){let[n,r]=Jn(o?.in,t,e),s=Jp(n),i=Jp(r),a=+s-zi(s),l=+i-zi(i);return Math.round((a-l)/px)}function bx(t,e){let o=hd(t,e),n=ao(e?.in||t,0);return n.setFullYear(o,0,4),n.setHours(0,0,0,0),Vs(n)}function Xi(t,e){let o=+Ke(t)-+Ke(e);return o<0?-1:o>0?1:o}function vx(t){return ao(t,Date.now())}function xx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function yx(t){return!(!xx(t)&&typeof t!="number"||isNaN(+Ke(t)))}function Cx(t,e,o){let[n,r]=Jn(o?.in,t,e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function wx(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function Sx(t,e){return+Ke(t)-+Ke(e)}function Ix(t,e){let o=Ke(t,e?.in);return o.setHours(23,59,59,999),o}function Rx(t,e){let o=Ke(t,e?.in),n=o.getMonth();return o.setFullYear(o.getFullYear(),n+1,0),o.setHours(23,59,59,999),o}function _x(t,e){let o=Ke(t,e?.in);return+Ix(o,e)==+Rx(o,e)}function Dx(t,e,o){let[n,r,s]=Jn(o?.in,t,t,e),i=Xi(r,s),a=Math.abs(Cx(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=Xi(r,s)===-i;_x(n)&&a===1&&Xi(n,s)===1&&(l=!1);let c=i*(a-+l);return c===0?0:c}function Fx(t,e,o){let n=Sx(t,e)/1e3;return wx(o?.roundingMethod)(n)}function Ax(t,e){let o=Ke(t,e?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}function Tx(t,e){let o=Ke(t,e?.in);return gx(o,Ax(o))+1}function Ex(t,e){let o=Ke(t,e?.in),n=+Vs(o)-+bx(o);return Math.round(n/pd)+1}function gd(t,e){let o=Ke(t,e?.in),n=o.getFullYear(),r=qr(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=ao(e?.in||t,0);i.setFullYear(n+1,0,s),i.setHours(0,0,0,0);let a=bn(i,e),l=ao(e?.in||t,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);let c=bn(l,e);return+o>=+a?n+1:+o>=+c?n:n-1}function Px(t,e){let o=qr(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,r=gd(t,e),s=ao(e?.in||t,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),bn(s,e)}function Nx(t,e){let o=Ke(t,e?.in),n=+bn(o,e)-+Px(o,e);return Math.round(n/pd)+1}function it(t,e){let o=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return o+n}var vn={y(t,e){let o=t.getFullYear(),n=o>0?o:1-o;return it(e==="yy"?n%100:n,e.length)},M(t,e){let o=t.getMonth();return e==="M"?String(o+1):it(o+1,2)},d(t,e){return it(t.getDate(),e.length)},a(t,e){let o=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(t,e){return it(t.getHours()%12||12,e.length)},H(t,e){return it(t.getHours(),e.length)},m(t,e){return it(t.getMinutes(),e.length)},s(t,e){return it(t.getSeconds(),e.length)},S(t,e){let o=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,o-3));return it(r,e.length)}};var Ui={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qp={G:function(t,e,o){let n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})}},y:function(t,e,o){if(e==="yo"){let n=t.getFullYear(),r=n>0?n:1-n;return o.ordinalNumber(r,{unit:"year"})}return vn.y(t,e)},Y:function(t,e,o,n){let r=gd(t,n),s=r>0?r:1-r;if(e==="YY"){let i=s%100;return it(i,2)}return e==="Yo"?o.ordinalNumber(s,{unit:"year"}):it(s,e.length)},R:function(t,e){let o=hd(t);return it(o,e.length)},u:function(t,e){let o=t.getFullYear();return it(o,e.length)},Q:function(t,e,o){let n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return it(n,2);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,o){let n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return it(n,2);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,o){let n=t.getMonth();switch(e){case"M":case"MM":return vn.M(t,e);case"Mo":return o.ordinalNumber(n+1,{unit:"month"});case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,o){let n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return it(n+1,2);case"Lo":return o.ordinalNumber(n+1,{unit:"month"});case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,o,n){let r=Nx(t,n);return e==="wo"?o.ordinalNumber(r,{unit:"week"}):it(r,e.length)},I:function(t,e,o){let n=Ex(t);return e==="Io"?o.ordinalNumber(n,{unit:"week"}):it(n,e.length)},d:function(t,e,o){return e==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):vn.d(t,e)},D:function(t,e,o){let n=Tx(t);return e==="Do"?o.ordinalNumber(n,{unit:"dayOfYear"}):it(n,e.length)},E:function(t,e,o){let n=t.getDay();switch(e){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,o,n){let r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return it(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(r,{width:"short",context:"formatting"});case"eeee":default:return o.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,o,n){let r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return it(s,e.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,o){let n=t.getDay(),r=n===0?7:n;switch(e){case"i":return String(r);case"ii":return it(r,e.length);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return o.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(n,{width:"short",context:"formatting"});case"iiii":default:return o.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,o){let r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,o){let n=t.getHours(),r;switch(n===12?r=Ui.noon:n===0?r=Ui.midnight:r=n/12>=1?"pm":"am",e){case"b":case"bb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,o){let n=t.getHours(),r;switch(n>=17?r=Ui.evening:n>=12?r=Ui.afternoon:n>=4?r=Ui.morning:r=Ui.night,e){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,o){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),o.ordinalNumber(n,{unit:"hour"})}return vn.h(t,e)},H:function(t,e,o){return e==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):vn.H(t,e)},K:function(t,e,o){let n=t.getHours()%12;return e==="Ko"?o.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},k:function(t,e,o){let n=t.getHours();return n===0&&(n=24),e==="ko"?o.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},m:function(t,e,o){return e==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):vn.m(t,e)},s:function(t,e,o){return e==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):vn.s(t,e)},S:function(t,e){return vn.S(t,e)},X:function(t,e,o){let n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return $x(n);case"XXXX":case"XX":return Gs(n);case"XXXXX":case"XXX":default:return Gs(n,":")}},x:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"x":return $x(n);case"xxxx":case"xx":return Gs(n);case"xxxxx":case"xxx":default:return Gs(n,":")}},O:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Lx(n,":");case"OOOO":default:return"GMT"+Gs(n,":")}},z:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Lx(n,":");case"zzzz":default:return"GMT"+Gs(n,":")}},t:function(t,e,o){let n=Math.trunc(+t/1e3);return it(n,e.length)},T:function(t,e,o){return it(+t,e.length)}};function Lx(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=Math.trunc(n/60),s=n%60;return s===0?o+String(r):o+String(r)+e+it(s,2)}function $x(t,e){return t%60===0?(t>0?"-":"+")+it(Math.abs(t)/60,2):Gs(t,e)}function Gs(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=it(Math.trunc(n/60),2),s=it(n%60,2);return o+r+e+s}var kx=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},jx=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},bE=(t,e)=>{let o=t.match(/(P+)(p+)?/)||[],n=o[1],r=o[2];if(!r)return kx(t,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",kx(n,e)).replace("{{time}}",jx(r,e))},Ox={p:jx,P:bE};var vE=/^D+$/,xE=/^Y+$/,yE=["D","DD","YY","YYYY"];function Mx(t){return vE.test(t)}function Bx(t){return xE.test(t)}function Vx(t,e,o){let n=CE(t,e,o);if(console.warn(n),yE.includes(t))throw new RangeError(n)}function CE(t,e,o){let n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var wE=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,SE=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IE=/^'([^]*?)'?$/,RE=/''/g,_E=/[a-zA-Z]/;function Qp(t,e,o){let n=qr(),r=o?.locale??n.locale??ol,s=o?.firstWeekContainsDate??o?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=o?.weekStartsOn??o?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Ke(t,o?.in);if(!yx(a))throw new RangeError("Invalid time value");let l=e.match(SE).map(u=>{let d=u[0];if(d==="p"||d==="P"){let f=Ox[d];return f(u,r.formatLong)}return u}).join("").match(wE).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:DE(u)};if(qp[d])return{isToken:!0,value:u};if(d.match(_E))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));let c={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return l.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!o?.useAdditionalWeekYearTokens&&Bx(d)||!o?.useAdditionalDayOfYearTokens&&Mx(d))&&Vx(d,e,String(t));let f=qp[d[0]];return f(a,d,r.localize,c)}).join("")}function DE(t){let e=t.match(IE);return e?e[1].replace(RE,"'"):t}function Gx(t,e,o){let n=qr(),r=o?.locale??n.locale??ol,s=2520,i=Xi(t,e);if(isNaN(i))throw new RangeError("Invalid time value");let a=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:i}),[l,c]=Jn(o?.in,...i>0?[e,t]:[t,e]),u=Fx(c,l),d=(zi(c)-zi(l))/1e3,f=Math.round((u-d)/60),m;if(f<2)return o?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):f===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",f,a);if(f<45)return r.formatDistance("xMinutes",f,a);if(f<90)return r.formatDistance("aboutXHours",1,a);if(f<Yp){let h=Math.round(f/60);return r.formatDistance("aboutXHours",h,a)}else{if(f<s)return r.formatDistance("xDays",1,a);if(f<Cl){let h=Math.round(f/Yp);return r.formatDistance("xDays",h,a)}else if(f<Cl*2)return m=Math.round(f/Cl),r.formatDistance("aboutXMonths",m,a)}if(m=Dx(c,l),m<12){let h=Math.round(f/Cl);return r.formatDistance("xMonths",h,a)}else{let h=m%12,p=Math.trunc(m/12);return h<3?r.formatDistance("aboutXYears",p,a):h<9?r.formatDistance("overXYears",p,a):r.formatDistance("almostXYears",p+1,a)}}function Wx(t,e){return Gx(t,vx(t),e)}function Fr(t,e){let o=FE(e)?new e(0):ao(e,0);return o.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),o.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),o}function FE(t){return typeof t=="function"&&t.prototype?.constructor===t}var xn=({date:t,i18n:e,pattern:o,timezone:n})=>{let r=new Mt(new Date(t));if(n){let s=Mt.tz(n),i=r.withTimeZone(n),a=Fr(i,s);return e.dateFNS?Qp(a,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`}return e.dateFNS?Qp(r,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`},Hx=({date:t,i18n:e})=>{let o=new Date(t);return e?.dateFNS?Wx(o,{locale:e.dateFNS}):`${e.t("general:loading")}...`};function Kp(t){return typeof t=="object"&&"root"in t}function bd(t,e){for(let o of t)"text"in o&&o.text?e+=o.text:"children"in o||(e+=`[${o.type}]`),"children"in o&&o.children&&(e+=bd(o.children,e));return e}var dr=({collectionConfig:t,data:e,dateFormat:o,fallback:n,globalConfig:r,i18n:s})=>{let i;if(t){let a=t?.admin?.useAsTitle;if(a&&(i=e?.[a]||i,i)){let l=t.fields.find(u=>"name"in u&&u.name===a);if(l?.type==="date"){let u="date"in l.admin&&l?.admin?.date?.displayFormat||o;i=xn({date:i,i18n:s,pattern:u})||i}}}return r&&(i=AE(r?.label,s)||r?.slug),Kp(i)&&(i=bd(i.root.children?.[0]?.children||[],"")),!i&&Kp(n)&&(i=bd(n.root.children?.[0]?.children||[],"")),i||(i=typeof n=="string"?n:`[${s.t("general:untitled")}]`),i};import{c as TE}from"react/compiler-runtime";import{jsx as EE}from"react/jsx-runtime";import eh from"react";var zx=eh.createContext({getUploadEdits:()=>{},resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),th=t=>{let e=TE(10),{children:o,initialUploadEdits:n}=t,r;e[0]!==n?(r=n||{},e[0]=n,e[1]=r):r=e[1];let[s,i]=eh.useState(r),a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{i({})},e[2]=a):a=e[2];let l=a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h=>{i(p=>({...p||{},...h||{}}))},e[3]=c):c=e[3];let u=c,d;e[4]!==s?(d=()=>s,e[4]=s,e[5]=d):d=e[5];let f=d,m;return e[6]!==o||e[7]!==f||e[8]!==s?(m=EE(zx,{value:{getUploadEdits:f,resetUploadEdits:l,updateUploadEdits:u,uploadEdits:s},children:o}),e[6]=o,e[7]=f,e[8]=s,e[9]=m):m=e[9],m},Ws=()=>eh.use(zx);import*as oh from"qs-esm";import PE from"react";var wl=t=>{let{collectionSlug:e,docPermissions:o,globalSlug:n,isEditing:r}=t;return e?!!(r&&o?.update||!r&&o?.create):n?!!o?.update:!1};var Xx=({id:t,collectionSlug:e,globalSlug:o})=>!!(o||e&&t);var Ux=({id:t,api:e,collectionSlug:o,globalSlug:n,i18n:r,locale:s,permissions:i,serverURL:a,setDocPermissions:l,setHasPublishPermission:c,setHasSavePermission:u})=>PE.useCallback(async d=>{let f={locale:s||void 0},m=d?.id||t,h=Xx({id:m,collectionSlug:o,globalSlug:n});if(h){let p=o?`/${o}/access/${m}`:n?`/globals/${n}/access`:null;if(p){let b=await(await fetch(`${a}${e}${p}?${oh.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"post"})).json(),v=await fetch(`${a}${e}${p}?${oh.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"POST"}).then(x=>x.json());l(b),u(wl({collectionSlug:o,docPermissions:b,globalSlug:n,isEditing:h})),c(v?.update)}}else{let p=o?i?.collections?.[o]:i?.globals?.[n];l(p),u(wl({collectionSlug:o,docPermissions:p,globalSlug:n,isEditing:h}))}},[a,e,t,i,r.language,s,o,n]);var qx=NE({}),Ee=()=>LE(qx),jE=({children:t,...e})=>{let{id:o,collectionSlug:n,currentEditor:r,docPermissions:s,globalSlug:i,hasPublishedDoc:a,hasPublishPermission:l,hasSavePermission:c,initialData:u,initialState:d,isLocked:f,lastUpdateTime:m,mostRecentVersionIsAutosaved:h,unpublishedVersionCount:p,versionCount:g}=e,[b,v]=qo(s),[x,y]=qo(c),[C,S]=qo(l),{permissions:w}=De(),{config:{admin:{dateFormat:D},routes:{api:_},serverURL:A},getEntityConfig:F}=H(),R=F({collectionSlug:n}),I=F({globalSlug:i}),E=kE(new AbortController),T=R||I,{i18n:$}=k(),{uploadEdits:j}=Ws(),[N,P]=qo(()=>dr({collectionConfig:R,data:{...u||{},id:o},dateFormat:D,fallback:o?.toString(),globalConfig:I,i18n:$})),[L,V]=qo(h),[M,O]=qo(g),[B,G]=qo(a),[X,Z]=qo(p),[te,U]=qo(f),[z,le]=qo(r),[J,ce]=qo(m),[re,q]=qo(u),[pe,he]=qo("idle"),Re=Yi(Ge=>{he(Ge)},[]),{getPreference:ge,setPreference:Ve}=Fo(),{code:Q}=Pe(),{localeIsLoading:Le}=ud(),_e=$E(()=>d===void 0||u===void 0||Le,[u,d,Le]),ae=`${A}${_}`,se,Y,ie;i&&(se=i,Y="globals",ie=`global-${se}`),n&&(se=n,Y="collections",o&&(ie=`collection-${se}-${o}`));let de=Yi(async(Ge,Je)=>{try{let xt=Je===i?`where[globalSlug][equals]=${Je}`:`where[document.value][equals]=${Ge}&where[document.relationTo][equals]=${Je}`,jt=await Qe.get(`${A}${_}/payload-locked-documents?${xt}`),{docs:gt}=await jt.json();if(gt.length>0){let qe=gt[0].id;await Qe.delete(`${A}${_}/payload-locked-documents/${qe}`,{headers:{"Content-Type":"application/json"}}),U(!1)}}catch(Ye){console.error("Failed to unlock the document",Ye)}},[A,_,i]),Ce=Yi(async(Ge,Je,Ye)=>{try{let jt=Je===i?`where[globalSlug][equals]=${Je}`:`where[document.value][equals]=${Ge}&where[document.relationTo][equals]=${Je}`,gt=await Qe.get(`${A}${_}/payload-locked-documents?${jt}`),{docs:qe}=await gt.json();if(qe.length>0){let Tt=qe[0].id,be=typeof Ye=="object"?{relationTo:Ye.collection,value:Ye.id}:{relationTo:"users",value:Ye};await Qe.patch(`${A}${_}/payload-locked-documents/${Tt}`,{body:JSON.stringify({user:be}),headers:{"Content-Type":"application/json"}})}}catch(xt){console.error("Failed to update the document editor",xt)}},[A,_,i]),ze=Ux({id:o,api:_,collectionSlug:n,globalSlug:i,i18n:$,locale:Q,permissions:w,serverURL:A,setDocPermissions:v,setHasPublishPermission:S,setHasSavePermission:y}),$e=Yi(()=>ge(ie),[ge,ie]),ot=Yi(async(Ge,Je)=>{let Ye=await $e();if(ie)try{await Ve(ie,{...Ye,fields:{...Ye?.fields||{},[Ge]:{...Ye?.fields?.[Ge],...Je}}})}catch(xt){console.error(xt)}},[Ve,ie,$e]),Xe=Yi(()=>{let Ge=M+1;R&&R.versions?R.versions.maxPerDoc>0?O(Math.min(Ge,R.versions.maxPerDoc)):O(Ge):I&&I.versions&&(I.versions.max>0?O(Math.min(Ge,I.versions.max)):O(Ge))},[R,I,M]),Ue=Yx.useCallback(Ge=>{q(Ge)},[]);Zx(()=>{P(dr({collectionConfig:R,data:{...re,id:o},dateFormat:D,fallback:o?.toString(),globalConfig:I,i18n:$}))},[R,I,re,D,$,o]),Zx(()=>{let Ge=E.current;return()=>{if(Ge)try{Ge.abort()}catch{}}},[]);let ft=Yx.useMemo(()=>`${`${ae}${Y==="globals"?"/globals":""}/${se}${o?`/${o}`:""}`}${Jx.stringify({depth:0,"fallback-locale":"null",locale:Q,uploadEdits:j||void 0},{addQueryPrefix:!0})}`,[ae,Q,Y,o,se,j]),Qt={...e,action:ft,currentEditor:z,docConfig:T,docPermissions:b,documentIsLocked:te,getDocPermissions:ze,getDocPreferences:$e,hasPublishedDoc:B,hasPublishPermission:C,hasSavePermission:x,incrementVersionCount:Xe,initialData:u,initialState:d,isInitializing:_e,lastUpdateTime:J,mostRecentVersionIsAutosaved:L,preferencesKey:ie,savedDocumentData:re,setCurrentEditor:le,setDocFieldPreferences:ot,setDocumentIsLocked:U,setDocumentTitle:P,setHasPublishedDoc:G,setLastUpdateTime:ce,setMostRecentVersionIsAutosaved:V,setUnpublishedVersionCount:Z,setUploadStatus:Re,title:N,unlockDocument:de,unpublishedVersionCount:X,updateDocumentEditor:Ce,updateSavedDocumentData:Ue,uploadStatus:pe,versionCount:M};return rh(qx,{value:Qt,children:t})},Sl=t=>rh(th,{children:rh(jE,{...t})});import{jsx as OE}from"react/jsx-runtime";import{createContext as ME,use as BE}from"react";var vd=ME(""),Il=({children:t,operation:e})=>OE(vd,{value:e,children:t}),Qo=()=>BE(vd);import Qx from"react";var nh=Qx.createContext(void 0),Kx=()=>{let t=Qx.useContext(nh);if(t)return t};var Te=t=>{let e=VE(64),o;e[0]!==t?(o=t||{},e[0]=t,e[1]=o):o=e[1];let{disableFormData:n,hasRows:r,path:s,potentiallyStalePath:i,validate:a}=o,l=n===void 0?!1:n,c=Kx(),u=s||c||i,d=Xt(),f=lr(),m=Ts(),{user:h}=De(),{id:p,collectionSlug:g}=Ee(),b=Qo(),v=Et(GE),x;e[2]!==u?(x=pe=>{let[he]=pe;return he&&he?.[u]||null},e[2]=u,e[3]=x):x=e[3];let y=Et(x),{t:C}=k(),{config:S}=H(),{getData:w,getDataByPath:D,getSiblingData:_,setModified:A}=Oe(),F=$i(),R=Ut(),I=y?.filterOptions,E=y?.value,T=y?.initialValue,$=typeof y?.valid=="boolean"?y.valid:!0,j=$===!1&&d,N=ey($),P=ey(y?.errorMessage),L;e[4]!==u?(L=u?u.split("."):[],e[4]=u,e[5]=L):L=e[5];let V=L,M;e[6]!==l||e[7]!==v||e[8]!==r||e[9]!==R||e[10]!==u||e[11]!==A?(M=(pe,he)=>{let Re=he===void 0?!1:he,ge=pe&&pe.target?pe.target.value:pe;v({type:"UPDATE",disableFormData:l||r&&ge>0,path:u,value:ge}),Re||typeof A=="function"&&R===!1&&setTimeout(()=>{A(!0)},10)},e[6]=l,e[7]=v,e[8]=r,e[9]=R,e[10]=u,e[11]=A,e[12]=M):M=e[12];let O=M,B,G=y?.customComponents,X=f||m,Z=y?.errorMessage,te;e[13]!==y?.errorPaths?(te=y?.errorPaths||[],e[13]=y?.errorPaths,e[14]=te):te=e[14];let U=y?.rows,z=y?.valid,le;e[15]!==I||e[16]!==T||e[17]!==m||e[18]!==u||e[19]!==f||e[20]!==O||e[21]!==j||e[22]!==d||e[23]!==U||e[24]!==z||e[25]!==G||e[26]!==X||e[27]!==Z||e[28]!==te||e[29]!==E?(le={customComponents:G,disabled:X,errorMessage:Z,errorPaths:te,filterOptions:I,formInitializing:m,formProcessing:f,formSubmitted:d,initialValue:T,path:u,rows:U,setValue:O,showError:j,valid:z,value:E},e[15]=I,e[16]=T,e[17]=m,e[18]=u,e[19]=f,e[20]=O,e[21]=j,e[22]=d,e[23]=U,e[24]=z,e[25]=G,e[26]=X,e[27]=Z,e[28]=te,e[29]=E,e[30]=le):le=e[30],B=le;let J=B,ce;e[31]!==g||e[32]!==S||e[33]!==l||e[34]!==v||e[35]!==F||e[36]!==y||e[37]!==w||e[38]!==D||e[39]!==_||e[40]!==r||e[41]!==p||e[42]!==b||e[43]!==u||e[44]!==V||e[45]!==C||e[46]!==h||e[47]!==a||e[48]!==E?(ce=()=>{(async()=>{let he=E;y?.rows&&Array.isArray(y.rows)&&(he=D(u));let Re=P.current,ge=N.current,Ve=w(),Q=typeof a=="function"?await a(he,{id:p,blockData:void 0,collectionSlug:g,data:F?.getData?F.getData():Ve,event:"onChange",operation:b,path:V,preferences:{},req:{payload:{config:S},t:C,user:h},siblingData:_(u)}):typeof P.current=="string"?P.current:N.current;if(typeof Q=="string"?(ge=!1,Re=Q):typeof Q=="boolean"&&(ge=Q,Re=void 0),ge!==N.current||Re!==P.current){N.current=ge,P.current=Re;let Le={type:"UPDATE",errorMessage:Re,path:u,rows:y?.rows,valid:ge,validate:a,value:E};(l||r&&typeof E=="number"&&E>0)&&(Le.disableFormData=!0),typeof v=="function"&&v(Le)}})()},e[31]=g,e[32]=S,e[33]=l,e[34]=v,e[35]=F,e[36]=y,e[37]=w,e[38]=D,e[39]=_,e[40]=r,e[41]=p,e[42]=b,e[43]=u,e[44]=V,e[45]=C,e[46]=h,e[47]=a,e[48]=E,e[49]=ce):ce=e[49];let re=y?.rows,q;return e[50]!==g||e[51]!==l||e[52]!==v||e[53]!==w||e[54]!==D||e[55]!==_||e[56]!==p||e[57]!==b||e[58]!==u||e[59]!==re||e[60]!==h||e[61]!==a||e[62]!==E?(q=[E,l,v,w,_,D,p,b,u,h,a,re,g],e[50]=g,e[51]=l,e[52]=v,e[53]=w,e[54]=D,e[55]=_,e[56]=p,e[57]=b,e[58]=u,e[59]=re,e[60]=h,e[61]=a,e[62]=E,e[63]=q):q=e[63],Bs(ce,150,q),J};function GE(t){let[,e]=t;return e}import{jsx as ty}from"react/jsx-runtime";import"react";import{c as WE}from"react/compiler-runtime";var sh=t=>{let e=WE(2),{children:o,path:n}=t,r;e[0]!==n?(r=a=>{let[l]=a;return l&&l?.[n]||null},e[0]=n,e[1]=r):r=e[1];let s=Et(r),{passesCondition:i}=s||{};return i===!1?null:o};var je=t=>o=>{let{path:n}=o;return ty(sh,{path:n,children:ty(t,{...o})})};var rt=t=>({...t?.admin?.style||{},...t?.admin?.width?{"--field-width":t.admin.width}:{flex:"1 1 auto"},...t?.admin?.style?.flex?{flex:t.admin.style.flex}:{}});var ye="field-type";function Zi({fieldLocalized:t,fieldRTL:e,locale:o,localizationConfig:n}){let r=o&&n&&n.locales&&n.locales.length>1,s=o?.code===n?.defaultLocale;return e!==!1&&o?.rtl===!0&&(t||!t&&!r||!t&&s)||e===!0}import{jsx as Rl,jsxs as lh}from"react/jsx-runtime";import"react";import{jsx as oy}from"react/jsx-runtime";import"react";var ih=()=>oy("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:oy("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})});import{jsx as ry}from"react/jsx-runtime";import"react";var ah=()=>ry("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ry("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})});var _l="checkbox-input",Hs=({id:t,name:e,AfterInput:o,BeforeInput:n,checked:r,className:s,inputRef:i,Label:a,label:l,localized:c,onToggle:u,partialChecked:d,readOnly:f,required:m})=>lh("div",{className:[s,_l,r&&`${_l}--checked`,f&&`${_l}--read-only`].filter(Boolean).join(" "),children:[lh("div",{className:`${_l}__input`,children:[n,Rl("input",{"aria-label":"",defaultChecked:!!r,disabled:f,id:t,name:e,onInput:u,ref:i,required:m,type:"checkbox"}),lh("span",{className:[`${_l}__icon`,!r&&d?"partial":"check"].filter(Boolean).join(" "),children:[r&&Rl(ih,{}),!r&&d&&Rl(ah,{})]}),o]}),Rl(oe,{CustomComponent:a,Fallback:Rl(ve,{htmlFor:t,label:l,localized:c,required:m})})]});var ch="checkbox";var XE=t=>{let{id:e,checked:o,disableFormData:n,field:r,field:{admin:{className:s,description:i}={},label:a,required:l}={},onChange:c,partialChecked:u,path:d,readOnly:f,validate:m}=t,{uuid:h}=Oe(),p=ct(),g=ny((T,$)=>{if(typeof m=="function")return m(T,{...$,required:l})},[m,l]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,path:w,setValue:D,showError:_,value:A}=Te({disableFormData:n,potentiallyStalePath:d,validate:g}),F=ny(()=>{f||(D(!A),typeof c=="function"&&c(!A))},[c,f,D,A]),R=o||!!A,I=e||dd(w,p,h),E=zE(()=>rt(r),[r]);return HE("div",{className:[ye,ch,_&&"error",s,A&&`${ch}--checked`,(f||S)&&`${ch}--read-only`].filter(Boolean).join(" "),style:E,children:[Dl(oe,{CustomComponent:y,Fallback:Dl(He,{path:w,showError:_})}),Dl(Hs,{AfterInput:b,BeforeInput:v,checked:R,id:I,inputRef:null,Label:C,label:a,name:w,onToggle:F,partialChecked:u,readOnly:f||S,required:l}),Dl(oe,{CustomComponent:x,Fallback:Dl(Be,{description:i,path:w})})]})},mr=je(XE);var Fl=t=>{let e=UE(4),{fieldValue:o,localized:n,path:r}=t,{code:s}=Pe(),{config:i}=H(),{localization:a}=i,[l,c]=iy.useState(typeof o!="number"),{t:u}=k();if(!n||!a||a.defaultLocale===s||!a.fallback)return null;if(o){let f=!1;if(typeof o=="number"&&o>0&&(f=!0),Array.isArray(o)&&o.length>0&&(f=!0),f)return l&&c(!1),null}let d;return e[0]!==l||e[1]!==r||e[2]!==u?(d=sy(Ir,{children:sy(mr,{checked:l,field:{name:"",label:u("general:fallbackToDefaultLocale")},id:`field-${r.replace(/\./g,"__")}`,path:r,schemaPath:""})}),e[0]=l,e[1]=r,e[2]=u,e[3]=d):d=e[3],d};var Ji=t=>{let e=document.getElementById(t);if(e){let o=e.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:o.top-100})}};import{c as rM}from"react/compiler-runtime";import{jsx as ys,jsxs as nM}from"react/jsx-runtime";import{getTranslation as sM}from"@payloadcms/translations";import"react";import{c as ZE}from"react/compiler-runtime";import{jsx as yn,jsxs as zs}from"react/jsx-runtime";import JE from"react";import{jsx as ay}from"react/jsx-runtime";import"react";var Al=()=>ay("svg",{className:"icon icon--copy",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:ay("path",{className:"stroke",d:"M4.66666 12.6667C3.93333 12.6667 3.33333 12.0667 3.33333 11.3333V4.66668C3.33333 3.93334 3.93333 3.33334 4.66666 3.33334H11.3333C12.0667 3.33334 12.6667 3.93334 12.6667 4.66668M8.66666 7.33334H15.3333C16.0697 7.33334 16.6667 7.9303 16.6667 8.66668V15.3333C16.6667 16.0697 16.0697 16.6667 15.3333 16.6667H8.66666C7.93028 16.6667 7.33333 16.0697 7.33333 15.3333V8.66668C7.33333 7.9303 7.93028 7.33334 8.66666 7.33334Z",strokeLinecap:"square"})});import{jsx as uh,jsxs as YE}from"react/jsx-runtime";import"react";var dh=({className:t})=>YE("svg",{className:["icon icon--more",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[uh("path",{className:"fill",d:"M10 10.6666C10.3682 10.6666 10.6667 10.3682 10.6667 9.99998C10.6667 9.63179 10.3682 9.33331 10 9.33331C9.63182 9.33331 9.33334 9.63179 9.33334 9.99998C9.33334 10.3682 9.63182 10.6666 10 10.6666Z",strokeLinecap:"square"}),uh("path",{className:"fill",d:"M14.6667 10.6666C15.0349 10.6666 15.3333 10.3682 15.3333 9.99998C15.3333 9.63179 15.0349 9.33331 14.6667 9.33331C14.2985 9.33331 14 9.63179 14 9.99998C14 10.3682 14.2985 10.6666 14.6667 10.6666Z",strokeLinecap:"square"}),uh("path",{className:"fill",d:"M5.33334 10.6666C5.70153 10.6666 6.00001 10.3682 6.00001 9.99998C6.00001 9.63179 5.70153 9.33331 5.33334 9.33331C4.96515 9.33331 4.66667 9.63179 4.66667 9.99998C4.66667 10.3682 4.96515 10.6666 5.33334 10.6666Z",strokeLinecap:"square"})]});var Ko="array-actions",xd=t=>{let e=ZE(10),{addRow:o,duplicateRow:n,hasMaxRows:r,index:s,isSortable:i,moveRow:a,removeRow:l,rowCount:c}=t,{t:u}=k(),d;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==u?(d=yn(ho,{button:yn(dh,{}),buttonClassName:`${Ko}__button`,className:Ko,horizontalAlign:"center",render:f=>{let{close:m}=f;return zs(Me.ButtonGroup,{buttonSize:"small",children:[i&&s!==0&&zs(Me.Button,{className:`${Ko}__action ${Ko}__move-up`,onClick:()=>{a(s,s-1),m()},children:[yn("div",{className:`${Ko}__action-chevron`,children:yn(Ze,{direction:"up"})}),u("general:moveUp")]}),i&&s<c-1&&zs(Me.Button,{className:`${Ko}__action`,onClick:()=>{a(s,s+1),m()},children:[yn("div",{className:`${Ko}__action-chevron`,children:yn(Ze,{})}),u("general:moveDown")]}),!r&&zs(JE.Fragment,{children:[zs(Me.Button,{className:`${Ko}__action ${Ko}__add`,onClick:()=>{o(s+1),m()},children:[yn(jo,{}),u("general:addBelow")]}),zs(Me.Button,{className:`${Ko}__action ${Ko}__duplicate`,onClick:()=>{n(s),m()},children:[yn(Al,{}),u("general:duplicate")]})]}),zs(Me.Button,{className:`${Ko}__action ${Ko}__remove`,onClick:()=>{l(s),m()},children:[yn(pt,{}),u("general:remove")]})]})},size:"medium"}),e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=a,e[6]=l,e[7]=c,e[8]=u,e[9]=d):d=e[9],d};import{c as iP}from"react/compiler-runtime";import{jsx as Tr,jsxs as ph}from"react/jsx-runtime";import{useState as my}from"react";import{jsx as qi,jsxs as qE}from"react/jsx-runtime";import"react";var Cn=({className:t})=>qE("svg",{className:["icon icon--drag-handle",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[qi("path",{className:"fill",d:"M7.99999 10.6667C8.36818 10.6667 8.66666 10.3682 8.66666 9.99999C8.66666 9.6318 8.36818 9.33332 7.99999 9.33332C7.63181 9.33332 7.33333 9.6318 7.33333 9.99999C7.33333 10.3682 7.63181 10.6667 7.99999 10.6667Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M7.99999 5.99999C8.36818 5.99999 8.66666 5.70151 8.66666 5.33332C8.66666 4.96513 8.36818 4.66666 7.99999 4.66666C7.63181 4.66666 7.33333 4.96513 7.33333 5.33332C7.33333 5.70151 7.63181 5.99999 7.99999 5.99999Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M7.99999 15.3333C8.36818 15.3333 8.66666 15.0348 8.66666 14.6667C8.66666 14.2985 8.36818 14 7.99999 14C7.63181 14 7.33333 14.2985 7.33333 14.6667C7.33333 15.0348 7.63181 15.3333 7.99999 15.3333Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M12 10.6667C12.3682 10.6667 12.6667 10.3682 12.6667 9.99999C12.6667 9.6318 12.3682 9.33332 12 9.33332C11.6318 9.33332 11.3333 9.6318 11.3333 9.99999C11.3333 10.3682 11.6318 10.6667 12 10.6667Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M12 5.99999C12.3682 5.99999 12.6667 5.70151 12.6667 5.33332C12.6667 4.96513 12.3682 4.66666 12 4.66666C11.6318 4.66666 11.3333 4.96513 11.3333 5.33332C11.3333 5.70151 11.6318 5.99999 12 5.99999Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M12 15.3333C12.3682 15.3333 12.6667 15.0348 12.6667 14.6667C12.6667 14.2985 12.3682 14 12 14C11.6318 14 11.3333 14.2985 11.3333 14.6667C11.3333 15.0348 11.6318 15.3333 12 15.3333Z",strokeLinecap:"square"})]});import{jsx as cy}from"react/jsx-runtime";import yd,{useEffect as tP,useRef as fh}from"react";import{useEffect as QE,useMemo as KE,useRef as mh,useState as eP}from"react";var ly=({containerRef:t,contentRef:e,duration:o,open:n})=>{let r=KE(()=>typeof CSS<"u"&&CSS&&CSS.supports?CSS.supports("interpolate-size","allow-keywords"):!1,[]),s=mh(!1),i=mh(n),[a,l]=eP(!1),c=mh(null);return QE(()=>{let u=t.current,d=e.current;if(!u||!d||r)return;let f=p=>{u.style.height=p},m=()=>{u&&(u.style.transition="",u.style.height=n?"auto":"0px",l(!1))};return(()=>{if(!s.current&&n){f("auto"),l(!1);return}s.current=!0,i.current!==n&&f(n?"0px":`${d.scrollHeight}px`),u.offsetHeight,l(!0),u.style.transition=`height ${o}ms ease`,f(n?`${d.scrollHeight}px`:"0px");let p=()=>{m(),u.removeEventListener("transitionend",p)};u.addEventListener("transitionend",p)})(),i.current=n,c.current=new ResizeObserver(()=>{a&&(u.style.height=n?`${d.scrollHeight}px`:"0px")}),c.current.observe(d),()=>{u&&(u.style.transition="",u.style.height=""),c.current?.disconnect()}},[n,o,t,e,r]),{browserSupportsKeywordAnimation:r}};var Ar=({id:t,children:e,className:o,duration:n=300,height:r})=>{let[s,i]=yd.useState(()=>!!r),a=fh(s),[l,c]=yd.useState(()=>s?"":"none"),[u,d]=yd.useState(()=>s?"":"hidden"),[f,m]=yd.useState(!1),h=fh(null),p=fh(null);return tP(()=>{let g,b,v=!!r,x=a.current!==v;return a.current=v,x&&(m(!0),d("hidden"),v?c(""):g=window.setTimeout(()=>{c("none")},n),i(v),b=window.setTimeout(()=>{d(""),m(!1)},n)),()=>{g&&clearTimeout(g),b&&clearTimeout(b)}},[r,n]),ly({containerRef:h,contentRef:p,duration:n,open:s}),cy("div",{"aria-hidden":!s,className:[o,"rah-static",s&&r==="auto"&&"rah-static--height-auto",f&&`rah-animating--${s?"down":"up"}`,f&&r==="auto"&&"rah-animating--to-height-auto"].filter(Boolean).join(" "),id:t,ref:h,style:{overflow:u,transition:`height ${n}ms ease`},children:cy("div",{ref:p,...l?{style:{display:l}}:{},children:e})})};import{jsx as oP}from"react/jsx-runtime";import rP,{createContext as nP,use as sP}from"react";var uy=nP({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),dy=({children:t,isCollapsed:e,isWithinCollapsible:o=!0,toggle:n})=>{let{isCollapsed:r,isVisible:s}=qn(),i=rP.useMemo(()=>({isCollapsed:e,isVisible:s&&!r,isWithinCollapsible:o,toggle:n}),[e,o,n,r,s]);return oP(uy,{value:i,children:t})},qn=()=>sP(uy);var wo="collapsible";var Xs=t=>{let e=iP(26),{actions:o,children:n,className:r,collapsibleStyle:s,dragHandleProps:i,header:a,initCollapsed:l,isCollapsed:c,onToggle:u}=t,d=s===void 0?"default":s,[f,m]=my(!!l),[h,p]=my(!1),{isWithinCollapsible:g}=qn(),{t:b}=k(),v=typeof c=="boolean"?c:f,x;e[0]!==v||e[1]!==u?(x=()=>{typeof u=="function"&&u(!v),m(!v)},e[0]=v,e[1]=u,e[2]=x):x=e[2];let y=x,C=i&&`${wo}--has-drag-handle`,S=v&&`${wo}--collapsed`,w=g&&`${wo}--nested`,D=h&&`${wo}--hovered`,_=`${wo}--style-${d}`,A;e[3]!==r||e[4]!==C||e[5]!==S||e[6]!==w||e[7]!==D||e[8]!==_?(A=[wo,r,C,S,w,D,_].filter(Boolean),e[3]=r,e[4]=C,e[5]=S,e[6]=w,e[7]=D,e[8]=_,e[9]=A):A=e[9];let F=A.join(" "),R,I;e[10]===Symbol.for("react.memo_cache_sentinel")?(R=()=>p(!0),I=()=>p(!1),e[10]=R,e[11]=I):(R=e[10],I=e[11]);let E=`${wo}__toggle--${v?"collapsed":"open"}`,T;e[12]!==E?(T=[`${wo}__toggle`,E].filter(Boolean),e[12]=E,e[13]=T):T=e[13];let $=T.join(" "),j;if(e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==a||e[18]!==v||e[19]!==b||e[20]!==$||e[21]!==F||e[22]!==y){let N;e[24]!==i?(N=i&&Tr("div",{className:`${wo}__drag`,...i.attributes,...i.listeners,children:Tr(Cn,{})}),e[24]=i,e[25]=N):N=e[25],j=Tr("div",{className:F,children:ph(dy,{isCollapsed:v,toggle:y,children:[ph("div",{className:`${wo}__toggle-wrap`,onMouseEnter:R,onMouseLeave:I,children:[Tr("button",{className:$,onClick:y,type:"button",children:Tr("span",{children:b("fields:toggleBlock")})}),N,a?Tr("div",{className:[`${wo}__header-wrap`,i&&`${wo}__header-wrap--has-drag-handle`].filter(Boolean).join(" "),children:a}):null,ph("div",{className:`${wo}__actions-wrap`,children:[o?Tr("div",{className:`${wo}__actions`,children:o}):null,Tr("div",{className:`${wo}__indicator`,children:Tr(Ze,{direction:v?void 0:"up"})})]})]}),Tr(Ar,{height:v?0:"auto",children:Tr("div",{className:`${wo}__content`,children:n})})]})}),e[14]=o,e[15]=n,e[16]=i,e[17]=a,e[18]=v,e[19]=b,e[20]=$,e[21]=F,e[22]=y,e[23]=j}else j=e[23];return j};import{c as KO}from"react/compiler-runtime";import{jsx as _b}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as eM,getFieldPaths as tM,getFieldPermissions as oM}from"payload/shared";import"react";import{c as aP}from"react/compiler-runtime";import{jsx as lP}from"react/jsx-runtime";import fy from"react";var py=t=>{let e=aP(9),{children:o,className:n,forceRender:r}=t,[s,i]=fy.useState(!!r),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={rootMargin:"1000px"},e[0]=a):a=e[0];let[l,c]=mn(a,!!r),u=!!c?.isIntersecting,d=c?.boundingClientRect?.top<0,f=r||u||d,m,h;e[1]!==s||e[2]!==f?(m=()=>{f&&!s&&i(!0)},h=[f,s],e[1]=s,e[2]=f,e[3]=m,e[4]=h):(m=e[3],h=e[4]),fy.useEffect(m,h);let p=s?o:null,g;return e[5]!==n||e[6]!==l||e[7]!==p?(g=lP("div",{className:n,ref:l,children:p}),e[5]=n,e[6]=l,e[7]=p,e[8]=g):g=e[8],g};import{c as QO}from"react/compiler-runtime";import{jsx as Ft}from"react/jsx-runtime";import"react";import{c as TP}from"react/compiler-runtime";import{jsx as Yt,jsxs as es}from"react/jsx-runtime";import{getTranslation as xh}from"@payloadcms/translations";import EP,{Fragment as PP}from"react";import{c as DP}from"react/compiler-runtime";import{jsx as Er,jsxs as Py,Fragment as FP}from"react/jsx-runtime";import{getTranslation as AP}from"@payloadcms/translations";import"react";import{c as cP}from"react/compiler-runtime";import{jsx as Tl,jsxs as uP}from"react/jsx-runtime";import"react";var fr="pill",dP=t=>{let e=cP(12),{id:o,className:n}=t,r;e[0]!==o?(r={id:o},e[0]=o,e[1]=r):r=e[1];let{attributes:s,isDragging:i,listeners:a,setNodeRef:l,transform:c}=Oi(r),u=i&&`${fr}--is-dragging`,d;e[2]!==n||e[3]!==u?(d=[u,n].filter(Boolean),e[2]=n,e[3]=u,e[4]=d):d=e[4];let f=d.join(" "),m;return e[5]!==s||e[6]!==a||e[7]!==t||e[8]!==l||e[9]!==f||e[10]!==c?(m=Tl(hy,{...t,className:f,elementProps:{...a,...s,ref:l,style:{transform:c}}}),e[5]=s,e[6]=a,e[7]=t,e[8]=l,e[9]=f,e[10]=c,e[11]=m):m=e[11],m},hy=t=>{let{id:e,alignIcon:o="right","aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,children:a,className:l,draggable:c,elementProps:u,icon:d,onClick:f,pillStyle:m="light",rounded:h,size:p="medium",to:g}=t,b=[fr,`${fr}--style-${m}`,`${fr}--size-${p}`,l&&l,g&&`${fr}--has-link`,(g||f)&&`${fr}--has-action`,d&&`${fr}--has-icon`,d&&`${fr}--align-icon-${o}`,c&&`${fr}--draggable`,h&&`${fr}--rounded`].filter(Boolean).join(" "),v="div";return f&&!g&&(v="button"),g&&(v=no),uP(v,{...u,"aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,className:b,href:g||null,id:e,onClick:f,type:v==="button"?"button":void 0,children:[Tl("span",{className:`${fr}__label`,children:a}),!!d&&Tl("span",{className:`${fr}__icon`,children:d})]})},vt=t=>{let{draggable:e}=t;return e?Tl(dP,{...t}):Tl(hy,{...t})};import{useEffect as mP,useState as fP}from"react";function Cd(t,e){let[o,n]=fP(t);return mP(()=>{let r=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(r)}},[t,e]),o}import{c as IP}from"react/compiler-runtime";import{jsx as Dy,jsxs as RP}from"react/jsx-runtime";import Fy from"react";import{jsx as Qr,jsxs as Iy}from"react/jsx-runtime";import{getTranslation as Id}from"@payloadcms/translations";import{useEffect as Ry,useMemo as wP,useState as _y}from"react";import{c as pP}from"react/compiler-runtime";import{jsx as gy,jsxs as hP}from"react/jsx-runtime";import"react";var El="thumbnail-card",by=t=>{let e=pP(15),{alignLabel:o,className:n,collection:r,doc:s,label:i,onClick:a,thumbnail:l}=t,{config:c}=H(),{i18n:u}=k(),d=typeof a=="function"&&`${El}--has-on-click`,f=o&&`${El}--align-label-${o}`,m;e[0]!==n||e[1]!==d||e[2]!==f?(m=[El,n,d,f].filter(Boolean),e[0]=n,e[1]=d,e[2]=f,e[3]=m):m=e[3];let h=m.join(" "),p=i;if(!p){let b=s?.filename,v;e[4]!==r||e[5]!==c.admin.dateFormat||e[6]!==s||e[7]!==u||e[8]!==b?(v=dr({collectionConfig:r,data:s,dateFormat:c.admin.dateFormat,fallback:b,i18n:u}),e[4]=r,e[5]=c.admin.dateFormat,e[6]=s,e[7]=u,e[8]=b,e[9]=v):v=e[9],p=v}let g;return e[10]!==h||e[11]!==a||e[12]!==l||e[13]!==p?(g=hP("button",{className:h,onClick:a,title:p,type:"button",children:[gy("div",{className:`${El}__thumbnail`,children:l}),gy("div",{className:`${El}__label`,children:p})]}),e[10]=h,e[11]=a,e[12]=l,e[13]=p,e[14]=g):g=e[14],g};import{jsx as Sn,jsxs as xy}from"react/jsx-runtime";import{useState as xP}from"react";var bo=[];for(wd=0;wd<256;++wd)bo.push((wd+256).toString(16).slice(1));var wd;function vy(t,e=0){return(bo[t[e+0]]+bo[t[e+1]]+bo[t[e+2]]+bo[t[e+3]]+"-"+bo[t[e+4]]+bo[t[e+5]]+"-"+bo[t[e+6]]+bo[t[e+7]]+"-"+bo[t[e+8]]+bo[t[e+9]]+"-"+bo[t[e+10]]+bo[t[e+11]]+bo[t[e+12]]+bo[t[e+13]]+bo[t[e+14]]+bo[t[e+15]]).toLowerCase()}var Sd,gP=new Uint8Array(16);function hh(){if(!Sd&&(Sd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sd(gP)}var bP=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gh={randomUUID:bP};function vP(t,e,o){if(gh.randomUUID&&!e&&!t)return gh.randomUUID();t=t||{};var n=t.random||(t.rng||hh)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){o=o||0;for(var r=0;r<16;++r)e[o+r]=n[r];return e}return vy(n)}var wn=vP;var bh=()=>{let[t]=xP(()=>`pattern${wn()}`);return xy("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[xy("g",{clipPath:`url(#${t})`,children:[Sn("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),Sn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),Sn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),Sn("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),Sn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),Sn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),Sn("defs",{children:Sn("clipPath",{id:`${t}`,children:Sn("rect",{fill:"white",height:"151",width:"231"})})})]})};import{c as yP}from"react/compiler-runtime";import{jsx as Cy,jsxs as CP}from"react/jsx-runtime";import"react";import{jsx as yy}from"react/jsx-runtime";import"react";var Pl=()=>yy("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:yy("path",{className:"stroke",d:"M16 16L13.1333 13.1333M14.6667 9.33333C14.6667 12.2789 12.2789 14.6667 9.33333 14.6667C6.38781 14.6667 4 12.2789 4 9.33333C4 6.38781 6.38781 4 9.33333 4C12.2789 4 14.6667 6.38781 14.6667 9.33333Z",strokeLinecap:"square"})});var wy="block-search",Sy=t=>{let e=yP(5),{setSearchTerm:o}=t,{t:n}=k(),r;e[0]!==o?(r=a=>{o(a.target.value)},e[0]=o,e[1]=r):r=e[1];let s=r,i;return e[2]!==s||e[3]!==n?(i=CP("div",{className:wy,children:[Cy("input",{className:`${wy}__input`,onChange:s,placeholder:n("fields:searchForBlock")}),Cy(Pl,{})]}),e[2]=s,e[3]=n,e[4]=i):i=e[4],i};var Qn="blocks-drawer",SP=(t,e)=>typeof t.labels.singular=="string"?t.labels.singular.toLowerCase():typeof t.labels.singular=="object"?Id(t.labels.singular,e).toLowerCase():"",Nl=t=>{let{addRow:e,addRowIndex:o,blocks:n,drawerSlug:r,labels:s}=t,[i,a]=_y(""),[l,c]=_y(n),{closeModal:u,isModalOpen:d}=ue(),{i18n:f,t:m}=k(),{config:h}=H(),p=wP(()=>{let g={_none:[]};return l.forEach(b=>{if(typeof b=="object"&&b.admin?.group){let v=b.admin.group,x=typeof v=="string"?v:Id(v,f);Object.hasOwn(g,x)?g[x].push(b):g[x]=[b]}else g._none.push(b)}),g},[l,f]);return Ry(()=>{d(r)||a("")},[d,r]),Ry(()=>{let g=i.toLowerCase(),b=n?.reduce((v,x)=>{let y=typeof x=="string"?h.blocksMap[x]:x;return SP(y,f).includes(g)&&v.push(y),v},[]);c(b)},[i,n,f,h.blocksMap]),Iy(Pt,{slug:r,title:m("fields:addLabel",{label:Id(s.singular,f)}),children:[Qr(Sy,{setSearchTerm:a}),Qr("div",{className:`${Qn}__blocks-wrapper`,children:Qr("ul",{className:`${Qn}__block-groups`,children:Object.entries(p).map(([g,b])=>b.length?Iy("li",{className:[`${Qn}__block-group`,g==="_none"&&`${Qn}__block-group-none`].filter(Boolean).join(" "),children:[g!=="_none"&&Qr("h3",{className:`${Qn}__block-group-label`,children:g}),Qr("ul",{className:`${Qn}__blocks`,children:b.map((v,x)=>{let y=typeof v=="string"?h.blocksMap[v]:v,{slug:C,imageAltText:S,imageURL:w,labels:D}=y;return Qr("li",{className:`${Qn}__block`,children:Qr(by,{alignLabel:"center",label:Id(D?.singular,f),onClick:()=>{e(o,C),u(r)},thumbnail:Qr("div",{className:`${Qn}__default-image`,children:w?Qr("img",{alt:S,src:w}):Qr(bh,{})})})},x)})})]},g):null)})})]})};var Ay=t=>{let e=IP(26),{addRow:o,blocks:n,blockType:r,duplicateRow:s,hasMaxRows:i,isSortable:a,labels:l,moveRow:c,removeRow:u,rowCount:d,rowIndex:f}=t,{closeModal:m,openModal:h}=ue(),p=bl("blocks-drawer"),[g,b]=Fy.useState(null),v;e[0]!==o||e[1]!==m||e[2]!==p||e[3]!==g?(v=(y,C)=>{typeof o=="function"&&o(g,C),m(p)},e[0]=o,e[1]=m,e[2]=p,e[3]=g,e[4]=v):v=e[4];let x;if(e[5]!==r||e[6]!==n||e[7]!==p||e[8]!==s||e[9]!==i||e[10]!==a||e[11]!==l||e[12]!==c||e[13]!==h||e[14]!==u||e[15]!==d||e[16]!==f||e[17]!==v){let y;e[19]!==p||e[20]!==h?(y=S=>{b(S),h(p)},e[19]=p,e[20]=h,e[21]=y):y=e[21];let C;e[22]!==r||e[23]!==s||e[24]!==f?(C=()=>s(f,r),e[22]=r,e[23]=s,e[24]=f,e[25]=C):C=e[25],x=RP(Fy.Fragment,{children:[Dy(Nl,{addRow:v,addRowIndex:f,blocks:n,drawerSlug:p,labels:l}),Dy(xd,{addRow:y,duplicateRow:C,hasMaxRows:i,index:f,isSortable:a,moveRow:c,removeRow:u,rowCount:d})]}),e[5]=r,e[6]=n,e[7]=p,e[8]=s,e[9]=i,e[10]=a,e[11]=l,e[12]=c,e[13]=h,e[14]=u,e[15]=d,e[16]=f,e[17]=v,e[18]=x}else x=e[18];return x};import{c as _P}from"react/compiler-runtime";import{jsx as Ty}from"react/jsx-runtime";import"react";var Ey="section-title",vh=t=>{let e=_P(14),{customOnChange:o,customValue:n,path:r,readOnly:s}=t,i;e[0]!==r?(i={path:r},e[0]=r,e[1]=i):i=e[1];let{setValue:a,value:l}=Te(i),{t:c}=k(),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=[Ey].filter(Boolean),e[2]=u):u=e[2];let d=u.join(" "),f;e[3]!==o||e[4]!==a?(f=o||(g=>{g.stopPropagation(),g.preventDefault(),a(g.target.value)}),e[3]=o,e[4]=a,e[5]=f):f=e[5];let m=f,h=n||l,p;return e[6]!==n||e[7]!==m||e[8]!==r||e[9]!==s||e[10]!==c||e[11]!==h||e[12]!==l?(p=Ty("div",{className:d,"data-value":h,children:Ty("input",{className:`${Ey}__input`,id:r,name:r,onChange:m,placeholder:c("general:untitled"),readOnly:s,type:"text",value:n||l||""})}),e[6]=n,e[7]=m,e[8]=r,e[9]=s,e[10]=c,e[11]=h,e[12]=l,e[13]=p):p=e[13],p};var Kn="blocks-field",Ny=t=>{let e=DP(40),{addRow:o,attributes:n,block:r,blocks:s,duplicateRow:i,errorCount:a,fields:l,hasMaxRows:c,isLoading:u,isSortable:d,Label:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:v,readOnly:x,removeRow:y,row:C,rowCount:S,rowIndex:w,schemaPath:D,setCollapse:_,setNodeRef:A,transform:F}=t,R=Cd(u,500),{i18n:I}=k(),T=Xt()&&a>0,$=!r.admin?.disableBlockName,j=T?`${Kn}__row--has-errors`:`${Kn}__row--no-errors`,N;e[0]!==j?(N=[`${Kn}__row`,j].filter(Boolean),e[0]=j,e[1]=N):N=e[1];let P=N.join(" "),L;if(v===!0)L=!0;else{let O=v?.blocks?.[r.slug];O===!0?L=!0:L=O?.fields}let V=`${g?.split(".").join("-")}-row-${w}`,M;if(e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==r.fields||e[6]!==r.labels||e[7]!==L||e[8]!==s||e[9]!==P||e[10]!==i||e[11]!==a||e[12]!==T||e[13]!==l||e[14]!==c||e[15]!==I||e[16]!==R||e[17]!==d||e[18]!==m||e[19]!==h||e[20]!==p||e[21]!==g||e[22]!==b||e[23]!==x||e[24]!==y||e[25]!==C.blockType||e[26]!==C.collapsed||e[27]!==C.id||e[28]!==S||e[29]!==w||e[30]!==D||e[31]!==_||e[32]!==A||e[33]!==$||e[34]!==V||e[35]!==F){let O;e[37]!==C.id||e[38]!==_?(O=B=>_(C.id,B),e[37]=C.id,e[38]=_,e[39]=O):O=e[39],M=Er("div",{id:V,ref:A,style:{transform:F},children:Er(Xs,{actions:x?void 0:Er(Ay,{addRow:o,blocks:s,blockType:C.blockType,duplicateRow:i,fields:r.fields,hasMaxRows:c,isSortable:d,labels:m,moveRow:p,removeRow:y,rowCount:S,rowIndex:w}),className:P,collapsibleStyle:T?"error":"default",dragHandleProps:d?{id:C.id,attributes:n,listeners:h}:void 0,header:R?Er(St,{height:"1rem",width:"8rem"}):Py("div",{className:`${Kn}__block-header`,children:[Er(dn,{CustomComponent:f,label:Py(FP,{children:[Er("span",{className:`${Kn}__block-number`,children:String(w+1).padStart(2,"0")}),Er(vt,{className:`${Kn}__block-pill ${Kn}__block-pill-${C.blockType}`,pillStyle:"white",children:AP(r.labels.singular,I)}),$&&Er(vh,{path:`${b}.blockName`,readOnly:x})]}),path:b,rowNumber:w}),T&&Er(io,{count:a,i18n:I,withMessage:!0})]}),isCollapsed:C.collapsed,onToggle:O,children:R?Er(St,{}):Er(So,{className:`${Kn}__fields`,fields:l,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:D,permissions:L,readOnly:x})},C.id)},`${g}-row-${w}`),e[2]=f,e[3]=o,e[4]=n,e[5]=r.fields,e[6]=r.labels,e[7]=L,e[8]=s,e[9]=P,e[10]=i,e[11]=a,e[12]=T,e[13]=l,e[14]=c,e[15]=I,e[16]=R,e[17]=d,e[18]=m,e[19]=h,e[20]=p,e[21]=g,e[22]=b,e[23]=x,e[24]=y,e[25]=C.blockType,e[26]=C.collapsed,e[27]=C.id,e[28]=S,e[29]=w,e[30]=D,e[31]=_,e[32]=A,e[33]=$,e[34]=V,e[35]=F,e[36]=M}else M=e[36];return M};var Pr="blocks-field",NP=t=>{let e=TP(50),{i18n:o,t:n}=k(),{field:r,path:s,permissions:i,readOnly:a,schemaPath:l,validate:c}=t,{name:u,admin:d,blockReferences:f,blocks:m,label:h,labels:p,localized:g,maxRows:b,minRows:v,required:x}=r,y;e[0]!==d?(y=d===void 0?{}:d,e[0]=d,e[1]=y):y=e[1];let{className:C,description:S,isSortable:w}=y,D=w===void 0?!0:w,_=l??u,A=v??x?1:0,{setDocFieldPreferences:F}=Ee(),{addFieldRow:R,dispatchFields:I,moveFieldRow:E,removeFieldRow:T,setModified:$}=Oe(),{code:j}=Pe(),{config:N,config:P}=H(),{localization:L}=N,V=bl("blocks-drawer"),M=Xt(),O={plural:n("fields:blocks"),singular:n("fields:block"),...p},B;e:{if(L&&L.fallback){let K=L.defaultLocale;B=j===K;break e}B=!0}let G=B,X;e[2]!==G||e[3]!==b||e[4]!==A||e[5]!==x||e[6]!==c?(X=(K,W)=>{if(!G&&K===null)return!0;if(typeof c=="function")return c(K,{...W,maxRows:b,minRows:A,required:x})},e[2]=G,e[3]=b,e[4]=A,e[5]=x,e[6]=c,e[7]=X):X=e[7];let Z=X,te;e[8]!==Z||e[9]!==s?(te={hasRows:!0,potentiallyStalePath:s,validate:Z},e[8]=Z,e[9]=s,e[10]=te):te=e[10];let{customComponents:U,disabled:z,errorPaths:le,path:J,rows:ce,showError:re,valid:q,value:pe}=Te(te),he;e[11]!==U?(he=U===void 0?{}:U,e[11]=U,e[12]=he):he=e[12];let{AfterInput:Re,BeforeInput:ge,Description:Ve,Error:Q,Label:Le}=he,_e;e[13]!==ce?(_e=ce===void 0?[]:ce,e[13]=ce,e[14]=_e):_e=e[14];let ae=_e,se;e[15]!==R||e[16]!==J||e[17]!==_?(se=(K,W)=>{R({blockType:W,path:J,rowIndex:K,schemaPath:_}),setTimeout(()=>{Ji(`${J}-row-${K+1}`)},0)},e[15]=R,e[16]=J,e[17]=_,e[18]=se):se=e[18];let Y=se,ie;e[19]!==I||e[20]!==J||e[21]!==$?(ie=K=>{I({type:"DUPLICATE_ROW",path:J,rowIndex:K}),$(!0),setTimeout(()=>{Ji(`${J}-row-${K+1}`)},0)},e[19]=I,e[20]=J,e[21]=$,e[22]=ie):ie=e[22];let de=ie,Ce;e[23]!==J||e[24]!==T?(Ce=K=>{T({path:J,rowIndex:K})},e[23]=J,e[24]=T,e[25]=Ce):Ce=e[25];let ze=Ce,$e;e[26]!==E||e[27]!==J?($e=(K,W)=>{E({moveFromIndex:K,moveToIndex:W,path:J})},e[26]=E,e[27]=J,e[28]=$e):$e=e[28];let ot=$e,Xe;e[29]!==I||e[30]!==J||e[31]!==ae||e[32]!==F?(Xe=K=>{let{collapsedIDs:W,updatedRows:ee}=fd({collapsed:K,rows:ae});I({type:"SET_ALL_ROWS_COLLAPSED",path:J,updatedRows:ee}),F(J,{collapsed:W})},e[29]=I,e[30]=J,e[31]=ae,e[32]=F,e[33]=Xe):Xe=e[33];let Ue=Xe,ft;e[34]!==I||e[35]!==J||e[36]!==ae||e[37]!==F?(ft=(K,W)=>{let{collapsedIDs:ee,updatedRows:fe}=md({collapsed:W,rowID:K,rows:ae});I({type:"SET_ROW_COLLAPSED",path:J,updatedRows:fe}),F(J,{collapsed:ee})},e[34]=I,e[35]=J,e[36]=ae,e[37]=F,e[38]=ft):ft=e[38];let Qt=ft,Ge=b&&ae.length>=b,Je=le.length,Ye=M&&Je+(q?0:1)>0,xt=ae.length<A||x&&ae.length===0,jt=a&&ae.length===0,gt=Ye?`${Pr}--has-error`:`${Pr}--has-no-error`,qe;e[39]!==C||e[40]!==gt?(qe=[ye,Pr,C,gt].filter(Boolean),e[39]=C,e[40]=gt,e[41]=qe):qe=e[41];let Tt;e[42]!==Q||e[43]!==J||e[44]!==re?(Tt=re&&Yt(oe,{CustomComponent:Q,Fallback:Yt(He,{path:J,showError:re})}),e[42]=Q,e[43]=J,e[44]=re,e[45]=Tt):Tt=e[45];let be;return e[46]!==Je||e[47]!==Ye||e[48]!==o?(be=Ye&&Je>0&&Yt(io,{count:Je,i18n:o,withMessage:!0}),e[46]=Je,e[47]=Ye,e[48]=o,e[49]=be):be=e[49],es("div",{className:qe.join(" "),id:`field-${J?.replace(/\./g,"__")}`,children:[Tt,es("header",{className:`${Pr}__header`,children:[es("div",{className:`${Pr}__header-wrap`,children:[es("div",{className:`${Pr}__heading-with-error`,children:[Yt("h3",{children:Yt(oe,{CustomComponent:Le,Fallback:Yt(ve,{label:h,localized:g,path:J,required:x})})}),be]}),ae.length>0&&es("ul",{className:`${Pr}__header-actions`,children:[Yt("li",{children:Yt("button",{className:`${Pr}__header-action`,onClick:()=>Ue(!0),type:"button",children:n("fields:collapseAll")})}),Yt("li",{children:Yt("button",{className:`${Pr}__header-action`,onClick:()=>Ue(!1),type:"button",children:n("fields:showAll")})})]})]}),Yt(oe,{CustomComponent:Ve,Fallback:Yt(Be,{description:S,path:J})})]}),ge,Yt(Fl,{fieldValue:pe,localized:g,path:J}),(ae.length>0||!q&&(jt||xt))&&es(cr,{className:`${Pr}__rows`,ids:ae.map(LP),onDragEnd:K=>{let{moveFromIndex:W,moveToIndex:ee}=K;return ot(W,ee)},children:[ae.map((K,W)=>{let{blockType:ee,isLoading:fe}=K,Ae=P.blocksMap[ee]??(f??m).find(Ne=>typeof Ne!="string"&&Ne.slug===ee);if(Ae){let Ne=`${J}.${W}`,we=le.filter(We=>We.startsWith(Ne+".")).length;return Yt(Jr,{disabled:a||z||!D,id:K.id,children:We=>Yt(Ny,{...We,addRow:Y,block:Ae,blocks:f??m,duplicateRow:de,errorCount:we,fields:Ae.fields,hasMaxRows:Ge,isLoading:fe,isSortable:D,Label:ae?.[W]?.customComponents?.RowLabel,labels:O,moveRow:ot,parentPath:J,path:Ne,permissions:i,readOnly:a||z,removeRow:ze,row:K,rowCount:ae.length,rowIndex:W,schemaPath:_+Ae.slug,setCollapse:Qt})},K.id)}return null}),!G&&es(EP.Fragment,{children:[xt&&Yt(Ir,{type:"error",children:n("validation:requiresAtLeast",{count:A,label:xh(A>1?O.plural:O.singular,o)||n(A>1?"general:row":"general:rows")})}),jt&&Yt(Ir,{children:n("validation:fieldHasNo",{label:xh(O.plural,o)})})]})]}),!Ge&&es(PP,{children:[Yt(ur,{className:`${Pr}__drawer-toggler`,disabled:a||z,slug:V,children:Yt(ne,{buttonStyle:"icon-label",disabled:a||z,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:n("fields:addLabel",{label:xh(O.singular,o)})})}),Yt(Nl,{addRow:Y,addRowIndex:ae?.length||0,blocks:f??m,drawerSlug:V,labels:O})]}),Re]})},Ll=je(NP);function LP(t){return t.id}import{jsx as Us,jsxs as Ly}from"react/jsx-runtime";import{useCallback as OP,useMemo as MP}from"react";import{jsx as yh}from"react/jsx-runtime";import{lazy as $P,Suspense as kP}from"react";var jP=$P(()=>import("./CodeEditor-7N7BMHRP.js")),$l=t=>yh(kP,{fallback:yh(St,{}),children:yh(jP,{...t})});var BP={js:"javascript",ts:"typescript"},VP="code-field",GP=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r={},language:s="javascript"}={},label:i,localized:a,required:l},onMount:c,path:u,readOnly:d,validate:f}=t,m=OP((_,A)=>{if(typeof f=="function")return f(_,{...A,required:l})},[f,l]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},disabled:x,path:y,setValue:C,showError:S,value:w}=Te({potentiallyStalePath:u,validate:m}),D=MP(()=>rt(e),[e]);return Ly("div",{className:[ye,VP,o,S&&"error",(d||x)&&"read-only"].filter(Boolean).join(" "),style:D,children:[Us(oe,{CustomComponent:v,Fallback:Us(ve,{label:i,localized:a,path:y,required:l})}),Ly("div",{className:`${ye}__wrap`,children:[Us(oe,{CustomComponent:b,Fallback:Us(He,{path:y,showError:S})}),p,Us($l,{defaultLanguage:BP[s]||s,onChange:d||x?()=>null:_=>C(_),onMount:c,options:r,readOnly:d||x,value:w||""}),h]}),Us(oe,{CustomComponent:g,Fallback:Us(Be,{description:n,path:y})})]})},kl=je(GP);import{jsx as Zs,jsxs as Ch}from"react/jsx-runtime";import{getTranslation as HP}from"@payloadcms/translations";import{Fragment as zP,useCallback as XP,useEffect as UP,useMemo as YP,useState as ky}from"react";import{c as WP}from"react/compiler-runtime";import{fieldAffectsData as $y}from"payload/shared";var Rd=t=>t.reduce((e,o)=>{let n="fields"in o?o.fields:void 0;return n?$y(o)?e.push(`${o.name}.`):e.push(...Rd(n)):o.type==="tabs"?"tabs"in o&&o.tabs?.forEach(r=>{"name"in r?e.push(`${r.name}.`):e.push(...Rd(r.fields))}):$y(o)&&e.push(o.name),e},[]);var Ys=t=>{let e=WP(12),{fields:o,path:n,setErrorCount:r}=t,[s]=ki(),i=Xt(),a;e[0]!==o?(a=Rd(o),e[0]=o,e[1]=a):a=e[1];let l=a,c;e[2]!==s||e[3]!==i||e[4]!==n||e[5]!==l||e[6]!==r?(c=()=>{if(i){let d;d=0,Object.entries(s).forEach(f=>{let[m]=f;if(l?.some(p=>{let g=[...n,p].join(".");return g.endsWith(".")?m.startsWith(g):m===g})){let p=s[m];"valid"in p&&!p.valid&&(d=d+1)}}),r(d)}},e[2]=s,e[3]=i,e[4]=n,e[5]=l,e[6]=r,e[7]=c):c=e[7];let u;return e[8]!==o||e[9]!==s||e[10]!==i?(u=[s,i,o],e[8]=o,e[9]=s,e[10]=i,e[11]=u):u=e[11],Bs(c,250,u),null};var jl="collapsible-field",ZP=t=>{let{field:e,field:{admin:{className:o,description:n,initCollapsed:r=!1}={},fields:s,label:i}={},indexPath:a,parentPath:l,parentSchemaPath:c,path:u,permissions:d,readOnly:f}=t,{i18n:m}=k(),{getPreference:h,setPreference:p}=Fo(),{preferencesKey:g}=Ee(),[b,v]=ky(),x=`collapsible-${u?.replace(/\./g,"__")}`,[y,C]=ky(0),S=y>0,{customComponents:{AfterInput:w,BeforeInput:D,Description:_,Label:A}={},disabled:F}=Te({path:u}),R=XP(async E=>{let T=await h(g);g&&p(g,{...T,...u?{fields:{...T?.fields||{},[u]:{...T?.fields?.[u],collapsed:E}}}:{fields:{...T?.fields||{},[x]:{...T?.fields?.[x],collapsed:E}}}})},[g,x,h,p,u]);UP(()=>{(async()=>{if(g){let T=await h(g),$=u?T?.fields?.[u]?.collapsed:T?.fields?.[x]?.collapsed;v($!==void 0?!!$:typeof r=="boolean"?r:!1)}else v(typeof r=="boolean"?r:!1)})()},[h,g,x,r,u]);let I=YP(()=>rt(e),[e]);return typeof b!="boolean"?null:Ch(zP,{children:[Zs(Ys,{fields:s,path:u.split(".").slice(0,-1),setErrorCount:C}),Ch("div",{className:[ye,jl,o,S?`${jl}--has-error`:`${jl}--has-no-error`].filter(Boolean).join(" "),id:`field-${x}`,style:I,children:[D,Zs(Xs,{className:`${jl}__collapsible`,collapsibleStyle:S?"error":"default",header:Ch("div",{className:`${jl}__row-label-wrap`,children:[Zs(dn,{CustomComponent:A,label:HP(i,m),path:u}),S&&Zs(io,{count:y,i18n:m,withMessage:!0})]}),initCollapsed:b,onToggle:R,children:Zs(So,{fields:s,margins:"small",parentIndexPath:a,parentPath:l,parentSchemaPath:c,permissions:d,readOnly:f||F})}),w,Zs(oe,{CustomComponent:_,Fallback:Zs(Be,{description:n,path:u})})]})]})},Ol=je(ZP);import{jsx as ns,jsxs as _2}from"react/jsx-runtime";import{getTranslation as UN}from"@payloadcms/translations";import{useCallback as ug,useMemo as D2}from"react";import{jsx as wh}from"react/jsx-runtime";import{lazy as JP,Suspense as qP}from"react";var QP=JP(()=>import("./DatePicker-4DPXLCID.js")),Qi=t=>wh(qP,{fallback:wh(St,{height:50}),children:wh(QP,{...t})});import{jsx as R2,jsxs as zN}from"react/jsx-runtime";import{useMemo as XN}from"react";import{jsx as ei}from"react/jsx-runtime";import{getTranslation as w2}from"@payloadcms/translations";import S2,{useEffect as VN,useId as GN}from"react";function Nr(t){"@babel/helpers - typeof";return Nr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nr(t)}function jy(t,e){if(Nr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(Nr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _d(t){var e=jy(t,"string");return Nr(e)=="symbol"?e:e+""}function Js(t,e,o){return(e=_d(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function Oy(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,n)}return o}function Ie(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Oy(Object(o),!0).forEach(function(n){Js(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Oy(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function My(t){if(Array.isArray(t))return t}function By(t,e){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n,r,s,i,a=[],l=!0,c=!1;try{if(s=(o=o.call(t)).next,e===0){if(Object(o)!==o)return;l=!1}else for(;!(l=(n=s.call(o)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&o.return!=null&&(i=o.return(),Object(i)!==i))return}finally{if(c)throw r}}return a}}function Ml(t,e){(e==null||e>t.length)&&(e=t.length);for(var o=0,n=Array(e);o<e;o++)n[o]=t[o];return n}function Dd(t,e){if(t){if(typeof t=="string")return Ml(t,e);var o={}.toString.call(t).slice(8,-1);return o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set"?Array.from(t):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Ml(t,e):void 0}}function Vy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
49
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
50
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ts(t){return Yy(t)||Zy(t)||Dd(t)||Jy()}import*as ut from"react";import{useMemo as Zl,Fragment as Uh,useRef as ma,useCallback as rs,useEffect as zw,Component as M5}from"react";import*as hr from"react";import{useContext as E6,forwardRef as P6}from"react";var e6=!1;function t6(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function o6(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var qy=function(){function t(o){var n=this;this._insertTag=function(r){var s;n.tags.length===0?n.insertionPoint?s=n.insertionPoint.nextSibling:n.prepend?s=n.container.firstChild:s=n.before:s=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(r,s),n.tags.push(r)},this.isSpeedy=o.speedy===void 0?!e6:o.speedy,this.tags=[],this.ctr=0,this.nonce=o.nonce,this.key=o.key,this.container=o.container,this.prepend=o.prepend,this.insertionPoint=o.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(n){n.forEach(this._insertTag)},e.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(o6(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=t6(r);try{s.insertRule(n,s.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(n));this.ctr++},e.flush=function(){this.tags.forEach(function(n){var r;return(r=n.parentNode)==null?void 0:r.removeChild(n)}),this.tags=[],this.ctr=0},t}();var vo="-ms-",Vl="-moz-",nt="-webkit-",Td="comm",Ki="rule",ea="decl";var Qy="@import";var Ed="@keyframes";var Ky="@layer";var eC=Math.abs,qs=String.fromCharCode,tC=Object.assign;function oC(t,e){return Bt(t,0)^45?(((e<<2^Bt(t,0))<<2^Bt(t,1))<<2^Bt(t,2))<<2^Bt(t,3):0}function Pd(t){return t.trim()}function Rh(t,e){return(t=e.exec(t))?t[0]:t}function et(t,e,o){return t.replace(e,o)}function Gl(t,e){return t.indexOf(e)}function Bt(t,e){return t.charCodeAt(e)|0}function os(t,e,o){return t.slice(e,o)}function Ao(t){return t.length}function ta(t){return t.length}function oa(t,e){return e.push(t),t}function _h(t,e){return t.map(e).join("")}var Nd=1,ra=1,rC=0,To=0,Zt=0,sa="";function Wl(t,e,o,n,r,s,i){return{value:t,root:e,parent:o,type:n,props:r,children:s,line:Nd,column:ra,length:i,return:""}}function ia(t,e){return tC(Wl("",null,null,"",null,null,0),t,{length:-t.length},e)}function nC(){return Zt}function sC(){return Zt=To>0?Bt(sa,--To):0,ra--,Zt===10&&(ra=1,Nd--),Zt}function Eo(){return Zt=To<rC?Bt(sa,To++):0,ra++,Zt===10&&(ra=1,Nd++),Zt}function pr(){return Bt(sa,To)}function Hl(){return To}function aa(t,e){return os(sa,t,e)}function na(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ld(t){return Nd=ra=1,rC=Ao(sa=t),To=0,[]}function $d(t){return sa="",t}function la(t){return Pd(aa(To-1,Dh(t===91?t+2:t===40?t+1:t)))}function iC(t){for(;(Zt=pr())&&Zt<33;)Eo();return na(t)>2||na(Zt)>3?"":" "}function aC(t,e){for(;--e&&Eo()&&!(Zt<48||Zt>102||Zt>57&&Zt<65||Zt>70&&Zt<97););return aa(t,Hl()+(e<6&&pr()==32&&Eo()==32))}function Dh(t){for(;Eo();)switch(Zt){case t:return To;case 34:case 39:t!==34&&t!==39&&Dh(Zt);break;case 40:t===41&&Dh(t);break;case 92:Eo();break}return To}function lC(t,e){for(;Eo()&&t+Zt!==57;)if(t+Zt===84&&pr()===47)break;return"/*"+aa(e,To-1)+"*"+qs(t===47?t:Eo())}function cC(t){for(;!na(pr());)Eo();return aa(t,To)}function mC(t){return $d(kd("",null,null,null,[""],t=Ld(t),0,[0],t))}function kd(t,e,o,n,r,s,i,a,l){for(var c=0,u=0,d=i,f=0,m=0,h=0,p=1,g=1,b=1,v=0,x="",y=r,C=s,S=n,w=x;g;)switch(h=v,v=Eo()){case 40:if(h!=108&&Bt(w,d-1)==58){Gl(w+=et(la(v),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:w+=la(v);break;case 9:case 10:case 13:case 32:w+=iC(h);break;case 92:w+=aC(Hl()-1,7);continue;case 47:switch(pr()){case 42:case 47:oa(r6(lC(Eo(),Hl()),e,o),l);break;default:w+="/"}break;case 123*p:a[c++]=Ao(w)*b;case 125*p:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:b==-1&&(w=et(w,/\f/g,"")),m>0&&Ao(w)-d&&oa(m>32?dC(w+";",n,o,d-1):dC(et(w," ","")+";",n,o,d-2),l);break;case 59:w+=";";default:if(oa(S=uC(w,e,o,c,u,r,a,x,y=[],C=[],d),s),v===123)if(u===0)kd(w,e,S,S,y,s,d,a,C);else switch(f===99&&Bt(w,3)===110?100:f){case 100:case 108:case 109:case 115:kd(t,S,S,n&&oa(uC(t,S,S,0,0,r,a,x,r,y=[],d),C),r,C,d,a,n?y:C);break;default:kd(w,S,S,S,[""],C,0,a,C)}}c=u=m=0,p=b=1,x=w="",d=i;break;case 58:d=1+Ao(w),m=h;default:if(p<1){if(v==123)--p;else if(v==125&&p++==0&&sC()==125)continue}switch(w+=qs(v),v*p){case 38:b=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(Ao(w)-1)*b,b=1;break;case 64:pr()===45&&(w+=la(Eo())),f=pr(),u=d=Ao(x=w+=cC(Hl())),v++;break;case 45:h===45&&Ao(w)==2&&(p=0)}}return s}function uC(t,e,o,n,r,s,i,a,l,c,u){for(var d=r-1,f=r===0?s:[""],m=ta(f),h=0,p=0,g=0;h<n;++h)for(var b=0,v=os(t,d+1,d=eC(p=i[h])),x=t;b<m;++b)(x=Pd(p>0?f[b]+" "+v:et(v,/&\f/g,f[b])))&&(l[g++]=x);return Wl(t,e,o,r===0?Ki:a,l,c,u)}function r6(t,e,o){return Wl(t,e,o,Td,qs(nC()),os(t,2,-2),0)}function dC(t,e,o,n){return Wl(t,e,o,ea,os(t,0,n),os(t,n+1,-1),n)}function Qs(t,e){for(var o="",n=ta(t),r=0;r<n;r++)o+=e(t[r],r,t,e)||"";return o}function fC(t,e,o,n){switch(t.type){case Ky:if(t.children.length)break;case Qy:case ea:return t.return=t.return||t.value;case Td:return"";case Ed:return t.return=t.value+"{"+Qs(t.children,n)+"}";case Ki:t.value=t.props.join(",")}return Ao(o=Qs(t.children,n))?t.return=t.value+"{"+o+"}":""}function pC(t){var e=ta(t);return function(o,n,r,s){for(var i="",a=0;a<e;a++)i+=t[a](o,n,r,s)||"";return i}}function hC(t){return function(e){e.root||(e=e.return)&&t(e)}}function gC(t){var e=Object.create(null);return function(o){return e[o]===void 0&&(e[o]=t(o)),e[o]}}var n6=function(e,o,n){for(var r=0,s=0;r=s,s=pr(),r===38&&s===12&&(o[n]=1),!na(s);)Eo();return aa(e,To)},s6=function(e,o){var n=-1,r=44;do switch(na(r)){case 0:r===38&&pr()===12&&(o[n]=1),e[n]+=n6(To-1,o,n);break;case 2:e[n]+=la(r);break;case 4:if(r===44){e[++n]=pr()===58?"&\f":"",o[n]=e[n].length;break}default:e[n]+=qs(r)}while(r=Eo());return e},i6=function(e,o){return $d(s6(Ld(e),o))},bC=new WeakMap,a6=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var o=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&o.charCodeAt(0)!==58&&!bC.get(n))&&!r){bC.set(e,!0);for(var s=[],i=i6(o,s),a=n.props,l=0,c=0;l<i.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=s[l]?i[l].replace(/&\f/g,a[u]):a[u]+" "+i[l]}}},l6=function(e){if(e.type==="decl"){var o=e.value;o.charCodeAt(0)===108&&o.charCodeAt(2)===98&&(e.return="",e.value="")}};function vC(t,e){switch(oC(t,e)){case 5103:return nt+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return nt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return nt+t+Vl+t+vo+t+t;case 6828:case 4268:return nt+t+vo+t+t;case 6165:return nt+t+vo+"flex-"+t+t;case 5187:return nt+t+et(t,/(\w+).+(:[^]+)/,nt+"box-$1$2"+vo+"flex-$1$2")+t;case 5443:return nt+t+vo+"flex-item-"+et(t,/flex-|-self/,"")+t;case 4675:return nt+t+vo+"flex-line-pack"+et(t,/align-content|flex-|-self/,"")+t;case 5548:return nt+t+vo+et(t,"shrink","negative")+t;case 5292:return nt+t+vo+et(t,"basis","preferred-size")+t;case 6060:return nt+"box-"+et(t,"-grow","")+nt+t+vo+et(t,"grow","positive")+t;case 4554:return nt+et(t,/([^-])(transform)/g,"$1"+nt+"$2")+t;case 6187:return et(et(et(t,/(zoom-|grab)/,nt+"$1"),/(image-set)/,nt+"$1"),t,"")+t;case 5495:case 3959:return et(t,/(image-set\([^]*)/,nt+"$1$`$1");case 4968:return et(et(t,/(.+:)(flex-)?(.*)/,nt+"box-pack:$3"+vo+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+nt+t+t;case 4095:case 3583:case 4068:case 2532:return et(t,/(.+)-inline(.+)/,nt+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ao(t)-1-e>6)switch(Bt(t,e+1)){case 109:if(Bt(t,e+4)!==45)break;case 102:return et(t,/(.+:)(.+)-([^]+)/,"$1"+nt+"$2-$3$1"+Vl+(Bt(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Gl(t,"stretch")?vC(et(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Bt(t,e+1)!==115)break;case 6444:switch(Bt(t,Ao(t)-3-(~Gl(t,"!important")&&10))){case 107:return et(t,":",":"+nt)+t;case 101:return et(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nt+(Bt(t,14)===45?"inline-":"")+"box$3$1"+nt+"$2$3$1"+vo+"$2box$3")+t}break;case 5936:switch(Bt(t,e+11)){case 114:return nt+t+vo+et(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nt+t+vo+et(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nt+t+vo+et(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nt+t+vo+t+t}return t}var c6=function(e,o,n,r){if(e.length>-1&&!e.return)switch(e.type){case ea:e.return=vC(e.value,e.length);break;case Ed:return Qs([ia(e,{value:et(e.value,"@","@"+nt)})],r);case Ki:if(e.length)return _h(e.props,function(s){switch(Rh(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qs([ia(e,{props:[et(s,/:(read-\w+)/,":"+Vl+"$1")]})],r);case"::placeholder":return Qs([ia(e,{props:[et(s,/:(plac\w+)/,":"+nt+"input-$1")]}),ia(e,{props:[et(s,/:(plac\w+)/,":"+Vl+"$1")]}),ia(e,{props:[et(s,/:(plac\w+)/,vo+"input-$1")]})],r)}return""})}},u6=[c6],Fh=function(e){var o=e.key;if(o==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(p){var g=p.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var r=e.stylisPlugins||u6,s={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+o+' "]'),function(p){for(var g=p.getAttribute("data-emotion").split(" "),b=1;b<g.length;b++)s[g[b]]=!0;a.push(p)});var l,c=[a6,l6];{var u,d=[fC,hC(function(p){u.insert(p)})],f=pC(c.concat(r,d)),m=function(g){return Qs(mC(g),f)};l=function(g,b,v,x){u=v,m(g?g+"{"+b.styles+"}":b.styles),x&&(h.inserted[b.name]=!0)}}var h={key:o,sheet:new qy({key:o,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:l};return h.sheet.hydrate(a),h};var S6=!0;function Lh(t,e,o){var n="";return o.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):r&&(n+=r+" ")}),n}var Ud=function(e,o,n){var r=e.key+"-"+o.name;(n===!1||S6===!1)&&e.registered[r]===void 0&&(e.registered[r]=o.styles)},$h=function(e,o,n){Ud(e,o,n);var r=e.key+"-"+o.name;if(e.inserted[o.name]===void 0){var s=o;do e.insert(o===s?"."+r:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function TC(t){for(var e=0,o,n=0,r=t.length;r>=4;++n,r-=4)o=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,e=(o&65535)*1540483477+((o>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var EC={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var I6=!1,R6=/[A-Z]|^ms/g,_6=/_EMO_([^_]+?)_([^]*?)_EMO_/g,$C=function(e){return e.charCodeAt(1)===45},PC=function(e){return e!=null&&typeof e!="boolean"},kh=gC(function(t){return $C(t)?t:t.replace(R6,"-$&").toLowerCase()}),NC=function(e,o){switch(e){case"animation":case"animationName":if(typeof o=="string")return o.replace(_6,function(n,r,s){return Kr={name:r,styles:s,next:Kr},r})}return EC[e]!==1&&!$C(e)&&typeof o=="number"&&o!==0?o+"px":o},D6="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function zl(t,e,o){if(o==null)return"";var n=o;if(n.__emotion_styles!==void 0)return n;switch(typeof o){case"boolean":return"";case"object":{var r=o;if(r.anim===1)return Kr={name:r.name,styles:r.styles,next:Kr},r.name;var s=o;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)Kr={name:i.name,styles:i.styles,next:Kr},i=i.next;var a=s.styles+";";return a}return F6(t,e,o)}case"function":{if(t!==void 0){var l=Kr,c=o(t);return Kr=l,zl(t,e,c)}break}}var u=o;if(e==null)return u;var d=e[u];return d!==void 0?d:u}function F6(t,e,o){var n="";if(Array.isArray(o))for(var r=0;r<o.length;r++)n+=zl(t,e,o[r])+";";else for(var s in o){var i=o[s];if(typeof i!="object"){var a=i;e!=null&&e[a]!==void 0?n+=s+"{"+e[a]+"}":PC(a)&&(n+=kh(s)+":"+NC(s,a)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&I6)throw new Error(D6);if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var l=0;l<i.length;l++)PC(i[l])&&(n+=kh(s)+":"+NC(s,i[l])+";");else{var c=zl(t,e,i);switch(s){case"animation":case"animationName":{n+=kh(s)+":"+c+";";break}default:n+=s+"{"+c+"}"}}}}return n}var LC=/label:\s*([^\s;{]+)\s*(;|$)/g,Kr;function Yd(t,e,o){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var n=!0,r="";Kr=void 0;var s=t[0];if(s==null||s.raw===void 0)n=!1,r+=zl(o,e,s);else{var i=s;r+=i[0]}for(var a=1;a<t.length;a++)if(r+=zl(o,e,t[a]),n){var l=s;r+=l[a]}LC.lastIndex=0;for(var c="",u;(u=LC.exec(r))!==null;)c+="-"+u[1];var d=TC(r)+c;return{name:d,styles:r,next:Kr}}import*as Zd from"react";var A6=function(e){return e()},T6=Zd.useInsertionEffect?Zd.useInsertionEffect:!1,jh=T6||A6;var kC=!1,jC=hr.createContext(typeof HTMLElement<"u"?Fh({key:"css"}):null),rie=jC.Provider;var OC=function(e){return P6(function(o,n){var r=E6(jC);return e(o,r,n)})},MC=hr.createContext({});var Jd={}.hasOwnProperty,Oh="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",BC=function(e,o){var n={};for(var r in o)Jd.call(o,r)&&(n[r]=o[r]);return n[Oh]=e,n},N6=function(e){var o=e.cache,n=e.serialized,r=e.isStringTag;return Ud(o,n,r),jh(function(){return $h(o,n,r)}),null},L6=OC(function(t,e,o){var n=t.css;typeof n=="string"&&e.registered[n]!==void 0&&(n=e.registered[n]);var r=t[Oh],s=[n],i="";typeof t.className=="string"?i=Lh(e.registered,s,t.className):t.className!=null&&(i=t.className+" ");var a=Yd(s,void 0,hr.useContext(MC));i+=e.key+"-"+a.name;var l={};for(var c in t)Jd.call(t,c)&&c!=="css"&&c!==Oh&&!kC&&(l[c]=t[c]);return l.className=i,o&&(l.ref=o),hr.createElement(hr.Fragment,null,hr.createElement(N6,{cache:e,serialized:a,isStringTag:typeof r=="string"}),hr.createElement(r,l))}),VC=L6;import*as ca from"react";var fie=Ds(AC()),Fe=function(e,o){var n=arguments;if(o==null||!Jd.call(o,"css"))return ca.createElement.apply(void 0,n);var r=n.length,s=new Array(r);s[0]=VC,s[1]=BC(e,o);for(var i=2;i<r;i++)s[i]=n[i];return ca.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(Fe||(Fe={}));function Xl(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return Yd(e)}function GC(){var t=Xl.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function WC(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}DD();import{useContext as k6,useRef as Vh,useState as em,useMemo as j6,useCallback as Mh,createContext as O6}from"react";import{createPortal as M6}from"react-dom";import{useLayoutEffect as $6}from"react";var qd=$6;var B6=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ul=function(){};function V6(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function zC(t,e){for(var o=arguments.length,n=new Array(o>2?o-2:0),r=2;r<o;r++)n[r-2]=arguments[r];var s=[].concat(n);if(e&&t)for(var i in e)e.hasOwnProperty(i)&&e[i]&&s.push("".concat(V6(t,i)));return s.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var ua=function(e){return U6(e)?e.filter(Boolean):Nr(e)==="object"&&e!==null?[e]:[]},XC=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var o=Vo(e,B6);return Ie({},o)},Nt=function(e,o,n){var r=e.cx,s=e.getStyles,i=e.getClassNames,a=e.className;return{css:s(o,e),className:r(n??{},i(o,e),a)}};function Yl(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function G6(t){return Yl(t)?window.innerHeight:t.clientHeight}function UC(t){return Yl(t)?window.pageYOffset:t.scrollTop}function tm(t,e){if(Yl(t)){window.scrollTo(0,e);return}t.scrollTop=e}function W6(t){var e=getComputedStyle(t),o=e.position==="absolute",n=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var r=t;r=r.parentElement;)if(e=getComputedStyle(r),!(o&&e.position==="static")&&n.test(e.overflow+e.overflowY+e.overflowX))return r;return document.documentElement}function H6(t,e,o,n){return o*((t=t/n-1)*t*t+1)+e}function Qd(t,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ul,r=UC(t),s=e-r,i=10,a=0;function l(){a+=i;var c=H6(a,r,s,o);tm(t,c),a<o?window.requestAnimationFrame(l):n(t)}l()}function Gh(t,e){var o=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=e.offsetHeight/3;n.bottom+r>o.bottom?tm(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):n.top-r<o.top&&tm(t,Math.max(e.offsetTop-r,0))}function z6(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function Wh(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function YC(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var ZC=!1,X6={get passive(){return ZC=!0}},Kd=typeof window<"u"?window:{};Kd.addEventListener&&Kd.removeEventListener&&(Kd.addEventListener("p",Ul,X6),Kd.removeEventListener("p",Ul,!1));var JC=ZC;function qC(t){return t!=null}function U6(t){return Array.isArray(t)}function Ks(t,e,o){return t?e:o}var QC=function(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];var s=Object.entries(e).filter(function(i){var a=Lr(i,1),l=a[0];return!n.includes(l)});return s.reduce(function(i,a){var l=Lr(a,2),c=l[0],u=l[1];return i[c]=u,i},{})},Y6=["children","innerProps"],Z6=["children","innerProps"];function J6(t){var e=t.maxHeight,o=t.menuEl,n=t.minHeight,r=t.placement,s=t.shouldScroll,i=t.isFixedPosition,a=t.controlHeight,l=W6(o),c={placement:"bottom",maxHeight:e};if(!o||!o.offsetParent)return c;var u=l.getBoundingClientRect(),d=u.height,f=o.getBoundingClientRect(),m=f.bottom,h=f.height,p=f.top,g=o.offsetParent.getBoundingClientRect(),b=g.top,v=i?window.innerHeight:G6(l),x=UC(l),y=parseInt(getComputedStyle(o).marginBottom,10),C=parseInt(getComputedStyle(o).marginTop,10),S=b-C,w=v-p,D=S+x,_=d-x-p,A=m-v+x+y,F=x+p-C,R=160;switch(r){case"auto":case"bottom":if(w>=h)return{placement:"bottom",maxHeight:e};if(_>=h&&!i)return s&&Qd(l,A,R),{placement:"bottom",maxHeight:e};if(!i&&_>=n||i&&w>=n){s&&Qd(l,A,R);var I=i?w-y:_-y;return{placement:"bottom",maxHeight:I}}if(r==="auto"||i){var E=e,T=i?S:D;return T>=n&&(E=Math.min(T-y-a,e)),{placement:"top",maxHeight:E}}if(r==="bottom")return s&&tm(l,A),{placement:"bottom",maxHeight:e};break;case"top":if(S>=h)return{placement:"top",maxHeight:e};if(D>=h&&!i)return s&&Qd(l,F,R),{placement:"top",maxHeight:e};if(!i&&D>=n||i&&S>=n){var $=e;return(!i&&D>=n||i&&S>=n)&&($=i?S-C:D-C),s&&Qd(l,F,R),{placement:"top",maxHeight:$}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function q6(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var KC=function(e){return e==="auto"?"bottom":e},ew=function(e,o){var n,r=e.placement,s=e.theme,i=s.borderRadius,a=s.spacing,l=s.colors;return Ie((n={label:"menu"},Js(n,q6(r),"100%"),Js(n,"position","absolute"),Js(n,"width","100%"),Js(n,"zIndex",1),n),o?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},tw=O6(null),ow=function(e){var o=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,i=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,c=k6(tw)||{},u=c.setPortalPlacement,d=Vh(null),f=em(r),m=Lr(f,2),h=m[0],p=m[1],g=em(null),b=Lr(g,2),v=b[0],x=b[1],y=l.spacing.controlHeight;return qd(function(){var C=d.current;if(C){var S=i==="fixed",w=a&&!S,D=J6({maxHeight:r,menuEl:C,minHeight:n,placement:s,shouldScroll:w,isFixedPosition:S,controlHeight:y});p(D.maxHeight),x(D.placement),u?.(D.placement)}},[r,s,i,a,n,u,y]),o({ref:d,placerProps:Ie(Ie({},e),{},{placement:v||KC(s),maxHeight:h})})},Q6=function(e){var o=e.children,n=e.innerRef,r=e.innerProps;return Fe("div",Se({},Nt(e,"menu",{menu:!0}),{ref:n},r),o)},K6=Q6,rw=function(e,o){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return Ie({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},o?{}:{paddingBottom:r,paddingTop:r})},e5=function(e){var o=e.children,n=e.innerProps,r=e.innerRef,s=e.isMulti;return Fe("div",Se({},Nt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},n),o)},nw=function(e,o){var n=e.theme,r=n.spacing.baseUnit,s=n.colors;return Ie({textAlign:"center"},o?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},sw=nw,iw=nw,t5=function(e){var o=e.children,n=o===void 0?"No options":o,r=e.innerProps,s=Vo(e,Y6);return Fe("div",Se({},Nt(Ie(Ie({},s),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},o5=function(e){var o=e.children,n=o===void 0?"Loading...":o,r=e.innerProps,s=Vo(e,Z6);return Fe("div",Se({},Nt(Ie(Ie({},s),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},aw=function(e){var o=e.rect,n=e.offset,r=e.position;return{left:o.left,position:r,top:n,width:o.width,zIndex:1}},r5=function(e){var o=e.appendTo,n=e.children,r=e.controlElement,s=e.innerProps,i=e.menuPlacement,a=e.menuPosition,l=Vh(null),c=Vh(null),u=em(KC(i)),d=Lr(u,2),f=d[0],m=d[1],h=j6(function(){return{setPortalPlacement:m}},[]),p=em(null),g=Lr(p,2),b=g[0],v=g[1],x=Mh(function(){if(r){var w=z6(r),D=a==="fixed"?0:window.pageYOffset,_=w[f]+D;(_!==b?.offset||w.left!==b?.rect.left||w.width!==b?.rect.width)&&v({offset:_,rect:w})}},[r,a,f,b?.offset,b?.rect.left,b?.rect.width]);qd(function(){x()},[x]);var y=Mh(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&l.current&&(c.current=fv(r,l.current,x,{elementResize:"ResizeObserver"in window}))},[r,x]);qd(function(){y()},[y]);var C=Mh(function(w){l.current=w,y()},[y]);if(!o&&a!=="fixed"||!b)return null;var S=Fe("div",Se({ref:C},Nt(Ie(Ie({},e),{},{offset:b.offset,position:a,rect:b.rect}),"menuPortal",{"menu-portal":!0}),s),n);return Fe(tw.Provider,{value:h},o?M6(S,o):S)},lw=function(e){var o=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:o?"none":void 0,position:"relative"}},n5=function(e){var o=e.children,n=e.innerProps,r=e.isDisabled,s=e.isRtl;return Fe("div",Se({},Nt(e,"container",{"--is-disabled":r,"--is-rtl":s}),n),o)},cw=function(e,o){var n=e.theme.spacing,r=e.isMulti,s=e.hasValue,i=e.selectProps.controlShouldRenderValue;return Ie({alignItems:"center",display:r&&s&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},o?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(n.baseUnit*2,"px")})},s5=function(e){var o=e.children,n=e.innerProps,r=e.isMulti,s=e.hasValue;return Fe("div",Se({},Nt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),n),o)},uw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},i5=function(e){var o=e.children,n=e.innerProps;return Fe("div",Se({},Nt(e,"indicatorsContainer",{indicators:!0}),n),o)},HC,a5=["size"],l5=["innerProps","isRtl","size"];var c5={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},dw=function(e){var o=e.size,n=Vo(e,a5);return Fe("svg",Se({height:o,width:o,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:c5},n))},Hh=function(e){return Fe(dw,Se({size:20},e),Fe("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},mw=function(e){return Fe(dw,Se({size:20},e),Fe("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},fw=function(e,o){var n=e.isFocused,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return Ie({label:"indicatorContainer",display:"flex",transition:"color 150ms"},o?{}:{color:n?i.neutral60:i.neutral20,padding:s*2,":hover":{color:n?i.neutral80:i.neutral40}})},pw=fw,u5=function(e){var o=e.children,n=e.innerProps;return Fe("div",Se({},Nt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),o||Fe(mw,null))},hw=fw,d5=function(e){var o=e.children,n=e.innerProps;return Fe("div",Se({},Nt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),o||Fe(Hh,null))},gw=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return Ie({label:"indicatorSeparator",alignSelf:"stretch",width:1},o?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:s*2,marginTop:s*2})},m5=function(e){var o=e.innerProps;return Fe("span",Se({},o,Nt(e,"indicatorSeparator",{"indicator-separator":!0})))},f5=GC(HC||(HC=WC([`
|
|
47
|
+
`};var O0=(t,e)=>{let o=Object.assign({},t),{type:n,payload:r}=e;switch(n){case"UPDATE_MODAL":{let{slug:s}=r;s&&(o[s]=Object.assign(Object.assign({},o[s]),r));break}case"OPEN_MODAL":{let{slug:s}=r;s&&(s in o&&o[s].isOpen||(o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:Date.now(),isOpen:!0})));break}case"TOGGLE_MODAL":{let{slug:s}=r;if(s){let i=s in o&&o[s].isOpen;o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:i?void 0:Date.now(),isOpen:!i})}break}case"CLOSE_MODAL":{let{slug:s}=r;s&&(o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:void 0,isOpen:!1}));break}case"REMOVE_MODAL":{let{slug:s}=r;s&&s in o&&delete o[s];break}case"CLOSE_LATEST_MODAL":{let s=Object.keys(o).reduce((i,a)=>{let l=o[a];return l.isOpen&&typeof l.openedOn=="number"&&(!i||typeof i.openedOn=="number"&&l.openedOn>i.openedOn)?l:i},void 0);s&&(o[s.slug]=Object.assign(Object.assign({},o[s.slug]),{isOpen:!1,openedOn:void 0}));break}case"CLOSE_ALL_MODALS":{o=Object.entries(o).reduce((s,[i,a])=>(s[i]=Object.assign(Object.assign({},a),{isOpen:!1,openedOn:void 0}),s),{});break}default:break}return o};var ZA=()=>{if(typeof window<"u")return new URLSearchParams(window.location.search)},JA=()=>{let t=ZA(),e=[];if(t){let o=t.get("modal");o&&(o.includes(",")?e=o.split(","):e=[o])}return e},Lp=t=>{let{classPrefix:e,minifyCSS:o=!0,generateCSS:n=!0,zIndex:r=9999,handleParamChange:s,children:i,transTime:a=250}=t,l=B0(null),[c,u]=YA(O0,{},()=>JA().reduce((T,$)=>(T[$]={slug:$,isOpen:!0,openedOn:Date.now()},T),{})),[d,f]=rd(!1),[m,h]=rd(!1),[p,g]=rd(!1),[b,v]=rd(""),x=B0(!1),y=Zn(I=>{I.keyCode===27&&u({type:"CLOSE_LATEST_MODAL"})},[]);nd(()=>(x.current||(document.addEventListener("keydown",I=>y(I),!1),x.current=!0),()=>{x.current&&document.removeEventListener("keydown",I=>y(I),!1)}),[y]),nd(()=>{if(n){let I="";I=j0({classPrefix:e,zIndex:r}),o&&(I=I.replace(/\n/g,"").replace(/\s\s+/g," ")),v(I)}},[n,o,r,e]),nd(()=>{if(typeof s=="function"&&s(c),typeof s=="boolean"&&s){let I=Object.keys(c).filter(j=>c[j].isOpen),E=new URLSearchParams;for(let j of I)E.append("modal",j);let T=E.toString()?`?${E}`:"",$=`${window.location.pathname}${T}`;window.history.pushState({},"",$)}},[c,s]),nd(()=>{let I=Object.keys(c).some(E=>c[E].isOpen);f(I)},[c]);let C=Zn((I,E)=>{E&&(I?($0(E),g(!0)):(k0(E),g(!1)))},[]),S=Zn(I=>{l.current=I},[]),w=Zn(I=>{u({type:"OPEN_MODAL",payload:{slug:I}})},[]),D=Zn(I=>{u({type:"CLOSE_MODAL",payload:{slug:I}})},[]),_=Zn(()=>{u({type:"CLOSE_ALL_MODALS"})},[]),A=Zn(I=>{u({type:"TOGGLE_MODAL",payload:{slug:I}})},[]),F=Zn(I=>c[I]&&c[I].isOpen,[c]),R=Object.assign({},t);return delete R.children,XA(UA,{children:[n&&M0("style",{dangerouslySetInnerHTML:{__html:b}}),M0(qu.Provider,{value:Object.assign(Object.assign({},R),{transTime:a,containerRef:l,modalState:c,oneModalIsOpen:d,isModalOpen:F,closeOnBlur:m,bodyScrollIsLocked:p,classPrefix:e,closeAllModals:_,setCloseOnBlur:h,openModal:w,closeModal:D,toggleModal:A,setBodyScrollLock:C,setContainerRef:S}),children:i})]})};import{usePathname as VT,useRouter as GT}from"next/navigation.js";import{formatAdminURL as WT}from"payload/shared";import*as Q0 from"qs-esm";import J0,{createContext as HT,use as zT,useCallback as Ms,useEffect as cd,useState as xl}from"react";import ye,{forwardRef as qA,isValidElement as $p}from"react";import QA from"react-dom";import Mo from"react";import V0 from"react";import lT from"react";var KA=t=>{switch(t){case"success":return oT;case"info":return nT;case"warning":return rT;case"error":return sT;default:return null}},eT=Array(12).fill(0),tT=({visible:t,className:e})=>Mo.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Mo.createElement("div",{className:"sonner-spinner"},eT.map((o,n)=>Mo.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),oT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),rT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),nT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),sT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),iT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Mo.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Mo.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aT=()=>{let[t,e]=V0.useState(document.hidden);return V0.useEffect(()=>{let o=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),t},kp=1,cT=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:o,...n}=t,r=typeof t?.id=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:kp++,s=this.toasts.find(a=>a.id===r),i=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(a=>a.id===r?(this.publish({...a,...t,id:r,title:o}),{...a,...t,id:r,dismissible:i,title:o}):a):this.addToast({title:o,...n,dismissible:i,id:r}),r},this.dismiss=t=>(t||this.toasts.forEach(e=>{this.subscribers.forEach(o=>o({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let o;e.loading!==void 0&&(o=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),r=o!==void 0,s,i=n.then(async l=>{if(s=["resolve",l],lT.isValidElement(l))r=!1,this.create({id:o,type:"default",message:l});else if(dT(l)&&!l.ok){r=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:o,type:"error",message:c,description:u})}else if(e.success!==void 0){r=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:o,type:"success",message:c,description:u})}}).catch(async l=>{if(s=["reject",l],e.error!==void 0){r=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:o,type:"error",message:c,description:u})}}).finally(()=>{var l;r&&(this.dismiss(o),o=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,c)=>i.then(()=>s[0]==="reject"?c(s[1]):l(s[1])).catch(c));return typeof o!="string"&&typeof o!="number"?{unwrap:a}:Object.assign(o,{unwrap:a})},this.custom=(t,e)=>{let o=e?.id||kp++;return this.create({jsx:t(o),id:o,...e}),o},this.subscribers=[],this.toasts=[]}},Zo=new cT,uT=(t,e)=>{let o=e?.id||kp++;return Zo.addToast({title:t,...e,id:o}),o},dT=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",mT=uT,fT=()=>Zo.toasts,fe=Object.assign(mT,{success:Zo.success,info:Zo.info,warning:Zo.warning,error:Zo.error,custom:Zo.custom,message:Zo.message,promise:Zo.promise,dismiss:Zo.dismiss,loading:Zo.loading},{getHistory:fT});function pT(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}pT(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
48
|
+
`);function sd(t){return t.label!==void 0}var hT=3,gT="32px",bT="16px",G0=4e3,vT=356,xT=14,yT=20,CT=200;function Dr(...t){return t.filter(Boolean).join(" ")}function wT(t){let[e,o]=t.split("-"),n=[];return e&&n.push(e),o&&n.push(o),n}var ST=t=>{var e,o,n,r,s,i,a,l,c,u,d;let{invert:f,toast:m,unstyled:h,interacting:p,setHeights:g,visibleToasts:b,heights:v,index:x,toasts:y,expanded:C,removeToast:S,defaultRichColors:w,closeButton:D,style:_,cancelButtonStyle:A,actionButtonStyle:F,className:R="",descriptionClassName:I="",duration:E,position:T,gap:$,loadingIcon:j,expandByDefault:N,classNames:P,icons:L,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:M}=t,[O,B]=ye.useState(null),[G,X]=ye.useState(null),[Z,te]=ye.useState(!1),[U,z]=ye.useState(!1),[ce,J]=ye.useState(!1),[ue,re]=ye.useState(!1),[q,pe]=ye.useState(!1),[he,_e]=ye.useState(0),[ge,Ve]=ye.useState(0),Q=ye.useRef(m.duration||E||G0),Le=ye.useRef(null),De=ye.useRef(null),ae=x===0,se=x+1<=b,Y=m.type,ie=m.dismissible!==!1,me=m.className||"",we=m.descriptionClassName||"",ze=ye.useMemo(()=>v.findIndex(be=>be.toastId===m.id)||0,[v,m.id]),$e=ye.useMemo(()=>{var be;return(be=m.closeButton)!=null?be:D},[m.closeButton,D]),ot=ye.useMemo(()=>m.duration||E||G0,[m.duration,E]),Xe=ye.useRef(0),Ue=ye.useRef(0),ft=ye.useRef(0),Qt=ye.useRef(null),[Ge,Je]=T.split("-"),Ye=ye.useMemo(()=>v.reduce((be,K,W)=>W>=ze?be:be+K.height,0),[v,ze]),xt=aT(),jt=m.invert||f,gt=Y==="loading";Ue.current=ye.useMemo(()=>ze*$+Ye,[ze,Ye]),ye.useEffect(()=>{Q.current=ot},[ot]),ye.useEffect(()=>{te(!0)},[]),ye.useEffect(()=>{let be=De.current;if(be){let K=be.getBoundingClientRect().height;return Ve(K),g(W=>[{toastId:m.id,height:K,position:m.position},...W]),()=>g(W=>W.filter(ee=>ee.toastId!==m.id))}},[g,m.id]),ye.useLayoutEffect(()=>{if(!Z)return;let be=De.current,K=be.style.height;be.style.height="auto";let W=be.getBoundingClientRect().height;be.style.height=K,Ve(W),g(ee=>ee.find(le=>le.toastId===m.id)?ee.map(le=>le.toastId===m.id?{...le,height:W}:le):[{toastId:m.id,height:W,position:m.position},...ee])},[Z,m.title,m.description,g,m.id]);let qe=ye.useCallback(()=>{z(!0),_e(Ue.current),g(be=>be.filter(K=>K.toastId!==m.id)),setTimeout(()=>{S(m)},CT)},[m,S,g,Ue]);ye.useEffect(()=>{if(m.promise&&Y==="loading"||m.duration===1/0||m.type==="loading")return;let be;return C||p||M&&xt?(()=>{if(ft.current<Xe.current){let K=new Date().getTime()-Xe.current;Q.current=Q.current-K}ft.current=new Date().getTime()})():Q.current!==1/0&&(Xe.current=new Date().getTime(),be=setTimeout(()=>{var K;(K=m.onAutoClose)==null||K.call(m,m),qe()},Q.current)),()=>clearTimeout(be)},[C,p,m,Y,M,xt,qe]),ye.useEffect(()=>{m.delete&&qe()},[qe,m.delete]);function Tt(){var be,K,W;return L!=null&&L.loading?ye.createElement("div",{className:Dr(P?.loader,(be=m?.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":Y==="loading"},L.loading):j?ye.createElement("div",{className:Dr(P?.loader,(K=m?.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":Y==="loading"},j):ye.createElement(tT,{className:Dr(P?.loader,(W=m?.classNames)==null?void 0:W.loader),visible:Y==="loading"})}return ye.createElement("li",{tabIndex:0,ref:De,className:Dr(R,me,P?.toast,(e=m?.classNames)==null?void 0:e.toast,P?.default,P?.[Y],(o=m?.classNames)==null?void 0:o[Y]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:w,"data-styled":!(m.jsx||m.unstyled||h),"data-mounted":Z,"data-promise":!!m.promise,"data-swiped":q,"data-removed":U,"data-visible":se,"data-y-position":Ge,"data-x-position":Je,"data-index":x,"data-front":ae,"data-swiping":ce,"data-dismissible":ie,"data-type":Y,"data-invert":jt,"data-swipe-out":ue,"data-swipe-direction":G,"data-expanded":!!(C||N&&Z),style:{"--index":x,"--toasts-before":x,"--z-index":y.length-x,"--offset":`${U?he:Ue.current}px`,"--initial-height":N?"auto":`${ge}px`,..._,...m.style},onPointerDown:be=>{gt||!ie||(Le.current=new Date,_e(Ue.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(J(!0),Qt.current={x:be.clientX,y:be.clientY}))},onPointerUp:()=>{var be,K,W,ee;if(ue||!ie)return;Qt.current=null;let le=Number(((be=De.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ve=Number(((K=De.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Fe=new Date().getTime()-((W=Le.current)==null?void 0:W.getTime()),Se=O==="x"?le:ve,We=Math.abs(Se)/Fe;if(Math.abs(Se)>=yT||We>.11){_e(Ue.current),(ee=m.onDismiss)==null||ee.call(m,m),X(O==="x"?le>0?"right":"left":ve>0?"down":"up"),qe(),re(!0),pe(!1);return}J(!1),B(null)},onPointerMove:be=>{var K,W,ee,le;if(!Qt.current||!ie||((K=window.getSelection())==null?void 0:K.toString().length)>0)return;let ve=be.clientY-Qt.current.y,Fe=be.clientX-Qt.current.x,Se=(W=t.swipeDirections)!=null?W:wT(T);!O&&(Math.abs(Fe)>1||Math.abs(ve)>1)&&B(Math.abs(Fe)>Math.abs(ve)?"x":"y");let We={x:0,y:0};O==="y"?(Se.includes("top")||Se.includes("bottom"))&&(Se.includes("top")&&ve<0||Se.includes("bottom")&&ve>0)&&(We.y=ve):O==="x"&&(Se.includes("left")||Se.includes("right"))&&(Se.includes("left")&&Fe<0||Se.includes("right")&&Fe>0)&&(We.x=Fe),(Math.abs(We.x)>0||Math.abs(We.y)>0)&&pe(!0),(ee=De.current)==null||ee.style.setProperty("--swipe-amount-x",`${We.x}px`),(le=De.current)==null||le.style.setProperty("--swipe-amount-y",`${We.y}px`)}},$e&&!m.jsx?ye.createElement("button",{"aria-label":V,"data-disabled":gt,"data-close-button":!0,onClick:gt||!ie?()=>{}:()=>{var be;qe(),(be=m.onDismiss)==null||be.call(m,m)},className:Dr(P?.closeButton,(r=m?.classNames)==null?void 0:r.closeButton)},(s=L?.close)!=null?s:iT):null,m.jsx||$p(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ye.createElement(ye.Fragment,null,Y||m.icon||m.promise?ye.createElement("div",{"data-icon":"",className:Dr(P?.icon,(i=m?.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Tt():null,m.type!=="loading"?m.icon||L?.[Y]||KA(Y):null):null,ye.createElement("div",{"data-content":"",className:Dr(P?.content,(a=m?.classNames)==null?void 0:a.content)},ye.createElement("div",{"data-title":"",className:Dr(P?.title,(l=m?.classNames)==null?void 0:l.title)},typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Dr(I,we,P?.description,(c=m?.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),$p(m.cancel)?m.cancel:m.cancel&&sd(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||A,onClick:be=>{var K,W;sd(m.cancel)&&ie&&((W=(K=m.cancel).onClick)==null||W.call(K,be),qe())},className:Dr(P?.cancelButton,(u=m?.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,$p(m.action)?m.action:m.action&&sd(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||F,onClick:be=>{var K,W;sd(m.action)&&((W=(K=m.action).onClick)==null||W.call(K,be),!be.defaultPrevented&&qe())},className:Dr(P?.actionButton,(d=m?.classNames)==null?void 0:d.actionButton)},m.action.label):null))};function W0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function IT(t,e){let o={};return[t,e].forEach((n,r)=>{let s=r===1,i=s?"--mobile-offset":"--offset",a=s?bT:gT;function l(c){["top","right","bottom","left"].forEach(u=>{o[`${i}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?o[`${i}-${c}`]=a:o[`${i}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(a)}),o}var H0=qA(function(t,e){let{invert:o,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:m,visibleToasts:h=hT,toastOptions:p,dir:g=W0(),gap:b=xT,loadingIcon:v,icons:x,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:C}=t,[S,w]=ye.useState([]),D=ye.useMemo(()=>Array.from(new Set([n].concat(S.filter(M=>M.position).map(M=>M.position)))),[S,n]),[_,A]=ye.useState([]),[F,R]=ye.useState(!1),[I,E]=ye.useState(!1),[T,$]=ye.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),j=ye.useRef(null),N=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=ye.useRef(null),L=ye.useRef(!1),V=ye.useCallback(M=>{w(O=>{var B;return(B=O.find(G=>G.id===M.id))!=null&&B.delete||Zo.dismiss(M.id),O.filter(({id:G})=>G!==M.id)})},[]);return ye.useEffect(()=>Zo.subscribe(M=>{if(M.dismiss){w(O=>O.map(B=>B.id===M.id?{...B,delete:!0}:B));return}setTimeout(()=>{QA.flushSync(()=>{w(O=>{let B=O.findIndex(G=>G.id===M.id);return B!==-1?[...O.slice(0,B),{...O[B],...M},...O.slice(B+1)]:[M,...O]})})})}),[]),ye.useEffect(()=>{if(u!=="system"){$(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{$(O?"dark":"light")})}catch{M.addListener(({matches:B})=>{try{$(B?"dark":"light")}catch(G){console.error(G)}})}},[u]),ye.useEffect(()=>{S.length<=1&&R(!1)},[S]),ye.useEffect(()=>{let M=O=>{var B,G;r.every(X=>O[X]||O.code===X)&&(R(!0),(B=j.current)==null||B.focus()),O.code==="Escape"&&(document.activeElement===j.current||(G=j.current)!=null&&G.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[r]),ye.useEffect(()=>{if(j.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,L.current=!1)}},[j.current]),ye.createElement("section",{ref:e,"aria-label":`${y} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((M,O)=>{var B;let[G,X]=M.split("-");return S.length?ye.createElement("ol",{key:M,dir:g==="auto"?W0():g,tabIndex:-1,ref:j,className:a,"data-sonner-toaster":!0,"data-theme":T,"data-y-position":G,"data-lifted":F&&S.length>1&&!s,"data-x-position":X,style:{"--front-toast-height":`${((B=_[0])==null?void 0:B.height)||0}px`,"--width":`${vT}px`,"--gap":`${b}px`,...m,...IT(l,c)},onBlur:Z=>{L.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(L.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||L.current||(L.current=!0,P.current=Z.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{I||R(!1)},onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},S.filter(Z=>!Z.position&&O===0||Z.position===M).map((Z,te)=>{var U,z;return ye.createElement(ST,{key:Z.id,icons:x,index:te,toast:Z,defaultRichColors:d,duration:(U=p?.duration)!=null?U:f,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:o,visibleToasts:h,closeButton:(z=p?.closeButton)!=null?z:i,interacting:I,position:M,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:V,toasts:S.filter(ce=>ce.position==Z.position),heights:_.filter(ce=>ce.position==Z.position),setHeights:A,expandByDefault:s,gap:b,loadingIcon:v,expanded:F,pauseWhenPageIsHidden:C,swipeDirections:t.swipeDirections})})):null}))});import{c as NT}from"react/compiler-runtime";import{jsx as LT}from"react/jsx-runtime";import{useRouter as $T}from"next/navigation.js";import{formatAdminURL as kT}from"payload/shared";import"react";import{c as ET}from"react/compiler-runtime";import{jsx as vl,jsxs as Bp}from"react/jsx-runtime";import PT from"react";import{c as Op}from"react/compiler-runtime";import{jsx as gn,jsxs as ad}from"react/jsx-runtime";import{createContext as FT,use as AT,useEffect as z0,useState as X0}from"react";import{jsx as RT}from"react/jsx-runtime";import"react";var id="gutter",Bo=t=>{let{children:e,className:o,left:n=!0,negativeLeft:r=!1,negativeRight:s=!1,ref:i,right:a=!0}=t,l=n&&!r,c=a&&!s;return RT("div",{className:[l&&`${id}--left`,c&&`${id}--right`,r&&`${id}--negative-left`,s&&`${id}--negative-right`,o].filter(Boolean).join(" "),ref:i,children:e})};import{c as _T}from"react/compiler-runtime";import{useId as DT}from"react";var bl=t=>{let e=_T(3),o=DT(),n=ct(),r=`${t}-${o}`,s;return e[0]!==n||e[1]!==r?(s=jp({slug:r,depth:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};var Fr="drawer",Mp=100,jp=({slug:t,depth:e})=>`drawer_${e}_${t}`,ur=t=>{let e=Op(17),o,n,r,s,i,a;e[0]!==t?({slug:a,children:o,className:n,disabled:r,onClick:s,...i}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=a):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],a=e[6]);let{openModal:l}=de(),c;e[7]!==s||e[8]!==l||e[9]!==a?(c=f=>{l(a),typeof s=="function"&&s(f)},e[7]=s,e[8]=l,e[9]=a,e[10]=c):c=e[10];let u=c,d;return e[11]!==o||e[12]!==n||e[13]!==r||e[14]!==u||e[15]!==i?(d=gn("button",{className:n,disabled:r,onClick:u,type:"button",...i,children:o}),e[11]=o,e[12]=n,e[13]=r,e[14]=u,e[15]=i,e[16]=d):d=e[16],d},Pt=t=>{let e=Op(26),{slug:o,children:n,className:r,gutter:s,Header:i,hoverTitle:a,title:l}=t,c=s===void 0?!0:s,{t:u}=k(),{closeModal:d,modalState:f}=de(),m=Wi(),[h,p]=X0(!1),[g,b]=X0(!1),v,x;e[0]!==f||e[1]!==o?(v=()=>{p(f[o]?.isOpen)},x=[o,f],e[0]=f,e[1]=o,e[2]=v,e[3]=x):(v=e[2],x=e[3]),z0(v,x);let y,C;if(e[4]!==h?(y=()=>{b(h)},C=[h],e[4]=h,e[5]=y,e[6]=C):(y=e[5],C=e[6]),z0(y,C),h){let S=g&&`${Fr}--is-open`,w=m>1&&`${Fr}--nested`,D;e[7]!==r||e[8]!==S||e[9]!==w?(D=[r,Fr,S,w].filter(Boolean),e[7]=r,e[8]=S,e[9]=w,e[10]=D):D=e[10];let _=D.join(" "),A=Mp+m,F;if(e[11]!==i||e[12]!==n||e[13]!==d||e[14]!==m||e[15]!==c||e[16]!==a||e[17]!==o||e[18]!==u||e[19]!==A||e[20]!==_||e[21]!==l){let R;e[23]!==d||e[24]!==o?(R=()=>d(o),e[23]=d,e[24]=o,e[25]=R):R=e[25],F=gn(TT,{children:ad(Yo,{className:_,slug:o,style:{zIndex:A},children:[(!m||m===1)&&gn("div",{className:`${Fr}__blur-bg`}),gn("button",{"aria-label":u("general:close"),className:`${Fr}__close`,id:`close-drawer__${o}`,onClick:R,type:"button"}),ad("div",{className:`${Fr}__content`,style:{width:`calc(100% - (${m} * var(--gutter-h)))`},children:[gn("div",{className:`${Fr}__blur-bg-content`}),ad(Bo,{className:`${Fr}__content-children`,left:c,right:c,children:[i,i===void 0&&ad("div",{className:`${Fr}__header`,children:[gn("h2",{className:`${Fr}__header__title`,title:a?l:null,children:l}),gn("button",{"aria-label":u("general:close"),className:`${Fr}__header__close`,id:`close-drawer__${o}`,onClick:()=>d(o),type:"button",children:gn(pt,{})})]}),n]})]})]})}),e[11]=i,e[12]=n,e[13]=d,e[14]=m,e[15]=c,e[16]=a,e[17]=o,e[18]=u,e[19]=A,e[20]=_,e[21]=l,e[22]=F}else F=e[22];return F}return null},U0=FT(1),TT=t=>{let e=Op(3),{children:o}=t,r=Wi()+1,s;return e[0]!==o||e[1]!==r?(s=gn(U0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},Wi=()=>AT(U0);var ld="confirmation-modal";function It(t){let e=ET(33),{body:o,cancelLabel:n,className:r,confirmingLabel:s,confirmLabel:i,heading:a,modalSlug:l,onCancel:c,onConfirm:u}=t,d=Wi(),[f,m]=PT.useState(!1),{closeModal:h}=de(),{t:p}=k(),g;e[0]!==h||e[1]!==f||e[2]!==l||e[3]!==u?(g=async()=>{f||(m(!0),typeof u=="function"&&await u(),m(!1),h(l))},e[0]=h,e[1]=f,e[2]=l,e[3]=u,e[4]=g):g=e[4];let b=g,v;e[5]!==h||e[6]!==f||e[7]!==l||e[8]!==c?(v=()=>{f||(h(l),typeof c=="function"&&c())},e[5]=h,e[6]=f,e[7]=l,e[8]=c,e[9]=v):v=e[9];let x=v,y;e[10]!==r?(y=[ld,r].filter(Boolean),e[10]=r,e[11]=y):y=e[11];let C=y.join(" "),S=Mp+d,w;if(e[12]!==o||e[13]!==n||e[14]!==i||e[15]!==f||e[16]!==s||e[17]!==a||e[18]!==l||e[19]!==x||e[20]!==b||e[21]!==p||e[22]!==C||e[23]!==S){let D;e[25]!==n||e[26]!==p?(D=n||p("general:cancel"),e[25]=n,e[26]=p,e[27]=D):D=e[27];let _;e[28]!==i||e[29]!==f||e[30]!==s||e[31]!==p?(_=f?s||`${p("general:loading")}...`:i||p("general:confirm"),e[28]=i,e[29]=f,e[30]=s,e[31]=p,e[32]=_):_=e[32],w=vl(Yo,{className:C,slug:l,style:{zIndex:S},children:Bp("div",{className:`${ld}__wrapper`,children:[Bp("div",{className:`${ld}__content`,children:[vl("h1",{children:a}),vl("p",{children:o})]}),Bp("div",{className:`${ld}__controls`,children:[vl(ne,{buttonStyle:"secondary",disabled:f,id:"confirm-cancel",onClick:x,size:"large",type:"button",children:D}),vl(ne,{id:"confirm-action",onClick:b,size:"large",children:_})]})]})}),e[12]=o,e[13]=n,e[14]=i,e[15]=f,e[16]=s,e[17]=a,e[18]=l,e[19]=x,e[20]=b,e[21]=p,e[22]=C,e[23]=S,e[24]=w}else w=e[24];return w}var Vp="stay-logged-in",Y0=()=>{let t=NT(11),{refreshCookie:e}=Ae(),o=$T(),{config:n}=H(),{admin:r,routes:s}=n,{routes:i}=r,{logout:a}=i,{admin:l}=s,{t:c}=k(),{startRouteTransition:u}=st(),d;t[0]!==l||t[1]!==a||t[2]!==o||t[3]!==u?(d=()=>u(()=>o.push(kT({adminRoute:l,path:a}))),t[0]=l,t[1]=a,t[2]=o,t[3]=u,t[4]=d):d=t[4];let f=d,m;t[5]!==e?(m=()=>{e()},t[5]=e,t[6]=m):m=t[6];let h=m,p;return t[7]!==h||t[8]!==f||t[9]!==c?(p=LT(It,{body:c("authentication:youAreInactive"),cancelLabel:c("authentication:stayLoggedIn"),confirmLabel:c("authentication:logOut"),heading:c("authentication:stayLoggedIn"),modalSlug:Vp,onCancel:h,onConfirm:f}),t[7]=h,t[8]=f,t[9]=c,t[10]=p):p=t[10],p};import{c as jT}from"react/compiler-runtime";import{useEffect as OT,useState as MT}from"react";function Jo(t,e){let o=jT(4),[n,r]=MT(t),s,i;return o[0]!==e||o[1]!==t?(s=()=>{let a=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(a)}},i=[t,e],o[0]=e,o[1]=t,o[2]=s,o[3]=i):(s=o[2],i=o[3]),OT(s,i),n}import*as Z0 from"qs-esm";var Qe={delete:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"delete"};return fetch(t,n)},get:(t,e={headers:{}})=>{let o="";return e.params&&(o=Z0.stringify(e.params,{addQueryPrefix:!0})),fetch(`${t}${o}`,{credentials:"include",...e})},patch:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"PATCH"};return fetch(t,n)},post:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"post"};return fetch(`${t}`,n)},put:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"put"};return fetch(t,n)}};var K0=HT({}),q0=2147483647;function Gp({children:t,permissions:e,user:o}){let[n,r]=xl(o),[s,i]=xl(),[a,l]=xl(),c=VT(),u=GT(),{config:d}=H(),{admin:{routes:{inactivity:f},user:m},routes:{admin:h,api:p},serverURL:g}=d,[b,v]=xl(e),{i18n:x}=k(),{closeAllModals:y,openModal:C}=de(),[S,w]=xl(0),D=Jo(S,1e4),_=J0.useRef(null),{startRouteTransition:A}=st(),F=n?.id,R=Ms(()=>{A(()=>u.replace(WT({adminRoute:h,path:`${f}${window.location.pathname.startsWith(h)?`?redirect=${encodeURIComponent(window.location.pathname)}`:""}`}))),y()},[u,h,f,y,A]),I=Ms(()=>{i(void 0),l(void 0),clearTimeout(_.current)},[]),E=Ms(L=>{L?.user?(r(L.user),i(L.token),l(L.exp)):(r(null),I())},[I]),T=Ms(L=>{let V=Math.round(new Date().getTime()/1e3),M=(typeof a=="number"?a:0)-V;return(L||a&&M<120)&&(_.current=setTimeout(()=>{async function O(){try{let B=await Qe.post(`${g}${p}/${m}/refresh-token?refresh`,{headers:{"Accept-Language":x.language}});if(B.status===200){let G=await B.json();E(G)}else E(null),R()}catch(B){fe.error(B.message)}}O()},1e3)),()=>{clearTimeout(_.current)}},[p,x.language,R,g,E,a,m]),$=Ms(async L=>{try{let V=await Qe.post(`${g}${p}/${m}/refresh-token`,{headers:{"Accept-Language":x.language}});if(V.status===200){let M=await V.json();return L||E(M),M.user}return E(null),R(),null}catch(V){return fe.error(`Refreshing token failed: ${V.message}`),null}},[p,x.language,R,g,E,m]),j=Ms(async()=>{try{return await Qe.post(`${g}${p}/${n.collection}/logout`),E(null),I(),!0}catch(L){return fe.error(`Logging out failed: ${L.message}`),!1}},[p,I,g,E,n]),N=Ms(async({locale:L}={})=>{let V=Q0.stringify({locale:L},{addQueryPrefix:!0});try{let M=await Qe.get(`${g}${p}/access${V}`,{headers:{"Accept-Language":x.language}});if(M.status===200){let O=await M.json();v(O)}else throw new Error(`Fetching permissions failed with status code ${M.status}`)}catch(M){fe.error(`Refreshing permissions failed: ${M.message}`)}},[g,p,x]),P=J0.useCallback(async()=>{try{let L=await Qe.get(`${g}${p}/${m}/me`,{credentials:"include",headers:{"Accept-Language":x.language}});if(L.status===200){let V=await L.json(),M=null;return E(V),M}}catch(L){fe.error(`Fetching user failed: ${L.message}`)}return null},[g,p,m,x.language,E]);return cd(()=>{P()},[P]),cd(()=>{F&&T()},[D,T,F]),cd(()=>{w(Date.now())},[c]),cd(()=>{let L,V,M=Math.round(new Date().getTime()/1e3),O=typeof a=="number"?a-M:0,B=Math.max(Math.min((O-60)*1e3,q0),0),G=Math.max(Math.min(O*1e3,q0),0);if(!n){clearTimeout(L),clearTimeout(V);return}return O>0&&(L=setTimeout(()=>{C(Vp)},B),V=setTimeout(()=>{E(null),R()},G)),()=>{L&&clearTimeout(L),V&&clearTimeout(V)}},[a,C,x,E,n,R]),BT(K0,{value:{fetchFullUser:P,logOut:j,permissions:b,refreshCookie:T,refreshCookieAsync:$,refreshPermissions:N,setPermissions:v,setUser:E,token:s,user:n},children:t})}var Ae=()=>zT(K0);import{jsx as XT}from"react/jsx-runtime";import{dequal as ex}from"dequal/lite";import{createContext as UT,use as YT,useCallback as tx,useEffect as ZT,useRef as Hp}from"react";function Wp(t,e){let o={...t};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&!Array.isArray(e[n])&&t[n]?o[n]=Wp(t[n],e[n]):o[n]=e[n]);return o}var rx=UT({}),ox=(t,e)=>({body:JSON.stringify({value:t}),headers:{"Accept-Language":e,"Content-Type":"application/json"}}),zp=({children:t})=>{let e=Hp({}),o=Hp({}),n=Hp({}),{config:r}=H(),{user:s}=Ae(),{i18n:i}=k(),{routes:{api:a},serverURL:l}=r;ZT(()=>{s||(o.current={})},[s]);let c=tx(async d=>{let f=o.current;if(typeof f[d]<"u")return f[d];let m=new Promise(h=>{(async()=>{let p=await Qe.get(`${l}${a}/payload-preferences/${d}`,{headers:{"Accept-Language":i.language}}),g=null;p.status===200&&(g=(await p.json()).value),o.current[d]=g,h(g)})()});return f[d]=m,m},[i.language,a,o,l]),u=tx(async(d,f,m=!1)=>{if(m===!1){o.current[d]=f,await Qe.post(`${l}${a}/payload-preferences/${d}`,ox(f,i.language));return}let h=f,p=await c(d);if(typeof f=="object"&&typeof p=="object"&&typeof h=="object"){if(p&&(h=Wp(p,h)),ex(h,p))return;n.current[d]={...n.current[d],...h}}else{if(h===p)return;n.current[d]=h}let g=async()=>{ex(n.current[d],o.current[d])||(o.current[d]=n.current[d],await Qe.post(`${l}${a}/payload-preferences/${d}`,ox(o.current[d],i.language)),delete n.current[d])};setTimeout(()=>{g()})},[a,c,i.language,n,l]);return e.current.getPreference=c,e.current.setPreference=u,XT(rx,{value:e.current,children:t})},Fo=()=>YT(rx);var lx=ix({}),cx=ix({localeIsLoading:!1,setLocaleIsLoading:t=>{}}),tE=async(t,e)=>await fetch(`${e}/payload-preferences/${t}`,{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"})?.then(o=>o.json()),Xp=t=>{let e=JT(27),{children:o,locale:n}=t,{config:r}=H(),{localization:s,routes:i,serverURL:a}=r,l=s===void 0?!1:s,{api:c}=i,{user:u}=Ae(),d=l?l.defaultLocale:"en",{getPreference:f}=Fo(),m=qT(),h;e[0]!==m?(h=m.get("locale"),e[0]=m,e[1]=h):h=e[1];let p=h,g;e[2]!==d||e[3]!==n||e[4]!==p||e[5]!==l?(g=()=>!l||l&&!l.locales.length?{}:Yn(l,p)||Yn(l,n)||Yn(l,d)||Yn(l,l.locales[0].code),e[2]=d,e[3]=n,e[4]=p,e[5]=l,e[6]=g):g=e[6];let[b,v]=QT.useState(g),[x,y]=eE(!1),C=KT(b),S,w;e[7]!==b?(S=()=>{b.code!==C.current.code&&y(!1),C.current=b},w=[b],e[7]=b,e[8]=S,e[9]=w):(S=e[8],w=e[9]),sx(S,w);let D=`${a}${c}`,_;e[10]!==d||e[11]!==D||e[12]!==p||e[13]!==l||e[14]!==u?.id?(_=()=>{(async function(){if(l&&u?.id){let T=p||await tE("locale",D)?.then(oE),$=Yn(l,T)||Yn(l,d)||Yn(l,l?.locales?.[0]?.code);$&&v($)}})()},e[10]=d,e[11]=D,e[12]=p,e[13]=l,e[14]=u?.id,e[15]=_):_=e[15];let A=u?.id,F;e[16]!==d||e[17]!==D||e[18]!==f||e[19]!==p||e[20]!==l||e[21]!==A?(F=[d,f,l,D,p,A],e[16]=d,e[17]=D,e[18]=f,e[19]=p,e[20]=l,e[21]=A,e[22]=F):F=e[22],sx(_,F);let R;return e[23]!==o||e[24]!==x||e[25]!==b?(R=nx(lx,{value:b,children:nx(cx,{value:{localeIsLoading:x,setLocaleIsLoading:y},children:o})}),e[23]=o,e[24]=x,e[25]=b,e[26]=R):R=e[26],R},ud=()=>ax(cx),Ne=()=>ax(lx);function oE(t){return t.value}var dd=(t,e,o)=>`field-${t?.replace(/\./g,"__")}${e>1?`-${e}`:""}${o?`-${o}`:""}`;var xe=t=>{let e=rE(25),{as:o,hideLocale:n,htmlFor:r,label:s,localized:i,path:a,required:l,unstyled:c}=t,u=o===void 0?"label":o,d=n===void 0?!1:n,f=i===void 0?!1:i,m=l===void 0?!1:l,h=c===void 0?!1:c,{uuid:p}=Oe(),g=ct(),b;e[0]!==g||e[1]!==r||e[2]!==a||e[3]!==p?(b=r||dd(a,g,p),e[0]=g,e[1]=r,e[2]=a,e[3]=p,e[4]=b):b=e[4];let v=b,{i18n:x}=k(),{code:y,label:C}=Ne();if(s){let S=`field-label ${h?"unstyled":""}`,w;if(e[5]!==u||e[6]!==y||e[7]!==d||e[8]!==v||e[9]!==x||e[10]!==s||e[11]!==C||e[12]!==f||e[13]!==m||e[14]!==S||e[15]!==h){let D;e[17]!==m||e[18]!==h?(D=m&&!h&&nE("span",{className:"required",children:"*"}),e[17]=m,e[18]=h,e[19]=D):D=e[19];let _;e[20]!==y||e[21]!==d||e[22]!==C||e[23]!==f?(_=f&&!d&&ux("span",{className:"localized",children:["\u2014 ",typeof C=="string"?C:y]}),e[20]=y,e[21]=d,e[22]=C,e[23]=f,e[24]=_):_=e[24],w=ux(u,{className:S,htmlFor:v,children:[sE(s,x),D,_]}),e[5]=u,e[6]=y,e[7]=d,e[8]=v,e[9]=x,e[10]=s,e[11]=C,e[12]=f,e[13]=m,e[14]=S,e[15]=h,e[16]=w}else w=e[16];return w}return null};var md=({collapsed:t,rowID:e,rows:o})=>o.reduce((n,r)=>(e===r.id&&(r.collapsed=t),r.collapsed&&n.collapsedIDs.push(r.id),n.updatedRows.push(r),n),{collapsedIDs:[],updatedRows:[]}),fd=({collapsed:t,rows:e})=>e.reduce((o,n)=>(n.collapsed=t,t&&o.collapsedIDs.push(n.id),o.updatedRows.push(n),o),{collapsedIDs:[],updatedRows:[]});import{c as UE}from"react/compiler-runtime";import{jsx as sy}from"react/jsx-runtime";import*as iy from"react";import{jsx as Dl,jsxs as HE}from"react/jsx-runtime";import{useCallback as ny,useMemo as zE}from"react";import{c as VE}from"react/compiler-runtime";import{useRef as ey}from"react";import{c as iE}from"react/compiler-runtime";import{useEffect as aE,useRef as lE}from"react";var Bs=(t,e,o)=>{let n=iE(9),r;n[0]!==o?(r=o===void 0?[]:o,n[0]=o,n[1]=r):r=n[1];let s=r,i;n[2]===Symbol.for("react.memo_cache_sentinel")?(i=Date.now(),n[2]=i):i=n[2];let a=lE(i),l;n[3]!==t||n[4]!==e?(l=()=>{let u=setTimeout(()=>{Date.now()-a.current>=e&&(t(),a.current=Date.now())},e-(Date.now()-a.current));return()=>{clearTimeout(u)}},n[3]=t,n[4]=e,n[5]=l):l=n[5];let c;n[6]!==e||n[7]!==s?(c=[e,...s],n[6]=e,n[7]=s,n[8]=c):c=n[8],aE(l,c)};import{jsx as rh}from"react/jsx-runtime";import*as Jx from"qs-esm";import Yx,{createContext as NE,use as LE,useCallback as Yi,useEffect as Zx,useMemo as $E,useRef as kE,useState as qo}from"react";import{getTranslation as AE}from"@payloadcms/translations";var cE={},yl={};function Hi(t,e){try{let n=(cE[t]||=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format)(e).split("GMT")[1]||"";return n in yl?yl[n]:dx(n,n.split(":"))}catch{if(t in yl)return yl[t];let o=t?.match(uE);return o?dx(t,o.slice(1)):NaN}}var uE=/([+-]\d\d):?(\d\d)?/;function dx(t,e){let o=+e[0],n=+(e[1]||0);return yl[t]=o>0?o*60+n:o*60-n}var Mt=class t extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Hi(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),fx(this,NaN),Up(this)):this.setTime(Date.now())}static tz(e,...o){return o.length?new t(...o,e):new t(Date.now(),e)}withTimeZone(e){return new t(+this,e)}getTimezoneOffset(){return-Hi(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Up(this),+this}[Symbol.for("constructDateFrom")](e){return new t(+new Date(e),this.timeZone)}},mx=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!mx.test(t))return;let e=t.replace(mx,"$1UTC");Mt.prototype[e]&&(t.startsWith("get")?Mt.prototype[t]=function(){return this.internal[e]()}:(Mt.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),dE(this),+this},Mt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Up(this),+this}))});function Up(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function dE(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),fx(t)}function fx(t){let e=Hi(t.timeZone,t),o=new Date(+t);o.setUTCHours(o.getUTCHours()-1);let n=-new Date(+t).getTimezoneOffset(),r=-new Date(+o).getTimezoneOffset(),s=n-r,i=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();s&&i&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+s);let a=n-e;a&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+a);let l=Hi(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-l,d=l!==e,f=u-a;if(d&&f){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+f);let m=Hi(t.timeZone,t),h=l-m;h&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+h),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+h))}}var mE=Math.pow(10,8)*24*60*60*1e3,gJ=-mE,pd=6048e5,px=864e5;var Cl=43200,Yp=1440;var fE=3600;var hx=fE*24,bJ=hx*7,pE=hx*365.2425,hE=pE/12,vJ=hE*3,Zp=Symbol.for("constructDateFrom");function ao(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Zp in t?t[Zp](e):t instanceof Date?new t.constructor(e):new Date(e)}function Ke(t,e){return ao(e||t,t)}var gE={};function qr(){return gE}function bn(t,e){let o=qr(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,r=Ke(t,e?.in),s=r.getDay(),i=(s<n?7:0)+s-n;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Vs(t,e){return bn(t,{...e,weekStartsOn:1})}function hd(t,e){let o=Ke(t,e?.in),n=o.getFullYear(),r=ao(o,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let s=Vs(r),i=ao(o,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let a=Vs(i);return o.getTime()>=s.getTime()?n+1:o.getTime()>=a.getTime()?n:n-1}function zi(t){let e=Ke(t),o=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return o.setUTCFullYear(e.getFullYear()),+t-+o}function Jn(t,...e){let o=ao.bind(null,t||e.find(n=>typeof n=="object"));return e.map(o)}function Jp(t,e){let o=Ke(t,e?.in);return o.setHours(0,0,0,0),o}function gx(t,e,o){let[n,r]=Jn(o?.in,t,e),s=Jp(n),i=Jp(r),a=+s-zi(s),l=+i-zi(i);return Math.round((a-l)/px)}function bx(t,e){let o=hd(t,e),n=ao(e?.in||t,0);return n.setFullYear(o,0,4),n.setHours(0,0,0,0),Vs(n)}function Xi(t,e){let o=+Ke(t)-+Ke(e);return o<0?-1:o>0?1:o}function vx(t){return ao(t,Date.now())}function xx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function yx(t){return!(!xx(t)&&typeof t!="number"||isNaN(+Ke(t)))}function Cx(t,e,o){let[n,r]=Jn(o?.in,t,e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function wx(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function Sx(t,e){return+Ke(t)-+Ke(e)}function Ix(t,e){let o=Ke(t,e?.in);return o.setHours(23,59,59,999),o}function Rx(t,e){let o=Ke(t,e?.in),n=o.getMonth();return o.setFullYear(o.getFullYear(),n+1,0),o.setHours(23,59,59,999),o}function _x(t,e){let o=Ke(t,e?.in);return+Ix(o,e)==+Rx(o,e)}function Dx(t,e,o){let[n,r,s]=Jn(o?.in,t,t,e),i=Xi(r,s),a=Math.abs(Cx(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=Xi(r,s)===-i;_x(n)&&a===1&&Xi(n,s)===1&&(l=!1);let c=i*(a-+l);return c===0?0:c}function Fx(t,e,o){let n=Sx(t,e)/1e3;return wx(o?.roundingMethod)(n)}function Ax(t,e){let o=Ke(t,e?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}function Tx(t,e){let o=Ke(t,e?.in);return gx(o,Ax(o))+1}function Ex(t,e){let o=Ke(t,e?.in),n=+Vs(o)-+bx(o);return Math.round(n/pd)+1}function gd(t,e){let o=Ke(t,e?.in),n=o.getFullYear(),r=qr(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=ao(e?.in||t,0);i.setFullYear(n+1,0,s),i.setHours(0,0,0,0);let a=bn(i,e),l=ao(e?.in||t,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);let c=bn(l,e);return+o>=+a?n+1:+o>=+c?n:n-1}function Px(t,e){let o=qr(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,r=gd(t,e),s=ao(e?.in||t,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),bn(s,e)}function Nx(t,e){let o=Ke(t,e?.in),n=+bn(o,e)-+Px(o,e);return Math.round(n/pd)+1}function it(t,e){let o=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return o+n}var vn={y(t,e){let o=t.getFullYear(),n=o>0?o:1-o;return it(e==="yy"?n%100:n,e.length)},M(t,e){let o=t.getMonth();return e==="M"?String(o+1):it(o+1,2)},d(t,e){return it(t.getDate(),e.length)},a(t,e){let o=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(t,e){return it(t.getHours()%12||12,e.length)},H(t,e){return it(t.getHours(),e.length)},m(t,e){return it(t.getMinutes(),e.length)},s(t,e){return it(t.getSeconds(),e.length)},S(t,e){let o=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,o-3));return it(r,e.length)}};var Ui={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qp={G:function(t,e,o){let n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})}},y:function(t,e,o){if(e==="yo"){let n=t.getFullYear(),r=n>0?n:1-n;return o.ordinalNumber(r,{unit:"year"})}return vn.y(t,e)},Y:function(t,e,o,n){let r=gd(t,n),s=r>0?r:1-r;if(e==="YY"){let i=s%100;return it(i,2)}return e==="Yo"?o.ordinalNumber(s,{unit:"year"}):it(s,e.length)},R:function(t,e){let o=hd(t);return it(o,e.length)},u:function(t,e){let o=t.getFullYear();return it(o,e.length)},Q:function(t,e,o){let n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return it(n,2);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,o){let n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return it(n,2);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,o){let n=t.getMonth();switch(e){case"M":case"MM":return vn.M(t,e);case"Mo":return o.ordinalNumber(n+1,{unit:"month"});case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,o){let n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return it(n+1,2);case"Lo":return o.ordinalNumber(n+1,{unit:"month"});case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,o,n){let r=Nx(t,n);return e==="wo"?o.ordinalNumber(r,{unit:"week"}):it(r,e.length)},I:function(t,e,o){let n=Ex(t);return e==="Io"?o.ordinalNumber(n,{unit:"week"}):it(n,e.length)},d:function(t,e,o){return e==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):vn.d(t,e)},D:function(t,e,o){let n=Tx(t);return e==="Do"?o.ordinalNumber(n,{unit:"dayOfYear"}):it(n,e.length)},E:function(t,e,o){let n=t.getDay();switch(e){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,o,n){let r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return it(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(r,{width:"short",context:"formatting"});case"eeee":default:return o.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,o,n){let r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return it(s,e.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,o){let n=t.getDay(),r=n===0?7:n;switch(e){case"i":return String(r);case"ii":return it(r,e.length);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return o.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(n,{width:"short",context:"formatting"});case"iiii":default:return o.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,o){let r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,o){let n=t.getHours(),r;switch(n===12?r=Ui.noon:n===0?r=Ui.midnight:r=n/12>=1?"pm":"am",e){case"b":case"bb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,o){let n=t.getHours(),r;switch(n>=17?r=Ui.evening:n>=12?r=Ui.afternoon:n>=4?r=Ui.morning:r=Ui.night,e){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,o){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),o.ordinalNumber(n,{unit:"hour"})}return vn.h(t,e)},H:function(t,e,o){return e==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):vn.H(t,e)},K:function(t,e,o){let n=t.getHours()%12;return e==="Ko"?o.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},k:function(t,e,o){let n=t.getHours();return n===0&&(n=24),e==="ko"?o.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},m:function(t,e,o){return e==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):vn.m(t,e)},s:function(t,e,o){return e==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):vn.s(t,e)},S:function(t,e){return vn.S(t,e)},X:function(t,e,o){let n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return $x(n);case"XXXX":case"XX":return Gs(n);case"XXXXX":case"XXX":default:return Gs(n,":")}},x:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"x":return $x(n);case"xxxx":case"xx":return Gs(n);case"xxxxx":case"xxx":default:return Gs(n,":")}},O:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Lx(n,":");case"OOOO":default:return"GMT"+Gs(n,":")}},z:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Lx(n,":");case"zzzz":default:return"GMT"+Gs(n,":")}},t:function(t,e,o){let n=Math.trunc(+t/1e3);return it(n,e.length)},T:function(t,e,o){return it(+t,e.length)}};function Lx(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=Math.trunc(n/60),s=n%60;return s===0?o+String(r):o+String(r)+e+it(s,2)}function $x(t,e){return t%60===0?(t>0?"-":"+")+it(Math.abs(t)/60,2):Gs(t,e)}function Gs(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=it(Math.trunc(n/60),2),s=it(n%60,2);return o+r+e+s}var kx=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},jx=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},bE=(t,e)=>{let o=t.match(/(P+)(p+)?/)||[],n=o[1],r=o[2];if(!r)return kx(t,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",kx(n,e)).replace("{{time}}",jx(r,e))},Ox={p:jx,P:bE};var vE=/^D+$/,xE=/^Y+$/,yE=["D","DD","YY","YYYY"];function Mx(t){return vE.test(t)}function Bx(t){return xE.test(t)}function Vx(t,e,o){let n=CE(t,e,o);if(console.warn(n),yE.includes(t))throw new RangeError(n)}function CE(t,e,o){let n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var wE=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,SE=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IE=/^'([^]*?)'?$/,RE=/''/g,_E=/[a-zA-Z]/;function Qp(t,e,o){let n=qr(),r=o?.locale??n.locale??ol,s=o?.firstWeekContainsDate??o?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=o?.weekStartsOn??o?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Ke(t,o?.in);if(!yx(a))throw new RangeError("Invalid time value");let l=e.match(SE).map(u=>{let d=u[0];if(d==="p"||d==="P"){let f=Ox[d];return f(u,r.formatLong)}return u}).join("").match(wE).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:DE(u)};if(qp[d])return{isToken:!0,value:u};if(d.match(_E))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));let c={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return l.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!o?.useAdditionalWeekYearTokens&&Bx(d)||!o?.useAdditionalDayOfYearTokens&&Mx(d))&&Vx(d,e,String(t));let f=qp[d[0]];return f(a,d,r.localize,c)}).join("")}function DE(t){let e=t.match(IE);return e?e[1].replace(RE,"'"):t}function Gx(t,e,o){let n=qr(),r=o?.locale??n.locale??ol,s=2520,i=Xi(t,e);if(isNaN(i))throw new RangeError("Invalid time value");let a=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:i}),[l,c]=Jn(o?.in,...i>0?[e,t]:[t,e]),u=Fx(c,l),d=(zi(c)-zi(l))/1e3,f=Math.round((u-d)/60),m;if(f<2)return o?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):f===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",f,a);if(f<45)return r.formatDistance("xMinutes",f,a);if(f<90)return r.formatDistance("aboutXHours",1,a);if(f<Yp){let h=Math.round(f/60);return r.formatDistance("aboutXHours",h,a)}else{if(f<s)return r.formatDistance("xDays",1,a);if(f<Cl){let h=Math.round(f/Yp);return r.formatDistance("xDays",h,a)}else if(f<Cl*2)return m=Math.round(f/Cl),r.formatDistance("aboutXMonths",m,a)}if(m=Dx(c,l),m<12){let h=Math.round(f/Cl);return r.formatDistance("xMonths",h,a)}else{let h=m%12,p=Math.trunc(m/12);return h<3?r.formatDistance("aboutXYears",p,a):h<9?r.formatDistance("overXYears",p,a):r.formatDistance("almostXYears",p+1,a)}}function Wx(t,e){return Gx(t,vx(t),e)}function Ar(t,e){let o=FE(e)?new e(0):ao(e,0);return o.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),o.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),o}function FE(t){return typeof t=="function"&&t.prototype?.constructor===t}var xn=({date:t,i18n:e,pattern:o,timezone:n})=>{let r=new Mt(new Date(t));if(n){let s=Mt.tz(n),i=r.withTimeZone(n),a=Ar(i,s);return e.dateFNS?Qp(a,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`}return e.dateFNS?Qp(r,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`},Hx=({date:t,i18n:e})=>{let o=new Date(t);return e?.dateFNS?Wx(o,{locale:e.dateFNS}):`${e.t("general:loading")}...`};function Kp(t){return typeof t=="object"&&"root"in t}function bd(t,e){for(let o of t)"text"in o&&o.text?e+=o.text:"children"in o||(e+=`[${o.type}]`),"children"in o&&o.children&&(e+=bd(o.children,e));return e}var dr=({collectionConfig:t,data:e,dateFormat:o,fallback:n,globalConfig:r,i18n:s})=>{let i;if(t){let a=t?.admin?.useAsTitle;if(a&&(i=e?.[a]||i,i)){let l=t.fields.find(u=>"name"in u&&u.name===a);if(l?.type==="date"){let u="date"in l.admin&&l?.admin?.date?.displayFormat||o;i=xn({date:i,i18n:s,pattern:u})||i}}}return r&&(i=AE(r?.label,s)||r?.slug),Kp(i)&&(i=bd(i.root.children?.[0]?.children||[],"")),!i&&Kp(n)&&(i=bd(n.root.children?.[0]?.children||[],"")),i||(i=typeof n=="string"?n:`[${s.t("general:untitled")}]`),i};import{c as TE}from"react/compiler-runtime";import{jsx as EE}from"react/jsx-runtime";import eh from"react";var zx=eh.createContext({getUploadEdits:()=>{},resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),th=t=>{let e=TE(10),{children:o,initialUploadEdits:n}=t,r;e[0]!==n?(r=n||{},e[0]=n,e[1]=r):r=e[1];let[s,i]=eh.useState(r),a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{i({})},e[2]=a):a=e[2];let l=a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h=>{i(p=>({...p||{},...h||{}}))},e[3]=c):c=e[3];let u=c,d;e[4]!==s?(d=()=>s,e[4]=s,e[5]=d):d=e[5];let f=d,m;return e[6]!==o||e[7]!==f||e[8]!==s?(m=EE(zx,{value:{getUploadEdits:f,resetUploadEdits:l,updateUploadEdits:u,uploadEdits:s},children:o}),e[6]=o,e[7]=f,e[8]=s,e[9]=m):m=e[9],m},Ws=()=>eh.use(zx);import*as oh from"qs-esm";import PE from"react";var wl=t=>{let{collectionSlug:e,docPermissions:o,globalSlug:n,isEditing:r}=t;return e?!!(r&&o?.update||!r&&o?.create):n?!!o?.update:!1};var Xx=({id:t,collectionSlug:e,globalSlug:o})=>!!(o||e&&t);var Ux=({id:t,api:e,collectionSlug:o,globalSlug:n,i18n:r,locale:s,permissions:i,serverURL:a,setDocPermissions:l,setHasPublishPermission:c,setHasSavePermission:u})=>PE.useCallback(async d=>{let f={locale:s||void 0},m=d?.id||t,h=Xx({id:m,collectionSlug:o,globalSlug:n});if(h){let p=o?`/${o}/access/${m}`:n?`/globals/${n}/access`:null;if(p){let b=await(await fetch(`${a}${e}${p}?${oh.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"post"})).json(),v=await fetch(`${a}${e}${p}?${oh.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"POST"}).then(x=>x.json());l(b),u(wl({collectionSlug:o,docPermissions:b,globalSlug:n,isEditing:h})),c(v?.update)}}else{let p=o?i?.collections?.[o]:i?.globals?.[n];l(p),u(wl({collectionSlug:o,docPermissions:p,globalSlug:n,isEditing:h}))}},[a,e,t,i,r.language,s,o,n]);var qx=NE({}),Pe=()=>LE(qx),jE=({children:t,...e})=>{let{id:o,collectionSlug:n,currentEditor:r,docPermissions:s,globalSlug:i,hasPublishedDoc:a,hasPublishPermission:l,hasSavePermission:c,initialData:u,initialState:d,isLocked:f,lastUpdateTime:m,mostRecentVersionIsAutosaved:h,unpublishedVersionCount:p,versionCount:g}=e,[b,v]=qo(s),[x,y]=qo(c),[C,S]=qo(l),{permissions:w}=Ae(),{config:{admin:{dateFormat:D},routes:{api:_},serverURL:A},getEntityConfig:F}=H(),R=F({collectionSlug:n}),I=F({globalSlug:i}),E=kE(new AbortController),T=R||I,{i18n:$}=k(),{uploadEdits:j}=Ws(),[N,P]=qo(()=>dr({collectionConfig:R,data:{...u||{},id:o},dateFormat:D,fallback:o?.toString(),globalConfig:I,i18n:$})),[L,V]=qo(h),[M,O]=qo(g),[B,G]=qo(a),[X,Z]=qo(p),[te,U]=qo(f),[z,ce]=qo(r),[J,ue]=qo(m),[re,q]=qo(u),[pe,he]=qo("idle"),_e=Yi(Ge=>{he(Ge)},[]),{getPreference:ge,setPreference:Ve}=Fo(),{code:Q}=Ne(),{localeIsLoading:Le}=ud(),De=$E(()=>d===void 0||u===void 0||Le,[u,d,Le]),ae=`${A}${_}`,se,Y,ie;i&&(se=i,Y="globals",ie=`global-${se}`),n&&(se=n,Y="collections",o&&(ie=`collection-${se}-${o}`));let me=Yi(async(Ge,Je)=>{try{let xt=Je===i?`where[globalSlug][equals]=${Je}`:`where[document.value][equals]=${Ge}&where[document.relationTo][equals]=${Je}`,jt=await Qe.get(`${A}${_}/payload-locked-documents?${xt}`),{docs:gt}=await jt.json();if(gt.length>0){let qe=gt[0].id;await Qe.delete(`${A}${_}/payload-locked-documents/${qe}`,{headers:{"Content-Type":"application/json"}}),U(!1)}}catch(Ye){console.error("Failed to unlock the document",Ye)}},[A,_,i]),we=Yi(async(Ge,Je,Ye)=>{try{let jt=Je===i?`where[globalSlug][equals]=${Je}`:`where[document.value][equals]=${Ge}&where[document.relationTo][equals]=${Je}`,gt=await Qe.get(`${A}${_}/payload-locked-documents?${jt}`),{docs:qe}=await gt.json();if(qe.length>0){let Tt=qe[0].id,be=typeof Ye=="object"?{relationTo:Ye.collection,value:Ye.id}:{relationTo:"users",value:Ye};await Qe.patch(`${A}${_}/payload-locked-documents/${Tt}`,{body:JSON.stringify({user:be}),headers:{"Content-Type":"application/json"}})}}catch(xt){console.error("Failed to update the document editor",xt)}},[A,_,i]),ze=Ux({id:o,api:_,collectionSlug:n,globalSlug:i,i18n:$,locale:Q,permissions:w,serverURL:A,setDocPermissions:v,setHasPublishPermission:S,setHasSavePermission:y}),$e=Yi(()=>ge(ie),[ge,ie]),ot=Yi(async(Ge,Je)=>{let Ye=await $e();if(ie)try{await Ve(ie,{...Ye,fields:{...Ye?.fields||{},[Ge]:{...Ye?.fields?.[Ge],...Je}}})}catch(xt){console.error(xt)}},[Ve,ie,$e]),Xe=Yi(()=>{let Ge=M+1;R&&R.versions?R.versions.maxPerDoc>0?O(Math.min(Ge,R.versions.maxPerDoc)):O(Ge):I&&I.versions&&(I.versions.max>0?O(Math.min(Ge,I.versions.max)):O(Ge))},[R,I,M]),Ue=Yx.useCallback(Ge=>{q(Ge)},[]);Zx(()=>{P(dr({collectionConfig:R,data:{...re,id:o},dateFormat:D,fallback:o?.toString(),globalConfig:I,i18n:$}))},[R,I,re,D,$,o]),Zx(()=>{let Ge=E.current;return()=>{if(Ge)try{Ge.abort()}catch{}}},[]);let ft=Yx.useMemo(()=>`${`${ae}${Y==="globals"?"/globals":""}/${se}${o?`/${o}`:""}`}${Jx.stringify({depth:0,"fallback-locale":"null",locale:Q,uploadEdits:j||void 0},{addQueryPrefix:!0})}`,[ae,Q,Y,o,se,j]),Qt={...e,action:ft,currentEditor:z,docConfig:T,docPermissions:b,documentIsLocked:te,getDocPermissions:ze,getDocPreferences:$e,hasPublishedDoc:B,hasPublishPermission:C,hasSavePermission:x,incrementVersionCount:Xe,initialData:u,initialState:d,isInitializing:De,lastUpdateTime:J,mostRecentVersionIsAutosaved:L,preferencesKey:ie,savedDocumentData:re,setCurrentEditor:ce,setDocFieldPreferences:ot,setDocumentIsLocked:U,setDocumentTitle:P,setHasPublishedDoc:G,setLastUpdateTime:ue,setMostRecentVersionIsAutosaved:V,setUnpublishedVersionCount:Z,setUploadStatus:_e,title:N,unlockDocument:me,unpublishedVersionCount:X,updateDocumentEditor:we,updateSavedDocumentData:Ue,uploadStatus:pe,versionCount:M};return rh(qx,{value:Qt,children:t})},Sl=t=>rh(th,{children:rh(jE,{...t})});import{jsx as OE}from"react/jsx-runtime";import{createContext as ME,use as BE}from"react";var vd=ME(""),Il=({children:t,operation:e})=>OE(vd,{value:e,children:t}),Qo=()=>BE(vd);import Qx from"react";var nh=Qx.createContext(void 0),Kx=()=>{let t=Qx.useContext(nh);if(t)return t};var Ee=t=>{let e=VE(64),o;e[0]!==t?(o=t||{},e[0]=t,e[1]=o):o=e[1];let{disableFormData:n,hasRows:r,path:s,potentiallyStalePath:i,validate:a}=o,l=n===void 0?!1:n,c=Kx(),u=s||c||i,d=Xt(),f=lr(),m=Ts(),{user:h}=Ae(),{id:p,collectionSlug:g}=Pe(),b=Qo(),v=Et(GE),x;e[2]!==u?(x=pe=>{let[he]=pe;return he&&he?.[u]||null},e[2]=u,e[3]=x):x=e[3];let y=Et(x),{t:C}=k(),{config:S}=H(),{getData:w,getDataByPath:D,getSiblingData:_,setModified:A}=Oe(),F=$i(),R=Ut(),I=y?.filterOptions,E=y?.value,T=y?.initialValue,$=typeof y?.valid=="boolean"?y.valid:!0,j=$===!1&&d,N=ey($),P=ey(y?.errorMessage),L;e[4]!==u?(L=u?u.split("."):[],e[4]=u,e[5]=L):L=e[5];let V=L,M;e[6]!==l||e[7]!==v||e[8]!==r||e[9]!==R||e[10]!==u||e[11]!==A?(M=(pe,he)=>{let _e=he===void 0?!1:he,ge=pe&&pe.target?pe.target.value:pe;v({type:"UPDATE",disableFormData:l||r&&ge>0,path:u,value:ge}),_e||typeof A=="function"&&R===!1&&setTimeout(()=>{A(!0)},10)},e[6]=l,e[7]=v,e[8]=r,e[9]=R,e[10]=u,e[11]=A,e[12]=M):M=e[12];let O=M,B,G=y?.customComponents,X=f||m,Z=y?.errorMessage,te;e[13]!==y?.errorPaths?(te=y?.errorPaths||[],e[13]=y?.errorPaths,e[14]=te):te=e[14];let U=y?.rows,z=y?.valid,ce;e[15]!==I||e[16]!==T||e[17]!==m||e[18]!==u||e[19]!==f||e[20]!==O||e[21]!==j||e[22]!==d||e[23]!==U||e[24]!==z||e[25]!==G||e[26]!==X||e[27]!==Z||e[28]!==te||e[29]!==E?(ce={customComponents:G,disabled:X,errorMessage:Z,errorPaths:te,filterOptions:I,formInitializing:m,formProcessing:f,formSubmitted:d,initialValue:T,path:u,rows:U,setValue:O,showError:j,valid:z,value:E},e[15]=I,e[16]=T,e[17]=m,e[18]=u,e[19]=f,e[20]=O,e[21]=j,e[22]=d,e[23]=U,e[24]=z,e[25]=G,e[26]=X,e[27]=Z,e[28]=te,e[29]=E,e[30]=ce):ce=e[30],B=ce;let J=B,ue;e[31]!==g||e[32]!==S||e[33]!==l||e[34]!==v||e[35]!==F||e[36]!==y||e[37]!==w||e[38]!==D||e[39]!==_||e[40]!==r||e[41]!==p||e[42]!==b||e[43]!==u||e[44]!==V||e[45]!==C||e[46]!==h||e[47]!==a||e[48]!==E?(ue=()=>{(async()=>{let he=E;y?.rows&&Array.isArray(y.rows)&&(he=D(u));let _e=P.current,ge=N.current,Ve=w(),Q=typeof a=="function"?await a(he,{id:p,blockData:void 0,collectionSlug:g,data:F?.getData?F.getData():Ve,event:"onChange",operation:b,path:V,preferences:{},req:{payload:{config:S},t:C,user:h},siblingData:_(u)}):typeof P.current=="string"?P.current:N.current;if(typeof Q=="string"?(ge=!1,_e=Q):typeof Q=="boolean"&&(ge=Q,_e=void 0),ge!==N.current||_e!==P.current){N.current=ge,P.current=_e;let Le={type:"UPDATE",errorMessage:_e,path:u,rows:y?.rows,valid:ge,validate:a,value:E};(l||r&&typeof E=="number"&&E>0)&&(Le.disableFormData=!0),typeof v=="function"&&v(Le)}})()},e[31]=g,e[32]=S,e[33]=l,e[34]=v,e[35]=F,e[36]=y,e[37]=w,e[38]=D,e[39]=_,e[40]=r,e[41]=p,e[42]=b,e[43]=u,e[44]=V,e[45]=C,e[46]=h,e[47]=a,e[48]=E,e[49]=ue):ue=e[49];let re=y?.rows,q;return e[50]!==g||e[51]!==l||e[52]!==v||e[53]!==w||e[54]!==D||e[55]!==_||e[56]!==p||e[57]!==b||e[58]!==u||e[59]!==re||e[60]!==h||e[61]!==a||e[62]!==E?(q=[E,l,v,w,_,D,p,b,u,h,a,re,g],e[50]=g,e[51]=l,e[52]=v,e[53]=w,e[54]=D,e[55]=_,e[56]=p,e[57]=b,e[58]=u,e[59]=re,e[60]=h,e[61]=a,e[62]=E,e[63]=q):q=e[63],Bs(ue,150,q),J};function GE(t){let[,e]=t;return e}import{jsx as ty}from"react/jsx-runtime";import"react";import{c as WE}from"react/compiler-runtime";var sh=t=>{let e=WE(2),{children:o,path:n}=t,r;e[0]!==n?(r=a=>{let[l]=a;return l&&l?.[n]||null},e[0]=n,e[1]=r):r=e[1];let s=Et(r),{passesCondition:i}=s||{};return i===!1?null:o};var je=t=>o=>{let{path:n}=o;return ty(sh,{path:n,children:ty(t,{...o})})};var rt=t=>({...t?.admin?.style||{},...t?.admin?.width?{"--field-width":t.admin.width}:{flex:"1 1 auto"},...t?.admin?.style?.flex?{flex:t.admin.style.flex}:{}});var Ce="field-type";function Zi({fieldLocalized:t,fieldRTL:e,locale:o,localizationConfig:n}){let r=o&&n&&n.locales&&n.locales.length>1,s=o?.code===n?.defaultLocale;return e!==!1&&o?.rtl===!0&&(t||!t&&!r||!t&&s)||e===!0}import{jsx as Rl,jsxs as lh}from"react/jsx-runtime";import"react";import{jsx as oy}from"react/jsx-runtime";import"react";var ih=()=>oy("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:oy("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})});import{jsx as ry}from"react/jsx-runtime";import"react";var ah=()=>ry("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ry("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})});var _l="checkbox-input",Hs=({id:t,name:e,AfterInput:o,BeforeInput:n,checked:r,className:s,inputRef:i,Label:a,label:l,localized:c,onToggle:u,partialChecked:d,readOnly:f,required:m})=>lh("div",{className:[s,_l,r&&`${_l}--checked`,f&&`${_l}--read-only`].filter(Boolean).join(" "),children:[lh("div",{className:`${_l}__input`,children:[n,Rl("input",{"aria-label":"",defaultChecked:!!r,disabled:f,id:t,name:e,onInput:u,ref:i,required:m,type:"checkbox"}),lh("span",{className:[`${_l}__icon`,!r&&d?"partial":"check"].filter(Boolean).join(" "),children:[r&&Rl(ih,{}),!r&&d&&Rl(ah,{})]}),o]}),Rl(oe,{CustomComponent:a,Fallback:Rl(xe,{htmlFor:t,label:l,localized:c,required:m})})]});var ch="checkbox";var XE=t=>{let{id:e,checked:o,disableFormData:n,field:r,field:{admin:{className:s,description:i}={},label:a,required:l}={},onChange:c,partialChecked:u,path:d,readOnly:f,validate:m}=t,{uuid:h}=Oe(),p=ct(),g=ny((T,$)=>{if(typeof m=="function")return m(T,{...$,required:l})},[m,l]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,path:w,setValue:D,showError:_,value:A}=Ee({disableFormData:n,potentiallyStalePath:d,validate:g}),F=ny(()=>{f||(D(!A),typeof c=="function"&&c(!A))},[c,f,D,A]),R=o||!!A,I=e||dd(w,p,h),E=zE(()=>rt(r),[r]);return HE("div",{className:[Ce,ch,_&&"error",s,A&&`${ch}--checked`,(f||S)&&`${ch}--read-only`].filter(Boolean).join(" "),style:E,children:[Dl(oe,{CustomComponent:y,Fallback:Dl(He,{path:w,showError:_})}),Dl(Hs,{AfterInput:b,BeforeInput:v,checked:R,id:I,inputRef:null,Label:C,label:a,name:w,onToggle:F,partialChecked:u,readOnly:f||S,required:l}),Dl(oe,{CustomComponent:x,Fallback:Dl(Be,{description:i,path:w})})]})},mr=je(XE);var Fl=t=>{let e=UE(4),{fieldValue:o,localized:n,path:r}=t,{code:s}=Ne(),{config:i}=H(),{localization:a}=i,[l,c]=iy.useState(typeof o!="number"),{t:u}=k();if(!n||!a||a.defaultLocale===s||!a.fallback)return null;if(o){let f=!1;if(typeof o=="number"&&o>0&&(f=!0),Array.isArray(o)&&o.length>0&&(f=!0),f)return l&&c(!1),null}let d;return e[0]!==l||e[1]!==r||e[2]!==u?(d=sy(Rr,{children:sy(mr,{checked:l,field:{name:"",label:u("general:fallbackToDefaultLocale")},id:`field-${r.replace(/\./g,"__")}`,path:r,schemaPath:""})}),e[0]=l,e[1]=r,e[2]=u,e[3]=d):d=e[3],d};var Ji=t=>{let e=document.getElementById(t);if(e){let o=e.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:o.top-100})}};import{c as rM}from"react/compiler-runtime";import{jsx as ys,jsxs as nM}from"react/jsx-runtime";import{getTranslation as sM}from"@payloadcms/translations";import"react";import{c as ZE}from"react/compiler-runtime";import{jsx as yn,jsxs as zs}from"react/jsx-runtime";import JE from"react";import{jsx as ay}from"react/jsx-runtime";import"react";var Al=()=>ay("svg",{className:"icon icon--copy",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:ay("path",{className:"stroke",d:"M4.66666 12.6667C3.93333 12.6667 3.33333 12.0667 3.33333 11.3333V4.66668C3.33333 3.93334 3.93333 3.33334 4.66666 3.33334H11.3333C12.0667 3.33334 12.6667 3.93334 12.6667 4.66668M8.66666 7.33334H15.3333C16.0697 7.33334 16.6667 7.9303 16.6667 8.66668V15.3333C16.6667 16.0697 16.0697 16.6667 15.3333 16.6667H8.66666C7.93028 16.6667 7.33333 16.0697 7.33333 15.3333V8.66668C7.33333 7.9303 7.93028 7.33334 8.66666 7.33334Z",strokeLinecap:"square"})});import{jsx as uh,jsxs as YE}from"react/jsx-runtime";import"react";var dh=({className:t})=>YE("svg",{className:["icon icon--more",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[uh("path",{className:"fill",d:"M10 10.6666C10.3682 10.6666 10.6667 10.3682 10.6667 9.99998C10.6667 9.63179 10.3682 9.33331 10 9.33331C9.63182 9.33331 9.33334 9.63179 9.33334 9.99998C9.33334 10.3682 9.63182 10.6666 10 10.6666Z",strokeLinecap:"square"}),uh("path",{className:"fill",d:"M14.6667 10.6666C15.0349 10.6666 15.3333 10.3682 15.3333 9.99998C15.3333 9.63179 15.0349 9.33331 14.6667 9.33331C14.2985 9.33331 14 9.63179 14 9.99998C14 10.3682 14.2985 10.6666 14.6667 10.6666Z",strokeLinecap:"square"}),uh("path",{className:"fill",d:"M5.33334 10.6666C5.70153 10.6666 6.00001 10.3682 6.00001 9.99998C6.00001 9.63179 5.70153 9.33331 5.33334 9.33331C4.96515 9.33331 4.66667 9.63179 4.66667 9.99998C4.66667 10.3682 4.96515 10.6666 5.33334 10.6666Z",strokeLinecap:"square"})]});var Ko="array-actions",xd=t=>{let e=ZE(10),{addRow:o,duplicateRow:n,hasMaxRows:r,index:s,isSortable:i,moveRow:a,removeRow:l,rowCount:c}=t,{t:u}=k(),d;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==u?(d=yn(ho,{button:yn(dh,{}),buttonClassName:`${Ko}__button`,className:Ko,horizontalAlign:"center",render:f=>{let{close:m}=f;return zs(Me.ButtonGroup,{buttonSize:"small",children:[i&&s!==0&&zs(Me.Button,{className:`${Ko}__action ${Ko}__move-up`,onClick:()=>{a(s,s-1),m()},children:[yn("div",{className:`${Ko}__action-chevron`,children:yn(Ze,{direction:"up"})}),u("general:moveUp")]}),i&&s<c-1&&zs(Me.Button,{className:`${Ko}__action`,onClick:()=>{a(s,s+1),m()},children:[yn("div",{className:`${Ko}__action-chevron`,children:yn(Ze,{})}),u("general:moveDown")]}),!r&&zs(JE.Fragment,{children:[zs(Me.Button,{className:`${Ko}__action ${Ko}__add`,onClick:()=>{o(s+1),m()},children:[yn(jo,{}),u("general:addBelow")]}),zs(Me.Button,{className:`${Ko}__action ${Ko}__duplicate`,onClick:()=>{n(s),m()},children:[yn(Al,{}),u("general:duplicate")]})]}),zs(Me.Button,{className:`${Ko}__action ${Ko}__remove`,onClick:()=>{l(s),m()},children:[yn(pt,{}),u("general:remove")]})]})},size:"medium"}),e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=a,e[6]=l,e[7]=c,e[8]=u,e[9]=d):d=e[9],d};import{c as iP}from"react/compiler-runtime";import{jsx as Er,jsxs as ph}from"react/jsx-runtime";import{useState as my}from"react";import{jsx as qi,jsxs as qE}from"react/jsx-runtime";import"react";var Cn=({className:t})=>qE("svg",{className:["icon icon--drag-handle",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[qi("path",{className:"fill",d:"M7.99999 10.6667C8.36818 10.6667 8.66666 10.3682 8.66666 9.99999C8.66666 9.6318 8.36818 9.33332 7.99999 9.33332C7.63181 9.33332 7.33333 9.6318 7.33333 9.99999C7.33333 10.3682 7.63181 10.6667 7.99999 10.6667Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M7.99999 5.99999C8.36818 5.99999 8.66666 5.70151 8.66666 5.33332C8.66666 4.96513 8.36818 4.66666 7.99999 4.66666C7.63181 4.66666 7.33333 4.96513 7.33333 5.33332C7.33333 5.70151 7.63181 5.99999 7.99999 5.99999Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M7.99999 15.3333C8.36818 15.3333 8.66666 15.0348 8.66666 14.6667C8.66666 14.2985 8.36818 14 7.99999 14C7.63181 14 7.33333 14.2985 7.33333 14.6667C7.33333 15.0348 7.63181 15.3333 7.99999 15.3333Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M12 10.6667C12.3682 10.6667 12.6667 10.3682 12.6667 9.99999C12.6667 9.6318 12.3682 9.33332 12 9.33332C11.6318 9.33332 11.3333 9.6318 11.3333 9.99999C11.3333 10.3682 11.6318 10.6667 12 10.6667Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M12 5.99999C12.3682 5.99999 12.6667 5.70151 12.6667 5.33332C12.6667 4.96513 12.3682 4.66666 12 4.66666C11.6318 4.66666 11.3333 4.96513 11.3333 5.33332C11.3333 5.70151 11.6318 5.99999 12 5.99999Z",strokeLinecap:"square"}),qi("path",{className:"fill",d:"M12 15.3333C12.3682 15.3333 12.6667 15.0348 12.6667 14.6667C12.6667 14.2985 12.3682 14 12 14C11.6318 14 11.3333 14.2985 11.3333 14.6667C11.3333 15.0348 11.6318 15.3333 12 15.3333Z",strokeLinecap:"square"})]});import{jsx as cy}from"react/jsx-runtime";import yd,{useEffect as tP,useRef as fh}from"react";import{useEffect as QE,useMemo as KE,useRef as mh,useState as eP}from"react";var ly=({containerRef:t,contentRef:e,duration:o,open:n})=>{let r=KE(()=>typeof CSS<"u"&&CSS&&CSS.supports?CSS.supports("interpolate-size","allow-keywords"):!1,[]),s=mh(!1),i=mh(n),[a,l]=eP(!1),c=mh(null);return QE(()=>{let u=t.current,d=e.current;if(!u||!d||r)return;let f=p=>{u.style.height=p},m=()=>{u&&(u.style.transition="",u.style.height=n?"auto":"0px",l(!1))};return(()=>{if(!s.current&&n){f("auto"),l(!1);return}s.current=!0,i.current!==n&&f(n?"0px":`${d.scrollHeight}px`),u.offsetHeight,l(!0),u.style.transition=`height ${o}ms ease`,f(n?`${d.scrollHeight}px`:"0px");let p=()=>{m(),u.removeEventListener("transitionend",p)};u.addEventListener("transitionend",p)})(),i.current=n,c.current=new ResizeObserver(()=>{a&&(u.style.height=n?`${d.scrollHeight}px`:"0px")}),c.current.observe(d),()=>{u&&(u.style.transition="",u.style.height=""),c.current?.disconnect()}},[n,o,t,e,r]),{browserSupportsKeywordAnimation:r}};var Tr=({id:t,children:e,className:o,duration:n=300,height:r})=>{let[s,i]=yd.useState(()=>!!r),a=fh(s),[l,c]=yd.useState(()=>s?"":"none"),[u,d]=yd.useState(()=>s?"":"hidden"),[f,m]=yd.useState(!1),h=fh(null),p=fh(null);return tP(()=>{let g,b,v=!!r,x=a.current!==v;return a.current=v,x&&(m(!0),d("hidden"),v?c(""):g=window.setTimeout(()=>{c("none")},n),i(v),b=window.setTimeout(()=>{d(""),m(!1)},n)),()=>{g&&clearTimeout(g),b&&clearTimeout(b)}},[r,n]),ly({containerRef:h,contentRef:p,duration:n,open:s}),cy("div",{"aria-hidden":!s,className:[o,"rah-static",s&&r==="auto"&&"rah-static--height-auto",f&&`rah-animating--${s?"down":"up"}`,f&&r==="auto"&&"rah-animating--to-height-auto"].filter(Boolean).join(" "),id:t,ref:h,style:{overflow:u,transition:`height ${n}ms ease`},children:cy("div",{ref:p,...l?{style:{display:l}}:{},children:e})})};import{jsx as oP}from"react/jsx-runtime";import rP,{createContext as nP,use as sP}from"react";var uy=nP({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),dy=({children:t,isCollapsed:e,isWithinCollapsible:o=!0,toggle:n})=>{let{isCollapsed:r,isVisible:s}=qn(),i=rP.useMemo(()=>({isCollapsed:e,isVisible:s&&!r,isWithinCollapsible:o,toggle:n}),[e,o,n,r,s]);return oP(uy,{value:i,children:t})},qn=()=>sP(uy);var wo="collapsible";var Xs=t=>{let e=iP(26),{actions:o,children:n,className:r,collapsibleStyle:s,dragHandleProps:i,header:a,initCollapsed:l,isCollapsed:c,onToggle:u}=t,d=s===void 0?"default":s,[f,m]=my(!!l),[h,p]=my(!1),{isWithinCollapsible:g}=qn(),{t:b}=k(),v=typeof c=="boolean"?c:f,x;e[0]!==v||e[1]!==u?(x=()=>{typeof u=="function"&&u(!v),m(!v)},e[0]=v,e[1]=u,e[2]=x):x=e[2];let y=x,C=i&&`${wo}--has-drag-handle`,S=v&&`${wo}--collapsed`,w=g&&`${wo}--nested`,D=h&&`${wo}--hovered`,_=`${wo}--style-${d}`,A;e[3]!==r||e[4]!==C||e[5]!==S||e[6]!==w||e[7]!==D||e[8]!==_?(A=[wo,r,C,S,w,D,_].filter(Boolean),e[3]=r,e[4]=C,e[5]=S,e[6]=w,e[7]=D,e[8]=_,e[9]=A):A=e[9];let F=A.join(" "),R,I;e[10]===Symbol.for("react.memo_cache_sentinel")?(R=()=>p(!0),I=()=>p(!1),e[10]=R,e[11]=I):(R=e[10],I=e[11]);let E=`${wo}__toggle--${v?"collapsed":"open"}`,T;e[12]!==E?(T=[`${wo}__toggle`,E].filter(Boolean),e[12]=E,e[13]=T):T=e[13];let $=T.join(" "),j;if(e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==a||e[18]!==v||e[19]!==b||e[20]!==$||e[21]!==F||e[22]!==y){let N;e[24]!==i?(N=i&&Er("div",{className:`${wo}__drag`,...i.attributes,...i.listeners,children:Er(Cn,{})}),e[24]=i,e[25]=N):N=e[25],j=Er("div",{className:F,children:ph(dy,{isCollapsed:v,toggle:y,children:[ph("div",{className:`${wo}__toggle-wrap`,onMouseEnter:R,onMouseLeave:I,children:[Er("button",{className:$,onClick:y,type:"button",children:Er("span",{children:b("fields:toggleBlock")})}),N,a?Er("div",{className:[`${wo}__header-wrap`,i&&`${wo}__header-wrap--has-drag-handle`].filter(Boolean).join(" "),children:a}):null,ph("div",{className:`${wo}__actions-wrap`,children:[o?Er("div",{className:`${wo}__actions`,children:o}):null,Er("div",{className:`${wo}__indicator`,children:Er(Ze,{direction:v?void 0:"up"})})]})]}),Er(Tr,{height:v?0:"auto",children:Er("div",{className:`${wo}__content`,children:n})})]})}),e[14]=o,e[15]=n,e[16]=i,e[17]=a,e[18]=v,e[19]=b,e[20]=$,e[21]=F,e[22]=y,e[23]=j}else j=e[23];return j};import{c as KO}from"react/compiler-runtime";import{jsx as _b}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as eM,getFieldPaths as tM,getFieldPermissions as oM}from"payload/shared";import"react";import{c as aP}from"react/compiler-runtime";import{jsx as lP}from"react/jsx-runtime";import fy from"react";var py=t=>{let e=aP(9),{children:o,className:n,forceRender:r}=t,[s,i]=fy.useState(!!r),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={rootMargin:"1000px"},e[0]=a):a=e[0];let[l,c]=mn(a,!!r),u=!!c?.isIntersecting,d=c?.boundingClientRect?.top<0,f=r||u||d,m,h;e[1]!==s||e[2]!==f?(m=()=>{f&&!s&&i(!0)},h=[f,s],e[1]=s,e[2]=f,e[3]=m,e[4]=h):(m=e[3],h=e[4]),fy.useEffect(m,h);let p=s?o:null,g;return e[5]!==n||e[6]!==l||e[7]!==p?(g=lP("div",{className:n,ref:l,children:p}),e[5]=n,e[6]=l,e[7]=p,e[8]=g):g=e[8],g};import{c as QO}from"react/compiler-runtime";import{jsx as Ft}from"react/jsx-runtime";import"react";import{c as TP}from"react/compiler-runtime";import{jsx as Yt,jsxs as es}from"react/jsx-runtime";import{getTranslation as xh}from"@payloadcms/translations";import EP,{Fragment as PP}from"react";import{c as DP}from"react/compiler-runtime";import{jsx as Pr,jsxs as Py,Fragment as FP}from"react/jsx-runtime";import{getTranslation as AP}from"@payloadcms/translations";import"react";import{c as cP}from"react/compiler-runtime";import{jsx as Tl,jsxs as uP}from"react/jsx-runtime";import"react";var fr="pill",dP=t=>{let e=cP(12),{id:o,className:n}=t,r;e[0]!==o?(r={id:o},e[0]=o,e[1]=r):r=e[1];let{attributes:s,isDragging:i,listeners:a,setNodeRef:l,transform:c}=Oi(r),u=i&&`${fr}--is-dragging`,d;e[2]!==n||e[3]!==u?(d=[u,n].filter(Boolean),e[2]=n,e[3]=u,e[4]=d):d=e[4];let f=d.join(" "),m;return e[5]!==s||e[6]!==a||e[7]!==t||e[8]!==l||e[9]!==f||e[10]!==c?(m=Tl(hy,{...t,className:f,elementProps:{...a,...s,ref:l,style:{transform:c}}}),e[5]=s,e[6]=a,e[7]=t,e[8]=l,e[9]=f,e[10]=c,e[11]=m):m=e[11],m},hy=t=>{let{id:e,alignIcon:o="right","aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,children:a,className:l,draggable:c,elementProps:u,icon:d,onClick:f,pillStyle:m="light",rounded:h,size:p="medium",to:g}=t,b=[fr,`${fr}--style-${m}`,`${fr}--size-${p}`,l&&l,g&&`${fr}--has-link`,(g||f)&&`${fr}--has-action`,d&&`${fr}--has-icon`,d&&`${fr}--align-icon-${o}`,c&&`${fr}--draggable`,h&&`${fr}--rounded`].filter(Boolean).join(" "),v="div";return f&&!g&&(v="button"),g&&(v=no),uP(v,{...u,"aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,className:b,href:g||null,id:e,onClick:f,type:v==="button"?"button":void 0,children:[Tl("span",{className:`${fr}__label`,children:a}),!!d&&Tl("span",{className:`${fr}__icon`,children:d})]})},vt=t=>{let{draggable:e}=t;return e?Tl(dP,{...t}):Tl(hy,{...t})};import{useEffect as mP,useState as fP}from"react";function Cd(t,e){let[o,n]=fP(t);return mP(()=>{let r=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(r)}},[t,e]),o}import{c as IP}from"react/compiler-runtime";import{jsx as Dy,jsxs as RP}from"react/jsx-runtime";import Fy from"react";import{jsx as Qr,jsxs as Iy}from"react/jsx-runtime";import{getTranslation as Id}from"@payloadcms/translations";import{useEffect as Ry,useMemo as wP,useState as _y}from"react";import{c as pP}from"react/compiler-runtime";import{jsx as gy,jsxs as hP}from"react/jsx-runtime";import"react";var El="thumbnail-card",by=t=>{let e=pP(15),{alignLabel:o,className:n,collection:r,doc:s,label:i,onClick:a,thumbnail:l}=t,{config:c}=H(),{i18n:u}=k(),d=typeof a=="function"&&`${El}--has-on-click`,f=o&&`${El}--align-label-${o}`,m;e[0]!==n||e[1]!==d||e[2]!==f?(m=[El,n,d,f].filter(Boolean),e[0]=n,e[1]=d,e[2]=f,e[3]=m):m=e[3];let h=m.join(" "),p=i;if(!p){let b=s?.filename,v;e[4]!==r||e[5]!==c.admin.dateFormat||e[6]!==s||e[7]!==u||e[8]!==b?(v=dr({collectionConfig:r,data:s,dateFormat:c.admin.dateFormat,fallback:b,i18n:u}),e[4]=r,e[5]=c.admin.dateFormat,e[6]=s,e[7]=u,e[8]=b,e[9]=v):v=e[9],p=v}let g;return e[10]!==h||e[11]!==a||e[12]!==l||e[13]!==p?(g=hP("button",{className:h,onClick:a,title:p,type:"button",children:[gy("div",{className:`${El}__thumbnail`,children:l}),gy("div",{className:`${El}__label`,children:p})]}),e[10]=h,e[11]=a,e[12]=l,e[13]=p,e[14]=g):g=e[14],g};import{jsx as Sn,jsxs as xy}from"react/jsx-runtime";import{useState as xP}from"react";var bo=[];for(wd=0;wd<256;++wd)bo.push((wd+256).toString(16).slice(1));var wd;function vy(t,e=0){return(bo[t[e+0]]+bo[t[e+1]]+bo[t[e+2]]+bo[t[e+3]]+"-"+bo[t[e+4]]+bo[t[e+5]]+"-"+bo[t[e+6]]+bo[t[e+7]]+"-"+bo[t[e+8]]+bo[t[e+9]]+"-"+bo[t[e+10]]+bo[t[e+11]]+bo[t[e+12]]+bo[t[e+13]]+bo[t[e+14]]+bo[t[e+15]]).toLowerCase()}var Sd,gP=new Uint8Array(16);function hh(){if(!Sd&&(Sd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sd(gP)}var bP=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gh={randomUUID:bP};function vP(t,e,o){if(gh.randomUUID&&!e&&!t)return gh.randomUUID();t=t||{};var n=t.random||(t.rng||hh)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){o=o||0;for(var r=0;r<16;++r)e[o+r]=n[r];return e}return vy(n)}var wn=vP;var bh=()=>{let[t]=xP(()=>`pattern${wn()}`);return xy("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[xy("g",{clipPath:`url(#${t})`,children:[Sn("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),Sn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),Sn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),Sn("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),Sn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),Sn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),Sn("defs",{children:Sn("clipPath",{id:`${t}`,children:Sn("rect",{fill:"white",height:"151",width:"231"})})})]})};import{c as yP}from"react/compiler-runtime";import{jsx as Cy,jsxs as CP}from"react/jsx-runtime";import"react";import{jsx as yy}from"react/jsx-runtime";import"react";var Pl=()=>yy("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:yy("path",{className:"stroke",d:"M16 16L13.1333 13.1333M14.6667 9.33333C14.6667 12.2789 12.2789 14.6667 9.33333 14.6667C6.38781 14.6667 4 12.2789 4 9.33333C4 6.38781 6.38781 4 9.33333 4C12.2789 4 14.6667 6.38781 14.6667 9.33333Z",strokeLinecap:"square"})});var wy="block-search",Sy=t=>{let e=yP(5),{setSearchTerm:o}=t,{t:n}=k(),r;e[0]!==o?(r=a=>{o(a.target.value)},e[0]=o,e[1]=r):r=e[1];let s=r,i;return e[2]!==s||e[3]!==n?(i=CP("div",{className:wy,children:[Cy("input",{className:`${wy}__input`,onChange:s,placeholder:n("fields:searchForBlock")}),Cy(Pl,{})]}),e[2]=s,e[3]=n,e[4]=i):i=e[4],i};var Qn="blocks-drawer",SP=(t,e)=>typeof t.labels.singular=="string"?t.labels.singular.toLowerCase():typeof t.labels.singular=="object"?Id(t.labels.singular,e).toLowerCase():"",Nl=t=>{let{addRow:e,addRowIndex:o,blocks:n,drawerSlug:r,labels:s}=t,[i,a]=_y(""),[l,c]=_y(n),{closeModal:u,isModalOpen:d}=de(),{i18n:f,t:m}=k(),{config:h}=H(),p=wP(()=>{let g={_none:[]};return l.forEach(b=>{if(typeof b=="object"&&b.admin?.group){let v=b.admin.group,x=typeof v=="string"?v:Id(v,f);Object.hasOwn(g,x)?g[x].push(b):g[x]=[b]}else g._none.push(b)}),g},[l,f]);return Ry(()=>{d(r)||a("")},[d,r]),Ry(()=>{let g=i.toLowerCase(),b=n?.reduce((v,x)=>{let y=typeof x=="string"?h.blocksMap[x]:x;return SP(y,f).includes(g)&&v.push(y),v},[]);c(b)},[i,n,f,h.blocksMap]),Iy(Pt,{slug:r,title:m("fields:addLabel",{label:Id(s.singular,f)}),children:[Qr(Sy,{setSearchTerm:a}),Qr("div",{className:`${Qn}__blocks-wrapper`,children:Qr("ul",{className:`${Qn}__block-groups`,children:Object.entries(p).map(([g,b])=>b.length?Iy("li",{className:[`${Qn}__block-group`,g==="_none"&&`${Qn}__block-group-none`].filter(Boolean).join(" "),children:[g!=="_none"&&Qr("h3",{className:`${Qn}__block-group-label`,children:g}),Qr("ul",{className:`${Qn}__blocks`,children:b.map((v,x)=>{let y=typeof v=="string"?h.blocksMap[v]:v,{slug:C,imageAltText:S,imageURL:w,labels:D}=y;return Qr("li",{className:`${Qn}__block`,children:Qr(by,{alignLabel:"center",label:Id(D?.singular,f),onClick:()=>{e(o,C),u(r)},thumbnail:Qr("div",{className:`${Qn}__default-image`,children:w?Qr("img",{alt:S,src:w}):Qr(bh,{})})})},x)})})]},g):null)})})]})};var Ay=t=>{let e=IP(26),{addRow:o,blocks:n,blockType:r,duplicateRow:s,hasMaxRows:i,isSortable:a,labels:l,moveRow:c,removeRow:u,rowCount:d,rowIndex:f}=t,{closeModal:m,openModal:h}=de(),p=bl("blocks-drawer"),[g,b]=Fy.useState(null),v;e[0]!==o||e[1]!==m||e[2]!==p||e[3]!==g?(v=(y,C)=>{typeof o=="function"&&o(g,C),m(p)},e[0]=o,e[1]=m,e[2]=p,e[3]=g,e[4]=v):v=e[4];let x;if(e[5]!==r||e[6]!==n||e[7]!==p||e[8]!==s||e[9]!==i||e[10]!==a||e[11]!==l||e[12]!==c||e[13]!==h||e[14]!==u||e[15]!==d||e[16]!==f||e[17]!==v){let y;e[19]!==p||e[20]!==h?(y=S=>{b(S),h(p)},e[19]=p,e[20]=h,e[21]=y):y=e[21];let C;e[22]!==r||e[23]!==s||e[24]!==f?(C=()=>s(f,r),e[22]=r,e[23]=s,e[24]=f,e[25]=C):C=e[25],x=RP(Fy.Fragment,{children:[Dy(Nl,{addRow:v,addRowIndex:f,blocks:n,drawerSlug:p,labels:l}),Dy(xd,{addRow:y,duplicateRow:C,hasMaxRows:i,index:f,isSortable:a,moveRow:c,removeRow:u,rowCount:d})]}),e[5]=r,e[6]=n,e[7]=p,e[8]=s,e[9]=i,e[10]=a,e[11]=l,e[12]=c,e[13]=h,e[14]=u,e[15]=d,e[16]=f,e[17]=v,e[18]=x}else x=e[18];return x};import{c as _P}from"react/compiler-runtime";import{jsx as Ty}from"react/jsx-runtime";import"react";var Ey="section-title",vh=t=>{let e=_P(14),{customOnChange:o,customValue:n,path:r,readOnly:s}=t,i;e[0]!==r?(i={path:r},e[0]=r,e[1]=i):i=e[1];let{setValue:a,value:l}=Ee(i),{t:c}=k(),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=[Ey].filter(Boolean),e[2]=u):u=e[2];let d=u.join(" "),f;e[3]!==o||e[4]!==a?(f=o||(g=>{g.stopPropagation(),g.preventDefault(),a(g.target.value)}),e[3]=o,e[4]=a,e[5]=f):f=e[5];let m=f,h=n||l,p;return e[6]!==n||e[7]!==m||e[8]!==r||e[9]!==s||e[10]!==c||e[11]!==h||e[12]!==l?(p=Ty("div",{className:d,"data-value":h,children:Ty("input",{className:`${Ey}__input`,id:r,name:r,onChange:m,placeholder:c("general:untitled"),readOnly:s,type:"text",value:n||l||""})}),e[6]=n,e[7]=m,e[8]=r,e[9]=s,e[10]=c,e[11]=h,e[12]=l,e[13]=p):p=e[13],p};var Kn="blocks-field",Ny=t=>{let e=DP(40),{addRow:o,attributes:n,block:r,blocks:s,duplicateRow:i,errorCount:a,fields:l,hasMaxRows:c,isLoading:u,isSortable:d,Label:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:v,readOnly:x,removeRow:y,row:C,rowCount:S,rowIndex:w,schemaPath:D,setCollapse:_,setNodeRef:A,transform:F}=t,R=Cd(u,500),{i18n:I}=k(),T=Xt()&&a>0,$=!r.admin?.disableBlockName,j=T?`${Kn}__row--has-errors`:`${Kn}__row--no-errors`,N;e[0]!==j?(N=[`${Kn}__row`,j].filter(Boolean),e[0]=j,e[1]=N):N=e[1];let P=N.join(" "),L;if(v===!0)L=!0;else{let O=v?.blocks?.[r.slug];O===!0?L=!0:L=O?.fields}let V=`${g?.split(".").join("-")}-row-${w}`,M;if(e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==r.fields||e[6]!==r.labels||e[7]!==L||e[8]!==s||e[9]!==P||e[10]!==i||e[11]!==a||e[12]!==T||e[13]!==l||e[14]!==c||e[15]!==I||e[16]!==R||e[17]!==d||e[18]!==m||e[19]!==h||e[20]!==p||e[21]!==g||e[22]!==b||e[23]!==x||e[24]!==y||e[25]!==C.blockType||e[26]!==C.collapsed||e[27]!==C.id||e[28]!==S||e[29]!==w||e[30]!==D||e[31]!==_||e[32]!==A||e[33]!==$||e[34]!==V||e[35]!==F){let O;e[37]!==C.id||e[38]!==_?(O=B=>_(C.id,B),e[37]=C.id,e[38]=_,e[39]=O):O=e[39],M=Pr("div",{id:V,ref:A,style:{transform:F},children:Pr(Xs,{actions:x?void 0:Pr(Ay,{addRow:o,blocks:s,blockType:C.blockType,duplicateRow:i,fields:r.fields,hasMaxRows:c,isSortable:d,labels:m,moveRow:p,removeRow:y,rowCount:S,rowIndex:w}),className:P,collapsibleStyle:T?"error":"default",dragHandleProps:d?{id:C.id,attributes:n,listeners:h}:void 0,header:R?Pr(St,{height:"1rem",width:"8rem"}):Py("div",{className:`${Kn}__block-header`,children:[Pr(dn,{CustomComponent:f,label:Py(FP,{children:[Pr("span",{className:`${Kn}__block-number`,children:String(w+1).padStart(2,"0")}),Pr(vt,{className:`${Kn}__block-pill ${Kn}__block-pill-${C.blockType}`,pillStyle:"white",children:AP(r.labels.singular,I)}),$&&Pr(vh,{path:`${b}.blockName`,readOnly:x})]}),path:b,rowNumber:w}),T&&Pr(io,{count:a,i18n:I,withMessage:!0})]}),isCollapsed:C.collapsed,onToggle:O,children:R?Pr(St,{}):Pr(So,{className:`${Kn}__fields`,fields:l,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:D,permissions:L,readOnly:x})},C.id)},`${g}-row-${w}`),e[2]=f,e[3]=o,e[4]=n,e[5]=r.fields,e[6]=r.labels,e[7]=L,e[8]=s,e[9]=P,e[10]=i,e[11]=a,e[12]=T,e[13]=l,e[14]=c,e[15]=I,e[16]=R,e[17]=d,e[18]=m,e[19]=h,e[20]=p,e[21]=g,e[22]=b,e[23]=x,e[24]=y,e[25]=C.blockType,e[26]=C.collapsed,e[27]=C.id,e[28]=S,e[29]=w,e[30]=D,e[31]=_,e[32]=A,e[33]=$,e[34]=V,e[35]=F,e[36]=M}else M=e[36];return M};var Nr="blocks-field",NP=t=>{let e=TP(50),{i18n:o,t:n}=k(),{field:r,path:s,permissions:i,readOnly:a,schemaPath:l,validate:c}=t,{name:u,admin:d,blockReferences:f,blocks:m,label:h,labels:p,localized:g,maxRows:b,minRows:v,required:x}=r,y;e[0]!==d?(y=d===void 0?{}:d,e[0]=d,e[1]=y):y=e[1];let{className:C,description:S,isSortable:w}=y,D=w===void 0?!0:w,_=l??u,A=v??x?1:0,{setDocFieldPreferences:F}=Pe(),{addFieldRow:R,dispatchFields:I,moveFieldRow:E,removeFieldRow:T,setModified:$}=Oe(),{code:j}=Ne(),{config:N,config:P}=H(),{localization:L}=N,V=bl("blocks-drawer"),M=Xt(),O={plural:n("fields:blocks"),singular:n("fields:block"),...p},B;e:{if(L&&L.fallback){let K=L.defaultLocale;B=j===K;break e}B=!0}let G=B,X;e[2]!==G||e[3]!==b||e[4]!==A||e[5]!==x||e[6]!==c?(X=(K,W)=>{if(!G&&K===null)return!0;if(typeof c=="function")return c(K,{...W,maxRows:b,minRows:A,required:x})},e[2]=G,e[3]=b,e[4]=A,e[5]=x,e[6]=c,e[7]=X):X=e[7];let Z=X,te;e[8]!==Z||e[9]!==s?(te={hasRows:!0,potentiallyStalePath:s,validate:Z},e[8]=Z,e[9]=s,e[10]=te):te=e[10];let{customComponents:U,disabled:z,errorPaths:ce,path:J,rows:ue,showError:re,valid:q,value:pe}=Ee(te),he;e[11]!==U?(he=U===void 0?{}:U,e[11]=U,e[12]=he):he=e[12];let{AfterInput:_e,BeforeInput:ge,Description:Ve,Error:Q,Label:Le}=he,De;e[13]!==ue?(De=ue===void 0?[]:ue,e[13]=ue,e[14]=De):De=e[14];let ae=De,se;e[15]!==R||e[16]!==J||e[17]!==_?(se=(K,W)=>{R({blockType:W,path:J,rowIndex:K,schemaPath:_}),setTimeout(()=>{Ji(`${J}-row-${K+1}`)},0)},e[15]=R,e[16]=J,e[17]=_,e[18]=se):se=e[18];let Y=se,ie;e[19]!==I||e[20]!==J||e[21]!==$?(ie=K=>{I({type:"DUPLICATE_ROW",path:J,rowIndex:K}),$(!0),setTimeout(()=>{Ji(`${J}-row-${K+1}`)},0)},e[19]=I,e[20]=J,e[21]=$,e[22]=ie):ie=e[22];let me=ie,we;e[23]!==J||e[24]!==T?(we=K=>{T({path:J,rowIndex:K})},e[23]=J,e[24]=T,e[25]=we):we=e[25];let ze=we,$e;e[26]!==E||e[27]!==J?($e=(K,W)=>{E({moveFromIndex:K,moveToIndex:W,path:J})},e[26]=E,e[27]=J,e[28]=$e):$e=e[28];let ot=$e,Xe;e[29]!==I||e[30]!==J||e[31]!==ae||e[32]!==F?(Xe=K=>{let{collapsedIDs:W,updatedRows:ee}=fd({collapsed:K,rows:ae});I({type:"SET_ALL_ROWS_COLLAPSED",path:J,updatedRows:ee}),F(J,{collapsed:W})},e[29]=I,e[30]=J,e[31]=ae,e[32]=F,e[33]=Xe):Xe=e[33];let Ue=Xe,ft;e[34]!==I||e[35]!==J||e[36]!==ae||e[37]!==F?(ft=(K,W)=>{let{collapsedIDs:ee,updatedRows:le}=md({collapsed:W,rowID:K,rows:ae});I({type:"SET_ROW_COLLAPSED",path:J,updatedRows:le}),F(J,{collapsed:ee})},e[34]=I,e[35]=J,e[36]=ae,e[37]=F,e[38]=ft):ft=e[38];let Qt=ft,Ge=b&&ae.length>=b,Je=ce.length,Ye=M&&Je+(q?0:1)>0,xt=ae.length<A||x&&ae.length===0,jt=a&&ae.length===0,gt=Ye?`${Nr}--has-error`:`${Nr}--has-no-error`,qe;e[39]!==C||e[40]!==gt?(qe=[Ce,Nr,C,gt].filter(Boolean),e[39]=C,e[40]=gt,e[41]=qe):qe=e[41];let Tt;e[42]!==Q||e[43]!==J||e[44]!==re?(Tt=re&&Yt(oe,{CustomComponent:Q,Fallback:Yt(He,{path:J,showError:re})}),e[42]=Q,e[43]=J,e[44]=re,e[45]=Tt):Tt=e[45];let be;return e[46]!==Je||e[47]!==Ye||e[48]!==o?(be=Ye&&Je>0&&Yt(io,{count:Je,i18n:o,withMessage:!0}),e[46]=Je,e[47]=Ye,e[48]=o,e[49]=be):be=e[49],es("div",{className:qe.join(" "),id:`field-${J?.replace(/\./g,"__")}`,children:[Tt,es("header",{className:`${Nr}__header`,children:[es("div",{className:`${Nr}__header-wrap`,children:[es("div",{className:`${Nr}__heading-with-error`,children:[Yt("h3",{children:Yt(oe,{CustomComponent:Le,Fallback:Yt(xe,{label:h,localized:g,path:J,required:x})})}),be]}),ae.length>0&&es("ul",{className:`${Nr}__header-actions`,children:[Yt("li",{children:Yt("button",{className:`${Nr}__header-action`,onClick:()=>Ue(!0),type:"button",children:n("fields:collapseAll")})}),Yt("li",{children:Yt("button",{className:`${Nr}__header-action`,onClick:()=>Ue(!1),type:"button",children:n("fields:showAll")})})]})]}),Yt(oe,{CustomComponent:Ve,Fallback:Yt(Be,{description:S,path:J})})]}),ge,Yt(Fl,{fieldValue:pe,localized:g,path:J}),(ae.length>0||!q&&(jt||xt))&&es(cr,{className:`${Nr}__rows`,ids:ae.map(LP),onDragEnd:K=>{let{moveFromIndex:W,moveToIndex:ee}=K;return ot(W,ee)},children:[ae.map((K,W)=>{let{blockType:ee,isLoading:le}=K,ve=P.blocksMap[ee]??(f??m).find(Fe=>typeof Fe!="string"&&Fe.slug===ee);if(ve){let Fe=`${J}.${W}`,Se=ce.filter(We=>We.startsWith(Fe+".")).length;return Yt(Jr,{disabled:a||z||!D,id:K.id,children:We=>Yt(Ny,{...We,addRow:Y,block:ve,blocks:f??m,duplicateRow:me,errorCount:Se,fields:ve.fields,hasMaxRows:Ge,isLoading:le,isSortable:D,Label:ae?.[W]?.customComponents?.RowLabel,labels:O,moveRow:ot,parentPath:J,path:Fe,permissions:i,readOnly:a||z,removeRow:ze,row:K,rowCount:ae.length,rowIndex:W,schemaPath:_+ve.slug,setCollapse:Qt})},K.id)}return null}),!G&&es(EP.Fragment,{children:[xt&&Yt(Rr,{type:"error",children:n("validation:requiresAtLeast",{count:A,label:xh(A>1?O.plural:O.singular,o)||n(A>1?"general:row":"general:rows")})}),jt&&Yt(Rr,{children:n("validation:fieldHasNo",{label:xh(O.plural,o)})})]})]}),!Ge&&es(PP,{children:[Yt(ur,{className:`${Nr}__drawer-toggler`,disabled:a||z,slug:V,children:Yt(ne,{buttonStyle:"icon-label",disabled:a||z,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:n("fields:addLabel",{label:xh(O.singular,o)})})}),Yt(Nl,{addRow:Y,addRowIndex:ae?.length||0,blocks:f??m,drawerSlug:V,labels:O})]}),_e]})},Ll=je(NP);function LP(t){return t.id}import{jsx as Us,jsxs as Ly}from"react/jsx-runtime";import{useCallback as OP,useMemo as MP}from"react";import{jsx as yh}from"react/jsx-runtime";import{lazy as $P,Suspense as kP}from"react";var jP=$P(()=>import("./CodeEditor-7N7BMHRP.js")),$l=t=>yh(kP,{fallback:yh(St,{}),children:yh(jP,{...t})});var BP={js:"javascript",ts:"typescript"},VP="code-field",GP=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r={},language:s="javascript"}={},label:i,localized:a,required:l},onMount:c,path:u,readOnly:d,validate:f}=t,m=OP((_,A)=>{if(typeof f=="function")return f(_,{...A,required:l})},[f,l]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},disabled:x,path:y,setValue:C,showError:S,value:w}=Ee({potentiallyStalePath:u,validate:m}),D=MP(()=>rt(e),[e]);return Ly("div",{className:[Ce,VP,o,S&&"error",(d||x)&&"read-only"].filter(Boolean).join(" "),style:D,children:[Us(oe,{CustomComponent:v,Fallback:Us(xe,{label:i,localized:a,path:y,required:l})}),Ly("div",{className:`${Ce}__wrap`,children:[Us(oe,{CustomComponent:b,Fallback:Us(He,{path:y,showError:S})}),p,Us($l,{defaultLanguage:BP[s]||s,onChange:d||x?()=>null:_=>C(_),onMount:c,options:r,readOnly:d||x,value:w||""}),h]}),Us(oe,{CustomComponent:g,Fallback:Us(Be,{description:n,path:y})})]})},kl=je(GP);import{jsx as Zs,jsxs as Ch}from"react/jsx-runtime";import{getTranslation as HP}from"@payloadcms/translations";import{Fragment as zP,useCallback as XP,useEffect as UP,useMemo as YP,useState as ky}from"react";import{c as WP}from"react/compiler-runtime";import{fieldAffectsData as $y}from"payload/shared";var Rd=t=>t.reduce((e,o)=>{let n="fields"in o?o.fields:void 0;return n?$y(o)?e.push(`${o.name}.`):e.push(...Rd(n)):o.type==="tabs"?"tabs"in o&&o.tabs?.forEach(r=>{"name"in r?e.push(`${r.name}.`):e.push(...Rd(r.fields))}):$y(o)&&e.push(o.name),e},[]);var Ys=t=>{let e=WP(12),{fields:o,path:n,setErrorCount:r}=t,[s]=ki(),i=Xt(),a;e[0]!==o?(a=Rd(o),e[0]=o,e[1]=a):a=e[1];let l=a,c;e[2]!==s||e[3]!==i||e[4]!==n||e[5]!==l||e[6]!==r?(c=()=>{if(i){let d;d=0,Object.entries(s).forEach(f=>{let[m]=f;if(l?.some(p=>{let g=[...n,p].join(".");return g.endsWith(".")?m.startsWith(g):m===g})){let p=s[m];"valid"in p&&!p.valid&&(d=d+1)}}),r(d)}},e[2]=s,e[3]=i,e[4]=n,e[5]=l,e[6]=r,e[7]=c):c=e[7];let u;return e[8]!==o||e[9]!==s||e[10]!==i?(u=[s,i,o],e[8]=o,e[9]=s,e[10]=i,e[11]=u):u=e[11],Bs(c,250,u),null};var jl="collapsible-field",ZP=t=>{let{field:e,field:{admin:{className:o,description:n,initCollapsed:r=!1}={},fields:s,label:i}={},indexPath:a,parentPath:l,parentSchemaPath:c,path:u,permissions:d,readOnly:f}=t,{i18n:m}=k(),{getPreference:h,setPreference:p}=Fo(),{preferencesKey:g}=Pe(),[b,v]=ky(),x=`collapsible-${u?.replace(/\./g,"__")}`,[y,C]=ky(0),S=y>0,{customComponents:{AfterInput:w,BeforeInput:D,Description:_,Label:A}={},disabled:F}=Ee({path:u}),R=XP(async E=>{let T=await h(g);g&&p(g,{...T,...u?{fields:{...T?.fields||{},[u]:{...T?.fields?.[u],collapsed:E}}}:{fields:{...T?.fields||{},[x]:{...T?.fields?.[x],collapsed:E}}}})},[g,x,h,p,u]);UP(()=>{(async()=>{if(g){let T=await h(g),$=u?T?.fields?.[u]?.collapsed:T?.fields?.[x]?.collapsed;v($!==void 0?!!$:typeof r=="boolean"?r:!1)}else v(typeof r=="boolean"?r:!1)})()},[h,g,x,r,u]);let I=YP(()=>rt(e),[e]);return typeof b!="boolean"?null:Ch(zP,{children:[Zs(Ys,{fields:s,path:u.split(".").slice(0,-1),setErrorCount:C}),Ch("div",{className:[Ce,jl,o,S?`${jl}--has-error`:`${jl}--has-no-error`].filter(Boolean).join(" "),id:`field-${x}`,style:I,children:[D,Zs(Xs,{className:`${jl}__collapsible`,collapsibleStyle:S?"error":"default",header:Ch("div",{className:`${jl}__row-label-wrap`,children:[Zs(dn,{CustomComponent:A,label:HP(i,m),path:u}),S&&Zs(io,{count:y,i18n:m,withMessage:!0})]}),initCollapsed:b,onToggle:R,children:Zs(So,{fields:s,margins:"small",parentIndexPath:a,parentPath:l,parentSchemaPath:c,permissions:d,readOnly:f||F})}),w,Zs(oe,{CustomComponent:_,Fallback:Zs(Be,{description:n,path:u})})]})]})},Ol=je(ZP);import{jsx as ns,jsxs as _2}from"react/jsx-runtime";import{getTranslation as UN}from"@payloadcms/translations";import{useCallback as ug,useMemo as D2}from"react";import{jsx as wh}from"react/jsx-runtime";import{lazy as JP,Suspense as qP}from"react";var QP=JP(()=>import("./DatePicker-4DPXLCID.js")),Qi=t=>wh(qP,{fallback:wh(St,{height:50}),children:wh(QP,{...t})});import{jsx as R2,jsxs as zN}from"react/jsx-runtime";import{useMemo as XN}from"react";import{jsx as ei}from"react/jsx-runtime";import{getTranslation as w2}from"@payloadcms/translations";import S2,{useEffect as VN,useId as GN}from"react";function Lr(t){"@babel/helpers - typeof";return Lr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lr(t)}function jy(t,e){if(Lr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(Lr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _d(t){var e=jy(t,"string");return Lr(e)=="symbol"?e:e+""}function Js(t,e,o){return(e=_d(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function Oy(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,n)}return o}function Re(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Oy(Object(o),!0).forEach(function(n){Js(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Oy(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function My(t){if(Array.isArray(t))return t}function By(t,e){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n,r,s,i,a=[],l=!0,c=!1;try{if(s=(o=o.call(t)).next,e===0){if(Object(o)!==o)return;l=!1}else for(;!(l=(n=s.call(o)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&o.return!=null&&(i=o.return(),Object(i)!==i))return}finally{if(c)throw r}}return a}}function Ml(t,e){(e==null||e>t.length)&&(e=t.length);for(var o=0,n=Array(e);o<e;o++)n[o]=t[o];return n}function Dd(t,e){if(t){if(typeof t=="string")return Ml(t,e);var o={}.toString.call(t).slice(8,-1);return o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set"?Array.from(t):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?Ml(t,e):void 0}}function Vy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
49
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $r(t,e){return My(t)||By(t,e)||Dd(t,e)||Vy()}function Vo(t,e){if(t==null)return{};var o,n,r=Mi(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)o=s[n],e.includes(o)||{}.propertyIsEnumerable.call(t,o)&&(r[o]=t[o])}return r}import{useState as Sh,useCallback as Fd}from"react";var KP=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Ad(t){var e=t.defaultInputValue,o=e===void 0?"":e,n=t.defaultMenuIsOpen,r=n===void 0?!1:n,s=t.defaultValue,i=s===void 0?null:s,a=t.inputValue,l=t.menuIsOpen,c=t.onChange,u=t.onInputChange,d=t.onMenuClose,f=t.onMenuOpen,m=t.value,h=Vo(t,KP),p=Sh(a!==void 0?a:o),g=$r(p,2),b=g[0],v=g[1],x=Sh(l!==void 0?l:r),y=$r(x,2),C=y[0],S=y[1],w=Sh(m!==void 0?m:i),D=$r(w,2),_=D[0],A=D[1],F=Fd(function(N,P){typeof c=="function"&&c(N,P),A(N)},[c]),R=Fd(function(N,P){var L;typeof u=="function"&&(L=u(N,P)),v(L!==void 0?L:N)},[u]),I=Fd(function(){typeof f=="function"&&f(),S(!0)},[f]),E=Fd(function(){typeof d=="function"&&d(),S(!1)},[d]),T=a!==void 0?a:b,$=l!==void 0?l:C,j=m!==void 0?m:_;return Re(Re({},h),{},{inputValue:T,menuIsOpen:$,onChange:F,onInputChange:R,onMenuClose:E,onMenuOpen:I,value:j})}import*as o2 from"react";import{forwardRef as SN,useMemo as Jie}from"react";function Gy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wy(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_d(n.key),n)}}function Hy(t,e,o){return e&&Wy(t.prototype,e),o&&Wy(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function zy(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Bi(t,e)}function Bl(t){return Bl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bl(t)}function Ih(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ih=function(){return!!t})()}function Xy(t,e){if(e&&(Lr(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C0(t)}function Uy(t){var e=Ih();return function(){var o,n=Bl(t);if(e){var r=Bl(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return Xy(this,o)}}function Yy(t){if(Array.isArray(t))return Ml(t)}function Zy(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Jy(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
50
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ts(t){return Yy(t)||Zy(t)||Dd(t)||Jy()}import*as ut from"react";import{useMemo as Zl,Fragment as Uh,useRef as ma,useCallback as rs,useEffect as zw,Component as M5}from"react";import*as hr from"react";import{useContext as E6,forwardRef as P6}from"react";var e6=!1;function t6(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function o6(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var qy=function(){function t(o){var n=this;this._insertTag=function(r){var s;n.tags.length===0?n.insertionPoint?s=n.insertionPoint.nextSibling:n.prepend?s=n.container.firstChild:s=n.before:s=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(r,s),n.tags.push(r)},this.isSpeedy=o.speedy===void 0?!e6:o.speedy,this.tags=[],this.ctr=0,this.nonce=o.nonce,this.key=o.key,this.container=o.container,this.prepend=o.prepend,this.insertionPoint=o.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(n){n.forEach(this._insertTag)},e.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(o6(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=t6(r);try{s.insertRule(n,s.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(n));this.ctr++},e.flush=function(){this.tags.forEach(function(n){var r;return(r=n.parentNode)==null?void 0:r.removeChild(n)}),this.tags=[],this.ctr=0},t}();var vo="-ms-",Vl="-moz-",nt="-webkit-",Td="comm",Ki="rule",ea="decl";var Qy="@import";var Ed="@keyframes";var Ky="@layer";var eC=Math.abs,qs=String.fromCharCode,tC=Object.assign;function oC(t,e){return Bt(t,0)^45?(((e<<2^Bt(t,0))<<2^Bt(t,1))<<2^Bt(t,2))<<2^Bt(t,3):0}function Pd(t){return t.trim()}function Rh(t,e){return(t=e.exec(t))?t[0]:t}function et(t,e,o){return t.replace(e,o)}function Gl(t,e){return t.indexOf(e)}function Bt(t,e){return t.charCodeAt(e)|0}function os(t,e,o){return t.slice(e,o)}function Ao(t){return t.length}function ta(t){return t.length}function oa(t,e){return e.push(t),t}function _h(t,e){return t.map(e).join("")}var Nd=1,ra=1,rC=0,To=0,Zt=0,sa="";function Wl(t,e,o,n,r,s,i){return{value:t,root:e,parent:o,type:n,props:r,children:s,line:Nd,column:ra,length:i,return:""}}function ia(t,e){return tC(Wl("",null,null,"",null,null,0),t,{length:-t.length},e)}function nC(){return Zt}function sC(){return Zt=To>0?Bt(sa,--To):0,ra--,Zt===10&&(ra=1,Nd--),Zt}function Eo(){return Zt=To<rC?Bt(sa,To++):0,ra++,Zt===10&&(ra=1,Nd++),Zt}function pr(){return Bt(sa,To)}function Hl(){return To}function aa(t,e){return os(sa,t,e)}function na(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ld(t){return Nd=ra=1,rC=Ao(sa=t),To=0,[]}function $d(t){return sa="",t}function la(t){return Pd(aa(To-1,Dh(t===91?t+2:t===40?t+1:t)))}function iC(t){for(;(Zt=pr())&&Zt<33;)Eo();return na(t)>2||na(Zt)>3?"":" "}function aC(t,e){for(;--e&&Eo()&&!(Zt<48||Zt>102||Zt>57&&Zt<65||Zt>70&&Zt<97););return aa(t,Hl()+(e<6&&pr()==32&&Eo()==32))}function Dh(t){for(;Eo();)switch(Zt){case t:return To;case 34:case 39:t!==34&&t!==39&&Dh(Zt);break;case 40:t===41&&Dh(t);break;case 92:Eo();break}return To}function lC(t,e){for(;Eo()&&t+Zt!==57;)if(t+Zt===84&&pr()===47)break;return"/*"+aa(e,To-1)+"*"+qs(t===47?t:Eo())}function cC(t){for(;!na(pr());)Eo();return aa(t,To)}function mC(t){return $d(kd("",null,null,null,[""],t=Ld(t),0,[0],t))}function kd(t,e,o,n,r,s,i,a,l){for(var c=0,u=0,d=i,f=0,m=0,h=0,p=1,g=1,b=1,v=0,x="",y=r,C=s,S=n,w=x;g;)switch(h=v,v=Eo()){case 40:if(h!=108&&Bt(w,d-1)==58){Gl(w+=et(la(v),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:w+=la(v);break;case 9:case 10:case 13:case 32:w+=iC(h);break;case 92:w+=aC(Hl()-1,7);continue;case 47:switch(pr()){case 42:case 47:oa(r6(lC(Eo(),Hl()),e,o),l);break;default:w+="/"}break;case 123*p:a[c++]=Ao(w)*b;case 125*p:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:b==-1&&(w=et(w,/\f/g,"")),m>0&&Ao(w)-d&&oa(m>32?dC(w+";",n,o,d-1):dC(et(w," ","")+";",n,o,d-2),l);break;case 59:w+=";";default:if(oa(S=uC(w,e,o,c,u,r,a,x,y=[],C=[],d),s),v===123)if(u===0)kd(w,e,S,S,y,s,d,a,C);else switch(f===99&&Bt(w,3)===110?100:f){case 100:case 108:case 109:case 115:kd(t,S,S,n&&oa(uC(t,S,S,0,0,r,a,x,r,y=[],d),C),r,C,d,a,n?y:C);break;default:kd(w,S,S,S,[""],C,0,a,C)}}c=u=m=0,p=b=1,x=w="",d=i;break;case 58:d=1+Ao(w),m=h;default:if(p<1){if(v==123)--p;else if(v==125&&p++==0&&sC()==125)continue}switch(w+=qs(v),v*p){case 38:b=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(Ao(w)-1)*b,b=1;break;case 64:pr()===45&&(w+=la(Eo())),f=pr(),u=d=Ao(x=w+=cC(Hl())),v++;break;case 45:h===45&&Ao(w)==2&&(p=0)}}return s}function uC(t,e,o,n,r,s,i,a,l,c,u){for(var d=r-1,f=r===0?s:[""],m=ta(f),h=0,p=0,g=0;h<n;++h)for(var b=0,v=os(t,d+1,d=eC(p=i[h])),x=t;b<m;++b)(x=Pd(p>0?f[b]+" "+v:et(v,/&\f/g,f[b])))&&(l[g++]=x);return Wl(t,e,o,r===0?Ki:a,l,c,u)}function r6(t,e,o){return Wl(t,e,o,Td,qs(nC()),os(t,2,-2),0)}function dC(t,e,o,n){return Wl(t,e,o,ea,os(t,0,n),os(t,n+1,-1),n)}function Qs(t,e){for(var o="",n=ta(t),r=0;r<n;r++)o+=e(t[r],r,t,e)||"";return o}function fC(t,e,o,n){switch(t.type){case Ky:if(t.children.length)break;case Qy:case ea:return t.return=t.return||t.value;case Td:return"";case Ed:return t.return=t.value+"{"+Qs(t.children,n)+"}";case Ki:t.value=t.props.join(",")}return Ao(o=Qs(t.children,n))?t.return=t.value+"{"+o+"}":""}function pC(t){var e=ta(t);return function(o,n,r,s){for(var i="",a=0;a<e;a++)i+=t[a](o,n,r,s)||"";return i}}function hC(t){return function(e){e.root||(e=e.return)&&t(e)}}function gC(t){var e=Object.create(null);return function(o){return e[o]===void 0&&(e[o]=t(o)),e[o]}}var n6=function(e,o,n){for(var r=0,s=0;r=s,s=pr(),r===38&&s===12&&(o[n]=1),!na(s);)Eo();return aa(e,To)},s6=function(e,o){var n=-1,r=44;do switch(na(r)){case 0:r===38&&pr()===12&&(o[n]=1),e[n]+=n6(To-1,o,n);break;case 2:e[n]+=la(r);break;case 4:if(r===44){e[++n]=pr()===58?"&\f":"",o[n]=e[n].length;break}default:e[n]+=qs(r)}while(r=Eo());return e},i6=function(e,o){return $d(s6(Ld(e),o))},bC=new WeakMap,a6=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var o=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&o.charCodeAt(0)!==58&&!bC.get(n))&&!r){bC.set(e,!0);for(var s=[],i=i6(o,s),a=n.props,l=0,c=0;l<i.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=s[l]?i[l].replace(/&\f/g,a[u]):a[u]+" "+i[l]}}},l6=function(e){if(e.type==="decl"){var o=e.value;o.charCodeAt(0)===108&&o.charCodeAt(2)===98&&(e.return="",e.value="")}};function vC(t,e){switch(oC(t,e)){case 5103:return nt+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return nt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return nt+t+Vl+t+vo+t+t;case 6828:case 4268:return nt+t+vo+t+t;case 6165:return nt+t+vo+"flex-"+t+t;case 5187:return nt+t+et(t,/(\w+).+(:[^]+)/,nt+"box-$1$2"+vo+"flex-$1$2")+t;case 5443:return nt+t+vo+"flex-item-"+et(t,/flex-|-self/,"")+t;case 4675:return nt+t+vo+"flex-line-pack"+et(t,/align-content|flex-|-self/,"")+t;case 5548:return nt+t+vo+et(t,"shrink","negative")+t;case 5292:return nt+t+vo+et(t,"basis","preferred-size")+t;case 6060:return nt+"box-"+et(t,"-grow","")+nt+t+vo+et(t,"grow","positive")+t;case 4554:return nt+et(t,/([^-])(transform)/g,"$1"+nt+"$2")+t;case 6187:return et(et(et(t,/(zoom-|grab)/,nt+"$1"),/(image-set)/,nt+"$1"),t,"")+t;case 5495:case 3959:return et(t,/(image-set\([^]*)/,nt+"$1$`$1");case 4968:return et(et(t,/(.+:)(flex-)?(.*)/,nt+"box-pack:$3"+vo+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+nt+t+t;case 4095:case 3583:case 4068:case 2532:return et(t,/(.+)-inline(.+)/,nt+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ao(t)-1-e>6)switch(Bt(t,e+1)){case 109:if(Bt(t,e+4)!==45)break;case 102:return et(t,/(.+:)(.+)-([^]+)/,"$1"+nt+"$2-$3$1"+Vl+(Bt(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Gl(t,"stretch")?vC(et(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Bt(t,e+1)!==115)break;case 6444:switch(Bt(t,Ao(t)-3-(~Gl(t,"!important")&&10))){case 107:return et(t,":",":"+nt)+t;case 101:return et(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nt+(Bt(t,14)===45?"inline-":"")+"box$3$1"+nt+"$2$3$1"+vo+"$2box$3")+t}break;case 5936:switch(Bt(t,e+11)){case 114:return nt+t+vo+et(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nt+t+vo+et(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nt+t+vo+et(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nt+t+vo+t+t}return t}var c6=function(e,o,n,r){if(e.length>-1&&!e.return)switch(e.type){case ea:e.return=vC(e.value,e.length);break;case Ed:return Qs([ia(e,{value:et(e.value,"@","@"+nt)})],r);case Ki:if(e.length)return _h(e.props,function(s){switch(Rh(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qs([ia(e,{props:[et(s,/:(read-\w+)/,":"+Vl+"$1")]})],r);case"::placeholder":return Qs([ia(e,{props:[et(s,/:(plac\w+)/,":"+nt+"input-$1")]}),ia(e,{props:[et(s,/:(plac\w+)/,":"+Vl+"$1")]}),ia(e,{props:[et(s,/:(plac\w+)/,vo+"input-$1")]})],r)}return""})}},u6=[c6],Fh=function(e){var o=e.key;if(o==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(p){var g=p.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var r=e.stylisPlugins||u6,s={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+o+' "]'),function(p){for(var g=p.getAttribute("data-emotion").split(" "),b=1;b<g.length;b++)s[g[b]]=!0;a.push(p)});var l,c=[a6,l6];{var u,d=[fC,hC(function(p){u.insert(p)})],f=pC(c.concat(r,d)),m=function(g){return Qs(mC(g),f)};l=function(g,b,v,x){u=v,m(g?g+"{"+b.styles+"}":b.styles),x&&(h.inserted[b.name]=!0)}}var h={key:o,sheet:new qy({key:o,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:l};return h.sheet.hydrate(a),h};var S6=!0;function Lh(t,e,o){var n="";return o.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):r&&(n+=r+" ")}),n}var Ud=function(e,o,n){var r=e.key+"-"+o.name;(n===!1||S6===!1)&&e.registered[r]===void 0&&(e.registered[r]=o.styles)},$h=function(e,o,n){Ud(e,o,n);var r=e.key+"-"+o.name;if(e.inserted[o.name]===void 0){var s=o;do e.insert(o===s?"."+r:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function TC(t){for(var e=0,o,n=0,r=t.length;r>=4;++n,r-=4)o=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,e=(o&65535)*1540483477+((o>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var EC={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var I6=!1,R6=/[A-Z]|^ms/g,_6=/_EMO_([^_]+?)_([^]*?)_EMO_/g,$C=function(e){return e.charCodeAt(1)===45},PC=function(e){return e!=null&&typeof e!="boolean"},kh=gC(function(t){return $C(t)?t:t.replace(R6,"-$&").toLowerCase()}),NC=function(e,o){switch(e){case"animation":case"animationName":if(typeof o=="string")return o.replace(_6,function(n,r,s){return Kr={name:r,styles:s,next:Kr},r})}return EC[e]!==1&&!$C(e)&&typeof o=="number"&&o!==0?o+"px":o},D6="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function zl(t,e,o){if(o==null)return"";var n=o;if(n.__emotion_styles!==void 0)return n;switch(typeof o){case"boolean":return"";case"object":{var r=o;if(r.anim===1)return Kr={name:r.name,styles:r.styles,next:Kr},r.name;var s=o;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)Kr={name:i.name,styles:i.styles,next:Kr},i=i.next;var a=s.styles+";";return a}return F6(t,e,o)}case"function":{if(t!==void 0){var l=Kr,c=o(t);return Kr=l,zl(t,e,c)}break}}var u=o;if(e==null)return u;var d=e[u];return d!==void 0?d:u}function F6(t,e,o){var n="";if(Array.isArray(o))for(var r=0;r<o.length;r++)n+=zl(t,e,o[r])+";";else for(var s in o){var i=o[s];if(typeof i!="object"){var a=i;e!=null&&e[a]!==void 0?n+=s+"{"+e[a]+"}":PC(a)&&(n+=kh(s)+":"+NC(s,a)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&I6)throw new Error(D6);if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var l=0;l<i.length;l++)PC(i[l])&&(n+=kh(s)+":"+NC(s,i[l])+";");else{var c=zl(t,e,i);switch(s){case"animation":case"animationName":{n+=kh(s)+":"+c+";";break}default:n+=s+"{"+c+"}"}}}}return n}var LC=/label:\s*([^\s;{]+)\s*(;|$)/g,Kr;function Yd(t,e,o){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var n=!0,r="";Kr=void 0;var s=t[0];if(s==null||s.raw===void 0)n=!1,r+=zl(o,e,s);else{var i=s;r+=i[0]}for(var a=1;a<t.length;a++)if(r+=zl(o,e,t[a]),n){var l=s;r+=l[a]}LC.lastIndex=0;for(var c="",u;(u=LC.exec(r))!==null;)c+="-"+u[1];var d=TC(r)+c;return{name:d,styles:r,next:Kr}}import*as Zd from"react";var A6=function(e){return e()},T6=Zd.useInsertionEffect?Zd.useInsertionEffect:!1,jh=T6||A6;var kC=!1,jC=hr.createContext(typeof HTMLElement<"u"?Fh({key:"css"}):null),rie=jC.Provider;var OC=function(e){return P6(function(o,n){var r=E6(jC);return e(o,r,n)})},MC=hr.createContext({});var Jd={}.hasOwnProperty,Oh="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",BC=function(e,o){var n={};for(var r in o)Jd.call(o,r)&&(n[r]=o[r]);return n[Oh]=e,n},N6=function(e){var o=e.cache,n=e.serialized,r=e.isStringTag;return Ud(o,n,r),jh(function(){return $h(o,n,r)}),null},L6=OC(function(t,e,o){var n=t.css;typeof n=="string"&&e.registered[n]!==void 0&&(n=e.registered[n]);var r=t[Oh],s=[n],i="";typeof t.className=="string"?i=Lh(e.registered,s,t.className):t.className!=null&&(i=t.className+" ");var a=Yd(s,void 0,hr.useContext(MC));i+=e.key+"-"+a.name;var l={};for(var c in t)Jd.call(t,c)&&c!=="css"&&c!==Oh&&!kC&&(l[c]=t[c]);return l.className=i,o&&(l.ref=o),hr.createElement(hr.Fragment,null,hr.createElement(N6,{cache:e,serialized:a,isStringTag:typeof r=="string"}),hr.createElement(r,l))}),VC=L6;import*as ca from"react";var fie=Ds(AC()),Te=function(e,o){var n=arguments;if(o==null||!Jd.call(o,"css"))return ca.createElement.apply(void 0,n);var r=n.length,s=new Array(r);s[0]=VC,s[1]=BC(e,o);for(var i=2;i<r;i++)s[i]=n[i];return ca.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(Te||(Te={}));function Xl(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return Yd(e)}function GC(){var t=Xl.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function WC(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}DD();import{useContext as k6,useRef as Vh,useState as em,useMemo as j6,useCallback as Mh,createContext as O6}from"react";import{createPortal as M6}from"react-dom";import{useLayoutEffect as $6}from"react";var qd=$6;var B6=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ul=function(){};function V6(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function zC(t,e){for(var o=arguments.length,n=new Array(o>2?o-2:0),r=2;r<o;r++)n[r-2]=arguments[r];var s=[].concat(n);if(e&&t)for(var i in e)e.hasOwnProperty(i)&&e[i]&&s.push("".concat(V6(t,i)));return s.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var ua=function(e){return U6(e)?e.filter(Boolean):Lr(e)==="object"&&e!==null?[e]:[]},XC=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var o=Vo(e,B6);return Re({},o)},Nt=function(e,o,n){var r=e.cx,s=e.getStyles,i=e.getClassNames,a=e.className;return{css:s(o,e),className:r(n??{},i(o,e),a)}};function Yl(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function G6(t){return Yl(t)?window.innerHeight:t.clientHeight}function UC(t){return Yl(t)?window.pageYOffset:t.scrollTop}function tm(t,e){if(Yl(t)){window.scrollTo(0,e);return}t.scrollTop=e}function W6(t){var e=getComputedStyle(t),o=e.position==="absolute",n=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var r=t;r=r.parentElement;)if(e=getComputedStyle(r),!(o&&e.position==="static")&&n.test(e.overflow+e.overflowY+e.overflowX))return r;return document.documentElement}function H6(t,e,o,n){return o*((t=t/n-1)*t*t+1)+e}function Qd(t,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ul,r=UC(t),s=e-r,i=10,a=0;function l(){a+=i;var c=H6(a,r,s,o);tm(t,c),a<o?window.requestAnimationFrame(l):n(t)}l()}function Gh(t,e){var o=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=e.offsetHeight/3;n.bottom+r>o.bottom?tm(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):n.top-r<o.top&&tm(t,Math.max(e.offsetTop-r,0))}function z6(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function Wh(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function YC(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var ZC=!1,X6={get passive(){return ZC=!0}},Kd=typeof window<"u"?window:{};Kd.addEventListener&&Kd.removeEventListener&&(Kd.addEventListener("p",Ul,X6),Kd.removeEventListener("p",Ul,!1));var JC=ZC;function qC(t){return t!=null}function U6(t){return Array.isArray(t)}function Ks(t,e,o){return t?e:o}var QC=function(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];var s=Object.entries(e).filter(function(i){var a=$r(i,1),l=a[0];return!n.includes(l)});return s.reduce(function(i,a){var l=$r(a,2),c=l[0],u=l[1];return i[c]=u,i},{})},Y6=["children","innerProps"],Z6=["children","innerProps"];function J6(t){var e=t.maxHeight,o=t.menuEl,n=t.minHeight,r=t.placement,s=t.shouldScroll,i=t.isFixedPosition,a=t.controlHeight,l=W6(o),c={placement:"bottom",maxHeight:e};if(!o||!o.offsetParent)return c;var u=l.getBoundingClientRect(),d=u.height,f=o.getBoundingClientRect(),m=f.bottom,h=f.height,p=f.top,g=o.offsetParent.getBoundingClientRect(),b=g.top,v=i?window.innerHeight:G6(l),x=UC(l),y=parseInt(getComputedStyle(o).marginBottom,10),C=parseInt(getComputedStyle(o).marginTop,10),S=b-C,w=v-p,D=S+x,_=d-x-p,A=m-v+x+y,F=x+p-C,R=160;switch(r){case"auto":case"bottom":if(w>=h)return{placement:"bottom",maxHeight:e};if(_>=h&&!i)return s&&Qd(l,A,R),{placement:"bottom",maxHeight:e};if(!i&&_>=n||i&&w>=n){s&&Qd(l,A,R);var I=i?w-y:_-y;return{placement:"bottom",maxHeight:I}}if(r==="auto"||i){var E=e,T=i?S:D;return T>=n&&(E=Math.min(T-y-a,e)),{placement:"top",maxHeight:E}}if(r==="bottom")return s&&tm(l,A),{placement:"bottom",maxHeight:e};break;case"top":if(S>=h)return{placement:"top",maxHeight:e};if(D>=h&&!i)return s&&Qd(l,F,R),{placement:"top",maxHeight:e};if(!i&&D>=n||i&&S>=n){var $=e;return(!i&&D>=n||i&&S>=n)&&($=i?S-C:D-C),s&&Qd(l,F,R),{placement:"top",maxHeight:$}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function q6(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var KC=function(e){return e==="auto"?"bottom":e},ew=function(e,o){var n,r=e.placement,s=e.theme,i=s.borderRadius,a=s.spacing,l=s.colors;return Re((n={label:"menu"},Js(n,q6(r),"100%"),Js(n,"position","absolute"),Js(n,"width","100%"),Js(n,"zIndex",1),n),o?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},tw=O6(null),ow=function(e){var o=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,i=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,c=k6(tw)||{},u=c.setPortalPlacement,d=Vh(null),f=em(r),m=$r(f,2),h=m[0],p=m[1],g=em(null),b=$r(g,2),v=b[0],x=b[1],y=l.spacing.controlHeight;return qd(function(){var C=d.current;if(C){var S=i==="fixed",w=a&&!S,D=J6({maxHeight:r,menuEl:C,minHeight:n,placement:s,shouldScroll:w,isFixedPosition:S,controlHeight:y});p(D.maxHeight),x(D.placement),u?.(D.placement)}},[r,s,i,a,n,u,y]),o({ref:d,placerProps:Re(Re({},e),{},{placement:v||KC(s),maxHeight:h})})},Q6=function(e){var o=e.children,n=e.innerRef,r=e.innerProps;return Te("div",Ie({},Nt(e,"menu",{menu:!0}),{ref:n},r),o)},K6=Q6,rw=function(e,o){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return Re({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},o?{}:{paddingBottom:r,paddingTop:r})},e5=function(e){var o=e.children,n=e.innerProps,r=e.innerRef,s=e.isMulti;return Te("div",Ie({},Nt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},n),o)},nw=function(e,o){var n=e.theme,r=n.spacing.baseUnit,s=n.colors;return Re({textAlign:"center"},o?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},sw=nw,iw=nw,t5=function(e){var o=e.children,n=o===void 0?"No options":o,r=e.innerProps,s=Vo(e,Y6);return Te("div",Ie({},Nt(Re(Re({},s),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},o5=function(e){var o=e.children,n=o===void 0?"Loading...":o,r=e.innerProps,s=Vo(e,Z6);return Te("div",Ie({},Nt(Re(Re({},s),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},aw=function(e){var o=e.rect,n=e.offset,r=e.position;return{left:o.left,position:r,top:n,width:o.width,zIndex:1}},r5=function(e){var o=e.appendTo,n=e.children,r=e.controlElement,s=e.innerProps,i=e.menuPlacement,a=e.menuPosition,l=Vh(null),c=Vh(null),u=em(KC(i)),d=$r(u,2),f=d[0],m=d[1],h=j6(function(){return{setPortalPlacement:m}},[]),p=em(null),g=$r(p,2),b=g[0],v=g[1],x=Mh(function(){if(r){var w=z6(r),D=a==="fixed"?0:window.pageYOffset,_=w[f]+D;(_!==b?.offset||w.left!==b?.rect.left||w.width!==b?.rect.width)&&v({offset:_,rect:w})}},[r,a,f,b?.offset,b?.rect.left,b?.rect.width]);qd(function(){x()},[x]);var y=Mh(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&l.current&&(c.current=fv(r,l.current,x,{elementResize:"ResizeObserver"in window}))},[r,x]);qd(function(){y()},[y]);var C=Mh(function(w){l.current=w,y()},[y]);if(!o&&a!=="fixed"||!b)return null;var S=Te("div",Ie({ref:C},Nt(Re(Re({},e),{},{offset:b.offset,position:a,rect:b.rect}),"menuPortal",{"menu-portal":!0}),s),n);return Te(tw.Provider,{value:h},o?M6(S,o):S)},lw=function(e){var o=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:o?"none":void 0,position:"relative"}},n5=function(e){var o=e.children,n=e.innerProps,r=e.isDisabled,s=e.isRtl;return Te("div",Ie({},Nt(e,"container",{"--is-disabled":r,"--is-rtl":s}),n),o)},cw=function(e,o){var n=e.theme.spacing,r=e.isMulti,s=e.hasValue,i=e.selectProps.controlShouldRenderValue;return Re({alignItems:"center",display:r&&s&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},o?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(n.baseUnit*2,"px")})},s5=function(e){var o=e.children,n=e.innerProps,r=e.isMulti,s=e.hasValue;return Te("div",Ie({},Nt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),n),o)},uw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},i5=function(e){var o=e.children,n=e.innerProps;return Te("div",Ie({},Nt(e,"indicatorsContainer",{indicators:!0}),n),o)},HC,a5=["size"],l5=["innerProps","isRtl","size"];var c5={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},dw=function(e){var o=e.size,n=Vo(e,a5);return Te("svg",Ie({height:o,width:o,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:c5},n))},Hh=function(e){return Te(dw,Ie({size:20},e),Te("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},mw=function(e){return Te(dw,Ie({size:20},e),Te("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},fw=function(e,o){var n=e.isFocused,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return Re({label:"indicatorContainer",display:"flex",transition:"color 150ms"},o?{}:{color:n?i.neutral60:i.neutral20,padding:s*2,":hover":{color:n?i.neutral80:i.neutral40}})},pw=fw,u5=function(e){var o=e.children,n=e.innerProps;return Te("div",Ie({},Nt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),o||Te(mw,null))},hw=fw,d5=function(e){var o=e.children,n=e.innerProps;return Te("div",Ie({},Nt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),o||Te(Hh,null))},gw=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return Re({label:"indicatorSeparator",alignSelf:"stretch",width:1},o?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:s*2,marginTop:s*2})},m5=function(e){var o=e.innerProps;return Te("span",Ie({},o,Nt(e,"indicatorSeparator",{"indicator-separator":!0})))},f5=GC(HC||(HC=WC([`
|
|
51
51
|
0%, 80%, 100% { opacity: 0; }
|
|
52
52
|
40% { opacity: 1; }
|
|
53
|
-
`]))),bw=function(e,o){var n=e.isFocused,r=e.size,s=e.theme,i=s.colors,a=s.spacing.baseUnit;return Ie({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},o?{}:{color:n?i.neutral60:i.neutral20,padding:a*2})},Bh=function(e){var o=e.delay,n=e.offset;return Fe("span",{css:Xl({animation:"".concat(f5," 1s ease-in-out ").concat(o,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},p5=function(e){var o=e.innerProps,n=e.isRtl,r=e.size,s=r===void 0?4:r,i=Vo(e,l5);return Fe("div",Se({},Nt(Ie(Ie({},i),{},{innerProps:o,isRtl:n,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),o),Fe(Bh,{delay:0,offset:n}),Fe(Bh,{delay:160,offset:!0}),Fe(Bh,{delay:320,offset:!n}))},vw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.theme,i=s.colors,a=s.borderRadius,l=s.spacing;return Ie({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},o?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},h5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Fe("div",Se({ref:s},Nt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),o)},g5=h5,b5=["data"],xw=function(e,o){var n=e.theme.spacing;return o?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},v5=function(e){var o=e.children,n=e.cx,r=e.getStyles,s=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return Fe("div",Se({},Nt(e,"group",{group:!0}),l),Fe(i,Se({},a,{selectProps:d,theme:u,getStyles:r,getClassNames:s,cx:n}),c),Fe("div",null,o))},yw=function(e,o){var n=e.theme,r=n.colors,s=n.spacing;return Ie({label:"group",cursor:"default",display:"block"},o?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},x5=function(e){var o=XC(e);o.data;var n=Vo(o,b5);return Fe("div",Se({},Nt(e,"groupHeading",{"group-heading":!0}),n))},y5=v5,C5=["innerRef","isDisabled","isHidden","inputClassName"],Cw=function(e,o){var n=e.isDisabled,r=e.value,s=e.theme,i=s.spacing,a=s.colors;return Ie(Ie({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},w5),o?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},ww={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},w5={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ie({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},ww)},S5=function(e){return Ie({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},ww)},I5=function(e){var o=e.cx,n=e.value,r=XC(e),s=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,c=Vo(r,C5);return Fe("div",Se({},Nt(e,"input",{"input-container":!0}),{"data-value":n||""}),Fe("input",Se({className:o({input:!0},l),ref:s,style:S5(a),disabled:i},c)))},R5=I5,Sw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors;return Ie({label:"multiValue",display:"flex",minWidth:0},o?{}:{backgroundColor:i.neutral10,borderRadius:s/2,margin:r.baseUnit/2})},Iw=function(e,o){var n=e.theme,r=n.borderRadius,s=n.colors,i=e.cropWithEllipsis;return Ie({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},o?{}:{borderRadius:r/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Rw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors,a=e.isFocused;return Ie({alignItems:"center",display:"flex"},o?{}:{borderRadius:s/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},_w=function(e){var o=e.children,n=e.innerProps;return Fe("div",n,o)},_5=_w,D5=_w;function F5(t){var e=t.children,o=t.innerProps;return Fe("div",Se({role:"button"},o),e||Fe(Hh,{size:14}))}var A5=function(e){var o=e.children,n=e.components,r=e.data,s=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,c=n.Container,u=n.Label,d=n.Remove;return Fe(c,{data:r,innerProps:Ie(Ie({},Nt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),s),selectProps:l},Fe(u,{data:r,innerProps:Ie({},Nt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},o),Fe(d,{data:r,innerProps:Ie(Ie({},Nt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(o||"option")},a),selectProps:l}))},T5=A5,Dw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return Ie({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},o?{}:{backgroundColor:s?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:s?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:s?l.primary:l.primary50}})},E5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.innerRef,a=e.innerProps;return Fe("div",Se({},Nt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":s}),{ref:i,"aria-disabled":n},a),o)},P5=E5,Fw=function(e,o){var n=e.theme,r=n.spacing,s=n.colors;return Ie({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},o?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},N5=function(e){var o=e.children,n=e.innerProps;return Fe("div",Se({},Nt(e,"placeholder",{placeholder:!0}),n),o)},L5=N5,Aw=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing,i=r.colors;return Ie({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},o?{}:{color:n?i.neutral40:i.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},$5=function(e){var o=e.children,n=e.isDisabled,r=e.innerProps;return Fe("div",Se({},Nt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),o)},k5=$5,co={ClearIndicator:d5,Control:g5,DropdownIndicator:u5,DownChevron:mw,CrossIcon:Hh,Group:y5,GroupHeading:x5,IndicatorsContainer:i5,IndicatorSeparator:m5,Input:R5,LoadingIndicator:p5,Menu:K6,MenuList:e5,MenuPortal:r5,LoadingMessage:o5,NoOptionsMessage:t5,MultiValue:T5,MultiValueContainer:_5,MultiValueLabel:D5,MultiValueRemove:F5,Option:P5,Placeholder:L5,SelectContainer:n5,SingleValue:k5,ValueContainer:s5},Tw=function(e){return Ie(Ie({},co),e.components)};var Ew=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function j5(t,e){return!!(t===e||Ew(t)&&Ew(e))}function O5(t,e){if(t.length!==e.length)return!1;for(var o=0;o<t.length;o++)if(!j5(t[o],e[o]))return!1;return!0}function Pw(t,e){e===void 0&&(e=O5);var o=null;function n(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];if(o&&o.lastThis===this&&e(r,o.lastArgs))return o.lastResult;var i=t.apply(this,r);return o={lastResult:i,lastArgs:r,lastThis:this},i}return n.clear=function(){o=null},n}var B5={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},V5=function(e){return Fe("span",Se({css:B5},e))},Nw=V5,G5={guidance:function(e){var o=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,s=e.context,i=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(o?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var o=e.action,n=e.label,r=n===void 0?"":n,s=e.labels,i=e.isDisabled;switch(o){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var o=e.context,n=e.focused,r=e.options,s=e.label,i=s===void 0?"":s,a=e.selectValue,l=e.isDisabled,c=e.isSelected,u=e.isAppleDevice,d=function(p,g){return p&&p.length?"".concat(p.indexOf(g)+1," of ").concat(p.length):""};if(o==="value"&&a)return"value ".concat(i," focused, ").concat(d(a,n),".");if(o==="menu"&&u){var f=l?" disabled":"",m="".concat(c?" selected":"").concat(f);return"".concat(i).concat(m,", ").concat(d(r,n),".")}return""},onFilter:function(e){var o=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(o?" for search term "+o:"",".")}},W5=function(e){var o=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,m=l.inputValue,h=l.isMulti,p=l.isOptionDisabled,g=l.isSearchable,b=l.menuIsOpen,v=l.options,x=l.screenReaderStatus,y=l.tabSelectsValue,C=l.isLoading,S=l["aria-label"],w=l["aria-live"],D=Zl(function(){return Ie(Ie({},G5),d||{})},[d]),_=Zl(function(){var T="";if(o&&D.onChange){var $=o.option,j=o.options,N=o.removedValue,P=o.removedValues,L=o.value,V=function(te){return Array.isArray(te)?null:te},M=N||$||V(L),O=M?f(M):"",B=j||P||void 0,G=B?B.map(f):[],X=Ie({isDisabled:M&&p(M,a),label:O,labels:G},o);T=D.onChange(X)}return T},[o,D,p,a,f]),A=Zl(function(){var T="",$=n||r,j=!!(n&&a&&a.includes(n));if($&&D.onFocus){var N={focused:$,label:f($),isDisabled:p($,a),isSelected:j,options:s,context:$===n?"menu":"value",selectValue:a,isAppleDevice:u};T=D.onFocus(N)}return T},[n,r,f,p,D,s,a,u]),F=Zl(function(){var T="";if(b&&v.length&&!C&&D.onFilter){var $=x({count:s.length});T=D.onFilter({inputValue:m,resultsMessage:$})}return T},[s,m,b,D,v,x,C]),R=o?.action==="initial-input-focus",I=Zl(function(){var T="";if(D.guidance){var $=r?"value":b?"menu":"input";T=D.guidance({"aria-label":S,context:$,isDisabled:n&&p(n,a),isMulti:h,isSearchable:g,tabSelectsValue:y,isInitialFocus:R})}return T},[S,n,r,h,p,g,b,D,a,y,R]),E=Fe(Uh,null,Fe("span",{id:"aria-selection"},_),Fe("span",{id:"aria-focused"},A),Fe("span",{id:"aria-results"},F),Fe("span",{id:"aria-guidance"},I));return Fe(Uh,null,Fe(Nw,{id:c},R&&E),Fe(Nw,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!R&&E))},H5=W5,Yh=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],z5=new RegExp("["+Yh.map(function(t){return t.letters}).join("")+"]","g"),Xw={};for(om=0;om<Yh.length;om++)for(rm=Yh[om],nm=0;nm<rm.letters.length;nm++)Xw[rm.letters[nm]]=rm.base;var rm,nm,om,Uw=function(e){return e.replace(z5,function(o){return Xw[o]})},X5=Pw(Uw),Lw=function(e){return e.replace(/^\s+|\s+$/g,"")},U5=function(e){return"".concat(e.label," ").concat(e.value)},Y5=function(e){return function(o,n){if(o.data.__isNew__)return!0;var r=Ie({ignoreCase:!0,ignoreAccents:!0,stringify:U5,trim:!0,matchFrom:"any"},e),s=r.ignoreCase,i=r.ignoreAccents,a=r.stringify,l=r.trim,c=r.matchFrom,u=l?Lw(n):n,d=l?Lw(a(o)):a(o);return s&&(u=u.toLowerCase(),d=d.toLowerCase()),i&&(u=X5(u),d=Uw(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},Z5=["innerRef"];function J5(t){var e=t.innerRef,o=Vo(t,Z5),n=QC(o,"onExited","in","enter","exit","appear");return Fe("input",Se({ref:e},n,{css:Xl({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var q5=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Q5(t){var e=t.isEnabled,o=t.onBottomArrive,n=t.onBottomLeave,r=t.onTopArrive,s=t.onTopLeave,i=ma(!1),a=ma(!1),l=ma(0),c=ma(null),u=rs(function(g,b){if(c.current!==null){var v=c.current,x=v.scrollTop,y=v.scrollHeight,C=v.clientHeight,S=c.current,w=b>0,D=y-C-x,_=!1;D>b&&i.current&&(n&&n(g),i.current=!1),w&&a.current&&(s&&s(g),a.current=!1),w&&b>D?(o&&!i.current&&o(g),S.scrollTop=y,_=!0,i.current=!0):!w&&-b>x&&(r&&!a.current&&r(g),S.scrollTop=0,_=!0,a.current=!0),_&&q5(g)}},[o,n,r,s]),d=rs(function(g){u(g,g.deltaY)},[u]),f=rs(function(g){l.current=g.changedTouches[0].clientY},[]),m=rs(function(g){var b=l.current-g.changedTouches[0].clientY;u(g,b)},[u]),h=rs(function(g){if(g){var b=JC?{passive:!1}:!1;g.addEventListener("wheel",d,b),g.addEventListener("touchstart",f,b),g.addEventListener("touchmove",m,b)}},[m,f,d]),p=rs(function(g){g&&(g.removeEventListener("wheel",d,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",m,!1))},[m,f,d]);return zw(function(){if(e){var g=c.current;return h(g),function(){p(g)}}},[e,h,p]),function(g){c.current=g}}var $w=["boxSizing","height","overflow","paddingRight","position"],kw={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function jw(t){t.cancelable&&t.preventDefault()}function Ow(t){t.stopPropagation()}function Mw(){var t=this.scrollTop,e=this.scrollHeight,o=t+this.offsetHeight;t===0?this.scrollTop=1:o===e&&(this.scrollTop=t-1)}function Bw(){return"ontouchstart"in window||navigator.maxTouchPoints}var Vw=!!(typeof window<"u"&&window.document&&window.document.createElement),Jl=0,da={capture:!1,passive:!1};function K5(t){var e=t.isEnabled,o=t.accountForScrollbars,n=o===void 0?!0:o,r=ma({}),s=ma(null),i=rs(function(l){if(Vw){var c=document.body,u=c&&c.style;if(n&&$w.forEach(function(h){var p=u&&u[h];r.current[h]=p}),n&&Jl<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,m=window.innerWidth-f+d||0;Object.keys(kw).forEach(function(h){var p=kw[h];u&&(u[h]=p)}),u&&(u.paddingRight="".concat(m,"px"))}c&&Bw()&&(c.addEventListener("touchmove",jw,da),l&&(l.addEventListener("touchstart",Mw,da),l.addEventListener("touchmove",Ow,da))),Jl+=1}},[n]),a=rs(function(l){if(Vw){var c=document.body,u=c&&c.style;Jl=Math.max(Jl-1,0),n&&Jl<1&&$w.forEach(function(d){var f=r.current[d];u&&(u[d]=f)}),c&&Bw()&&(c.removeEventListener("touchmove",jw,da),l&&(l.removeEventListener("touchstart",Mw,da),l.removeEventListener("touchmove",Ow,da)))}},[n]);return zw(function(){if(e){var l=s.current;return i(l),function(){a(l)}}},[e,i,a]),function(l){s.current=l}}var eN=function(e){var o=e.target;return o.ownerDocument.activeElement&&o.ownerDocument.activeElement.blur()},tN={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oN(t){var e=t.children,o=t.lockEnabled,n=t.captureEnabled,r=n===void 0?!0:n,s=t.onBottomArrive,i=t.onBottomLeave,a=t.onTopArrive,l=t.onTopLeave,c=Q5({isEnabled:r,onBottomArrive:s,onBottomLeave:i,onTopArrive:a,onTopLeave:l}),u=K5({isEnabled:o}),d=function(m){c(m),u(m)};return Fe(Uh,null,o&&Fe("div",{onClick:eN,css:tN}),e(d))}var rN={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},nN=function(e){var o=e.name,n=e.onFocus;return Fe("input",{required:!0,name:o,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:rN,value:"",onChange:function(){}})},sN=nN;function Zh(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function iN(){return Zh(/^iPhone/i)}function Yw(){return Zh(/^Mac/i)}function aN(){return Zh(/^iPad/i)||Yw()&&navigator.maxTouchPoints>1}function lN(){return iN()||aN()}function cN(){return Yw()||lN()}var uN=function(e){return e.label},Jh=function(e){return e.label},qh=function(e){return e.value},dN=function(e){return!!e.isDisabled},mN={clearIndicator:hw,container:lw,control:vw,dropdownIndicator:pw,group:xw,groupHeading:yw,indicatorsContainer:uw,indicatorSeparator:gw,input:Cw,loadingIndicator:bw,loadingMessage:iw,menu:ew,menuList:rw,menuPortal:aw,multiValue:Sw,multiValueLabel:Iw,multiValueRemove:Rw,noOptionsMessage:sw,option:Dw,placeholder:Fw,singleValue:Aw,valueContainer:cw};var fN={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},pN=4,Zw=4,hN=38,gN=Zw*2,bN={baseUnit:Zw,controlHeight:hN,menuGutter:gN},zh={borderRadius:pN,colors:fN,spacing:bN},vN={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Wh(),captureMenuScroll:!Wh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Y5(),formatGroupLabel:uN,getOptionLabel:Jh,getOptionValue:qh,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:dN,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!YC(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var o=e.count;return"".concat(o," result").concat(o!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Gw(t,e,o,n){var r=Qw(t,e,o),s=Kw(t,e,o),i=qw(t,e),a=im(t,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:i,value:a,index:n}}function sm(t,e){return t.options.map(function(o,n){if("options"in o){var r=o.options.map(function(i,a){return Gw(t,i,e,a)}).filter(function(i){return Hw(t,i)});return r.length>0?{type:"group",data:o,options:r,index:n}:void 0}var s=Gw(t,o,e,n);return Hw(t,s)?s:void 0}).filter(qC)}function Jw(t){return t.reduce(function(e,o){return o.type==="group"?e.push.apply(e,ts(o.options.map(function(n){return n.data}))):e.push(o.data),e},[])}function Ww(t,e){return t.reduce(function(o,n){return n.type==="group"?o.push.apply(o,ts(n.options.map(function(r){return{data:r.data,id:"".concat(e,"-").concat(n.index,"-").concat(r.index)}}))):o.push({data:n.data,id:"".concat(e,"-").concat(n.index)}),o},[])}function xN(t,e){return Jw(sm(t,e))}function Hw(t,e){var o=t.inputValue,n=o===void 0?"":o,r=e.data,s=e.isSelected,i=e.label,a=e.value;return(!t2(t)||!s)&&e2(t,{label:i,value:a,data:r},n)}function yN(t,e){var o=t.focusedValue,n=t.selectValue,r=n.indexOf(o);if(r>-1){var s=e.indexOf(o);if(s>-1)return o;if(r<e.length)return e[r]}return null}function CN(t,e){var o=t.focusedOption;return o&&e.indexOf(o)>-1?o:e[0]}var Xh=function(e,o){var n,r=(n=e.find(function(s){return s.data===o}))===null||n===void 0?void 0:n.id;return r||null},qw=function(e,o){return e.getOptionLabel(o)},im=function(e,o){return e.getOptionValue(o)};function Qw(t,e,o){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,o):!1}function Kw(t,e,o){if(o.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,o);var n=im(t,e);return o.some(function(r){return im(t,r)===n})}function e2(t,e,o){return t.filterOption?t.filterOption(e,o):!0}var t2=function(e){var o=e.hideSelectedOptions,n=e.isMulti;return o===void 0?n:o},wN=1,ql=function(t){zy(o,t);var e=Uy(o);function o(n){var r;if(Gy(this,o),r=e.call(this,n),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=cN(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,c){var u=r.props,d=u.onChange,f=u.name;c.name=f,r.ariaOnChange(l,c),d(l,c)},r.setValue=function(l,c,u){var d=r.props,f=d.closeMenuOnSelect,m=d.isMulti,h=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:h}),f&&(r.setState({inputIsHiddenAfterUpdate:!m}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:c,option:u})},r.selectOption=function(l){var c=r.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,m=r.state.selectValue,h=d&&r.isOptionSelected(l,m),p=r.isOptionDisabled(l,m);if(h){var g=r.getOptionValue(l);r.setValue(m.filter(function(b){return r.getOptionValue(b)!==g}),"deselect-option",l)}else if(!p)d?r.setValue([].concat(ts(m),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}u&&r.blurInput()},r.removeValue=function(l){var c=r.props.isMulti,u=r.state.selectValue,d=r.getOptionValue(l),f=u.filter(function(h){return r.getOptionValue(h)!==d}),m=Ks(c,f,f[0]||null);r.onChange(m,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(Ks(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,c=r.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=Ks(l,d,d[0]||null);u&&r.onChange(f,{action:"pop-value",removedValue:u})},r.getFocusedOptionId=function(l){return Xh(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return Ww(sm(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return zC.apply(void 0,[r.props.classNamePrefix].concat(c))},r.getOptionLabel=function(l){return qw(r.props,l)},r.getOptionValue=function(l){return im(r.props,l)},r.getStyles=function(l,c){var u=r.props.unstyled,d=mN[l](c,u);d.boxSizing="border-box";var f=r.props.styles[l];return f?f(d,c):d},r.getClassNames=function(l,c){var u,d;return(u=(d=r.props.classNames)[l])===null||u===void 0?void 0:u.call(d,c)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return Tw(r.props)},r.buildCategorizedOptions=function(){return sm(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Jw(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,c){r.setState({ariaSelection:Ie({value:l},c)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var c=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():c&&r.openMenu("first"):(c&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var c=r.props,u=c.isMulti,d=c.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!u}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Yl(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var c=l.touches,u=c&&c.item(0);u&&(r.initialTouchX=u.clientX,r.initialTouchY=u.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var c=l.touches,u=c&&c.item(0);if(u){var d=Math.abs(u.clientX-r.initialTouchX),f=Math.abs(u.clientY-r.initialTouchY),m=5;r.userIsDragging=d>m||f>m}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var c=r.props.inputValue,u=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(u,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var c=r.getFocusableOptions(),u=c.indexOf(l);r.setState({focusedOption:l,focusedOptionId:u>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return t2(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var c=r.props,u=c.isMulti,d=c.backspaceRemovesValue,f=c.escapeClearsValue,m=c.inputValue,h=c.isClearable,p=c.isDisabled,g=c.menuIsOpen,b=c.onKeyDown,v=c.tabSelectsValue,x=c.openMenuOnFocus,y=r.state,C=y.focusedOption,S=y.focusedValue,w=y.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!u||m)return;r.focusValue("previous");break;case"ArrowRight":if(!u||m)return;r.focusValue("next");break;case"Delete":case"Backspace":if(m)return;if(S)r.removeValue(S);else{if(!d)return;u?r.popValue():h&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!g||!v||!C||x&&r.isOptionSelected(C,w))return;r.selectOption(C);break;case"Enter":if(l.keyCode===229)break;if(g){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":g?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:m}),r.onMenuClose()):h&&f&&r.clearValue();break;case" ":if(m)return;if(!g){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":g?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":g?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!g)return;r.focusOption("pageup");break;case"PageDown":if(!g)return;r.focusOption("pagedown");break;case"Home":if(!g)return;r.focusOption("first");break;case"End":if(!g)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++wN),r.state.selectValue=ua(n.value),n.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),a=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=i[a],r.state.focusedOptionId=Xh(s,i[a])}return r}return Hy(o,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Gh(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var s=this.props,i=s.isDisabled,a=s.menuIsOpen,l=this.state.isFocused;(l&&!i&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Gh(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,s){this.props.onInputChange(r,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var s=this,i=this.state,a=i.selectValue,l=i.isFocused,c=this.buildFocusableOptions(),u=r==="first"?0:c.length-1;if(!this.props.isMulti){var d=c.indexOf(a[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[u],focusedOptionId:this.getFocusedOptionId(c[u])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(r){var s=this.state,i=s.selectValue,a=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var c=i.length-1,u=-1;if(i.length){switch(r){case"previous":l===0?u=0:l===-1?u=c:u=l-1;break;case"next":l>-1&&l<c&&(u=l+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:i[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(i);i||(c=-1),r==="up"?l=c>0?c-1:a.length-1:r==="down"?l=(c+1)%a.length:r==="pageup"?(l=c-s,l<0&&(l=0)):r==="pagedown"?(l=c+s,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(zh):Ie(Ie({},zh),this.props.theme):zh}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,u=this.setValue,d=this.props,f=d.isMulti,m=d.isRtl,h=d.options,p=this.hasValue();return{clearValue:r,cx:s,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:f,isRtl:m,options:h,selectOption:c,selectProps:d,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,s=r.isClearable,i=r.isMulti;return s===void 0?i:s}},{key:"isOptionDisabled",value:function(r,s){return Qw(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return Kw(this.props,r,s)}},{key:"filterOption",value:function(r,s){return e2(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:i,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,s=r.isDisabled,i=r.isSearchable,a=r.inputId,l=r.inputValue,c=r.tabIndex,u=r.form,d=r.menuIsOpen,f=r.required,m=this.getComponents(),h=m.Input,p=this.state,g=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,x=a||this.getElementId("input"),y=Ie(Ie(Ie({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?ut.createElement(h,Se({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:s,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:u,type:"text",value:l},y)):ut.createElement(J5,Se({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ul,onFocus:this.onInputFocus,disabled:s,tabIndex:c,inputMode:"none",form:u,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),i=s.MultiValue,a=s.MultiValueContainer,l=s.MultiValueLabel,c=s.MultiValueRemove,u=s.SingleValue,d=s.Placeholder,f=this.commonProps,m=this.props,h=m.controlShouldRenderValue,p=m.isDisabled,g=m.isMulti,b=m.inputValue,v=m.placeholder,x=this.state,y=x.selectValue,C=x.focusedValue,S=x.isFocused;if(!this.hasValue()||!h)return b?null:ut.createElement(d,Se({},f,{key:"placeholder",isDisabled:p,isFocused:S,innerProps:{id:this.getElementId("placeholder")}}),v);if(g)return y.map(function(D,_){var A=D===C,F="".concat(r.getOptionLabel(D),"-").concat(r.getOptionValue(D));return ut.createElement(i,Se({},f,{components:{Container:a,Label:l,Remove:c},isFocused:A,isDisabled:p,key:F,index:_,removeProps:{onClick:function(){return r.removeValue(D)},onTouchEnd:function(){return r.removeValue(D)},onMouseDown:function(I){I.preventDefault()}},data:D}),r.formatOptionLabel(D,"value"))});if(b)return null;var w=y[0];return ut.createElement(u,Se({},f,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!this.isClearable()||!s||l||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return ut.createElement(s,Se({},i,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!s||!c)return null;var d={"aria-hidden":"true"};return ut.createElement(s,Se({},i,{innerProps:d,isDisabled:l,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,i=r.IndicatorSeparator;if(!s||!i)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return ut.createElement(i,Se({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return ut.createElement(s,Se({},i,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),i=s.Group,a=s.GroupHeading,l=s.Menu,c=s.MenuList,u=s.MenuPortal,d=s.LoadingMessage,f=s.NoOptionsMessage,m=s.Option,h=this.commonProps,p=this.state.focusedOption,g=this.props,b=g.captureMenuScroll,v=g.inputValue,x=g.isLoading,y=g.loadingMessage,C=g.minMenuHeight,S=g.maxMenuHeight,w=g.menuIsOpen,D=g.menuPlacement,_=g.menuPosition,A=g.menuPortalTarget,F=g.menuShouldBlockScroll,R=g.menuShouldScrollIntoView,I=g.noOptionsMessage,E=g.onMenuScrollToTop,T=g.onMenuScrollToBottom;if(!w)return null;var $=function(O,B){var G=O.type,X=O.data,Z=O.isDisabled,te=O.isSelected,U=O.label,z=O.value,le=p===X,J=Z?void 0:function(){return r.onOptionHover(X)},ce=Z?void 0:function(){return r.selectOption(X)},re="".concat(r.getElementId("option"),"-").concat(B),q={id:re,onClick:ce,onMouseMove:J,onMouseOver:J,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:te};return ut.createElement(m,Se({},h,{innerProps:q,data:X,isDisabled:Z,isSelected:te,key:re,label:U,type:G,value:z,isFocused:le,innerRef:le?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(O.data,"menu"))},j;if(this.hasOptions())j=this.getCategorizedOptions().map(function(M){if(M.type==="group"){var O=M.data,B=M.options,G=M.index,X="".concat(r.getElementId("group"),"-").concat(G),Z="".concat(X,"-heading");return ut.createElement(i,Se({},h,{key:X,data:O,options:B,Heading:a,headingProps:{id:Z,data:M.data},label:r.formatGroupLabel(M.data)}),M.options.map(function(te){return $(te,"".concat(G,"-").concat(te.index))}))}else if(M.type==="option")return $(M,"".concat(M.index))});else if(x){var N=y({inputValue:v});if(N===null)return null;j=ut.createElement(d,h,N)}else{var P=I({inputValue:v});if(P===null)return null;j=ut.createElement(f,h,P)}var L={minMenuHeight:C,maxMenuHeight:S,menuPlacement:D,menuPosition:_,menuShouldScrollIntoView:R},V=ut.createElement(ow,Se({},h,L),function(M){var O=M.ref,B=M.placerProps,G=B.placement,X=B.maxHeight;return ut.createElement(l,Se({},h,L,{innerRef:O,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:x,placement:G}),ut.createElement(oN,{captureEnabled:b,onTopArrive:E,onBottomArrive:T,lockEnabled:F},function(Z){return ut.createElement(c,Se({},h,{innerRef:function(U){r.getMenuListRef(U),Z(U)},innerProps:{role:"listbox","aria-multiselectable":h.isMulti,id:r.getElementId("listbox")},isLoading:x,maxHeight:X,focusedOption:p}),j)}))});return A||_==="fixed"?ut.createElement(u,Se({},h,{appendTo:A,controlElement:this.controlRef,menuPlacement:D,menuPosition:_}),V):V}},{key:"renderFormField",value:function(){var r=this,s=this.props,i=s.delimiter,a=s.isDisabled,l=s.isMulti,c=s.name,u=s.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!a)return ut.createElement(sN,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(i){var f=d.map(function(p){return r.getOptionValue(p)}).join(i);return ut.createElement("input",{name:c,type:"hidden",value:f})}else{var m=d.length>0?d.map(function(p,g){return ut.createElement("input",{key:"i-".concat(g),name:c,type:"hidden",value:r.getOptionValue(p)})}):ut.createElement("input",{name:c,type:"hidden",value:""});return ut.createElement("div",null,m)}else{var h=d[0]?this.getOptionValue(d[0]):"";return ut.createElement("input",{name:c,type:"hidden",value:h})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,i=s.ariaSelection,a=s.focusedOption,l=s.focusedValue,c=s.isFocused,u=s.selectValue,d=this.getFocusableOptions();return ut.createElement(H5,Se({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:c,selectValue:u,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,i=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,c=this.props,u=c.className,d=c.id,f=c.isDisabled,m=c.menuIsOpen,h=this.state.isFocused,p=this.commonProps=this.getCommonProps();return ut.createElement(a,Se({},p,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:h}),this.renderLiveRegion(),ut.createElement(s,Se({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:h,menuIsOpen:m}),ut.createElement(l,Se({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),ut.createElement(i,Se({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,s){var i=s.prevProps,a=s.clearFocusValueOnUpdate,l=s.inputIsHiddenAfterUpdate,c=s.ariaSelection,u=s.isFocused,d=s.prevWasFocused,f=s.instancePrefix,m=r.options,h=r.value,p=r.menuIsOpen,g=r.inputValue,b=r.isMulti,v=ua(h),x={};if(i&&(h!==i.value||m!==i.options||p!==i.menuIsOpen||g!==i.inputValue)){var y=p?xN(r,v):[],C=p?Ww(sm(r,v),"".concat(f,"-option")):[],S=a?yN(s,v):null,w=CN(s,y),D=Xh(C,w);x={selectValue:v,focusedOption:w,focusedOptionId:D,focusableOptionsWithIds:C,focusedValue:S,clearFocusValueOnUpdate:!1}}var _=l!=null&&r!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},A=c,F=u&&d;return u&&!F&&(A={value:Ks(b,v,v[0]||null),options:v,action:"initial-input-focus"},F=!d),c?.action==="initial-input-focus"&&(A=null),Ie(Ie(Ie({},x),_),{},{prevProps:r,ariaSelection:A,prevWasFocused:F})}}]),o}(M5);ql.defaultProps=vN;import"react-dom";var IN=SN(function(t,e){var o=Ad(t);return o2.createElement(ql,Se({ref:e},o))}),r2=IN;import*as a2 from"react";import{forwardRef as DN}from"react";import{useMemo as n2,useCallback as RN}from"react";var _N=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],s2=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),s=String(n.getOptionValue(o)).toLowerCase(),i=String(n.getOptionLabel(o)).toLowerCase();return s===r||i===r},Qh={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,o,n,r){return!(!e||o.some(function(s){return s2(e,s,r)})||n.some(function(s){return s2(e,s,r)}))},getNewOptionData:function(e,o){return{label:o,value:e,__isNew__:!0}}};function i2(t){var e=t.allowCreateWhileLoading,o=e===void 0?!1:e,n=t.createOptionPosition,r=n===void 0?"last":n,s=t.formatCreateLabel,i=s===void 0?Qh.formatCreateLabel:s,a=t.isValidNewOption,l=a===void 0?Qh.isValidNewOption:a,c=t.getNewOptionData,u=c===void 0?Qh.getNewOptionData:c,d=t.onCreateOption,f=t.options,m=f===void 0?[]:f,h=t.onChange,p=Vo(t,_N),g=p.getOptionValue,b=g===void 0?qh:g,v=p.getOptionLabel,x=v===void 0?Jh:v,y=p.inputValue,C=p.isLoading,S=p.isMulti,w=p.value,D=p.name,_=n2(function(){return l(y,ua(w),m,{getOptionValue:b,getOptionLabel:x})?u(y,i(y)):void 0},[i,u,x,b,y,l,m,w]),A=n2(function(){return(o||!C)&&_?r==="first"?[_].concat(ts(m)):[].concat(ts(m),[_]):m},[o,r,C,_,m]),F=RN(function(R,I){if(I.action!=="select-option")return h(R,I);var E=Array.isArray(R)?R:[R];if(E[E.length-1]===_){if(d)d(y);else{var T=u(y,y),$={action:"create-option",name:D,option:T};h(Ks(S,[].concat(ts(ua(w)),[T]),T),$)}return}h(R,I)},[u,y,S,D,_,d,h,w]);return Ie(Ie({},p),{},{options:A,onChange:F})}import"react-dom";var FN=DN(function(t,e){var o=Ad(t),n=i2(o);return a2.createElement(ql,Se({ref:e},n))}),l2=FN;import{jsx as c2}from"react/jsx-runtime";import"react";var u2="clear-indicator",Kh=t=>{let{clearValue:e,innerProps:{ref:o,...n}}=t;return c2("div",{className:u2,ref:typeof o=="string"?null:o,...n,onKeyDown:r=>{r.key==="Enter"&&(e(),r.stopPropagation())},role:"button",tabIndex:0,children:c2(pt,{className:`${u2}__icon`})})};import{jsx as d2}from"react/jsx-runtime";import AN from"react";var eg=t=>{let{children:e,innerProps:o,selectProps:{customProps:{disableKeyDown:n,disableMouseDown:r}={}}={}}=t;return d2(AN.Fragment,{children:d2(co.Control,{...t,innerProps:{...o,onKeyDown:s=>{if(n){s.stopPropagation();let i=new CustomEvent("bypassKeyDown",{detail:s});document.dispatchEvent(i)}},onMouseDown:s=>{r||o.onMouseDown(s)}},children:e})})};import{jsx as m2}from"react/jsx-runtime";import"react";var f2="dropdown-indicator",tg=t=>{let{innerProps:{ref:e,...o}}=t;return m2("button",{className:f2,ref:e,...o,onKeyDown:n=>{n.key==="Enter"&&(n.key=" ")},type:"button",children:m2(Ze,{className:`${f2}__icon`})})};import{jsx as p2}from"react/jsx-runtime";import TN from"react";var og=t=>p2(TN.Fragment,{children:p2(co.Input,{...t,"aria-activedescendant":void 0})});import{c as EN}from"react/compiler-runtime";import{jsx as h2}from"react/jsx-runtime";import PN from"react";var g2="multi-value";function rg(t,e){return typeof e=="function"?e(t):t.value}var ng=t=>{let e=EN(26),{className:o,data:n,innerProps:r,isDisabled:s,selectProps:i}=t,a;e[0]!==i?(a=i===void 0?{}:i,e[0]=i,e[1]=a):a=e[1];let{customProps:l,getOptionValue:c,isSortable:u}=a,d;e[2]!==l?(d=l===void 0?{}:l,e[2]=l,e[3]=d):d=e[3];let{disableMouseDown:f}=d,m;e[4]!==n||e[5]!==c?(m=rg(n,c),e[4]=n,e[5]=c,e[6]=m):m=e[6];let h=!u,p;e[7]!==m||e[8]!==h?(p={id:m,disabled:h},e[7]=m,e[8]=h,e[9]=p):p=e[9];let{attributes:g,isDragging:b,listeners:v,setNodeRef:x,transform:y}=Oi(p),C=!s&&u&&"draggable",S=b&&`${g2}--is-dragging`,w;e[10]!==o||e[11]!==C||e[12]!==S?(w=[g2,o,C,S].filter(Boolean),e[10]=o,e[11]=C,e[12]=S,e[13]=w):w=e[13];let D=w.join(" "),_;if(e[14]!==g||e[15]!==D||e[16]!==f||e[17]!==r||e[18]!==u||e[19]!==v||e[20]!==t||e[21]!==x||e[22]!==y){let A;e[24]!==f?(A=F=>{f||F.stopPropagation()},e[24]=f,e[25]=A):A=e[25],_=h2(PN.Fragment,{children:h2(co.MultiValue,{...t,className:D,innerProps:{...u?{...g,...v}:{},...r,onMouseDown:A,ref:x,style:u?{transform:y,...g?.style}:{}}})}),e[14]=g,e[15]=D,e[16]=f,e[17]=r,e[18]=u,e[19]=v,e[20]=t,e[21]=x,e[22]=y,e[23]=_}else _=e[23];return _};import{jsx as b2}from"react/jsx-runtime";import"react";var v2="multi-value-label",sg=t=>{let{data:e,selectProps:{customProps:{draggableProps:o,editableProps:n}={}}={}}=t,r=`${v2}__text`;return b2("div",{className:v2,children:b2(co.MultiValueLabel,{...t,innerProps:{className:r,...n&&n(e,r,t.selectProps)||{},...o||{}}})})};import{c as NN}from"react/compiler-runtime";import{jsx as x2,jsxs as LN}from"react/jsx-runtime";import $N from"react";var ig="multi-value-remove",ag=t=>{let e=NN(12),{innerProps:o}=t,{className:n,onClick:r,onTouchEnd:s}=o,[i,a]=$N.useState(!1),{t:l}=k(),c;if(e[0]!==n||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==l){let u=l("general:remove"),d;e[6]!==n?(d=[ig,n].filter(Boolean),e[6]=n,e[7]=d):d=e[7];let f;e[8]!==r?(f=p=>{a(!1),r(p)},e[8]=r,e[9]=f):f=e[9];let m,h;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),h=()=>a(!1),e[10]=m,e[11]=h):(m=e[10],h=e[11]),c=LN("button",{"aria-label":u,className:d.join(" "),onClick:f,onKeyDown:kN,onMouseDown:jN,onMouseEnter:m,onMouseLeave:h,onTouchEnd:s,type:"button",children:[x2(go,{className:`${ig}__tooltip`,show:i,children:l("general:remove")}),x2(pt,{className:`${ig}__icon`})]}),e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=l,e[5]=c}else c=e[5];return c};function kN(t){t.key==="Enter"&&t.stopPropagation()}function jN(t){return t.stopPropagation()}import{jsx as y2}from"react/jsx-runtime";import ON from"react";var MN="react-select--single-value",lg=t=>{let{children:e,className:o}=t;return y2(ON.Fragment,{children:y2(co.SingleValue,{...t,className:[MN,o].filter(Boolean).join(" "),children:e})})};import{jsx as C2}from"react/jsx-runtime";import"react";var BN="value-container",cg=t=>{let{selectProps:{customProps:e}={}}=t;return C2("div",{className:BN,ref:e?.droppableRef,children:C2(co.ValueContainer,{...t})})};var WN=t=>({label:t,value:t}),I2=t=>{let{i18n:e,t:o}=k(),[n,r]=S2.useState(""),s=GN(),[i,a]=S2.useState(!1);VN(()=>{a(!0)},[]);let{className:l,components:c,customProps:u,disabled:d=!1,filterOption:f=void 0,getOptionValue:m,isClearable:h=!0,isCreatable:p,isLoading:g,isSearchable:b=!0,noOptionsMessage:v=()=>o("general:noOptions"),numberOnly:x=!1,onChange:y,onMenuClose:C,onMenuOpen:S,options:w,placeholder:D=o("general:selectValue"),showError:_,value:A}=t,F=()=>o("general:loading")+"...",R=[l,"react-select",_&&"react-select--error"].filter(Boolean).join(" "),I={menu:T=>({...T,zIndex:void 0})};if(!i)return ei(St,{height:"calc(var(--base) * 2 + 2px)"});if(!p)return ei(r2,{captureMenuScroll:!0,customProps:u,isLoading:g,placeholder:w2(D,e),...t,className:R,classNamePrefix:"rs",components:{ClearIndicator:Kh,Control:eg,DropdownIndicator:tg,Input:og,MultiValue:ng,MultiValueLabel:sg,MultiValueRemove:ag,SingleValue:lg,ValueContainer:cg,...c},filterOption:f,getOptionValue:m,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:F,menuPlacement:"auto",noOptionsMessage:v,onChange:y,onMenuClose:C,onMenuOpen:S,options:w,styles:I,unstyled:!0,value:A});let E=T=>{if(x===!0){let $=["Tab","Escape","Backspace","Enter","ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],j=!/\D/.test(T.key),N=$.includes(T.key);if(!j&&!N){T.preventDefault();return}}if(!(!A||!n||n.trim()==="")&&!(f&&!f(null,n)))switch(T.key){case"Enter":case"Tab":y([...A,WN(n)]),r(""),T.preventDefault();break;default:break}};return ei(l2,{captureMenuScroll:!0,isLoading:g,placeholder:w2(D,e),...t,className:R,classNamePrefix:"rs",components:{ClearIndicator:Kh,Control:eg,DropdownIndicator:tg,Input:og,MultiValue:ng,MultiValueLabel:sg,MultiValueRemove:ag,SingleValue:lg,ValueContainer:cg,...c},filterOption:f,inputValue:n,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:F,menuPlacement:"auto",noOptionsMessage:v,onChange:y,onInputChange:T=>r(T),onKeyDown:E,onMenuClose:C,onMenuOpen:S,options:w,styles:I,unstyled:!0,value:A})},HN=t=>{let{getOptionValue:e,onChange:o,value:n}=t,r=[];return n&&(r=(Array.isArray(n)?n:[n]).map(s=>rg(s,e))),ei(cr,{className:"react-select-container",ids:r,onDragEnd:({moveFromIndex:s,moveToIndex:i})=>{let a=n;n&&Array.isArray(n)&&(a=zu(n,s,i)),o(a)},children:ei(I2,{...t})})},mt=t=>{let{isMulti:e,isSortable:o}=t;return e&&o?ei(HN,{...t}):ei(I2,{...t})};var Ql=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e});var Kl=t=>{let{id:e,onChange:o,options:n,required:r,selectedTimezone:s}=t,{t:i}=k(),a=Ql(n),l=XN(()=>a.find(c=>(typeof c=="string"?c:c.value)===(s||"UTC")),[a,s]);return zN("div",{className:"timezone-picker-wrapper",children:[R2(ve,{htmlFor:e,label:`${i("general:timezone")} ${r?"*":""}`,required:r,unstyled:!0}),R2(mt,{className:"timezone-picker",inputId:e,isClearable:!0,isCreatable:!1,onChange:c=>{o&&o(c?.value||"")},options:a,value:l})]})};var F2="date-time-field",YN=t=>{let{field:e,field:{admin:{className:o,date:n,description:r,placeholder:s}={},label:i,localized:a,required:l,timezone:c},path:u,readOnly:d,validate:f}=t,m=n?.pickerAppearance||"default",h=Intl.DateTimeFormat().resolvedOptions().timeZone,{config:p}=H(),{i18n:g}=k(),{dispatchFields:b,setModified:v}=Oe(),x=ug((O,B)=>{if(typeof f=="function")return f(O,{...B,required:l})},[f,l]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:D}={},disabled:_,path:A,setValue:F,showError:R,value:I}=Te({potentiallyStalePath:u,validate:x}),E=A+"_tz",T=Et(([O,B])=>O?.[E]),$=p.admin.timezones.supportedTimezones,j=["dayOnly","default","monthOnly"].includes(m),N=T?.value,P=D2(()=>{if(c&&N&&h&&I){let O=Mt.tz(N),B=Mt.tz(h),G=new Mt(I).withTimeZone(N),X=Fr(G,O);return Fr(X,B).toISOString()}return I},[c,N,I,h]),L=D2(()=>rt(e),[e]),V=ug(O=>{if(!(d||_))if(c&&N&&O){let B=Mt.tz(N);if(j){let G=O.getTimezoneOffset()/60,X=O.getHours()+G;O.setHours(X);let Z=Fr(O,B);F(Z.toISOString()||null)}else{let G=new Mt(O),X=Fr(G,B);F(X.toISOString()||null)}}else F(O?.toISOString()||null)},[d,_,c,N,j,F]),M=ug(O=>{E&&(b({type:"UPDATE",path:E,value:O}),v(!0))},[b,v,E]);return _2("div",{className:[ye,F2,o,R&&`${F2}--has-error`,(d||_)&&"read-only"].filter(Boolean).join(" "),style:L,children:[ns(oe,{CustomComponent:D,Fallback:ns(ve,{label:i,localized:a,required:l})}),_2("div",{className:`${ye}__wrap`,id:`field-${A.replace(/\./g,"__")}`,children:[ns(oe,{CustomComponent:w,Fallback:ns(He,{path:A,showError:R})}),C,ns(Qi,{...n,onChange:V,overrides:{...n?.overrides},placeholder:UN(s,g),readOnly:d||_,value:P}),c&&$.length>0&&ns(Kl,{id:`${A}-timezone-picker`,onChange:M,options:$,required:l,selectedTimezone:N}),y]}),ns(oe,{CustomComponent:S,Fallback:ns(Be,{description:r,path:A})})]})},ec=je(YN);import{jsx as ti,jsxs as A2}from"react/jsx-runtime";import{getTranslation as ZN}from"@payloadcms/translations";import{useCallback as JN,useMemo as qN}from"react";var QN=t=>{let{field:e,field:{admin:{autoComplete:o,className:n,description:r,placeholder:s}={},label:i,localized:a,required:l}={},path:c,readOnly:u,validate:d}=t,{i18n:f}=k(),m=JN((_,A)=>{if(typeof d=="function")return d(_,{...A,required:l})},[d,l]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},disabled:x,path:y,setValue:C,showError:S,value:w}=Te({potentiallyStalePath:c,validate:m}),D=qN(()=>rt(e),[e]);return A2("div",{className:[ye,"email",n,S&&"error",(u||x)&&"read-only"].filter(Boolean).join(" "),style:D,children:[ti(oe,{CustomComponent:v,Fallback:ti(ve,{label:i,localized:a,path:y,required:l})}),A2("div",{className:`${ye}__wrap`,children:[ti(oe,{CustomComponent:b,Fallback:ti(He,{path:y,showError:S})}),p,ti("input",{autoComplete:o,disabled:u||x,id:`field-${y.replace(/\./g,"__")}`,name:y,onChange:C,placeholder:ZN(s,f),required:l,type:"email",value:w||""}),h]}),ti(oe,{CustomComponent:g,Fallback:ti(Be,{description:r,path:y})})]})},oi=je(QN);import{jsx as ss,jsxs as am}from"react/jsx-runtime";import{getTranslation as l9}from"@payloadcms/translations";import{useMemo as c9}from"react";import{jsx as KN}from"react/jsx-runtime";import{createContext as e9,use as t9}from"react";var T2=e9(!1),E2=({children:t,withinRow:e=!0})=>KN(T2,{value:e,children:t}),P2=()=>t9(T2);import{jsx as o9}from"react/jsx-runtime";import{createContext as r9,use as n9}from"react";var N2=r9(!1),dg=({children:t,withinTab:e=!0})=>o9(N2,{value:e,children:t}),L2=()=>n9(N2);import{jsx as s9}from"react/jsx-runtime";import{createContext as i9,use as a9}from"react";var $2=i9(!1),k2=({children:t,withinGroup:e=!0})=>s9($2,{value:e,children:t}),j2=()=>a9($2);var $r="group-field",u9=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,hideGutter:s}={},fields:i,label:a},path:l,permissions:c,readOnly:u,schemaPath:d}=t,f=d??o,{i18n:m}=k(),{isWithinCollapsible:h}=qn(),p=j2(),g=P2(),b=L2(),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Label:C}={},errorPaths:S}=Te({path:l}),w=Xt(),D=S.length,_=w&&D>0,A=!(h||p||g),F=c9(()=>rt(e),[e]);return am("div",{className:[ye,$r,A&&`${$r}--top-level`,h&&`${$r}--within-collapsible`,p&&`${$r}--within-group`,g&&`${$r}--within-row`,b&&`${$r}--within-tab`,!s&&p&&`${$r}--gutter`,_&&`${$r}--has-error`,n].filter(Boolean).join(" "),id:`field-${l?.replace(/\./g,"__")}`,style:F,children:[ss(k2,{children:am("div",{className:`${$r}__wrap`,children:[!!(C||y||a||_)&&am("div",{className:`${$r}__header`,children:[!!(C||y||a)&&am("header",{children:[ss(oe,{CustomComponent:C,Fallback:ss("h3",{className:`${$r}__title`,children:ss(ve,{as:"span",label:l9(a,m),localized:!1,path:l,required:!1})})}),ss(oe,{CustomComponent:y,Fallback:ss(Be,{description:r,path:l})})]}),_&&ss(io,{count:D,i18n:m,withMessage:!0})]}),x,ss(So,{fields:i,margins:"small",parentIndexPath:"",parentPath:l,parentSchemaPath:f,permissions:c===!0?c:c?.fields,readOnly:u})]})}),v]})};var tc=je(u9);import{c as d9}from"react/compiler-runtime";import{jsx as m9}from"react/jsx-runtime";import{useEffect as f9}from"react";var p9=t=>{let e=d9(12),{disableModifyingForm:o,path:n,value:r}=t,s=o===void 0?!0:o,i;e[0]!==n?(i={potentiallyStalePath:n},e[0]=n,e[1]=i):i=e[1];let{path:a,setValue:l,value:c}=Te(i),u,d;e[2]!==s||e[3]!==l||e[4]!==r?(u=()=>{r!==void 0&&l(r,s)},d=[r,l,s],e[2]=s,e[3]=l,e[4]=r,e[5]=u,e[6]=d):(u=e[5],d=e[6]),f9(u,d);let f=`field-${a?.replace(/\./g,"__")}`,m=c||"",h;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==m?(h=m9("input",{id:f,name:a,onChange:l,type:"hidden",value:m}),e[7]=a,e[8]=l,e[9]=f,e[10]=m,e[11]=h):h=e[11],h},oc=je(p9);var Mg=Ds(fg(),1);import{jsx as si,jsxs as c$}from"react/jsx-runtime";import{flattenTopLevelFields as u$}from"payload/shared";import{useMemo as H3}from"react";import{jsx as to,jsxs as ni}from"react/jsx-runtime";import{getTranslation as kg}from"@payloadcms/translations";import{hoistQueryParamsToAnd as l$,transformColumnsToPreferences as G3}from"payload/shared";import{Fragment as W3,useCallback as Sm,useEffect as jg,useState as Rn}from"react";import{c as v9}from"react/compiler-runtime";import{useInsertionEffect as x9,useRef as y9}from"react";function eo(t){let e=v9(4),o=y9(t),n,r;e[0]!==t?(n=()=>{o.current=t},r=[t],e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),x9(n,r);let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(...i)=>{let a=i,l=o.current;return l(...a)},e[3]=s):s=e[3],s}import{jsx as Y2}from"react/jsx-runtime";import{useRouter as R9,useSearchParams as _9}from"next/navigation.js";import{isNumber as D9,transformColumnsToSearchParams as F9}from"payload/shared";import*as gg from"qs-esm";import A9,{useCallback as nc,useEffect as T9,useMemo as E9,useRef as P9,useState as Z2}from"react";import{jsx as C9}from"react/jsx-runtime";import{createContext as w9,use as S9}from"react";var H2=w9({}),pg=({children:t,...e})=>C9(H2,{value:{isInDrawer:!!e.drawerSlug,...e},children:t}),en=()=>{let t=S9(H2);if(!t)throw new Error("useListDrawerContext must be used within a ListDrawerContextProvider");return t};import*as z2 from"qs-esm";function kr(t){let e=t.toString();return z2.parse(e,{depth:10,ignoreQueryPrefix:!0})}import{createContext as X2,use as I9}from"react";var hg=X2({}),Rt=()=>I9(hg),U2=X2(!1);var bg=({children:t,collectionSlug:e,columns:o,data:n,defaultLimit:r,defaultSort:s,listPreferences:i,modifySearchParams:a,onQueryChange:l,orderableFieldName:c})=>{"use no memo";let u=R9(),d=_9(),{startRouteTransition:f}=st(),[m,h]=Z2(!1),p=E9(()=>kr(d),[d]),g=P9({});g.current.modified=m;let{onQueryChange:b}=en(),[v,x]=Z2(()=>a?p:{limit:String(r),sort:s}),y=nc(async(F,R)=>{h(R!==void 0?R:!0);let I="page"in F?F.page:v?.page;("where"in F||"search"in F)&&(I="1");let E={columns:"columns"in F?F.columns:v.columns,limit:"limit"in F?F.limit:v?.limit??String(r),page:I,preset:"preset"in F?F.preset:v?.preset,search:"search"in F?F.search:v?.search,sort:"sort"in F?F.sort:v?.sort??s,where:"where"in F?F.where:v?.where};a?f(()=>u.replace(`${gg.stringify({...E,columns:JSON.stringify(E.columns)},{addQueryPrefix:!0})}`)):(typeof b=="function"||typeof l=="function")&&(b||l)(E),x(E)},[v?.columns,v?.limit,v?.page,v?.search,v?.sort,v?.where,v?.preset,f,r,s,a,b,l,u]),C=nc(async F=>{await y({page:String(F)})},[y]),S=A9.useCallback(async F=>{await y({limit:String(F),page:"1"})},[y]),w=nc(async F=>{await y({search:F===""?void 0:F})},[y]),D=nc(async F=>{await y({sort:F})},[y]),_=nc(async F=>{await y({where:F})},[y]),A=eo(()=>{let F=!1,R={...v||{}};D9(r)&&!("limit"in v)&&(R.limit=String(r),F=!0),s&&!("sort"in v)&&(R.sort=s,F=!0),o&&i?.columns&&!("columns"in v)&&(R.columns=F9(o),F=!0),F&&(x(R),window.history.replaceState(null,"",`?${gg.stringify({...R,columns:JSON.stringify(R.columns)})}`))});return T9(()=>{a&&A()},[s,r,a,o]),Y2(hg,{value:{collectionSlug:e,data:n,handlePageChange:C,handlePerPageChange:S,handleSearchChange:w,handleSortChange:D,handleWhereChange:_,orderableFieldName:c,query:v,refineListData:y,setModified:h,...g.current},children:Y2(U2,{value:m,children:t})})};import{jsx as N9}from"react/jsx-runtime";import L9,{createContext as $9,useCallback as fa}from"react";var J2=$9(void 0),Dt=()=>{let t=L9.use(J2);if(t===void 0)throw new Error("useServerFunctions must be used within a ServerFunctionsProvider");return t},vg=({children:t,serverFunction:e})=>{if(!e)throw new Error("ServerFunctionsProvider requires a serverFunction prop");let o=fa(async l=>await e({name:"render-document-slots",args:l}),[e]),n=fa(async l=>{let{signal:c,...u}=l;try{if(!c?.aborted){let f=await e({name:"schedule-publish",args:{...u}});if(!c?.aborted)return f}}catch(f){console.error(f)}let d=`Error scheduling ${u.type}`;return u.doc&&(d+=` for document with ID ${u.doc.value} in collection ${u.doc.relationTo}`),{error:""}},[e]),r=fa(async l=>{let{signal:c,...u}=l||{};try{if(!c?.aborted){let d=await e({name:"form-state",args:{fallbackLocale:!1,...u}});if(!c?.aborted)return d}}catch(d){console.error(d)}return{state:null}},[e]),s=fa(async l=>{let{signal:c,...u}=l||{};try{if(!c?.aborted){let d=await e({name:"table-state",args:{fallbackLocale:!1,...u}});if(!c?.aborted)return d}}catch(d){console.error(d)}},[e]),i=fa(async l=>{let{signal:c,...u}=l||{};try{return await e({name:"render-document",args:{fallbackLocale:!1,...u}})}catch(d){console.error(d)}},[e]),a=fa(async l=>{let{signal:c,...u}=l||{};try{let d=await e({name:"copy-data-from-locale",args:u});if(!c?.aborted)return d}catch(d){console.error(d)}},[e]);return N9(J2,{value:{copyDataFromLocale:a,getDocumentSlots:o,getFormState:r,getTableState:s,renderDocument:i,schedulePublish:n,serverFunction:e},children:t})};import{jsx as O9}from"react/jsx-runtime";import{transformColumnsToSearchParams as q2}from"payload/shared";import Q2,{startTransition as K2,useCallback as yg,useRef as M9}from"react";import{createContext as k9,use as j9}from"react";var xg=k9({}),pa=()=>j9(xg);var sc=({children:t,collectionSlug:e,columnState:o,LinkedCellOverride:n})=>{let{getEntityConfig:r}=H(),{query:s,refineListData:i}=Rt(),{admin:{defaultColumns:a}={}}=r({collectionSlug:e}),[l,c]=Q2.useOptimistic(o,(p,g)=>g),u=M9({}),d=yg(async p=>{let g=(l||[]).map(b=>b.accessor===p?{...b,active:!b.active}:b);K2(()=>{c(g)}),await i({columns:q2(g)})},[i,l,c]),f=yg(async p=>{let{fromIndex:g,toIndex:b}=p,v=[...l||[]],[x]=v.splice(g,1);v.splice(b,0,x),K2(()=>{c(v)}),await i({columns:q2(v)})},[l,i,c]),m=yg(async p=>{let g=s.columns;p.forEach(b=>{let v=g.findIndex(x=>b===x);v!==void 0&&g[v][0]==="-"&&(g[v]=b.slice(1))}),await i({columns:g})},[s,i]),h=Q2.useCallback(async()=>{await m(a)},[a,m]);return O9(xg,{value:{columns:l,LinkedCellOverride:n,moveColumn:f,resetColumnsState:h,setActiveColumns:m,toggleColumn:d,...u.current},children:t})};import{jsx as ic}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as B9,fieldIsID as V9}from"payload/shared";import{useId as G9,useMemo as W9}from"react";var Cg="column-selector",cm=({collectionSlug:t})=>{let{columns:e,moveColumn:o,toggleColumn:n}=pa(),r=G9(),s=ct(),i=W9(()=>e.filter(a=>!(B9(a.field)&&!V9(a.field))&&!a?.field?.admin?.disableListColumn),[e]);return e?ic(cr,{className:Cg,ids:i.map(a=>a?.accessor),onDragEnd:({moveFromIndex:a,moveToIndex:l})=>{o({fromIndex:a,toIndex:l})},children:i.map((a,l)=>{let{accessor:c,active:u,field:d}=a;return ic(vt,{alignIcon:"left","aria-checked":u,className:[`${Cg}__column`,u&&`${Cg}__column--active`].filter(Boolean).join(" "),draggable:!0,icon:u?ic(pt,{}):ic(jo,{}),id:c,onClick:()=>{n(c)},children:a.CustomLabel??ic(ve,{label:d&&"label"in d&&d.label,unstyled:!0})},`${t}-${d&&"name"in d?d?.name:l}${s?`-${s}-`:""}${r}`)})}):null};import{c as m3}from"react/compiler-runtime";import{jsx as mm}from"react/jsx-runtime";import{createElement as sL}from"react";import{useEffect as iL,useId as aL,useState as lL}from"react";import{c as H9}from"react/compiler-runtime";import{useState as z9}from"react";var um=t=>{let e=H9(3),{getEntityConfig:o}=H(),n;e[0]!==o||e[1]!==t?(n=()=>t?(typeof t=="string"?[t]:t).map(i=>o({collectionSlug:i})):[],e[0]=o,e[1]=t,e[2]=n):n=e[2];let[r]=z9(n);return r};import{jsx as c3}from"react/jsx-runtime";import rL,{useCallback as lc,useEffect as u3,useRef as nL,useState as Rg}from"react";import{c as Ig}from"react/compiler-runtime";import{jsx as ri,jsxs as s3}from"react/jsx-runtime";import{getTranslation as q9}from"@payloadcms/translations";import Q9 from"react";import{c as U9}from"react/compiler-runtime";import{jsx as Y9,jsxs as Z9}from"react/jsx-runtime";import o3,{createContext as J9}from"react";import{c as X9}from"react/compiler-runtime";import*as is from"react";var wg=t=>{let e=X9(13),{delayBeforeShow:o,inTimeout:n,minShowTime:r,outTimeout:s,show:i}=t,a=n+r+s,[l,c]=Hf(o),[u,d]=is.useState(!1),[f,m]=is.useState(!1),h=is.useRef(0),p=is.useRef(void 0),g;e[0]!==s?(g=()=>{m(!0),p.current=setTimeout(()=>{d(!1),m(!1)},s)},e[0]=s,e[1]=g):g=e[1];let b=g,v,x;e[2]!==l||e[3]!==u||e[4]!==i||e[5]!==a||e[6]!==b?(v=()=>{let C=l&&!u&&i,S=u&&!i;if(C)h.current=Date.now(),d(!0);else if(S){let w=Date.now()-h.current,D=a-w;clearTimeout(p.current),p.current=setTimeout(b,Math.max(0,D))}},x=[u,i,b,a,l],e[2]=l,e[3]=u,e[4]=i,e[5]=a,e[6]=b,e[7]=v,e[8]=x):(v=e[7],x=e[8]),is.useEffect(v,x);let y;return e[9]!==u||e[10]!==f||e[11]!==c?(y={isMounted:u,isUnmounting:f,triggerDelayedRender:c},e[9]=u,e[10]=f,e[11]=c,e[12]=y):y=e[12],y};var e3={isLoading:!1,loaders:[],loadingText:"",overlayType:null},t3=(t,e)=>{let o=[...t.loaders],{type:n="fullscreen",key:r="user",loadingText:s}=e.payload;if(e.type==="add")o.push({type:n,key:r,loadingText:s});else if(e.type==="remove"){let a=o.findIndex(l=>l.key===r&&l.type===n);o.splice(a,1)}let i=o?.length>0?o[o.length-1]:null;return{isLoading:!!i,loaders:o,loadingText:i?.loadingText||t?.loadingText,overlayType:i?.type||t?.overlayType}};var Sg=250,r3=J9({isOnScreen:!1,toggleLoadingOverlay:void 0}),n3=t=>{let e=U9(21),{children:o}=t,{t:n}=k(),r;e[0]!==n?(r=n("general:loading"),e[0]=n,e[1]=r):r=e[1];let s=r,[i,a]=o3.useReducer(t3,e3),l;e[2]!==i.isLoading?(l={delayBeforeShow:1e3,inTimeout:Sg,minShowTime:500,outTimeout:Sg,show:i.isLoading},e[2]=i.isLoading,e[3]=l):l=e[3];let{isMounted:c,isUnmounting:u,triggerDelayedRender:d}=wg(l),f;e[4]!==s||e[5]!==d?(f=p=>{let{type:g,isLoading:b,key:v,loadingText:x}=p,y=x===void 0?s:x;b?(d(),a({type:"add",payload:{type:g,key:v,loadingText:y}})):a({type:"remove",payload:{type:g,key:v}})},e[4]=s,e[5]=d,e[6]=f):f=e[6];let m=f,h;if(e[7]!==o||e[8]!==s||e[9]!==c||e[10]!==u||e[11]!==i.loadingText||e[12]!==i.overlayType||e[13]!==m){let p;e[15]!==s||e[16]!==c||e[17]!==u||e[18]!==i.loadingText||e[19]!==i.overlayType?(p=c&&Y9(In,{animationDuration:`${Sg}ms`,loadingText:i.loadingText||s,overlayType:i.overlayType,show:!u}),e[15]=s,e[16]=c,e[17]=u,e[18]=i.loadingText,e[19]=i.overlayType,e[20]=p):p=e[20],h=Z9(r3,{value:{isOnScreen:c,toggleLoadingOverlay:m},children:[p,o]}),e[7]=o,e[8]=s,e[9]=c,e[10]=u,e[11]=i.loadingText,e[12]=i.overlayType,e[13]=m,e[14]=h}else h=e[14];return h},dm=()=>{let t=o3.use(r3);if(t===void 0)throw new Error("useLoadingOverlay must be used within a LoadingOverlayProvider");return t};var jr="loading-overlay",In=t=>{let e=Ig(11),{animationDuration:o,loadingText:n,overlayType:r,show:s}=t,i=s===void 0?!0:s,{t:a}=k(),l=i?`${jr}--entering`:`${jr}--exiting`,c=r?`${jr}--${r}`:"",u;e[0]!==l||e[1]!==c?(u=[jr,l,c].filter(Boolean),e[0]=l,e[1]=c,e[2]=u):u=e[2];let d=u.join(" "),f=o||"500ms",m;if(e[3]!==n||e[4]!==a||e[5]!==d||e[6]!==f){let h;e[8]!==n||e[9]!==a?(h=n||a("general:loading"),e[8]=n,e[9]=a,e[10]=h):h=e[10],m=s3("div",{className:d,style:{animationDuration:f},children:[s3("div",{className:`${jr}__bars`,children:[ri("div",{className:`${jr}__bar`}),ri("div",{className:`${jr}__bar`}),ri("div",{className:`${jr}__bar`}),ri("div",{className:`${jr}__bar`}),ri("div",{className:`${jr}__bar`})]}),ri("span",{className:`${jr}__text`,children:h})]}),e[3]=n,e[4]=a,e[5]=d,e[6]=f,e[7]=m}else m=e[7];return m},i3=t=>{let e=Ig(7),{name:o,type:n,loadingText:r,show:s}=t,i=n===void 0?"fullscreen":n,{toggleLoadingOverlay:a}=dm(),l,c;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==a||e[4]!==i?(l=()=>(a({type:i,isLoading:s,key:o,loadingText:r||void 0}),()=>{a({type:i,isLoading:!1,key:o})}),c=[s,a,o,i,r],e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=i,e[5]=l,e[6]=c):(l=e[5],c=e[6]),Q9.useEffect(l,c),null},K9=t=>{let e=Ig(6),{name:o,type:n,action:r,formIsLoading:s,loadingSuffix:i}=t,a=n===void 0?"fullscreen":n,l=s===void 0?!1:s,c=lr(),{i18n:u,t:d}=k(),m=`${{create:d("general:creating"),loading:d("general:loading"),update:d("general:updating")}[r]} ${i?q9(i,u):""}`,h;return e[0]!==l||e[1]!==c||e[2]!==o||e[3]!==m||e[4]!==a?(h=ri(i3,{loadingText:m.trim(),name:o,show:l||c,type:a}),e[0]=l,e[1]=c,e[2]=o,e[3]=m,e[4]=a,e[5]=h):h=e[5],h};function tr(t){if(t)try{t.abort()}catch{}}function or(t){let e=new AbortController;if(t.current)try{t.current.abort()}catch{}return t.current=e,e}import{jsx as eL}from"react/jsx-runtime";import{createContext as tL,use as oL}from"react";var a3=tL({}),l3=({children:t,...e})=>eL(a3,{value:e,children:t}),ac=()=>{let t=oL(a3);if(!t)throw new Error("useDocumentDrawerContext must be used within a DocumentDrawerProvider");return t};var d3=({id:t,AfterFields:e,collectionSlug:o,disableActions:n,drawerSlug:r,Header:s,initialData:i,onDelete:a,onDuplicate:l,onSave:c,overrideEntityVisibility:u=!0,redirectAfterCreate:d,redirectAfterDelete:f,redirectAfterDuplicate:m})=>{let{getEntityConfig:h}=H(),p=Pe(),[g]=Rg(()=>h({collectionSlug:o})),b=rL.useRef(null),{closeModal:v}=ue(),{t:x}=k(),{renderDocument:y}=Dt(),[C,S]=Rg(void 0),[w,D]=Rg(!0),_=nL(!1),A=lc(T=>{let $=or(b);(async()=>{D(!0);try{let N=await y({collectionSlug:o,disableActions:n,docID:T,drawerSlug:r,initialData:i,locale:p,overrideEntityVisibility:u,redirectAfterCreate:d,redirectAfterDelete:f!==void 0?f:!1,redirectAfterDuplicate:m!==void 0?m:!1,signal:$.signal});N?.Document&&(S(N.Document),D(!1))}catch(N){me.error(N?.message||x("error:unspecific")),v(r)}b.current=null})()},[o,n,r,i,f,m,y,v,u,x,p]),F=lc(T=>{A(T.doc.id),typeof c=="function"&&c({...T,collectionConfig:g})},[c,g,A]),R=lc(T=>{A(T.doc.id),typeof l=="function"&&l({...T,collectionConfig:g})},[l,g,A]),I=lc(T=>{typeof a=="function"&&a({...T,collectionConfig:g}),v(r)},[a,v,r,g]),E=lc(()=>{A()},[A]);return u3(()=>{!C&&!_.current&&(A(t),_.current=!0)},[C,A,t]),u3(()=>{let T=b.current;return()=>{tr(T)}},[]),w?c3(In,{}):c3(l3,{clearDoc:E,drawerSlug:r,onDelete:I,onDuplicate:R,onSave:F,children:C})};var as="doc-drawer",cL=({id:t,collectionSlug:e,depth:o,uuid:n})=>`doc-drawer_${e}_${o}${t?`_${t}`:""}_${n}`,uL=t=>{let e=m3(21),o,n,r,s,i,a,l,c;e[0]!==t?({id:a,children:o,className:n,collectionSlug:r,disabled:s,drawerSlug:i,onClick:l,...c}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=a,e[7]=l,e[8]=c):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],a=e[6],l=e[7],c=e[8]);let{t:u}=k(),[d]=um(r),f=a?"general:editLabel":"fields:addNewLabel",m=d?.labels.singular,h;if(e[9]!==o||e[10]!==n||e[11]!==s||e[12]!==i||e[13]!==l||e[14]!==c||e[15]!==u||e[16]!==f||e[17]!==m){let p=u(f,{label:m}),g;e[19]!==n?(g=[n,`${as}__toggler`].filter(Boolean),e[19]=n,e[20]=g):g=e[20],h=mm(ur,{"aria-label":p,className:g.join(" "),disabled:s,onClick:l,slug:i,...c,children:o}),e[9]=o,e[10]=n,e[11]=s,e[12]=i,e[13]=l,e[14]=c,e[15]=u,e[16]=f,e[17]=m,e[18]=h}else h=e[18];return h},dL=t=>{let{drawerSlug:e}=t;return mm(Pt,{className:as,gutter:!1,Header:null,slug:e,children:mm(d3,{...t})})},Jt=t=>{let e=m3(38),{id:o,collectionSlug:n,overrideEntityVisibility:r}=t,s=ct(),i=aL(),{closeModal:a,modalState:l,openModal:c,toggleModal:u}=ue(),[d,f]=lL(!1),m;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==i?(m=cL({id:o,collectionSlug:n,depth:s,uuid:i}),e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=m):m=e[4];let h=m,p,g;e[5]!==h||e[6]!==l?(p=()=>{f(!!l[h]?.isOpen)},g=[l,h],e[5]=h,e[6]=l,e[7]=p,e[8]=g):(p=e[7],g=e[8]),iL(p,g);let b;e[9]!==h||e[10]!==u?(b=()=>{u(h)},e[9]=h,e[10]=u,e[11]=b):b=e[11];let v=b,x;e[12]!==a||e[13]!==h?(x=()=>{a(h)},e[12]=a,e[13]=h,e[14]=x):x=e[14];let y=x,C;e[15]!==h||e[16]!==c?(C=()=>{c(h)},e[15]=h,e[16]=c,e[17]=C):C=e[17];let S=C,w,D;e[18]!==n||e[19]!==h||e[20]!==o||e[21]!==r?(D=j=>sL(dL,{...j,collectionSlug:n,drawerSlug:h,id:o,key:h,overrideEntityVisibility:r}),e[18]=n,e[19]=h,e[20]=o,e[21]=r,e[22]=D):D=e[22],w=D;let _=w,A,F;e[23]!==n||e[24]!==h||e[25]!==o?(F=j=>mm(uL,{...j,collectionSlug:n,drawerSlug:h,id:o}),e[23]=n,e[24]=h,e[25]=o,e[26]=F):F=e[26],A=F;let R=A,I,E;e[27]!==y||e[28]!==h||e[29]!==s||e[30]!==d||e[31]!==S||e[32]!==v?(E={closeDrawer:y,drawerDepth:s,drawerSlug:h,isDrawerOpen:d,openDrawer:S,toggleDrawer:v},e[27]=y,e[28]=h,e[29]=s,e[30]=d,e[31]=S,e[32]=v,e[33]=E):E=e[33],I=E;let T=I,$;return e[34]!==_||e[35]!==T||e[36]!==R?($=[_,R,T],e[34]=_,e[35]=T,e[36]=R,e[37]=$):$=e[37],$};import{c as mL}from"react/compiler-runtime";import{jsx as fL}from"react/jsx-runtime";import{createContext as pL,use as hL,useEffect as gL,useReducer as bL,useRef as vL}from"react";function f3(t,e){switch(e.type){case"ADD_LOADED":{let o={...t};typeof o[e.relationTo]!="object"&&(o[e.relationTo]={});let n=[...e.idsToLoad];return Array.isArray(e.docs)&&e.docs.forEach(r=>{n.splice(n.indexOf(r.id),1),o[e.relationTo][r.id]=r}),n.forEach(r=>{o[e.relationTo][r]=!1}),o}case"REQUEST":{let o={...t};return e.docs.forEach(({relationTo:n,value:r})=>{typeof o[n]!="object"&&(o[n]={}),o[n][r]=null}),o}default:return t}}var p3=pL({}),cc=t=>{let e=mL(15),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=bL(f3,n),i=Jo(r,100),{config:a}=H(),{routes:l,serverURL:c}=a,{api:u}=l,{i18n:d}=k(),{code:f}=Pe(),m=vL(f),h;e[1]!==u||e[2]!==i||e[3]!==d||e[4]!==f||e[5]!==c?(h=C=>{let S=C===void 0?!1:C;Object.entries(i).forEach(async w=>{let[D,_]=w,A=[];if(Object.entries(_).forEach(F=>{let[R,I]=F;(I===null||S)&&A.push(R)}),A.length>0){let F=`${c}${u}/${D}`,R=new URLSearchParams;if(R.append("depth","0"),R.append("limit","250"),f&&R.append("locale",f),A&&A.length>0){let T=A.map(xL);R.append("where[id][in]",T.join(","))}let I=`?${R.toString()}`,E=await fetch(`${F}${I}`,{credentials:"include",headers:{"Accept-Language":d.language}});if(E.ok){let T=await E.json();T.docs&&s({type:"ADD_LOADED",docs:T.docs,idsToLoad:A,relationTo:D})}else s({type:"ADD_LOADED",docs:[],idsToLoad:A,relationTo:D})}})},e[1]=u,e[2]=i,e[3]=d,e[4]=f,e[5]=c,e[6]=h):h=e[6];let p=h,g,b;e[7]!==p||e[8]!==f?(g=()=>{p(f&&m.current!==f),m.current=f},b=[f,p],e[7]=p,e[8]=f,e[9]=g,e[10]=b):(g=e[9],b=e[10]),gL(g,b);let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=C=>{s({type:"REQUEST",docs:C})},e[11]=v):v=e[11];let x=v,y;return e[12]!==o||e[13]!==r?(y=fL(p3,{value:{documents:r,getRelationships:x},children:o}),e[12]=o,e[13]=r,e[14]=y):y=e[14],y},_g=()=>hL(p3);function xL(t){return String(t)}import{c as e$}from"react/compiler-runtime";import{jsx as Cm,jsxs as t$}from"react/jsx-runtime";import"react";import{c as qL}from"react/compiler-runtime";import{jsx as L3}from"react/jsx-runtime";import $3 from"react";import{c as HL}from"react/compiler-runtime";import{jsx as ba,jsxs as zL}from"react/jsx-runtime";import{getTranslation as XL}from"@payloadcms/translations";import{fieldAffectsData as UL,fieldIsID as YL}from"payload/shared";import ZL from"react";import{formatAdminURL as h3}from"payload/shared";import{getTranslation as yL}from"@payloadcms/translations";import CL from"react";var g3=(t,e,o)=>{if((e?.type==="select"||e?.type==="radio")&&Array.isArray(e.options)){let n=e.options.find(r=>typeof r=="object"?r.value===t:r===t);if(n)return typeof n=="object"&&"label"in n?CL.isValidElement(n.label)?n.label:yL(n.label,o)||n.value:n}return t};import{jsx as b3}from"react/jsx-runtime";import"react";var fm=({cellData:t,nowrap:e})=>{let o=t?.length>100?`${t.substring(0,100)}\u2026`:t;return b3("code",{className:"code-cell",style:e?{whiteSpace:"nowrap"}:{},children:b3("span",{children:o})})};import{c as wL}from"react/compiler-runtime";import{jsx as SL}from"react/jsx-runtime";import{getTranslation as v3}from"@payloadcms/translations";import"react";var x3=t=>{let e=wL(2),{cellData:o,field:n}=t,{labels:r}=n,{i18n:s}=k(),i=o??[],a=i.length===1?`${i.length} ${v3(r?.singular||s.t("general:rows"),s)}`:`${i.length} ${v3(r?.plural||s.t("general:rows"),s)}`,l;return e[0]!==a?(l=SL("span",{children:a}),e[0]=a,e[1]=l):l=e[1],l};import{c as IL}from"react/compiler-runtime";import{jsx as RL}from"react/jsx-runtime";import{getTranslation as pm}from"@payloadcms/translations";import"react";var y3=t=>{let e=IL(2),{cellData:o,field:n}=t,{blockReferences:r,blocks:s,labels:i}=n,{i18n:a}=k(),{config:l}=H(),c=Array.isArray(o)?o.map(_L):[],u=(r??s)?.map(h=>{let p=typeof h=="string"?l.blocksMap[h]:h;return{slug:p.slug,label:pm(p.labels.singular,a)}}),d=`0 ${pm(i?.plural,a)}`,f=h=>h.map(p=>u.filter(b=>b.slug===p)?.[0]?.label).join(", ");if(c.length>5){let h=c.length-5;d=`${c.length} ${pm(i?.plural,a)} - ${a.t("fields:itemsAndMore",{count:h,items:f(c.slice(0,5))})}`}else c.length>0&&(d=`${c.length} ${pm(c.length===1?i?.singular:i?.plural,a)} - ${f(c)}`);let m;return e[0]!==d?(m=RL("span",{children:d}),e[0]=d,e[1]=m):m=e[1],m};function _L(t){let{blockType:e}=t;return e}import{c as DL}from"react/compiler-runtime";import{jsx as C3}from"react/jsx-runtime";import"react";var w3=t=>{let e=DL(3),{cellData:o}=t,{t:n}=k(),r=`general:${o}`,s;return e[0]!==n||e[1]!==r?(s=C3("code",{className:"bool-cell",children:C3("span",{children:n(r).toLowerCase()})}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};import{c as FL}from"react/compiler-runtime";import{jsx as AL}from"react/jsx-runtime";import"react";var S3=t=>{let e=FL(8),{cellData:o,field:n}=t,{admin:r}=n,s;e[0]!==r?(s=r===void 0?{}:r,e[0]=r,e[1]=s):s=e[1];let{date:i}=s,{config:a}=H(),{admin:l}=a,{dateFormat:c}=l,u=i?.displayFormat||c,{i18n:d}=k(),f;e[2]!==o||e[3]!==u||e[4]!==d?(f=o&&xn({date:o,i18n:d,pattern:u}),e[2]=o,e[3]=u,e[4]=d,e[5]=f):f=e[5];let m;return e[6]!==f?(m=AL("span",{children:f}),e[6]=f,e[7]=m):m=e[7],m};import{jsx as Fg,jsxs as EL,Fragment as PL}from"react/jsx-runtime";import{isImage as NL}from"payload/shared";import"react";var ha=({sizes:t,targetSizeMax:e=180,targetSizeMin:o=40,thumbnailURL:n,url:r,width:s})=>n||t&&Object.values(t).reduce((a,l)=>!l.width||l.width<o?a:l.width>=o&&l.width<=e?!a.width||l.width<a.width||a.width<o||a.width>e?l:a:!a.width||!a.original&&a.width<o&&l.width>a.width||a.width>e&&l.width<a.width?l:a,{original:!0,url:r,width:s}).url||r;import{c as I3}from"react/compiler-runtime";import{jsx as ga,jsxs as R3}from"react/jsx-runtime";import gm from"react";import{jsx as Dg,jsxs as TL}from"react/jsx-runtime";import"react";var hm=()=>TL("svg",{height:"150",viewBox:"0 0 150 150",width:"150",xmlns:"http://www.w3.org/2000/svg",children:[Dg("rect",{fill:"#333333",height:"150",transform:"translate(0 0.5)",width:"150"}),Dg("path",{d:"M82.8876 50.5H55.5555V100.5H94.4444V61.9818H82.8876V50.5Z",fill:"white"}),Dg("path",{d:"M82.8876 61.9818H94.4444L82.8876 50.5V61.9818Z",fill:"#9A9A9A"})]});var bm="thumbnail",Or=t=>{let e=I3(17),{className:o,doc:n,fileSrc:r,imageCacheTag:s,size:i}=t,a=o===void 0?"":o,l;e[0]!==n?(l=n===void 0?{}:n,e[0]=n,e[1]=l):l=e[1];let{filename:c}=l,[u,d]=gm.useState(void 0),f=`${bm}--size-${i||"medium"}`,m;e[2]!==a||e[3]!==f?(m=[bm,f,a],e[2]=a,e[3]=f,e[4]=m):m=e[4];let h=m.join(" "),p,g;e[5]!==r?(p=()=>{if(!r){d(!1);return}d(void 0);let x=new Image;x.src=r,x.onload=()=>{d(!0)},x.onerror=()=>{d(!1)}},g=[r],e[5]=r,e[6]=p,e[7]=g):(p=e[6],g=e[7]),gm.useEffect(p,g);let b=null;if(r){let x=r?.includes("?")?"&":"?";b=s?`${r}${x}${encodeURIComponent(s)}`:r}let v;if(e[8]!==h||e[9]!==u||e[10]!==c||e[11]!==b){let x;e[13]!==u||e[14]!==c||e[15]!==b?(x=u&&ga("img",{alt:c,src:b}),e[13]=u,e[14]=c,e[15]=b,e[16]=x):x=e[16],v=R3("div",{className:h,children:[u===void 0&&ga(St,{height:"100%"}),x,u===!1&&ga(hm,{})]}),e[8]=h,e[9]=u,e[10]=c,e[11]=b,e[12]=v}else v=e[12];return v};function _3(t){let e=I3(17),{alt:o,className:n,filename:r,fileSrc:s,imageCacheTag:i,size:a}=t,l=n===void 0?"":n,[c,u]=gm.useState(void 0),d=`${bm}--size-${a||"medium"}`,f;e[0]!==l||e[1]!==d?(f=[bm,d,l],e[0]=l,e[1]=d,e[2]=f):f=e[2];let m=f.join(" "),h,p;e[3]!==s?(h=()=>{if(!s){u(!1);return}u(void 0);let v=new Image;v.src=s,v.onload=()=>{u(!0)},v.onerror=()=>{u(!1)}},p=[s],e[3]=s,e[4]=h,e[5]=p):(h=e[4],p=e[5]),gm.useEffect(h,p);let g="";if(s){let v=s?.includes("?")?"&":"?";g=i?`${s}${v}${encodeURIComponent(i)}`:s}let b;if(e[6]!==o||e[7]!==m||e[8]!==c||e[9]!==r||e[10]!==g){let v;e[12]!==o||e[13]!==c||e[14]!==r||e[15]!==g?(v=c&&ga("img",{alt:o||r,src:g}),e[12]=o,e[13]=c,e[14]=r,e[15]=g,e[16]=v):v=e[16],b=R3("div",{className:m,children:[c===void 0&&ga(St,{height:"100%"}),v,c===!1&&ga(hm,{})]}),e[6]=o,e[7]=m,e[8]=c,e[9]=r,e[10]=g,e[11]=b}else b=e[11];return b}var Ag="file",vm=({cellData:t,collectionConfig:e,field:o,rowData:n})=>{if(("displayPreview"in o?o.displayPreview:void 0)??e.upload?.displayPreview??!0){let i=NL(n?.mimeType),a=i?n?.thumbnailURL||n?.url:n?.thumbnailURL;return i&&(a=ha({sizes:n?.sizes,thumbnailURL:n?.thumbnailURL,url:n?.url,width:n?.width})),EL("div",{className:Ag,children:[Fg(Or,{className:`${Ag}__thumbnail`,collectionSlug:e?.slug,doc:{...n,filename:t},fileSrc:a,size:"small",uploadConfig:e?.upload}),Fg("span",{className:`${Ag}__filename`,children:String(t)})]})}else return Fg(PL,{children:String(t)})};import{jsx as D3}from"react/jsx-runtime";import"react";var F3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return D3("code",{className:"json-cell",children:D3("span",{children:JSON.stringify(e)})})};import{c as LL}from"react/compiler-runtime";import{jsx as $L,jsxs as T3}from"react/jsx-runtime";import{getTranslation as kL}from"@payloadcms/translations";import jL,{useEffect as E3,useState as P3}from"react";var A3=!!(typeof window<"u"&&window.document&&window.document.createElement);var OL="relationship-cell",xm=3,ym=t=>{let e=LL(40),{cellData:o,customCellProps:n,field:r,field:s}=t,{label:i}=s,a="relationTo"in r&&r.relationTo||"collection"in r&&r.collection,l;l="collection"in r?o?.docs:o;let c=l,{config:u,getEntityConfig:d}=H(),{collections:f,routes:m}=u,[h,p]=mn(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];let[b,v]=P3(g),{documents:x,getRelationships:y}=_g(),[C,S]=P3(!1),{i18n:w,t:D}=k(),_=A3?p?.boundingClientRect?.top<window.innerHeight:!1,A;e[1]!==c||e[2]!==y||e[3]!==C||e[4]!==_||e[5]!==a?(A=()=>{if((c||typeof c=="number")&&_&&!C){let T=[],$=Array.isArray(c)?c:[c];$.slice(0,$.length<xm?$.length:xm).forEach(j=>{typeof j=="object"&&"relationTo"in j&&"value"in j&&T.push(j),(typeof j=="number"||typeof j=="string")&&typeof a=="string"&&T.push({relationTo:a,value:j})}),y(T),S(!0),v(T)}},e[1]=c,e[2]=y,e[3]=C,e[4]=_,e[5]=a,e[6]=A):A=e[6];let F;e[7]!==c||e[8]!==f||e[9]!==y||e[10]!==C||e[11]!==_||e[12]!==a||e[13]!==m.api?(F=[c,a,f,_,m.api,C,y],e[7]=c,e[8]=f,e[9]=y,e[10]=C,e[11]=_,e[12]=a,e[13]=m.api,e[14]=F):F=e[14],E3(A,F);let R;e[15]!==C?(R=()=>{C&&S(!1)},e[15]=C,e[16]=R):R=e[16];let I;e[17]!==c?(I=[c],e[17]=c,e[18]=I):I=e[18],E3(R,I);let E;if(e[19]!==c||e[20]!==u.admin||e[21]!==n||e[22]!==x||e[23]!==r||e[24]!==d||e[25]!==w||e[26]!==h||e[27]!==i||e[28]!==D||e[29]!==b){let T;e[31]!==u.admin||e[32]!==n||e[33]!==x||e[34]!==r||e[35]!==d||e[36]!==w||e[37]!==D||e[38]!==b.length?(T=($,j)=>{let{relationTo:N,value:P}=$,L=x[N][P],V=d({collectionSlug:N}),M=dr({collectionConfig:V,data:L||null,dateFormat:u.admin.dateFormat,fallback:`${D("general:untitled")} - ID: ${P}`,i18n:w}),O=null;return r.type==="upload"&&(("displayPreview"in r?r.displayPreview:void 0)??V.upload?.displayPreview??!0)&&L&&(O=$L(vm,{cellData:M,collectionConfig:V,collectionSlug:V.slug,customCellProps:n,field:r,rowData:L})),T3(jL.Fragment,{children:[L===!1&&`${D("general:untitled")} - ID: ${P}`,L===null&&`${D("general:loading")}...`,L?O||M:null,b.length>j+1&&", "]},j)},e[31]=u.admin,e[32]=n,e[33]=x,e[34]=r,e[35]=d,e[36]=w,e[37]=D,e[38]=b.length,e[39]=T):T=e[39],E=T3("div",{className:OL,ref:h,children:[b.map(T),Array.isArray(c)&&c.length>xm&&D("fields:itemsAndMore",{count:c.length-xm,items:""}),b.length===0&&D("general:noLabel",{label:kL(i||"",w)})]}),e[19]=c,e[20]=u.admin,e[21]=n,e[22]=x,e[23]=r,e[24]=d,e[25]=w,e[26]=h,e[27]=i,e[28]=D,e[29]=b,e[30]=E}else E=e[30];return E};import{c as ML}from"react/compiler-runtime";import{jsx as BL}from"react/jsx-runtime";import{getTranslation as VL}from"@payloadcms/translations";import{optionsAreObjects as GL}from"payload/shared";import"react";var Tg=t=>{let e=ML(10),{cellData:o,field:n}=t,{options:r}=n,{i18n:s}=k(),i;e[0]!==s||e[1]!==r?(i=u=>u.map(d=>{let f=r.filter(m=>m.value===d)?.[0]?.label;return VL(f,s)}).join(", "),e[0]=s,e[1]=r,e[2]=i):i=e[2];let a=i,l;if(GL(r)){let u;e[3]!==o||e[4]!==a?(u=Array.isArray(o)?a(o):a([o]),e[3]=o,e[4]=a,e[5]=u):u=e[5],l=u}else{let u;e[6]!==o?(u=Array.isArray(o)?o.join(", "):o,e[6]=o,e[7]=u):u=e[7],l=u}let c;return e[8]!==l?(c=BL("span",{children:l}),e[8]=l,e[9]=c):c=e[9],c};import{jsx as WL}from"react/jsx-runtime";import"react";var N3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return WL("span",{children:e})};var Eg={array:x3,blocks:y3,checkbox:w3,code:fm,date:S3,File:vm,join:ym,json:F3,radio:Tg,relationship:ym,select:Tg,textarea:N3,upload:ym};var uc=t=>{let e=HL(14),{cellData:o,className:n,collectionSlug:r,field:s,field:i,link:a,onClick:l,rowData:c}=t,{admin:u}=i,{i18n:d}=k(),{config:f,getEntityConfig:m}=H(),{routes:h}=f,{admin:p}=h,g,b;if(e[0]!==u||e[1]!==p||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==m||e[7]!==d||e[8]!==a||e[9]!==l||e[10]!==t||e[11]!==c){b=Symbol.for("react.early_return_sentinel");e:{let v=m({collectionSlug:r}),x=u&&"className"in u?u.className:void 0,y=n||(s.admin&&"className"in s.admin?s.admin.className:null)||x,C=l,S="span",w={className:y};if(a&&(w.prefetch=!1,S=no,w.href=v?.slug?h3({adminRoute:p,path:`/collections/${v?.slug}/${encodeURIComponent(c.id)}`}):""),typeof C=="function"&&(S="button",w.type="button",w.onClick=()=>{C({cellData:o,collectionSlug:v?.slug,rowData:c})}),YL(s)){b=ba(S,{...w,children:ba(fm,{cellData:`ID: ${o}`,collectionConfig:v,collectionSlug:r,field:{...s,type:"code"},nowrap:!0,rowData:c})});break e}let D=g3(o,s,d),_=typeof o<"u"&&Eg[s.type],A=null;if(ZL.isValidElement(D))A=D;else if(_)A=ba(_,{cellData:o,rowData:c,...t});else if(!_)if(v?.upload&&UL(s)&&s.name==="filename"&&s.type==="text"){let F=Eg.File;A=ba(F,{cellData:o,rowData:c,...t,collectionConfig:v,field:s})}else{b=zL(S,{...w,children:[(D===""||typeof D>"u"||D===null)&&d.t("general:noLabel",{label:XL(("label"in s?s.label:null)||"data",d)}),typeof D=="string"&&D,typeof D=="number"&&D,typeof D=="object"&&D!==null&&JSON.stringify(D)]});break e}if((s.type==="select"||s.type==="radio")&&s.options.length&&o){let F=Array.isArray(o)?o.map(JL).join(" "):`selected--${o}`,R=[w.className,F].filter(Boolean).join(" ");b=ba(S,{...w,className:R,children:A});break e}g=ba(S,{...w,children:A})}e[0]=u,e[1]=p,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=m,e[7]=d,e[8]=a,e[9]=l,e[10]=t,e[11]=c,e[12]=g,e[13]=b}else g=e[12],b=e[13];return b!==Symbol.for("react.early_return_sentinel")?b:g};function JL(t){return`selected--${t}`}var QL="default-cell",k3=$3.createContext(null),Pg=()=>$3.use(k3),KL=t=>{let e=qL(9),{clientProps:o,columnIndex:n,isLinkedColumn:r}=t,{drawerSlug:s,onSelect:i}=en(),{LinkedCellOverride:a}=pa(),l;if(e[0]!==a||e[1]!==o||e[2]!==n||e[3]!==s||e[4]!==r||e[5]!==i){let c={...o,columnIndex:n};if(r&&s){c.className=`${QL}__first-cell`,c.link=!1;let u;e[7]!==i?(u=d=>{let{collectionSlug:f,rowData:m}=d;typeof i=="function"&&i({collectionSlug:f,doc:m,docID:m.id})},e[7]=i,e[8]=u):u=e[8],c.onClick=u}l=L3(k3,{value:c,children:r&&a?a:L3(uc,{...c})}),e[0]=a,e[1]=o,e[2]=n,e[3]=s,e[4]=r,e[5]=i,e[6]=l}else l=e[6];return l};var j3=t=>{let e=e$(15),{onDrawerDelete:o,onDrawerSave:n}=t,r=Pg(),s=r?.rowData.id,i=r?.collectionSlug,a;e[0]!==s||e[1]!==i?(a={id:s,collectionSlug:i},e[0]=s,e[1]=i,e[2]=a):a=e[2];let[l,c,u]=Jt(a),{closeDrawer:d}=u,f;e[3]!==d||e[4]!==n?(f=b=>{d(),typeof n=="function"&&n(b)},e[3]=d,e[4]=n,e[5]=f):f=e[5];let m=f,h;e[6]!==d||e[7]!==o?(h=b=>{d(),typeof o=="function"&&o(b)},e[6]=d,e[7]=o,e[8]=h):h=e[8];let p=h,g;return e[9]!==l||e[10]!==c||e[11]!==r||e[12]!==p||e[13]!==m?(g=t$("div",{className:"drawer-link",children:[Cm(uc,{...r,className:"drawer-link__cell",link:!1,onClick:null}),Cm(c,{children:Cm(Rr,{})}),Cm(l,{onDelete:p,onSave:m})]}),e[9]=l,e[10]=c,e[11]=r,e[12]=p,e[13]=m,e[14]=g):g=e[14],g};import{c as i$}from"react/compiler-runtime";import{jsx as a$}from"react/jsx-runtime";import"react";import{jsx as $g}from"react/jsx-runtime";import"react";import{jsx as O3}from"react/jsx-runtime";import"react";var Ng="clickable-arrow",M3=t=>{let{direction:e="right",isDisabled:o=!1,updatePage:n}=t,r=[Ng,o&&`${Ng}--is-disabled`,e&&`${Ng}--${e}`].filter(Boolean).join(" ");return O3("button",{className:r,disabled:o,onClick:o?void 0:n,type:"button",children:O3(Ze,{})})};import{jsx as o$}from"react/jsx-runtime";import"react";var wm="paginator__page",Lg=({isCurrent:t,isFirstPage:e=!1,isLastPage:o=!1,page:n=1,updatePage:r})=>{let s=[wm,t&&`${wm}--is-current`,e&&`${wm}--is-first-page`,o&&`${wm}--is-last-page`].filter(Boolean).join(" ");return o$("button",{className:s,onClick:()=>r(n),type:"button",children:n})};import{jsx as r$}from"react/jsx-runtime";import"react";var B3=()=>r$("span",{className:"paginator__separator",children:"\u2014"});var n$={ClickableArrow:M3,Page:Lg,Separator:B3},s$="paginator",dc=t=>{let{hasNextPage:e=!1,hasPrevPage:o=!1,nextPage:n=null,numberOfNeighbors:r=1,onChange:s,page:i,prevPage:a=null,totalPages:l=null}=t;if(!e&&!o)return null;let c=h=>{typeof s=="function"&&s(h)},u=Array.from({length:l},(h,p)=>p+1),d=i-1-r;d<=0&&(d=0);let f=i-1+r+1,m=u.slice(d,f);return i-r-1>=2&&m.unshift({type:"Separator"}),i>r+1&&m.unshift({type:"Page",props:{isFirstPage:!0,page:1,updatePage:c}}),i+r+1<l&&m.push({type:"Separator"}),f<l&&m.push({type:"Page",props:{isLastPage:!0,page:l,updatePage:c}}),m.unshift({type:"ClickableArrow",props:{direction:"right",isDisabled:!e,updatePage:()=>c(n)}}),m.unshift({type:"ClickableArrow",props:{direction:"left",isDisabled:!o,updatePage:()=>c(a)}}),$g("div",{className:s$,children:m.map((h,p)=>{if(typeof h=="number")return $g(Lg,{isCurrent:i===h,page:h,updatePage:c},p);let g=n$[h.type];return $g(g,{...h.props},p)})})};var V3=()=>{let t=i$(11),{data:e,handlePageChange:o}=Rt(),n=e.nextPage||2,r;t[0]!==o?(r=l=>{o(l)},t[0]=o,t[1]=r):r=t[1];let s=e.page||1,i=e.prevPage||void 0,a;return t[2]!==e.hasNextPage||t[3]!==e.hasPrevPage||t[4]!==e.limit||t[5]!==e.totalPages||t[6]!==n||t[7]!==r||t[8]!==s||t[9]!==i?(a=a$(dc,{hasNextPage:e.hasNextPage,hasPrevPage:e.hasPrevPage,limit:e.limit,nextPage:n,numberOfNeighbors:1,onChange:r,page:s,prevPage:i,totalPages:e.totalPages}),t[2]=e.hasNextPage,t[3]=e.hasPrevPage,t[4]=e.limit,t[5]=e.totalPages,t[6]=n,t[7]=r,t[8]=s,t[9]=i,t[10]=a):a=t[10],a};var rr="relationship-table",Og=t=>{let{AfterInput:e,allowCreate:o=!0,BeforeInput:n,disableTable:r=!1,field:s,filterOptions:i,initialData:a,initialDrawerData:l,Label:c,parent:u,relationTo:d}=t,[f,m]=Rn(null),{config:h,getEntityConfig:p}=H(),{permissions:g}=De(),[b]=Rn(()=>{if(a)return{...a,docs:Array.isArray(a.docs)?a.docs.reduce((U,z)=>typeof z=="string"?[...U,{id:z}]:[...U,z],[]):[]}}),{i18n:v,t:x}=k(),[y,C]=Rn(),[S,w]=Rn(!1),[D]=Rn(()=>p({collectionSlug:d})),[_,A]=Rn(Array.isArray(d)?void 0:d),[F,R]=Rn(!r),[I,E]=Rn(b),[T,$]=Rn(),{getTableState:j}=Dt(),N=Sm(async U=>{let z={limit:String(s?.defaultLimit||D?.admin?.pagination?.defaultLimit),sort:s.defaultSort||D?.defaultSort,...y||{},where:{...y?.where||{}}};i&&(z.where=l$(z.where,i));let le=s.admin.defaultColumns?s.admin.defaultColumns.map(q=>({accessor:q,active:!0})):void 0,{data:J,state:ce,Table:re}=await j({collectionSlug:d,columns:G3(y?.columns)||le,docs:U,enableRowSelections:!1,orderableFieldName:!s.orderable||Array.isArray(s.collection)?void 0:`_${s.collection}_${s.name}_order`,parent:u,query:z,renderRowTypes:!0,tableAppearance:"condensed"});E(J),m(re),$(ce),R(!1)},[s.defaultLimit,s.defaultSort,s.admin.defaultColumns,s.collection,s.name,s.orderable,D?.admin?.pagination?.defaultLimit,D?.defaultSort,y,i,j,d,u]),P=eo((U,z)=>{!z&&(!f||U)&&N()});jg(()=>{P(y,r)},[y,r]);let[L,V,{closeDrawer:M,isDrawerOpen:O,openDrawer:B}]=Jt({collectionSlug:_}),G=Sm(U=>{let z=I?.docs?.findIndex(J=>J.id===U.doc.id),le;if(z!==-1){let J=[...I.docs];J[z]=U.doc,le=J}else le=[U.doc,...I.docs];N(le)},[I?.docs,N]),X=Sm(U=>{M(),G(U)},[M,G]),Z=Sm(U=>{let z=I.docs.filter(le=>le.id!==U.id);N(z)},[I?.docs,N]),te=o!==!1&&g?.collections?.[Array.isArray(d)?d[0]:d]?.create;return jg(()=>{Array.isArray(d)&&_&&B()},[_,B,d]),jg(()=>{Array.isArray(d)&&!O&&_&&A(void 0)},[O]),ni("div",{className:rr,children:[ni("div",{className:`${rr}__header`,children:[c,ni("div",{className:`${rr}__actions`,children:[!Array.isArray(d)&&te&&to(V,{className:`${rr}__add-new`,children:v.t("fields:addNew")}),Array.isArray(d)&&to(W3,{children:to(ho,{button:ni(ne,{buttonStyle:"none",className:`${rr}__add-new-polymorphic`,children:[v.t("fields:addNew"),to(jo,{})]}),buttonType:"custom",horizontalAlign:"center",render:({close:U})=>to(Me.ButtonGroup,{children:d.map(z=>g.collections[z].create?to(Me.Button,{className:`${rr}__relation-button--${z}`,onClick:()=>{U(),A(z)},children:kg(h.collections.find(le=>le.slug===z).labels.singular,v)},z):null)}),size:"medium"})}),to(vt,{"aria-controls":`${rr}-columns`,"aria-expanded":S,className:`${rr}__toggle-columns ${S?`${rr}__buttons-active`:""}`,icon:to(Ze,{direction:S?"up":"down"}),onClick:()=>w(!S),pillStyle:"light",children:x("general:columns")})]})]}),n,F?to("p",{children:x("general:loading")}):ni(W3,{children:[I?.docs&&I.docs.length===0&&ni("div",{className:`${rr}__no-results`,children:[to("p",{children:v.t("general:noResults",{label:Array.isArray(d)?v.t("general:documents"):kg(D?.labels?.plural,v)})}),te&&to(ne,{onClick:B,children:v.t("general:createNewLabel",{label:kg(D?.labels?.singular,v)})})]}),I?.docs&&I.docs.length>0&&to(cc,{children:to(bg,{columns:G3(T),data:I,defaultLimit:s.defaultLimit??D?.admin?.pagination?.defaultLimit,defaultSort:s.defaultSort??D?.defaultSort,modifySearchParams:!1,onQueryChange:C,orderableFieldName:!s.orderable||Array.isArray(s.collection)?void 0:`_${s.collection}_${s.name}_order`,children:ni(sc,{collectionSlug:Array.isArray(d)?d[0]:d,columnState:T,LinkedCellOverride:to(j3,{onDrawerDelete:Z,onDrawerSave:G}),children:[to(Ar,{className:`${rr}__columns`,height:S?"auto":0,id:`${rr}-columns`,children:to("div",{className:`${rr}__columns-inner`,children:D&&to(cm,{collectionSlug:D.slug})})}),f,to(V3,{})]})})})]}),e,to(L,{initialData:l,onSave:X})]})};var z3=Mg.default.default||Mg.default,Im=({collectionSlug:t,config:e,docID:o,fields:n,segments:r})=>{let s=u$(n),i=r[0],a=s.find(c=>c.name===i);if(!a)return null;if(a.type==="relationship"||a.type==="upload"){let c=o;return Array.isArray(a.relationTo)&&(c={relationTo:t,value:o}),{[a.name]:a.hasMany?[c]:c}}let l=r.slice(1,r.length);if(a.type==="tab"||a.type==="group")return{[a.name]:Im({collectionSlug:t,config:e,docID:o,fields:a.fields,segments:l})};if(a.type==="array"){let c=Im({collectionSlug:t,config:e,docID:o,fields:a.fields,segments:l});return c.id=z3().toHexString(),{[a.name]:[c]}}if(a.type==="blocks")for(let c of a.blockReferences??a.blocks){let u=typeof c=="string"?e.blocksMap[c]:c,d=Im({collectionSlug:t,config:e,docID:o,fields:u.fields,segments:l});if(d)return d.id=z3().toHexString(),d.blockType=u.slug,{[a.name]:[d]}}},d$=t=>{let{field:e,field:{admin:{allowCreate:o,description:n},collection:r,label:s,localized:i,on:a,required:l},path:c}=t,{id:u,docConfig:d}=Ee(),{config:f,getEntityConfig:m}=H(),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},path:x,showError:y,value:C}=Te({potentiallyStalePath:c}),S=H3(()=>{if(!u)return null;let D=u;Array.isArray(e.targetField.relationTo)&&(D={relationTo:d.slug,value:D});let _=Array.isArray(r)?{}:{[a]:{equals:D}};return e.where?{and:[_,e.where]}:_},[u,r,e.targetField.relationTo,e.where,a,d?.slug]),w=H3(()=>{let D=m({collectionSlug:Array.isArray(e.collection)?e.collection[0]:e.collection});return Im({collectionSlug:d?.slug,config:f,docID:u,fields:D.fields,segments:e.on.split(".")})},[m,e.collection,e.on,d?.slug,u,f]);return d?c$("div",{className:[ye,y&&"error","join"].filter(Boolean).join(" "),id:`field-${x?.replace(/\./g,"__")}`,children:[si(oe,{CustomComponent:b,Fallback:si(He,{path:x,showError:y})}),si(Og,{AfterInput:h,allowCreate:typeof u<"u"&&o,BeforeInput:p,disableTable:S===null,field:e,filterOptions:S,initialData:u&&C?C:{docs:[]},initialDrawerData:w,Label:si("h4",{style:{margin:0},children:v||si(ve,{label:s,localized:i,path:x,required:l})}),parent:Array.isArray(r)?{id:u,collectionSlug:d.slug,joinPath:x}:void 0,relationTo:r}),si(oe,{CustomComponent:g,Fallback:si(Be,{description:n,path:x})})]}):null},mc=je(d$);import{jsx as ii,jsxs as X3}from"react/jsx-runtime";import m$,{useCallback as Bg,useEffect as f$,useMemo as p$,useState as Vg}from"react";var h$="json-field",g$=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r,maxHeight:s}={},jsonSchema:i,label:a,localized:l,required:c},path:u,readOnly:d,validate:f}=t,[m,h]=Vg(),p=m$.useRef("system"),[g,b]=Vg(""),v=Bg((P,L)=>{if(typeof f=="function")return f(P,{...L,jsonError:m,required:c})},[f,c,m]),{customComponents:{AfterInput:x,BeforeInput:y,Description:C,Error:S,Label:w}={},disabled:D,initialValue:_,path:A,setValue:F,showError:R,value:I}=Te({potentiallyStalePath:u,validate:v}),[E,T]=Vg(()=>(I||_)!==void 0?JSON.stringify(I??_,null,2):void 0),$=Bg((P,L)=>{if(!i)return;L.languages.json.jsonDefaults.setDiagnosticsOptions({enableSchemaRequest:!0,schemas:[...L.languages.json.jsonDefaults.diagnosticsOptions.schemas||[],i],validate:!0});let V=i.uri,M=V.includes("?")?`${V}&${crypto.randomUUID?crypto.randomUUID():wn()}`:`${V}?${crypto.randomUUID?crypto.randomUUID():wn()}`;P.setModel(L.editor.createModel(JSON.stringify(I,null,2),"json",L.Uri.parse(M)))},[i,I]),j=Bg(P=>{if(!(d||D)){p.current="user";try{F(P?JSON.parse(P):null),h(void 0)}catch(L){F(P||null),h(L)}}},[d,D,F]);f$(()=>{p.current==="system"&&(T((I||_)!==void 0?JSON.stringify(I??_,null,2):void 0),b(new Date().toString())),p.current="system"},[_,I]);let N=p$(()=>rt(e),[e]);return X3("div",{className:[ye,h$,o,R&&"error",(d||D)&&"read-only"].filter(Boolean).join(" "),style:N,children:[ii(oe,{CustomComponent:w,Fallback:ii(ve,{label:a,localized:l,path:A,required:c})}),X3("div",{className:`${ye}__wrap`,children:[ii(oe,{CustomComponent:S,Fallback:ii(He,{message:m,path:A,showError:R})}),y,ii($l,{defaultLanguage:"json",maxHeight:s,onChange:j,onMount:$,options:r,readOnly:d||D,value:E,wrapperProps:{id:`field-${A?.replace(/\./g,"__")}`}},g),x]}),ii(oe,{CustomComponent:C,Fallback:ii(Be,{description:n,path:A})})]})},fc=je(g$);import{jsx as _n,jsxs as U3}from"react/jsx-runtime";import{getTranslation as b$}from"@payloadcms/translations";import{isNumber as v$}from"payload/shared";import{useCallback as Gg,useEffect as x$,useMemo as y$,useState as C$}from"react";var w$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s=1}={},hasMany:i=!1,label:a,localized:l,max:c=1/0,maxRows:u=1/0,min:d=-1/0,required:f},onChange:m,path:h,readOnly:p,validate:g}=t,{i18n:b,t:v}=k(),x=Gg((P,L)=>{if(typeof g=="function")return g(P,{...L,max:c,min:d,required:f})},[g,d,c,f]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:D}={},disabled:_,path:A,setValue:F,showError:R,value:I}=Te({potentiallyStalePath:h,validate:x}),E=Gg(P=>{let L=parseFloat(P.target.value),V=L;Number.isNaN(L)&&(V=null),typeof m=="function"&&m(V),F(V)},[m,F]),[T,$]=C$([]),j=Gg(P=>{if(!(p||_)){let L;P?Array.isArray(P)?L=P.map(V=>Number(V.value?.value||V.value)):L=[Number(P.value?.value||P.value)]:L=[],F(L)}},[p,_,F]);x$(()=>{i&&Array.isArray(I)&&$(I.map((P,L)=>({id:`${P}${L}`,label:`${P}`,value:{toString:()=>`${P}${L}`,value:P?.value||P}})))},[I,i]);let N=y$(()=>rt(e),[e]);return U3("div",{className:[ye,"number",o,R&&"error",(p||_)&&"read-only",i&&"has-many"].filter(Boolean).join(" "),style:N,children:[_n(oe,{CustomComponent:D,Fallback:_n(ve,{label:a,localized:l,path:A,required:f})}),U3("div",{className:`${ye}__wrap`,children:[_n(oe,{CustomComponent:w,Fallback:_n(He,{path:A,showError:R})}),C,i?_n(mt,{className:`field-${A.replace(/\./g,"__")}`,disabled:p||_,filterOption:(P,L)=>{let V=Array.isArray(I)&&I.length>=u;return v$(L)&&!V},isClearable:!0,isCreatable:!0,isMulti:!0,isSortable:!0,noOptionsMessage:()=>Array.isArray(I)&&I.length>=u?v("validation:limitReached",{max:u,value:I.length+1}):null,onChange:j,options:[],placeholder:v("general:enterAValue"),showError:R,value:T}):_n("div",{children:_n("input",{disabled:p||_,id:`field-${A.replace(/\./g,"__")}`,max:c,min:d,name:A,onChange:E,onWheel:P=>{P.target.blur()},placeholder:b$(r,b),step:s,type:"number",value:typeof I=="number"?I:""})}),y,_n(oe,{CustomComponent:S,Fallback:_n(Be,{description:n,path:A})})]})]})},pc=je(w$);import{jsx as tn,jsxs as va}from"react/jsx-runtime";import{getTranslation as Wg}from"@payloadcms/translations";import{useCallback as Y3,useMemo as S$}from"react";var Z3="point",I$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s}={},label:i,localized:a,required:l},path:c,readOnly:u,validate:d}=t,{i18n:f,t:m}=k(),h=Y3((R,I)=>{if(typeof d=="function")return d(R,{...I,required:l})},[d,l]),{customComponents:{AfterInput:p,BeforeInput:g,Description:b,Error:v,Label:x}={},disabled:y,path:C,setValue:S,showError:w,value:D=[null,null]}=Te({potentiallyStalePath:c,validate:h}),_=Y3((R,I)=>{let E=parseFloat(R.target.value);Number.isNaN(E)&&(E=R.target.value);let T=[...D];T[I]=E,S(T)},[S,D]),A=R=>{let I=m(R==="longitude"?"fields:longitude":"fields:latitude"),E=i?Wg(i,f):"";return`${E}${E?" - ":""}${I}`},F=S$(()=>rt(e),[e]);return va("div",{className:[ye,Z3,o,w&&"error",(u||y)&&"read-only"].filter(Boolean).join(" "),style:F,children:[va("ul",{className:`${Z3}__wrap`,children:[va("li",{children:[tn(oe,{CustomComponent:x,Fallback:tn(ve,{label:A("longitude"),localized:a,path:C,required:l})}),va("div",{className:"input-wrapper",children:[g,tn("input",{disabled:u||y,id:`field-longitude-${C?.replace(/\./g,"__")}`,name:`${C}.longitude`,onChange:R=>_(R,0),placeholder:Wg(r,f),step:s,type:"number",value:D&&typeof D[0]=="number"?D[0]:""}),p]})]}),va("li",{children:[tn(oe,{CustomComponent:x,Fallback:tn(ve,{label:A("latitude"),localized:a,path:C,required:l})}),va("div",{className:"input-wrapper",children:[tn(oe,{CustomComponent:v,Fallback:tn(He,{path:C,showError:w})}),g,tn("input",{disabled:u||y,id:`field-latitude-${C?.replace(/\./g,"__")}`,name:`${C}.latitude`,onChange:R=>_(R,1),placeholder:Wg(r,f),step:s,type:"number",value:D&&typeof D[1]=="number"?D[1]:""}),p]})]})]}),tn(oe,{CustomComponent:b,Fallback:tn(Be,{description:n,path:C})})]})},hc=je(I$);import{jsx as Dn,jsxs as J3}from"react/jsx-runtime";import{optionIsObject as q3}from"payload/shared";import{useCallback as F$,useMemo as A$}from"react";import{c as R$}from"react/compiler-runtime";import{jsx as Rm,jsxs as _$}from"react/jsx-runtime";import{getTranslation as D$}from"@payloadcms/translations";import"react";var gc="radio-input",bc=t=>{let e=R$(16),{isSelected:o,onChange:n,option:r,path:s,readOnly:i,uuid:a}=t,{i18n:l}=k(),c=ct(),u=`field-${s}-${r.value}${c>1?`-${c}`:""}${a?`-${a}`:""}`,d=o&&`${gc}--is-selected`,f;e[0]!==d?(f=[gc,d].filter(Boolean),e[0]=d,e[1]=f):f=e[1];let m=f.join(" "),h;e[2]!==n||e[3]!==r.value?(h=()=>typeof n=="function"?n(r.value):null,e[2]=n,e[3]=r.value,e[4]=h):h=e[4];let p;if(e[5]!==l||e[6]!==u||e[7]!==o||e[8]!==r.label||e[9]!==s||e[10]!==i||e[11]!==m||e[12]!==h){let g=Rm("input",{checked:o,disabled:i,id:u,name:s,onChange:h,type:"radio"}),b=i&&`${gc}__styled-radio--disabled`,v;e[14]!==b?(v=[`${gc}__styled-radio`,b].filter(Boolean),e[14]=b,e[15]=v):v=e[15],p=Rm("label",{htmlFor:u,children:_$("div",{className:m,children:[g,Rm("span",{className:v.join(" ")}),Rm("span",{className:`${gc}__label`,children:D$(r.label,l)})]})}),e[5]=l,e[6]=u,e[7]=o,e[8]=r.label,e[9]=s,e[10]=i,e[11]=m,e[12]=h,e[13]=p}else p=e[13];return p};var _m="radio-group",T$=t=>{let{disableModifyingForm:e,field:o,field:{admin:{className:n,description:r,layout:s="horizontal"}={},label:i,localized:a,options:l=[],required:c}={},onChange:u,path:d,readOnly:f,validate:m,value:h}=t,{uuid:p}=Oe(),g=F$((I,E)=>{if(typeof m=="function")return m(I,{...E,options:l,required:c})},[m,l,c]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,path:w,setValue:D,showError:_,value:A}=Te({potentiallyStalePath:d,validate:g}),F=A||h,R=A$(()=>rt(o),[o]);return J3("div",{className:[ye,_m,n,`${_m}--layout-${s}`,_&&"error",(f||S)&&`${_m}--read-only`].filter(Boolean).join(" "),style:R,children:[Dn(oe,{CustomComponent:y,Fallback:Dn(He,{path:w,showError:_})}),Dn(oe,{CustomComponent:C,Fallback:Dn(ve,{label:i,localized:a,path:w,required:c})}),J3("div",{className:`${ye}__wrap`,children:[v,Dn("ul",{className:`${_m}--group`,id:`field-${w.replace(/\./g,"__")}`,children:l.map(I=>{let E="";q3(I)?E=I.value:E=I;let T=String(E)===String(F),$=`field-${w}-${E}${p?`-${p}`:""}`;return Dn("li",{children:Dn(bc,{id:$,isSelected:T,onChange:()=>{typeof u=="function"&&u(E),f||S||D(E,!!e)},option:q3(I)?I:{label:I,value:I},path:w,readOnly:f||S,uuid:p})},`${w} - ${E}`)})}),b,Dn(oe,{CustomComponent:x,Fallback:Dn(Be,{description:r,path:w})})]})]})},vc=je(T$);import{jsx as Mr,jsxs as Yg}from"react/jsx-runtime";import{dequal as ok}from"dequal/lite";import{wordBoundariesRegex as rk}from"payload/shared";import*as Zg from"qs-esm";import{useCallback as Fn,useEffect as Em,useMemo as pS,useReducer as nk,useRef as Cc,useState as ls}from"react";import{c as E$}from"react/compiler-runtime";import{jsx as on,jsxs as Dm}from"react/jsx-runtime";import{getTranslation as Q3}from"@payloadcms/translations";import{Fragment as Hg,useEffect as Fm,useState as xc}from"react";var xa="relationship-add-new",K3=t=>{let e=E$(45),{Button:o,hasMany:n,path:r,relationTo:s,setValue:i,unstyled:a,value:l}=t,c=um(s),{permissions:u}=De(),[d,f]=xc(!1),[m,h]=xc(),p=c.length>1,g;e[0]!==c[0]||e[1]!==p?(g=()=>p?void 0:c[0],e[0]=c[0],e[1]=p,e[2]=g):g=e[2];let[b,v]=xc(g),[x,y]=xc(!1),{i18n:C,t:S}=k(),[w,D]=xc(!1),_=b?.slug,A;e[3]!==_?(A={collectionSlug:_},e[3]=_,e[4]=A):A=e[4];let[F,R,I]=Jt(A),{isDrawerOpen:E,toggleDrawer:T}=I,$;e[5]!==b?.slug||e[6]!==n||e[7]!==s||e[8]!==i||e[9]!==l?($=z=>{let{doc:le,operation:J}=z;if(J==="create"){let ce=Array.isArray(s)?{relationTo:b?.slug,value:le.id}:le.id;(Array.isArray(s)&&Array.isArray(l)?!l.some(q=>q&&typeof q=="object"&&q.value===le.id):l!==le.id)&&i(n?[...Array.isArray(l)?l:[],ce]:ce),h(void 0)}},e[5]=b?.slug,e[6]=n,e[7]=s,e[8]=i,e[9]=l,e[10]=$):$=e[10];let j=$,N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=z=>{y(z)},e[11]=N):N=e[11];let P=N,L,V;e[12]!==u||e[13]!==c?(L=()=>{u&&(c.length===1?f(u.collections[c[0]?.slug]?.create):f(c.some(z=>u.collections[z?.slug]?.create)))},V=[u,c],e[12]=u,e[13]=c,e[14]=L,e[15]=V):(L=e[14],V=e[15]),Fm(L,V);let M,O;e[16]!==c||e[17]!==p||e[18]!==m?(O=()=>{p&&m&&v(c.find(z=>z?.slug===m))},M=[m,p,c],e[16]=c,e[17]=p,e[18]=m,e[19]=M,e[20]=O):(M=e[19],O=e[20]),Fm(O,M);let B,G;e[21]!==b||e[22]!==p||e[23]!==T?(B=()=>{p&&b&&(T(),h(void 0))},G=[T,p,b],e[21]=b,e[22]=p,e[23]=T,e[24]=B,e[25]=G):(B=e[24],G=e[25]),Fm(B,G);let X,Z;e[26]!==E||e[27]!==p?(X=()=>{p&&!E&&v(void 0)},Z=[E,p],e[26]=E,e[27]=p,e[28]=X,e[29]=Z):(X=e[28],Z=e[29]),Fm(X,Z);let te=c[0].labels.singular,U;if(e[30]!==o||e[31]!==F||e[32]!==R||e[33]!==b||e[34]!==C||e[35]!==j||e[36]!==r||e[37]!==u||e[38]!==x||e[39]!==c||e[40]!==d||e[41]!==w||e[42]!==S||e[43]!==a){U=Symbol.for("react.early_return_sentinel");e:{let z=S("fields:addNewLabel",{label:Q3(te,C)});if(d){U=Dm("div",{className:xa,id:`${r}-add-new`,children:[c.length===1&&Dm(Hg,{children:[on(R,{className:[`${xa}__add-button`,a&&`${xa}__add-button--unstyled`].filter(Boolean).join(" "),onClick:()=>D(!1),onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:o||Dm(Hg,{children:[on(go,{className:`${xa}__tooltip`,show:w,children:z}),on(jo,{})]})}),on(F,{onSave:j})]}),c.length>1&&Dm(Hg,{children:[on(ho,{button:o||on(ne,{buttonStyle:"none",className:`${xa}__add-button`,tooltip:x?void 0:S("fields:addNew"),children:on(jo,{})}),buttonType:"custom",horizontalAlign:"center",onToggleOpen:P,render:le=>{let{close:J}=le;return on(dp,{children:c.map(ce=>u.collections[ce?.slug].create?on(mp,{className:`${xa}__relation-button--${ce?.slug}`,onClick:()=>{J(),h(ce?.slug)},children:Q3(ce?.labels?.singular,C)},ce?.slug):null)})},size:"medium"}),b&&u.collections[b?.slug]?.create&&on(F,{onSave:j})]})]});break e}}e[30]=o,e[31]=F,e[32]=R,e[33]=b,e[34]=C,e[35]=j,e[36]=r,e[37]=u,e[38]=x,e[39]=c,e[40]=d,e[41]=w,e[42]=S,e[43]=a,e[44]=U}else U=e[44];return U!==Symbol.for("react.early_return_sentinel")?U:null};import{c as L$}from"react/compiler-runtime";import{jsx as Tm}from"react/jsx-runtime";import{createElement as $$}from"react";import{useEffect as rS,useId as k$,useState as nS}from"react";import{jsx as eS,jsxs as P$}from"react/jsx-runtime";import{hoistQueryParamsToAnd as N$}from"payload/shared";import{useCallback as Am,useEffect as tS,useState as zg}from"react";var oS=({allowCreate:t=!0,collectionSlugs:e,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,filterOptions:s,onBulkSelect:i,onSelect:a,overrideEntityVisibility:l=!0,selectedCollection:c})=>{let{closeModal:u,isModalOpen:d}=ue(),{serverFunction:f}=Dt(),[m,h]=zg(void 0),[p,g]=zg(!0),{config:{collections:b},getEntityConfig:v}=H(),x=d(n),y=b.filter(({slug:T})=>e.includes(T)),[C,S]=zg(()=>{let T=c||y[0]?.slug,$=v({collectionSlug:T});return $?{label:$.labels,value:$.slug}:void 0}),[w,D,{drawerSlug:_}]=Jt({collectionSlug:C.value}),A=eo(T=>{T&&T!==C?.value&&S({label:v({collectionSlug:T})?.labels,value:T})});tS(()=>{A(c)},[c]);let F=Am(async(T,$)=>{try{let j={...$||{},where:{...$?.where||{}}},N=s?.[T];s&&typeof N!="boolean"&&(j.where=N$(j.where,N));let{List:P}=await f({name:"render-list",args:{allowCreate:t,collectionSlug:T,disableBulkDelete:!0,disableBulkEdit:!0,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,overrideEntityVisibility:l,query:j}});h(P),g(!1)}catch(j){console.error("Error rendering List View: ",j),x&&u(n)}},[f,u,t,n,x,r,s,l,o]);tS(()=>{m||F(C.value)},[F,m,C.value]);let R=Am(({doc:T})=>{typeof a=="function"&&a({collectionSlug:C.value,doc:T,docID:T.id}),u(_),u(n)},[u,_,n,a,C.value]),I=Am(T=>{F(C.value,T)},[F,C.value]),E=Am(T=>{S(T),F(T.value)},[F]);return p?eS(In,{}):P$(pg,{allowCreate:t,createNewDrawerSlug:_,DocumentDrawerToggler:D,drawerSlug:n,enabledCollections:e,onBulkSelect:i,onQueryChange:I,onSelect:a,selectedOption:C,setSelectedOption:E,children:[m,eS(w,{onSave:R})]})};var sS="list-drawer",j$=({depth:t,uuid:e})=>`list-drawer_${t}_${e}`,O$=({children:t,className:e,disabled:o,drawerSlug:n,onClick:r,...s})=>Tm(ur,{className:[e,`${sS}__toggler`].filter(Boolean).join(" "),disabled:o,onClick:r,slug:n,...s,children:t}),M$=t=>{let{drawerSlug:e}=t;return Tm(Pt,{className:sS,gutter:!1,Header:null,slug:e,children:Tm(oS,{...t})})},ai=t=>{let e=L$(42),{collectionSlugs:o,filterOptions:n,selectedCollection:r,uploads:s}=t,{config:i}=H(),{collections:a}=i,l=ct(),c=k$(),{closeModal:u,modalState:d,openModal:f,toggleModal:m}=ue(),[h,p]=nS(!1),[g,b]=nS(o),v;e[0]!==l||e[1]!==c?(v=j$({depth:l,uuid:c}),e[0]=l,e[1]=c,e[2]=v):v=e[2];let x=v,y,C;e[3]!==x||e[4]!==d?(y=()=>{p(!!d[x]?.isOpen)},C=[d,x],e[3]=x,e[4]=d,e[5]=y,e[6]=C):(y=e[5],C=e[6]),rS(y,C);let S,w;e[7]!==g||e[8]!==a||e[9]!==s?(S=()=>{if(!g||g.length===0){let B=a.filter(G=>{let{upload:X}=G;return s?!!X:!0});b(B.map(B$))}},w=[g,s,a],e[7]=g,e[8]=a,e[9]=s,e[10]=S,e[11]=w):(S=e[10],w=e[11]),rS(S,w);let D;e[12]!==x||e[13]!==m?(D=()=>{m(x)},e[12]=x,e[13]=m,e[14]=D):D=e[14];let _=D,A;e[15]!==u||e[16]!==x?(A=()=>{u(x)},e[15]=u,e[16]=x,e[17]=A):A=e[17];let F=A,R;e[18]!==x||e[19]!==f?(R=()=>{f(x)},e[18]=x,e[19]=f,e[20]=R):R=e[20];let I=R,E,T;e[21]!==F||e[22]!==g||e[23]!==x||e[24]!==n||e[25]!==r||e[26]!==s?(T=B=>$$(M$,{...B,closeDrawer:F,collectionSlugs:g,drawerSlug:x,filterOptions:n,key:x,selectedCollection:r,uploads:s}),e[21]=F,e[22]=g,e[23]=x,e[24]=n,e[25]=r,e[26]=s,e[27]=T):T=e[27],E=T;let $=E,j,N;e[28]!==x?(N=B=>Tm(O$,{...B,drawerSlug:x}),e[28]=x,e[29]=N):N=e[29],j=N;let P=j,L,V;e[30]!==F||e[31]!==g||e[32]!==l||e[33]!==x||e[34]!==h||e[35]!==I||e[36]!==_?(V={closeDrawer:F,collectionSlugs:g,drawerDepth:l,drawerSlug:x,isDrawerOpen:h,openDrawer:I,setCollectionSlugs:b,toggleDrawer:_},e[30]=F,e[31]=g,e[32]=l,e[33]=x,e[34]=h,e[35]=I,e[36]=_,e[37]=V):V=e[37],L=V;let M=L,O;return e[38]!==$||e[39]!==M||e[40]!==P?(O=[$,P,M],e[38]=$,e[39]=M,e[40]=P,e[41]=O):O=e[41],O};function B$(t){let{slug:e}=t;return e}import{c as V$}from"react/compiler-runtime";import{useRef as G$}from"react";var Xg=(t,e)=>{let o=V$(3),n=G$(void 0),r;return o[0]!==t||o[1]!==e?(r=(...s)=>{let i=s,a=()=>{clearTimeout(n.current),t(...i)};clearTimeout(n.current),n.current=setTimeout(a,e)},o[0]=t,o[1]=e,o[2]=r):r=o[2],r};var Ug=({hasMany:t,relationTo:e,value:o})=>{let n=Array.isArray(e),r;if(Array.isArray(e)?r=e.reduce((i,a)=>({...i,[a]:[]}),{}):r={[e]:[]},o===null)return r;let s=(i,a)=>{(typeof a=="string"||typeof a=="number")&&typeof i=="string"&&(r[i]?r[i].push(a):r[i]=[a])};return t&&Array.isArray(o)?o.forEach(i=>{n&&typeof i=="object"&&"relationTo"in i&&"value"in i&&s(i.relationTo,i.value),!n&&typeof e=="string"&&s(e,i)}):n&&Array.isArray(e)?typeof o=="object"&&"relationTo"in o&&"value"in o&&s(o.relationTo,o.value):s(e,o),r};var iS=({allowEdit:t,options:e,value:o})=>{if(o||typeof o=="number"){if(Array.isArray(o))return o.map(r=>{let s;return e.forEach(i=>{s||(s=i.options.find(a=>typeof r=="object"?a.value===r.value&&a.relationTo===r.relationTo:r===a.value))}),s?{allowEdit:t,...s}:void 0});let n;return e.forEach(r=>{n||(n=r.options.find(s=>typeof o=="object"?s.value===o.value&&s.relationTo===o.relationTo:o===s.value))}),n?{allowEdit:t,...n}:void 0}};import{getTranslation as W$}from"@payloadcms/translations";var lS=t=>t.reduce((e,o)=>o.options?[...e,...lS(o.options)]:[...e,{id:o.value,relationTo:o.relationTo}],[]),aS=t=>t.sort((e,o)=>typeof e?.label?.localeCompare=="function"&&typeof o?.label?.localeCompare=="function"?e.label.localeCompare(o.label):0),cS=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,config:n,docs:r,i18n:s,ids:i=[],sort:a}=e,l=o.slug,c=lS(t),u=[...t],d=u.find(m=>m.label===o.labels.plural),f=r.reduce((m,h)=>{if(c.filter(p=>p.id===h.id&&p.relationTo===l).length===0){c.push({id:h.id,relationTo:l});let p=dr({collectionConfig:o,data:h,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${h.id}`,i18n:s});return[...m,{label:p,relationTo:l,value:h.id}]}return m},[]);if(i.forEach(m=>{c.filter(h=>h.id===m&&h.relationTo===l).length===0&&(c.push({id:m,relationTo:l}),f.push({allowEdit:!1,label:`${s.t("general:untitled")} - ID: ${m}`,relationTo:l,value:m}))}),d){let m=[...d.options,...f];d.options=a?aS(m):m}else u.push({label:W$(o.labels.plural,s),options:a?aS(f):f});return u}case"CLEAR":{let o=e.exemptValues?Array.isArray(e.exemptValues)?e.exemptValues:[e.exemptValues]:[];return t.filter(r=>{let s=r.options.filter(i=>o?o.some(a=>a&&i.value===(typeof a=="object"?a.value:a)):!1);return r.options=s,s.length>0})}case"REMOVE":{let{id:o,collection:n}=e,r=[...t],s=r.findIndex(i=>i.label===n.labels.plural);return s===-1||(r[s]={...r[s],options:r[s].options.filter(i=>i.value!==o)}),r}case"UPDATE":{let{collection:o,config:n,doc:r,i18n:s}=e,i=o.slug,a=[...t],l=dr({collectionConfig:o,data:r,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${r.id}`,i18n:s}),u=a.find(d=>d.label===o.labels.plural)?.options?.find(d=>d.value===r.id);return u&&(u.label=l,u.relationTo=i),a}default:return t}};import{c as H$}from"react/compiler-runtime";import{jsx as yc,jsxs as uS}from"react/jsx-runtime";import{Fragment as z$,useState as X$}from"react";var ya="relationship--multi-value-label",dS=t=>{let e=H$(26),{data:o,selectProps:n}=t,{allowEdit:r,label:s,relationTo:i,value:a}=o,l;e[0]!==n?(l=n===void 0?{}:n,e[0]=n,e[1]=l):l=e[1];let{customProps:c}=l,u;e[2]!==c?(u=c===void 0?{}:c,e[2]=c,e[3]=u):u=e[3];let{draggableProps:d,onDocumentDrawerOpen:f}=u,{permissions:m}=De(),[h,p]=X$(!1),{t:g}=k(),b=!!m?.collections?.[i]?.read,v;e[4]!==d?(v=d||{},e[4]=d,e[5]=v):v=e[5];let x;if(e[6]!==r||e[7]!==b||e[8]!==s||e[9]!==f||e[10]!==t||e[11]!==i||e[12]!==h||e[13]!==g||e[14]!==v||e[15]!==a){let y;e[17]!==r||e[18]!==b||e[19]!==s||e[20]!==f||e[21]!==i||e[22]!==h||e[23]!==g||e[24]!==a?(y=i&&b&&r!==!1&&yc(z$,{children:uS("button",{"aria-label":`Edit ${s}`,className:`${ya}__drawer-toggler`,onClick:()=>{p(!1),f({id:a,collectionSlug:i,hasReadPermission:b})},onKeyDown:U$,onMouseDown:Y$,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onTouchEnd:Z$,type:"button",children:[yc(go,{className:`${ya}__tooltip`,show:h,children:g("general:editLabel",{label:""})}),yc(Rr,{className:`${ya}__icon`})]})}),e[17]=r,e[18]=b,e[19]=s,e[20]=f,e[21]=i,e[22]=h,e[23]=g,e[24]=a,e[25]=y):y=e[25],x=uS("div",{className:ya,children:[yc("div",{className:`${ya}__content`,children:yc(co.MultiValueLabel,{...t,innerProps:{className:`${ya}__text`,...v}})}),y]}),e[6]=r,e[7]=b,e[8]=s,e[9]=f,e[10]=t,e[11]=i,e[12]=h,e[13]=g,e[14]=v,e[15]=a,e[16]=x}else x=e[16];return x};function U$(t){t.key==="Enter"&&t.stopPropagation()}function Y$(t){return t.stopPropagation()}function Z$(t){return t.stopPropagation()}import{c as J$}from"react/compiler-runtime";import{jsx as Ca,jsxs as mS}from"react/jsx-runtime";import{Fragment as q$,useState as Q$}from"react";var wa="relationship--single-value",fS=t=>{let e=J$(24),{children:o,data:n,selectProps:r}=t,{allowEdit:s,label:i,relationTo:a,value:l}=n,c;e[0]!==r?(c=r===void 0?{}:r,e[0]=r,e[1]=c):c=e[1];let{customProps:u}=c,d;e[2]!==u?(d=u===void 0?{}:u,e[2]=u,e[3]=d):d=e[3];let{onDocumentDrawerOpen:f}=d,[m,h]=Q$(!1),{t:p}=k(),{permissions:g}=De(),b=!!g?.collections?.[a]?.read,v;if(e[4]!==s||e[5]!==o||e[6]!==b||e[7]!==i||e[8]!==f||e[9]!==t||e[10]!==a||e[11]!==m||e[12]!==p||e[13]!==l){let x;e[15]!==s||e[16]!==b||e[17]!==i||e[18]!==f||e[19]!==a||e[20]!==m||e[21]!==p||e[22]!==l?(x=a&&b&&s!==!1&&Ca(q$,{children:mS("button",{"aria-label":p("general:editLabel",{label:i}),className:`${wa}__drawer-toggler`,onClick:()=>{h(!1),f({id:l,collectionSlug:a,hasReadPermission:b})},onKeyDown:K$,onMouseDown:ek,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onTouchEnd:tk,type:"button",children:[Ca(go,{className:`${wa}__tooltip`,show:m,children:p("general:edit")}),Ca(Rr,{})]})}),e[15]=s,e[16]=b,e[17]=i,e[18]=f,e[19]=a,e[20]=m,e[21]=p,e[22]=l,e[23]=x):x=e[23],v=Ca(co.SingleValue,{...t,className:wa,children:Ca("div",{className:`${wa}__label`,children:mS("div",{className:`${wa}__label-text`,children:[Ca("div",{className:`${wa}__text`,children:o}),x]})})}),e[4]=s,e[5]=o,e[6]=b,e[7]=i,e[8]=f,e[9]=t,e[10]=a,e[11]=m,e[12]=p,e[13]=l,e[14]=v}else v=e[14];return v};function K$(t){t.key==="Enter"&&t.stopPropagation()}function ek(t){return t.stopPropagation()}function tk(t){return t.stopPropagation()}var sk=10,wc="relationship",ik=t=>{let{field:e,field:{admin:{allowCreate:o=!0,allowEdit:n=!0,appearance:r="select",className:s,description:i,isSortable:a=!0,sortOptions:l}={},hasMany:c,label:u,localized:d,relationTo:f,required:m},path:h,readOnly:p,validate:g}=t,{config:b,getEntityConfig:v}=H(),{routes:{api:x},serverURL:y}=b,{i18n:C,t:S}=k(),{permissions:w}=De(),{code:D}=Pe(),_=Array.isArray(f),[A,F]=ls({id:void 0,collectionSlug:void 0,hasReadPermission:!1}),[R,I]=ls(-1),[E,T]=ls({}),[$,j]=ls(""),[N,P]=ls(""),[L,V]=ls(!1),[M,O]=ls(!1),[B,G]=ls(!1),X=Cc(!1),Z=Fn((W,ee)=>{if(typeof g=="function")return g(W,{...ee,required:m})},[g,m]),{customComponents:{AfterInput:te,BeforeInput:U,Description:z,Error:le,Label:J}={},disabled:ce,filterOptions:re,initialValue:q,path:pe,setValue:he,showError:Re,value:ge}=Te({potentiallyStalePath:h,validate:Z}),[Ve,Q]=nk(cS,[]),Le=Cc(ge);Le.current=ge;let[_e,,{isDrawerOpen:ae,openDrawer:se}]=Jt({id:A.id,collectionSlug:A.collectionSlug}),Y=pS(()=>{let W=re;return ge&&(Array.isArray(ge)?ge:[ge]).forEach(ee=>{(Array.isArray(f)?f:[f]).forEach(fe=>{W={...re||{},[fe]:{...typeof re?.[fe]=="object"?re[fe]:{},id:{not_in:[typeof ee=="object"?ee.value:ee]}}}})}),W},[re,ge,f]),[ie,,{closeDrawer:de,isDrawerOpen:Ce,openDrawer:ze}]=ai({collectionSlugs:_?f:[f],filterOptions:Y}),$e=Fn(({collectionSlug:W,doc:ee})=>{let fe=_?{relationTo:W,value:ee.id}:ee.id;if(c){let Ae=Array.isArray(ge)?ge:[];Ae.push(fe),he(Ae)}else he(fe);de()},[c,_,he,de,ge]),ot=Cc(!1),Xe=Fn(async({filterOptions:W,lastFullyLoadedRelation:ee,lastLoadedPage:fe,onSuccess:Ae,search:Ne,sort:we,value:We})=>{if(!w)return;let Kt=typeof ee<"u"?ee:-1,Ot=Array.isArray(f)?f:[f],lt=Kt===-1?Ot:Ot.slice(Kt+1),fo=0,ro=Ug({hasMany:c,relationTo:f,value:We});$||(await lt.reduce(async(ko,ke)=>{let po=W?.[ke],Xo;if(N!==Ne?Xo=1:Xo=fe[ke]+1,await ko,po===!1)return I(Ot.indexOf(ke)),Promise.resolve();if(fo<10){let zt=v({collectionSlug:ke}),Yr=zt?.admin?.useAsTitle||"id",Ei=zt?.defaultSort||"id";typeof l=="string"?Ei=l:l?.[ke]&&(Ei=l[ke]);let tl={depth:0,draft:!0,limit:sk,locale:D,page:Xo,sort:Ei,where:{and:[{id:{not_in:ro[ke]}}]}};Ne&&tl.where.and.push({[Yr]:{like:Ne}}),po&&typeof po!="boolean"&&tl.where.and.push(po);let _s=await fetch(`${y}${x}/${ke}`,{body:Zg.stringify(tl),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(_s.ok){let Pi=await _s.json();T(Ni=>({...Ni,[ke]:Xo})),Pi.nextPage||I(Ot.indexOf(ke)),Pi.docs.length>0&&(fo+=Pi.docs.length,Q({type:"ADD",collection:zt,config:b,docs:Pi.docs,i18n:C,sort:we}))}else _s.status===403?(I(Ot.indexOf(ke)),Q({type:"ADD",collection:zt,config:b,docs:[],i18n:C,ids:ro[ke],sort:we})):j(S("error:unspecific"))}},Promise.resolve()),typeof Ae=="function"&&Ae())},[w,f,c,$,N,v,D,y,l,x,C,b,S]),Ue=Xg((W,ee)=>{Xe({filterOptions:re,lastLoadedPage:{},search:W,sort:!0,value:ee}),P(W)},300),ft=Fn((W,ee)=>{N!==W&&(T({}),Ue(W,ee,W!==""))},[N,Ue]),Qt=eo(W=>{let ee=Ug({hasMany:c,relationTo:f,value:W});Object.entries(ee).reduce(async(fe,[Ae,Ne])=>{await fe;let we=Ne.filter(We=>!Ve.find(Kt=>Kt?.options?.find(Ot=>Ot.value===We&&Ot.relationTo===Ae)));if(we.length>0){let We={depth:0,draft:!0,limit:we.length,locale:D,where:{id:{in:we}}};if(!$){let Kt=await fetch(`${y}${x}/${Ae}`,{body:Zg.stringify(We),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"}),Ot=v({collectionSlug:Ae}),lt=[];Kt.ok&&(lt=(await Kt.json()).docs),Q({type:"ADD",collection:Ot,config:b,docs:lt,i18n:C,ids:we,sort:!0})}}},Promise.resolve())}),Ge=Cc(ge),Je=Cc(!0);Em(()=>{(Je.current||!ok(ge,Ge.current))&&Qt(ge),Je.current=!1,Ge.current=ge},[ge]),Em(()=>{let ee=(Array.isArray(f)?f:[f]).reduce((fe,Ae)=>(v({collectionSlug:Ae})?.admin?.useAsTitle||"id")==="id"&&fe,!0);O(!ee)},[f,v]);let Ye=eo(async W=>await Xe(W));Em(()=>{X.current&&B&&(V(!0),Ye({filterOptions:re,lastLoadedPage:{},onSuccess:()=>{X.current=!0,V(!1)},value:Le.current})),Q({type:"CLEAR",exemptValues:Le.current}),I(-1),T({})},[f,re,D,pe,B]);let xt=Fn(W=>{Q({type:"UPDATE",collection:W.collectionConfig,config:b,doc:W.doc,i18n:C});let ee=Le.current,fe=W.doc.id;if(c){let Ae=ee.some(we=>typeof we=="string"?we===fe:we.value===fe),Ne=ee.map(we=>we.value===fe?{relationTo:W.collectionConfig.slug,value:fe}:we);he(Ne,Ae)}else{let Ae=ee===fe;he({relationTo:W.collectionConfig.slug,value:fe},Ae)}},[C,b,c,he]),jt=Fn(W=>{Q({type:"ADD",collection:W.collectionConfig,config:b,docs:[W.doc],i18n:C,sort:!0}),he(c?Le.current?Le.current.concat({relationTo:W.collectionConfig.slug,value:W.doc.id}):null:{relationTo:W.collectionConfig.slug,value:W.doc.id})},[C,b,c,he]),gt=Fn(W=>{Q({id:W.id,type:"REMOVE",collection:W.collectionConfig,config:b,i18n:C}),he(c&&Le.current?Le.current.filter(ee=>ee.value!==W.id):null)},[C,b,c,he]),qe=Fn((W,ee)=>{if(!ee)return!0;let fe=rk(ee||""),Ae=250,Ne=String(W.label);for(;Ne.length>Ae;){let we=Ne.indexOf(" ",ee.length);if(fe.test(Ne.slice(0,we===-1?ee.length:we+1)))return!0;Ne=Ne.slice(we===-1?ee.length:we+1)}return fe.test(Ne.slice(-Ae))},[]),Tt=Fn(({id:W,collectionSlug:ee,hasReadPermission:fe})=>{ot.current=!0,F({id:W,collectionSlug:ee,hasReadPermission:fe})},[]);Em(()=>{ot.current&&(se(),ot.current=!1)},[se,A]);let be=iS({allowEdit:n,options:Ve,value:ge});!Array.isArray(be)&&be?.value==="null"&&(be.value=null);let K=pS(()=>rt(e),[e]);return Yg("div",{className:[ye,wc,s,Re&&"error",$&&"error-loading",(p||ce)&&`${wc}--read-only`,!(p||ce)&&o&&`${wc}--allow-create`].filter(Boolean).join(" "),id:`field-${pe.replace(/\./g,"__")}`,style:K,children:[Mr(oe,{CustomComponent:J,Fallback:Mr(ve,{label:u,localized:d,path:pe,required:m})}),Yg("div",{className:`${ye}__wrap`,children:[Mr(oe,{CustomComponent:le,Fallback:Mr(He,{path:pe,showError:Re})}),U,!$&&Yg("div",{className:`${wc}__wrap`,children:[Mr(mt,{backspaceRemovesValue:!(ae||Ce),components:{MultiValueLabel:dS,SingleValue:fS,...r!=="select"&&{DropdownIndicator:null}},customProps:{disableKeyDown:ae||Ce,disableMouseDown:ae||Ce,onDocumentDrawerOpen:Tt,onSave:xt},disabled:p||ce||ae||Ce,filterOption:M?qe:void 0,getOptionValue:W=>{if(W)return c&&Array.isArray(f)?`${W.relationTo}_${W.value}`:W.value},isLoading:r==="select"&&L,isMulti:c,isSearchable:r==="select",isSortable:a,menuIsOpen:r==="select"?B:!1,onChange:p||ce?void 0:W=>{W===null?he(c?[]:null):c&&Array.isArray(W)?he(W?W.map(ee=>_?{relationTo:ee.relationTo,value:ee.value}:ee.value):null):_&&!Array.isArray(W)?he({relationTo:W.relationTo,value:W.value}):Array.isArray(W)||he(W.value)},onInputChange:W=>ft(W,ge),onMenuClose:()=>{G(!1)},onMenuOpen:()=>{r==="drawer"?ze():r==="select"&&(G(!0),X.current||(V(!0),Xe({filterOptions:re,lastLoadedPage:{},onSuccess:()=>{X.current=!0,V(!1)},value:q})))},onMenuScrollToBottom:()=>{Xe({filterOptions:re,lastFullyLoadedRelation:R,lastLoadedPage:E,search:N,sort:!1,value:q})},options:Ve,showError:Re,value:be??null}),!(p||ce)&&o&&Mr(K3,{hasMany:c,path:pe,relationTo:f,setValue:he,value:ge})]}),$&&Mr("div",{className:`${wc}__error-loading`,children:$}),te,Mr(oe,{CustomComponent:z,Fallback:Mr(Be,{description:i,path:pe})})]}),A.collectionSlug&&A.hasReadPermission&&Mr(_e,{onDelete:gt,onDuplicate:jt,onSave:xt}),r==="drawer"&&!p&&Mr(ie,{allowCreate:o,enableRowSelections:!1,onSelect:$e})]})},Sc=je(ik);var Ic=()=>null;import{jsx as Jg}from"react/jsx-runtime";import"react";var hS="row",ak=t=>{let{field:{admin:{className:e,style:o}={},fields:n},forceRender:r=!1,indexPath:s="",parentPath:i="",parentSchemaPath:a="",permissions:l,readOnly:c}=t;return Jg(E2,{children:Jg("div",{className:[ye,hS,e].filter(Boolean).join(" "),style:o||void 0,children:Jg(So,{className:`${hS}__fields`,fields:n,forceRender:r,margins:!1,parentIndexPath:s,parentPath:i,parentSchemaPath:a,permissions:l,readOnly:c})})})},Rc=je(ak);import{jsx as ck}from"react/jsx-runtime";import uk,{useCallback as bS,useMemo as dk}from"react";import{c as lk}from"react/compiler-runtime";import{jsx as li,jsxs as gS}from"react/jsx-runtime";import{getTranslation as qg}from"@payloadcms/translations";import"react";var Sa=t=>{let e=lk(39),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:a,hasMany:l,isClearable:c,isSortable:u,label:d,Label:f,localized:m,onChange:h,onInputChange:p,options:g,path:b,readOnly:v,required:x,showError:y,style:C,value:S}=t,w=l===void 0?!1:l,D=c===void 0?!0:c,_=u===void 0?!0:u,{i18n:A}=k(),F;if(e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==a||e[4]!==f||e[5]!==r||e[6]!==i||e[7]!==w||e[8]!==A||e[9]!==D||e[10]!==_||e[11]!==d||e[12]!==m||e[13]!==h||e[14]!==p||e[15]!==g||e[16]!==b||e[17]!==v||e[18]!==x||e[19]!==y||e[20]!==C||e[21]!==S){let R;if(w&&Array.isArray(S)){let j;e[23]!==A||e[24]!==g?(j=N=>{let P=g.find(L=>L.value===N);return{label:P?qg(P.label,A):N,value:P?.value??N}},e[23]=A,e[24]=g,e[25]=j):j=e[25],R=S.map(j)}else if(S){let j,N;if(e[26]!==A||e[27]!==g||e[28]!==S){let P;e[31]!==S?(P=L=>L.value===S,e[31]=S,e[32]=P):P=e[32],j=g.find(P),N=j?qg(j.label,A):S,e[26]=A,e[27]=g,e[28]=S,e[29]=j,e[30]=N}else j=e[29],N=e[30];R={label:N,value:j?.value??S}}else R=null;let I=y&&"error",E=v&&"read-only",T;e[33]!==r||e[34]!==I||e[35]!==E?(T=[ye,"select",r,I,E].filter(Boolean),e[33]=r,e[34]=I,e[35]=E,e[36]=T):T=e[36];let $;e[37]!==A?($=j=>({...j,label:qg(j.label,A)}),e[37]=A,e[38]=$):$=e[38],F=gS("div",{className:T.join(" "),id:`field-${b.replace(/\./g,"__")}`,style:C,children:[li(oe,{CustomComponent:f,Fallback:li(ve,{label:d,localized:m,path:b,required:x})}),gS("div",{className:`${ye}__wrap`,children:[li(oe,{CustomComponent:a,Fallback:li(He,{path:b,showError:y})}),n,li(mt,{disabled:v,isClearable:D,isMulti:w,isSortable:_,onChange:h,onInputChange:p,options:g.map($),showError:y,value:R}),o]}),li(oe,{CustomComponent:s,Fallback:li(Be,{description:i,path:b})})]}),e[0]=o,e[1]=n,e[2]=s,e[3]=a,e[4]=f,e[5]=r,e[6]=i,e[7]=w,e[8]=A,e[9]=D,e[10]=_,e[11]=d,e[12]=m,e[13]=h,e[14]=p,e[15]=g,e[16]=b,e[17]=v,e[18]=x,e[19]=y,e[20]=C,e[21]=S,e[22]=F}else F=e[22];return F};var mk=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e}),fk=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,isClearable:s=!0,isSortable:i=!0}={},hasMany:a=!1,label:l,localized:c,options:u=[],required:d},onChange:f,path:m,readOnly:h,validate:p}=t,g=uk.useMemo(()=>mk(u),[u]),b=bS((E,T)=>{if(typeof p=="function")return p(E,{...T,hasMany:a,options:g,required:d})},[p,d,a,g]),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Error:C,Label:S}={},disabled:w,path:D,setValue:_,showError:A,value:F}=Te({potentiallyStalePath:m,validate:b}),R=bS(E=>{if(!h||w){let T=null;E&&a?Array.isArray(E)?T=E.map($=>$.value):T=[]:E&&!Array.isArray(E)&&(T=E.value),typeof f=="function"&&f(T),_(T)}},[h,w,a,_,f]),I=dk(()=>rt(e),[e]);return ck(Sa,{AfterInput:v,BeforeInput:x,className:n,Description:y,description:r,Error:C,hasMany:a,isClearable:s,isSortable:i,Label:S,label:l,localized:c,name:o,onChange:R,options:g,path:D,readOnly:h||w,required:d,showError:A,style:I,value:F})},_c=je(fk);import{c as kS}from"react/compiler-runtime";import{jsx as Tn,jsxs as jS}from"react/jsx-runtime";import{getTranslation as ej}from"@payloadcms/translations";import{tabHasName as km,toKebabCase as tj}from"payload/shared";import{useEffect as $S,useState as ab}from"react";var ES=Ds(eb(),1);import{jsx as Br}from"react/jsx-runtime";import{dequal as TS}from"dequal/lite";import{useRouter as Wk}from"next/navigation.js";import{deepCopyObjectSimpleWithoutReactComponents as nb,getDataByPath as Hk,getSiblingData as zk,reduceFieldsToValues as sb,wait as Xk}from"payload/shared";import Uk,{useCallback as Wo,useEffect as ui,useReducer as Yk,useRef as Ac,useState as us}from"react";import{c as vk}from"react/compiler-runtime";import{jsx as CS,jsxs as xk}from"react/jsx-runtime";import yk from"react";function Ck(t){let e=[];for(let o of t)if(o){let n=o.split(" \u2192 "),r=!1;for(let s=0;s<e.length;s++)if(e[s].startsWith(n[0])){e.splice(s+1,0,o),r=!0;break}r||e.push(o)}return e}function wk(t){let[e,o]=t.split(":");if(!o)return{message:e};let n=o.split(",").map(r=>r.replaceAll(" > "," \u2192 ").trim());return n.length===1?{errors:n,message:`${e}:`}:{errors:Ck(n),message:`${e} (${n.length}):`}}function wS(t){let e=vk(5),{errorMessage:o}=t,n;e[0]!==o?(n=()=>wk(o),e[0]=o,e[1]=n):n=e[1];let[r]=yk.useState(n),{errors:s,message:i}=r,a;return e[2]!==s||e[3]!==i?(a=xk("div",{children:[i,Array.isArray(s)&&s.length>0?CS("ul",{"data-testid":"field-errors",children:s.map(Sk)}):null]}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function Sk(t,e){return CS("li",{children:t},e)}import{c as Ik}from"react/compiler-runtime";import{useEffect as SS,useState as Rk}from"react";function tb(t,e,o){let n=Ik(11),r;n[0]!==t?(r=()=>t,n[0]=t,n[1]=r):r=n[1];let[s,i]=Rk(r),a;n[2]!==o||n[3]!==t?(a=()=>{let d=setTimeout(()=>{i(()=>t)},o);return()=>{clearTimeout(d)}},n[2]=o,n[3]=t,n[4]=a):a=n[4];let l;n[5]!==o||n[6]!==e?(l=[...e,o],n[5]=o,n[6]=e,n[7]=l):l=n[7],SS(a,l);let c,u;n[8]!==s?(c=()=>{s()},u=[s],n[8]=s,n[9]=c,n[10]=u):(c=n[9],u=n[10]),SS(c,u)}import{useCallback as _k,useRef as IS}from"react";function Nm(){let t=IS([]),e=IS(!1);return{queueTask:_k((n,r)=>{t.current.push(n);async function s(){if(!e.current&&!(typeof r?.beforeProcess=="function"&&r.beforeProcess()===!1))for(;t.current.length>0;){let i=t.current.pop();t.current=[],e.current=!0;try{await i()}catch(a){console.error("Error in queued function:",a)}finally{e.current=!1,typeof r?.afterProcess=="function"&&r.afterProcess()}}}s()},[])}}import{c as Dk}from"react/compiler-runtime";import{jsx as Fk}from"react/jsx-runtime";import RS,{useState as Ak}from"react";var _S=RS.createContext(null),ob=t=>{let e=Dk(6),{children:o}=t,[n,r]=Ak(Tk),s;e[0]!==n?(s=u=>{let{collectionSlug:d}=u;return n.get(d)},e[0]=n,e[1]=s):s=e[1];let i=s,a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=u=>{let{collectionSlug:d,handler:f}=u;r(m=>{let h=new Map(m);return h.set(d,f),h})},e[2]=a):a=e[2];let l=a,c;return e[3]!==o||e[4]!==i?(c=Fk(_S,{value:{getUploadHandler:i,setUploadHandler:l},children:o}),e[3]=o,e[4]=i,e[5]=c):c=e[5],c},Dc=()=>{let t=RS.use(_S);if(t===null)throw new Error("useUploadHandlers must be used within UploadHandlersProvider");return t};function Tk(){return new Map}var DS={413:"Your request was too large to submit successfully."};var rb=Ds(fg(),1);import{dequal as Pk}from"dequal/lite";import{deepCopyObjectSimpleWithoutReactComponents as AS}from"payload/shared";import{dequal as Ek}from"dequal/lite";var FS=({acceptValues:t,currentState:e={},incomingState:o})=>{let n={...e};for(let[r,s]of Object.entries(o||{}))!(r in e)&&!s.addedByServer||(!t&&!s.addedByServer&&(delete s.value,delete s.initialValue),n[r]={...e[r],...s},Array.isArray(s.rows)&&r in e&&(n[r].rows=[...e[r]?.rows||[]],s.rows.forEach(i=>{let a=e[r].rows.findIndex(l=>l.id===i.id);a>-1&&(n[r].rows[a]={...e[r].rows[a],...i})})),s.valid!==!1&&(n[r].valid=!0),s.passesCondition!==!1&&(n[r].passesCondition=!0),delete n[r].addedByServer);return Ek(n,e)?e:n};var Ia=(t,e)=>{let o={},n=Object.entries(e).reduce((r,[s,i])=>{let a=r;if(s.indexOf(`${t}.`)===0){let[l]=s.replace(`${t}.`,"").split(".");a[l]||(a[l]={}),a[l][s.replace(`${t}.${String(l)}.`,"")]={...i}}else o[s]=i;return a},[]);return{remainingFields:o,rows:n}},Ra=(t,e)=>e.reduce((o,n,r)=>({...o,...Object.entries(n).reduce((s,[i,a])=>({...s,[`${t}.${r}.${i}`]:{...a}}),{})}),{});var cs=rb.default.default||rb.default;function Fc(t,e){switch(e.type){case"ADD_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,i=typeof r=="number"?r:t[n]?.rows?.length||0,a=[...t[n]?.rows||[]],l={id:s?.id?.value||new cs().toHexString(),collapsed:!1,isLoading:!0};o&&(l.blockType=o),a.splice(i,0,l),o&&(s.blockType={initialValue:o,valid:!0,value:o});let{remainingFields:c,rows:u}=Ia(n,t);return u.splice(i,0,s),{...c,...Ra(n,u),[`${n}.${i}.id`]:{initialValue:l.id,passesCondition:!0,valid:!0,value:l.id},[n]:{...t[n],disableFormData:!0,rows:a,value:u.length}}}case"ADD_SERVER_ERRORS":{let o={...t},n=[];return e.errors.forEach(({message:r,path:s})=>{o[s]={...o[s]||{initialValue:null,value:null},errorMessage:r,valid:!1};let i=s.split(".");i.length>1&&n.push({fieldErrorPath:s,parentPath:i.slice(0,i.length-1).join(".")})}),o=Object.entries(o).reduce((r,[s,i])=>{let a=n.reduce((c,{fieldErrorPath:u,parentPath:d})=>(d.startsWith(s)&&c.push(u),c),[]),l=!1;if(a.length>0){let c=Array.isArray(i.errorPaths)?i.errorPaths:[];a.forEach(u=>{c.includes(u)||(c.push(u),l=!0)}),l&&(r[s]={...i,errorPaths:c})}return l||(r[s]=i),r},{}),o}case"DUPLICATE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=Ia(o,t),i=[...t[o].rows||[]],a=AS(i[n]);a.id&&(a.id=new cs().toHexString());let l=AS(s[n]);l.id&&(l.id.value=new cs().toHexString(),l.id.initialValue=new cs().toHexString());for(let u of Object.keys(l).filter(d=>d.endsWith(".id"))){let d=l[u];d&&typeof d.value=="string"&&cs.isValid(d.value)&&(l[u].value=new cs().toHexString(),l[u].initialValue=new cs().toHexString())}return Object.keys(l).length>0&&(s.splice(n+1,0,l),i.splice(n+1,0,a)),{...r,...Ra(o,s),[o]:{...t[o],disableFormData:!0,rows:i,value:s.length}}}case"MERGE_SERVER_STATE":{let{acceptValues:o,prevStateRef:n,serverState:r}=e,s=FS({acceptValues:o,currentState:t||{},incomingState:r});return n.current=s,s}case"MOVE_ROW":{let{moveFromIndex:o,moveToIndex:n,path:r}=e,{remainingFields:s,rows:i}=Ia(r,t),a=i[o];i.splice(o,1),i.splice(n,0,a);let l=[...t[r]?.rows||[]],c={...l[o]};return l.splice(o,1),l.splice(n,0,c),{...s,...Ra(r,i),[r]:{...t[r],rows:l}}}case"REMOVE":{let o={...t};return o[e.path]&&delete o[e.path],o}case"REMOVE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=Ia(o,t),i=[...t[o]?.rows||[]];return s.splice(n,1),i.splice(n,1),{...r,[o]:{...t[o],disableFormData:s.length>0,rows:i,value:s.length},...Ra(o,s)}}case"REPLACE_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,{remainingFields:i,rows:a}=Ia(n,t),l=Math.max(0,Math.min(r,a?.length-1||0)),c=[...t[n]?.rows||[]];return c[l]={id:new cs().toHexString(),blockType:o||void 0,collapsed:!1},o&&(s.blockType={initialValue:o,valid:!0,value:o}),a[l]=s,{...i,...Ra(n,a),[n]:{...t[n],disableFormData:!0,rows:c,value:a.length}}}case"REPLACE_STATE":{if(e.optimize!==!1){let o={};for(let[n,r]of Object.entries(e.state)){let s=t[n];r.valid!==!1&&(r.valid=!0),r.passesCondition!==!1&&(r.passesCondition=!0),Pk(s,r)?s&&(o[n]=s):o[n]=r}return o}if(e.sanitize)for(let o of Object.values(e.state))o.valid!==!1&&(o.valid=!0),o.passesCondition!==!1&&(o.passesCondition=!0);return e.state}case"SET_ALL_ROWS_COLLAPSED":{let{path:o,updatedRows:n}=e;return{...t,[o]:{...t[o],rows:n}}}case"SET_ROW_COLLAPSED":{let{path:o,updatedRows:n}=e;return{...t,[o]:{...t[o],rows:n}}}case"UPDATE":{let o=Object.entries(e).reduce((r,[s,i])=>["disableFormData","errorMessage","initialValue","rows","valid","validate","value"].includes(s)?{...r,[s]:i}:r,t?.[e.path]||{});return{...t,[e.path]:o}}case"UPDATE_MANY":{let o={...t};return Object.entries(e.formState).forEach(([n,r])=>{o[n]=r}),o}default:return t}}var Nk=()=>{},Lk=()=>{},$k=()=>{},kk=()=>{},jk=()=>{},Ok=()=>{},Mk=()=>{},Bk=()=>{},Vk=()=>{},Gk=()=>{},Lm={addFieldRow:()=>{},buildRowErrors:()=>{},createFormData:jk,disabled:!1,dispatchFields:$k,fields:{},formRef:null,getData:()=>{},getDataByPath:()=>{},getField:()=>{},getFields:()=>({}),getSiblingData:Lk,initializing:void 0,isValid:!0,moveFieldRow:()=>{},removeFieldRow:()=>{},replaceFieldRow:()=>{},replaceState:()=>{},reset:Gk,setBackgroundProcessing:Bk,setDisabled:()=>{},setIsValid:()=>{},setModified:Ok,setProcessing:Mk,setSubmitted:Vk,submit:Nk,validateForm:kk};var Zk="form",An=t=>{let{id:e,collectionSlug:o,docConfig:n,docPermissions:r,getDocPreferences:s,globalSlug:i}=Ee(),{action:a,beforeSubmit:l,children:c,className:u,disabled:d,disableSuccessStatus:f,disableValidationOnSubmit:m,el:h,handleResponse:p,initialState:g,isDocumentForm:b,isInitializing:v,onChange:x,onSubmit:y,onSuccess:C,redirect:S,submitted:w,uuid:D,waitForAutocomplete:_}=t,A="method"in t?t?.method:void 0,F=Wk(),R=$i(),{code:I}=Pe(),{i18n:E,t:T}=k(),{refreshCookie:$,user:j}=De(),N=Qo(),{queueTask:P}=Nm(),{getFormState:L}=Dt(),{startRouteTransition:V}=st(),{getUploadHandler:M}=Dc(),{config:O}=H(),[B,G]=us(d||!1),[X,Z]=us(!1),[te,U]=us(!1),[z,le]=us(!0),[J,ce]=us(v),[re,q]=us(!1),[pe,he]=us(!1),[Re,ge]=us(!1),Ve=Ac(null),Q=Ac({}),Le=Ac(null),_e=Ac(!0),ae=Yk(Fc,{},()=>g),[se,Y]=ae;Q.current.fields=se;let ie=Ac(se),de=Wo(async()=>{let W={},ee=!0,fe=Q.current.getData(),Ae=Object.entries(Q.current.fields).map(async([Ne,we])=>{let We=we,Kt=Ne?Ne.split("."):[];if(we.passesCondition!==!1){let Ot=We.valid;if("validate"in we&&typeof we.validate=="function"){let lt=we.value;we?.rows&&Array.isArray(we.rows)&&(lt=Q.current.getDataByPath(Ne)),Ot=await we.validate(lt,{...we,id:e,collectionSlug:o,blockData:void 0,data:R?.getData?R.getData():fe,event:"submit",operation:N,path:Kt,preferences:{},req:{payload:{config:O},t:T,user:j},siblingData:Q.current.getSiblingData(Ne)}),typeof Ot=="string"?(We.errorMessage=Ot,We.valid=!1):(We.valid=!0,We.errorMessage=void 0)}We.valid===!1&&(ee=!1)}W[Ne]=We});return await Promise.all(Ae),TS(Q.current.fields,W)||Y({type:"REPLACE_STATE",state:W}),le(ee),ee},[o,O,Y,e,N,T,j,R]),Ce=Wo(async(W={},ee)=>{let{action:fe=a,method:Ae=A,overrides:Ne={},skipValidation:we}=W;if(B){ee&&ee.preventDefault();return}let We,Kt,Ot=new Promise((ke,po)=>{Kt=ke,We=po}),lt=fe||typeof a=="string"||typeof a=="function";if(S||f||!lt?(Kt=ke=>me.success(ke),We=ke=>me.error(ke)):me.promise(Ot,{error:ke=>ke,loading:T("general:submitting"),success:ke=>ke}),ee&&(ee.stopPropagation(),ee.preventDefault()),q(!0),G(!0),_&&await Xk(100),Array.isArray(l)){let ke,po=nb(Q.current.fields);await l.reduce(async(zt,Yr)=>{await zt,ke=await Yr({formState:po})},Promise.resolve());let Xo=Object.entries(ke).every(([,zt])=>zt.valid!==!1);if(le(Xo),!Xo)return q(!1),ge(!0),G(!1),Y({type:"REPLACE_STATE",state:ke})}let fo=we||m?!0:await Q.current.validateForm();if(le(fo),!fo){We(T("error:correctInvalidFields")),q(!1),ge(!0),G(!1);return}let ro={};if(typeof Ne=="function"?ro=Ne(Q.current.fields):typeof Ne=="object"&&(ro=Ne),y){let ke=nb(Q.current.fields),po=sb(ke,!0);for(let[Xo,zt]of Object.entries(ro))po[Xo]=zt;y(ke,po)}if(!lt){q(!1),ge(!0),G(!1);return}let ko=await Q.current.createFormData(ro,{mergeOverrideData:typeof Ne!="function"});try{let ke;if(typeof fe=="string"?ke=await Qe[Ae.toLowerCase()](fe,{body:ko,headers:{"Accept-Language":E.language}}):typeof a=="function"&&(ke=await a(ko)),U(!1),G(!1),typeof p=="function"){p(ke,Kt,We);return}let po=ke.headers.get("content-type"),Xo=po&&po.indexOf("application/json")!==-1,zt={};if(Xo&&(zt=await ke.json()),ke.status<400){if(typeof C=="function"){let Yr=await C(zt);Yr&&Y({type:"MERGE_SERVER_STATE",acceptValues:!0,prevStateRef:ie,serverState:Yr})}ge(!1),q(!1),S?V(()=>F.push(S)):f||Kt(zt.message||T("general:submissionSuccessful"))}else{if(q(!1),ge(!0),Q.current={...Q.current},zt.message){We(zt.message);return}if(Array.isArray(zt.errors)){let[Ei,tl]=zt.errors.reduce(([_s,Pi],Ni)=>{let cv=[],Bf=[];return Ni?.message&&Bf.push(Ni),Array.isArray(Ni?.data?.errors)&&Ni.data?.errors.forEach(Vf=>{Vf?.path?cv.push(Vf):Bf.push(Vf)}),[[..._s,...cv],[...Pi,...Bf]]},[[],[]]);le(!1),Y({type:"ADD_SERVER_ERRORS",errors:Ei}),tl.forEach(_s=>{We(Br(wS,{errorMessage:_s.message||T("error:unknown")}))});return}let Yr=DS?.[ke.status]||ke?.statusText||T("error:unknown");We(Yr)}}catch(ke){console.error("Error submitting form",ke),q(!1),ge(!0),G(!1),We(ke.message)}},[l,V,a,f,m,B,Y,p,A,y,C,S,F,T,E,_]),ze=Wo(()=>Q.current.fields,[]),$e=Wo(W=>Q.current.fields[W],[]),ot=Wo(()=>sb(Q.current.fields,!0),[]),Xe=Wo(W=>zk(Q.current.fields,W),[]),Ue=Wo(W=>Hk(Q.current.fields,W),[]),ft=Wo(async(W,{mergeOverrideData:ee=!0})=>{let fe=sb(Q.current.fields,!0),Ae=fe?.file;if(n&&"upload"in n&&n.upload&&Ae){delete fe.file;let We=M({collectionSlug:o});if(typeof We=="function"){let Kt=Ae.name,Ot=await We({file:Ae,updateFilename:lt=>{Kt=lt}});Ae=JSON.stringify({clientUploadContext:Ot,collectionSlug:o,filename:Kt,mimeType:Ae.type,size:Ae.size})}}ee?fe={...fe,...W}:fe=W;let Ne={_payload:JSON.stringify(fe)};return n&&"upload"in n&&n.upload&&Ae&&(Ne.file=Ae),(0,ES.serialize)(Ne,{indices:!0,nullsAsUndefineds:!1})},[o,n,M]),Qt=Wo(async W=>{let ee=or(Le),fe=await s(),{state:Ae}=await L({id:e,collectionSlug:o,data:W,docPermissions:r,docPreferences:fe,globalSlug:i,locale:I,operation:N,renderAllFields:!0,schemaPath:o||i,signal:ee.signal,skipValidation:!0});Q.current={...Lm},U(!1),Y({type:"REPLACE_STATE",state:Ae}),Le.current=null},[o,Y,i,e,N,L,r,s,I]),Ge=Wo(W=>{Q.current={...Lm},U(!1),Y({type:"REPLACE_STATE",state:W})},[Y]),Je=Wo(({blockType:W,path:ee,rowIndex:fe,subFieldState:Ae})=>{let Ne=Ue(ee)||[],we=fe===void 0?Ne.length:fe;Y({type:"ADD_ROW",blockType:W,path:ee,rowIndex:we,subFieldState:Ae}),U(!0)},[Y,Ue]),Ye=Wo(({moveFromIndex:W,moveToIndex:ee,path:fe})=>{Y({type:"MOVE_ROW",moveFromIndex:W,moveToIndex:ee,path:fe}),U(!0)},[Y]),xt=Wo(({path:W,rowIndex:ee})=>{Y({type:"REMOVE_ROW",path:W,rowIndex:ee}),U(!0)},[Y]),jt=Wo(({blockType:W,path:ee,rowIndex:fe,subFieldState:Ae})=>{let Ne=Ue(ee),we=fe===void 0?Ne.length:fe;Y({type:"REPLACE_ROW",blockType:W,path:ee,rowIndex:we,subFieldState:Ae}),U(!0)},[Y,Ue]);ui(()=>{let W=Le.current;return()=>{tr(W)}},[]),ui(()=>{v!==void 0&&ce(v)},[v]),Q.current.submit=Ce,Q.current.getFields=ze,Q.current.getField=$e,Q.current.getData=ot,Q.current.getSiblingData=Xe,Q.current.getDataByPath=Ue,Q.current.validateForm=de,Q.current.createFormData=ft,Q.current.setModified=U,Q.current.setProcessing=q,Q.current.setBackgroundProcessing=he,Q.current.setSubmitted=ge,Q.current.setIsValid=le,Q.current.disabled=B,Q.current.setDisabled=G,Q.current.formRef=Ve,Q.current.reset=Qt,Q.current.replaceState=Ge,Q.current.dispatchFields=Y,Q.current.addFieldRow=Je,Q.current.removeFieldRow=xt,Q.current.moveFieldRow=Ye,Q.current.replaceFieldRow=jt,Q.current.uuid=D,Q.current.initializing=J,Q.current.isValid=z,ui(()=>{Z(!0)},[]),ui(()=>{typeof d=="boolean"&&G(d)},[d]),ui(()=>{typeof w=="boolean"&&ge(w)},[w]),ui(()=>{g&&(Q.current={...Lm},Y({type:"REPLACE_STATE",optimize:!1,sanitize:!0,state:g}))},[g,Y]),Bs(()=>{$()},15e3,[se]),ui(()=>{Q.current={...Q.current},U(!1)},[I]);let gt=[u,Zk].filter(Boolean).join(" "),qe=eo(W=>{P(async()=>{if(Array.isArray(x)){let ee;for(let fe of x)ee=await fe({formState:nb(se),submitted:W});Y({type:"MERGE_SERVER_STATE",prevStateRef:ie,serverState:ee})}})});tb(()=>{(_e.current||!TS(se,ie.current))&&te&&qe(Re),ie.current=se,_e.current=!1},[te,Re,se],250);let Tt=b?Au:Uk.Fragment,be=b?{value:Q.current}:{};return Br(h||"form",{action:typeof a=="function"?void 0:a,className:gt,method:A,noValidate:!0,onSubmit:W=>void Q.current.submit({},W),ref:Ve,children:Br(Tt,{...be,children:Br(Fu,{value:Q.current,children:Br(Tu,{value:{fields:se,...Q.current},children:Br(Eu,{value:Re,children:Br(op,{value:!X||X&&J,children:Br(Pu,{value:re,children:Br(tp,{value:pe,children:Br(Nu,{value:te,children:Br(al.Provider,{value:ae,children:c})})})})})})})})})})};import{c as Jk}from"react/compiler-runtime";import{jsx as PS,jsxs as NS}from"react/jsx-runtime";import{getTranslation as qk}from"@payloadcms/translations";import{tabHasName as LS}from"payload/shared";import Qk,{useState as Kk}from"react";var $m="tabs-field__tab-button",ib=t=>{let e=Jk(15),{hidden:o,isActive:n,parentPath:r,setIsActive:s,tab:i}=t,{i18n:a}=k(),[l,c]=Kk(void 0),u;if(e[0]!==l||e[1]!==o||e[2]!==a||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i){let d=[...r?r.split(".").slice(0,-1):[],...LS(i)?[i.name]:[]],f=l>0,m=PS(Ys,{fields:i.fields,path:d,setErrorCount:c}),h=f&&`${$m}--has-error`,p=n&&`${$m}--active`,g=o&&`${$m}--hidden`,b;e[8]!==h||e[9]!==p||e[10]!==g?(b=[$m,h,p,g].filter(Boolean),e[8]=h,e[9]=p,e[10]=g,e[11]=b):b=e[11];let v;e[12]!==a||e[13]!==i?(v=i.label?qk(i.label,a):LS(i)?i.name:"",e[12]=a,e[13]=i,e[14]=v):v=e[14],u=NS(Qk.Fragment,{children:[m,NS("button",{className:b.join(" "),onClick:s,type:"button",children:[v,f&&PS(io,{count:l,i18n:a})]})]}),e[0]=l,e[1]=o,e[2]=a,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=u}else u=e[7];return u};var En="tabs-field";function _a({activeTabConfig:t,path:e}){let o=e;return km(t)&&t.name&&(e?o=`${e}.${t.name}`:o=t.name),o}var oj=t=>{let e=kS(89),{field:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:a,permissions:l,readOnly:c}=t,{admin:u,tabs:d}=o,f;e[0]!==u?(f=u===void 0?{}:u,e[0]=u,e[1]=f):f=e[1];let{className:m}=f,h;e[2]!==d?(h=d===void 0?[]:d,e[2]=d,e[3]=h):h=e[3];let p=h,g=n===void 0?!1:n,b=r===void 0?"":r,v=s===void 0?"":s,x=i===void 0?"":i,y=a===void 0?"":a,{getPreference:C,setPreference:S}=Fo(),{preferencesKey:w}=Ee(),{i18n:D}=k(),{isWithinCollapsible:_}=qn(),A;e[4]!==p?(A=_e=>{let[ae]=_e;return p.map((se,Y)=>{let ie=se?.id;return{index:Y,passesCondition:ae?.[ie]?.passesCondition??!0,tab:se}})},e[4]=p,e[5]=A):A=e[5];let F=Et(A),R;e[6]!==F?(R=()=>F.filter(nj)?.[0]?.index??0,e[6]=F,e[7]=R):R=e[7];let[I,E]=ab(R),T=`tabs-${b}`,$;e[8]!==I||e[9]!==v||e[10]!==p?($=()=>_a({activeTabConfig:p[I],path:v}),e[8]=I,e[9]=v,e[10]=p,e[11]=$):$=e[11];let[j,N]=ab($),P;e[12]!==x||e[13]!==p[0]?(P=()=>_a({activeTabConfig:p[0],path:x}),e[12]=x,e[13]=p[0],e[14]=P):P=e[14];let[L,V]=ab(P),M;e[15]!==I||e[16]!==j||e[17]!==v||e[18]!==p?(M=km(p[I])?j:v,e[15]=I,e[16]=j,e[17]=v,e[18]=p,e[19]=M):M=e[19];let O=M,B=F[I],G=B?.tab,X;e[20]!==I||e[21]!==L||e[22]!==x||e[23]!==p?(X=km(p[I])?L:x,e[20]=I,e[21]=L,e[22]=x,e[23]=p,e[24]=X):X=e[24];let Z=X,te=G.admin?.description??G.description,U;e[25]!==te||e[26]!==D?(U=typeof te=="function"?te({i18n:D,t:D.t}):te,e[25]=te,e[26]=D,e[27]=U):U=e[27];let z=U,le=F.some(sj),J;e[28]!==C||e[29]!==v||e[30]!==x||e[31]!==y||e[32]!==w||e[33]!==S||e[34]!==p||e[35]!==T?(J=async _e=>{E(_e),N(_a({activeTabConfig:p[_e],path:v})),V(_a({activeTabConfig:p[_e],path:x}));let ae=await C(w);w&&S(w,{...ae,...y?{fields:{...ae?.fields||{},[y]:{...ae?.fields?.[y],tabIndex:_e}}}:{fields:{...ae?.fields,[T]:{...ae?.fields?.[T],tabIndex:_e}}}})},e[28]=C,e[29]=v,e[30]=x,e[31]=y,e[32]=w,e[33]=S,e[34]=p,e[35]=T,e[36]=J):J=e[36];let ce=J,re,q;e[37]!==C||e[38]!==v||e[39]!==x||e[40]!==y||e[41]!==w||e[42]!==p||e[43]!==T?(re=()=>{w&&(async()=>{let ae=await C(w),Y=(y?ae?.fields?.[y]?.tabIndex:ae?.fields?.[T]?.tabIndex)||0;E(Y),N(_a({activeTabConfig:p[Y],path:v})),V(_a({activeTabConfig:p[Y],path:x}))})()},q=[y,C,w,T,p,v,x],e[37]=C,e[38]=v,e[39]=x,e[40]=y,e[41]=w,e[42]=p,e[43]=T,e[44]=re,e[45]=q):(re=e[44],q=e[45]),$S(re,q);let pe;e[46]!==B?.passesCondition||e[47]!==ce||e[48]!==F?(pe=()=>{if(B?.passesCondition===!1){let _e=F.find(ij);_e&&ce(_e.index)}},e[46]=B?.passesCondition,e[47]=ce,e[48]=F,e[49]=pe):pe=e[49];let he;e[50]!==B||e[51]!==ce||e[52]!==F?(he=[B,F,ce],e[50]=B,e[51]=ce,e[52]=F,e[53]=he):he=e[53],$S(pe,he);let Re=_&&`${En}--within-collapsible`,ge=!le&&`${En}--hidden`,Ve;e[54]!==m||e[55]!==Re||e[56]!==ge?(Ve=[ye,m,En,Re,ge].filter(Boolean),e[54]=m,e[55]=Re,e[56]=ge,e[57]=Ve):Ve=e[57];let Q=Ve.join(" "),Le;if(e[58]!==O||e[59]!==Z||e[60]!==G||e[61]!==I||e[62]!==B||e[63]!==j||e[64]!==z||e[65]!==g||e[66]!==ce||e[67]!==b||e[68]!==y||e[69]!==l||e[70]!==c||e[71]!==Q||e[72]!==F){let _e;e[74]!==I||e[75]!==ce||e[76]!==y?(_e=se=>{let{index:Y,passesCondition:ie,tab:de}=se;return Tn(ib,{hidden:!ie,isActive:I===Y,parentPath:y,setIsActive:()=>{ce(Y)},tab:de},Y)},e[74]=I,e[75]=ce,e[76]=y,e[77]=_e):_e=e[77];let ae;e[78]!==O||e[79]!==Z||e[80]!==G||e[81]!==B||e[82]!==j||e[83]!==z||e[84]!==g||e[85]!==b||e[86]!==l||e[87]!==c?(ae=G&&Tn(rj,{description:z,fields:G.fields,forceRender:g,hidden:!1,parentIndexPath:km(G)?"":`${b?b+"-":""}`+String(B.index),parentPath:O,parentSchemaPath:Z,path:j,permissions:l&&typeof l=="object"&&"name"in G?l[G.name]&&typeof l[G.name]=="object"&&"fields"in l[G.name]?l[G.name].fields:l[G.name]:l,readOnly:c}),e[78]=O,e[79]=Z,e[80]=G,e[81]=B,e[82]=j,e[83]=z,e[84]=g,e[85]=b,e[86]=l,e[87]=c,e[88]=ae):ae=e[88],Le=Tn("div",{className:Q,children:jS(dg,{children:[Tn("div",{className:`${En}__tabs-wrap`,children:Tn("div",{className:`${En}__tabs`,children:F.map(_e)})}),Tn("div",{className:`${En}__content-wrap`,children:ae})]})}),e[58]=O,e[59]=Z,e[60]=G,e[61]=I,e[62]=B,e[63]=j,e[64]=z,e[65]=g,e[66]=ce,e[67]=b,e[68]=y,e[69]=l,e[70]=c,e[71]=Q,e[72]=F,e[73]=Le}else Le=e[73];return Le},Tc=je(oj);function rj(t){let e=kS(19),{description:o,fields:n,forceRender:r,hidden:s,label:i,parentIndexPath:a,parentPath:l,parentSchemaPath:c,permissions:u,readOnly:d}=t,{i18n:f}=k(),{customComponents:m,path:h}=Te(),p;e[0]!==m?(p=m===void 0?{}:m,e[0]=m,e[1]=p):p=e[1];let{AfterInput:g,BeforeInput:b,Description:v,Field:x}=p;if(x)return x;let y=s&&`${En}__tab--hidden`,C=i&&`${En}__tabConfigLabel-${tj(ej(i,f))}`,S;e[2]!==y||e[3]!==C?(S=[y,`${En}__tab`,C].filter(Boolean),e[2]=y,e[3]=C,e[4]=S):S=e[4];let w=S.join(" "),D;return e[5]!==g||e[6]!==b||e[7]!==v||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==a||e[12]!==l||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==d||e[17]!==w?(D=jS("div",{className:w,children:[Tn(oe,{CustomComponent:v,Fallback:Tn(Be,{description:o,marginPlacement:"bottom",path:h})}),b,Tn(So,{fields:n,forceRender:r,parentIndexPath:a,parentPath:l,parentSchemaPath:c,permissions:u,readOnly:d}),g]}),e[5]=g,e[6]=b,e[7]=v,e[8]=o,e[9]=n,e[10]=r,e[11]=a,e[12]=l,e[13]=c,e[14]=h,e[15]=u,e[16]=d,e[17]=w,e[18]=D):D=e[18],D}function nj(t){let{passesCondition:e}=t;return e}function sj(t){let{passesCondition:e}=t;return e}function ij(t){let{passesCondition:e}=t;return e}import{jsx as dj}from"react/jsx-runtime";import{useCallback as MS,useEffect as mj,useMemo as fj,useState as pj}from"react";import{c as aj}from"react/compiler-runtime";import{jsx as ds,jsxs as OS}from"react/jsx-runtime";import{getTranslation as lj}from"@payloadcms/translations";import"react";var lb=t=>{let e=aj(31),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:a,hasMany:l,inputRef:c,Label:u,label:d,localized:f,maxRows:m,onChange:h,onKeyDown:p,path:g,placeholder:b,readOnly:v,required:x,rtl:y,showError:C,style:S,value:w,valueToRender:D}=t,{i18n:_,t:A}=k(),F=uj,R=C&&"error",I=v&&"read-only",E=l&&"has-many",T;e[0]!==r||e[1]!==R||e[2]!==I||e[3]!==E?(T=[ye,"text",r,R,I,E].filter(Boolean),e[0]=r,e[1]=R,e[2]=I,e[3]=E,e[4]=T):T=e[4];let $=T.join(" "),j;return e[5]!==o||e[6]!==n||e[7]!==s||e[8]!==a||e[9]!==u||e[10]!==i||e[11]!==l||e[12]!==_||e[13]!==c||e[14]!==d||e[15]!==f||e[16]!==m||e[17]!==h||e[18]!==p||e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==x||e[23]!==y||e[24]!==C||e[25]!==S||e[26]!==A||e[27]!==$||e[28]!==w||e[29]!==D?(j=OS("div",{className:$,style:S,children:[ds(oe,{CustomComponent:u,Fallback:ds(ve,{label:d,localized:f,path:g,required:x})}),OS("div",{className:`${ye}__wrap`,children:[ds(oe,{CustomComponent:a,Fallback:ds(He,{path:g,showError:C})}),n,l?ds(mt,{className:`field-${g.replace(/\./g,"__")}`,components:{DropdownIndicator:null},customProps:{editableProps:F},disabled:v,filterOption:()=>m?!(Array.isArray(w)&&m&&w.length>=m):!0,isClearable:!1,isCreatable:!0,isMulti:!0,isSortable:!0,menuIsOpen:!1,noOptionsMessage:()=>Array.isArray(w)&&w.length>=m?A("validation:limitReached",{max:m,value:w.length+1}):null,onChange:h,options:[],placeholder:A("general:enterAValue"),showError:C,value:D}):ds("input",{"data-rtl":y,disabled:v,id:`field-${g?.replace(/\./g,"__")}`,name:g,onChange:h,onKeyDown:p,placeholder:lj(b,_),ref:c,type:"text",value:w||""}),o,ds(oe,{CustomComponent:s,Fallback:ds(Be,{description:i,path:g})})]})]}),e[5]=o,e[6]=n,e[7]=s,e[8]=a,e[9]=u,e[10]=i,e[11]=l,e[12]=_,e[13]=c,e[14]=d,e[15]=f,e[16]=m,e[17]=h,e[18]=p,e[19]=g,e[20]=b,e[21]=v,e[22]=x,e[23]=y,e[24]=C,e[25]=S,e[26]=A,e[27]=$,e[28]=w,e[29]=D,e[30]=j):j=e[30],j};function cj(t){t.currentTarget.contentEditable="false"}function uj(t,e,o){let n=`${e}--editable`;return{onBlur:cj,onClick:r=>{r.currentTarget.contentEditable="true",r.currentTarget.classList.add(n),r.currentTarget.focus()},onKeyDown:r=>{if(r.key==="Enter"||r.key==="Tab"||r.key==="Escape"){if(r.currentTarget.contentEditable="false",r.currentTarget.classList.remove(n),t.value.value=r.currentTarget.innerText,t.label=r.currentTarget.innerText,t.value.value.replaceAll(`
|
|
54
|
-
`,""))o.onChange(o.value,{action:"create-option",option:t});else if(Array.isArray(o.value)){let s=o.value.filter(i=>i.id!==t.id);o.onChange(s,{action:"pop-value",removedValue:t})}r.preventDefault()}r.stopPropagation()}}}var hj=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rtl:s}={},hasMany:i,label:a,localized:l,maxLength:c,maxRows:u,minLength:d,minRows:f,required:m},inputRef:h,path:p,readOnly:g,validate:b}=t,v=Pe(),{config:{localization:x}}=H(),y=MS((L,V)=>{if(typeof b=="function")return b(L,{...V,maxLength:c,minLength:d,required:m})},[b,d,c,m]),{customComponents:{AfterInput:C,BeforeInput:S,Description:w,Error:D,Label:_}={},disabled:A,path:F,setValue:R,showError:I,value:E}=Te({potentiallyStalePath:p,validate:y}),T=Zi({fieldLocalized:l,fieldRTL:s,locale:v,localizationConfig:x||void 0}),[$,j]=pj([]),N=MS(L=>{if(!(g||A)){let V;L?Array.isArray(L)?V=L.map(M=>M.value?.value||M.value):V=[L.value?.value||L.value]:V=[],R(V)}},[g,R,A]);mj(()=>{i&&Array.isArray(E)&&j(E.map((L,V)=>({id:`${L}${V}`,label:`${L}`,value:{toString:()=>`${L}${V}`,value:L?.value||L}})))},[E,i]);let P=fj(()=>rt(e),[e]);return dj(lb,{AfterInput:C,BeforeInput:S,className:o,Description:w,description:n,Error:D,hasMany:i,inputRef:h,Label:_,label:a,localized:l,maxRows:u,minRows:f,onChange:i?N:L=>{R(L.target.value)},path:F,placeholder:r,readOnly:g||A,required:m,rtl:T,showError:I,style:P,value:E||"",valueToRender:$})},di=je(hj);import{jsx as vj}from"react/jsx-runtime";import{getTranslation as xj}from"@payloadcms/translations";import{useCallback as yj,useMemo as Cj}from"react";import{c as gj}from"react/compiler-runtime";import{jsx as ms,jsxs as BS}from"react/jsx-runtime";import{getTranslation as bj}from"@payloadcms/translations";import"react";var cb=t=>{let e=gj(25),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:a,Label:l,label:c,localized:u,onChange:d,path:f,placeholder:m,readOnly:h,required:p,rows:g,rtl:b,showError:v,style:x,value:y}=t,{i18n:C}=k(),S=v&&"error",w=h&&"read-only",D;e[0]!==r||e[1]!==S||e[2]!==w?(D=[ye,"textarea",r,S,w].filter(Boolean),e[0]=r,e[1]=S,e[2]=w,e[3]=D):D=e[3];let _=D.join(" "),A;return e[4]!==o||e[5]!==n||e[6]!==s||e[7]!==a||e[8]!==l||e[9]!==i||e[10]!==C||e[11]!==c||e[12]!==u||e[13]!==d||e[14]!==f||e[15]!==m||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==_||e[23]!==y?(A=BS("div",{className:_,style:x,children:[ms(oe,{CustomComponent:l,Fallback:ms(ve,{label:c,localized:u,path:f,required:p})}),BS("div",{className:`${ye}__wrap`,children:[ms(oe,{CustomComponent:a,Fallback:ms(He,{path:f,showError:v})}),n,ms("label",{className:"textarea-outer",htmlFor:`field-${f.replace(/\./g,"__")}`,children:ms("textarea",{"data-rtl":b,disabled:h,id:`field-${f.replace(/\./g,"__")}`,name:f,onChange:d,placeholder:bj(m,C),rows:g,value:y||""})}),o,ms(oe,{CustomComponent:s,Fallback:ms(Be,{description:i,path:f})})]})]}),e[4]=o,e[5]=n,e[6]=s,e[7]=a,e[8]=l,e[9]=i,e[10]=C,e[11]=c,e[12]=u,e[13]=d,e[14]=f,e[15]=m,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=_,e[23]=y,e[24]=A):A=e[24],A};var wj=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rows:s,rtl:i}={},label:a,localized:l,maxLength:c,minLength:u,required:d},path:f,readOnly:m,validate:h}=t,{i18n:p}=k(),{config:{localization:g}}=H(),b=Pe(),v=Zi({fieldLocalized:l,fieldRTL:i,locale:b,localizationConfig:g||void 0}),x=yj((T,$)=>{if(typeof h=="function")return h(T,{...$,maxLength:c,minLength:u,required:d})},[h,d,c,u]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:D}={},disabled:_,path:A,setValue:F,showError:R,value:I}=Te({potentiallyStalePath:f,validate:x}),E=Cj(()=>rt(e),[e]);return vj(cb,{AfterInput:y,BeforeInput:C,className:o,Description:S,description:n,Error:w,Label:D,label:a,localized:l,onChange:T=>{F(T.target.value)},path:A,placeholder:xj(r,p),readOnly:m||_,required:d,rows:s,rtl:v,showError:R,style:E,value:I})},Ec=je(wj);var Pc=()=>null;import{jsx as YO}from"react/jsx-runtime";import ZO,{useMemo as JO}from"react";import{jsx as $t,jsxs as bi,Fragment as Uc}from"react/jsx-runtime";import*as UI from"qs-esm";import zr,{useCallback as HI,useEffect as zI,useMemo as XI}from"react";import{c as kI}from"react/compiler-runtime";import{jsx as pi,jsxs as $O}from"react/jsx-runtime";import{validateMimeType as kO}from"payload/shared";import nn from"react";import{jsx as Om,jsxs as ub}from"react/jsx-runtime";import Aj from"react";import{jsx as Sj}from"react/jsx-runtime";import fs from"react";var VS=t=>{t.preventDefault(),t.stopPropagation()},Ij="dropzone";function mi({children:t,className:e,disabled:o=!1,dropzoneStyle:n="default",multipleFiles:r,onChange:s}){let i=fs.useRef(null),[a,l]=fs.useState(!1),c=fs.useCallback(p=>{if(!r&&p.length>1){let g=new DataTransfer;g.items.add(p[0]),s(g.files)}else s(p)},[r,s]),u=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),p.clipboardData.files&&p.clipboardData.files.length>0&&c(p.clipboardData.files)},[c]),d=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),l(!0)},[]),f=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),l(!1)},[]),m=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),l(!1),p.dataTransfer.files&&p.dataTransfer.files.length>0&&(c(p.dataTransfer.files),l(!1),p.dataTransfer.clearData())},[c]);fs.useEffect(()=>{let p=i.current;return p&&!o?(p.addEventListener("dragenter",d),p.addEventListener("dragleave",f),p.addEventListener("dragover",VS),p.addEventListener("drop",m),p.addEventListener("paste",u),()=>{p.removeEventListener("dragenter",d),p.removeEventListener("dragleave",f),p.removeEventListener("dragover",VS),p.removeEventListener("drop",m),p.removeEventListener("paste",u)}):()=>null},[o,d,f,m,u]);let h=[Ij,e,a?"dragging":"",`dropzoneStyle--${n}`].filter(Boolean).join(" ");return Sj("div",{className:h,ref:i,children:t})}import{jsx as WS,jsxs as Dj}from"react/jsx-runtime";import"react";import{c as Rj}from"react/compiler-runtime";import{jsx as GS}from"react/jsx-runtime";import"react";var _j="drawer-close-button";function jm(t){let e=Rj(3),{onClick:o}=t,{t:n}=k(),r;return e[0]!==o||e[1]!==n?(r=GS("button",{"aria-label":n("general:close"),className:_j,onClick:o,type:"button",children:GS(pt,{})}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r}var Fj="bulk-upload--drawer-header";function Da({onClose:t,title:e}){return Dj("div",{className:Fj,children:[WS("h2",{title:e,children:e}),WS(jm,{onClick:t})]})}var Mm="bulk-upload--add-files";function Bm({acceptMimeTypes:t,onCancel:e,onDrop:o}){let{t:n}=k(),r=Aj.useRef(null);return ub("div",{className:Mm,children:[Om(Da,{onClose:e,title:n("upload:addFiles")}),Om("div",{className:`${Mm}__dropArea`,children:ub(mi,{multipleFiles:!0,onChange:o,children:[Om(ne,{buttonStyle:"pill",iconPosition:"left",onClick:()=>{r.current&&r.current.click()},size:"small",children:n("upload:selectFile")}),Om("input",{accept:t,"aria-hidden":"true",className:`${Mm}__hidden-input`,hidden:!0,multiple:!0,onChange:s=>{s.target.files&&s.target.files.length>0&&o(s.target.files)},ref:r,type:"file"}),ub("p",{className:`${Mm}__dragAndDropText`,children:[n("general:or")," ",n("upload:dragAndDrop")]})]})})]})}import{c as PO}from"react/compiler-runtime";import{jsx as zc,jsxs as Rb}from"react/jsx-runtime";import{getTranslation as NO}from"@payloadcms/translations";import{reduceFieldsToValues as LO}from"payload/shared";import"react";import{c as sI}from"react/compiler-runtime";import{jsx as Gr,jsxs as Lc}from"react/jsx-runtime";import"react";import{c as Yj}from"react/compiler-runtime";import{jsx as zm,jsxs as Zj}from"react/jsx-runtime";import"react";import{jsx as Ej,jsxs as Pj}from"react/jsx-runtime";import{isImage as Nj}from"payload/shared";import*as Vm from"qs-esm";import tt from"react";var HS=t=>new Promise((e,o)=>{let n=new Image;n.src=URL.createObjectURL(t),n.onload=()=>{let s,i,a=n.width/n.height;a>1?(i=280,s=280/a):(i=280*a,s=280);let l=new OffscreenCanvas(i,s);l.getContext("2d").drawImage(n,0,0,i,s),l.convertToBlob({type:"image/jpeg",quality:.25}).then(u=>{URL.revokeObjectURL(n.src);let d=new FileReader;d.onload=()=>e(d.result),d.onerror=o,d.readAsDataURL(u)}).catch(o)},n.onerror=r=>{URL.revokeObjectURL(n.src),o(r)}});var zS=Ds(eb(),1);import{reduceFieldsToValues as Tj}from"payload/shared";async function XS(t={},e={},o,n){let r=Tj(t,!0),s=r?.file;if(s&&delete r.file,s&&typeof n=="function"){let l=s.name,c=await n({file:s,updateFilename:u=>{l=u}});s=JSON.stringify({clientUploadContext:c,collectionSlug:o,filename:l,mimeType:s.type,size:s.size})}let i={...r,...e},a={_payload:JSON.stringify(i),file:s};return(0,zS.serialize)(a,{indices:!0,nullsAsUndefineds:!1})}function US(t,e){switch(e.type){case"ADD_FORMS":{let o=[];for(let n=0;n<e.files.length;n++)o[n]={errorCount:0,formState:{...e.initialState||{},file:{initialValue:e.files[n],valid:!0,value:e.files[n]}},uploadEdits:{}};return{...t,activeIndex:0,forms:[...o,...t.forms]}}case"REMOVE_FORM":{let o=[...t.forms],[n]=o.splice(e.index,1),r=t.activeIndex>=e.index,s=t.activeIndex===e.index?e.index:r?t.activeIndex-1:t.activeIndex,i=Math.min(o.length-1,s);return{...t,activeIndex:r?i:t.activeIndex,forms:o,totalErrorCount:t.totalErrorCount-n.errorCount}}case"REPLACE":return{...t,...e.state};case"SET_ACTIVE_INDEX":return{...t,activeIndex:e.index};case"UPDATE_ERROR_COUNT":{let o=[...t.forms];return o[e.index].errorCount=e.count,{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}case"UPDATE_FORM":{let o=[...t.forms];return o[e.index].errorCount=e.errorCount,o[e.index]={...o[e.index],formState:{...o[e.index].formState,...e.formState},uploadEdits:{...o[e.index].uploadEdits,...e.uploadEdits}},{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}default:return t}}var YS=tt.createContext({activeIndex:0,addFiles:()=>Promise.resolve(),bulkUpdateForm:()=>null,collectionSlug:"",docPermissions:void 0,documentSlots:{},forms:[],getFormDataRef:{current:()=>({})},hasPublishPermission:!1,hasSavePermission:!1,hasSubmitted:!1,isInitializing:!1,removeFile:()=>{},saveAllDocs:()=>Promise.resolve(),setActiveIndex:()=>0,setFormTotalErrorCount:()=>{},thumbnailUrls:[],totalErrorCount:0,updateUploadEdits:()=>{}}),Lj={activeIndex:0,forms:[],totalErrorCount:0};function ZS({children:t}){let{config:e}=H(),{routes:{api:o},serverURL:n}=e,{code:r}=Pe(),{i18n:s,t:i}=k(),{getDocumentSlots:a,getFormState:l}=Dt(),{getUploadHandler:c}=Dc(),[u,d]=tt.useState({}),[f,m]=tt.useState(!1),[h,p]=tt.useState(),[g,b]=tt.useState(!1),[v,x]=tt.useState(!1),[y,C]=tt.useState(!1),[S,w]=tt.useState(!1),[D,_]=tt.useState(!1),[A,F]=tt.useReducer(US,Lj),{activeIndex:R,forms:I,totalErrorCount:E}=A,T=tt.useRef(I);T.current=I;let $=I.length,j=tt.useRef([]),N=tt.useRef(new Set),[P,L]=tt.useState([]);tt.useEffect(()=>{(async()=>{let Y=[...j.current];for(let ie=0;ie<$;ie++){let de=T.current[ie].formState.file.value;if(N.current.has(de)||!de||!Nj(de.type))continue;N.current.add(de);let Ce=await HS(de);Y[ie]=Ce,j.current=Y,L([...Y]),await new Promise(ze=>setTimeout(ze,100))}})()},[$]);let{toggleLoadingOverlay:V}=dm(),{closeModal:M}=ue(),{collectionSlug:O,drawerSlug:B,initialFiles:G,onSuccess:X}=Ho(),[Z,te]=tt.useState(!1),[U,z]=tt.useState(""),le=tt.useRef(!1),J=tt.useRef(null),ce=tt.useRef(()=>({})),re=`${o}/${O}`,q=tt.useCallback(async()=>{let Y={locale:r||void 0},ie=`/${O}/access`,Ce=await(await fetch(`${n}${o}${ie}?${Vm.stringify(Y)}`,{credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"post"})).json(),ze=await fetch(`${n}${o}${ie}?${Vm.stringify(Y)}`,{body:JSON.stringify({_status:"published"}),credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"POST"}).then($e=>$e.json());p(Ce),b(wl({collectionSlug:O,docPermissions:Ce,isEditing:!1})),x(ze?.update),w(!0)},[o,r,O,s.language,n]),pe=tt.useCallback(async Y=>{Y?.signal&&Y.abort("aborting previous fetch for initial form state without files");let ie=await a({collectionSlug:O});d(ie);try{let{state:de}=await l({collectionSlug:O,docPermissions:h,docPreferences:{fields:{}},locale:r,operation:"create",renderAllFields:!0,schemaPath:O,skipValidation:!0});J.current=de,C(!0)}catch{}},[a,O,l,h,r]),he=tt.useCallback(Y=>{let ie=ce.current();F({type:"REPLACE",state:{activeIndex:Y,forms:I.map((de,Ce)=>Ce===R?{errorCount:de.errorCount,formState:ie,uploadEdits:de.uploadEdits}:de)}})},[I,R]),Re=tt.useCallback(async Y=>{V({isLoading:!0,key:"addingDocs"}),y||await pe(),F({type:"ADD_FORMS",files:Y,initialState:J.current}),V({isLoading:!1,key:"addingDocs"})},[pe,y,V]),ge=tt.useCallback(Y=>{j.current=j.current.filter((ie,de)=>!Y.includes(de)),L([...j.current])},[]),Ve=tt.useCallback(Y=>{F({type:"REMOVE_FORM",index:Y}),ge([Y])},[ge]),Q=tt.useCallback(({errorCount:Y,index:ie})=>{F({type:"UPDATE_ERROR_COUNT",count:Y,index:ie})},[]),Le=tt.useCallback(async({overrides:Y}={})=>{let ie=ce.current(),de=[...I];de[R]={errorCount:de[R].errorCount,formState:ie,uploadEdits:de[R].uploadEdits};let Ce=[];te(!0);for(let Ue=0;Ue<de.length;Ue++)try{let ft=de[Ue];z(i("general:uploadingBulk",{current:Ue+1,total:de.length}));let Qt=`${re}${Vm.stringify({uploadEdits:ft?.uploadEdits||void 0},{addQueryPrefix:!0})}`,Ge=await fetch(Qt,{body:await XS(ft.formState,Y,O,c({collectionSlug:O})),method:"POST"}),Je=await Ge.json();Ge.status===201&&Je?.doc&&Ce.push(Je.doc);let[Ye,xt]=(Je?.errors||[]).reduce(([jt,gt],qe)=>{let Tt=[],be=[];return qe?.message&&be.push(qe),Array.isArray(qe?.data?.errors)&&qe.data?.errors.forEach(K=>{K?.path?Tt.push(K):be.push(K)}),[[...jt,...Tt],[...gt,...be]]},[[],[]]);de[Ue]={errorCount:Ye.length,formState:Fc(de[Ue].formState,{type:"ADD_SERVER_ERRORS",errors:Ye})},(Ge.status===413||Ge.status===400)&&(de[Ue]={...de[Ue],errorCount:de[Ue].errorCount+1},me.error(xt[0]?.message))}catch{}m(!0),z(""),te(!1);let ze=[],$e=[];de.forEach(({errorCount:Ue},ft)=>{Ue?ze.push(de[ft]):$e.push(ft)});let ot=Math.max(0,de.length-ze.length),Xe=de.length-ot;ot&&(me.success(`Successfully saved ${ot} files`),typeof X=="function"&&X(Ce,Xe),ze.length&&$e.length&&ge($e)),Xe?me.error(`Failed to save ${Xe} files`):M(B),F({type:"REPLACE",state:{activeIndex:0,forms:ze,totalErrorCount:ze.reduce((Ue,{errorCount:ft})=>Ue+ft,0)}})},[re,R,I,ge,X,O,c,i,M,B]),_e=tt.useCallback(async(Y,ie)=>{for(let de=0;de<I.length;de++)if(Object.entries(Y).forEach(([Ce,ze])=>{I[de].formState[Ce]&&(I[de].formState[Ce].value=ze,F({type:"UPDATE_FORM",errorCount:I[de].errorCount,formState:I[de].formState,index:de}))}),typeof ie=="function"&&ie(),f){let{state:Ce}=await l({collectionSlug:O,docPermissions:h,docPreferences:null,formState:I[de].formState,operation:"create",schemaPath:O}),ze=Object.values(Ce).reduce(($e,ot)=>ot?.valid===!1?$e+1:$e,0);F({type:"UPDATE_FORM",errorCount:ze,formState:Ce,index:de})}},[O,h,I,l,f]),ae=tt.useCallback(Y=>{F({type:"UPDATE_FORM",errorCount:I[R].errorCount,formState:I[R].formState,index:R,uploadEdits:Y})},[R,I]),se=tt.useCallback(()=>{F({type:"REPLACE",state:{forms:I.map(Y=>({...Y,uploadEdits:{}}))}})},[I]);return tt.useEffect(()=>{O&&(y||pe(),S||q(),G&&_(!y||!S),y&&G&&!le.current&&(Re(G),le.current=!0))},[Re,G,pe,q,O,y,S]),Pj(YS,{value:{activeIndex:A.activeIndex,addFiles:Re,bulkUpdateForm:_e,collectionSlug:O,docPermissions:h,documentSlots:u,forms:I,getFormDataRef:ce,hasPublishPermission:v,hasSavePermission:g,hasSubmitted:f,isInitializing:D,removeFile:Ve,resetUploadEdits:se,saveAllDocs:Le,setActiveIndex:he,setFormTotalErrorCount:Q,thumbnailUrls:P,totalErrorCount:E,updateUploadEdits:ae},children:[Z&&Ej(In,{animationDuration:"250ms",loadingText:U,overlayType:"fullscreen",show:!0}),t]})}function Io(){return tt.use(YS)}import{jsx as Vr,jsxs as db}from"react/jsx-runtime";import{getTranslation as Hj}from"@payloadcms/translations";import{unflatten as tI}from"payload/shared";import zj,{useCallback as mb,useEffect as Xj,useMemo as Uj,useState as oI}from"react";import{c as Mj}from"react/compiler-runtime";import{jsx as eI,jsxs as Bj}from"react/jsx-runtime";import{useState as Vj}from"react";var JS=t=>{let e=["file","mimeType","thumbnailURL","width","height","filesize","filename","url","focalX","focalY","sizes"];return t.filter(o=>!e.includes("name"in o&&o.name))};import{fieldAffectsData as $j,fieldHasSubFields as kj,fieldIsHiddenOrDisabled as jj,getFieldPermissions as Oj}from"payload/shared";import{fieldAffectsData as qS}from"payload/shared";var Fa=(t,e)=>t?qS(e)?`${t}.${e.name}`:t:qS(e)?e.name:"";import{jsx as Gm,jsxs as QS}from"react/jsx-runtime";import{Fragment as KS}from"react";var Nc=({CustomLabel:t,field:e,prefix:o})=>QS(KS,{children:[o?QS(KS,{children:[Gm("span",{style:{display:"inline-block"},children:o})," > "]}):null,Gm("span",{style:{display:"inline-block"},children:Gm(oe,{CustomComponent:t,Fallback:Gm(ve,{label:"label"in e&&e.label})})})]});var Wm=({fields:t,formState:e,labelPrefix:o=null,parentPath:n="",path:r="",permissions:s})=>{if(!t)return[];let i=e?.[r]?.customComponents?.Label;return t?.reduce((a,l)=>{let{operation:c,permissions:u,read:d}=Oj({field:l,operation:"update",parentName:n?.includes(".")?n.split(".")[n.split(".").length-1]:n,permissions:s});if(($j(l)||l.type==="ui")&&(l.admin?.disableBulkEdit||l.unique||jj(l)||"readOnly"in l&&l.readOnly||!c||!d))return a;if(!(l.type==="array"||l.type==="blocks")&&kj(l))return[...a,...Wm({fields:l.fields,labelPrefix:Nc({CustomLabel:i,field:l,prefix:o}),parentPath:r,path:Fa(r,l),permissions:u})];if(l.type==="tabs"&&"tabs"in l)return[...a,...l.tabs.reduce((m,h)=>{if("fields"in h){let p="name"in h&&h.name;return[...m,...Wm({fields:h.fields,labelPrefix:o,parentPath:r,path:p?Fa(r,l):r,permissions:u})]}},[])];let f={label:Nc({CustomLabel:i,field:l,prefix:o}),value:{field:l,fieldPermissions:u,path:Fa(r,l)}};return[...a,f]},[])};var Gj="field-select",Hm=t=>{let e=Mj(14),{fields:o,onChange:n,permissions:r}=t,{t:s}=k(),{dispatchFields:i,getFields:a}=Oe(),l;e[0]!==o||e[1]!==a||e[2]!==r?(l=()=>Wm({fields:JS(o),formState:a(),permissions:r}),e[0]=o,e[1]=a,e[2]=r,e[3]=l):l=e[3];let[c]=Vj(l),u;if(e[4]!==i||e[5]!==a||e[6]!==n||e[7]!==c||e[8]!==s){let d;e[10]!==i||e[11]!==a||e[12]!==n?(d=f=>n({dispatchFields:i,formState:a(),selected:f}),e[10]=i,e[11]=a,e[12]=n,e[13]=d):d=e[13],u=Bj("div",{className:Gj,children:[eI(ve,{label:s("fields:selectFieldsToEdit")}),eI(mt,{getOptionValue:Wj,isMulti:!0,onChange:d,options:c})]}),e[4]=i,e[5]=a,e[6]=n,e[7]=c,e[8]=s,e[9]=u}else u=e[9];return u};function Wj(t){return typeof t.value=="object"&&"path"in t.value?String(t.value.path):String(t.value)}var rI=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,forms:i}=t,[a,l]=oI(!1),{permissions:c}=De(),{i18n:u,t:d}=k(),{closeModal:f}=ue(),{bulkUpdateForm:m}=Io(),{getFormState:h}=Dt(),p=zj.useRef(null),[g,b]=oI([]),v=c?.collections?.[r.slug],x=Uj(()=>tI(g.reduce((w,D)=>(w[D.value.path]=!0,w),{})),[g]),y=mb(async({formState:w,submitted:D})=>{let _=or(p),{state:A}=await h({collectionSlug:r.slug,docPermissions:v,docPreferences:null,formState:w,operation:"update",schemaPath:r.slug,select:x,signal:_.signal,skipValidation:!D});return p.current=null,A},[h,r,v,x]);Xj(()=>{let w=p.current;return()=>{tr(w)}},[]);let C=mb(w=>{let D=g.reduce((_,A)=>(w[A.value.path]&&(_[A.value.path]=w[A.value.path].value),_),{});m(D,()=>f(s))},[f,s,m,g]),S=mb(async({dispatchFields:w,formState:D,selected:_})=>{l(!0),b(_||[]);let{state:A}=await h({collectionSlug:r.slug,docPermissions:v,docPreferences:null,formState:D,operation:"update",schemaPath:r.slug,select:tI(_.reduce((F,R)=>(F[R.value.path]=!0,F),{})),skipValidation:!0});w({type:"UPDATE_MANY",formState:A}),l(!1)},[h,r,v]);return db("div",{className:`${gr}__main`,children:[db("div",{className:`${gr}__header`,children:[Vr("h2",{className:`${gr}__header__title`,children:d("general:editingLabel",{count:i.length,label:Hj(i.length>1?o:n,u)})}),Vr("button",{"aria-label":d("general:close"),className:`${gr}__header__close`,id:`close-drawer__${s}`,onClick:()=>f(s),type:"button",children:Vr(pt,{})})]}),db(An,{className:`${gr}__form`,isInitializing:a,onChange:[y],onSubmit:C,children:[Vr(Hm,{fields:e,onChange:S,permissions:v.fields}),g.length===0?null:Vr("div",{className:"render-fields",children:g.map((w,D)=>{let{value:{field:_,fieldPermissions:A,path:F}}=w;return Vr(Aa,{clientFieldConfig:_,indexPath:"",parentPath:"",parentSchemaPath:"",path:F,permissions:A},`${F}-${D}`)})}),Vr("div",{className:`${gr}__sidebar-wrap`,children:Vr("div",{className:`${gr}__sidebar`,children:Vr("div",{className:`${gr}__sidebar-sticky-wrap`,children:Vr("div",{className:`${gr}__document-actions`,children:Vr(ne,{type:"submit",children:d("general:applyChanges")})})})})})]})]})};var gr="edit-many-bulk-uploads",nI=t=>{let e=Yj(5),{collection:o,collection:n}=t,{slug:r}=o===void 0?{}:o,{permissions:s}=De(),{t:i}=k(),{forms:a}=Io(),c=s?.collections?.[r]?.update,u=`edit-${r}-bulk-uploads`;if(!c)return null;let d;return e[0]!==n||e[1]!==u||e[2]!==a||e[3]!==i?(d=Zj("div",{className:gr,children:[zm(ur,{"aria-label":i("general:editAll"),className:`${gr}__toggle`,slug:u,children:i("general:editAll")}),zm(Ns,{children:zm(Pt,{Header:null,slug:u,children:zm(rI,{collection:n,drawerSlug:u,forms:a})})})]}),e[0]=n,e[1]=u,e[2]=a,e[3]=i,e[4]=d):d=e[4],d};var Ta="bulk-upload--actions-bar";function iI(t){let e=sI(15),{collectionConfig:o}=t,{activeIndex:n,forms:r,setActiveIndex:s}=Io(),{t:i}=k(),a=n+1,l;if(e[0]!==n||e[1]!==o||e[2]!==r.length||e[3]!==s||e[4]!==i||e[5]!==a){let c;e[7]!==n||e[8]!==r.length||e[9]!==s?(c=()=>{let d=n-1;d<0?s(r.length-1):s(d)},e[7]=n,e[8]=r.length,e[9]=s,e[10]=c):c=e[10];let u;e[11]!==n||e[12]!==r.length||e[13]!==s?(u=()=>{let d=n+1;d===r.length?s(0):s(d)},e[11]=n,e[12]=r.length,e[13]=s,e[14]=u):u=e[14],l=Lc("div",{className:Ta,children:[Lc("div",{className:`${Ta}__navigation`,children:[Lc("p",{className:`${Ta}__locationText`,children:[Gr("strong",{children:a})," of ",Gr("strong",{children:r.length})]}),Lc("div",{className:`${Ta}__controls`,children:[Gr(ne,{"aria-label":i("general:previous"),buttonStyle:"none",onClick:c,type:"button",children:Gr(Ze,{direction:"left"})}),Gr(ne,{"aria-label":i("general:next"),buttonStyle:"none",onClick:u,type:"button",children:Gr(Ze,{direction:"right"})})]}),Gr(nI,{collection:o})]}),Gr(fb,{className:`${Ta}__saveButtons`})]}),e[0]=n,e[1]=o,e[2]=r.length,e[3]=s,e[4]=i,e[5]=a,e[6]=l}else l=e[6];return l}function fb(t){let e=sI(12),{className:o}=t,{getEntityConfig:n}=H(),{t:r}=k(),{collectionSlug:s,hasPublishPermission:i,hasSavePermission:a,saveAllDocs:l}=Io(),c;e[0]!==s||e[1]!==n?(c=n({collectionSlug:s}),e[0]=s,e[1]=n,e[2]=c):c=e[2];let u=c,d;e[3]!==o?(d=[`${Ta}__buttons`,o].filter(Boolean),e[3]=o,e[4]=d):d=e[4];let f=d.join(" "),m;return e[5]!==u?.versions?.drafts||e[6]!==i||e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==f?(m=Lc("div",{className:f,children:[u?.versions?.drafts&&a?Gr(ne,{buttonStyle:"secondary",onClick:()=>void l({overrides:{_status:"draft"}}),children:r("version:saveDraft")}):null,u?.versions?.drafts&&i?Gr(ne,{onClick:()=>void l({overrides:{_status:"published"}}),children:r("version:publish")}):null,!u?.versions?.drafts&&a?Gr(ne,{onClick:()=>void l(),children:r("general:save")}):null]}),e[5]=u?.versions?.drafts,e[6]=i,e[7]=a,e[8]=l,e[9]=r,e[10]=f,e[11]=m):m=e[11],m}import{c as Jj}from"react/compiler-runtime";import{jsx as qj}from"react/jsx-runtime";import"react";var $c="bulk-upload--discard-without-saving";function aI(){let t=Jj(9),{t:e}=k(),{closeModal:o}=ue(),{drawerSlug:n}=Ho(),r;t[0]!==o?(r=()=>{o($c)},t[0]=o,t[1]=r):r=t[1];let s=r,i;t[2]!==o||t[3]!==n?(i=()=>{o(n),o($c)},t[2]=o,t[3]=n,t[4]=i):i=t[4];let a=i,l;return t[5]!==s||t[6]!==a||t[7]!==e?(l=qj(It,{body:e("general:changesNotSaved"),cancelLabel:e("general:stayOnThisPage"),confirmLabel:e("general:leaveAnyway"),heading:e("general:leaveWithoutSaving"),modalSlug:$c,onCancel:s,onConfirm:a}),t[5]=s,t[6]=a,t[7]=e,t[8]=l):l=t[8],l}import{jsx as xs,jsxs as xO}from"react/jsx-runtime";import{useRouter as yO,useSearchParams as CO}from"next/navigation.js";import{formatAdminURL as wO}from"payload/shared";import Hc,{useCallback as TI,useEffect as EI}from"react";import{c as Qj}from"react/compiler-runtime";import{jsx as Kj}from"react/jsx-runtime";import{createContext as eO,use as tO,useState as oO}from"react";var lI=eO({mostRecentUpdate:null,reportUpdate:t=>null}),pb=t=>{let e=Qj(3),{children:o}=t,[n,r]=oO(null),s;return e[0]!==o||e[1]!==n?(s=Kj(lI,{value:{mostRecentUpdate:n,reportUpdate:r},children:o}),e[0]=o,e[1]=n,e[2]=s):s=e[2],s},fi=()=>tO(lI);import{jsx as ps,jsxs as cI}from"react/jsx-runtime";import{fieldIsSidebar as rO}from"payload/shared";import{useMemo as nO}from"react";var br="document-fields",kc=({AfterFields:t,BeforeFields:e,Description:o,docPermissions:n,fields:r,forceSidebarWrap:s,readOnly:i,schemaPathSegments:a})=>{let{hasSidebarFields:l,mainFields:c,sidebarFields:u}=nO(()=>r.reduce((d,f)=>(rO(f)?(d.sidebarFields.push(f),d.mainFields.push(null),d.hasSidebarFields=!0):(d.mainFields.push(f),d.sidebarFields.push(null)),d),{hasSidebarFields:!1,mainFields:[],sidebarFields:[]}),[r]);return cI("div",{className:[br,l?`${br}--has-sidebar`:`${br}--no-sidebar`,s&&`${br}--force-sidebar-wrap`].filter(Boolean).join(" "),children:[ps("div",{className:`${br}__main`,children:cI(Bo,{className:`${br}__edit`,children:[o?ps("header",{className:`${br}__header`,children:ps("div",{className:`${br}__sub-header`,children:o})}):null,e,ps(So,{className:`${br}__fields`,fields:c,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:a.join("."),permissions:n?.fields,readOnly:i}),t]})}),l?ps("div",{className:`${br}__sidebar-wrap`,children:ps("div",{className:`${br}__sidebar`,children:ps("div",{className:`${br}__sidebar-fields`,children:ps(So,{fields:u,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:a.join("."),permissions:n?.fields,readOnly:i})})})}):null]})};import{c as DI}from"react/compiler-runtime";import{jsx as wt,jsxs as xr}from"react/jsx-runtime";import{isImage as FI}from"payload/shared";import Wc,{Fragment as gO,useCallback as Jm,useEffect as Cb,useRef as _I,useState as Gc}from"react";import{jsx as _t,jsxs as Po}from"react/jsx-runtime";import Ym,{useRef as La,useState as bs}from"react";import Vt,{PureComponent as sO,createRef as uI}from"react";var Xm={x:0,y:0,width:0,height:0,unit:"px"},Ea=(t,e,o)=>Math.min(Math.max(t,e),o),iO=(...t)=>t.filter(e=>e&&typeof e=="string").join(" "),dI=(t,e)=>t===e||t.width===e.width&&t.height===e.height&&t.x===e.x&&t.y===e.y&&t.unit===e.unit;function Pa(t,e,o){return t.unit==="%"?{...Xm,...t,unit:"%"}:{unit:"%",x:t.x?t.x/e*100:0,y:t.y?t.y/o*100:0,width:t.width?t.width/e*100:0,height:t.height?t.height/o*100:0}}function hs(t,e,o){return t.unit?t.unit==="px"?{...Xm,...t,unit:"px"}:{unit:"px",x:t.x?t.x*e/100:0,y:t.y?t.y*o/100:0,width:t.width?t.width*e/100:0,height:t.height?t.height*o/100:0}:{...Xm,...t,unit:"px"}}function mI(t,e,o,n,r,s=0,i=0,a=n,l=r){let c={...t},u=Math.min(s,n),d=Math.min(i,r),f=Math.min(a,n),m=Math.min(l,r);e&&(e>1?(u=i?i*e:u,d=u/e,f=a*e):(d=s?s/e:d,u=d*e,m=l/e)),c.y<0&&(c.height=Math.max(c.height+c.y,d),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,u),c.x=0);let h=n-(c.x+c.width);h<0&&(c.x=Math.min(c.x,n-u),c.width+=h);let p=r-(c.y+c.height);if(p<0&&(c.y=Math.min(c.y,r-d),c.height+=p),c.width<u&&((o==="sw"||o=="nw")&&(c.x-=u-c.width),c.width=u),c.height<d&&((o==="nw"||o=="ne")&&(c.y-=d-c.height),c.height=d),c.width>f&&((o==="sw"||o=="nw")&&(c.x-=f-c.width),c.width=f),c.height>m&&((o==="nw"||o=="ne")&&(c.y-=m-c.height),c.height=m),e){let g=c.width/c.height;if(g<e){let b=Math.max(c.width/e,d);(o==="nw"||o=="ne")&&(c.y-=b-c.height),c.height=b}else if(g>e){let b=Math.max(c.height*e,u);(o==="sw"||o=="nw")&&(c.x-=b-c.width),c.width=b}}return c}function aO(t,e,o,n){let r={...t};return e==="ArrowLeft"?n==="nw"?(r.x-=o,r.y-=o,r.width+=o,r.height+=o):n==="w"?(r.x-=o,r.width+=o):n==="sw"?(r.x-=o,r.width+=o,r.height+=o):n==="ne"?(r.y+=o,r.width-=o,r.height-=o):n==="e"?r.width-=o:n==="se"&&(r.width-=o,r.height-=o):e==="ArrowRight"&&(n==="nw"?(r.x+=o,r.y+=o,r.width-=o,r.height-=o):n==="w"?(r.x+=o,r.width-=o):n==="sw"?(r.x+=o,r.width-=o,r.height-=o):n==="ne"?(r.y-=o,r.width+=o,r.height+=o):n==="e"?r.width+=o:n==="se"&&(r.width+=o,r.height+=o)),e==="ArrowUp"?n==="nw"?(r.x-=o,r.y-=o,r.width+=o,r.height+=o):n==="n"?(r.y-=o,r.height+=o):n==="ne"?(r.y-=o,r.width+=o,r.height+=o):n==="sw"?(r.x+=o,r.width-=o,r.height-=o):n==="s"?r.height-=o:n==="se"&&(r.width-=o,r.height-=o):e==="ArrowDown"&&(n==="nw"?(r.x+=o,r.y+=o,r.width-=o,r.height-=o):n==="n"?(r.y+=o,r.height-=o):n==="ne"?(r.y+=o,r.width-=o,r.height-=o):n==="sw"?(r.x-=o,r.width+=o,r.height+=o):n==="s"?r.height+=o:n==="se"&&(r.width+=o,r.height+=o)),r}var Na={capture:!0,passive:!1},gs=class Wr extends sO{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=uI(),this.mediaRef=uI(),this.initChangeCalled=!1,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{let{crop:o,disabled:n}=this.props,r=this.getBox();if(!o)return;let s=hs(o,r.width,r.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let i=e.target.dataset.ord,a=!!i,l=e.clientX,c=e.clientY,u=s.x,d=s.y;if(i){let f=e.clientX-r.x,m=e.clientY-r.y,h=0,p=0;i==="ne"||i=="e"?(h=f-(s.x+s.width),p=m-s.y,u=s.x,d=s.y+s.height):i==="se"||i==="s"?(h=f-(s.x+s.width),p=m-(s.y+s.height),u=s.x,d=s.y):i==="sw"||i=="w"?(h=f-s.x,p=m-(s.y+s.height),u=s.x+s.width,d=s.y):(i==="nw"||i=="n")&&(h=f-s.x,p=m-s.y,u=s.x+s.width,d=s.y+s.height),l=u+r.x+h,c=d+r.y+p}this.evData={startClientX:l,startClientY:c,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:a,ord:i},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=e=>{let{crop:o,disabled:n,locked:r,keepSelection:s,onChange:i}=this.props,a=this.getBox();if(n||r||s&&o)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-a.x,c=e.clientY-a.y,u={unit:"px",x:l,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,i(hs(u,a.width,a.height),Pa(u,a.width,a.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=e=>{let{crop:o,disabled:n,onChange:r,onDragStart:s}=this.props,i=this.getBox();if(n||!o||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,s&&s(e));let{evData:a}=this;a.clientX=e.clientX,a.clientY=e.clientY;let l;a.isResize?l=this.resizeCrop():l=this.dragCrop(),dI(o,l)||r(hs(l,i.width,i.height),Pa(l,i.width,i.height))},this.onComponentKeyDown=e=>{let{crop:o,disabled:n,onChange:r,onComplete:s}=this.props;if(n)return;let i=e.key,a=!1;if(!o)return;let l=this.getBox(),c=this.makePixelCrop(l),u=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Wr.nudgeStepLarge:e.shiftKey?Wr.nudgeStepMedium:Wr.nudgeStep;if(i==="ArrowLeft"?(c.x-=u,a=!0):i==="ArrowRight"?(c.x+=u,a=!0):i==="ArrowUp"?(c.y-=u,a=!0):i==="ArrowDown"&&(c.y+=u,a=!0),a){e.cancelable&&e.preventDefault(),c.x=Ea(c.x,0,l.width-c.width),c.y=Ea(c.y,0,l.height-c.height);let d=hs(c,l.width,l.height),f=Pa(c,l.width,l.height);r(d,f),s&&s(d,f)}},this.onHandlerKeyDown=(e,o)=>{let{aspect:n=0,crop:r,disabled:s,minWidth:i=0,minHeight:a=0,maxWidth:l,maxHeight:c,onChange:u,onComplete:d}=this.props,f=this.getBox();if(s||!r)return;if(e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="ArrowLeft"||e.key==="ArrowRight")e.stopPropagation(),e.preventDefault();else return;let m=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Wr.nudgeStepLarge:e.shiftKey?Wr.nudgeStepMedium:Wr.nudgeStep,h=hs(r,f.width,f.height),p=aO(h,e.key,m,o),g=mI(p,n,o,f.width,f.height,i,a,l,c);if(!dI(r,g)){let b=Pa(g,f.width,f.height);u(g,b),d&&d(g,b)}},this.onDocPointerDone=e=>{let{crop:o,disabled:n,onComplete:r,onDragEnd:s}=this.props,i=this.getBox();this.unbindDocMove(),!(n||!o)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,s&&s(e),r&&r(hs(o,i.width,i.height),Pa(o,i.width,i.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=e=>{var o;(o=this.componentRef.current)==null||o.scrollTo(0,0)}}get document(){return document}getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:o,y:n,width:r,height:s}=e.getBoundingClientRect();return{x:o,y:n,width:r,height:s}}componentDidUpdate(e){let{crop:o,onComplete:n}=this.props;if(n&&!e.crop&&o){let{width:r,height:s}=this.getBox();r&&s&&n(hs(o,r,s),Pa(o,r,s))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Na),this.document.addEventListener("pointerup",this.onDocPointerDone,Na),this.document.addEventListener("pointercancel",this.onDocPointerDone,Na),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Na),this.document.removeEventListener("pointerup",this.onDocPointerDone,Na),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Na),this.docMoveBound=!1)}getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,o=this.getBox(),n=this.makePixelCrop(o),r=e.clientX-e.startClientX,s=e.clientY-e.startClientY;return n.x=Ea(e.startCropX+r,0,o.width-n.width),n.y=Ea(e.startCropY+s,0,o.height-n.height),n}getPointRegion(e,o,n,r){let{evData:s}=this,i=s.clientX-e.x,a=s.clientY-e.y,l;r&&o?l=o==="nw"||o==="n"||o==="ne":l=a<s.startCropY;let c;return n&&o?c=o==="nw"||o==="w"||o==="sw":c=i<s.startCropX,c?l?"nw":"sw":l?"ne":"se"}resolveMinDimensions(e,o,n=0,r=0){let s=Math.min(n,e.width),i=Math.min(r,e.height);return!o||!s&&!i?[s,i]:o>1?s?[s,s/o]:[i*o,i]:i?[i*o,i]:[s,s/o]}resizeCrop(){let{evData:e}=this,{aspect:o=0,maxWidth:n,maxHeight:r}=this.props,s=this.getBox(),[i,a]=this.resolveMinDimensions(s,o,this.props.minWidth,this.props.minHeight),l=this.makePixelCrop(s),c=this.getPointRegion(s,e.ord,i,a),u=e.ord||c,d=e.clientX-e.startClientX,f=e.clientY-e.startClientY;(i&&u==="nw"||u==="w"||u==="sw")&&(d=Math.min(d,-i)),(a&&u==="nw"||u==="n"||u==="ne")&&(f=Math.min(f,-a));let m={unit:"px",x:0,y:0,width:0,height:0};c==="ne"?(m.x=e.startCropX,m.width=d,o?(m.height=m.width/o,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY-m.height)):c==="se"?(m.x=e.startCropX,m.y=e.startCropY,m.width=d,o?m.height=m.width/o:m.height=f):c==="sw"?(m.x=e.startCropX+d,m.y=e.startCropY,m.width=Math.abs(d),o?m.height=m.width/o:m.height=f):c==="nw"&&(m.x=e.startCropX+d,m.width=Math.abs(d),o?(m.height=m.width/o,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY+f));let h=mI(m,o,c,s.width,s.height,i,a,n,r);return o||Wr.xyOrds.indexOf(u)>-1?l=h:Wr.xOrds.indexOf(u)>-1?(l.x=h.x,l.width=h.width):Wr.yOrds.indexOf(u)>-1&&(l.y=h.y,l.height=h.height),l.x=Ea(l.x,0,s.width-l.width),l.y=Ea(l.y,0,s.height-l.height),l}createCropSelection(){let{ariaLabels:e=Wr.defaultProps.ariaLabels,disabled:o,locked:n,renderSelectionAddon:r,ruleOfThirds:s,crop:i}=this.props,a=this.getCropStyle();if(i)return Vt.createElement("div",{style:a,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!o&&!n&&Vt.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},Vt.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"nw"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"n"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"ne"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"e"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"se"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"s"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"sw"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"w"),role:"button"})),r&&Vt.createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:l=>l.stopPropagation()},r(this.state)),s&&Vt.createElement(Vt.Fragment,null,Vt.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),Vt.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){let o={...Xm,...this.props.crop||{}};return hs(o,e.width,e.height)}render(){let{aspect:e,children:o,circularCrop:n,className:r,crop:s,disabled:i,locked:a,style:l,ruleOfThirds:c}=this.props,{cropIsActive:u,newCropIsBeingDrawn:d}=this.state,f=s?this.createCropSelection():null,m=iO("ReactCrop",r,u&&"ReactCrop--active",i&&"ReactCrop--disabled",a&&"ReactCrop--locked",d&&"ReactCrop--new-crop",s&&e&&"ReactCrop--fixed-aspect",s&&n&&"ReactCrop--circular-crop",s&&c&&"ReactCrop--rule-of-thirds",!this.dragStarted&&s&&!s.width&&!s.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return Vt.createElement("div",{ref:this.componentRef,className:m,style:l},Vt.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},o),f)}};gs.xOrds=["e","w"];gs.yOrds=["n","s"];gs.xyOrds=["nw","ne","se","sw"];gs.nudgeStep=1;gs.nudgeStepMedium=10;gs.nudgeStepLarge=100;gs.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};var fI=gs;import"react-image-crop/dist/ReactCrop.css";var yt="edit-upload",Um=t=>{let{name:e,onChange:o,ref:n,value:r}=t;return Po("div",{className:`${yt}__input`,children:[e,_t("input",{name:e,onChange:s=>o(s.target.value),ref:n,type:"number",value:r})]})},lO={height:100,unit:"%",width:100,x:0,y:0},hb=({fileName:t,fileSrc:e,imageCacheTag:o,initialCrop:n,initialFocalPoint:r,onSave:s,showCrop:i,showFocalPoint:a})=>{let{closeModal:l}=ue(),{t:c}=k(),[u,d]=bs(()=>({...lO,...n||{}})),f={x:50,y:50},[m,h]=bs(()=>({...f,...r})),[p,g]=bs(!1),[b,v]=bs(0),[x,y]=bs(0),C=La(void 0),S=La(void 0),w=La(void 0),D=La(null),_=La(null),[A,F]=bs(!1),R=P=>{v(P.currentTarget.naturalHeight),y(P.currentTarget.naturalWidth),F(!0)},I=({dimension:P,value:L})=>{let V=parseInt(L);if(P==="width"&&V>=x||P==="height"&&V>=b)return null;let M=100*(V/(P==="width"?x:b));if(M===100||M===0)return null;d({...u,[P]:M})},E=({coordinate:P,value:L})=>{let V=parseInt(L);V>=0&&V<=100&&h(M=>({...M,[P]:V}))},T=()=>{typeof s=="function"&&s({crop:u||void 0,focalPoint:m,heightInPixels:Number(D?.current?.value??b),widthInPixels:Number(_?.current?.value??x)}),l(jc)},$=Ym.useCallback(({x:P,y:L})=>{h({x:P,y:L}),g(!1)},[]),j=()=>{let P=C.current.getBoundingClientRect(),L=i?w.current.getBoundingClientRect():S.current.getBoundingClientRect(),V=(L.left-P.left+L.width/2)/P.width*100,M=(L.top-P.top+L.height/2)/P.height*100;h({x:V,y:M})},N=o?`${e}?${encodeURIComponent(o)}`:e;return Po("div",{className:yt,children:[Po("div",{className:`${yt}__header`,children:[Po("h2",{title:`${c("general:editing")} ${t}`,children:[c("general:editing")," ",t]}),Po("div",{className:`${yt}__actions`,children:[_t(ne,{"aria-label":c("general:cancel"),buttonStyle:"secondary",className:`${yt}__cancel`,onClick:()=>l(jc),children:c("general:cancel")}),_t(ne,{"aria-label":c("general:applyChanges"),buttonStyle:"primary",className:`${yt}__save`,disabled:!A,onClick:T,children:c("general:applyChanges")})]})]}),Po("div",{className:`${yt}__toolWrap`,children:[_t("div",{className:`${yt}__crop`,children:Po("div",{className:`${yt}__focal-wrapper`,ref:C,style:{aspectRatio:`${x/b}`},children:[i?_t(fI,{className:`${yt}__reactCrop`,crop:u,onChange:(P,L)=>d(L),onComplete:()=>g(!0),renderSelectionAddon:()=>_t("div",{className:`${yt}__crop-window`,ref:w}),children:_t("img",{alt:c("upload:setCropArea"),onLoad:R,ref:S,src:N})}):_t("img",{alt:c("upload:setFocalPoint"),onLoad:R,ref:S,src:N}),a&&_t(cO,{boundsRef:i?w:S,checkBounds:i?p:!1,className:`${yt}__focalPoint`,containerRef:C,initialPosition:m,onDragEnd:$,setCheckBounds:i?g:!1,children:_t(jo,{})})]})}),(i||a)&&Po("div",{className:`${yt}__sidebar`,children:[i&&Po("div",{className:`${yt}__groupWrap`,children:[_t("div",{children:Po("div",{className:`${yt}__titleWrap`,children:[_t("h3",{children:c("upload:crop")}),_t(ne,{buttonStyle:"none",className:`${yt}__reset`,onClick:()=>d({height:100,unit:"%",width:100,x:0,y:0}),children:c("general:reset")})]})}),_t("span",{className:`${yt}__description`,children:c("upload:cropToolDescription")}),Po("div",{className:`${yt}__inputsWrap`,children:[_t(Um,{name:`${c("upload:width")} (px)`,onChange:P=>I({dimension:"width",value:P}),ref:_,value:(u.width/100*x).toFixed(0)}),_t(Um,{name:`${c("upload:height")} (px)`,onChange:P=>I({dimension:"height",value:P}),ref:D,value:(u.height/100*b).toFixed(0)})]})]}),a&&Po("div",{className:`${yt}__groupWrap`,children:[_t("div",{children:Po("div",{className:`${yt}__titleWrap`,children:[_t("h3",{children:c("upload:focalPoint")}),_t(ne,{buttonStyle:"none",className:`${yt}__reset`,onClick:j,children:c("general:reset")})]})}),_t("span",{className:`${yt}__description`,children:c("upload:focalPointDescription")}),Po("div",{className:`${yt}__inputsWrap`,children:[_t(Um,{name:"X %",onChange:P=>E({coordinate:"x",value:P}),value:m.x.toFixed(0)}),_t(Um,{name:"Y %",onChange:P=>E({coordinate:"y",value:P}),value:m.y.toFixed(0)})]})]})]})]})]})},cO=({boundsRef:t,checkBounds:e,children:o,className:n,containerRef:r,initialPosition:s={x:50,y:50},onDragEnd:i,setCheckBounds:a})=>{let[l,c]=bs({x:s.x,y:s.y}),[u,d]=bs(!1),f=La(void 0),m=Ym.useCallback((b,v,x)=>{let y=r.current.getBoundingClientRect(),C=t.current.getBoundingClientRect(),S=b??C.left,w=v??C.top,D=S<C.left||S>C.right,_=w<C.top||w>C.bottom,A=(S-y.left)/y.width*100,F=(w-y.top)/y.height*100,R=(C.left-y.left+C.width/2)/y.width*100,I=(C.top-y.top+C.height/2)/y.height*100;return(D||_)&&(d(!1),S<C.left?A=(C.left-y.left)/y.width*100:S>C.right&&(A=(y.width-(y.right-C.right))/y.width*100),w<C.top?F=(C.top-y.top)/y.height*100:w>C.bottom&&(F=(y.height-(y.bottom-C.bottom))/y.height*100),x&&(A=D?R:A,F=_?I:F)),{x:A,y:F}},[t,r]),h=b=>{b.preventDefault(),d(!0)},p=b=>{if(!u)return null;let{x:v,y:x}=m(b.clientX,b.clientY);c({x:v,y:x})},g=()=>{d(!1),i(l)};return Ym.useEffect(()=>{if(!(u||!f.current)&&e){let{height:b,left:v,top:x,width:y}=f.current.getBoundingClientRect(),{x:C,y:S}=m(v+y/2,x+b/2,!0);i({x:C,y:S}),c({x:C,y:S}),a(!1);return}},[m,u,e,a,l.x,l.y,i]),Ym.useEffect(()=>{c({x:s.x,y:s.y})},[s.x,s.y]),Po("div",{className:[`${yt}__draggable-container`,u&&`${yt}__draggable-container--dragging`].filter(Boolean).join(" "),onMouseMove:p,children:[_t("button",{className:[`${yt}__draggable`,n].filter(Boolean).join(" "),onMouseDown:h,onMouseUp:g,ref:f,style:{left:`${l.x}%`,top:`${l.y}%`},type:"button",children:o}),_t("div",{})]})};import{jsx as wI}from"react/jsx-runtime";import"react";import{c as uO}from"react/compiler-runtime";import{jsx as Pn,jsxs as gb}from"react/jsx-runtime";import"react";var vs="file-details-draggable",pI=t=>{let e=uO(20),{collectionSlug:o,doc:n,hideRemoveFile:r,imageCacheTag:s,isSortable:i,removeItem:a,rowIndex:l,uploadConfig:c}=t,{id:u,filename:d,thumbnailURL:f,url:m}=n,h;e[0]!==o||e[1]!==u?(h={id:u,collectionSlug:o},e[0]=o,e[1]=u,e[2]=h):h=e[2];let[p,g]=Jt(h),b;e[3]!==p||e[4]!==g||e[5]!==o||e[6]!==n||e[7]!==d||e[8]!==r||e[9]!==s||e[10]!==i||e[11]!==a||e[12]!==l||e[13]!==f||e[14]!==c||e[15]!==m?(b=x=>gb("div",{className:[vs,x&&i&&`${vs}--has-drag-handle`].filter(Boolean).join(" "),ref:x.setNodeRef,style:{transform:x.transform,transition:x.transition,zIndex:x.isDragging?1:void 0},children:[gb("div",{className:`${vs}--drag-wrapper`,children:[i&&x&&Pn("div",{className:`${vs}__drag`,...x.attributes,...x.listeners,children:Pn(Cn,{})}),Pn(Or,{className:`${vs}__thumbnail`,collectionSlug:o,doc:n,fileSrc:f||m,imageCacheTag:s,uploadConfig:c})]}),Pn("div",{className:`${vs}__main-detail`,children:d}),gb("div",{className:`${vs}__actions`,children:[Pn(p,{}),Pn(g,{children:Pn(Rr,{})}),!r&&a&&Pn(ne,{buttonStyle:"icon-label",className:`${vs}__remove`,icon:"x",iconStyle:"none",onClick:()=>a(l),round:!0})]})]}),e[3]=p,e[4]=g,e[5]=o,e[6]=n,e[7]=d,e[8]=r,e[9]=s,e[10]=i,e[11]=a,e[12]=l,e[13]=f,e[14]=c,e[15]=m,e[16]=b):b=e[16];let v;return e[17]!==u||e[18]!==b?(v=Pn(Jr,{id:u,children:b},u),e[17]=u,e[18]=b,e[19]=v):v=e[19],v};import{jsx as Vc,jsxs as yI}from"react/jsx-runtime";import"react";import{jsx as vI,jsxs as Mc}from"react/jsx-runtime";import{formatFilesize as fO}from"payload/shared";import xI from"react";import{jsx as hI,jsxs as gI}from"react/jsx-runtime";import{useRef as dO,useState as bI}from"react";var mO="copy-to-clipboard",Oc=({defaultMessage:t,successMessage:e,value:o})=>{let n=dO(null),[r,s]=bI(!1),[i,a]=bI(!1),{t:l}=k();return o?gI("button",{className:mO,onClick:()=>{n&&n.current&&(n.current.select(),n.current.setSelectionRange(0,o.length+1),document.execCommand("copy"),s(!0))},onMouseEnter:()=>{a(!0),s(!1)},onMouseLeave:()=>{a(!1),s(!1)},type:"button",children:[hI(Al,{}),gI(go,{delay:r?0:void 0,show:i||r,children:[r&&(e??l("general:copied")),!r&&(t??l("general:copy"))]}),hI("textarea",{readOnly:!0,ref:n,tabIndex:-1,value:o})]}):null};var bb="file-meta",Bc=t=>{let{filename:e,filesize:o,height:n,mimeType:r,url:s,width:i}=t;return Mc("div",{className:bb,children:[Mc("div",{className:`${bb}__url`,children:[vI("a",{href:s,rel:"noopener noreferrer",target:"_blank",children:e}),vI(Oc,{defaultMessage:"Copy URL",value:s})]}),Mc("div",{className:`${bb}__size-type`,children:[fO(o),typeof i=="number"&&typeof n=="number"&&Mc(xI.Fragment,{children:["\xA0-\xA0",i,"x",n]}),r&&Mc(xI.Fragment,{children:["\xA0-\xA0",r]})]})]})};var Zm="file-details",CI=t=>{let{customUploadActions:e,doc:o,enableAdjustments:n,handleRemove:r,hasImageSizes:s,hideRemoveFile:i,imageCacheTag:a,uploadConfig:l}=t,{filename:c,filesize:u,height:d,mimeType:f,thumbnailURL:m,url:h,width:p}=o,g=l.displayPreview??!0;return Vc("div",{className:Zm,children:yI("header",{children:[g&&Vc(Or,{className:`${Zm}__thumbnail`,doc:o,fileSrc:m||h,imageCacheTag:a,uploadConfig:l}),yI("div",{className:`${Zm}__main-detail`,children:[Vc(Bc,{filename:c,filesize:u,height:d,mimeType:f,url:h,width:p}),(n||e)&&Vc(vb,{customActions:e,enableAdjustments:!!n,enablePreviewSizes:s&&o.filename,mimeType:f})]}),!i&&r&&Vc(ne,{buttonStyle:"icon-label",className:`${Zm}__remove`,icon:"x",iconStyle:"with-border",onClick:r,round:!0})]})})};var xb=t=>{let{hasMany:e}=t;return e?wI(pI,{...t}):wI(CI,{...t})};import{jsx as rn,jsxs as $a}from"react/jsx-runtime";import{useEffect as pO,useMemo as hO,useState as SI}from"react";var vr="preview-sizes",II=(t,e)=>{if(!e||e.length===0)return t;let o={};return e.forEach(({name:n})=>{t[n]&&(o[n]=t[n])}),o},RI=({name:t,active:e,meta:o,onClick:n,previewSrc:r})=>$a("div",{className:[`${vr}__sizeOption`,e&&`${vr}--selected`].filter(Boolean).join(" "),onClick:typeof n=="function"?n:void 0,onKeyDown:s=>{typeof n=="function"&&s.key==="Enter"&&n()},role:"button",tabIndex:0,children:[rn("div",{className:`${vr}__image`,children:rn("img",{alt:o.filename,src:r})}),$a("div",{className:`${vr}__sizeMeta`,children:[rn("div",{className:`${vr}__sizeName`,children:t}),rn(Bc,{...o})]})]}),yb=({doc:t,imageCacheTag:e,uploadConfig:o})=>{let{imageSizes:n}=o,{sizes:r}=t,[s,i]=SI(()=>II(r,n)),[a,l]=SI(null),c=m=>{if(!m.filename)return null;if(m.url)return`${m.url}${e?`?${encodeURIComponent(e)}`:""}`};pO(()=>{i(II(r,n))},[r,n,e]);let u=c(a?t.sizes[a]:t),d=hO(()=>({filename:t.filename,filesize:t.filesize,height:t.height,mimeType:t.mimeType,url:t.url,width:t.width}),[t]),f="Original";return $a("div",{className:vr,children:[$a("div",{className:`${vr}__imageWrap`,children:[$a("div",{className:`${vr}__meta`,children:[rn("div",{className:`${vr}__sizeName`,children:a||f}),rn(Bc,{...a?s[a]:d})]}),rn("img",{alt:t.filename,className:`${vr}__preview`,src:u})]}),rn("div",{className:`${vr}__listWrap`,children:$a("div",{className:`${vr}__list`,children:[rn(RI,{active:!a,meta:d,name:f,onClick:()=>l(null),previewSrc:c(t)}),Object.entries(s).map(([m,h])=>{let p=a===m,g=c(h);return g?rn(RI,{active:p,meta:h,name:m,onClick:()=>l(m),previewSrc:g},m):null})]})})]})};var qt="file-field",jc="edit-upload",AI="preview-sizes",bO=t=>!t&&t!==void 0?"A file is required.":!0,vb=t=>{let e=DI(9),{customActions:o,enableAdjustments:n,enablePreviewSizes:r,mimeType:s}=t,{t:i}=k(),a,l;if(e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i){l=Symbol.for("react.early_return_sentinel");e:{let c=FI(s)&&s!=="image/svg+xml"&&s!=="image/jxl";if(!c&&(!o||o.length===0)){l=null;break e}let u;e[7]!==o?(u=o&&o.map(vO),e[7]=o,e[8]=u):u=e[8],a=xr("div",{className:`${qt}__upload-actions`,children:[c&&xr(Wc.Fragment,{children:[r&&wt(ur,{className:`${qt}__previewSizes`,slug:AI,children:i("upload:previewSizes")}),n&&wt(ur,{className:`${qt}__edit`,slug:jc,children:i("upload:editImage")})]}),u]})}e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=a,e[6]=l}else a=e[5],l=e[6];return l!==Symbol.for("react.early_return_sentinel")?l:a},wb=t=>{let e=DI(5),{resetUploadEdits:o,updateUploadEdits:n,uploadEdits:r}=Ws(),s;return e[0]!==t||e[1]!==o||e[2]!==n||e[3]!==r?(s=wt(Sb,{...t,resetUploadEdits:o,updateUploadEdits:n,uploadEdits:r}),e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s):s=e[4],s},Sb=t=>{let{collectionSlug:e,customActions:o,initialState:n,onChange:r,resetUploadEdits:s,updateUploadEdits:i,uploadConfig:a,uploadEdits:l}=t,{config:{routes:{api:c},serverURL:u}}=H(),{t:d}=k(),{setModified:f}=Oe(),{id:m,docPermissions:h,savedDocumentData:p,setUploadStatus:g}=Ee(),b=lr(),{errorMessage:v,setValue:x,showError:y,value:C}=Te({path:"file",validate:bO}),[S,w]=Gc(null),[D,_]=Gc(!1),[A,F]=Gc(C?.name||""),[R,I]=Gc(!1),[E,T]=Gc(""),$=_I(null),j=_I(null),N=typeof a?.pasteURL=="object"&&a.pasteURL.allowList?.length>0,P=Jm(q=>{q instanceof File&&w(URL.createObjectURL(q)),x(q),I(!1),typeof r=="function"&&r(q)},[r,x]),L=(q,pe)=>new File([q],pe,{type:q.type,lastModified:q.lastModified}),V=Wc.useCallback(q=>{let pe=q.target.value;C&&(P(L(C,pe)),F(pe))},[P,C]),M=Jm(q=>{let pe=q?.[0];P(pe)},[P]),O=Jm(()=>{_(!0),P(null),w(""),T(""),s(),I(!1)},[P,s]),B=Jm(q=>{f(!0),i(q)},[f,i]),G=async()=>{if(!(!E||a?.pasteURL===!1)){g("uploading");try{let q=await fetch(E);if(!q.ok)throw new Error(`Fetch failed with status: ${q.status}`);let pe=await q.blob(),he=decodeURIComponent(E.split("/").pop()||""),Re=new File([pe],he,{type:pe.type});P(Re),g("idle");return}catch{if(!N){me.error("Failed to fetch the file."),g("failed");return}}try{let q=`/${e}/paste-url${m?`/${m}?`:"?"}src=${encodeURIComponent(E)}`,pe=await fetch(`${u}${c}${q}`);if(!pe.ok)throw new Error(`Fetch failed with status: ${pe.status}`);let he=await pe.blob(),Re=decodeURIComponent(E.split("/").pop()||""),ge=new File([he],Re,{type:he.type});P(ge),g("idle")}catch{me.error("The provided URL is not allowed."),g("failed")}}};Cb(()=>{n?.file?.value instanceof File&&(w(URL.createObjectURL(n.file.value)),_(!1))},[n]),Cb(()=>{R&&$.current},[R]),Cb(()=>{b&&_(!1)},[b]);let X=h?.update&&"delete"in h&&h?.delete,Z=a?.imageSizes?.length>0,te=!!a?.resizeOptions,U=a?.focalPoint===!0,{crop:z=!0,focalPoint:le=!0}=a,J=le&&(Z||te||U),ce=a.mimeTypes?.join(", "),re=a?.cacheTags&&p?.updatedAt;return a.hideFileInputOnCreate&&!p?.filename?null:xr("div",{className:[ye,qt].filter(Boolean).join(" "),children:[wt(He,{message:v,showError:y}),p&&p.filename&&!D&&wt(xb,{collectionSlug:e,customUploadActions:o,doc:p,enableAdjustments:z||J,handleRemove:X?O:void 0,hasImageSizes:Z,hideRemoveFile:a.hideRemoveFile,imageCacheTag:re,uploadConfig:a}),(!a.hideFileInputOnCreate&&!p?.filename||D)&&xr("div",{className:`${qt}__upload`,children:[!C&&!R&&wt(mi,{onChange:M,children:xr("div",{className:`${qt}__dropzoneContent`,children:[xr("div",{className:`${qt}__dropzoneButtons`,children:[wt(ne,{buttonStyle:"pill",onClick:()=>{j.current&&j.current.click()},size:"small",children:d("upload:selectFile")}),wt("input",{accept:ce,"aria-hidden":"true",className:`${qt}__hidden-input`,hidden:!0,onChange:q=>{q.target.files&&q.target.files.length>0&&M(q.target.files)},ref:j,type:"file"}),a?.pasteURL!==!1&&xr(gO,{children:[wt("span",{className:`${qt}__orText`,children:d("general:or")}),wt(ne,{buttonStyle:"pill",onClick:()=>{I(!0)},size:"small",children:d("upload:pasteURL")})]})]}),xr("p",{className:`${qt}__dragAndDropText`,children:[d("general:or")," ",d("upload:dragAndDrop")]})]})}),R&&xr(Wc.Fragment,{children:[xr("div",{className:`${qt}__remote-file-wrap`,children:[wt("input",{className:`${qt}__remote-file`,onChange:q=>{T(q.target.value)},ref:$,type:"text",value:E}),wt("div",{className:`${qt}__add-file-wrap`,children:wt("button",{className:`${qt}__add-file`,onClick:()=>{G()},type:"button",children:d("upload:addFile")})})]}),wt(ne,{buttonStyle:"icon-label",className:`${qt}__remove`,icon:"x",iconStyle:"with-border",onClick:()=>{I(!1)},round:!0,tooltip:d("general:cancel")})]}),C&&S&&xr(Wc.Fragment,{children:[wt("div",{className:`${qt}__thumbnail-wrap`,children:wt(Or,{collectionSlug:e,fileSrc:FI(C.type)?S:null})}),xr("div",{className:`${qt}__file-adjustments`,children:[wt("input",{className:`${qt}__filename`,onChange:V,type:"text",value:A||C.name}),wt(vb,{customActions:o,enableAdjustments:z||J,enablePreviewSizes:Z&&p?.filename&&!D,mimeType:C.type})]}),wt(ne,{buttonStyle:"icon-label",className:`${qt}__remove`,icon:"x",iconStyle:"with-border",onClick:O,round:!0,tooltip:d("general:cancel")})]})]}),(C||p?.filename)&&wt(Ns,{children:wt(Pt,{Header:null,slug:jc,children:wt(hb,{fileName:C?.name||p?.filename,fileSrc:p?.url||S,imageCacheTag:re,initialCrop:l?.crop??void 0,initialFocalPoint:{x:l?.focalPoint?.x||p?.focalX||50,y:l?.focalPoint?.y||p?.focalY||50},onSave:B,showCrop:z,showFocalPoint:J})})}),p&&Z&&wt(Pt,{className:`${qt}__previewDrawer`,hoverTitle:!0,slug:AI,title:d("upload:sizesFor",{label:p.filename}),children:wt(yb,{doc:p,imageCacheTag:re,uploadConfig:a})})]})};function vO(t,e){return wt(Wc.Fragment,{children:t},e)}var SO="collection-edit";function PI({resetUploadEdits:t,submitted:e,updateUploadEdits:o,uploadEdits:n}){let{action:r,collectionSlug:s,docPermissions:i,getDocPreferences:a,hasSavePermission:l,initialState:c,isEditing:u,isInitializing:d,Upload:f}=Ee(),{onSave:m}=ac(),{getFormState:h}=Dt(),{config:{routes:{admin:p}},getEntityConfig:g}=H(),b=Hc.useRef(null),v=g({collectionSlug:s}),x=yO(),y=ct(),C=CO(),{reportUpdate:S}=fi(),{startRouteTransition:w}=st(),D=C.get("locale"),_=v.slug,[A]=Hc.useState(_),F=TI(I=>{if(S({entitySlug:_,updatedAt:I?.result?.updatedAt||new Date().toISOString()}),typeof m=="function"&&m({...I,operation:"create"}),!u&&y<2){let E=wO({adminRoute:p,path:`/collections/${_}/${I?.doc?.id}${D?`?locale=${D}`:""}`});w(()=>x.push(E))}else t()},[p,_,y,u,D,m,S,t,x,w]),R=TI(async({formState:I,submitted:E})=>{let T=or(b),$=await a(),{state:j}=await h({collectionSlug:_,docPermissions:i,docPreferences:$,formState:I,operation:"create",schemaPath:A,signal:T.signal,skipValidation:!E});return b.current=null,j},[_,A,a,h,i]);return EI(()=>{let I=b.current;return()=>{tr(I)}},[]),xs(Il,{operation:"create",children:xs(Ib,{children:xO(An,{action:r,className:`${SO}__form`,disabled:d||!l,initialState:d?void 0:c,isInitializing:d,method:"POST",onChange:[R],onSuccess:F,submitted:e,children:[xs(kc,{BeforeFields:xs(Hc.Fragment,{children:f||xs(Sb,{collectionSlug:v.slug,initialState:c,resetUploadEdits:t,updateUploadEdits:o,uploadConfig:v.upload,uploadEdits:n})}),docPermissions:i,fields:v.fields,schemaPathSegments:[v.slug]}),xs(RO,{}),xs(IO,{})]})})})}function IO(){let{getFields:t}=Oe(),{getFormDataRef:e}=Io();return EI(()=>{e.current=t},[t,e]),null}function RO(){let{docConfig:t}=Ee(),{activeIndex:e,setFormTotalErrorCount:o}=Io(),n=Hc.useRef(0),r=Hc.useCallback(s=>{s!==n.current&&(o({errorCount:s,index:e}),n.current=s)},[e,o]);return t?xs(Ys,{fields:t.fields,path:[],setErrorCount:r}):null}import{c as _O}from"react/compiler-runtime";import{jsx as Lt,jsxs as Hr}from"react/jsx-runtime";import{isImage as DO}from"payload/shared";import FO from"react";var qm="bulk-upload-drawer--add-more-files",Ct="file-selections";function NI(){let t=_O(36),{activeIndex:e,addFiles:o,forms:n,isInitializing:r,removeFile:s,setActiveIndex:i,thumbnailUrls:a,totalErrorCount:l}=Io(),{initialFiles:c,maxFiles:u}=Ho(),{i18n:d,t:f}=k(),{closeModal:m,openModal:h}=ue(),[p,g]=FO.useState(!1),{breakpoints:b}=Co(),v;t[0]!==s?(v=R=>{s(R)},t[0]=s,t[1]=v):v=t[1];let x=v,y;t[2]!==o||t[3]!==m?(y=R=>{o(R),m(qm)},t[2]=o,t[3]=m,t[4]=y):y=t[4];let C=y,S=EO,w=r?c.length:n.length,D=p&&`${Ct}__showingFiles`,_;t[5]!==D?(_=[Ct,D].filter(Boolean),t[5]=D,t[6]=_):_=t[6];let A=_.join(" "),F;if(t[7]!==e||t[8]!==b.m||t[9]!==m||t[10]!==n||t[11]!==C||t[12]!==x||t[13]!==d||t[14]!==c||t[15]!==r||t[16]!==u||t[17]!==h||t[18]!==i||t[19]!==p||t[20]!==f||t[21]!==A||t[22]!==a||t[23]!==l||t[24]!==w){let R;t[26]===Symbol.for("react.memo_cache_sentinel")?(R=()=>g(TO),t[26]=R):R=t[26];let I;t[27]!==m?(I=()=>m(qm),t[27]=m,t[28]=I):I=t[28];let E;t[29]!==e||t[30]!==x||t[31]!==d||t[32]!==i||t[33]!==f||t[34]!==a?(E=(T,$)=>{let{errorCount:j,formState:N}=T,P=N?.file?.value||{};return Hr("div",{className:[`${Ct}__fileRowContainer`,$===e&&`${Ct}__fileRowContainer--active`,j&&j>0&&`${Ct}__fileRowContainer--error`].filter(Boolean).join(" "),children:[Hr("button",{className:`${Ct}__fileRow`,onClick:()=>i($),type:"button",children:[Lt(Or,{className:`${Ct}__thumbnail`,fileSrc:DO(P.type)?a[$]:null}),Lt("div",{className:`${Ct}__fileDetails`,children:Lt("p",{className:`${Ct}__fileName`,title:P.name,children:P.name||f("upload:noFile")})}),P instanceof File?Lt("p",{className:`${Ct}__fileSize`,children:S(P)}):null,Lt("div",{className:`${Ct}__remove ${Ct}__remove--underlay`,children:Lt(pt,{})}),j?Lt(io,{className:`${Ct}__errorCount`,count:j,i18n:d}):null]}),Lt("button",{"aria-label":f("general:remove"),className:`${Ct}__remove ${Ct}__remove--overlay`,onClick:()=>x($),type:"button",children:Lt(pt,{})})]},$)},t[29]=e,t[30]=x,t[31]=d,t[32]=i,t[33]=f,t[34]=a,t[35]=E):E=t[35],F=Hr("div",{className:A,children:[b.m&&p?Lt("div",{className:`${Ct}__mobileBlur`}):null,Hr("div",{className:`${Ct}__header`,children:[Hr("div",{className:`${Ct}__headerTopRow`,children:[Hr("div",{className:`${Ct}__header__text`,children:[Lt(io,{count:l,i18n:d,withMessage:!0}),Lt("p",{children:Hr("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})})]}),Hr("div",{className:`${Ct}__header__actions`,children:[typeof u!="number"||w<u?Lt(vt,{className:`${Ct}__header__addFile`,onClick:()=>h(qm),children:f("upload:addFile")}):null,Hr(ne,{buttonStyle:"transparent",className:`${Ct}__toggler`,onClick:R,children:[Lt("span",{className:`${Ct}__toggler__label`,children:Hr("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})}),Lt(Ze,{direction:p?"down":"up"})]}),Lt(Pt,{gutter:!1,Header:null,slug:qm,children:Lt(Bm,{onCancel:I,onDrop:C})})]})]}),Lt("div",{className:`${Ct}__header__mobileDocActions`,children:Lt(fb,{})})]}),Lt("div",{className:`${Ct}__animateWrapper`,children:Lt(Ar,{height:!b.m||p?"auto":0,children:Hr("div",{className:`${Ct}__filesContainer`,children:[r&&n.length===0&&c.length>0?Array.from(c).map(AO):null,n.map(E)]})})})]}),t[7]=e,t[8]=b.m,t[9]=m,t[10]=n,t[11]=C,t[12]=x,t[13]=d,t[14]=c,t[15]=r,t[16]=u,t[17]=h,t[18]=i,t[19]=p,t[20]=f,t[21]=A,t[22]=a,t[23]=l,t[24]=w,t[25]=F}else F=t[25];return F}function AO(t,e){return Lt(St,{animationDelay:`calc(${e} * 60ms)`,height:"35px"},e)}function TO(t){return!t}function EO(t){let e=t.size,o=e===0?0:Math.floor(Math.log(e)/Math.log(1024)),n=o>1?1:0;return(e/Math.pow(1024,o)).toFixed(n)+" "+["B","kB","MB","GB","TB"][o]}var LI="bulk-upload--file-manager";function $I(){let t=PO(18),{activeIndex:e,collectionSlug:o,docPermissions:n,documentSlots:r,forms:s,hasPublishPermission:i,hasSavePermission:a,hasSubmitted:l,resetUploadEdits:c,updateUploadEdits:u}=Io(),d=s[e],{getEntityConfig:f}=H(),{i18n:m}=k(),{user:h}=De(),{openModal:p}=ue(),g;if(t[0]!==d||t[1]!==e||t[2]!==o||t[3]!==n||t[4]!==r||t[5]!==s.length||t[6]!==f||t[7]!==i||t[8]!==a||t[9]!==l||t[10]!==m||t[11]!==p||t[12]!==c||t[13]!==u||t[14]!==h){let b=f({collectionSlug:o}),v;t[16]!==p?(v=()=>p($c),t[16]=p,t[17]=v):v=t[17],g=Rb("div",{className:LI,children:[zc(NI,{}),Rb("div",{className:`${LI}__editView`,children:[zc(Da,{onClose:v,title:NO(b.labels.singular,m)}),d?Rb(Sl,{collectionSlug:o,currentEditor:h,docPermissions:n,hasPublishedDoc:!1,hasPublishPermission:i,hasSavePermission:a,id:null,initialData:LO(d.formState,!0),initialState:d.formState,isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,Upload:r.Upload,versionCount:0,children:[zc(iI,{collectionConfig:b}),zc(PI,{resetUploadEdits:c,submitted:l,updateUploadEdits:u,uploadEdits:d?.uploadEdits})]},`${e}-${s.length}`):null]}),zc(aI,{})]}),t[0]=d,t[1]=e,t[2]=o,t[3]=n,t[4]=r,t[5]=s.length,t[6]=f,t[7]=i,t[8]=a,t[9]=l,t[10]=m,t[11]=p,t[12]=c,t[13]=u,t[14]=h,t[15]=g}else g=t[15];return g}var jO="bulk-upload-drawer-slug";function OO(){let{addFiles:t,forms:e,isInitializing:o}=Io(),{closeModal:n}=ue(),{collectionSlug:r,drawerSlug:s}=Ho(),{getEntityConfig:i}=H(),{t:a}=k(),u=i({collectionSlug:r})?.upload?.mimeTypes,d=nn.useCallback(f=>{let m=new DataTransfer;for(let h of f)(u===void 0||u.length===0||kO(h.type,u))&&m.items.add(h);m.files.length===0?me.error(a("error:invalidFileType")):t(m.files)},[t,a,u]);return r?!e.length&&!o?pi(Bm,{acceptMimeTypes:u?.join(", "),onCancel:()=>n(s),onDrop:d}):pi($I,{}):null}function jI(){let t=kI(2),{drawerSlug:e}=Ho(),o;return t[0]!==e?(o=pi(Pt,{gutter:!1,Header:null,slug:e,children:pi(ZS,{children:pi(OO,{})})}),t[0]=e,t[1]=o):o=t[1],o}var OI=nn.createContext({collectionSlug:"",currentActivePath:void 0,drawerSlug:"",initialFiles:void 0,maxFiles:void 0,onCancel:()=>null,onSuccess:()=>null,setCollectionSlug:()=>null,setCurrentActivePath:()=>null,setInitialFiles:()=>null,setMaxFiles:()=>null,setOnCancel:()=>null,setOnSuccess:()=>null});function Ib(t){let e=kI(16),{children:o}=t,[n,r]=nn.useState(),[s,i]=nn.useState(),[a,l]=nn.useState(),[c,u]=nn.useState(void 0),[d,f]=nn.useState(void 0),[m,h]=nn.useState(void 0),p=MI(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=w=>{r(w)},e[0]=g):g=e[0];let b=g,v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=(w,D)=>{i(_=>({..._,[w]:D}))},e[1]=v):v=e[1];let x=v,y;e[2]!==a?(y=()=>{typeof a=="function"&&a()},e[2]=a,e[3]=y):y=e[3];let C;e[4]!==m||e[5]!==s?(C=(w,D)=>{if(s&&Object.hasOwn(s,m)){let _=s[m];_(w,D)}},e[4]=m,e[5]=s,e[6]=C):C=e[6];let S;return e[7]!==o||e[8]!==n||e[9]!==m||e[10]!==p||e[11]!==c||e[12]!==d||e[13]!==y||e[14]!==C?(S=pi(OI,{value:{collectionSlug:n,currentActivePath:m,drawerSlug:p,initialFiles:c,maxFiles:d,onCancel:y,onSuccess:C,setCollectionSlug:b,setCurrentActivePath:h,setInitialFiles:u,setMaxFiles:f,setOnCancel:l,setOnSuccess:x},children:$O(nn.Fragment,{children:[o,pi(jI,{})]})}),e[7]=o,e[8]=n,e[9]=m,e[10]=p,e[11]=c,e[12]=d,e[13]=y,e[14]=C,e[15]=S):S=e[15],S}var Ho=()=>nn.use(OI);function MI(){let t=Wi();return`${jO}-${t||1}`}import{c as GO}from"react/compiler-runtime";import{jsx as gi,jsxs as WO}from"react/jsx-runtime";import"react";import{c as MO}from"react/compiler-runtime";import{jsx as hi,jsxs as Qm}from"react/jsx-runtime";import{formatFilesize as BO}from"payload/shared";import"react";var Nn="upload-relationship-details";function Km(t){let e=MO(34),{id:o,allowEdit:n,allowRemove:r,alt:s,byteSize:i,className:a,collectionSlug:l,displayPreview:c,filename:u,mimeType:d,onRemove:f,reloadDoc:m,src:h,thumbnailSrc:p,withMeta:g,x:b,y:v}=t,x=g===void 0?!0:g,{config:y}=H(),C;e[0]!==l||e[1]!==y?(C="collections"in y?y.collections.find(O=>O.slug===l):void 0,e[0]=l,e[1]=y,e[2]=C):C=e[2];let S=C,w=h?o:void 0,D;e[3]!==l||e[4]!==w?(D={id:w,collectionSlug:l},e[3]=l,e[4]=w,e[5]=D):D=e[5];let[_,,A]=Jt(D),{openDrawer:F}=A,R;e[6]!==l||e[7]!==m?(R=async O=>{let{doc:B}=O;return m(B.id,l)},e[6]=l,e[7]=m,e[8]=R):R=e[8];let I=R,E;e[9]!==b||e[10]!==v?(E=function(B,G){let X=[];return G&&X.push(BO(G)),b&&v&&X.push(`${b}x${v}`),B&&X.push(B),X.join(" \u2014 ")},e[9]=b,e[10]=v,e[11]=E):E=e[11];let $=x?E(d,i):"",j=c??S.upload?.displayPreview??!0,N;e[12]!==a?(N=[Nn,a].filter(Boolean),e[12]=a,e[13]=N):N=e[13];let P=N.join(" "),L;e[14]!==s||e[15]!==u||e[16]!==j||e[17]!==p?(L=j&&hi(_3,{alt:s,className:`${Nn}__thumbnail`,filename:u,fileSrc:p,size:"small"}),e[14]=s,e[15]=u,e[16]=j,e[17]=p,e[18]=L):L=e[18];let V;e[19]!==u||e[20]!==h?(V=h?hi("a",{href:h,target:"_blank",children:u}):u,e[19]=u,e[20]=h,e[21]=V):V=e[21];let M;return e[22]!==_||e[23]!==n||e[24]!==r||e[25]!==$||e[26]!==f||e[27]!==I||e[28]!==F||e[29]!==V||e[30]!==P||e[31]!==L||e[32]!==x?(M=Qm("div",{className:P,children:[Qm("div",{className:`${Nn}__imageAndDetails`,children:[L,Qm("div",{className:`${Nn}__details`,children:[hi("p",{className:`${Nn}__filename`,children:V}),x?hi("p",{className:`${Nn}__meta`,children:$}):null]})]}),n!==!1||r!==!1?Qm("div",{className:`${Nn}__actions`,children:[n!==!1?hi(ne,{buttonStyle:"icon-label",className:`${Nn}__edit`,icon:"edit",iconStyle:"none",onClick:F}):null,r!==!1?hi(ne,{buttonStyle:"icon-label",className:`${Nn}__remove`,icon:"x",iconStyle:"none",onClick:()=>f()}):null,hi(_,{onSave:I})]}):null]}),e[22]=_,e[23]=n,e[24]=r,e[25]=$,e[26]=f,e[27]=I,e[28]=F,e[29]=V,e[30]=P,e[31]=L,e[32]=x,e[33]=M):M=e[33],M}import{jsx as VO}from"react/jsx-runtime";import"react";var BI="upload-field-card";function ef({children:t,className:e,size:o="medium"}){return VO("div",{className:[BI,e,`${BI}--size-${o}`].filter(Boolean).join(" "),children:t})}import{isImage as HO}from"payload/shared";var Xc="upload upload--has-many";function VI(t){let e=GO(27),{className:o,displayPreview:n,fileDocs:r,isSortable:s,onRemove:i,onReorder:a,readonly:l,reloadDoc:c,serverURL:u}=t,d;e[0]!==r||e[1]!==a?(d=(v,x)=>{if(v===x)return;let y=[...r],[C]=y.splice(v,1);y.splice(x,0,C),a(y)},e[0]=r,e[1]=a,e[2]=d):d=e[2];let f=d,m;e[3]!==r||e[4]!==i?(m=v=>{let x=[...r||[]];x.splice(v,1),i(x.length===0?[]:x)},e[3]=r,e[4]=i,e[5]=m):m=e[5];let h=m,p;e[6]!==o?(p=[Xc,o].filter(Boolean),e[6]=o,e[7]=p):p=e[7];let g=p.join(" "),b;if(e[8]!==n||e[9]!==r||e[10]!==s||e[11]!==f||e[12]!==l||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==g){let v;e[18]!==f?(v=y=>{let{moveFromIndex:C,moveToIndex:S}=y;return f(C,S)},e[18]=f,e[19]=v):v=e[19];let x;e[20]!==n||e[21]!==s||e[22]!==l||e[23]!==c||e[24]!==h||e[25]!==u?(x=(y,C)=>{let{relationTo:S,value:w}=y,D=String(w.id),_,A;if(w.url)try{_=new URL(w.url,u).toString()}catch{_=`${u}${w.url}`}if(w.thumbnailURL)try{A=new URL(w.thumbnailURL,u).toString()}catch{A=`${u}${w.thumbnailURL}`}return HO(w.mimeType)&&(A=ha({sizes:w.sizes,thumbnailURL:A,url:_,width:w.width})),gi(Jr,{disabled:!s||l,id:D,children:F=>gi("div",{className:[`${Xc}__dragItem`,F&&s&&`${Xc}--has-drag-handle`].filter(Boolean).join(" "),ref:F.setNodeRef,style:{transform:F.transform,transition:F.transition,zIndex:F.isDragging?1:void 0},children:WO(ef,{size:"small",children:[F&&gi("div",{className:`${Xc}__drag`,...F.attributes,...F.listeners,children:gi(Cn,{})}),gi(Km,{allowEdit:!l,allowRemove:!l,alt:w?.alt||w?.filename,byteSize:w.filesize,collectionSlug:S,displayPreview:n,filename:w.filename,id:D,mimeType:w?.mimeType,onRemove:()=>h(C),reloadDoc:c,src:_,thumbnailSrc:A,withMeta:!1,x:w?.width,y:w?.height})]})})},D)},e[20]=n,e[21]=s,e[22]=l,e[23]=c,e[24]=h,e[25]=u,e[26]=x):x=e[26],b=gi("div",{className:g,children:gi(cr,{className:`${Xc}__draggable-rows`,ids:r?.map(zO),onDragEnd:v,children:r.map(x)})}),e[8]=n,e[9]=r,e[10]=s,e[11]=f,e[12]=l,e[13]=c,e[14]=h,e[15]=u,e[16]=g,e[17]=b}else b=e[17];return b}function zO(t){let{value:e}=t;return String(e.id)}import{jsx as GI}from"react/jsx-runtime";import{isImage as XO}from"payload/shared";import"react";var UO="upload upload--has-one";function WI(t){let{className:e,displayPreview:o,fileDoc:n,onRemove:r,readonly:s,reloadDoc:i,serverURL:a}=t,{relationTo:l,value:c}=n,u=String(c?.id),d,f;if(c.url)try{d=new URL(c.url,a).toString()}catch{d=`${a}${c.url}`}if(c.thumbnailURL)try{f=new URL(c.thumbnailURL,a).toString()}catch{f=`${a}${c.thumbnailURL}`}return XO(c.mimeType)&&(f=ha({sizes:c.sizes,thumbnailURL:f,url:d,width:c.width})),GI(ef,{className:[UO,e].filter(Boolean).join(" "),children:GI(Km,{allowEdit:!s,allowRemove:!s,alt:c?.alt||c?.filename,byteSize:c.filesize,collectionSlug:l,displayPreview:o,filename:c.filename,id:u,mimeType:c?.mimeType,onRemove:r,reloadDoc:i,src:d,thumbnailSrc:f,x:c?.width,y:c?.height})})}var sn="upload";function tf(t){let{AfterInput:e,allowCreate:o,api:n,BeforeInput:r,className:s,Description:i,description:a,displayPreview:l,Error:c,filterOptions:u,hasMany:d,isSortable:f,Label:m,label:h,localized:p,maxRows:g,onChange:b,path:v,readOnly:x,relationTo:y,required:C,serverURL:S,showError:w,style:D,value:_}=t,[A,F]=zr.useState(),[R,I]=zr.useState(Array.isArray(y)?y[0]:y),{openModal:E}=ue(),{drawerSlug:T,setCollectionSlug:$,setCurrentActivePath:j,setInitialFiles:N,setMaxFiles:P,setOnSuccess:L}=Ho(),{permissions:V}=De(),{code:M}=Pe(),{i18n:O,t:B}=k(),G=XI(()=>({...u,[R]:{...u?.[R]||{},id:{...u?.[R]?.id||{},not_in:(u?.[R]?.id?.not_in||[]).concat(...Array.isArray(_)||_?[_]:[])}}}),[_,R,u]),[X,,{closeDrawer:Z,openDrawer:te}]=ai({collectionSlugs:typeof y=="string"?[y]:y,filterOptions:G}),[U,,{closeDrawer:z,openDrawer:le}]=Jt({collectionSlug:R}),J=zr.useRef(!1),ce=XI(()=>o?!!(typeof R=="string"&&V?.collections&&V.collections?.[R]?.create):!1,[R,V,o]),re=zr.useCallback(se=>{typeof b=="function"&&b(se)},[b]),q=zr.useCallback(async(se,Y)=>{if(!se.length)return;let ie={depth:0,draft:!0,limit:se.length,locale:M,where:{and:[{id:{in:se}}]}},de=await fetch(`${S}${n}/${Y}`,{body:UI.stringify(ie),credentials:"include",headers:{"Accept-Language":O.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(de.ok){let Ce=await de.json(),ze=se.map($e=>Ce.docs.find(ot=>String(ot.id)===String($e)));return ze.includes(void 0)&&d&&(ze=ze.map(($e,ot)=>$e||{id:se[ot],filename:`${B("general:untitled")} - ID: ${se[ot]}`,isPlaceholder:!0})),{...Ce,docs:ze}}return null},[M,S,n,O.language,B,d]),pe=HI(se=>{if(d){let Y=[...Array.isArray(_)?_:[],...se.map(ie=>ie.id)];re(Y),F(ie=>[...ie||[],...se.map(de=>({relationTo:R,value:de}))])}else{let Y=se[0];re(Y.id),F([{relationTo:R,value:Y}])}},[_,re,R,d]),he=zr.useCallback(se=>{let Y=se;if(!d&&se&&se.length>1){let ie=new DataTransfer;ie.items.add(se[0]),Y=ie.files}Y&&N(Y),$(y),typeof g=="number"&&P(g),j(v),E(T)},[T,d,E,y,$,N,g,P,v,j]),Re=zr.useCallback(async se=>{let Y=[];for(let[de,Ce]of se)Ce&&Y.push(de);let ie=await q(Y,R);ie&&F(de=>[...de||[],...ie.docs.map(Ce=>({relationTo:R,value:Ce}))]),re([...Array.isArray(_)?_:[],...Y]),Z()},[R,Z,re,q,_]),ge=zr.useCallback(se=>{se.doc&&(F(Y=>[...Y||[],{relationTo:R,value:se.doc}]),re(se.doc.id)),z()},[z,R,re]),Ve=HI(async({collectionSlug:se,doc:Y})=>{let ie=await q([Y.id],se),de=ie?ie.docs?.[0]:null;F(Ce=>de?d?[...Ce||[],{relationTo:R,value:de}]:[{relationTo:R,value:de}]:Ce),re(d?[...Array.isArray(_)?_:[],Y.id]:Y.id),Z()},[Z,d,q,re,_,R]),Q=zr.useCallback(async(se,Y)=>{let{docs:ie}=await q([se],Y);if(ie[0]){let de=[];F(Ce=>{let ze=Ce?.findIndex($e=>($e.value?.id===ie[0].id||$e.value?.isPlaceholder)&&$e.relationTo===Y);if(ze>-1){let $e=[...Ce];return $e[ze]={relationTo:Y,value:ie[0]},de=$e,$e}}),de.length&&d&&re(de.map(Ce=>Ce.value?.id))}},[q,re,d]),Le=zr.useCallback(se=>{let Y=se.map(({value:ie})=>ie.id);re(Y),F(se)},[re]),_e=zr.useCallback(se=>{let Y=se?se.map(({value:ie})=>ie.id):null;re(d?Y:Y?Y[0]:null),F(se||[])},[re,d]);zI(()=>{async function se(){if(_){J.current=!0;let Y=await q(Array.isArray(_)?_:[_],R);Y&&F(Y.docs.map(ie=>({relationTo:R,value:ie})))}}J.current||se()},[q,R,_]),zI(()=>{L(v,pe)},[_,v,pe,L]);let ae=!_||d&&Array.isArray(_)&&(typeof g!="number"||_.length<g)||!d&&A?.[0]&&typeof A[0].value>"u";return bi("div",{className:[ye,sn,s,w&&"error",x&&"read-only"].filter(Boolean).join(" "),id:`field-${v?.replace(/\./g,"__")}`,style:D,children:[$t(oe,{CustomComponent:m,Fallback:$t(ve,{label:h,localized:p,path:v,required:C})}),$t("div",{className:`${sn}__wrap`,children:$t(oe,{CustomComponent:c,Fallback:$t(He,{path:v,showError:w})})}),r,bi("div",{className:`${sn}__dropzoneAndUpload`,children:[d&&Array.isArray(_)&&_.length>0?$t(Uc,{children:A&&A?.length>0?$t(VI,{displayPreview:l,fileDocs:A,isSortable:f&&!x,onRemove:_e,onReorder:Le,readonly:x,reloadDoc:Q,serverURL:S}):$t("div",{className:`${sn}__loadingRows`,children:_.map(se=>$t(St,{height:"40px"},se))})}):null,!d&&_?$t(Uc,{children:A&&A?.length>0&&A[0].value?$t(WI,{displayPreview:l,fileDoc:A[0],onRemove:_e,readonly:x,reloadDoc:Q,serverURL:S}):A&&_&&!A?.[0]?.value?bi(Uc,{children:[B("general:untitled")," - ID: ",_]}):$t(St,{height:"62px"})}):null,ae?$t(mi,{disabled:x||!ce,multipleFiles:d,onChange:he,children:bi("div",{className:`${sn}__dropzoneContent`,children:[bi("div",{className:`${sn}__dropzoneContent__buttons`,children:[ce&&bi(Uc,{children:[$t(ne,{buttonStyle:"pill",className:`${sn}__createNewToggler`,disabled:x||!ce,onClick:()=>{x||(d?he():le())},size:"small",children:B("general:createNew")}),$t("span",{className:`${sn}__dropzoneContent__orText`,children:B("general:or")})]}),$t(ne,{buttonStyle:"pill",className:`${sn}__listToggler`,disabled:x,onClick:te,size:"small",children:B("fields:chooseFromExisting")}),$t(U,{onSave:ge}),$t(X,{allowCreate:ce,enableRowSelections:d,onBulkSelect:Re,onSelect:Ve})]}),ce&&!x&&bi("p",{className:`${sn}__dragAndDropText`,children:[B("general:or")," ",B("upload:dragAndDrop")]})]})}):$t(Uc,{children:!x&&!A&&(!_||typeof g!="number"||Array.isArray(_)&&_.length<g)?$t(St,{height:"40px"}):null})]}),e,$t(oe,{CustomComponent:i,Fallback:$t(Be,{description:a,path:v})})]})}function qO(t){let{field:e,field:{admin:{allowCreate:o,className:n,description:r,isSortable:s}={},hasMany:i,label:a,localized:l,maxRows:c,relationTo:u,required:d},path:f,readOnly:m,validate:h}=t,{config:p}=H(),g=e.displayPreview,b=ZO.useCallback((E,T)=>{if(typeof h=="function")return h(E,{...T,required:d})},[h,d]),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Error:C,Label:S}={},disabled:w,filterOptions:D,path:_,setValue:A,showError:F,value:R}=Te({potentiallyStalePath:f,validate:b}),I=JO(()=>rt(e),[e]);return YO(tf,{AfterInput:v,allowCreate:o!==!1,api:p.routes.api,BeforeInput:x,className:n,Description:y,description:r,displayPreview:g,Error:C,filterOptions:D,hasMany:i,isSortable:s,label:a,Label:S,localized:l,maxRows:c,onChange:A,path:_,readOnly:m||w,relationTo:u,required:d,serverURL:p.serverURL,showError:F,style:I,value:R})}var Yc=je(qO);function Aa(t){let e=QO(13),{clientFieldConfig:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:a,permissions:l,readOnly:c,schemaPath:u}=t,d;e[0]!==a?(d=h=>{let[p]=h;return p&&p?.[a]?.customComponents?.Field},e[0]=a,e[1]=d):d=e[1];let f=Et(d);if(f!==void 0)return f||null;let m;if(e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==a||e[8]!==l||e[9]!==c||e[10]!==u){m=Symbol.for("react.early_return_sentinel");e:{let h={forceRender:n,permissions:l,readOnly:c,schemaPath:u},p={...h,indexPath:r,parentPath:s,parentSchemaPath:i};if(o.admin?.hidden){m=Ft(oc,{...h,path:a});break e}switch(o.type){case"array":{m=Ft(Zc,{...p,field:o,path:a});break e}case"blocks":{m=Ft(Ll,{...p,field:o,path:a});break e}case"checkbox":{m=Ft(mr,{...h,field:o,path:a});break e}case"code":{m=Ft(kl,{...h,field:o,path:a});break e}case"collapsible":{m=Ft(Ol,{...p,field:o,path:a});break e}case"date":{m=Ft(ec,{...h,field:o,path:a});break e}case"email":{m=Ft(oi,{...h,field:o,path:a});break e}case"group":{m=Ft(tc,{...p,field:o,path:a});break e}case"join":{m=Ft(mc,{...h,field:o,path:a});break e}case"json":{m=Ft(fc,{...h,field:o,path:a});break e}case"number":{m=Ft(pc,{...h,field:o,path:a});break e}case"point":{m=Ft(hc,{...h,field:o,path:a});break e}case"radio":{m=Ft(vc,{...h,field:o,path:a});break e}case"relationship":{m=Ft(Sc,{...h,field:o,path:a});break e}case"richText":{m=Ft(Ic,{...h,field:o,path:a});break e}case"row":{m=Ft(Rc,{...p,field:o});break e}case"select":{m=Ft(_c,{...h,field:o,path:a});break e}case"tabs":{m=Ft(Tc,{...p,field:o,path:a});break e}case"text":{m=Ft(di,{...h,field:o,path:a});break e}case"textarea":{m=Ft(Ec,{...h,field:o,path:a});break e}case"ui":{let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=Ft(Pc,{}),e[12]=g):g=e[12],m=g;break e}case"upload":{m=Ft(Yc,{...h,field:o,path:a});break e}}}e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=a,e[8]=l,e[9]=c,e[10]=u,e[11]=m}else m=e[11];if(m!==Symbol.for("react.early_return_sentinel"))return m}var Db="render-fields",So=t=>{let e=KO(22),{className:o,fields:n,forceRender:r,margins:s,parentIndexPath:i,parentPath:a,parentSchemaPath:l,permissions:c,readOnly:u}=t,d=Qo();if(n&&n.length>0){let f=s&&`${Db}--margins-${s}`,m=s===!1&&`${Db}--margins-none`,h;e[0]!==o||e[1]!==f||e[2]!==m?(h=[Db,o,f,m].filter(Boolean),e[0]=o,e[1]=f,e[2]=m,e[3]=h):h=e[3];let p=h.join(" "),g;if(e[4]!==n||e[5]!==r||e[6]!==d||e[7]!==i||e[8]!==a||e[9]!==l||e[10]!==c||e[11]!==u||e[12]!==p){let b;e[14]!==r||e[15]!==d||e[16]!==i||e[17]!==a||e[18]!==l||e[19]!==c||e[20]!==u?(b=(v,x)=>{if(!v||eM(v))return null;let{operation:y,permissions:C,read:S}=oM({field:v,operation:d,parentName:a?.includes(".")?a.split(".")[a.split(".").length-1]:a,permissions:c});if("name"in v&&!S)return null;let w=u||v?.admin?.readOnly;w&&v.admin?.readOnly===!1&&(w=!1),"name"in v&&!y&&(w=!0);let{indexPath:D,path:_,schemaPath:A}=tM({field:v,index:x,parentIndexPath:i,parentPath:a,parentSchemaPath:l});return _b(nh,{value:_,children:_b(Aa,{clientFieldConfig:v,forceRender:r,indexPath:D,parentPath:a,parentSchemaPath:l,path:_,permissions:C,readOnly:w,schemaPath:A})},`${_}-${x}`)},e[14]=r,e[15]=d,e[16]=i,e[17]=a,e[18]=l,e[19]=c,e[20]=u,e[21]=b):b=e[21],g=_b(py,{className:p,forceRender:r,children:n.map(b)}),e[4]=n,e[5]=r,e[6]=d,e[7]=i,e[8]=a,e[9]=l,e[10]=c,e[11]=u,e[12]=p,e[13]=g}else g=e[13];return g}return null};var Jc="array-field",YI=t=>{let e=rM(42),{addRow:o,attributes:n,CustomRowLabel:r,duplicateRow:s,errorCount:i,fields:a,forceRender:l,hasMaxRows:c,isDragging:u,isLoading:d,isSortable:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:v,readOnly:x,removeRow:y,row:C,rowCount:S,rowIndex:w,schemaPath:D,setCollapse:_,setNodeRef:A,transform:F,transition:R}=t,I=l===void 0?!1:l,E=Cd(d,500),{i18n:T}=k(),$=Xt(),j=`${sM(m.singular,T)} ${String(w+1).padStart(2,"0")}`,N=i>0&&$,P=N?`${Jc}__row--has-errors`:`${Jc}__row--no-errors`,L;e[0]!==P?(L=[`${Jc}__row`,P].filter(Boolean),e[0]=P,e[1]=L):L=e[1];let V=L.join(" "),M=`${g.split(".").join("-")}-row-${w}`,O=u?1:void 0,B;if(e[2]!==r||e[3]!==o||e[4]!==n||e[5]!==V||e[6]!==s||e[7]!==i||e[8]!==j||e[9]!==N||e[10]!==a||e[11]!==I||e[12]!==c||e[13]!==T||e[14]!==E||e[15]!==f||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==y||e[23]!==C.collapsed||e[24]!==C.id||e[25]!==S||e[26]!==w||e[27]!==D||e[28]!==_||e[29]!==A||e[30]!==M||e[31]!==O||e[32]!==F||e[33]!==R){let G;e[35]!==i||e[36]!==N||e[37]!==T?(G=N&&ys(io,{count:i,i18n:T,withMessage:!0}),e[35]=i,e[36]=N,e[37]=T,e[38]=G):G=e[38];let X;e[39]!==C.id||e[40]!==_?(X=Z=>_(C.id,Z),e[39]=C.id,e[40]=_,e[41]=X):X=e[41],B=ys("div",{id:M,ref:A,style:{transform:F,transition:R,zIndex:O},children:ys(Xs,{actions:x?void 0:ys(xd,{addRow:o,duplicateRow:s,hasMaxRows:c,index:w,isSortable:f,moveRow:p,removeRow:y,rowCount:S}),className:V,collapsibleStyle:N?"error":"default",dragHandleProps:f?{id:C.id,attributes:n,listeners:h}:void 0,header:nM("div",{className:`${Jc}__row-header`,children:[E?ys(St,{height:"1rem",width:"8rem"}):ys(dn,{CustomComponent:r,label:j,path:b,rowNumber:w}),G]}),isCollapsed:C.collapsed,onToggle:X,children:E?ys(St,{}):ys(So,{className:`${Jc}__fields`,fields:a,forceRender:I,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:D,permissions:v===!0?v:v?.fields,readOnly:x})})},`${g}-row-${C.id}`),e[2]=r,e[3]=o,e[4]=n,e[5]=V,e[6]=s,e[7]=i,e[8]=j,e[9]=N,e[10]=a,e[11]=I,e[12]=c,e[13]=T,e[14]=E,e[15]=f,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=y,e[23]=C.collapsed,e[24]=C.id,e[25]=S,e[26]=w,e[27]=D,e[28]=_,e[29]=A,e[30]=M,e[31]=O,e[32]=F,e[33]=R,e[34]=B}else B=e[34];return B};var yr="array-field",lM=t=>{let e=iM(52),{field:o,forceRender:n,path:r,permissions:s,readOnly:i,schemaPath:a,validate:l}=t,{name:c,admin:u,fields:d,label:f,localized:m,maxRows:h,minRows:p,required:g}=o,b;e[0]!==u?(b=u===void 0?{}:u,e[0]=u,e[1]=b):b=e[1];let{className:v,description:x,isSortable:y}=b,C=y===void 0?!0:y,S=n===void 0?!1:n,w=a??c,D=p??g?1:0,{setDocFieldPreferences:_}=Ee(),{addFieldRow:A,dispatchFields:F,moveFieldRow:R,removeFieldRow:I,setModified:E}=Oe(),T=Xt(),{code:$}=Pe(),{i18n:j,t:N}=k(),{config:P}=H(),{localization:L}=P,V;e:{if(L&&L.fallback){let K=L.defaultLocale;V=$===K;break e}V=!0}let M=V,O;e[2]!==N?(O=K=>"labels"in K&&K?.labels?K.labels:"labels"in K.field&&K.field.labels?{plural:K.field.labels?.plural,singular:K.field.labels?.singular}:"label"in K.field&&K.field.label?{plural:void 0,singular:K.field.label}:{plural:N("general:rows"),singular:N("general:row")},e[2]=N,e[3]=O):O=e[3];let G=O(t),X;e[4]!==M||e[5]!==h||e[6]!==D||e[7]!==g||e[8]!==l?(X=(K,W)=>{if(!M&&K===null)return!0;if(typeof l=="function")return l(K,{...W,maxRows:h,minRows:D,required:g})},e[4]=M,e[5]=h,e[6]=D,e[7]=g,e[8]=l,e[9]=X):X=e[9];let Z=X,te;e[10]!==Z||e[11]!==r?(te={hasRows:!0,potentiallyStalePath:r,validate:Z},e[10]=Z,e[11]=r,e[12]=te):te=e[12];let{customComponents:U,disabled:z,errorPaths:le,path:J,rows:ce,showError:re,valid:q,value:pe}=Te(te),he;e[13]!==U?(he=U===void 0?{}:U,e[13]=U,e[14]=he):he=e[14];let{AfterInput:Re,BeforeInput:ge,Description:Ve,Error:Q,Label:Le}=he,_e;e[15]!==ce?(_e=ce===void 0?[]:ce,e[15]=ce,e[16]=_e):_e=e[16];let ae=_e,se;e[17]!==A||e[18]!==J||e[19]!==w?(se=K=>{A({path:J,rowIndex:K,schemaPath:w}),setTimeout(()=>{Ji(`${J}-row-${K}`)},0)},e[17]=A,e[18]=J,e[19]=w,e[20]=se):se=e[20];let Y=se,ie;e[21]!==F||e[22]!==J||e[23]!==E?(ie=K=>{F({type:"DUPLICATE_ROW",path:J,rowIndex:K}),E(!0),setTimeout(()=>{Ji(`${J}-row-${K}`)},0)},e[21]=F,e[22]=J,e[23]=E,e[24]=ie):ie=e[24];let de=ie,Ce;e[25]!==J||e[26]!==I?(Ce=K=>{I({path:J,rowIndex:K})},e[25]=J,e[26]=I,e[27]=Ce):Ce=e[27];let ze=Ce,$e;e[28]!==R||e[29]!==J?($e=(K,W)=>{R({moveFromIndex:K,moveToIndex:W,path:J})},e[28]=R,e[29]=J,e[30]=$e):$e=e[30];let ot=$e,Xe;e[31]!==F||e[32]!==J||e[33]!==ae||e[34]!==_?(Xe=K=>{let{collapsedIDs:W,updatedRows:ee}=fd({collapsed:K,rows:ae});_(J,{collapsed:W}),F({type:"SET_ALL_ROWS_COLLAPSED",path:J,updatedRows:ee})},e[31]=F,e[32]=J,e[33]=ae,e[34]=_,e[35]=Xe):Xe=e[35];let Ue=Xe,ft;e[36]!==F||e[37]!==J||e[38]!==ae||e[39]!==_?(ft=(K,W)=>{let{collapsedIDs:ee,updatedRows:fe}=md({collapsed:W,rowID:K,rows:ae});F({type:"SET_ROW_COLLAPSED",path:J,updatedRows:fe}),_(J,{collapsed:ee})},e[36]=F,e[37]=J,e[38]=ae,e[39]=_,e[40]=ft):ft=e[40];let Qt=ft,Ge=h&&ae.length>=h,Je=le.length,Ye=T&&le.length>0,xt=(i||z)&&ae.length===0,jt=ae.length&&ae.length<D||g&&ae.length===0,gt=Ye?`${yr}--has-error`:`${yr}--has-no-error`,qe;e[41]!==v||e[42]!==gt?(qe=[ye,yr,v,gt].filter(Boolean),e[41]=v,e[42]=gt,e[43]=qe):qe=e[43];let Tt;e[44]!==Q||e[45]!==J||e[46]!==re?(Tt=re&&uo(oe,{CustomComponent:Q,Fallback:uo(He,{path:J,showError:re})}),e[44]=Q,e[45]=J,e[46]=re,e[47]=Tt):Tt=e[47];let be;return e[48]!==Je||e[49]!==Ye||e[50]!==j?(be=Ye&&Je>0&&uo(io,{count:Je,i18n:j,withMessage:!0}),e[48]=Je,e[49]=Ye,e[50]=j,e[51]=be):be=e[51],vi("div",{className:qe.join(" "),id:`field-${J.replace(/\./g,"__")}`,children:[Tt,vi("header",{className:`${yr}__header`,children:[vi("div",{className:`${yr}__header-wrap`,children:[vi("div",{className:`${yr}__header-content`,children:[uo("h3",{className:`${yr}__title`,children:uo(oe,{CustomComponent:Le,Fallback:uo(ve,{as:"span",label:f,localized:m,path:J,required:g})})}),be]}),ae?.length>0&&vi("ul",{className:`${yr}__header-actions`,children:[uo("li",{children:uo("button",{className:`${yr}__header-action`,onClick:()=>Ue(!0),type:"button",children:N("fields:collapseAll")})}),uo("li",{children:uo("button",{className:`${yr}__header-action`,onClick:()=>Ue(!1),type:"button",children:N("fields:showAll")})})]})]}),uo(oe,{CustomComponent:Ve,Fallback:uo(Be,{description:x,path:J})})]}),uo(Fl,{fieldValue:pe,localized:m,path:J}),ge,(ae?.length>0||!q&&(xt||jt))&&vi(cr,{className:`${yr}__draggable-rows`,ids:ae.map(cM),onDragEnd:K=>{let{moveFromIndex:W,moveToIndex:ee}=K;return ot(W,ee)},children:[ae.map((K,W)=>{let{id:ee,isLoading:fe}=K,Ae=`${J}.${W}`,Ne=le?.filter(we=>we.startsWith(Ae+".")).length;return uo(Jr,{disabled:i||z||!C,id:ee,children:we=>uo(YI,{...we,addRow:Y,CustomRowLabel:ae?.[W]?.customComponents?.RowLabel,duplicateRow:de,errorCount:Ne,fields:d,forceRender:S,hasMaxRows:Ge,isLoading:fe,isSortable:C,labels:G,moveRow:ot,parentPath:J,path:Ae,permissions:s,readOnly:i||z,removeRow:ze,row:K,rowCount:ae?.length,rowIndex:W,schemaPath:w,setCollapse:Qt})},ee)}),!q&&vi(aM.Fragment,{children:[xt&&uo(Ir,{children:N("validation:fieldHasNo",{label:Fb(G.plural,j)})}),jt&&uo(Ir,{type:"error",children:N("validation:requiresAtLeast",{count:D,label:Fb(D>1?G.plural:G.singular,j)||N(D>1?"general:rows":"general:row")})})]})]}),!Ge&&!i&&uo(ne,{buttonStyle:"icon-label",className:`${yr}__add-row`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:()=>{Y(pe||0)},children:N("fields:addLabel",{label:Fb(G.singular,j)})}),Re]})},Zc=je(lM);function cM(t){return t.id}import{c as uM}from"react/compiler-runtime";import{jsx as Ab,jsxs as ZI}from"react/jsx-runtime";import{confirmPassword as dM}from"payload/shared";import"react";var qc=t=>{let e=uM(12),{disabled:o,path:n}=t,r=n===void 0?"confirm-password":n,{t:s}=k(),i;e[0]!==r?(i={path:r,validate:mM},e[0]=r,e[1]=i):i=e[1];let{disabled:a,setValue:l,showError:c,value:u}=Te(i),d=c&&"error",f;e[2]!==d?(f=[ye,"confirm-password",d].filter(Boolean),e[2]=d,e[3]=f):f=e[3];let m=f.join(" "),h;return e[4]!==a||e[5]!==o||e[6]!==r||e[7]!==l||e[8]!==s||e[9]!==m||e[10]!==u?(h=ZI("div",{className:m,children:[Ab(ve,{htmlFor:"field-confirm-password",label:s("authentication:confirmPassword"),required:!0}),ZI("div",{className:`${ye}__wrap`,children:[Ab(He,{path:r}),Ab("input",{"aria-label":s("authentication:confirmPassword"),autoComplete:"off",disabled:!!(a||o),id:"field-confirm-password",name:"confirm-password",onChange:l,type:"password",value:u||""})]})]}),e[4]=a,e[5]=o,e[6]=r,e[7]=l,e[8]=s,e[9]=m,e[10]=u,e[11]=h):h=e[11],h};function mM(t,e){return dM(t,{name:"confirm-password",type:"text",required:!0,...e})}import{jsx as pM}from"react/jsx-runtime";import{password as hM}from"payload/shared";import{useCallback as gM,useMemo as bM}from"react";import{c as fM}from"react/compiler-runtime";import{jsx as xi,jsxs as Tb}from"react/jsx-runtime";import{getTranslation as JI}from"@payloadcms/translations";import"react";var qI=t=>{let e=fM(28),{AfterInput:o,autoComplete:n,BeforeInput:r,className:s,description:i,Description:a,Error:l,inputRef:c,Label:u,label:d,localized:f,onChange:m,onKeyDown:h,path:p,placeholder:g,readOnly:b,required:v,rtl:x,showError:y,style:C,value:S,width:w}=t,D=n===void 0?"off":n,{i18n:_}=k(),A=y&&"error",F=b&&"read-only",R;e[0]!==s||e[1]!==A||e[2]!==F?(R=[ye,"password",s,A,F].filter(Boolean),e[0]=s,e[1]=A,e[2]=F,e[3]=R):R=e[3];let I=R.join(" "),E;return e[4]!==o||e[5]!==r||e[6]!==a||e[7]!==l||e[8]!==u||e[9]!==D||e[10]!==i||e[11]!==_||e[12]!==c||e[13]!==d||e[14]!==f||e[15]!==m||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==y||e[23]!==C||e[24]!==I||e[25]!==S||e[26]!==w?(E=Tb("div",{className:I,style:{...C,width:w},children:[xi(oe,{CustomComponent:u,Fallback:xi(ve,{label:d,localized:f,path:p,required:v})}),Tb("div",{className:`${ye}__wrap`,children:[xi(oe,{CustomComponent:l,Fallback:xi(He,{path:p,showError:y})}),Tb("div",{children:[r,xi("input",{"aria-label":JI(d,_),autoComplete:D,"data-rtl":x,disabled:b,id:`field-${p.replace(/\./g,"__")}`,name:p,onChange:m,onKeyDown:h,placeholder:JI(g,_),ref:c,type:"password",value:S||""}),o]}),xi(oe,{CustomComponent:a,Fallback:xi(Be,{description:i,path:p})})]})]}),e[4]=o,e[5]=r,e[6]=a,e[7]=l,e[8]=u,e[9]=D,e[10]=i,e[11]=_,e[12]=c,e[13]=d,e[14]=f,e[15]=m,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=y,e[23]=C,e[24]=I,e[25]=S,e[26]=w,e[27]=E):E=e[27],E};var vM=t=>{let{autoComplete:e,field:o,field:{admin:{className:n,disabled:r,placeholder:s,rtl:i}={},label:a,localized:l,required:c}={},inputRef:u,path:d,validate:f}=t,{t:m}=k(),h=Pe(),{config:p}=H(),g=gM((R,I)=>{let E=d?d.split("."):[];return typeof f=="function"?f(R,{...I,required:c}):hM(R,{name:"password",type:"text",blockData:{},data:{},event:"onChange",path:E,preferences:{fields:{}},req:{payload:{config:p},t:m},required:!0,siblingData:{}})},[f,p,m,c,d]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,setValue:w,showError:D,value:_}=Te({path:d,validate:g}),A=Zi({fieldLocalized:!1,fieldRTL:i,locale:h,localizationConfig:p.localization||void 0}),F=bM(()=>rt(o),[o]);return pM(qI,{AfterInput:b,autoComplete:e,BeforeInput:v,className:n,Description:x,Error:y,inputRef:u,Label:C,label:a,localized:l,onChange:R=>{w(R.target.value)},path:d,placeholder:s,readOnly:S||r,required:c,rtl:A,showError:D,style:F,value:_||""})},Qc=je(vM);var QI={array:Zc,blocks:Ll,checkbox:mr,code:kl,collapsible:Ol,confirmPassword:qc,date:ec,email:oi,group:tc,hidden:oc,join:mc,json:fc,number:pc,password:Qc,point:hc,radio:vc,relationship:Sc,richText:Ic,row:Rc,select:_c,tabs:Tc,text:di,textarea:Ec,ui:Pc,upload:Yc},xM={...QI,Description:Be,Error:He,Label:ve,RowLabel:dn};import{c as yM}from"react/compiler-runtime";import{setsAreEqual as CM}from"payload/shared";import{useEffect as wM}from"react";var Ln=new Map([]),SM={altleft:"alt",altright:"alt",controlleft:"ctrl",controlright:"ctrl",ctrlleft:"ctrl",ctrlright:"ctrl",escape:"esc",metaleft:"meta",metaright:"meta",osleft:"meta",osright:"meta",shiftleft:"shift",shiftright:"shift"},KI=t=>(SM[t.toLowerCase()]||t).trim().toLowerCase().replace("key",""),IM=t=>{let e=KI(t);e==="meta"&&Ln.forEach((o,n)=>n!=="meta"&&Ln.delete(n)),Ln.set(e,Date.now())},RM=t=>{let e=KI(t);e==="meta"&&Ln.clear(),Ln.delete(e)},yi=(t,e)=>{let o=yM(9),{cmdCtrlKey:n,editDepth:r,keyCodes:s}=t,{modalState:i}=ue(),a;o[0]!==n||o[1]!==r||o[2]!==e||o[3]!==s||o[4]!==i?(a=f=>{let m=f.detail?.key?f.detail:f;if(m.key===void 0)return;Ln.forEach(_M),m.code&&IM(m.code);let h=window.navigator.userAgent.includes("Mac OS X"),p=[...Ln.keys()].filter(DM);if(CM(new Set(p),new Set(s))&&(!n||h&&Ln.has("meta")||!h&&m.ctrlKey)){if((Object.keys(i).filter(b=>i[b]?.isOpen)?.length+1||1)!==r)return;e(m)}},o[0]=n,o[1]=r,o[2]=e,o[3]=s,o[4]=i,o[5]=a):a=o[5];let l=a,c=FM,u,d;o[6]!==l?(u=()=>(document.addEventListener("keydown",l,!1),document.addEventListener("bypassKeyDown",l,!1),document.addEventListener("keyup",c,!1),()=>{document.removeEventListener("keydown",l),document.removeEventListener("bypassKeyDown",l),document.removeEventListener("keyup",c)}),d=[l,c],o[6]=l,o[7]=u,o[8]=d):(u=o[7],d=o[8]),wM(u,d)};function _M(t,e){Date.now()-t>3e3&&Ln.delete(e)}function DM(t){return!["alt","ctrl","meta","shift"].includes(t)}function FM(t){t.code&&RM(t.code)}import{c as AM}from"react/compiler-runtime";import*as t4 from"qs-esm";import{useEffect as e4,useRef as TM,useState as of}from"react";var EM=(t,e)=>{let o=AM(32),n;o[0]!==e?(n=e===void 0?{}:e,o[0]=e,o[1]=n):n=o[1];let r=n,{initialData:s,initialParams:i}=r,a;o[2]!==i?(a=i===void 0?{}:i,o[2]=i,o[3]=a):a=o[3];let l=a,{i18n:c}=k(),u;o[4]!==s?(u=s||{},o[4]=s,o[5]=u):u=o[5];let[d,f]=of(u),[m,h]=of(l),[p,g]=of(!s),[b,v]=of(!1),{code:x}=Pe(),y=TM(!1),C;if(o[6]!==x||o[7]!==m){let E;o[9]!==m?(E=typeof m=="object"?m:{},o[9]=m,o[10]=E):E=o[10],C=t4.stringify({locale:x,...E},{addQueryPrefix:!0}),o[6]=x,o[7]=m,o[8]=C}else C=o[8];let S=C,w;o[11]!==c.language||o[12]!==s||o[13]!==S||o[14]!==t?(w=()=>{if(s&&!y.current){y.current=!0;return}let E=new AbortController;return t?(async()=>{v(!1),g(!0);try{let $=await Qe.get(`${t}${S}`,{headers:{"Accept-Language":c.language},signal:E.signal});$.status>201&&v(!0);let j=await $.json();f(j),g(!1)}catch{E.signal.aborted||(v(!0),g(!1))}})():(v(!1),g(!1)),()=>{try{E.abort()}catch($){let j=$}}},o[11]=c.language,o[12]=s,o[13]=S,o[14]=t,o[15]=w):w=o[15];let D;o[16]!==c.language||o[17]!==s||o[18]!==x||o[19]!==S||o[20]!==t?(D=[t,x,S,c.language,s],o[16]=c.language,o[17]=s,o[18]=x,o[19]=S,o[20]=t,o[21]=D):D=o[21],e4(w,D);let _,A;o[22]!==s?(_=()=>{s&&y.current&&f(s)},A=[s],o[22]=s,o[23]=_,o[24]=A):(_=o[23],A=o[24]),e4(_,A);let F;o[25]!==d||o[26]!==b||o[27]!==p?(F={data:d,isError:b,isLoading:p},o[25]=d,o[26]=b,o[27]=p,o[28]=F):F=o[28];let R;o[29]===Symbol.for("react.memo_cache_sentinel")?(R={setParams:h},o[29]=R):R=o[29];let I;return o[30]!==F?(I=[F,R],o[30]=F,o[31]=I):I=o[31],I};import{c as PM}from"react/compiler-runtime";import{useEffect as NM,useState as LM}from"react";var $M=t=>{let e=PM(5),[o,n]=LM(),r,s;e[0]!==t?(r=()=>{let a;return t&&(a=new ResizeObserver(l=>{l.forEach(c=>{let{contentBoxSize:u,contentRect:d}=c,f=0,m=0;if(u){let h=Array.isArray(u)?u[0]:u;if(h){let{blockSize:p,inlineSize:g}=h;f=g,m=p}}else if(d){let{height:h,width:p}=d;f=p,m=h}n({height:m,width:f})})}),a.observe(t)),()=>{a&&a.unobserve(t)}},s=[t],e[0]=t,e[1]=r,e[2]=s):(r=e[1],s=e[2]),NM(r,s);let i;return e[3]!==o?(i={size:o},e[3]=o,e[4]=i):i=e[4],i};import{flattenTopLevelFields as kM}from"payload/shared";var Eb=t=>{let{admin:{useAsTitle:e},fields:o}=t;return kM(o)?.find(r=>"name"in r&&r.name===e)};import{c as n4}from"react/compiler-runtime";import{jsx as ka}from"react/jsx-runtime";import{useEffect as jM,useRef as OM}from"react";import{jsx as rf}from"react/jsx-runtime";import"react";var o4=({className:t})=>rf("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rf("path",{className:"fill",d:"M2.5 13.3333L5.83333 16.6667M5.83333 16.6667L9.16667 13.3333M5.83333 16.6667V3.33333M9.16667 7.08333H17.5M9.16667 10.4167H15M11.6667 13.75H12.5",stroke:"#2F2F2F",strokeLinecap:"round",strokeLinejoin:"round"})}),r4=({className:t})=>rf("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rf("path",{className:"fill",d:"M2.5 6.66668L5.83333 3.33334M5.83333 3.33334L9.16667 6.66668M5.83333 3.33334V16.6667M11.6667 7.08354H17.5M9.16667 10.4169H15M9.16667 13.7502H12.5",stroke:"#2F2F2F",strokeLinecap:"round",strokeLinejoin:"round"})});var $n="sort-header";function MM(){let t=n4(12),{handleSortChange:e,orderableFieldName:o,query:n}=Rt(),r=Array.isArray(n.sort)?n.sort[0]:n.sort,s=OM(r===`-${o}`?"desc":"asc"),i=r===`-${o}`||r===o,a,l;t[0]!==i||t[1]!==o||t[2]!==r?(a=()=>{i&&(s.current=r===`-${o}`?"desc":"asc")},l=[o,r,i],t[0]=i,t[1]=o,t[2]=r,t[3]=a,t[4]=l):(a=t[3],l=t[4]),jM(a,l);let c;t[5]!==e||t[6]!==i||t[7]!==o?(c=()=>{if(i){e(s.current==="asc"?`-${o}`:o),s.current=s.current==="asc"?"desc":"asc";return}e(s.current==="asc"?o:`-${o}`)},t[5]=e,t[6]=i,t[7]=o,t[8]=c):c=t[8];let u=c,d;return t[9]!==u||t[10]!==i?(d={handleSortPress:u,isActive:i,sort:s},t[9]=u,t[10]=i,t[11]=d):d=t[11],d}var BM=t=>{let e=n4(8),{appearance:o}=t,{handleSortPress:n,isActive:r,sort:s}=MM(),{t:i}=k(),a=o&&`${$n}--appearance-${o}`,l;e[0]!==a?(l=[$n,a].filter(Boolean),e[0]=a,e[1]=l):l=e[1];let c=l.join(" "),u;return e[2]!==n||e[3]!==r||e[4]!==s.current||e[5]!==i||e[6]!==c?(u=ka("div",{className:c,children:ka("div",{className:`${$n}__buttons`,children:s.current==="desc"?ka("button",{"aria-label":i("general:sortByLabelDirection",{direction:i("general:ascending"),label:"Order"}),className:`${$n}__button ${$n}__${s.current} ${r?`${$n}--active`:""}`,onClick:n,type:"button",children:ka(o4,{})}):ka("button",{"aria-label":i("general:sortByLabelDirection",{direction:i("general:descending"),label:"Order"}),className:`${$n}__button ${$n}__${s.current} ${r?`${$n}--active`:""}`,onClick:n,type:"button",children:ka(r4,{})})})}),e[2]=n,e[3]=r,e[4]=s.current,e[5]=i,e[6]=c,e[7]=u):u=e[7],u};import{c as VM}from"react/compiler-runtime";import{jsx as s4}from"react/jsx-runtime";import"react";var i4="sort-row",GM=()=>{let t=VM(2),{orderableFieldName:e,query:o}=Rt(),n=o.sort===e||o.sort===`-${e}`,r=`${i4} ${n?"active":""}`,s;return t[0]!==r?(s=s4("div",{className:r,role:"button",tabIndex:0,children:s4(Cn,{className:`${i4}__icon`})}),t[0]=r,t[1]=s):s=t[1],s};import{jsx as Xr,jsxs as l4}from"react/jsx-runtime";import{DragOverlay as WM}from"@dnd-kit/core";import{useEffect as HM,useState as Lb}from"react";import{jsx as nf}from"react/jsx-runtime";var Pb=({cellMap:t,columns:e,dragAttributes:o={},dragListeners:n={},rowId:r,...s})=>nf("tr",{...s,children:e.map((i,a)=>{let{accessor:l}=i,c=i.renderedCells[t[r]];return l==="_dragHandle"?nf("td",{className:`cell-${l}`,children:nf("div",{...o,...n,children:c})},a):nf("td",{className:`cell-${l}`,children:c},a)})});import{jsx as Nb}from"react/jsx-runtime";var a4=({children:t,className:e,rowId:o})=>typeof o>"u"?null:Nb("div",{className:e,children:Nb("table",{cellPadding:0,cellSpacing:0,children:Nb("tbody",{children:t})})});var sf="table",zM=({appearance:t="default",collection:e,columns:o,data:n})=>{let{config:r}=H(),{data:s,orderableFieldName:i,query:a}=Rt(),l=s?.docs||n,[c,u]=Lb(l),[d,f]=Lb({}),[m,h]=Lb();HM(()=>{u(l),f(Object.fromEntries(l.map((x,y)=>[String(x.id??x._id),y])))},[l]);let p=o?.filter(x=>x?.active);if(!p||p.filter(x=>!["_dragHandle","_select"].includes(x.accessor)).length===0)return Xr("div",{children:"No columns selected"});let g=async({moveFromIndex:x,moveToIndex:y})=>{if(a.sort!==i&&a.sort!==`-${i}`){me.warning('To reorder the rows you must first sort them by the "Order" column'),h(void 0);return}if(x===y){h(void 0);return}let C=c[x].id??c[x]._id,S=y>x?c[y]:c[y-1],w=y>x?c[y+1]:c[y],D=[...c];u(_=>{let A=[..._];return A[x][i]="pending",A.splice(y,0,A.splice(x,1)[0]),A});try{let _=S?{id:S.id??S._id,key:S[i]}:{id:w.id??w._id,key:w[i]},A=S&&a.sort===i||!S&&a.sort===`-${i}`?"greater":"less",F={collectionSlug:e.slug,docsToMove:[C],newKeyWillBe:A,orderableFieldName:i,target:_},R=await fetch(`${r.routes.api}/reorder`,{body:JSON.stringify(F),headers:{"Content-Type":"application/json"},method:"POST"});if(R.status===403)throw new Error("You do not have permission to reorder these rows");if(!R.ok)throw new Error("Failed to reorder. This can happen if you reorder several rows too quickly. Please try again.")}catch(_){let A=_ instanceof Error?_.message:String(_);u(D),me.error(A)}finally{h(void 0)}},b=({id:x})=>{h(x)},v=c.map(x=>x.id??x._id);return Xr("div",{className:[sf,t&&`${sf}--appearance-${t}`].filter(Boolean).join(" "),children:l4(cr,{ids:v,onDragEnd:g,onDragStart:b,children:[l4("table",{cellPadding:"0",cellSpacing:"0",children:[Xr("thead",{children:Xr("tr",{children:p.map((x,y)=>Xr("th",{id:`heading-${x.accessor}`,children:x.Heading},y))})}),Xr("tbody",{children:c.map((x,y)=>Xr(Jr,{id:v[y],children:({attributes:C,isDragging:S,listeners:w,setNodeRef:D,transform:_,transition:A})=>Xr(Pb,{cellMap:d,className:`row-${y+1}`,columns:p,dragAttributes:C,dragListeners:w,ref:D,rowId:x.id??x._id,style:{opacity:S?0:1,transform:_,transition:A}})},v[y]))})]}),Xr(WM,{children:Xr(a4,{className:[sf,`${sf}--drag-preview`].join(" "),rowId:m,children:Xr(Pb,{cellMap:d,columns:p,rowId:m})})})]})})};import{jsx as c4}from"react/jsx-runtime";import{toWords as XM,transformColumnsToSearchParams as UM}from"payload/shared";import"react";var YM="query-preset-columns-cell",ZM=({cellData:t})=>c4("div",{className:YM,children:t?UM(t).map((e,o)=>{let n=!e.startsWith("-");return n?c4(vt,{pillStyle:n?"always-white":"light",children:XM(e)},o):null}):"No columns selected"});import{jsx as JM}from"react/jsx-runtime";import{toWords as u4}from"payload/shared";import"react";var qM=t=>{if(t.or&&t.or.length>0&&t.or[0].and&&t.or[0].and.length>0){let o=t.or[0]?.and?.[0];if(!o)return"No where query";let n=Object.keys(o)[0];if(!o[n])return"No where query";let r=Object.keys(o[n])[0],s=o[n][r];return`${u4(n)} ${r} ${u4(s)}`}return""},QM=({cellData:t})=>JM("div",{children:t?qM(t):"No where query"});import{jsx as d4,jsxs as m4}from"react/jsx-runtime";import{toWords as f4}from"payload/shared";import{Fragment as KM}from"react";var eB=({cellData:t})=>{let e=["read","update","delete"];return d4("p",{children:e.reduce((o,n,r)=>{let s=t?.[n];return s&&s.constraint&&o.push(m4(KM,{children:[m4("span",{children:[d4("strong",{children:f4(n)}),": ",f4(s.constraint)]}),r!==e.length-1&&", "]},n)),o},[])})};import{c as tB}from"react/compiler-runtime";import{jsx as $b,jsxs as oB}from"react/jsx-runtime";import{toWords as rB,transformColumnsToSearchParams as nB}from"payload/shared";import"react";var sB=t=>{let e=tB(5),{field:o}=t,{label:n,required:r}=o,{path:s,value:i}=Te(),a;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==i?(a=oB("div",{className:"field-type query-preset-columns-field",children:[$b(ve,{as:"h3",label:n,path:s,required:r}),$b("div",{className:"value-wrapper",children:i?nB(i).map(iB):"No columns selected"})]}),e[0]=n,e[1]=s,e[2]=r,e[3]=i,e[4]=a):a=e[4],a};function iB(t,e){let o=!t.startsWith("-");return $b(vt,{pillStyle:o?"always-white":"light-gray",children:rB(t)},e)}import{jsx as kn,jsxs as af}from"react/jsx-runtime";import{getTranslation as aB}from"@payloadcms/translations";import{toWords as p4}from"payload/shared";import h4 from"react";var lB=(t,e)=>{if(!t)return null;let o=r=>{let s=Object.keys(r)[0];if(!r[s])return"No where query";let i=Object.keys(r[s])[0],a=r[s][i];if(typeof a=="object")try{a=new Date(a).toLocaleDateString()}catch{a="Unknown error has occurred"}return af(vt,{pillStyle:"always-white",children:[kn("b",{children:p4(s)})," ",i," ",kn("b",{children:p4(a)})]})};return((r,s)=>r.or&&r.or.length>0?kn("div",{className:"or-condition",children:r.or.map((i,a)=>kn(h4.Fragment,{children:i.and&&i.and.length>0?af("div",{className:"and-condition",children:[a===0&&kn("span",{className:"label",children:`Filter ${s} where `}),a>0&&kn("span",{className:"label",children:" or "}),i.and.map((l,c)=>af(h4.Fragment,{children:[o(l),c<i.and.length-1&&kn("span",{className:"label",children:" and "})]},c))]}):o(i)},a))}):o(r))(t,e)},cB=t=>{let{field:e}=t,{label:o,required:n}=e,{path:r,value:s}=Te(),{collectionSlug:i}=Rt(),{getEntityConfig:a}=H(),l=a({collectionSlug:i}),{i18n:c}=k();return af("div",{className:"field-type query-preset-where-field",children:[kn(ve,{as:"h3",label:o,path:r,required:n}),kn("div",{className:"value-wrapper",children:s?lB(s,aB(l.labels.plural,c)):"No where query"})]})};import{c as gB}from"react/compiler-runtime";import{jsx as bB}from"react/jsx-runtime";import vB from"react";import{c as uB}from"react/compiler-runtime";import{useRouter as dB}from"next/navigation.js";import{useEffect as kb,useRef as mB}from"react";function fB(t,...e){t&&t.addEventListener&&t.addEventListener(...e)}function pB(t,...e){t&&t.removeEventListener&&t.removeEventListener(...e)}var hB=(t,e)=>{let o=uB(7),n=t===void 0?!0:t,r;o[0]!==n||o[1]!==e?(r=l=>{if(typeof n!="function"||n())return l.preventDefault(),e&&(l.returnValue=e),e},o[0]=n,o[1]=e,o[2]=r):r=o[2];let s=r,i,a;o[3]!==n||o[4]!==s?(i=()=>{if(n)return fB(window,"beforeunload",s),()=>pB(window,"beforeunload",s)},a=[n,s],o[3]=n,o[4]=s,o[5]=i,o[6]=a):(i=o[5],a=o[6]),kb(i,a)},g4=({hasAccepted:t=!1,message:e="Are you sure want to leave this page?",onAccept:o,onPrevent:n,prevent:r=!0})=>{hB(r,e);let{startRouteTransition:s}=st(),i=dB(),a=mB("");kb(()=>{function l(d,f){let m=new URL(d),h=new URL(f);if(m.hostname===h.hostname&&m.pathname===h.pathname&&m.search===h.search){let p=m.hash,g=h.hash;return p!==g&&m.href.replace(p,"")===h.href.replace(g,"")}return!1}function c(d){for(;d&&d.tagName.toLowerCase()!=="a";)d=d.parentElement;return d}function u(d){try{let f=d.target,m=c(f);if(m){let h=window.location.href,p=m.href,g=l(h,p),b=m.download!=="",v=m.target==="_blank"||d.metaKey||d.ctrlKey;!(p===h||g||b||v)&&r&&(n||!window.confirm(e))&&(a.current=p,d.preventDefault(),d.stopPropagation(),typeof n=="function"&&n())}}catch(f){alert(f)}}return document.addEventListener("click",u,!0),()=>{document.removeEventListener("click",u,!0)}},[n,r,e]),kb(()=>{t&&a.current&&(o&&o(),s(()=>i.push(a.current)))},[t,o,i,s])};var lf="leave-without-saving",Kc=()=>{let t=gB(15),{closeModal:e,openModal:o}=ue(),n=Ut(),{isValid:r}=Oe(),{user:s}=De(),[i,a]=vB.useState(!1),{t:l}=k(),c=!!((n||!r)&&s),u;t[0]!==o?(u=()=>{o(lf)},t[0]=o,t[1]=u):u=t[1];let d=u,f;t[2]!==e?(f=()=>{e(lf)},t[2]=e,t[3]=f):f=t[3];let m=f,h;t[4]!==m||t[5]!==i||t[6]!==d||t[7]!==c?(h={hasAccepted:i,onAccept:m,onPrevent:d,prevent:c},t[4]=m,t[5]=i,t[6]=d,t[7]=c,t[8]=h):h=t[8],g4(h);let p;t[9]!==e?(p=()=>{e(lf)},t[9]=e,t[10]=p):p=t[10];let g=p,b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{a(!0)},t[11]=b):b=t[11];let v=b,x;return t[12]!==g||t[13]!==l?(x=bB(It,{body:l("general:changesNotSaved"),cancelLabel:l("general:stayOnThisPage"),confirmLabel:l("general:leaveAnyway"),heading:l("general:leaveWithoutSaving"),modalSlug:lf,onCancel:g,onConfirm:v}),t[12]=g,t[13]=l,t[14]=x):x=t[14],x};import{c as xB}from"react/compiler-runtime";import{jsx as eu,jsxs as jb}from"react/jsx-runtime";import{useEffect as yB}from"react";var ja="document-take-over",cf="document-take-over",Ob=t=>{let e=xB(17),{handleBackToDashboard:o,isActive:n,onReadOnly:r}=t,{closeModal:s,openModal:i}=ue(),{t:a}=k(),{startRouteTransition:l}=st(),c,u;e[0]!==s||e[1]!==n||e[2]!==i?(c=()=>{n?i(ja):s(ja)},u=[n,i,s],e[0]=s,e[1]=n,e[2]=i,e[3]=c,e[4]=u):(c=e[3],u=e[4]),yB(c,u);let d;if(e[5]!==s||e[6]!==o||e[7]!==r||e[8]!==l||e[9]!==a){let f;e[11]!==o||e[12]!==l?(f=()=>{l(()=>o())},e[11]=o,e[12]=l,e[13]=f):f=e[13];let m;e[14]!==s||e[15]!==r?(m=()=>{r(),s(ja)},e[14]=s,e[15]=r,e[16]=m):m=e[16],d=eu(Yo,{className:cf,slug:ja,children:jb("div",{className:`${cf}__wrapper`,children:[jb("div",{className:`${cf}__content`,children:[eu("h1",{children:a("general:editingTakenOver")}),eu("p",{children:a("general:anotherUserTakenOver")})]}),jb("div",{className:`${cf}__controls`,children:[eu(ne,{buttonStyle:"primary",id:`${ja}-back-to-dashboard`,onClick:f,size:"large",children:a("general:backToDashboard")}),eu(ne,{buttonStyle:"secondary",id:`${ja}-view-read-only`,onClick:m,size:"large",children:a("general:viewReadOnly")})]})]})}),e[5]=s,e[6]=o,e[7]=r,e[8]=l,e[9]=a,e[10]=d}else d=e[10];return d};import{c as CB}from"react/compiler-runtime";import{jsx as Ci,jsxs as tu}from"react/jsx-runtime";import{useEffect as wB}from"react";var uf=t=>t&&typeof t=="object";var Cs="document-locked",df="document-locked",SB=t=>t?new Intl.DateTimeFormat("en-US",{day:"numeric",hour:"numeric",hour12:!0,minute:"numeric",month:"short",year:"numeric"}).format(t):"",Mb=t=>{let e=CB(30),{handleGoBack:o,isActive:n,onReadOnly:r,onTakeOver:s,updatedAt:i,user:a}=t,{closeModal:l,openModal:c}=ue(),{t:u}=k(),{startRouteTransition:d}=st(),f,m;e[0]!==l||e[1]!==n||e[2]!==c?(f=()=>{n?c(Cs):l(Cs)},m=[n,c,l],e[0]=l,e[1]=n,e[2]=c,e[3]=f,e[4]=m):(f=e[3],m=e[4]),wB(f,m);let h;e[5]!==o||e[6]!==d?(h=()=>{d(()=>o())},e[5]=o,e[6]=d,e[7]=h):h=e[7];let p;if(e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==s||e[12]!==d||e[13]!==u||e[14]!==h||e[15]!==i||e[16]!==a){let g;e[18]!==u||e[19]!==a?(g=uf(a)?a.email??a.id:`${u("general:user")}: ${a}`,e[18]=u,e[19]=a,e[20]=g):g=e[20];let b;e[21]!==o||e[22]!==d?(b=()=>{d(()=>o())},e[21]=o,e[22]=d,e[23]=b):b=e[23];let v;e[24]!==l||e[25]!==r?(v=()=>{r(),l(Cs)},e[24]=l,e[25]=r,e[26]=v):v=e[26];let x;e[27]!==l||e[28]!==s?(x=()=>{s(),l(Cs)},e[27]=l,e[28]=s,e[29]=x):x=e[29],p=Ci(Yo,{className:df,onClose:h,slug:Cs,children:tu("div",{className:`${df}__wrapper`,children:[tu("div",{className:`${df}__content`,children:[Ci("h1",{children:u("general:documentLocked")}),tu("p",{children:[Ci("strong",{children:g})," ",u("general:currentlyEditing")]}),tu("p",{children:[u("general:editedSince")," ",Ci("strong",{children:SB(i)})]})]}),tu("div",{className:`${df}__controls`,children:[Ci(ne,{buttonStyle:"secondary",id:`${Cs}-go-back`,onClick:b,size:"large",children:u("general:goBack")}),Ci(ne,{buttonStyle:"secondary",id:`${Cs}-view-read-only`,onClick:v,size:"large",children:u("general:viewReadOnly")}),Ci(ne,{buttonStyle:"primary",id:`${Cs}-take-over`,onClick:x,size:"large",children:u("general:takeOver")})]})]})}),e[8]=l,e[9]=o,e[10]=r,e[11]=s,e[12]=d,e[13]=u,e[14]=h,e[15]=i,e[16]=a,e[17]=p}else p=e[17];return p};import{jsx as mf}from"react/jsx-runtime";import"react";var b4=({elements:t,translationString:e})=>{let o=/(<[^>]+>.*?<\/[^>]+>)/g,n=e.split(o);return mf("span",{children:n.map((r,s)=>{if(t&&r.startsWith("<")&&r.endsWith(">")){let i=r[1],a=t[i];if(a){let l=new RegExp(`<${i}>(.*?)</${i}>`,"g"),c=r.replace(l,(u,d)=>d);return mf(a,{children:mf(b4,{translationString:c})},s)}}return r})})},wi=({elements:t,i18nKey:e,t:o,variables:n})=>{let r=o(e,n||{});return t?mf(b4,{elements:t,translationString:r}):r};import{c as IB}from"react/compiler-runtime";import{jsx as RB}from"react/jsx-runtime";import{getTranslation as _B}from"@payloadcms/translations";import NFe from"react";function Bb(t){let e=IB(3),{i18n:o}=k(),{description:n}=t;if(n){let r;return e[0]!==n||e[1]!==o?(r=RB("div",{className:"custom-view-description",children:_B(n,o)}),e[0]=n,e[1]=o,e[2]=r):r=e[2],r}return null}import{jsx as zo,jsxs as bf}from"react/jsx-runtime";import{formatAdminURL as d7}from"payload/shared";import{useEffect as m7,useRef as f7,useState as p7}from"react";import{c as EB}from"react/compiler-runtime";import{jsx as A4}from"react/jsx-runtime";import{usePathname as PB}from"next/navigation.js";import{formatAdminURL as NB}from"payload/shared";import"react";import{jsx as Vb,jsxs as DB}from"react/jsx-runtime";import"react";var ou="graphic-account",v4=t=>DB("svg",{className:[ou,t?.active&&`${ou}--active`].filter(Boolean).join(" "),height:"25",viewBox:"0 0 25 25",width:"25",xmlns:"http://www.w3.org/2000/svg",children:[Vb("circle",{className:`${ou}__bg`,cx:"12.5",cy:"12.5",r:"11.5"}),Vb("circle",{className:`${ou}__head`,cx:"12.5",cy:"10.73",r:"3.98"}),Vb("path",{className:`${ou}__body`,d:"M12.5,24a11.44,11.44,0,0,0,7.66-2.94c-.5-2.71-3.73-4.8-7.66-4.8s-7.16,2.09-7.66,4.8A11.44,11.44,0,0,0,12.5,24Z"})]});var D4=Ds(_4(),1);import{c as AB}from"react/compiler-runtime";import{jsx as TB}from"react/jsx-runtime";import"react";var F4=()=>{let t=AB(2),{user:e}=De(),o=(0,D4.default)(e.email.trim().toLowerCase()),r=`?${new URLSearchParams({default:"mp",r:"g",s:"50"}).toString()}`,s=`https://www.gravatar.com/avatar/${o}?${r}`,i;return t[0]!==s?(i=TB("img",{alt:"yas",className:"gravatar-account",height:25,src:s,style:{borderRadius:"50%"},width:25}),t[0]=s,t[1]=i):i=t[1],i};var Hb=()=>{let t=EB(3),{config:e}=H(),{admin:o,routes:n}=e,{avatar:r,routes:s}=o,{account:i}=s,{admin:a}=n,{user:l}=De(),u=PB()===NB({adminRoute:a,path:i});if(!l?.email||r==="default"){let d;return t[0]!==u?(d=A4(v4,{active:u}),t[0]=u,t[1]=d):d=t[1],d}if(r==="gravatar"){let d;return t[2]===Symbol.for("react.memo_cache_sentinel")?(d=A4(F4,{}),t[2]=d):d=t[2],d}};import{c as LB}from"react/compiler-runtime";import{jsx as $B}from"react/jsx-runtime";import{createContext as kB,use as jB,useState as OB}from"react";var T4=kB({Actions:{},setViewActions:()=>{}}),zb=()=>jB(T4),MB=t=>{let e=LB(4),{Actions:o,children:n}=t,[r,s]=OB(o),i;return e[0]!==o||e[1]!==n||e[2]!==r?(i=$B(T4,{value:{Actions:{...r,...o},setViewActions:s},children:n}),e[0]=o,e[1]=n,e[2]=r,e[3]=i):i=e[3],i};import{c as BB}from"react/compiler-runtime";import{jsx as ff,jsxs as N4}from"react/jsx-runtime";import"react";import{jsx as E4}from"react/jsx-runtime";import"react";var Xb=()=>E4("svg",{className:"icon icon--close-menu",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:E4("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})});import{jsx as P4}from"react/jsx-runtime";import"react";var Ub=()=>P4("svg",{className:"icon icon--menu",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:P4("path",{className:"stroke",d:"M4.66667 10H15.3333M4.66667 6H15.3333M4.66667 14H15.3333",strokeLinecap:"square"})});var Yb="hamburger",Zb=t=>{let e=BB(4),{t:o}=k(),{closeIcon:n,isActive:r}=t,s=n===void 0?"x":n,i=r===void 0?!1:r,a;return e[0]!==s||e[1]!==i||e[2]!==o?(a=N4("div",{className:Yb,children:[!i&&ff("div",{"aria-label":o("general:open"),className:`${Yb}__open-icon`,title:o("general:open"),children:ff(Ub,{})}),i&&N4("div",{"aria-label":o(s==="collapse"?"general:collapse":"general:close"),className:`${Yb}__close-icon`,title:o(s==="collapse"?"general:collapse":"general:close"),children:[s==="x"&&ff(Xb,{}),s==="collapse"&&ff(Ze,{direction:"left"})]})]}),e[0]=s,e[1]=i,e[2]=o,e[3]=a):a=e[3],a};import{c as WB}from"react/compiler-runtime";import{jsx as Si,jsxs as HB}from"react/jsx-runtime";import{getTranslation as zB}from"@payloadcms/translations";import{useRouter as XB}from"next/navigation.js";import*as hf from"qs-esm";import{Fragment as UB}from"react";import{c as VB}from"react/compiler-runtime";import{jsx as L4,jsxs as Jb}from"react/jsx-runtime";import{getTranslation as GB}from"@payloadcms/translations";import"react";var ru="localizer-button",pf=t=>{let e=VB(12),{ariaLabel:o,className:n}=t,r=Pe(),{i18n:s,t:i}=k(),a;e[0]!==o||e[1]!==i?(a=o||i("general:locale"),e[0]=o,e[1]=i,e[2]=a):a=e[2];let l;e[3]!==n?(l=[ru,n].filter(Boolean),e[3]=n,e[4]=l):l=e[4];let c=l.join(" "),u=r?r.code:void 0,d=`${i("general:locale")}:`,f;return e[5]!==s||e[6]!==r.label||e[7]!==a||e[8]!==c||e[9]!==u||e[10]!==d?(f=Jb("div",{"aria-label":a,className:c,"data-locale":u,children:[Jb("div",{className:`${ru}__label`,children:[d,"\xA0"]}),Jb("div",{className:`${ru}__current`,children:[L4("span",{className:`${ru}__current-label`,children:`${GB(r.label,s)}`}),L4(Ze,{className:`${ru}__chevron`})]})]}),e[5]=s,e[6]=r.label,e[7]=a,e[8]=c,e[9]=u,e[10]=d,e[11]=f):f=e[11],f};var qb="localizer",$4=t=>{let e=WB(17),{className:o}=t,{config:n}=H(),{localization:r}=n,s=XB(),{startRouteTransition:i}=st(),{setLocaleIsLoading:a}=ud(),{i18n:l}=k(),c=Pe();if(r){let{locales:u}=r,d;e[0]!==o?(d=[qb,o].filter(Boolean),e[0]=o,e[1]=d):d=e[1];let f=d.join(" "),m;if(e[2]!==l||e[3]!==c||e[4]!==u||e[5]!==s||e[6]!==a||e[7]!==i||e[8]!==f){let h;e[10]!==l||e[11]!==c||e[12]!==u||e[13]!==s||e[14]!==a||e[15]!==i?(h=p=>{let{close:g}=p;return Si(Me.ButtonGroup,{children:u.map(b=>{let v=zB(b.label,l);return Si(Me.Button,{active:c.code===b.code,disabled:c.code===b.code,onClick:()=>{a(!0),g();let x=new URLSearchParams(window.location.search),y=hf.stringify({...hf.parse(x.toString(),{depth:10,ignoreQueryPrefix:!0}),locale:b.code},{addQueryPrefix:!0});i(()=>{s.push(y)})},children:v!==b.code?HB(UB,{children:[v,"\xA0",Si("span",{className:`${qb}__locale-code`,"data-locale":b.code,children:`(${b.code})`})]}):Si("span",{className:`${qb}__locale-code`,"data-locale":b.code,children:v})},b.code)})})},e[10]=l,e[11]=c,e[12]=u,e[13]=s,e[14]=a,e[15]=i,e[16]=h):h=e[16],m=Si("div",{className:f,children:Si(ho,{button:Si(pf,{}),horizontalAlign:"right",render:h,showScrollbar:!0,size:"large"})}),e[2]=l,e[3]=c,e[4]=u,e[5]=s,e[6]=a,e[7]=i,e[8]=f,e[9]=m}else m=e[9];return m}return null};import{jsx as YB}from"react/jsx-runtime";import{usePathname as ZB}from"next/navigation.js";import su,{useEffect as nu,useRef as JB}from"react";var k4=su.createContext({hydrated:!1,navOpen:!0,navRef:null,setNavOpen:()=>{},shouldAnimate:!1}),Ii=()=>su.use(k4),qB=async t=>{let o=(await t("nav"))?.open;return typeof o=="boolean"?o:!0},j4=({children:t,initialIsOpen:e})=>{let{breakpoints:{l:o,m:n,s:r}}=Co(),s=ZB(),{getPreference:i}=Fo(),a=JB(null),[l,c]=su.useState(e),[u,d]=su.useState(!1),[f,m]=su.useState(!1);return nu(()=>{o===!1&&(async()=>{let p=await qB(i);c(p)})()},[o,i,c]),nu(()=>{r===!0&&c(!1)},[s]),nu(()=>{a.current&&(l&&n?a.current.style.overscrollBehavior="contain":a.current.style.overscrollBehavior="auto")},[l,n]),nu(()=>{(o===!0||n===!0||r===!0)&&c(!1),m(!0),setTimeout(()=>{d(!0)},100)},[o,n,r]),nu(()=>()=>{a.current&&(a.current.style.overscrollBehavior="auto")},[]),YB(k4,{value:{hydrated:f,navOpen:l,navRef:a,setNavOpen:c,shouldAnimate:u},children:t})};import{c as QB}from"react/compiler-runtime";import{jsx as KB}from"react/jsx-runtime";import"react";var O4="nav-toggler",Qb=t=>{let e=QB(15),{id:o,children:n,className:r,tabIndex:s}=t,i=s===void 0?0:s,{t:a}=k(),{setPreference:l}=Fo(),{navOpen:c,setNavOpen:u}=Ii(),{breakpoints:d}=Co(),{l:f}=d,m=`${a(c?"general:close":"general:open")} ${a("general:menu")}`,h=c&&`${O4}--is-open`,p;e[0]!==r||e[1]!==h?(p=[O4,h,r].filter(Boolean),e[0]=r,e[1]=h,e[2]=p):p=e[2];let g=p.join(" "),b;e[3]!==f||e[4]!==c||e[5]!==u||e[6]!==l?(b=async()=>{u(!c),f||await l("nav",{open:!c},!0)},e[3]=f,e[4]=c,e[5]=u,e[6]=l,e[7]=b):b=e[7];let v;return e[8]!==n||e[9]!==o||e[10]!==m||e[11]!==g||e[12]!==b||e[13]!==i?(v=KB("button",{"aria-label":m,className:g,id:o,onClick:b,tabIndex:i,type:"button",children:n}),e[8]=n,e[9]=o,e[10]=m,e[11]=g,e[12]=b,e[13]=i,e[14]=v):v=e[14],v};import{c as c7}from"react/compiler-runtime";import{jsx as Ro,jsxs as V4}from"react/jsx-runtime";import{getTranslation as u7}from"@payloadcms/translations";import{Fragment as G4}from"react";import{jsx as M4,jsxs as e7}from"react/jsx-runtime";import"react";var gf=({fill:t})=>{let e=t||"var(--theme-elevation-1000)";return e7("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:[M4("path",{d:"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z",fill:e}),M4("path",{d:"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z",fill:e})]})};import{c as t7}from"react/compiler-runtime";import{jsx as o7}from"react/jsx-runtime";import{createContext as r7,use as n7,useState as s7}from"react";var jn=()=>n7(B4),B4=r7({}),Kb=t=>{let e=t7(4),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];let[r,s]=s7(n),i;return e[1]!==o||e[2]!==r?(i=o7(B4,{value:{setStepNav:s,stepNav:r},children:o}),e[1]=o,e[2]=r,e[3]=i):i=e[3],i};import{c as i7}from"react/compiler-runtime";import{useEffect as a7}from"react";var l7=t=>{let e=i7(4),{nav:o}=t,{setStepNav:n}=jn(),r,s;return e[0]!==o||e[1]!==n?(r=()=>{n(o)},s=[n,o],e[0]=o,e[1]=n,e[2]=r,e[3]=s):(r=e[2],s=e[3]),a7(r,s),null};var iu="step-nav",W4=t=>{let e=c7(7),{className:o,CustomIcon:n}=t,{i18n:r}=k(),{stepNav:s}=jn(),{config:i}=H(),{routes:a}=i,{admin:l}=a,{t:c}=k(),u;return e[0]!==n||e[1]!==l||e[2]!==o||e[3]!==r||e[4]!==s||e[5]!==c?(u=Ro(G4,{children:s.length>0?V4("nav",{className:[iu,o].filter(Boolean).join(" "),children:[Ro(no,{className:`${iu}__home`,href:l,prefetch:!1,tabIndex:0,children:Ro("span",{title:c("general:dashboard"),children:Ro(oe,{CustomComponent:n,Fallback:Ro(gf,{})})})}),Ro("span",{children:"/"}),s.map((d,f)=>{let m=u7(d.label,r);return s.length===f+1?Ro("span",{className:`${iu}__last`,children:m},f):V4(G4,{children:[d.url?Ro(no,{href:d.url,prefetch:!1,children:Ro("span",{children:m},f)}):Ro("span",{children:m},f),Ro("span",{children:"/"})]},f)})]}):Ro("div",{className:[iu,o].filter(Boolean).join(" "),children:Ro("div",{className:`${iu}__home`,children:Ro("span",{title:c("general:dashboard"),children:Ro(oe,{CustomComponent:n,Fallback:Ro(gf,{})})})})})}),e[0]=n,e[1]=l,e[2]=o,e[3]=r,e[4]=s,e[5]=c,e[6]=u):u=e[6],u};var _o="app-header";function h7({CustomAvatar:t,CustomIcon:e}){let{t:o}=k(),{Actions:n}=zb(),{config:{admin:{routes:{account:r}},localization:s,routes:{admin:i}}}=H(),{navOpen:a}=Ii(),l=f7(null),[c,u]=p7(!1);m7(()=>{let f=()=>{let m=l.current;if(m){let h=m.scrollWidth>m.clientWidth;u(h)}};return f(),window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[n]);let d=n?Object.values(n):[];return bf("header",{className:[_o,a&&`${_o}--nav-open`].filter(Boolean).join(" "),children:[zo("div",{className:`${_o}__bg`}),zo("div",{className:`${_o}__content`,children:bf("div",{className:`${_o}__wrapper`,children:[zo(Qb,{className:`${_o}__mobile-nav-toggler`,tabIndex:-1,children:zo(Zb,{})}),bf("div",{className:`${_o}__controls-wrapper`,children:[zo("div",{className:`${_o}__step-nav-wrapper`,children:zo(W4,{className:`${_o}__step-nav`,CustomIcon:e})}),bf("div",{className:`${_o}__actions-wrapper`,children:[zo("div",{className:`${_o}__actions`,ref:l,children:d.map((f,m)=>zo("div",{className:c&&m===d.length-1?`${_o}__last-action`:"",children:f},m))}),c&&zo("div",{className:`${_o}__gradient-placeholder`})]}),s&&zo(pf,{ariaLabel:"invisible",className:`${_o}__localizer-spacing`}),zo(no,{"aria-label":o("authentication:account"),className:`${_o}__account`,href:d7({adminRoute:i,path:r}),prefetch:!1,tabIndex:0,children:zo(oe,{CustomComponent:t,Fallback:zo(Hb,{})})})]})]})}),zo($4,{className:`${_o}__localizer`})]})}import{jsx as e1,jsxs as g7}from"react/jsx-runtime";import"react";var au="card",b7=t=>{let{id:e,actions:o,buttonAriaLabel:n,href:r,onClick:s,title:i,titleAs:a}=t,l=[au,e,(s||r)&&`${au}--has-onclick`].filter(Boolean).join(" ");return g7("div",{className:l,id:e,children:[e1(a??"div",{className:`${au}__title`,children:i}),o&&e1("div",{className:`${au}__actions`,children:o}),(s||r)&&e1(ne,{"aria-label":n,buttonStyle:"none",className:`${au}__click`,el:"link",onClick:s,to:r})]})};import{c as v7}from"react/compiler-runtime";import{jsx as ws,jsxs as vf}from"react/jsx-runtime";import{getTranslation as x7}from"@payloadcms/translations";import{useRouter as y7}from"next/navigation.js";import Oa from"react";var xf="copy-locale-data",yf="copy-locale",t1=()=>{let t=v7(38),{config:e}=H(),{localization:o,routes:n,serverURL:r}=e,{admin:s}=n,{code:i}=Pe(),{id:a,collectionSlug:l,globalSlug:c}=Ee(),{i18n:u,t:d}=k(),f=Ut(),{toggleModal:m}=ue(),{copyDataFromLocale:h}=Dt(),p=y7(),{startRouteTransition:g}=st(),b;t[0]!==o?(b=o&&o.locales.map(C7)||[],t[0]=o,t[1]=b):b=t[1];let v=b,x;t[2]!==i?(x=G=>G.value!==i,t[2]=i,t[3]=x):x=t[3];let y=v.filter(x),C;t[4]!==u||t[5]!==o?(C=G=>{let X=o&&o.locales.find(Z=>Z.code===G);return X&&X.label?x7(X.label,u):G},t[4]=u,t[5]=o,t[6]=C):C=t[6];let S=C,[w,D]=Oa.useState(!1),[_,A]=Oa.useState(null),[F,R]=Oa.useState(i),[I,E]=Oa.useState(!1),T,$;t[7]!==i||t[8]!==F?(T=()=>{F!==i&&R(i)},$=[i,F],t[7]=i,t[8]=F,t[9]=T,t[10]=$):(T=t[9],$=t[10]),Oa.useEffect(T,$);let j;t[11]!==s||t[12]!==l||t[13]!==h||t[14]!==c||t[15]!==a||t[16]!==I||t[17]!==p||t[18]!==r||t[19]!==g||t[20]!==m?(j=async G=>{let{from:X,to:Z}=G;D(!0);try{await h({collectionSlug:l,docID:a,fromLocale:X,globalSlug:c,overrideData:I,toLocale:Z}),D(!1),g(()=>p.push(`${r}${s}/${l?`collections/${l}/${a}`:`globals/${c}`}?locale=${Z}`)),m(yf)}catch(te){let U=te;me.error(U.message)}},t[11]=s,t[12]=l,t[13]=h,t[14]=c,t[15]=a,t[16]=I,t[17]=p,t[18]=r,t[19]=g,t[20]=m,t[21]=j):j=t[21];let N=j;if(!a&&!c)return null;let P;t[22]!==f||t[23]!==d||t[24]!==m?(P=()=>{f?me.info(d("general:unsavedChanges")):m(yf)},t[22]=f,t[23]=d,t[24]=m,t[25]=P):P=t[25];let L;t[26]!==m?(L=()=>{m(yf)},t[26]=m,t[27]=L):L=t[27];let V;t[28]!==N||t[29]!==w||t[30]!==F||t[31]!==d||t[32]!==_?(V=async()=>{if(F===_){me.error(d("localization:cannotCopySameLocale"));return}w||await N({from:F,to:_})},t[28]=N,t[29]=w,t[30]=F,t[31]=d,t[32]=_,t[33]=V):V=t[33];let M;t[34]===Symbol.for("react.memo_cache_sentinel")?(M=G=>{G?.value&&R(G.value)},t[34]=M):M=t[34];let O;t[35]===Symbol.for("react.memo_cache_sentinel")?(O=G=>{G?.value&&A(G.value)},t[35]=O):O=t[35];let B;return t[36]!==I?(B=()=>E(!I),t[36]=I,t[37]=B):B=t[37],vf(Oa.Fragment,{children:[ws(Me.Button,{id:`${xf}__button`,onClick:P,children:d("localization:copyToLocale")}),vf(Pt,{className:xf,gutter:!1,Header:ws(Da,{onClose:L,title:d("localization:copyToLocale")}),slug:yf,children:[vf("div",{className:`${xf}__sub-header`,children:[ws("span",{children:F&&_?ws("div",{children:d("localization:copyFromTo",{from:S(F),to:S(_)})}):d("localization:selectLocaleToCopy")}),ws(ne,{buttonStyle:"primary",disabled:!F||!_,iconPosition:"left",onClick:V,size:"medium",children:w?d("general:copying")+"...":d("general:copy")})]}),vf("div",{className:`${xf}__content`,children:[ws(Sa,{label:d("localization:copyFrom"),name:"fromLocale",onChange:M,options:v,path:"fromLocale",readOnly:!0,value:F}),ws(Sa,{label:d("localization:copyTo"),name:"toLocale",onChange:O,options:y,path:"toLocale",value:_}),ws(mr,{checked:I,field:{name:"overwriteExisting",label:d("general:overwriteExistingData")},onChange:B,path:"overwriteExisting"})]})]})]})};function C7(t){return{label:t.label,value:t.code}}import{jsx as Y4,jsxs as L7}from"react/jsx-runtime";import{getTranslation as Z4}from"@payloadcms/translations";import{useRouter as $7,useSearchParams as k7}from"next/navigation.js";import{mergeListSearchAndWhere as j7}from"payload/shared";import*as q4 from"qs-esm";import O7,{useCallback as J4}from"react";import{c as w7}from"react/compiler-runtime";import{jsx as S7}from"react/jsx-runtime";import{usePathname as I7,useRouter as R7}from"next/navigation.js";import{createContext as _7,use as D7,useEffect as F7}from"react";var H4=_7({clearRouteCache:()=>{}}),o1=t=>{let e=w7(10),{children:o}=t,n=I7(),r=R7(),s;e[0]!==r?(s=()=>{r.refresh()},e[0]=r,e[1]=s):s=e[1];let i=s,a;e[2]!==i?(a=()=>{i()},e[2]=i,e[3]=a):a=e[3];let l;e[4]!==i||e[5]!==n?(l=[n,i],e[4]=i,e[5]=n,e[6]=l):l=e[6],F7(a,l);let c;return e[7]!==o||e[8]!==i?(c=S7(H4,{value:{clearRouteCache:i},children:o}),e[7]=o,e[8]=i,e[9]=c):c=e[9],c},On=()=>D7(H4);import{jsx as A7}from"react/jsx-runtime";import{useSearchParams as T7}from"next/navigation.js";import*as X4 from"qs-esm";import{createContext as E7,use as P7,useCallback as r1,useEffect as z4,useRef as N7,useState as n1}from"react";var xo=function(t){return t.AllAvailable="allAvailable",t.AllInPage="allInPage",t.None="none",t.Some="some",t}({}),U4=E7({}),s1=({children:t,docs:e=[],totalDocs:o,user:n})=>{let r=N7({}),{code:s}=Pe(),[i,a]=n1(()=>{let g=new Map;return e.forEach(({id:b})=>{g.set(b,!1)}),g}),[l,c]=n1("none"),[u,d]=n1(0),f=T7(),m=r1((g=!1)=>{let b=new Map;g?(c("allAvailable"),e.forEach(({id:v,_isLocked:x,_userEditing:y})=>{(!x||y?.id===n?.id)&&b.set(v,!0)})):l==="allAvailable"||l==="allInPage"?c("none"):e.forEach(({id:v,_isLocked:x,_userEditing:y})=>{(!x||y?.id===n?.id)&&b.set(v,l!=="some")}),a(b)},[e,l,n?.id]),h=r1(g=>{let b=e.find(C=>C.id===g);if(b?._isLocked&&n?.id!==b?._userEditing.id)return;let v=i.get(g),x=typeof v=="boolean"?!v:!0,y=new Map(i.set(g,x));l==="allAvailable"&&!x&&c("some"),a(y)},[i,e,l,n?.id]),p=r1(g=>{let b;if(l==="allAvailable")b=kr(f)?.where||{id:{not_equals:""}};else{let v=[];for(let[x,y]of i)y&&v.push(x);b={id:{in:v}}}return g&&(b={and:[{...g},b]}),X4.stringify({locale:s,where:b},{addQueryPrefix:!0})},[l,i,s,f]);return z4(()=>{if(l==="allAvailable")return;let g=!1,b=!0;if(!i.size)b=!1,g=!1;else for(let[v,x]of i)b=b&&x,g=g||x;b&&i.size===e.length?c("allInPage"):c(g?"some":"none")},[l,i,o,e]),z4(()=>{let g=0;if(l==="allAvailable")g=o;else for(let[b,v]of i)v&&g++;d(g)},[l,i,o]),r.current={count:u,getQueryParams:p,selectAll:l,selected:i,setSelection:h,toggleAll:m,totalDocs:o},A7(U4,{value:r.current,children:t})},oo=()=>P7(U4);var M7="delete-documents",i1=t=>{let{collection:e,collection:{slug:o,labels:{plural:n,singular:r}}={}}=t,{permissions:s}=De(),{config:{routes:{api:i},serverURL:a}}=H(),{openModal:l}=ue(),{count:c,getQueryParams:u,selectAll:d,toggleAll:f}=oo(),{i18n:m,t:h}=k(),p=$7(),g=k7(),{clearRouteCache:b}=On(),x=s?.collections?.[o]?.delete,y=`delete-${o}`,C=J4(()=>{me.error(h("error:unknown"))},[h]),S=J4(async()=>{let w=j7({collectionConfig:e,search:g.get("search")}),D=u(w);await Qe.delete(`${a}${i}/${o}${D}`,{headers:{"Accept-Language":m.language,"Content-Type":"application/json"}}).then(async _=>{try{let A=await _.json(),F=A?.docs.length||0,R=F>1?n:r;if(_.status<400||F>0)return me.success(h("general:deletedCountSuccessfully",{count:F,label:Z4(R,m)})),A?.errors.length>0&&me.error(A.message,{description:A.errors.map(I=>I.message).join(`
|
|
55
|
-
`)}),f(),p.replace(q4.stringify({page:d?"1":void 0},{addQueryPrefix:!0})),b(),null;if(A.errors)
|
|
56
|
-
`)});else return C();return!1}catch{return C()}})},[g,C,i,u,m,n,p,d,a,r,o,h,f,b,e]);return d===xo.None||!x?null:L7(O7.Fragment,{children:[Y4("button",{className:`${M7}__toggle`,onClick:()=>{l(y)},type:"button",children:h("general:delete")}),Y4(It,{body:h("general:aboutToDeleteCount",{count:c,label:Z4(c>1?n:r,m)}),confirmingLabel:h("general:deleting"),heading:h("general:confirmDeletion"),modalSlug:y,onConfirm:S})]})};import{c as I8}from"react/compiler-runtime";import{jsx as at,jsxs as Lo}from"react/jsx-runtime";import{getTranslation as R8}from"@payloadcms/translations";import{formatAdminURL as _8}from"payload/shared";import p1,{Fragment as cu,useEffect as D8}from"react";import{jsx as K4,jsxs as V7}from"react/jsx-runtime";import{dequal as G7}from"dequal/lite";import{reduceFieldsToValues as eR,versionDefaults as W7}from"payload/shared";import H7,{useDeferredValue as z7,useEffect as tR,useRef as Ri,useState as X7}from"react";import{unflatten as B7}from"payload/shared";var Q4=(t,e,o)=>{let n={data:{},valid:!0};return t&&(Object.keys(t).forEach(r=>{(o===!0||!t[r]?.disableFormData)&&(n.data[r]=t[r]?.value,t[r].valid||(n.valid=!1))}),e&&(n.data=B7(n.data))),n};var U7="autosave",oR=1e3,rR=({id:t,collection:e,global:o})=>{let{config:{routes:{api:n},serverURL:r}}=H(),{docConfig:s,incrementVersionCount:i,lastUpdateTime:a,mostRecentVersionIsAutosaved:l,setLastUpdateTime:c,setMostRecentVersionIsAutosaved:u,setUnpublishedVersionCount:d,updateSavedDocumentData:f}=Ee(),{reportUpdate:m}=fi(),{dispatchFields:h,isValid:p,setBackgroundProcessing:g,setIsValid:b,setSubmitted:v}=Oe(),[x]=ki(),y=Ut(),C=Xt(),{code:S}=Pe(),{i18n:w,t:D}=k(),_=s?.versions,A=W7.autosaveInterval;_.drafts&&_.drafts.autosave&&(A=_.drafts.autosave.interval);let F=!!(s?.versions?.drafts&&s?.versions?.drafts.validate),[R,I]=X7(!1),E=z7(R),T=Jo(x,A),$=Ri(x),j=Ri(y),N=Ri(S),P=Ri(p);$.current=x,j.current=y,N.current=S;let{queueTask:L}=Nm(),V=Ri(null),M=eo(()=>{V.current=void 0;let X,Z,te=()=>{Z-X<oR?V.current=setTimeout(()=>{I(!1)},oR-(Z-X)):G()};L(async()=>{if(y){X=new Date().getTime(),I(!0);let U,z,le;if(e&&t&&(le=e.slug,U=`${r}${n}/${le}/${t}?draft=true&autosave=true&locale=${N.current}`,z="PATCH"),o&&(le=o.slug,U=`${r}${n}/globals/${le}?draft=true&autosave=true&locale=${N.current}`,z="POST"),U&&j.current){let{data:J,valid:ce}=Q4($.current,!0);if(J._status="draft",!(C&&!ce&&_?.drafts&&_?.drafts?.validate)&&P.current){let q;try{q=await fetch(U,{body:JSON.stringify(J),credentials:"include",headers:{"Accept-Language":w.language,"Content-Type":"application/json"},method:z})}catch{}let pe=new Date;Z=pe.getTime(),q.status===200&&(c(pe.getTime()),m({id:t,entitySlug:le,updatedAt:pe.toISOString()}),l||(i(),u(!0),d(Re=>Re+1)));let he=await q.json();if(_?.drafts&&_?.drafts?.validate&&he?.errors){if(Array.isArray(he.errors)){let[Re,ge]=he.errors.reduce(([Ve,Q],Le)=>{let _e=[],ae=[];return Le?.message&&ae.push(Le),Array.isArray(Le?.data)&&Le.data.forEach(se=>{se?.field?_e.push(se):ae.push(se)}),[[...Ve,..._e],[...Q,...ae]]},[[],[]]);h({type:"ADD_SERVER_ERRORS",errors:Re}),ge.forEach(Ve=>{me.error(Ve.message||w.t("error:unknown"))}),P.current=!1,b(!1),v(!0),te();return}}else{let Re=he?.doc||he?.result;Re&&(b(!0),P.current=!0,f(Re))}te()}}}},{afterProcess:()=>{g(!1)},beforeProcess:()=>{if(!P.current)return P.current=!0,!1;g(!0)}})}),O=Ri(!1),B=Ri(eR(T));tR(()=>{if(!O.current){O.current=!0;return}let X=eR(T);G7(X,B)||(B.current=X,M())},[T]),tR(()=>()=>{G()},[]);let G=eo(()=>{V.current&&clearTimeout(V.current),I(!1)});return V7("div",{className:U7,children:[F&&!p&&K4(Kc,{}),E&&D("general:saving"),!E&&!!a&&K4(H7.Fragment,{children:D("version:lastSavedAgo",{distance:Hx({date:a,i18n:w})})})]})};import{jsx as Cf,jsxs as Y7}from"react/jsx-runtime";import{getTranslation as nR}from"@payloadcms/translations";import{useRouter as Z7}from"next/navigation.js";import{formatAdminURL as J7}from"payload/shared";import q7,{useCallback as sR}from"react";var iR=t=>{let{id:e,buttonId:o,collectionSlug:n,onDelete:r,redirectAfterDelete:s=!0,singularLabel:i,title:a}=t,{config:{routes:{admin:l,api:c},serverURL:u},getEntityConfig:d}=H(),f=d({collectionSlug:n}),{setModified:m}=Oe(),h=Z7(),{i18n:p,t:g}=k(),{title:b}=Ee(),{startRouteTransition:v}=st(),{openModal:x}=ue(),y=`delete-${e}`,C=sR(()=>{me.error(g("error:deletingTitle",{title:b}))},[g,b]),S=sR(async()=>{m(!1);try{await Qe.delete(`${u}${c}/${n}/${e}`,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(async w=>{try{let D=await w.json();if(w.status<400){if(me.success(g("general:titleDeleted",{label:nR(i,p),title:b})||D.message),s)return v(()=>h.push(J7({adminRoute:l,path:`/collections/${n}`})));typeof r=="function"&&await r({id:e,collectionConfig:f});return}return D.errors?D.errors.forEach(_=>me.error(_.message)):C(),!1}catch{return C()}})}catch{return C()}},[m,u,c,n,e,g,i,C,p,b,h,l,s,r,f,v]);return e?Y7(q7.Fragment,{children:[Cf(Me.Button,{id:o,onClick:()=>{x(y)},children:g("general:delete")}),Cf(It,{body:Cf(wi,{elements:{1:({children:w})=>Cf("strong",{children:w})},i18nKey:"general:aboutToDelete",t:g,variables:{label:nR(i,p),title:a||b||e}}),confirmingLabel:g("general:deleting"),heading:g("general:confirmDeletion"),modalSlug:y,onConfirm:S})]}):null};import{jsx as aR,jsxs as Q7}from"react/jsx-runtime";import{getTranslation as lR}from"@payloadcms/translations";import{useRouter as K7}from"next/navigation.js";import{formatAdminURL as e8}from"payload/shared";import cR,{useCallback as uR}from"react";var dR=({id:t,slug:e,onDuplicate:o,redirectAfterDuplicate:n=!0,singularLabel:r})=>{let s=K7(),i=Ut(),{openModal:a}=ue(),l=Pe(),{setModified:c}=Oe(),{startRouteTransition:u}=st(),{config:{routes:{admin:d,api:f},serverURL:m},getEntityConfig:h}=H(),p=h({collectionSlug:e}),[g,b]=cR.useState(!1),{i18n:v,t:x}=k(),y=`duplicate-${t}`,C=uR(async()=>{b(!0),await Qe.post(`${m}${f}/${e}/${t}/duplicate${l?.code?`?locale=${l.code}`:""}`,{body:JSON.stringify({}),headers:{"Accept-Language":v.language,"Content-Type":"application/json",credentials:"include"}}).then(async w=>{let{doc:D,errors:_,message:A}=await w.json();if(w.status<400){if(me.success(A||x("general:successfullyDuplicated",{label:lR(r,v)})),c(!1),n)return u(()=>s.push(e8({adminRoute:d,path:`/collections/${e}/${D.id}${l?.code?`?locale=${l.code}`:""}`})));typeof o=="function"&&o({collectionConfig:p,doc:D})}else me.error(_?.[0].message||A||x("error:unspecific",{label:lR(r,v)}))})},[l,m,f,e,t,v,x,r,o,n,c,s,d,p,u]),S=uR(async()=>{b(!1),await C()},[C]);return Q7(cR.Fragment,{children:[aR(Me.Button,{id:"action-duplicate",onClick:()=>i?(b(!0),a(y)):C(),children:x("general:duplicate")}),g&&aR(It,{body:x("general:unsavedChangesDuplicate"),confirmLabel:x("general:duplicateWithoutSaving"),heading:x("general:unsavedChanges"),modalSlug:y,onConfirm:S})]})};import{c as o8}from"react/compiler-runtime";import{jsx as pR,jsxs as r8}from"react/jsx-runtime";import{useState as n8}from"react";import{jsx as mR,jsxs as t8}from"react/jsx-runtime";import"react";var fR=({className:t})=>t8("svg",{className:["icon icon--lock",t].filter(Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[mR("path",{className:"stroke",d:"M7.5 9.5V7.5C7.5 6.83696 7.76339 6.20107 8.23223 5.73223C8.70107 5.26339 9.33696 5 10 5C10.663 5 11.2989 5.26339 11.7678 5.73223C12.2366 6.20107 12.5 6.83696 12.5 7.5V9.5",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:"1"}),mR("path",{className:"stroke",d:"M13.5 9.5H6.5C5.94772 9.5 5.5 9.94772 5.5 10.5V14C5.5 14.5523 5.94772 15 6.5 15H13.5C14.0523 15 14.5 14.5523 14.5 14V10.5C14.5 9.94772 14.0523 9.5 13.5 9.5Z",stopOpacity:"1",strokeLinecap:"round",strokeLinejoin:"round"})]});var hR="locked",lu=t=>{let e=o8(8),{className:o,user:n}=t,[r,s]=n8(!1),{t:i}=k(),a=uf(n)?n.email??n.id:i("general:anotherUser"),l;e[0]!==o?(l=[hR,o].filter(Boolean),e[0]=o,e[1]=l):l=e[1];let c=l.join(" "),u,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>s(!0),d=()=>s(!1),e[2]=u,e[3]=d):(u=e[2],d=e[3]);let f=`${a} ${i("general:isEditing")}`,m;return e[4]!==r||e[5]!==c||e[6]!==f?(m=r8("div",{className:c,onMouseEnter:u,onMouseLeave:d,role:"button",tabIndex:0,children:[pR(go,{alignCaret:"left",className:`${hR}__tooltip`,position:"top",show:r,children:f}),pR(fR,{})]}),e[4]=r,e[5]=c,e[6]=f,e[7]=m):m=e[7],m};import{c as a8}from"react/compiler-runtime";import{jsx as l8}from"react/jsx-runtime";import"react";import*as bR from"qs-esm";import{useCallback as s8,useRef as i8,useState as gR}from"react";var vR=()=>{let{id:t,collectionSlug:e,globalSlug:o,versionCount:n}=Ee(),[r,s]=gR(!1),[i,a]=gR(""),{code:l}=Pe(),c=n>0,{config:{routes:{api:u},serverURL:d}}=H(),{t:f}=k(),m=i8(!1);return{generatePreviewURL:s8(async({openPreviewWindow:p=!1})=>{if(!m.current){m.current=!0;try{s(!0);let g=`${d}${u}`;e&&(g=`${g}/${e}/${t}/preview`),o&&(g=`${g}/globals/${o}/preview`);let v=await fetch(`${g}?${bR.stringify({draft:c?"true":"false",locale:l||void 0})}`);if(!v.ok)throw new Error;let x=await v.json();if(!x)throw new Error;a(x),s(!1),m.current=!1,p&&window.open(x,"_blank")}catch{s(!1),m.current=!1,me.error(f("error:previewing"))}}},[d,u,e,o,c,l,t,f]),isLoading:r,label:f(r?"general:loading":"version:preview"),previewURL:i}};var c8="preview-btn";function a1(t){let e=a8(5),{generatePreviewURL:o,label:n}=vR(),r;e[0]!==o?(r=()=>o({openPreviewWindow:!0}),e[0]=o,e[1]=r):r=e[1];let s;return e[2]!==n||e[3]!==r?(s=l8(ne,{buttonStyle:"secondary",className:c8,icon:"link",iconPosition:"left",onClick:r,size:"medium",children:n}),e[2]=n,e[3]=r,e[4]=s):s=e[4],s}import{jsx as Ba,jsxs as RR}from"react/jsx-runtime";import*as _R from"qs-esm";import c1,{useCallback as u1}from"react";import{jsx as xR}from"react/jsx-runtime";import"react";var u8="form-submit",Ur=t=>{let{type:e="submit",buttonId:o,children:n,disabled:r,onClick:s,programmaticSubmit:i,ref:a}=t,l=lr(),c=rp(),u=Ts(),{disabled:d,submit:f}=Oe();return xR("div",{className:u8,children:xR(ne,{ref:a,...t,disabled:!(r||u||l||c||d)?void 0:!0,id:o,onClick:s??(i?()=>{f()}:void 0),type:e,children:n})})};import{jsx as Gt,jsxs as _i}from"react/jsx-runtime";import{getTranslation as p8}from"@payloadcms/translations";import*as SR from"qs-esm";import No,{useCallback as h8,useMemo as g8}from"react";import{jsx as Ss,jsxs as d8}from"react/jsx-runtime";import"react";var yR="table",l1=({appearance:t,columns:e,data:o})=>{let n=e?.filter(r=>r?.active);return!n||n.length===0?Ss("div",{children:"No columns selected"}):Ss("div",{className:[yR,t&&`${yR}--appearance-${t}`].filter(Boolean).join(" "),children:d8("table",{cellPadding:"0",cellSpacing:"0",children:[Ss("thead",{children:Ss("tr",{children:n.map((r,s)=>Ss("th",{id:`heading-${r.accessor}`,children:r.Heading},s))})}),Ss("tbody",{children:o&&o.map((r,s)=>Ss("tr",{className:`row-${s+1}`,children:n.map((i,a)=>{let{accessor:l}=i;return Ss("td",{className:`cell-${l}`,children:i.renderedCells[s]},a)})},typeof r.id=="string"||typeof r.id=="number"?String(r.id):s))})]})})};import{jsx as an,jsxs as m8}from"react/jsx-runtime";import{getTranslation as f8}from"@payloadcms/translations";import"react";var CR=({dateFormat:t,deleteHandler:e,docs:o,i18n:n,localization:r,supportedTimezones:s,t:i})=>{let a=[{accessor:"input.type",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("version:type")}),renderedCells:o.map(l=>{let c=l.input?.type;return m8(vt,{pillStyle:c==="publish"?"success":"warning",children:[c==="publish"&&i("version:publish"),c==="unpublish"&&i("version:unpublish")]},l.id)})},{accessor:"waitUntil",active:!0,field:{name:"",type:"date"},Heading:an("span",{children:i("general:time")}),renderedCells:o.map(l=>an("span",{children:xn({date:l.waitUntil,i18n:n,pattern:t,timezone:l.input.timezone})},l.id))},{accessor:"input.timezone",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("general:timezone")}),renderedCells:o.map(l=>{let u=s.find(d=>d.value===l.input.timezone)?.label||l.input.timezone;return an("span",{children:u||i("general:noValue")},l.id)})}];return r&&a.push({accessor:"input.locale",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("general:locale")}),renderedCells:o.map(l=>{if(l.input.locale){let c=r.locales.find(u=>u.code===l.input.locale);if(c)return an("span",{children:f8(c.label,n)},l.id)}return an("span",{children:i("general:all")},l.id)})}),a.push({accessor:"delete",active:!0,field:{name:"delete",type:"text"},Heading:an("span",{children:i("general:delete")}),renderedCells:o.map(l=>an(ne,{buttonStyle:"icon-label",className:"schedule-publish__delete",icon:"x",onClick:c=>{c.preventDefault(),e(l.id)},tooltip:i("general:delete")},l.id))}),a};var Ma="schedule-publish",wR={label:"All",value:"all"},IR=({slug:t,defaultType:e,schedulePublishConfig:o})=>{let{toggleModal:n}=ue(),{config:{admin:{dateFormat:r,timezones:{defaultTimezone:s,supportedTimezones:i}},localization:a,routes:{api:l},serverURL:c}}=H(),{id:u,collectionSlug:d,globalSlug:f,title:m}=Ee(),{i18n:h,t:p}=k(),{schedulePublish:g}=Dt(),[b,v]=No.useState(e||"publish"),[x,y]=No.useState(),[C,S]=No.useState(s),[w,D]=No.useState(wR),[_,A]=No.useState(!1),F=p("general:schedulePublishFor",{title:m}),[R,I]=No.useState(),[E,T]=No.useState(),$=No.useRef(()=>null),j=Intl.DateTimeFormat().resolvedOptions().timeZone,N=No.useMemo(()=>{if(a){let B=a.locales.map(({code:G,label:X})=>({label:p8(X,h),value:G}));return B.unshift(wR),B}return[]},[a,h]),P=No.useCallback(async()=>{let B={sort:"waitUntil",where:{and:[{taskSlug:{equals:"schedulePublish"}},{waitUntil:{greater_than:new Date}}]}};d&&(B.where.and.push({"input.doc.value":{equals:String(u)}}),B.where.and.push({"input.doc.relationTo":{equals:d}})),f&&B.where.and.push({"input.global":{equals:f}});let{docs:G}=await Qe.post(`${c}${l}/payload-jobs`,{body:SR.stringify(B),headers:{"Accept-Language":h.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"}}).then(X=>X.json());T(CR({dateFormat:r,deleteHandler:$.current,docs:G,i18n:h,localization:a,supportedTimezones:i,t:p})),I(G)},[d,f,c,l,h,r,a,i,p,u]),L=No.useCallback(async B=>{try{await g({deleteID:B}),await P(),me.success(p("general:deletedSuccessfully"))}catch(G){console.error(G),me.error(G.message)}},[P,g,p]);No.useEffect(()=>{$.current=L},[L]);let V=No.useCallback(async()=>{if(!x)return me.error(p("general:noDateSelected"));A(!0);let B;typeof w=="object"&&w.value!=="all"&&b==="publish"&&(B=w.value);try{await g({type:b,date:x,doc:d?{relationTo:d,value:String(u)}:void 0,global:f||void 0,locale:B,timezone:C}),y(void 0),me.success(p("version:scheduledSuccessfully")),P()}catch(G){console.error(G),me.error(G.message)}A(!1)},[x,w,b,p,g,d,u,f,C,P]),M=g8(()=>{if(C&&j&&x){let B=Mt.tz(C),G=Mt.tz(j),X=new Mt(x).withTimeZone(C),Z=Fr(X,B);return Fr(Z,G).toISOString()}return x},[C,x,j]),O=h8(B=>{if(C&&B){let G=Mt.tz(C),X=new Mt(B),Z=Fr(X,G);y(Z||null)}else y(B||null)},[y,C]);return No.useEffect(()=>{R||(async()=>await P())()},[R,P]),_i(Pt,{className:Ma,gutter:!1,Header:_i("div",{className:`${Ma}__drawer-header`,children:[Gt("h2",{title:F,children:F}),Gt(jm,{onClick:()=>n(t)})]}),slug:t,children:[_i(Bo,{className:`${Ma}__scheduler`,children:[Gt(ve,{label:p("version:type"),required:!0}),_i("ul",{className:`${Ma}__type`,children:[Gt("li",{children:Gt(bc,{id:`${t}-type`,isSelected:b==="publish",onChange:()=>v("publish"),option:{label:p("version:publish"),value:"publish"},path:`${t}-type`,readOnly:_})}),Gt("li",{children:Gt(bc,{id:`${t}-type`,isSelected:b==="unpublish",onChange:()=>v("unpublish"),option:{label:p("version:unpublish"),value:"unpublish"},path:`${t}-type`,readOnly:_})})]}),Gt("br",{}),Gt(ve,{label:p("general:time"),path:"time",required:!0}),Gt(Qi,{id:"time",minDate:new Date,onChange:B=>O(B),pickerAppearance:"dayAndTime",readOnly:_,timeFormat:o?.timeFormat,timeIntervals:o?.timeIntervals??5,value:M}),i.length>0&&Gt(Kl,{id:"timezone-picker",onChange:S,options:i,selectedTimezone:C}),Gt("br",{}),N.length>0&&b==="publish"&&_i(No.Fragment,{children:[Gt(ve,{label:p("localization:localeToPublish")}),Gt(mt,{onChange:B=>D(B),options:N,value:w}),Gt("br",{})]}),_i("div",{className:`${Ma}__actions`,children:[Gt(ne,{buttonStyle:"primary",disabled:_,id:"scheduled-publish-save",onClick:V,type:"button",children:p("general:save")}),_?Gt("span",{children:p("general:saving")}):null]})]}),_i(Bo,{className:`${Ma}__upcoming`,children:[Gt("h4",{children:p("general:upcomingEvents")}),!R&&Gt(St,{}),R?.length===0&&Gt(Ir,{type:"info",children:p("general:noUpcomingEventsScheduled")}),R?.length>0&&Gt(l1,{appearance:"condensed",columns:E,data:R})]})]})};function d1({label:t}){let{id:e,collectionSlug:o,docConfig:n,globalSlug:r,hasPublishedDoc:s,hasPublishPermission:i,setHasPublishedDoc:a,setMostRecentVersionIsAutosaved:l,setUnpublishedVersionCount:c,unpublishedVersionCount:u,uploadStatus:d}=Ee(),{config:f,getEntityConfig:m}=H(),{submit:h}=Oe(),p=Ut(),g=ct(),{code:b}=Pe(),{isModalOpen:v,toggleModal:x}=ue(),y=`schedule-publish-${e}`,{localization:C,routes:{api:S},serverURL:w}=f,{t:D}=k(),_=t||D("version:publishChanges"),A=c1.useMemo(()=>{if(o)return m({collectionSlug:o});if(r)return m({globalSlug:r})},[o,r,m]),F=u>0,R=typeof A?.versions?.drafts=="object"&&A?.versions?.drafts.schedulePublish,I=i&&(p||F||!s)&&d!=="uploading",E=!!R,T=!!(typeof A?.versions?.drafts=="object"&&A?.versions?.drafts.autosave),$=!!(E&&i&&(r||o&&e)&&(T||!p)),N=Qo()==="update"&&!p,P=u1(async()=>{if(N)return;let U=`?locale=${b}&depth=0&fallback-locale=null&draft=true`,z,le="POST";o&&(z=`${w}${S}/${o}${e?`/${e}`:""}${U}`,e&&(le="PATCH")),r&&(z=`${w}${S}/globals/${r}${U}`),await h({action:z,method:le,overrides:{_status:"draft"},skipValidation:!0})},[h,o,r,w,S,b,e,N]);yi({cmdCtrlKey:!0,editDepth:g,keyCodes:["s"]},U=>{U.preventDefault(),U.stopPropagation(),P&&n.versions?.drafts&&n.versions?.drafts?.autosave&&P()});let L=u1(()=>{d!=="uploading"&&(h({overrides:{_status:"published"}}),c(0),l(!1),a(!0))},[a,h,c,d,l]),V=u1(U=>{if(d==="uploading")return;let z=_R.stringify({publishSpecificLocale:U}),le=`${w}${S}${r?`/globals/${r}`:`/${o}/${e?`${"/"+e}`:""}`}${z?"?"+z:""}`;h({action:le,overrides:{_status:"published"}}),a(!0)},[S,o,r,e,w,a,h,d]),M=!C||C&&C.defaultLocalePublishOption!=="active",O=C&&C?.locales.find(U=>typeof U=="string"?U===b:U.code===b),B=O&&(typeof O.label=="string"?O.label:O.label?.[b]??void 0),G=M?L:()=>V(O.code),X=M?_:D("version:publishIn",{locale:B}),Z=M?()=>V(O.code):L,te=M?D("version:publishIn",{locale:B}):D("version:publishAllLocales");return i?RR(c1.Fragment,{children:[Ba(Ur,{buttonId:"action-save",disabled:!I,enableSubMenu:$,onClick:G,size:"medium",SubMenuPopupContent:C||$?({close:U})=>RR(c1.Fragment,{children:[$&&Ba(Me.ButtonGroup,{children:Ba(Me.Button,{id:"schedule-publish",onClick:()=>[x(y),U()],children:D("version:schedulePublish")})},"schedule-publish"),C&&I&&Ba(Me.ButtonGroup,{children:Ba(Me.Button,{id:"publish-locale",onClick:Z,children:te})})]}):void 0,type:"button",children:C?X:_}),$&&v(y)&&Ba(IR,{defaultType:F?"publish":"unpublish",schedulePublishConfig:typeof R=="object"&&R,slug:y})]}):null}import{jsx as b8}from"react/jsx-runtime";import{useRef as v8}from"react";function m1({label:t}){let{uploadStatus:e}=Ee(),{t:o}=k(),{submit:n}=Oe(),r=Ut(),s=t||o("general:save"),i=v8(null),a=ct(),c=Qo()==="update"&&!r||e==="uploading";return yi({cmdCtrlKey:!0,editDepth:a,keyCodes:["s"]},d=>{d.preventDefault(),d.stopPropagation(),i?.current&&i.current.click()}),b8(Ur,{buttonId:"action-save",disabled:c,onClick:()=>{if(e!=="uploading")return void n()},ref:i,size:"medium",type:"button",children:s})}import{jsx as x8}from"react/jsx-runtime";import{useCallback as y8,useRef as C8}from"react";var w8="save-draft";function f1(t){let{config:{routes:{api:e},serverURL:o}}=H(),{id:n,collectionSlug:r,globalSlug:s,setUnpublishedVersionCount:i,uploadStatus:a}=Ee(),l=Ut(),{code:c}=Pe(),u=C8(null),d=ct(),{t:f}=k(),{submit:m}=Oe(),p=Qo()==="update"&&!l||a==="uploading",g=y8(async()=>{if(p)return;let b=`?locale=${c}&depth=0&fallback-locale=null&draft=true`,v,x="POST";r&&(v=`${o}${e}/${r}${n?`/${n}`:""}${b}`,n&&(x="PATCH")),s&&(v=`${o}${e}/globals/${s}${b}`),await m({action:v,method:x,overrides:{_status:"draft"},skipValidation:!0}),i(y=>y+1)},[m,r,s,o,e,c,n,p,i]);return yi({cmdCtrlKey:!0,editDepth:d,keyCodes:["s"]},b=>{b.preventDefault(),b.stopPropagation(),u?.current&&u.current.click()}),x8(Ur,{buttonId:"action-save-draft",buttonStyle:"secondary",className:w8,disabled:p,onClick:()=>void g(),ref:u,size:"medium",type:"button",children:f("version:saveDraft")})}import{jsx as Va,jsxs as wf}from"react/jsx-runtime";import DR,{useCallback as S8}from"react";var Ga="status",FR=()=>{let{id:t,collectionSlug:e,docPermissions:o,globalSlug:n,hasPublishedDoc:r,incrementVersionCount:s,setHasPublishedDoc:i,setMostRecentVersionIsAutosaved:a,setUnpublishedVersionCount:l,unpublishedVersionCount:c}=Ee(),{toggleModal:u}=ue(),{config:{routes:{api:d},serverURL:f}}=H(),{reset:m}=Oe(),{code:h}=Pe(),{i18n:p,t:g}=k(),b=`confirm-un-publish-${t}`,v=`confirm-revert-${t}`,x;c>0&&r?x="changed":r?r&&c<=0&&(x="published"):x="draft";let y=S8(async S=>{let w,D,_;S==="unpublish"&&(_={_status:"draft"}),e&&(w=`${f}${d}/${e}/${t}?locale=${h}&fallback-locale=null&depth=0`,D="patch"),n&&(w=`${f}${d}/globals/${n}?locale=${h}&fallback-locale=null&depth=0`,D="post"),S==="revert"&&(_=await Qe.get(w,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(R=>R.json()));let A=await Qe[D](w,{body:JSON.stringify(_),headers:{"Accept-Language":p.language,"Content-Type":"application/json"}});if(A.status===200){let F,R=await A.json();n?F=R.result:e&&(F=R.doc),m(F),me.success(R.message),s(),a(!1),S==="unpublish"?i(!1):S==="revert"&&l(0)}else me.error(g("error:unPublishingDocument"))},[d,e,n,t,p.language,s,h,m,f,l,a,g,i]),C=o?.update;return x?Va("div",{className:Ga,title:`${g("version:status")}: ${g(`version:${x}`)}`,children:wf("div",{className:`${Ga}__value-wrap`,children:[wf("span",{className:`${Ga}__label`,children:[g("version:status"),":\xA0"]}),Va("span",{className:`${Ga}__value`,children:g(`version:${x}`)}),C&&x==="published"&&wf(DR.Fragment,{children:["\xA0\u2014\xA0",Va(ne,{buttonStyle:"none",className:`${Ga}__action`,onClick:()=>u(b),children:g("version:unpublish")}),Va(It,{body:g("version:aboutToUnpublish"),confirmingLabel:g("version:unpublishing"),heading:g("version:confirmUnpublish"),modalSlug:b,onConfirm:()=>y("unpublish")})]}),C&&x==="changed"&&wf(DR.Fragment,{children:["\xA0\u2014\xA0",Va(ne,{buttonStyle:"none",className:`${Ga}__action`,id:"action-revert-to-published",onClick:()=>u(v),children:g("version:revertToPublished")}),Va(It,{body:g("version:aboutToRevertToPublished"),confirmingLabel:g("version:reverting"),heading:g("version:confirmRevertToSaved"),modalSlug:v,onConfirm:()=>y("revert")})]})]})}):null};var At="doc-controls",h1=t=>{let e=I8(15),{id:o,slug:n,BeforeDocumentControls:r,customComponents:s,data:i,disableActions:a,disableCreate:l,hasSavePermission:c,isAccountView:u,isEditing:d,onDelete:f,onDrawerCreateNew:m,onDuplicate:h,onTakeOver:p,permissions:g,readOnlyForIncomingUser:b,redirectAfterDelete:v,redirectAfterDuplicate:x,user:y}=t,C;e[0]!==s?(C=s===void 0?{}:s,e[0]=s,e[1]=C):C=e[1];let{PreviewButton:S,PublishButton:w,SaveButton:D,SaveDraftButton:_}=C,{i18n:A,t:F}=k(),R=ct(),{config:I,getEntityConfig:E}=H(),T=E({collectionSlug:n}),$=E({globalSlug:n}),{admin:j,localization:N,routes:P}=I,{dateFormat:L}=j,{admin:V}=P,[M,O]=p1.useState(""),[B,G]=p1.useState(""),X=lr(),Z=Ts(),te,U;e[2]!==i||e[3]!==L||e[4]!==A?(te=()=>{i?.updatedAt&&O(xn({date:i.updatedAt,i18n:A,pattern:L})),i?.createdAt&&G(xn({date:i.createdAt,i18n:A,pattern:L}))},U=[i,A,L],e[2]=i,e[3]=L,e[4]=A,e[5]=te,e[6]=U):(te=e[5],U=e[6]),D8(te,U);let z=g&&"create"in g&&g.create,le=g&&"delete"in g&&g.delete,J=!!(T&&o&&!a&&(z||le)),ce=!o&&T?.versions?.drafts&&T.versions?.drafts.validate,re=T?.versions?.drafts,q=$?.versions?.drafts,pe=re&&re?.autosave||q&&q?.autosave,he=re&&re?.autosave,Re=q&&q?.autosave,ge=he&&re.autosave!==!1&&re.autosave.showSaveDraftButton===!0||Re&&q.autosave!==!1&&q.autosave.showSaveDraftButton===!0,Ve=N&&!T?.admin?.disableCopyToLocale,Q;e[7]!==b||e[8]!==y?(Q=y&&b&&at(lu,{className:`${At}__locked-controls`,user:y}),e[7]=b,e[8]=y,e[9]=Q):Q=e[9];let Le;return e[10]!==p||e[11]!==b||e[12]!==F||e[13]!==y?(Le=y&&b&&at(ne,{buttonStyle:"secondary",id:"take-over",onClick:p,size:"medium",type:"button",children:F("general:takeOver")}),e[10]=p,e[11]=b,e[12]=F,e[13]=y,e[14]=Le):Le=e[14],Lo(Bo,{className:At,children:[Lo("div",{className:`${At}__wrapper`,children:[at("div",{className:`${At}__content`,children:Lo("ul",{className:`${At}__meta`,children:[T&&!d&&!u&&at("li",{className:`${At}__list-item`,children:at("p",{className:`${At}__value`,children:A.t("general:creatingNewLabel",{label:R8(T?.labels?.singular??A.t("general:document"),A)})})}),Q,(T?.versions?.drafts||$?.versions?.drafts)&&Lo(cu,{children:[($||T&&d)&&at("li",{className:[`${At}__status`,`${At}__list-item`].filter(Boolean).join(" "),children:at(FR,{})}),c&&pe&&!ce&&at("li",{className:`${At}__list-item`,children:at(rR,{collection:T,global:$,id:o,publishedDocUpdatedAt:i?.createdAt})})]}),T?.timestamps&&(d||u)&&Lo(cu,{children:[Lo("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:i?.updatedAt?M:"",children:[Lo("p",{className:`${At}__label`,children:[A.t("general:lastModified"),":\xA0"]}),i?.updatedAt&&at("p",{className:`${At}__value`,children:M})]}),Lo("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:i?.createdAt?B:"",children:[Lo("p",{className:`${At}__label`,children:[A.t("general:created"),":\xA0"]}),i?.createdAt&&at("p",{className:`${At}__value`,children:B})]})]})]})}),Lo("div",{className:`${At}__controls-wrapper`,children:[Lo("div",{className:`${At}__controls`,children:[r,(T?.admin.preview||$?.admin.preview)&&at(oe,{CustomComponent:S,Fallback:at(a1,{})}),c&&at(cu,{children:T?.versions?.drafts||$?.versions?.drafts?Lo(cu,{children:[(ce||!pe||pe&&ge)&&at(oe,{CustomComponent:_,Fallback:at(f1,{})}),at(oe,{CustomComponent:w,Fallback:at(d1,{})})]}):at(oe,{CustomComponent:D,Fallback:at(m1,{})})}),Le]}),J&&!b&&at(ho,{button:Lo("div",{className:`${At}__dots`,children:[at("div",{}),at("div",{}),at("div",{})]}),className:`${At}__popup`,disabled:Z||X,horizontalAlign:"right",size:"large",verticalAlign:"bottom",children:Lo(Me.ButtonGroup,{children:[Ve&&at(t1,{}),z&&Lo(p1.Fragment,{children:[!l&&at(cu,{children:R>1?at(Me.Button,{id:"action-create",onClick:m,children:A.t("general:createNew")}):at(Me.Button,{href:_8({adminRoute:V,path:`/collections/${T?.slug}/create`}),id:"action-create",children:A.t("general:createNew")})}),T.disableDuplicate!==!0&&d&&at(dR,{id:o.toString(),onDuplicate:h,redirectAfterDuplicate:x,singularLabel:T?.labels?.singular,slug:T?.slug})]}),le&&at(iR,{buttonId:"action-delete",collectionSlug:T?.slug,id:o.toString(),onDelete:f,redirectAfterDelete:v,singularLabel:T?.labels?.singular,useAsTitle:T?.admin?.useAsTitle})]})})]})]}),at("div",{className:`${At}__divider`})]})};import{c as j8}from"react/compiler-runtime";import{jsx as If,jsxs as O8}from"react/jsx-runtime";import{useState as M8}from"react";import{c as g1}from"react/compiler-runtime";import{jsx as mo,jsxs as Sf}from"react/jsx-runtime";import{getTranslation as F8}from"@payloadcms/translations";import{useRouter as A8,useSearchParams as T8}from"next/navigation.js";import{mergeListSearchAndWhere as E8,unflatten as AR}from"payload/shared";import*as NR from"qs-esm";import TR,{useCallback as ER,useEffect as P8,useMemo as PR,useState as N8}from"react";var L8=t=>{let e=g1(7),{action:o,disabled:n}=t,{submit:r}=Oe(),{t:s}=k(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let a=i,l;return e[3]!==n||e[4]!==a||e[5]!==s?(l=mo(Ur,{className:`${$o}__save`,disabled:n,onClick:a,children:s("general:save")}),e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l},$8=t=>{let e=g1(7),{action:o,disabled:n}=t,{submit:r}=Oe(),{t:s}=k(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",overrides:{_status:"published"},skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let a=i,l;return e[3]!==n||e[4]!==a||e[5]!==s?(l=mo(Ur,{className:`${$o}__publish`,disabled:n,onClick:a,children:s("version:publishChanges")}),e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l},k8=t=>{let e=g1(7),{action:o,disabled:n}=t,{submit:r}=Oe(),{t:s}=k(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",overrides:{_status:"draft"},skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let a=i,l;return e[3]!==n||e[4]!==a||e[5]!==s?(l=mo(Ur,{buttonStyle:"secondary",className:`${$o}__draft`,disabled:n,onClick:a,children:s("version:saveDraft")}),e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l},LR=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,selectedFields:i,setSelectedFields:a}=t,{permissions:l,user:c}=De(),{closeModal:u}=ue(),{config:{routes:{api:d},serverURL:f}}=H(),{getFormState:m}=Dt(),{count:h,getQueryParams:p,selectAll:g}=oo(),{i18n:b,t:v}=k(),[x,y]=N8(!1),C=A8(),S=TR.useRef(null),{clearRouteCache:w}=On(),D=l?.collections?.[r.slug],_=T8(),A=PR(()=>AR(i.reduce((T,$)=>(T[$.value.path]=!0,T),{})),[i]),F=ER(async({formState:T,submitted:$})=>{let j=or(S),{state:N}=await m({collectionSlug:r.slug,docPermissions:D,docPreferences:null,formState:T,operation:"update",schemaPath:r.slug,select:A,signal:j.signal,skipValidation:!$});return S.current=null,N},[m,r,D,A]);P8(()=>{let T=S.current;return()=>{tr(T)}},[]);let R=PR(()=>{let T=E8({collectionConfig:r,search:_.get("search")});return p(T)},[r,_,p]),I=()=>{C.replace(NR.stringify({...kr(_),page:g===xo.AllAvailable?"1":void 0},{addQueryPrefix:!0})),w(),u(s)},E=ER(async({dispatchFields:T,formState:$,selected:j})=>{y(!0),a(j||[]);let{state:N}=await m({collectionSlug:r.slug,docPermissions:D,docPreferences:null,formState:$,operation:"update",schemaPath:r.slug,select:AR(j.reduce((P,L)=>(P[L.value.path]=!0,P),{})),skipValidation:!0});T({type:"UPDATE_MANY",formState:N}),y(!1)},[m,r.slug,D,a]);return mo(Sl,{collectionSlug:r.slug,currentEditor:c,hasPublishedDoc:!1,id:null,initialData:{},isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,versionCount:0,children:mo(vd,{value:"update",children:Sf("div",{className:`${$o}__main`,children:[Sf("div",{className:`${$o}__header`,children:[mo("h2",{className:`${$o}__header__title`,children:v("general:editingLabel",{count:h,label:F8(h>1?o:n,b)})}),mo("button",{"aria-label":v("general:close"),className:`${$o}__header__close`,id:`close-drawer__${s}`,onClick:()=>u(s),type:"button",children:mo(pt,{})})]}),Sf(An,{className:`${$o}__form`,isInitializing:x,onChange:[F],onSuccess:I,children:[mo(Hm,{fields:e,onChange:E,permissions:D.fields}),i.length===0?null:mo("div",{className:"render-fields",children:i.map((T,$)=>{let{value:{field:j,fieldPermissions:N,path:P}}=T;return mo(Aa,{clientFieldConfig:j,indexPath:"",parentPath:"",parentSchemaPath:"",path:P,permissions:N},`${P}-${$}`)})}),mo("div",{className:`${$o}__sidebar-wrap`,children:mo("div",{className:`${$o}__sidebar`,children:mo("div",{className:`${$o}__sidebar-sticky-wrap`,children:mo("div",{className:`${$o}__document-actions`,children:r?.versions?.drafts?Sf(TR.Fragment,{children:[mo(k8,{action:`${f}${d}/${r.slug}${R}&draft=true`,disabled:i.length===0}),mo($8,{action:`${f}${d}/${r.slug}${R}&draft=true`,disabled:i.length===0})]}):mo(L8,{action:`${f}${d}/${r.slug}${R}`,disabled:i.length===0})})})})})]})]})})})};var $o="edit-many",b1=t=>{let e=j8(10),{collection:o}=t,{slug:n}=o,{permissions:r}=De(),{openModal:s}=ue(),{selectAll:i}=oo(),{t:a}=k(),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];let[c,u]=M8(l),d=r?.collections?.[n],f=`edit-${n}`;if(i===xo.None||!d?.update)return null;let m;if(e[1]!==f||e[2]!==s||e[3]!==t.collection||e[4]!==c||e[5]!==a){let h;e[7]!==f||e[8]!==s?(h=()=>{s(f),u([])},e[7]=f,e[8]=s,e[9]=h):h=e[9],m=O8("div",{className:$o,children:[If("button",{"aria-label":a("general:edit"),className:`${$o}__toggle`,onClick:h,type:"button",children:a("general:edit")}),If(Ns,{children:If(Pt,{Header:null,slug:f,children:If(LR,{collection:t.collection,drawerSlug:f,selectedFields:c,setSelectedFields:u})})})]}),e[1]=f,e[2]=s,e[3]=t.collection,e[4]=c,e[5]=a,e[6]=m}else m=e[6];return m};import{c as B8}from"react/compiler-runtime";import{jsx as V8}from"react/jsx-runtime";import"react";function G8(t){let e=B8(6),o=ct(),n;e[0]!==t.style?(n=t.style||{},e[0]=t.style,e[1]=n):n=e[1];let r=`calc(100 + ${o||0} + 1)`,s;return e[2]!==t||e[3]!==n||e[4]!==r?(s=V8(Yo,{...t,style:{...n,zIndex:r}}),e[2]=t,e[3]=n,e[4]=r,e[5]=s):s=e[5],s}import{c as W8}from"react/compiler-runtime";import{jsx as Rf,jsxs as H8}from"react/jsx-runtime";import z8 from"react";function v1(t){let e=W8(12),{highlightField:o,setKey:n}=t,{id:r}=Ee(),{toggleModal:s}=ue(),{t:i}=k(),a=`generate-confirmation-${r}`,l;e[0]!==o||e[1]!==n||e[2]!==i?(l=()=>{n(),me.success(i("authentication:newAPIKeyGenerated")),o(!0)},e[0]=o,e[1]=n,e[2]=i,e[3]=l):l=e[3];let c=l,u;e[4]!==a||e[5]!==s?(u=()=>{s(a)},e[4]=a,e[5]=s,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==a||e[9]!==i||e[10]!==u?(d=H8(z8.Fragment,{children:[Rf(ne,{buttonStyle:"secondary",onClick:u,size:"small",children:i("authentication:generateNewAPIKey")}),Rf(It,{body:Rf(wi,{elements:{1:X8},i18nKey:"authentication:generatingNewAPIKeyWillInvalidate",t:i}),confirmLabel:i("authentication:generate"),heading:i("authentication:confirmGeneration"),modalSlug:a,onConfirm:c})]}),e[7]=c,e[8]=a,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function X8(t){let{children:e}=t;return Rf("strong",{children:e})}import{c as U8}from"react/compiler-runtime";import{useEffect as Y8}from"react";function Z8(t){let e=U8(4),{permissions:o}=t,{setPermissions:n}=De(),r,s;return e[0]!==o||e[1]!==n?(r=()=>{n(o)},s=[o,n],e[0]=o,e[1]=n,e[2]=r,e[3]=s):(r=e[2],s=e[3]),Y8(r,s),null}import{jsx as Wt,jsxs as Ef}from"react/jsx-runtime";import{getTranslation as Xa}from"@payloadcms/translations";import{validateWhereQuery as EV}from"payload/shared";import PV,{Fragment as v_,useEffect as x_,useRef as y_,useState as NV}from"react";import{jsx as x1,jsxs as J8}from"react/jsx-runtime";import"react";var y1="dots",$R=({ariaLabel:t,className:e,noBackground:o,orientation:n="vertical"})=>J8("div",{"aria-label":t,className:[e,y1,o&&`${y1}--no-background`,n&&`${y1}--${n}`].filter(Boolean).join(" "),children:[x1("div",{}),x1("div",{}),x1("div",{})]});import{jsx as kR}from"react/jsx-runtime";import{useEffect as jR,useRef as OR,useState as q8}from"react";import{usePathname as Q8}from"next/navigation.js";var MR="search-filter",C1=t=>{let{handleChange:e,initialParams:o,label:n}=t,r=Q8(),[s,i]=q8(typeof o?.search=="string"?o?.search:void 0),a=OR(!0),l=OR(typeof o?.search=="string"?o?.search:void 0),c=Jo(s,300);return jR(()=>{o?.search!==l.current&&(a.current=!1,i(o?.search),l.current=o?.search)},[o?.search,r]),jR(()=>{c!==l.current&&a.current&&(e&&e(c),l.current=c)},[c,e]),kR("div",{className:MR,children:kR("input",{"aria-label":n,className:`${MR}__input`,id:"search-filter-input",onChange:u=>{a.current=!0,i(u.target.value)},placeholder:n,type:"text",value:s||""})})};import{jsx as Vn,jsxs as fu}from"react/jsx-runtime";import{getTranslation as wV}from"@payloadcms/translations";import{transformWhereQuery as SV,validateWhereQuery as i_}from"payload/shared";import Ff,{useMemo as a_}from"react";import{jsx as Mn,jsxs as T1}from"react/jsx-runtime";import{useCallback as t_,useEffect as hV,useState as gV}from"react";import{jsx as uu}from"react/jsx-runtime";import"react";import{jsx as BR}from"react/jsx-runtime";import"react";var K8="condition-value-date",w1=({disabled:t,field:{admin:e},onChange:o,value:n})=>{let{date:r}=e||{};return BR("div",{className:K8,children:BR(Qi,{...r,onChange:o,readOnly:t,value:n})})};import{c as eV}from"react/compiler-runtime";import{jsx as VR}from"react/jsx-runtime";import GR from"react";var tV="condition-value-number",S1=t=>{let e=eV(18),{disabled:o,field:n,onChange:r,operator:s,value:i}=t,{hasMany:a}=n,{t:l}=k(),c;e[0]!==a||e[1]!==s?(c=["in","not_in"].includes(s)||a,e[0]=a,e[1]=s,e[2]=c):c=e[2];let u=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[3]=d):d=e[3];let[f,m]=GR.useState(d),h;e[4]!==u||e[5]!==r?(h=x=>{let y;x?u&&(Array.isArray(x)?y=x.map(oV):y=[Number(x.value?.value||x.value)]):y=[],r(y)},e[4]=u,e[5]=r,e[6]=h):h=e[6];let p=h,g,b;e[7]!==i?(g=()=>{Array.isArray(i)?m(i.map(rV)):m([])},b=[i],e[7]=i,e[8]=g,e[9]=b):(g=e[8],b=e[9]),GR.useEffect(g,b);let v;return e[10]!==o||e[11]!==u||e[12]!==r||e[13]!==p||e[14]!==l||e[15]!==i||e[16]!==f?(v=u?VR(mt,{disabled:o,isClearable:!0,isCreatable:!0,isMulti:u,isSortable:!0,numberOnly:!0,onChange:p,options:[],placeholder:l("general:enterAValue"),value:f||[]}):VR("input",{className:tV,disabled:o,onChange:x=>r(x.target.value),placeholder:l("general:enterAValue"),type:"number",value:i}),e[10]=o,e[11]=u,e[12]=r,e[13]=p,e[14]=l,e[15]=i,e[16]=f,e[17]=v):v=e[17],v};function oV(t){return Number(t.value?.value||t.value)}function rV(t,e){return{id:`${t}${e}`,label:`${t}`,value:{toString:()=>`${t}${e}`,value:t?.value||t}}}import{jsx as XR,jsxs as sV}from"react/jsx-runtime";import*as JR from"qs-esm";import UR,{useCallback as _f,useEffect as YR,useReducer as iV,useState as I1}from"react";import{getTranslation as WR}from"@payloadcms/translations";var HR=t=>t.reduce((e,o)=>o.options?[...e,...HR(o.options)]:[...e,o.id],[]),nV=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,data:n,hasMultipleRelations:r,i18n:s,relation:i}=e,a=o.admin.useAsTitle||"id",l=HR(t);if(!r)return[...t,...n.docs.reduce((f,m)=>l.indexOf(m.id)===-1?(l.push(m.id),[...f,{label:m[a],value:m.id}]):f,[])];let c=[...t],u=c.find(f=>f.label===WR(o.labels.plural,s)),d=n.docs.reduce((f,m)=>l.indexOf(m.id)===-1?(l.push(m.id),[...f,{label:m[a],relationTo:i,value:m.id}]):f,[]);return u?u.options=[...u.options,...d]:c.push({label:WR(o.labels.plural,s),options:d,value:void 0}),c}case"CLEAR":return e.required?[]:[{label:e.i18n.t("general:none"),value:"null"}];default:return t}},zR=nV;var ZR="condition-value-relationship",aV=10,R1=t=>{let{disabled:e,field:{admin:{isSortable:o}={},hasMany:n,relationTo:r},filterOptions:s,onChange:i,value:a}=t,{config:{routes:{api:l},serverURL:c},getEntityConfig:u}=H(),d=Array.isArray(r),[f,m]=iV(zR,[]),[h,p]=I1(""),g=Jo(h,300),[b,v]=I1(""),[x,y]=I1(!1),{i18n:C,t:S}=k(),w=Pe(),D=d?r:[r],_=UR.useRef(new Map(D.map(N=>[N,{hasLoadedAll:!1,nextPage:1}]))),A=_f((N,P)=>{let L=u({collectionSlug:P});m({type:"ADD",collection:L,data:N,hasMultipleRelations:d,i18n:C,relation:P})},[d,C,u]),F=eo(async({abortController:N,relationSlug:P})=>{let L=_.current.get(P);if(P&&!L.hasLoadedAll){let M=u({collectionSlug:P})?.admin?.useAsTitle||"id",O={and:[]},B={depth:0,limit:aV,locale:w.code,page:L.nextPage,select:{[M]:!0},where:O};s&&s?.[P]&&B.where.and.push(s[P]),g&&B.where.and.push({[M]:{like:g}});try{let G=await fetch(`${c}${l}/${P}${JR.stringify(B,{addQueryPrefix:!0})}`,{credentials:"include",headers:{"Accept-Language":C.language},signal:N.signal});if(G.ok){let X=await G.json();X.docs.length>0&&(A(X,P),X.nextPage?_.current.set(P,{hasLoadedAll:!1,nextPage:X.nextPage}):_.current.set(P,{hasLoadedAll:!0,nextPage:null}))}else v(S("error:unspecific"))}catch(G){N.signal.aborted||console.error(G)}}y(!0)}),R=UR.useCallback(()=>{let N=_.current.entries().next().value;if(N[0]&&!N[1].hasLoadedAll){let P=new AbortController;F({abortController:P,relationSlug:N[0]})}},[]),I=_f(()=>{if(a){if(n)return Array.isArray(a)?a.map(N=>{if(d){let P;return f.forEach(L=>{L.options&&L.options.some(V=>V?.value==N.value?(P=V,!0):!1)}),P}return f.find(P=>P.value==N)}):void 0;if(d){let N,P=a;return f.forEach(L=>{L?.options&&L.options.some(V=>V?.value==P.value?(N=V,!0):!1)}),N}return f.find(N=>N.value==a)}},[n,d,a,f]),E=_f(N=>{if(N!==h){m({type:"CLEAR",i18n:C,required:!1});let P=Array.isArray(r)?r:[r];_.current=new Map(P.map(L=>[L,{hasLoadedAll:!1,nextPage:1}])),p(N)}},[C,r,h]),T=_f(async(N,P)=>{if(!b&&N!=="null"&&N&&P){let L=await fetch(`${c}${l}/${P}/${N}?depth=0`,{credentials:"include",headers:{"Accept-Language":C.language}});if(L.ok){let V=await L.json();A({docs:[V]},P)}else console.error(S("error:loadingDocument",{id:N}))}},[C,A,l,b,c,S]);YR(()=>{let N=Array.isArray(r)?r:[r];_.current=new Map(N.map(L=>[L,{hasLoadedAll:!1,nextPage:1}])),m({type:"CLEAR",i18n:C,required:!1}),y(!1);let P=[];return N.forEach(L=>{let V=new AbortController;F({abortController:V,relationSlug:L}),P.push(V)}),()=>{P.forEach(L=>{if(L.signal)try{L.abort()}catch{}})}},[C,r,g]),YR(()=>{if(a&&x){if(n)(I()||[]).forEach((P,L)=>{P||(d?T(a[L].value,a[L].relationTo):T(a[L],r))});else if(!I())if(d){let P=a;T(P.value,P.relationTo)}else T(a,r)}},[T,I,n,d,r,a,x]);let $=["field-type",ZR,b&&"error-loading"].filter(Boolean).join(" "),j=I()||a;return sV("div",{className:$,children:[!b&&XR(mt,{disabled:e,isMulti:n,isSortable:o,onChange:N=>{if(!N){i(null);return}n&&Array.isArray(N)?i(N?N.map(P=>d?{relationTo:P?.relationTo,value:P?.value}:P?.value):null):d&&!Array.isArray(N)?i({relationTo:N?.relationTo,value:N?.value}):Array.isArray(N)||i(N?.value)},onInputChange:E,onMenuScrollToBottom:R,options:f,placeholder:S("general:selectValue"),value:j}),b&&XR("div",{className:`${ZR}__error-loading`,children:b})]})};import{c as lV}from"react/compiler-runtime";import{jsx as cV}from"react/jsx-runtime";import{getTranslation as _1}from"@payloadcms/translations";import D1 from"react";var F1=t=>{let e=lV(26),{disabled:o,isClearable:n,onChange:r,operator:s,options:i,value:a}=t,{i18n:l}=k(),c;e[0]!==i?(c=Ql(i),e[0]=i,e[1]=c):c=e[1];let[u,d]=D1.useState(c),f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=["in","not_in"],e[2]=f):f=e[2];let m=f.includes(s),h;if(m&&Array.isArray(a)){let S;e[3]!==l||e[4]!==u?(S=w=>{let D=u.find(_=>_.value===w);return{label:D?_1(D.label,l):w,value:D?.value??w}},e[3]=l,e[4]=u,e[5]=S):S=e[5],h=a.map(S)}else if(a){let S,w;if(e[6]!==l||e[7]!==u||e[8]!==a){let D;e[11]!==a?(D=_=>_.value===a,e[11]=a,e[12]=D):D=e[12],S=u.find(D),w=S?_1(S.label,l):a,e[6]=l,e[7]=u,e[8]=a,e[9]=S,e[10]=w}else S=e[9],w=e[10];h={label:w,value:S?.value??a}}let p;e[13]!==m||e[14]!==r?(p=S=>{let w;S?m?Array.isArray(S)?w=S.map(uV):w=[]:w=S.value:w=null,r(w)},e[13]=m,e[14]=r,e[15]=p):p=e[15];let g=p,b,v;e[16]!==i?(b=()=>{d(Ql(i))},v=[i],e[16]=i,e[17]=b,e[18]=v):(b=e[17],v=e[18]),D1.useEffect(b,v);let x,y;e[19]!==m||e[20]!==r||e[21]!==a?(x=()=>{!m&&Array.isArray(a)&&r(a[0])},y=[m,r,a],e[19]=m,e[20]=r,e[21]=a,e[22]=x,e[23]=y):(x=e[22],y=e[23]),D1.useEffect(x,y);let C;return e[24]!==l?(C=S=>({...S,label:_1(S.label,l)}),e[24]=l,e[25]=C):C=e[25],cV(mt,{disabled:o,isClearable:n,isMulti:m,onChange:g,options:u.map(C),value:h})};function uV(t){return t.value}import{c as dV}from"react/compiler-runtime";import{jsx as qR}from"react/jsx-runtime";import QR from"react";var mV="condition-value-text",A1=t=>{let e=dV(18),{disabled:o,field:n,onChange:r,operator:s,value:i}=t,{hasMany:a}=n,{t:l}=k(),c;e[0]!==a||e[1]!==s?(c=["in","not_in"].includes(s)||a,e[0]=a,e[1]=s,e[2]=c):c=e[2];let u=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[3]=d):d=e[3];let[f,m]=QR.useState(d),h;e[4]!==u||e[5]!==r?(h=x=>{let y;x?u&&(Array.isArray(x)?y=x.map(fV):y=[x.value?.value||x.value]):y=[],r(y)},e[4]=u,e[5]=r,e[6]=h):h=e[6];let p=h,g,b;e[7]!==i?(g=()=>{Array.isArray(i)?m(i.map(pV)):m([])},b=[i],e[7]=i,e[8]=g,e[9]=b):(g=e[8],b=e[9]),QR.useEffect(g,b);let v;return e[10]!==o||e[11]!==u||e[12]!==r||e[13]!==p||e[14]!==l||e[15]!==i||e[16]!==f?(v=u?qR(mt,{disabled:o,isClearable:!0,isCreatable:!0,isMulti:u,isSortable:!0,onChange:p,options:[],placeholder:l("general:enterAValue"),value:f||[]}):qR("input",{className:mV,disabled:o,onChange:x=>r(x.target.value),placeholder:l("general:enterAValue"),type:"text",value:i||""}),e[10]=o,e[11]=u,e[12]=r,e[13]=p,e[14]=l,e[15]=i,e[16]=f,e[17]=v):v=e[17],v};function fV(t){return t.value?.value||t.value}function pV(t,e){return{id:`${t}${e}`,label:`${t}`,value:{toString:()=>`${t}${e}`,value:t?.value||t}}}var KR=({booleanSelect:t,disabled:e,filterOptions:o,internalField:n,onChange:r,operator:s,options:i,value:a})=>{if(t||["radio","select"].includes(n?.field?.type))return uu(F1,{disabled:e,field:n.field,isClearable:!t,onChange:r,operator:s,options:i,value:a});switch(n?.field?.type){case"date":return uu(w1,{disabled:e,field:n.field,onChange:r,operator:s,value:a});case"number":return uu(S1,{disabled:e,field:n.field,onChange:r,operator:s,value:a});case"relationship":return uu(R1,{disabled:e,field:n.field,filterOptions:o,onChange:r,operator:s,value:a});default:return uu(A1,{disabled:e,field:n?.field,onChange:r,operator:s,value:a})}};var e_=t=>({all:"any",contains:"string",equals:"any",exists:"boolean",greater_than:t==="date"?"object":"string",greater_than_equal:t==="date"?"object":"string",in:"any",intersects:"any",less_than:t==="date"?"object":"string",less_than_equal:t==="date"?"object":"string",like:"string",near:"any",not_equals:"any",not_in:"any",not_like:"string",within:"any"});var Bn="condition",o_=t=>{let{addCondition:e,andIndex:o,fieldName:n,filterOptions:r,operator:s,orIndex:i,reducedFields:a,removeCondition:l,RenderedFilter:c,updateCondition:u,value:d}=t,{t:f}=k(),m=a.find(w=>w.value===n),[h,p]=gV(d),g=Jo(h,300),b=["exists"].includes(s)||m?.field?.type==="checkbox",v=[];b?v=[{label:f("general:true"),value:"true"},{label:f("general:false"),value:"false"}]:m?.field&&"options"in m.field&&(v=m.field.options);let x=eo(async w=>{s&&await u({andIndex:o,field:m,operator:s,orIndex:i,value:w===null?"":w})});hV(()=>{x(g)},[g]);let y=!m?.value&&typeof m?.value!="number"||m?.field?.admin?.disableListFilter,C=t_(async w=>{p(void 0),await u({andIndex:o,field:a.find(D=>D.value===w.value),operator:s,orIndex:i,value:void 0})},[o,s,i,a,u]),S=t_(async w=>{let _=e_(m.field.type)[w.value]||"any",A=_==="any"||typeof d===_||_==="boolean"&&(d==="true"||d==="false");A||p(void 0),await u({andIndex:o,field:m,operator:w.value,orIndex:i,value:A?d:void 0})},[o,m,i,u,d]);return Mn("div",{className:Bn,children:T1("div",{className:`${Bn}__wrap`,children:[T1("div",{className:`${Bn}__inputs`,children:[Mn("div",{className:`${Bn}__field`,children:Mn(mt,{disabled:y,isClearable:!1,onChange:C,options:a.filter(w=>!w.field.admin.disableListFilter),value:m||{value:m?.value}})}),Mn("div",{className:`${Bn}__operator`,children:Mn(mt,{disabled:y,isClearable:!1,onChange:S,options:m?.operators,value:m?.operators.find(w=>s===w.value)||null})}),Mn("div",{className:`${Bn}__value`,children:c||Mn(KR,{booleanSelect:b,disabled:!s||!m||m?.field?.admin?.disableListFilter,filterOptions:r,internalField:m,onChange:p,operator:s,options:v,value:h??""})})]}),T1("div",{className:`${Bn}__actions`,children:[Mn(ne,{buttonStyle:"icon-label",className:`${Bn}__actions-remove`,icon:"x",iconStyle:"with-border",onClick:()=>l({andIndex:o,orIndex:i}),round:!0}),Mn(ne,{buttonStyle:"icon-label",className:`${Bn}__actions-add`,icon:"plus",iconStyle:"with-border",onClick:()=>e({andIndex:o+1,field:a.find(w=>!w.field.admin?.disableListFilter),orIndex:i,relation:"and"}),round:!0})]})]})})};var E1=[{label:"equals",value:"equals"},{label:"isNotEqualTo",value:"not_equals"}],nr=[...E1,{label:"isIn",value:"in"},{label:"isNotIn",value:"not_in"},{label:"exists",value:"exists"}],r_=[...nr,{label:"isGreaterThan",value:"greater_than"},{label:"isLessThan",value:"less_than"},{label:"isLessThanOrEqualTo",value:"less_than_equal"},{label:"isGreaterThanOrEqualTo",value:"greater_than_equal"}],bV=[...E1,{label:"exists",value:"exists"},{label:"near",value:"near"}],n_={label:"within",value:"within"},s_={label:"intersects",value:"intersects"},du={label:"isLike",value:"like"},mu={label:"isNotLike",value:"not_like"},Wa={label:"contains",value:"contains"},vV={checkbox:{component:"Text",operators:E1},code:{component:"Text",operators:[...nr,du,mu,Wa]},date:{component:"Date",operators:[...nr,...r_]},email:{component:"Text",operators:[...nr,Wa]},json:{component:"Text",operators:[...nr,du,Wa,mu,n_,s_]},number:{component:"Number",operators:[...nr,...r_]},point:{component:"Point",operators:[...bV,n_,s_]},radio:{component:"Select",operators:[...nr]},relationship:{component:"Relationship",operators:[...nr]},richText:{component:"Text",operators:[...nr,du,mu,Wa]},select:{component:"Select",operators:[...nr]},text:{component:"Text",operators:[...nr,du,mu,Wa]},textarea:{component:"Text",operators:[...nr,du,mu,Wa]},upload:{component:"Text",operators:[...nr]}},Di=vV;import{getTranslation as Df}from"@payloadcms/translations";import{fieldIsHiddenOrDisabled as xV,fieldIsID as yV,tabHasName as CV}from"payload/shared";var Ha=({fields:t,i18n:e,labelPrefix:o,pathPrefix:n})=>t.reduce((r,s)=>{if(xV(s)&&!yV(s))return r;if(s.type==="tabs"&&"tabs"in s)return s.tabs.forEach(a=>{if(typeof a.label!="boolean"){let l=Df(a.label,e),c=o?o+" > "+l:l,u=CV(a)&&a.name?n?n+"."+a.name:a.name:n;typeof l=="string"&&r.push(...Ha({fields:a.fields,i18n:e,labelPrefix:c,pathPrefix:u}))}}),r;if(s.type==="row"&&"fields"in s)return r.push(...Ha({fields:s.fields,i18n:e,labelPrefix:o,pathPrefix:n})),r;if(s.type==="collapsible"&&"fields"in s){let i=Df(s.label||"",e),a=o?o+" > "+i:i;return r.push(...Ha({fields:s.fields,i18n:e,labelPrefix:a,pathPrefix:n})),r}if(s.type==="group"&&"fields"in s){let i=Df(s.label||"",e),a=o?i?o+" > "+i:o:i,l=s.name?n?n+"."+s.name:s.name:n;return r.push(...Ha({fields:s.fields,i18n:e,labelPrefix:a,pathPrefix:l})),r}if(typeof Di[s.type]=="object"){let i=new Set,a=Di[s.type].operators.reduce((f,m)=>{if(!i.has(m.value)){i.add(m.value);let h=`operators:${m.label}`;f.push({...m,label:e.t(h)})}return f},[]),l=Df(s.label||"",e),c=o?Nc({field:s,prefix:o}):l,u=n?Fa(n,s):s.name,d={label:c,value:u,...Di[s.type],field:s,operators:a};return r.push(d),r}return r},[]);var ln="where-builder",l_=t=>{let{collectionPluralLabel:e,fields:o,renderedFilters:n,resolvedFilterOptions:r}=t,{i18n:s,t:i}=k(),a=a_(()=>Ha({fields:o,i18n:s}),[o,s]),{handleWhereChange:l,query:c}=Rt(),u=a_(()=>{let h=c.where;if(h){if(i_(h))return h.or;let p=SV(h);if(i_(p))return p.or;console.warn(`Invalid where query in URL: ${JSON.stringify(h)}`)}return[]},[c.where]),d=Ff.useCallback(async({andIndex:h,field:p,orIndex:g,relation:b})=>{let v=[...u],x=Di[p.field.type].operators[0].value;b==="and"?v[g].and.splice(h,0,{[String(p.value)]:{[x]:void 0}}):v.push({and:[{[String(p.value)]:{[x]:void 0}}]}),await l({or:v})},[u,l]),f=Ff.useCallback(async({andIndex:h,field:p,operator:g,orIndex:b,value:v})=>{let x=u[b].and[h],y=Di[p.field.type],C=g||y.operators[0].value;if(typeof x=="object"&&p.value){let S=v??x?.[C],w=S!==x?.[String(p.value)]?.[String(C)],D=C!==Object.keys(x?.[String(p.value)]||{})?.[0];if(w||D){let _={[String(p.value)]:{[C]:S}},A=[...u];A[b].and[h]=_,await l({or:A})}}},[u,l]),m=Ff.useCallback(async({andIndex:h,orIndex:p})=>{let g=[...u];g[p].and.splice(h,1),g[p].and.length===0&&g.splice(p,1),await l({or:g})},[u,l]);return fu("div",{className:ln,children:[u.length>0&&fu(Ff.Fragment,{children:[Vn("div",{className:`${ln}__label`,children:i("general:filterWhere",{label:wV(e,s)})}),Vn("ul",{className:`${ln}__or-filters`,children:u.map((h,p)=>{let g=`${p}_${Array.isArray(h?.and)?h.and.length:""}`;return fu("li",{children:[p!==0&&Vn("div",{className:`${ln}__label`,children:i("general:or")}),Vn("ul",{className:`${ln}__and-filters`,children:Array.isArray(h?.and)&&h.and.map((b,v)=>{let x=u[p].and[v],y=Object.keys(x)[0],C=Object.keys(x?.[y]||{})?.[0]||void 0,S=x?.[y]?.[C]||void 0;return fu("li",{children:[v!==0&&Vn("div",{className:`${ln}__label`,children:i("general:and")}),Vn(o_,{addCondition:d,andIndex:v,fieldName:y,filterOptions:r?.get(y),operator:C,orIndex:p,reducedFields:a,removeCondition:m,RenderedFilter:n?.get(y),updateCondition:f,value:S})]},v)})})]},g)})}),Vn(ne,{buttonStyle:"icon-label",className:`${ln}__add-or`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{await d({andIndex:0,field:a[0],orIndex:u.length,relation:"or"})},children:i("general:or")})]}),u.length===0&&fu("div",{className:`${ln}__no-filters`,children:[Vn("div",{className:`${ln}__label`,children:i("general:noFiltersSet")}),Vn(ne,{buttonStyle:"icon-label",className:`${ln}__add-first-filter`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{a.length>0&&await d({andIndex:0,field:a.find(h=>!h.field.admin?.disableListFilter),orIndex:u.length,relation:"or"})},children:i("general:addFilter")})]})]})};import{c as IV}from"react/compiler-runtime";import{jsx as Af,jsxs as RV}from"react/jsx-runtime";import{getTranslation as _V}from"@payloadcms/translations";import{jsx as c_}from"react/jsx-runtime";import"react";var u_=({className:t})=>c_("svg",{className:["icon","icon--people",t].filter(Boolean).join(" "),height:"14",viewBox:"0 0 16 14",width:"16",xmlns:"http://www.w3.org/2000/svg",children:c_("path",{className:"stroke",d:"M12.0002 13C12.0002 11.5855 11.4383 10.229 10.4381 9.22876C9.43787 8.22857 8.08132 7.66667 6.66683 7.66667M6.66683 7.66667C5.25234 7.66667 3.89579 8.22857 2.89559 9.22876C1.8954 10.229 1.3335 11.5855 1.3335 13M6.66683 7.66667C8.50778 7.66667 10.0002 6.17428 10.0002 4.33333C10.0002 2.49238 8.50778 1 6.66683 1C4.82588 1 3.3335 2.49238 3.3335 4.33333C3.3335 6.17428 4.82588 7.66667 6.66683 7.66667ZM14.6668 12.3333C14.6668 10.0867 13.3335 8 12.0002 7C12.4384 6.67118 12.7889 6.23939 13.0205 5.74285C13.2522 5.2463 13.3578 4.70031 13.3282 4.1532C13.2985 3.60609 13.1344 3.07472 12.8505 2.60613C12.5665 2.13754 12.1714 1.74617 11.7002 1.46667",strokeLinecap:"square"})});var pu="active-query-preset";function d_(t){let e=IV(36),{activePreset:o,openPresetListDrawer:n,resetPreset:r}=t,{i18n:s,t:i}=k(),{getEntityConfig:a}=H(),l,c,u,d,f,m,h,p,g,b,v;if(e[0]!==o||e[1]!==a||e[2]!==s||e[3]!==n||e[4]!==i){let y=a({collectionSlug:"payload-query-presets"});c=RV,u=vt;let C=o&&`${pu}--active`,S;e[16]!==C?(S=[pu,C].filter(Boolean),e[16]=C,e[17]=S):S=e[17],p=S.join(" "),g="select-preset",e[18]!==n?(b=()=>{n()},e[18]=n,e[19]=b):b=e[19],v=o?"always-white":"light",e[20]!==o?.isShared?(h=o?.isShared&&Af(u_,{className:`${pu}__shared`}),e[20]=o?.isShared,e[21]=h):h=e[21],f=Af,m="div",l=`${pu}__label-text`,d=o?.title||i("general:selectLabel",{label:_V(y.labels.singular,s)}),e[0]=o,e[1]=a,e[2]=s,e[3]=n,e[4]=i,e[5]=l,e[6]=c,e[7]=u,e[8]=d,e[9]=f,e[10]=m,e[11]=h,e[12]=p,e[13]=g,e[14]=b,e[15]=v}else l=e[5],c=e[6],u=e[7],d=e[8],f=e[9],m=e[10],h=e[11],p=e[12],g=e[13],b=e[14],v=e[15];let x;return e[22]!==o||e[23]!==r||e[24]!==l||e[25]!==c||e[26]!==u||e[27]!==d||e[28]!==f||e[29]!==m||e[30]!==h||e[31]!==p||e[32]!==g||e[33]!==b||e[34]!==v?(x=c(u,{className:p,id:g,onClick:b,pillStyle:v,children:[h,f(m,{className:l,children:d}),o?Af("div",{className:`${pu}__clear`,id:"clear-preset",onClick:async y=>{y.stopPropagation(),await r()},onKeyDown:async y=>{y.stopPropagation(),await r()},role:"button",tabIndex:0,children:Af(pt,{})}):null]}),e[22]=o,e[23]=r,e[24]=l,e[25]=c,e[26]=u,e[27]=d,e[28]=f,e[29]=m,e[30]=h,e[31]=p,e[32]=g,e[33]=b,e[34]=v,e[35]=x):x=e[35],x}import{fieldAffectsData as DV,flattenTopLevelFields as FV}from"payload/shared";var m_=(t,e)=>t?FV(e).filter(n=>DV(n)&&t.includes(n.name)):null;import{jsx as Cr,jsxs as AV}from"react/jsx-runtime";import{getTranslation as P1}from"@payloadcms/translations";import{transformColumnsToPreferences as f_,transformColumnsToSearchParams as p_}from"payload/shared";import{Fragment as TV,useCallback as Tf,useMemo as h_}from"react";var g_="confirm-delete-preset",za="payload-query-presets",b_=({activePreset:t,collectionSlug:e,queryPresetPermissions:o})=>{let{modified:n,query:r,refineListData:s,setModified:i}=Rt(),{i18n:a,t:l}=k(),{openModal:c}=ue(),{config:{routes:{api:u}},getEntityConfig:d}=H(),f=d({collectionSlug:za}),[m,,{openDrawer:h}]=Jt({id:t?.id,collectionSlug:za}),[p,,{closeDrawer:g,openDrawer:b}]=Jt({collectionSlug:za}),v=h_(()=>({"payload-query-presets":{relatedCollection:{equals:e}}}),[e]),[x,,{closeDrawer:y,openDrawer:C}]=ai({collectionSlugs:[za],filterOptions:v,selectedCollection:za}),S=Tf(async F=>{await s({columns:F.columns?p_(F.columns):void 0,preset:F.id,where:F.where},!1)},[s]),w=Tf(async()=>{await s({columns:void 0,preset:void 0,where:void 0},!1)},[s]),D=Tf(async()=>{try{await fetch(`${u}/${za}/${t.id}`,{method:"DELETE"}).then(async F=>{try{let R=await F.json();F.status<400?(me.success(l("general:titleDeleted",{label:P1(f?.labels?.singular,a),title:t.title})),await w()):R.errors?R.errors.forEach(I=>me.error(I.message)):me.error(l("error:deletingTitle",{title:t.title}))}catch{me.error(l("error:deletingTitle",{title:t.title}))}})}catch{me.error(l("error:deletingTitle",{title:t.title}))}},[u,t?.id,t?.title,l,f,a,w]),_=Tf(async()=>{try{await fetch(`${u}/payload-query-presets/${t.id}`,{body:JSON.stringify({columns:f_(r.columns),where:r.where}),credentials:"include",headers:{"Content-Type":"application/json"},method:"PATCH"}).then(async F=>{try{let R=await F.json();F.status<400?(me.success(l("general:updatedLabelSuccessfully",{label:P1(f?.labels?.singular,a)})),i(!1)):R.errors?R.errors.forEach(I=>me.error(I.message)):me.error(l("error:unknown"))}catch{me.error(l("error:unknown"))}})}catch{me.error(l("error:unknown"))}},[u,t?.id,r.columns,r.where,l,f?.labels?.singular,a,i]),A=h_(()=>{let F=[Cr($u,{label:P1(f?.labels?.plural,a)},"preset-group-label")];return t&&n&&(F.push(Cr(Me.Button,{onClick:async()=>{await s({columns:p_(t.columns),where:t.where},!1)},children:l("general:reset")})),o.update&&F.push(Cr(Me.Button,{onClick:async()=>{await _()},children:t.isShared?l("general:updateForEveryone"):l("general:save")}))),F.push(Cr(Me.Button,{onClick:()=>{b()},children:l("general:createNew")})),t&&o?.delete&&F.push(AV(TV,{children:[Cr(Me.Button,{onClick:()=>c(g_),children:l("general:delete")}),Cr(Me.Button,{onClick:()=>{h()},children:l("general:edit")})]})),F},[t,o?.delete,o?.update,b,h,c,_,l,s,n,f?.labels?.plural,a]);return{CreateNewPresetDrawer:Cr(p,{initialData:{columns:f_(r.columns),relatedCollection:e,where:r.where},onSave:async({doc:F})=>{g(),await S(F)},redirectAfterCreate:!1}),DeletePresetModal:Cr(It,{body:Cr(wi,{elements:{1:({children:F})=>Cr("strong",{children:F})},i18nKey:"general:aboutToDelete",t:l,variables:{label:f?.labels?.singular,title:t?.title}}),confirmingLabel:l("general:deleting"),heading:l("general:confirmDeletion"),modalSlug:g_,onConfirm:D}),EditPresetDrawer:Cr(m,{onDelete:()=>{},onDuplicate:async({doc:F})=>{await S(F)},onSave:async({doc:F})=>{await S(F)}}),hasModifiedPreset:n,openPresetListDrawer:C,PresetListDrawer:Cr(x,{allowCreate:!1,disableQueryPresets:!0,onSelect:async({doc:F})=>{y(),await S(F)}}),queryPresetMenuItems:A,resetPreset:w}};var Do="list-controls",N1=t=>{let{beforeActions:e,collectionConfig:o,collectionSlug:n,disableQueryPresets:r,enableColumns:s=!0,enableSort:i=!1,listMenuItems:a,queryPreset:l,queryPresetPermissions:c,renderedFilters:u,resolvedFilterOptions:d}=t,{handleSearchChange:f,query:m}=Rt(),{CreateNewPresetDrawer:h,DeletePresetModal:p,EditPresetDrawer:g,hasModifiedPreset:b,openPresetListDrawer:v,PresetListDrawer:x,queryPresetMenuItems:y,resetPreset:C}=b_({activePreset:l,collectionSlug:n,queryPresetPermissions:c}),S=Eb(o),{i18n:w,t:D}=k(),{breakpoints:{s:_}}=Co(),A=(S&&Xa("label"in S&&(typeof S.label=="string"||typeof S.label=="object")?S.label:"name"in S?S.name:null,w))??"ID",F=m_(o.admin.listSearchableFields,o.fields),R=y_(D("general:searchBy",{label:Xa(A,w)})),I=y_(!!m?.where),E=EV(m?.where),[T,$]=NV(E?"where":void 0);x_(()=>{I.current&&!m?.where?I.current=!1:m?.where&&(I.current=!0)},[$,m?.where]),x_(()=>{F?.length>0?R.current=F.reduce((N,P,L)=>{let V="label"in P&&P.label?P.label:"name"in P?P.name:null;return L===0?`${D("general:searchBy",{label:Xa(V,w)})}`:L===F.length-1?`${N} ${D("general:or")} ${Xa(V,w)}`:`${N}, ${Xa(V,w)}`},""):R.current=D("general:searchBy",{label:Xa(A,w)})},[D,F,w,A]);let j=a;return o?.enableQueryPresets&&!r&&y?.length>0&&(j=[...y,a?.length>0?Wt(Me.Divider,{},"divider"):null,...a||[]]),Ef(v_,{children:[Ef("div",{className:Do,children:[Ef("div",{className:`${Do}__wrap`,children:[Wt(Pl,{}),Wt(C1,{fieldName:S&&"name"in S?S?.name:null,handleChange:N=>void f(N),initialParams:m,label:R.current},n),l&&b?Wt("div",{className:`${Do}__modified`,children:"Modified"}):null,Wt("div",{className:`${Do}__buttons`,children:Ef("div",{className:`${Do}__buttons-wrap`,children:[!_&&Wt(PV.Fragment,{children:e&&e}),s&&Wt(vt,{"aria-controls":`${Do}-columns`,"aria-expanded":T==="columns",className:`${Do}__toggle-columns`,icon:Wt(Ze,{direction:T==="columns"?"up":"down"}),onClick:()=>$(T!=="columns"?"columns":void 0),pillStyle:"light",children:D("general:columns")}),Wt(vt,{"aria-controls":`${Do}-where`,"aria-expanded":T==="where",className:`${Do}__toggle-where`,icon:Wt(Ze,{direction:T==="where"?"up":"down"}),onClick:()=>$(T!=="where"?"where":void 0),pillStyle:"light",children:D("general:filters")}),i&&Wt(vt,{"aria-controls":`${Do}-sort`,"aria-expanded":T==="sort",className:`${Do}__toggle-sort`,icon:Wt(Ze,{}),onClick:()=>$(T!=="sort"?"sort":void 0),pillStyle:"light",children:D("general:sort")}),!r&&Wt(d_,{activePreset:l,openPresetListDrawer:v,resetPreset:C}),j&&Array.isArray(j)&&j.length>0&&Wt(ho,{button:Wt($R,{ariaLabel:D("general:moreOptions")}),className:`${Do}__popup`,horizontalAlign:"right",id:"list-menu",size:"large",verticalAlign:"bottom",children:Wt(Me.ButtonGroup,{children:j.map((N,P)=>Wt(v_,{children:N},`list-menu-item-${P}`))})})]})})]}),s&&Wt(Ar,{className:`${Do}__columns`,height:T==="columns"?"auto":0,id:`${Do}-columns`,children:Wt(cm,{collectionSlug:o.slug})}),Wt(Ar,{className:`${Do}__where`,height:T==="where"?"auto":0,id:`${Do}-where`,children:Wt(l_,{collectionPluralLabel:o?.labels?.plural,collectionSlug:o.slug,fields:o?.fields,renderedFilters:u,resolvedFilterOptions:d})})]}),x,g,h,p]})};import{c as HV}from"react/compiler-runtime";import{jsx as Fi,jsxs as A_}from"react/jsx-runtime";import{Fragment as zV}from"react";import{jsx as C_,jsxs as LV}from"react/jsx-runtime";import{getTranslation as w_}from"@payloadcms/translations";import{useRouter as $V,useSearchParams as kV}from"next/navigation.js";import*as I_ from"qs-esm";import jV,{useCallback as S_}from"react";var OV="publish-many",L1=t=>{let{clearRouteCache:e}=On(),{collection:{slug:o,labels:{plural:n,singular:r},versions:s}={}}=t,{config:{routes:{api:i},serverURL:a}}=H(),{permissions:l}=De(),{i18n:c,t:u}=k(),{getQueryParams:d,selectAll:f}=oo(),m=$V(),h=kV(),{openModal:p}=ue(),b=l?.collections?.[o]?.update,v=`publish-${o}`,x=S_(()=>{me.error(u("error:unknown"))},[u]),y=S_(async()=>{await Qe.patch(`${a}${i}/${o}${d({_status:{not_equals:"published"}})}&draft=true`,{body:JSON.stringify({_status:"published"}),headers:{"Accept-Language":c.language,"Content-Type":"application/json"}}).then(async C=>{try{let S=await C.json(),w=S?.docs.length||0,D=w>1?n:r;return C.status<400||w>0?(me.success(u("general:updatedCountSuccessfully",{count:w,label:w_(D,c)})),S?.errors.length>0&&me.error(S.message,{description:S.errors.map(_=>_.message).join(`
|
|
57
|
-
`)}),m.replace(I_.stringify({...
|
|
58
|
-
`)}),h.replace(F_.stringify({...kr(d),page:m?"1":void 0},{addQueryPrefix:!0})),p(),null):(S.errors?S.errors.forEach(_=>me.error(_.message)):x(),!1)}catch{return x()}})},[i,s,e,f,c,o,n,u,h,d,m,p,x]);return!r?.drafts||m===xo.None||!b?null:MV(GV.Fragment,{children:[R_("button",{className:`${WV}__toggle`,onClick:()=>{l(v)},type:"button",children:u("version:unpublish")}),R_(It,{body:u("version:aboutToUnpublishSelection",{label:__(o,c)}),confirmingLabel:u("version:unpublishing"),heading:u("version:confirmUnpublish"),modalSlug:v,onConfirm:y})]})};var T_="list-selection",hu=t=>{let e=HV(10),{collectionConfig:o,disableBulkDelete:n,disableBulkEdit:r,label:s}=t,{count:i,selectAll:a,toggleAll:l,totalDocs:c}=oo(),{t:u}=k();if(i===0)return null;let d;return e[0]!==o||e[1]!==i||e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==a||e[6]!==u||e[7]!==l||e[8]!==c?(d=A_("div",{className:T_,children:[Fi("span",{children:u("general:selectedCount",{count:i,label:""})}),a!==xo.AllAvailable&&i<c&&Fi("button",{"aria-label":u("general:selectAll",{count:i,label:s}),className:`${T_}__button`,id:"select-all-across-pages",onClick:()=>l(!0),type:"button",children:u("general:selectAll",{count:c,label:""})}),!r&&!n&&Fi("span",{children:"\u2014"}),!r&&A_(zV,{children:[Fi(b1,{collection:o}),Fi(L1,{collection:o}),Fi($1,{collection:o})]}),!n&&Fi(i1,{collection:o})]}),e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=a,e[6]=u,e[7]=l,e[8]=c,e[9]=d):d=e[9],d};import{jsx as sr,jsxs as Ua,Fragment as XV}from"react/jsx-runtime";import{getTranslation as Ya}from"@payloadcms/translations";import"react";var E_="list-header",Ai="list-drawer",UV=({className:t,collectionConfig:e,Description:o,disableBulkDelete:n,disableBulkEdit:r,hasCreatePermission:s,i18n:i,isBulkUploadEnabled:a,newDocumentURL:l,openBulkUpload:c,smallBreak:u,t:d})=>Ua("header",{className:[E_,t].filter(Boolean).join(" "),children:[sr("h1",{children:Ya(e?.labels?.plural,i)}),s&&Ua(XV,{children:[sr(ne,{"aria-label":i.t("general:createNewLabel",{label:Ya(e?.labels?.singular,i)}),buttonStyle:"pill",el:"link",size:"small",to:l,children:i.t("general:createNew")}),a&&sr(ne,{"aria-label":d("upload:bulkUpload"),buttonStyle:"pill",onClick:c,size:"small",children:d("upload:bulkUpload")})]}),!u&&sr(hu,{collectionConfig:e,disableBulkDelete:n,disableBulkEdit:r,label:Ya(e?.labels?.plural,i)}),o]}),YV=({Description:t,hasCreatePermission:e,i18n:o,t:n})=>{let{config:{collections:r},getEntityConfig:s}=H(),{closeModal:i}=ue(),{DocumentDrawerToggler:a,drawerSlug:l,enabledCollections:c,selectedOption:u,setSelectedOption:d}=en(),f=s({collectionSlug:u.value}),m=r.filter(({slug:p})=>c.includes(p)),h=c.length>1;return Ua("header",{className:`${Ai}__header`,children:[Ua("div",{className:`${Ai}__header-wrap`,children:[Ua("div",{className:`${Ai}__header-content`,children:[sr("h2",{className:`${Ai}__header-text`,children:Ya(f?.labels?.plural,o)}),e&&sr(a,{className:`${Ai}__create-new-button`,children:sr(vt,{children:n("general:createNew")})})]}),sr("button",{"aria-label":n("general:close"),className:`${Ai}__header-close`,onClick:()=>{i(l)},type:"button",children:sr(pt,{})})]}),t,h&&Ua("div",{className:`${Ai}__select-collection-wrap`,children:[sr(ve,{label:n("upload:selectCollectionToBrowse")}),sr(mt,{className:`${E_}__select-collection`,onChange:d,options:m.map(p=>({label:Ya(p.labels.singular,o),value:p.slug})),value:{label:Ya(f?.labels.singular,o),value:f?.slug}})]})]})},k1=t=>{let{isInDrawer:e}=en();return e?sr(YV,{...t}):sr(UV,{...t})};import{c as ZV}from"react/compiler-runtime";import{jsx as N_}from"react/jsx-runtime";import{formatAdminURL as JV}from"payload/shared";import"react";import{jsx as P_}from"react/jsx-runtime";import"react";var j1=()=>P_("svg",{className:"icon icon--logout",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:P_("path",{className:"stroke",d:"M12 16H14.6667C15.0203 16 15.3594 15.8595 15.6095 15.6095C15.8595 15.3594 16 15.0203 16 14.6667V5.33333C16 4.97971 15.8595 4.64057 15.6095 4.39052C15.3594 4.14048 15.0203 4 14.6667 4H12M7.33333 13.3333L4 10M4 10L7.33333 6.66667M4 10H12",strokeLinecap:"square"})});var qV="nav",QV=t=>{let e=ZV(5),{tabIndex:o}=t,n=o===void 0?0:o,{t:r}=k(),{config:s}=H(),{admin:i,routes:a}=s,{routes:l}=i,{logout:c}=l,{admin:u}=a,d;return e[0]!==u||e[1]!==c||e[2]!==r||e[3]!==n?(d=N_(no,{"aria-label":r("authentication:logOut"),className:`${qV}__log-out`,href:JV({adminRoute:u,path:c}),prefetch:!1,tabIndex:n,title:r("authentication:logOut"),children:N_(j1,{})}),e[0]=u,e[1]=c,e[2]=r,e[3]=n,e[4]=d):d=e[4],d};import{c as KV}from"react/compiler-runtime";import{jsx as Za,jsxs as L_}from"react/jsx-runtime";import eG,{useState as $_}from"react";var Is="nav-group",tG="nav",oG=t=>{let e=KV(21),{children:o,isOpen:n,label:r}=t,[s,i]=$_(typeof n<"u"?!n:!1),[a,l]=$_(!1),{setPreference:c}=Fo(),{navOpen:u}=Ii();if(r){let f;e[0]!==s||e[1]!==r||e[2]!==c?(f=()=>{l(!0);let D={};D?.[r]?D[r].open=!!s:D[r]={open:!!s},c(tG,{groups:D},!0),i(!s)},e[0]=s,e[1]=r,e[2]=c,e[3]=f):f=e[3];let m=f,h=`${r}`,p=s&&`${Is}--collapsed`,g;e[4]!==h||e[5]!==p?(g=[`${Is}`,h,p].filter(Boolean),e[4]=h,e[5]=p,e[6]=g):g=e[6];let b=g.join(" "),v=`nav-group-${r}`,x=`${Is}__toggle--${s?"collapsed":"open"}`,y;e[7]!==x?(y=[`${Is}__toggle`,x].filter(Boolean),e[7]=x,e[8]=y):y=e[8];let C=y.join(" "),S=u?0:-1,w;return e[9]!==a||e[10]!==o||e[11]!==s||e[12]!==r||e[13]!==S||e[14]!==b||e[15]!==v||e[16]!==C||e[17]!==m?(w=L_("div",{className:b,id:v,children:[L_("button",{className:C,onClick:m,tabIndex:S,type:"button",children:[Za("div",{className:`${Is}__label`,children:r}),Za("div",{className:`${Is}__indicator`,children:Za(Ze,{className:`${Is}__indicator`,direction:s?void 0:"up"})})]}),Za(Ar,{duration:a?200:0,height:s?0:"auto",children:Za("div",{className:`${Is}__content`,children:o})})]}),e[9]=a,e[10]=o,e[11]=s,e[12]=r,e[13]=S,e[14]=b,e[15]=v,e[16]=C,e[17]=m,e[18]=w):w=e[18],w}let d;return e[19]!==o?(d=Za(eG.Fragment,{children:o}),e[19]=o,e[20]=d):d=e[20],d};import{c as rG}from"react/compiler-runtime";import{jsx as Rs,jsxs as k_}from"react/jsx-runtime";import{collectionDefaults as nG,isNumber as sG}from"payload/shared";import"react";var Ja="per-page",iG=nG.admin.pagination.limits,O1=t=>{let e=rG(9),{defaultLimit:o,handleChange:n,limit:r,limits:s}=t,i=o===void 0?10:o,a=s===void 0?iG:s,{t:l}=k(),c=sG(r)?r:i,u;if(e[0]!==n||e[1]!==c||e[2]!==a||e[3]!==l){let d;e[5]!==n||e[6]!==c||e[7]!==a?(d=f=>{let{close:m}=f;return Rs(Me.ButtonGroup,{children:a.map((h,p)=>k_(Me.Button,{className:[`${Ja}__button`,h===c&&`${Ja}__button-active`].filter(Boolean).join(" "),onClick:()=>{m(),n&&n(h)},children:[h===c&&Rs("div",{className:`${Ja}__chevron`,children:Rs(Ze,{direction:"right",size:"small"})}),"\xA0",Rs("span",{children:h})]},p))})},e[5]=n,e[6]=c,e[7]=a,e[8]=d):d=e[8],u=Rs("div",{className:Ja,children:Rs(ho,{button:k_("div",{className:`${Ja}__base-button`,children:[Rs("span",{children:l("general:perPage",{limit:c})}),"\xA0",Rs(Ze,{className:`${Ja}__icon`})]}),horizontalAlign:"right",render:d,size:"small"})}),e[0]=n,e[1]=c,e[2]=a,e[3]=l,e[4]=u}else u=e[4];return u};import{c as cG}from"react/compiler-runtime";import{jsx as Nf}from"react/jsx-runtime";import{Fragment as O_}from"react";import{jsxs as aG}from"react/jsx-runtime";import"react";function j_(t){return t===void 0||typeof t=="number"?t:decodeURIComponent(t)}var lG="id-label",Pf=({id:t,className:e,prefix:o="ID:"})=>aG("div",{className:[lG,e].filter(Boolean).join(" "),title:t,children:[o,"\xA0",j_(t)]});var M1="render-title",B1=t=>{let e=cG(10),{className:o,element:n,fallback:r,title:s}=t,i=n===void 0?"h1":n,{id:a,isInitializing:l,title:c}=Ee(),u=s||c||r,d=u===a,f=i,m;if(e[0]!==f||e[1]!==o||e[2]!==a||e[3]!==d||e[4]!==l||e[5]!==u){let h=Nf(O_,{children:"\xA0"}),p=d&&`${M1}--has-id`,g;e[7]!==o||e[8]!==p?(g=[o,M1,p].filter(Boolean),e[7]=o,e[8]=p,e[9]=g):g=e[9],m=Nf(f,{className:g.join(" "),title:u,children:l?h:Nf(O_,{children:d?Nf(Pf,{className:`${M1}__id`,id:a}):u||h})}),e[0]=f,e[1]=o,e[2]=a,e[3]=d,e[4]=l,e[5]=u,e[6]=m}else m=e[6];return m};import{c as uG}from"react/compiler-runtime";import{jsx as qa,jsxs as M_}from"react/jsx-runtime";import"react";var cn="sort-column",dG=t=>{let e=uG(22),{name:o,appearance:n,disable:r,Label:s,label:i}=t,a=r===void 0?!1:r,{handleSortChange:l,query:c}=Rt(),{t:u}=k(),{sort:d}=c,f=`-${o}`,m=o,h;e[0]!==m||e[1]!==d?(h=[`${cn}__asc`],d===m&&h.push(`${cn}--active`),e[0]=m,e[1]=d,e[2]=h):h=e[2];let p;e[3]!==f||e[4]!==d?(p=[`${cn}__desc`],d===f&&p.push(`${cn}--active`),e[3]=f,e[4]=d,e[5]=p):p=e[5];let g=n&&`${cn}--appearance-${n}`,b;e[6]!==g?(b=[cn,g].filter(Boolean),e[6]=g,e[7]=b):b=e[7];let v=b.join(" "),x;e[8]!==s||e[9]!==i?(x=s??qa(ve,{hideLocale:!0,label:i,unstyled:!0}),e[8]=s,e[9]=i,e[10]=x):x=e[10];let y;return e[11]!==m||e[12]!==h||e[13]!==f||e[14]!==p||e[15]!==a||e[16]!==l||e[17]!==i||e[18]!==u||e[19]!==v||e[20]!==x?(y=M_("div",{className:v,children:[qa("span",{className:`${cn}__label`,children:x}),!a&&M_("div",{className:`${cn}__buttons`,children:[qa("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:ascending"),label:i}),className:[...h,`${cn}__button`].filter(Boolean).join(" "),onClick:()=>void l(m),type:"button",children:qa(Ze,{direction:"up"})}),qa("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:descending"),label:i}),className:[...p,`${cn}__button`].filter(Boolean).join(" "),onClick:()=>void l(f),type:"button",children:qa(Ze,{})})]})]}),e[11]=m,e[12]=h,e[13]=f,e[14]=p,e[15]=a,e[16]=l,e[17]=i,e[18]=u,e[19]=v,e[20]=x,e[21]=y):y=e[21],y};import{jsx as B_}from"react/jsx-runtime";import"react";var mG=t=>{let{className:e}=t;return B_("svg",{className:[e,"icon icon--externalLink"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:B_("path",{className:"stroke",d:"M16 10.6667V14.6667C16 15.0203 15.8595 15.3594 15.6095 15.6095C15.3594 15.8595 15.0203 16 14.6667 16H5.33333C4.97971 16 4.64057 15.8595 4.39052 15.6095C4.14048 15.3594 4 15.0203 4 14.6667V5.33333C4 4.97971 4.14048 4.64057 4.39052 4.39052C4.64057 4.14048 4.97971 4 5.33333 4H9.33333M16 4L10 10M16 4H12M16 4V8",strokeLinecap:"square"})})};import{jsx as V_}from"react/jsx-runtime";import"react";var fG=()=>V_("svg",{"aria-hidden":"true",className:"graphic code-block-icon",focusable:"false",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:V_("path",{className:"stroke",d:"M14 12.6667L16.6667 9.99999L14 7.33332M5.99999 7.33332L3.33333 9.99999L5.99999 12.6667M11.6667 4.66666L8.33333 15.3333",strokeLinecap:"square"})});import{jsx as V1}from"react/jsx-runtime";import"react";var G1="minimize-maximize",pG=({className:t,isMinimized:e})=>{let o=[G1,e?`${G1}--minimized`:`${G1}--maximized`,t].filter(Boolean).join(" ");return V1("svg",{className:o,height:"20",stroke:"currentColor",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:e?V1("path",{d:"M7.33333 4H5.33333C4.97971 4 4.64057 4.14048 4.39052 4.39052C4.14048 4.64057 4 4.97971 4 5.33333V7.33333M16 7.33333V5.33333C16 4.97971 15.8595 4.64057 15.6095 4.39052C15.3594 4.14048 15.0203 4 14.6667 4H12.6667M4 12.6667V14.6667C4 15.0203 4.14048 15.3594 4.39052 15.6095C4.64057 15.8595 4.97971 16 5.33333 16H7.33333M12.6667 16H14.6667C15.0203 16 15.3594 15.8595 15.6095 15.6095C15.8595 15.3594 16 15.0203 16 14.6667V12.6667"}):V1("path",{d:"M7.33333 4V6C7.33333 6.35362 7.19286 6.69276 6.94281 6.94281C6.69276 7.19286 6.35362 7.33333 6 7.33333H4M16 7.33333H14C13.6464 7.33333 13.3072 7.19286 13.0572 6.94281C12.8071 6.69276 12.6667 6.35362 12.6667 6V4M4 12.6667H6C6.35362 12.6667 6.69276 12.8071 6.94281 13.0572C7.19286 13.3072 7.33333 13.6464 7.33333 14V16M12.6667 16V14C12.6667 13.6464 12.8071 13.3072 13.0572 13.0572C13.3072 12.8071 13.6464 12.6667 14 12.6667H16"})})};import{jsx as G_,jsxs as hG}from"react/jsx-runtime";import"react";var W1=()=>hG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[G_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-error-500)"}),G_("path",{d:"M15.4001 10.5996L10.6001 15.3996M10.6001 10.5996L15.4001 15.3996",stroke:"var(--theme-error-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as W_,jsxs as gG}from"react/jsx-runtime";import"react";var H1=()=>gG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[W_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-elevation-500)"}),W_("path",{d:"M13 16.1998V12.9998M13 9.7998H13.0077",stroke:"var(--theme-elevation-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as H_,jsxs as bG}from"react/jsx-runtime";import"react";var z1=()=>bG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[H_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-success-500)"}),H_("path",{d:"M10.6001 13.0004L12.2001 14.6004L15.4001 11.4004",stroke:"var(--theme-success-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as z_,jsxs as vG}from"react/jsx-runtime";import"react";var X1=()=>vG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[z_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-warning-500)"}),z_("path",{d:"M13 10V13.2M13 16.4H13.008",stroke:"var(--theme-warning-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{c as U_}from"react/compiler-runtime";import{jsx as X_}from"react/jsx-runtime";import Qa from"react";var Y_=Qa.createContext({addClientFunction:()=>null,removeClientFunction:()=>null}),Z_=Qa.createContext({}),U1=t=>{let e=U_(6),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=Qa.useState(n),i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=d=>{s(f=>{let m={...f};return m[d.key]=d.func,m})},e[1]=i):i=e[1];let a=i,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=d=>{s(f=>{let m={...f};return delete m[d.key],m})},e[2]=l):l=e[2];let c=l,u;return e[3]!==o||e[4]!==r?(u=X_(Y_,{value:{addClientFunction:a,removeClientFunction:c},children:X_(Z_,{value:r,children:o})}),e[3]=o,e[4]=r,e[5]=u):u=e[5],u},xG=(t,e)=>{let o=U_(6),{addClientFunction:n,removeClientFunction:r}=Qa.use(Y_),s,i;o[0]!==n||o[1]!==e||o[2]!==t||o[3]!==r?(s=()=>(n({func:e,key:t}),()=>{r({func:e,key:t})}),i=[e,t,n,r],o[0]=n,o[1]=e,o[2]=t,o[3]=r,o[4]=s,o[5]=i):(s=o[4],i=o[5]),Qa.useEffect(s,i)},yG=()=>Qa.use(Z_);import{c as CG}from"react/compiler-runtime";import{jsx as J_}from"react/jsx-runtime";import wG,{useEffect as SG,useRef as IG}from"react";var q_=200,Y1="progress-bar",RG=150,_G=()=>{let t=CG(9),{isTransitioning:e,transitionProgress:o}=st(),[n,r]=wG.useState(null),s=IG(!0),i,a;if(t[0]!==e||t[1]!==o?(i=()=>{let l,c;return e?s.current?c=setTimeout(()=>{r(o),s.current=!1},RG):r(o):(s.current=!0,r(1),l=setTimeout(()=>{r(null)},q_*2)),()=>{clearTimeout(l),clearTimeout(c)}},a=[e,o],t[0]=e,t[1]=o,t[2]=i,t[3]=a):(i=t[2],a=t[3]),SG(i,a),typeof n=="number"){let l=n===1&&`${Y1}--fade-out`,c;t[4]!==l?(c=[Y1,l].filter(Boolean),t[4]=l,t[5]=c):c=t[5];let u=c.join(" "),d;return t[6]!==n||t[7]!==u?(d=J_("div",{className:u,style:{"--transition-duration":`${q_}ms`},children:J_("div",{className:`${Y1}__progress`,style:{width:`${(n||0)*100}%`}})}),t[6]=n,t[7]=u,t[8]=d):d=t[8],d}return null};import{c as DG}from"react/compiler-runtime";import{jsx as FG}from"react/jsx-runtime";import{createContext as AG,use as TG}from"react";var Q_=AG({}),EG=t=>{let e=DG(6),{children:o,visibleEntities:n}=t,r;e[0]!==n?(r=a=>{let{collectionSlug:l,globalSlug:c}=a;return l?n.collections.includes(l):c?n.globals.includes(c):!1},e[0]=n,e[1]=r):r=e[1];let s=r,i;return e[2]!==o||e[3]!==s||e[4]!==n?(i=FG(Q_,{value:{isEntityVisible:s,visibleEntities:n},children:o}),e[2]=o,e[3]=s,e[4]=n,e[5]=i):i=e[5],i},Z1=()=>TG(Q_);import{c as PG}from"react/compiler-runtime";import{jsx as NG}from"react/jsx-runtime";import{useParams as LG}from"next/navigation.js";import{createContext as $G,use as kG}from"react";var K_=$G({}),J1=t=>{let e=PG(3),{children:o}=t,n=LG(),r;return e[0]!==o||e[1]!==n?(r=NG(K_,{value:n,children:o}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r},jG=()=>kG(K_);import{jsx as kt,jsxs as rD}from"react/jsx-runtime";import IMe,{Fragment as RMe}from"react";import{useContext as MG}from"react";import{createContext as OG}from"react";var gu=OG({});var bu=()=>MG(gu);import BG,{useCallback as VG,useEffect as GG,useReducer as WG,useRef as HG}from"react";var zG=(t,e)=>{let{timestamp:o,animationRef:n}=e;n.current=null;let{x:r,y:s,xDirection:i,yDirection:a,eventsFired:l,hasScrolled:c}=t,u=c||!!o,d=u?window.pageXOffset:0,f=u?window.pageYOffset:0,m=u?l+1:l,h=d-r,p=f-s,g=d/(document.body.scrollWidth-window.innerWidth)*100,b=f/(document.body.scrollHeight-window.innerHeight)*100,v=(g+b)/2,x=h>0?"right":h<0?"left":i,y=p>0?"down":p<0?"up":a;return{x:d,y:f,xDifference:h,yDifference:p,xDirection:x,yDirection:y,xPercentage:g,yPercentage:b,totalPercentage:v,eventsFired:m,hasScrolled:u}},vu=t=>{let{children:e}=t,o=HG(null),[n,r]=WG(zG,{x:0,y:0,xDifference:0,yDifference:0,xDirection:void 0,yDirection:void 0,xPercentage:0,yPercentage:0,totalPercentage:0,eventsFired:0,hasScrolled:!1}),s=VG(i=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(a=>{r({e:i,timestamp:a,animationRef:o})})},[]);return GG(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[s]),BG.createElement(gu.Provider,{value:Object.assign({},n)},e&&e)};import PMe from"react";import{Fragment as nD}from"react";var{WindowInfoProvider:q1}=Xn&&"WindowInfoProvider"in Xn?Xn:{WindowInfoProvider:void 0},{useWindowInfo:Q1}=Xn&&"useWindowInfo"in Xn?Xn:{useWindowInfo:void 0};import{jsx as XG}from"react/jsx-runtime";import{useSearchParams as UG}from"next/navigation.js";import*as Lf from"qs-esm";import eD,{createContext as YG,use as ZG}from"react";var JG={searchParams:{},stringifyParams:()=>""},tD=YG(JG),K1=({children:t})=>{let o=UG().toString(),n=eD.useMemo(()=>Lf.parse(o,{depth:10,ignoreQueryPrefix:!0}),[o]),r=eD.useCallback(({params:s,replace:i=!1})=>Lf.stringify({...i?{}:n,...s},{addQueryPrefix:!0}),[n]);return XG(tD,{value:{searchParams:n,stringifyParams:r},children:t})},qG=()=>ZG(tD);import{jsx as xu}from"react/jsx-runtime";import"react";var oD=()=>xu(H0,{className:"payload-toast-container",closeButton:!0,dir:"undefined",gap:8,icons:{error:xu(W1,{}),info:xu(H1,{}),success:xu(z1,{}),warning:xu(X1,{})},offset:"calc(var(--gutter-h) / 2)",toastOptions:{classNames:{closeButton:"payload-toast-close-button",content:"toast-content",error:"toast-error",icon:"toast-icon",info:"toast-info",success:"toast-success",title:"toast-title",toast:"payload-toast-item",warning:"toast-warning"},unstyled:!0},visibleToasts:5});var QG=({children:t,config:e,dateFNSKey:o,fallbackLang:n,isNavOpen:r,languageCode:s,languageOptions:i,locale:a,permissions:l,serverFunction:c,switchLanguageServerAction:u,theme:d,translations:f,user:m})=>{let h=process.env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH==="true"?o1:nD;return rD(nD,{children:[kt(vg,{serverFunction:c,children:kt(ap,{children:kt(h,{children:kt(Wf,{config:e,children:kt(U1,{children:kt(Gf,{dateFNSKey:o,fallbackLang:n,language:s,languageOptions:i,switchLanguageServerAction:u,translations:f,children:kt(q1,{breakpoints:{l:"(max-width: 1440px)",m:"(max-width: 1024px)",s:"(max-width: 768px)",xs:"(max-width: 400px)"},children:kt(vu,{children:kt(K1,{children:kt(Lp,{classPrefix:"payload",transTime:0,zIndex:"var(--z-modal)",children:rD(Gp,{permissions:l,user:m,children:[kt(zp,{children:kt(zf,{theme:d,children:kt(J1,{children:kt(Xp,{locale:a,children:kt(Kb,{children:kt(n3,{children:kt(pb,{children:kt(j4,{initialIsOpen:r,children:kt(ob,{children:t})})})})})})})})}),kt(Ep,{}),kt(Y0,{})]})})})})})})})})})})}),kt(oD,{})]})};import{jsx as sD,jsxs as KG}from"react/jsx-runtime";import{email as eW,username as tW}from"payload/shared";import"react";function ev(t){let{className:e,loginWithUsername:o,readOnly:n,t:r}=t,s=!o||o?.requireEmail||o?.allowEmailLogin,i=!!o;return KG("div",{className:e,children:[s?sD(oi,{field:{name:"email",admin:{autoComplete:"off"},label:r("general:email"),required:!o||o&&o.requireEmail},path:"email",readOnly:n,schemaPath:"email",validate:eW}):null,i&&sD(di,{field:{name:"username",label:r("authentication:username"),required:o&&o.requireUsername},path:"username",readOnly:n,schemaPath:"username",validate:tW})]})}import{c as oW}from"react/compiler-runtime";import{jsx as rW}from"react/jsx-runtime";import"react";var iD="select-all",nW=()=>{let t=oW(7),{selectAll:e,toggleAll:o}=oo(),{i18n:n}=k(),r;if(t[0]!==n||t[1]!==e||t[2]!==o){let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=[iD,`${iD}__checkbox`],t[4]=s):s=t[4];let i;t[5]!==o?(i=()=>o(),t[5]=o,t[6]=i):i=t[6],r=rW(Hs,{"aria-label":e===xo.None?n.t("general:selectAllRows"):n.t("general:deselectAllRows"),checked:e===xo.AllInPage||e===xo.AllAvailable,className:s.join(" "),id:"select-all",name:"select-all",onToggle:i,partialChecked:e===xo.Some}),t[0]=n,t[1]=e,t[2]=o,t[3]=r}else r=t[3];return r};import{c as sW}from"react/compiler-runtime";import{jsx as aD}from"react/jsx-runtime";import"react";var lD="select-row",iW=t=>{let e=sW(14),{rowData:o}=t,{user:n}=De(),{selected:r,setSelection:s}=oo(),i;e[0]!==o?(i=o||{},e[0]=o,e[1]=i):i=e[1];let{_isLocked:a,_userEditing:l}=i;if(a&&l&&l.id!==n?.id){let p;return e[2]!==l?(p=aD(lu,{user:l}),e[2]=l,e[3]=p):p=e[3],p}let u;e[4]!==o.id||e[5]!==r?(u=r.get(o.id),e[4]=o.id,e[5]=r,e[6]=u):u=e[6];let d=!!u,f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=[lD,`${lD}__checkbox`],e[7]=f):f=e[7];let m;e[8]!==o.id||e[9]!==s?(m=()=>s(o.id),e[8]=o.id,e[9]=s,e[10]=m):m=e[10];let h;return e[11]!==d||e[12]!==m?(h=aD(Hs,{checked:d,className:f.join(" "),onToggle:m}),e[11]=d,e[12]=m,e[13]=h):h=e[13],h};import{jsx as aW}from"react/jsx-runtime";import"react";var Ka=t=>{let{onClick:e}=t,{count:o,selected:n}=oo();return!n||!o?null:aW(vt,{onClick:()=>{typeof e=="function"&&e(n)},pillStyle:"white",children:`Select ${o}`})};import{c as lW}from"react/compiler-runtime";import{jsx as Ht,jsxs as Ti}from"react/jsx-runtime";import{getTranslation as $f}from"@payloadcms/translations";import{useRouter as cW}from"next/navigation.js";import{formatFilesize as uW,isNumber as dW}from"payload/shared";import{Fragment as tv,useEffect as cD,useState as mW}from"react";var Gn="collection-list";function fW(t){let e=lW(17),{AfterList:o,AfterListTable:n,beforeActions:r,BeforeList:s,BeforeListTable:i,collectionSlug:a,columnState:l,Description:c,disableBulkDelete:u,disableBulkEdit:d,disableQueryPresets:f,enableRowSelections:m,hasCreatePermission:h,listMenuItems:p,newDocumentURL:g,queryPreset:b,queryPresetPermissions:v,renderedFilters:x,resolvedFilterOptions:y,Table:C}=t,[S,w]=mW(C),{allowCreate:D,createNewDrawerSlug:_,drawerSlug:A,onBulkSelect:F}=en(),R=D!==void 0?D&&h:h,I,E;e[0]!==C?(I=()=>{C&&w(C)},E=[C],e[0]=C,e[1]=I,e[2]=E):(I=e[1],E=e[2]),cD(I,E);let{user:T}=De(),{getEntityConfig:$}=H(),j=cW(),{data:N,defaultLimit:P,handlePageChange:L,handlePerPageChange:V,query:M}=Rt(),{openModal:O}=ue(),{setCollectionSlug:B,setCurrentActivePath:G,setOnSuccess:X}=Ho(),{drawerSlug:Z}=Ho(),te=$({collectionSlug:a}),{labels:U,upload:z}=te,le=!!z,J=le&&te.upload.bulkUpload,ce=!!A,{i18n:re,t:q}=k(),{setStepNav:pe}=jn(),{breakpoints:he}=Q1(),{s:Re}=he,ge;if(le){let ae;e[3]!==N.docs?(ae=N.docs.map(pW),e[3]=N.docs,e[4]=ae):ae=e[4],ge=ae}else ge=N.docs;let Ve=ge,Q;e[5]!==Z||e[6]!==a||e[7]!==O||e[8]!==j||e[9]!==B||e[10]!==G||e[11]!==X?(Q=()=>{B(a),G(a),O(Z),X(a,()=>j.refresh())},e[5]=Z,e[6]=a,e[7]=O,e[8]=j,e[9]=B,e[10]=G,e[11]=X,e[12]=Q):Q=e[12];let Le=Q;cD(()=>{ce||pe([{label:U?.plural}])},[pe,U,ce]);let _e;return e[13]!==r||e[14]!==m||e[15]!==F?(_e=m&&typeof F=="function"?r?[...r,Ht(Ka,{onClick:F},"select-many")]:[Ht(Ka,{onClick:F},"select-many")]:r,e[13]=r,e[14]=m,e[15]=F,e[16]=_e):_e=e[16],Ht(tv,{children:Ht(sc,{collectionSlug:a,columnState:l,children:Ht("div",{className:`${Gn} ${Gn}--${a}`,children:Ti(s1,{docs:Ve,totalDocs:N.totalDocs,user:T,children:[s,Ti(Bo,{className:`${Gn}__wrap`,children:[Ht(k1,{collectionConfig:te,Description:Ht("div",{className:`${Gn}__sub-header`,children:Ht(oe,{CustomComponent:c,Fallback:Ht(Bb,{collectionSlug:a,description:te?.admin?.description})})}),disableBulkDelete:u,disableBulkEdit:d,hasCreatePermission:R,i18n:re,isBulkUploadEnabled:J&&!z.hideFileInputOnCreate,newDocumentURL:g,openBulkUpload:Le,smallBreak:Re,t:q}),Ht(N1,{beforeActions:_e,collectionConfig:te,collectionSlug:a,disableQueryPresets:te?.enableQueryPresets!==!0||f,listMenuItems:p,queryPreset:b,queryPresetPermissions:v,renderedFilters:x,resolvedFilterOptions:y}),i,Ve.length>0&&Ht(cc,{children:S}),Ve.length===0&&Ti("div",{className:`${Gn}__no-results`,children:[Ht("p",{children:re.t("general:noResults",{label:$f(U?.plural,re)})}),R&&g&&Ht(tv,{children:ce?Ht(ne,{el:"button",onClick:()=>O(_),children:re.t("general:createNewLabel",{label:$f(U?.singular,re)})}):Ht(ne,{el:"link",to:g,children:re.t("general:createNewLabel",{label:$f(U?.singular,re)})})})]}),n,Ve.length>0&&Ti("div",{className:`${Gn}__page-controls`,children:[Ht(dc,{hasNextPage:N.hasNextPage,hasPrevPage:N.hasPrevPage,limit:N.limit,nextPage:N.nextPage,numberOfNeighbors:1,onChange:ae=>void L(ae),page:N.page,prevPage:N.prevPage,totalPages:N.totalPages}),N.totalDocs>0&&Ti(tv,{children:[Ti("div",{className:`${Gn}__page-info`,children:[N.page*N.limit-(N.limit-1),"-",N.totalPages>1&&N.totalPages!==N.page?N.limit*N.page:N.totalDocs," ",re.t("general:of")," ",N.totalDocs]}),Ht(O1,{handleChange:ae=>void V(ae),limit:dW(M?.limit)?Number(M.limit):P,limits:te?.admin?.pagination?.limits,resetPage:N.totalDocs<=N.pagingCounter}),Re&&Ti("div",{className:`${Gn}__list-selection`,children:[Ht(hu,{collectionConfig:te,disableBulkDelete:u,disableBulkEdit:d,label:$f(te.labels.plural,re)}),Ht("div",{className:`${Gn}__list-selection-actions`,children:m&&typeof F=="function"?r?[...r,Ht(Ka,{onClick:F},"select-many")]:[Ht(Ka,{onClick:F},"select-many")]:r})]})]})]})]}),o]})})})})}function pW(t){return{...t,filesize:uW(t.filesize)}}import{jsx as ir,jsxs as yD}from"react/jsx-runtime";import{useRouter as jW,useSearchParams as OW}from"next/navigation.js";import{formatAdminURL as MW}from"payload/shared";import BW,{Fragment as VW,useCallback as av,useEffect as CD,useMemo as GW,useRef as lv,useState as Of}from"react";import{c as dD}from"react/compiler-runtime";import{jsx as el,jsxs as uD}from"react/jsx-runtime";var mD=t=>{let e=dD(7),{drawerSlug:o}=t,{closeModal:n}=ue(),{t:r}=k(),s;if(e[0]!==n||e[1]!==o||e[2]!==r){let i;e[4]!==n||e[5]!==o?(i=()=>n(o),e[4]=n,e[5]=o,e[6]=i):i=e[6],s=uD(Bo,{className:`${as}__header`,children:[uD("div",{className:`${as}__header-content`,children:[el("h2",{className:`${as}__header-text`,children:el(B1,{element:"span"})}),el("button",{"aria-label":r("general:close"),className:`${as}__header-close`,onClick:i,type:"button",children:el(pt,{})})]}),el(hW,{})]}),e[0]=n,e[1]=o,e[2]=r,e[3]=s}else s=e[3];return s},hW=()=>{let t=dD(3),{id:e,title:o}=Ee(),n;return t[0]!==e||t[1]!==o?(n=e&&e!==o?el(Pf,{id:e.toString()}):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],n};import{formatAdminURL as gW}from"payload/shared";var fD=({adminRoute:t,router:e})=>{let o=gW({adminRoute:t,path:"/"});e.push(o)};import{formatAdminURL as bW}from"payload/shared";var pD=({adminRoute:t,collectionSlug:e,router:o})=>{let n=bW({adminRoute:t,path:e?`/collections/${e}`:"/"});o.push(n)};var ov=(t,e,o,n,r,s,i,a,l,c)=>{if(l)try{s(t,e??o,n),r||(a.current.hasShownLockedModal=!0),a.current={hasShownLockedModal:a.current?.hasShownLockedModal,isLocked:!0,user:n},i(n),r&&c&&c(!1)}catch(u){console.error("Error during document takeover:",u)}};import{c as IW}from"react/compiler-runtime";import{jsx as un,jsxs as yu}from"react/jsx-runtime";import RW,{Fragment as _W,useEffect as DW,useState as FW}from"react";import{jsx as kf,jsxs as rv}from"react/jsx-runtime";import{getTranslation as vW}from"@payloadcms/translations";import{text as xW}from"payload/shared";import yW,{useEffect as hD,useMemo as gD,useState as bD}from"react";var CW="apiKey",wW="api-key",SW="field-type",vD=({enabled:t,readOnly:e})=>{let[o]=bD(wn()),[n,r]=bD(!1),{i18n:s,t:i}=k(),{config:a,getEntityConfig:l}=H(),{collectionSlug:c}=Ee(),u=Et(([y])=>y&&y[CW]||null),d=l({collectionSlug:c})?.fields?.find(y=>"name"in y&&y.name==="apiKey"),f=y=>xW(y,{name:"apiKey",type:"text",blockData:{},data:{},event:"onChange",maxLength:48,minLength:24,path:["apiKey"],preferences:{fields:{}},req:{payload:{config:a},t:i},siblingData:{}}),m=u?.value,h=gD(()=>{let y="API Key";return d?.label&&(y=d.label),vW(y,s)},[d,s]),p=gD(()=>rv("div",{className:`${wW}__label`,children:[kf("span",{children:h}),kf(Oc,{value:m})]}),[h,m]),g=Te({path:"apiKey",validate:f}),b=()=>{n&&r(!1),setTimeout(()=>{r(!0)},1)},{setValue:v,value:x}=g;return hD(()=>{!m&&t&&v(o),!t&&m&&v(null)},[m,t,v,o]),hD(()=>{n&&setTimeout(()=>{r(!1)},1e4)},[n]),t?rv(yW.Fragment,{children:[rv("div",{className:[SW,"api-key","read-only"].filter(Boolean).join(" "),children:[p,kf("input",{"aria-label":h,className:n?"highlight":void 0,disabled:!0,id:"apiKey",name:"apiKey",type:"text",value:x||""})]}),!e&&kf(v1,{highlightField:b,setKey:()=>v(wn())})]}):null};var jf="auth-fields",xD=t=>{let e=IW(57),{className:o,collectionSlug:n,disableLocalStrategy:r,email:s,loginWithUsername:i,operation:a,readOnly:l,requirePassword:c,setValidateBeforeSubmit:u,useAPIKey:d,username:f,verify:m}=t,{permissions:h}=De(),[p,g]=FW(c),b=Et(AW),v=Et(TW),x=Ut(),{i18n:y,t:C}=k(),{docPermissions:S,isEditing:w,isInitializing:D}=Ee(),{config:_}=H(),{routes:A,serverURL:F}=_,{api:R}=A,I=!r||typeof r=="object"&&r.enableFields===!0,E=l||D,T=S?.fields===!0?!0:S?.fields?.enableAPIKey,$=l||T===!0||T&&typeof T=="object"&&!T?.update,j=l||T!==!0&&!T?.update,N=T===!0||T?.read,P;e:{let z=h?.collections?.[n];if(z){P=!!("unlock"in z&&z.unlock);break e}P=!1}let L=P,V;e[0]!==v||e[1]!==u||e[2]!==C?(V=z=>{z?(u(!0),v({type:"UPDATE",errorMessage:C("validation:required"),path:"password",valid:!1}),v({type:"UPDATE",errorMessage:C("validation:required"),path:"confirm-password",valid:!1})):(u(!1),v({type:"REMOVE",path:"password"}),v({type:"REMOVE",path:"confirm-password"})),g(z)},e[0]=v,e[1]=u,e[2]=C,e[3]=V):V=e[3];let M=V,O;e[4]!==R||e[5]!==n||e[6]!==s||e[7]!==y||e[8]!==i||e[9]!==F||e[10]!==C||e[11]!==f?(O=async()=>{let z=`${F}${R}/${n}/unlock`;(await fetch(z,{body:JSON.stringify(i&&f?{username:f}:{email:s}),credentials:"include",headers:{"Accept-Language":y.language,"Content-Type":"application/json"},method:"post"})).status===200?me.success(C("authentication:successfullyUnlocked")):me.error(C("authentication:failedToUnlock"))},e[4]=R,e[5]=n,e[6]=s,e[7]=y,e[8]=i,e[9]=F,e[10]=C,e[11]=f,e[12]=O):O=e[12];let B=O,G,X;if(e[13]!==x?(G=()=>{x||g(!1)},X=[x],e[13]=x,e[14]=G,e[15]=X):(G=e[14],X=e[15]),DW(G,X),r&&!I&&!d)return null;let Z;e[16]!==o?(Z=[jf,o].filter(Boolean),e[16]=o,e[17]=Z):Z=e[17];let te=Z.join(" "),U;if(e[18]!==$||e[19]!==N||e[20]!==p||e[21]!==n||e[22]!==r||e[23]!==E||e[24]!==S?.fields||e[25]!==b?.value||e[26]!==j||e[27]!==I||e[28]!==M||e[29]!==L||e[30]!==w||e[31]!==i||e[32]!==a||e[33]!==l||e[34]!==c||e[35]!==C||e[36]!==te||e[37]!==B||e[38]!==d||e[39]!==m){let z;e[41]!==$||e[42]!==N||e[43]!==n||e[44]!==E||e[45]!==b?.value||e[46]!==j||e[47]!==C||e[48]!==d?(z=d&&un("div",{className:`${jf}__api-key`,children:N&&yu(_W,{children:[un(mr,{field:{name:"enableAPIKey",admin:{disabled:E,readOnly:j},label:C("authentication:enableAPIKey")},path:"enableAPIKey",schemaPath:`${n}.enableAPIKey`}),un(vD,{enabled:!!b?.value,readOnly:$})]})}),e[41]=$,e[42]=N,e[43]=n,e[44]=E,e[45]=b?.value,e[46]=j,e[47]=C,e[48]=d,e[49]=z):z=e[49];let le;e[50]!==n||e[51]!==E||e[52]!==w||e[53]!==l||e[54]!==C||e[55]!==m?(le=m&&w&&un(mr,{field:{name:"_verified",admin:{disabled:E,readOnly:l},label:C("authentication:verified")},path:"_verified",schemaPath:`${n}._verified`}),e[50]=n,e[51]=E,e[52]=w,e[53]=l,e[54]=C,e[55]=m,e[56]=le):le=e[56],U=yu("div",{className:te,children:[I&&yu(RW.Fragment,{children:[un(ev,{loginWithUsername:i,operation:a,permissions:S?.fields,readOnly:l,t:C}),(p||c)&&(!r||!I)&&yu("div",{className:`${jf}__changing-password`,children:[un(Qc,{autoComplete:"new-password",field:{name:"password",label:C("authentication:newPassword"),required:!0},indexPath:"",parentPath:"",parentSchemaPath:"",path:"password",schemaPath:"password"}),un(qc,{disabled:l})]}),yu("div",{className:`${jf}__controls`,children:[p&&!c&&un(ne,{buttonStyle:"secondary",disabled:E,onClick:()=>M(!1),size:"medium",children:C("general:cancel")}),!p&&!c&&!r&&un(ne,{buttonStyle:"secondary",disabled:E,id:"change-password",onClick:()=>M(!0),size:"medium",children:C("authentication:changePassword")}),a==="update"&&L&&un(ne,{buttonStyle:"secondary",disabled:E,onClick:()=>void B(),size:"medium",children:C("authentication:forceUnlock")})]})]}),z,le]}),e[18]=$,e[19]=N,e[20]=p,e[21]=n,e[22]=r,e[23]=E,e[24]=S?.fields,e[25]=b?.value,e[26]=j,e[27]=I,e[28]=M,e[29]=L,e[30]=w,e[31]=i,e[32]=a,e[33]=l,e[34]=c,e[35]=C,e[36]=te,e[37]=B,e[38]=d,e[39]=m,e[40]=U}else U=e[40];return U};function AW(t){let[e]=t;return e&&e?.enableAPIKey||null}function TW(t){return t[1]}import{c as EW}from"react/compiler-runtime";import{getTranslation as PW}from"@payloadcms/translations";import{formatAdminURL as nv}from"payload/shared";import{useEffect as NW}from"react";var sv=t=>{let e=EW(20),{id:o,collectionSlug:n,globalSlug:r,pluralLabel:s,useAsTitle:i}=t,a=t?.view||void 0,{isEditing:l,isInitializing:c,title:u}=Ee(),{isEntityVisible:d}=Z1(),f;e[0]!==n||e[1]!==r||e[2]!==d?(f=d({collectionSlug:n,globalSlug:r}),e[0]=n,e[1]=r,e[2]=d,e[3]=f):f=e[3];let m=f,{setStepNav:h}=jn(),{i18n:p,t:g}=k(),{config:b}=H(),{routes:v}=b,{admin:x}=v,y,C;return e[4]!==x||e[5]!==n||e[6]!==r||e[7]!==p||e[8]!==o||e[9]!==l||e[10]!==c||e[11]!==m||e[12]!==s||e[13]!==h||e[14]!==g||e[15]!==u||e[16]!==i||e[17]!==a?(y=()=>{let S=[];c||(n?(S.push({label:PW(s,p),url:m?nv({adminRoute:x,path:`/collections/${n}`}):void 0}),l?S.push({label:i&&i!=="id"&&u||`${o}`,url:m?nv({adminRoute:x,path:`/collections/${n}/${o}`}):void 0}):S.push({label:g("general:createNew")})):r&&S.push({label:u,url:m?nv({adminRoute:x,path:`/globals/${r}`}):void 0}),a&&S.push({label:a}),h(S))},C=[h,c,l,s,o,i,x,g,p,u,n,r,a,m],e[4]=x,e[5]=n,e[6]=r,e[7]=p,e[8]=o,e[9]=l,e[10]=c,e[11]=m,e[12]=s,e[13]=h,e[14]=g,e[15]=u,e[16]=i,e[17]=a,e[18]=y,e[19]=C):(y=e[18],C=e[19]),NW(y,C),null};import{c as LW}from"react/compiler-runtime";import{useEffect as $W,useRef as kW}from"react";var iv=t=>{let e=LW(13),{collectionConfig:o,config:n,fallback:r,globalConfig:s}=t,i=o?.admin?.useAsTitle,a;e[0]!==i?(a=b=>{let[v]=b;return i&&v&&v?.[i]||null},e[0]=i,e[1]=a):a=e[1];let l=Et(a),c=kW(!1),{i18n:u}=k(),{setDocumentTitle:d}=Ee(),f=n?.admin?.dateFormat,m;e[2]!==o||e[3]!==f||e[4]!==r||e[5]!==l||e[6]!==s||e[7]!==u?(m=dr({collectionConfig:o,data:{id:""},dateFormat:f,fallback:typeof l=="string"?l:typeof l=="number"?String(l):l?.value||r,globalConfig:s,i18n:u}),e[2]=o,e[3]=f,e[4]=r,e[5]=l,e[6]=s,e[7]=u,e[8]=m):m=e[8];let h=m,p,g;return e[9]!==d||e[10]!==h?(p=()=>{if(!c.current){c.current=!0;return}d(h)},g=[d,h],e[9]=d,e[10]=h,e[11]=p,e[12]=g):(p=e[11],g=e[12]),$W(p,g),null};var Mf="collection-edit";function WW({BeforeDocumentControls:t,Description:e,PreviewButton:o,PublishButton:n,SaveButton:r,SaveDraftButton:s,Upload:i}){let{id:a,action:l,AfterDocument:c,AfterFields:u,apiURL:d,BeforeFields:f,collectionSlug:m,currentEditor:h,disableActions:p,disableCreate:g,disableLeaveWithoutSaving:b,docPermissions:v,documentIsLocked:x,getDocPermissions:y,getDocPreferences:C,globalSlug:S,hasPublishPermission:w,hasSavePermission:D,incrementVersionCount:_,initialState:A,isEditing:F,isInitializing:R,lastUpdateTime:I,redirectAfterCreate:E,redirectAfterDelete:T,redirectAfterDuplicate:$,savedDocumentData:j,setCurrentEditor:N,setDocumentIsLocked:P,unlockDocument:L,updateDocumentEditor:V,updateSavedDocumentData:M}=Ee(),{clearDoc:O,drawerSlug:B,onDelete:G,onDuplicate:X,onSave:Z}=ac(),te=!!B,{refreshCookieAsync:U,user:z}=De(),{config:le,config:{admin:{user:J},routes:{admin:ce}},getEntityConfig:re}=H(),q=re({collectionSlug:m}),pe=re({globalSlug:S}),he=ct(),Re=jW(),ge=OW(),{reportUpdate:Ve}=fi(),{resetUploadEdits:Q}=Ws(),{getFormState:Le}=Dt(),{startRouteTransition:_e}=st(),ae=lv(null),se=lv(null),Y=ge.get("locale"),ie=q?.slug||pe?.slug,de=m&&!a?"create":"update",Ce=q?q.auth:void 0,ze=q?q.upload:void 0,$e=q||pe,ot=$e?.lockDocuments!==void 0?$e?.lockDocuments:!0,Xe=ot!==!1,Qt=(typeof ot=="object"?ot.duration:300)*1e3,Ge=!!(q?.versions?.drafts&&q?.versions?.drafts?.autosave||pe?.versions?.drafts&&pe?.versions?.drafts?.autosave),Je=typeof b<"u"?!b:!Ge,[Ye,xt]=Of(!1),[jt,gt]=Of(!1),[qe,Tt]=Of(Date.now()),be=I+Qt,K=Date.now()>be,W=lv({hasShownLockedModal:!1,isLocked:!1,user:null}),ee=[Mf,(a||S)&&`${Mf}--is-editing`];S&&ee.push(`global-edit--${S}`),m&&ee.push(`collection-edit--${m}`);let fe=GW(()=>[ie],[ie]),[Ae,Ne]=Of(()=>!!(de==="create"&&Ce&&!Ce.disableLocalStrategy)),we=av(lt=>{P(!0);let fo=typeof W.current?.user=="object"?W.current?.user?.id:W.current?.user;if(lt){let ro=typeof lt.user=="string"||typeof lt.user=="number"?lt.user:lt.user.id;(!W.current||ro!==fo)&&(fo===z.id&&ro!==z.id&&(gt(!0),W.current.hasShownLockedModal=!0),W.current={hasShownLockedModal:W.current?.hasShownLockedModal||!1,isLocked:!0,user:lt.user},N(lt.user))}},[N,P,z?.id]),We=av(async lt=>{let fo=or(se),ro=lt?.doc||lt?.result;if(Ve({id:a,entitySlug:ie,updatedAt:ro?.updatedAt||new Date().toISOString()}),z&&m===J&&a===z.id&&U(),_(),typeof M=="function"&&M(ro||{}),typeof Z=="function"){let ko=a?"update":"create";Z({...lt,operation:ko,updatedAt:ko==="update"?new Date().toISOString():ro?.updatedAt||new Date().toISOString()})}if(!F&&he<2&&E!==!1){let ko=MW({adminRoute:ce,path:`/collections/${m}/${ro?.id}${Y?`?locale=${Y}`:""}`});_e(()=>Re.push(ko))}else Q();if(await y(lt),(a||S)&&!Ge){let ko=await C(),{state:ke}=await Le({id:a,collectionSlug:m,data:ro,docPermissions:v,docPreferences:ko,globalSlug:S,operation:de,renderAllFields:!0,returnLockStatus:!1,schemaPath:fe.join("."),signal:fo.signal,skipValidation:!0});return Xe&&P(!1),se.current=null,ke}},[Ve,a,ie,z,m,J,_,M,Z,F,he,y,S,Ge,U,ce,Y,Re,Q,C,Le,v,de,fe,Xe,P,_e,E]),Kt=av(async({formState:lt,submitted:fo})=>{let ro=or(ae),ko=Date.now(),ke=ko-qe,po=Xe&&ke>=1e4;po&&Tt(ko);let Xo=await C(),{lockedState:zt,state:Yr}=await Le({id:a,collectionSlug:m,docPermissions:v,docPreferences:Xo,formState:lt,globalSlug:S,operation:de,skipValidation:!fo,renderAllFields:!1,returnLockStatus:Xe,schemaPath:fe.join("."),signal:ro.signal,updateLastEdited:po});return Xe&&we(zt),ae.current=null,Yr},[a,m,C,Le,S,we,Xe,de,fe,v,qe]);CD(()=>()=>{Xe&&x&&(a||S)&&!["preview","api","versions"].some(fo=>window.location.pathname.includes(fo))&&(typeof W.current?.user=="object"?W.current?.user?.id===z?.id:W.current?.user===z?.id)&&(L(a,m??S),P(!1),N(null)),gt(!1)},[m,S,a,L,z,N,Xe,x,P]),CD(()=>{let lt=ae.current,fo=se.current;return()=>{tr(lt),tr(fo)}},[]);let Ot=x&&h&&(typeof h=="object"?h.id!==z?.id:h!==z?.id)&&!Ye&&!jt&&!W.current?.hasShownLockedModal&&!K;return ir("main",{className:ee.filter(Boolean).join(" "),children:ir(Il,{operation:de,children:yD(An,{action:l,className:`${Mf}__form`,disabled:Ye||R||!D,disableValidationOnSubmit:!Ae,initialState:!R&&A,isDocumentForm:!0,isInitializing:R,method:a?"PATCH":"POST",onChange:[Kt],onSuccess:We,children:[te&&ir(mD,{drawerSlug:B}),Xe&&Ot&&!Ye&&ir(Mb,{handleGoBack:()=>pD({adminRoute:ce,collectionSlug:m,router:Re}),isActive:Ot,onReadOnly:()=>{xt(!0),gt(!1)},onTakeOver:()=>ov(a,m,S,z,!1,V,N,W,Xe),updatedAt:I,user:h}),Xe&&jt&&ir(Ob,{handleBackToDashboard:()=>fD({adminRoute:ce,router:Re}),isActive:jt,onReadOnly:()=>{xt(!0),gt(!1)}}),!Ye&&Je&&ir(Kc,{}),!te&&ir(sv,{collectionSlug:q?.slug,globalSlug:pe?.slug,id:a,pluralLabel:q?.labels?.plural,useAsTitle:q?.admin?.useAsTitle}),ir(iv,{collectionConfig:q,config:le,fallback:he<=1?a?.toString():void 0,globalConfig:pe}),ir(h1,{apiURL:d,BeforeDocumentControls:t,customComponents:{PreviewButton:o,PublishButton:n,SaveButton:r,SaveDraftButton:s},data:j,disableActions:p,disableCreate:g,hasPublishPermission:w,hasSavePermission:D,id:a,isEditing:F,onDelete:G,onDrawerCreateNew:O,onDuplicate:X,onSave:We,onTakeOver:()=>ov(a,m,S,z,!0,V,N,W,Xe,xt),permissions:v,readOnlyForIncomingUser:Ye,redirectAfterDelete:T,redirectAfterDuplicate:$,slug:q?.slug||pe?.slug,user:h}),ir(kc,{AfterFields:u,BeforeFields:f||yD(VW,{children:[Ce&&ir(xD,{className:`${Mf}__auth`,collectionSlug:q.slug,disableLocalStrategy:q.auth?.disableLocalStrategy,email:j?.email,loginWithUsername:Ce?.loginWithUsername,operation:de,readOnly:!D,requirePassword:!a,setValidateBeforeSubmit:Ne,useAPIKey:Ce.useAPIKey,username:j?.username,verify:Ce.verify}),ze&&ir(BW.Fragment,{children:i||ir(wb,{collectionSlug:q.slug,initialState:A,uploadConfig:ze})})]}),Description:e,docPermissions:v,fields:$e.fields,readOnly:Ye||!D,schemaPathSegments:fe}),c]})})})}import{jsx as HW}from"react/jsx-runtime";import"react";var zW="field-diff-label",XW=({children:t})=>HW("div",{className:zW,children:t});export{Hb as Account,MB as ActionsProvider,h7 as AppHeader,Zc as ArrayField,Gp as AuthProvider,Ir as Banner,Nl as BlocksDrawer,Ll as BlocksField,jI as BulkUploadDrawer,Ib as BulkUploadProvider,ne as Button,FD as CalendarIcon,b7 as Card,ih as CheckIcon,mr as CheckboxField,Hs as CheckboxInput,Ze as ChevronIcon,U1 as ClientFunctionProvider,Xb as CloseMenuIcon,fG as CodeBlockIcon,_D as CodeEdiftor,$l as CodeEditorLazy,kl as CodeField,Xs as Collapsible,Ol as CollapsibleField,Wf as ConfigProvider,qc as ConfirmPasswordField,It as ConfirmationModal,Al as CopyIcon,t1 as CopyLocaleData,Oc as CopyToClipboard,w1 as DateCondition,AD as DatePicker,ec as DateTimeField,bh as DefaultBlockImage,uc as DefaultCell,WW as DefaultEditView,fW as DefaultListView,i1 as DeleteMany,h1 as DocumentControls,pb as DocumentEventsProvider,kc as DocumentFields,Sl as DocumentInfoProvider,Mb as DocumentLocked,Ob as DocumentTakeOver,Cn as DragHandleIcon,Pt as Drawer,ur as DrawerToggler,mi as Dropzone,Ns as EditDepthProvider,Rr as EditIcon,b1 as EditMany,hb as EditUpload,ev as EmailAndUsernameFields,oi as EmailField,EG as EntityVisibilityProvider,W1 as ErrorIcon,io as ErrorPill,mG as ExternalLinkIcon,Be as FieldDescription,XW as FieldDiffLabel,He as FieldError,ve as FieldLabel,hm as File,xb as FileDetails,An as Form,K9 as FormLoadingOverlayToggle,Ur as FormSubmit,G8 as FullscreenModal,v1 as GenerateConfirmation,tc as GroupField,Bo as Gutter,Zb as Hamburger,oc as HiddenField,Z8 as HydrateAuthProvider,H1 as InfoIcon,fc as JSONField,mc as JoinField,Kc as LeaveWithoutSaving,ah as LineIcon,no as Link,cp as LinkIcon,N1 as ListControls,pg as ListDrawerContextProvider,k1 as ListHeader,bg as ListQueryProvider,hu as ListSelection,In as LoadingOverlay,i3 as LoadingOverlayToggle,Xp as LocaleProvider,lu as Locked,j1 as LogOutIcon,QV as Logout,Ub as MenuIcon,pG as MinimizeMaximizeIcon,Yo as Modal,dh as MoreIcon,oG as NavGroup,Qb as NavToggler,Fl as NullifyLocaleField,S1 as NumberCondition,pc as NumberField,Il as OperationProvider,zM as OrderableTable,dc as Pagination,J1 as ParamsProvider,Qc as PasswordField,gf as PayloadIcon,O1 as PerPage,vt as Pill,jo as PlusIcon,hc as PointField,ho as Popup,Me as PopupList,zp as PreferencesProvider,a1 as PreviewButton,yb as PreviewSizes,_G as ProgressBar,d1 as PublishButton,L1 as PublishMany,eB as QueryPresetsAccessCell,sB as QueryPresetsColumnField,ZM as QueryPresetsColumnsCell,QM as QueryPresetsWhereCell,cB as QueryPresetsWhereField,vc as RadioGroupField,mt as ReactSelect,R1 as RelationshipCondition,Sc as RelationshipField,cc as RelationshipProvider,Og as RelationshipTable,oe as RenderCustomComponent,KL as RenderDefaultCell,So as RenderFields,B1 as RenderTitle,Ic as RichTextField,QG as RootProvider,o1 as RouteCacheProvider,ap as RouteTransitionProvider,Rc as RowField,dn as RowLabel,np as RowLabelProvider,m1 as SaveButton,f1 as SaveDraftButton,vu as ScrollInfoProvider,C1 as SearchFilter,Pl as SearchIcon,K1 as SearchParamsProvider,vh as SectionTitle,mt as Select,nW as SelectAll,F1 as SelectCondition,_c as SelectField,Sa as SelectInput,Ka as SelectMany,iW as SelectRow,s1 as SelectionProvider,vg as ServerFunctionsProvider,sv as SetDocumentStepNav,iv as SetDocumentTitle,l7 as SetStepNav,St as ShimmerEffect,dG as SortColumn,BM as SortHeader,GM as SortRow,SD as StaggeredShimmers,z1 as SuccessIcon,up as SwapIcon,ib as TabComponent,l1 as Table,sc as TableColumnsProvider,Tc as TabsField,dg as TabsProvider,A1 as TextCondition,di as TextField,lb as TextInput,Ec as TextareaField,cb as TextareaInput,zf as ThemeProvider,Or as Thumbnail,Kl as TimezonePicker,go as Tooltip,wi as Translation,Gf as TranslationProvider,Pc as UIField,$1 as UnpublishMany,wb as Upload,th as UploadEditsProvider,Yc as UploadField,ob as UploadHandlersProvider,tf as UploadInput,Bb as ViewDescription,X1 as WarningIcon,Ys as WatchChildErrors,sh as WatchCondition,q1 as WindowInfoProvider,pt as XIcon,xM as allFieldComponents,ID as defaultTheme,as as documentDrawerBaseClass,ye as fieldBaseClass,QI as fieldComponents,Fc as fieldReducer,jp as formatDrawerSlug,kr as parseSearchParams,me as toast,zb as useActions,xG as useAddClientFunction,ki as useAllFormFields,De as useAuth,Ho as useBulkUpload,MI as useBulkUploadDrawerSlug,Pg as useCellProps,yG as useClientFunctions,qn as useCollapsible,H as useConfig,Jo as useDebounce,Xg as useDebouncedCallback,tb as useDebouncedEffect,Hf as useDelay,wg as useDelayedRender,Jt as useDocumentDrawer,ac as useDocumentDrawerContext,fi as useDocumentEvents,$i as useDocumentForm,Ee as useDocumentInfo,bl as useDrawerSlug,ct as useEditDepth,eo as useEffectEvent,Z1 as useEntityVisibility,Te as useField,Oe as useForm,rp as useFormBackgroundProcessing,Et as useFormFields,Ts as useFormInitializing,Ut as useFormModified,lr as useFormProcessing,Xt as useFormSubmitted,yi as useHotkey,mn as useIntersect,ai as useListDrawer,en as useListDrawerContext,Rt as useListQuery,_g as useListRelationships,Pe as useLocale,ue as useModal,Ii as useNav,Qo as useOperation,jG as useParams,EM as usePayloadAPI,Fo as usePreferences,$M as useResize,On as useRouteCache,st as useRouteTransition,HD as useRowLabel,bu as useScrollInfo,qG as useSearchParams,oo as useSelection,Dt as useServerFunctions,jn as useStepNav,pa as useTableColumns,RD as useTheme,Bs as useThrottledEffect,k as useTranslation,Ws as useUploadEdits,Dc as useUploadHandlers,Eb as useUseTitleField,Lu as useWatchForm,Q1 as useWindowInfo,je as withCondition};
|
|
53
|
+
`]))),bw=function(e,o){var n=e.isFocused,r=e.size,s=e.theme,i=s.colors,a=s.spacing.baseUnit;return Re({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},o?{}:{color:n?i.neutral60:i.neutral20,padding:a*2})},Bh=function(e){var o=e.delay,n=e.offset;return Te("span",{css:Xl({animation:"".concat(f5," 1s ease-in-out ").concat(o,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},p5=function(e){var o=e.innerProps,n=e.isRtl,r=e.size,s=r===void 0?4:r,i=Vo(e,l5);return Te("div",Ie({},Nt(Re(Re({},i),{},{innerProps:o,isRtl:n,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),o),Te(Bh,{delay:0,offset:n}),Te(Bh,{delay:160,offset:!0}),Te(Bh,{delay:320,offset:!n}))},vw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.theme,i=s.colors,a=s.borderRadius,l=s.spacing;return Re({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},o?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},h5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Te("div",Ie({ref:s},Nt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),o)},g5=h5,b5=["data"],xw=function(e,o){var n=e.theme.spacing;return o?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},v5=function(e){var o=e.children,n=e.cx,r=e.getStyles,s=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return Te("div",Ie({},Nt(e,"group",{group:!0}),l),Te(i,Ie({},a,{selectProps:d,theme:u,getStyles:r,getClassNames:s,cx:n}),c),Te("div",null,o))},yw=function(e,o){var n=e.theme,r=n.colors,s=n.spacing;return Re({label:"group",cursor:"default",display:"block"},o?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},x5=function(e){var o=XC(e);o.data;var n=Vo(o,b5);return Te("div",Ie({},Nt(e,"groupHeading",{"group-heading":!0}),n))},y5=v5,C5=["innerRef","isDisabled","isHidden","inputClassName"],Cw=function(e,o){var n=e.isDisabled,r=e.value,s=e.theme,i=s.spacing,a=s.colors;return Re(Re({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},w5),o?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},ww={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},w5={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Re({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},ww)},S5=function(e){return Re({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},ww)},I5=function(e){var o=e.cx,n=e.value,r=XC(e),s=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,c=Vo(r,C5);return Te("div",Ie({},Nt(e,"input",{"input-container":!0}),{"data-value":n||""}),Te("input",Ie({className:o({input:!0},l),ref:s,style:S5(a),disabled:i},c)))},R5=I5,Sw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors;return Re({label:"multiValue",display:"flex",minWidth:0},o?{}:{backgroundColor:i.neutral10,borderRadius:s/2,margin:r.baseUnit/2})},Iw=function(e,o){var n=e.theme,r=n.borderRadius,s=n.colors,i=e.cropWithEllipsis;return Re({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},o?{}:{borderRadius:r/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Rw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors,a=e.isFocused;return Re({alignItems:"center",display:"flex"},o?{}:{borderRadius:s/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},_w=function(e){var o=e.children,n=e.innerProps;return Te("div",n,o)},_5=_w,D5=_w;function F5(t){var e=t.children,o=t.innerProps;return Te("div",Ie({role:"button"},o),e||Te(Hh,{size:14}))}var A5=function(e){var o=e.children,n=e.components,r=e.data,s=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,c=n.Container,u=n.Label,d=n.Remove;return Te(c,{data:r,innerProps:Re(Re({},Nt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),s),selectProps:l},Te(u,{data:r,innerProps:Re({},Nt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},o),Te(d,{data:r,innerProps:Re(Re({},Nt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(o||"option")},a),selectProps:l}))},T5=A5,Dw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return Re({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},o?{}:{backgroundColor:s?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:s?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:s?l.primary:l.primary50}})},E5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.innerRef,a=e.innerProps;return Te("div",Ie({},Nt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":s}),{ref:i,"aria-disabled":n},a),o)},P5=E5,Fw=function(e,o){var n=e.theme,r=n.spacing,s=n.colors;return Re({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},o?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},N5=function(e){var o=e.children,n=e.innerProps;return Te("div",Ie({},Nt(e,"placeholder",{placeholder:!0}),n),o)},L5=N5,Aw=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing,i=r.colors;return Re({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},o?{}:{color:n?i.neutral40:i.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},$5=function(e){var o=e.children,n=e.isDisabled,r=e.innerProps;return Te("div",Ie({},Nt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),o)},k5=$5,co={ClearIndicator:d5,Control:g5,DropdownIndicator:u5,DownChevron:mw,CrossIcon:Hh,Group:y5,GroupHeading:x5,IndicatorsContainer:i5,IndicatorSeparator:m5,Input:R5,LoadingIndicator:p5,Menu:K6,MenuList:e5,MenuPortal:r5,LoadingMessage:o5,NoOptionsMessage:t5,MultiValue:T5,MultiValueContainer:_5,MultiValueLabel:D5,MultiValueRemove:F5,Option:P5,Placeholder:L5,SelectContainer:n5,SingleValue:k5,ValueContainer:s5},Tw=function(e){return Re(Re({},co),e.components)};var Ew=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function j5(t,e){return!!(t===e||Ew(t)&&Ew(e))}function O5(t,e){if(t.length!==e.length)return!1;for(var o=0;o<t.length;o++)if(!j5(t[o],e[o]))return!1;return!0}function Pw(t,e){e===void 0&&(e=O5);var o=null;function n(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];if(o&&o.lastThis===this&&e(r,o.lastArgs))return o.lastResult;var i=t.apply(this,r);return o={lastResult:i,lastArgs:r,lastThis:this},i}return n.clear=function(){o=null},n}var B5={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},V5=function(e){return Te("span",Ie({css:B5},e))},Nw=V5,G5={guidance:function(e){var o=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,s=e.context,i=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(o?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var o=e.action,n=e.label,r=n===void 0?"":n,s=e.labels,i=e.isDisabled;switch(o){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var o=e.context,n=e.focused,r=e.options,s=e.label,i=s===void 0?"":s,a=e.selectValue,l=e.isDisabled,c=e.isSelected,u=e.isAppleDevice,d=function(p,g){return p&&p.length?"".concat(p.indexOf(g)+1," of ").concat(p.length):""};if(o==="value"&&a)return"value ".concat(i," focused, ").concat(d(a,n),".");if(o==="menu"&&u){var f=l?" disabled":"",m="".concat(c?" selected":"").concat(f);return"".concat(i).concat(m,", ").concat(d(r,n),".")}return""},onFilter:function(e){var o=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(o?" for search term "+o:"",".")}},W5=function(e){var o=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,m=l.inputValue,h=l.isMulti,p=l.isOptionDisabled,g=l.isSearchable,b=l.menuIsOpen,v=l.options,x=l.screenReaderStatus,y=l.tabSelectsValue,C=l.isLoading,S=l["aria-label"],w=l["aria-live"],D=Zl(function(){return Re(Re({},G5),d||{})},[d]),_=Zl(function(){var T="";if(o&&D.onChange){var $=o.option,j=o.options,N=o.removedValue,P=o.removedValues,L=o.value,V=function(te){return Array.isArray(te)?null:te},M=N||$||V(L),O=M?f(M):"",B=j||P||void 0,G=B?B.map(f):[],X=Re({isDisabled:M&&p(M,a),label:O,labels:G},o);T=D.onChange(X)}return T},[o,D,p,a,f]),A=Zl(function(){var T="",$=n||r,j=!!(n&&a&&a.includes(n));if($&&D.onFocus){var N={focused:$,label:f($),isDisabled:p($,a),isSelected:j,options:s,context:$===n?"menu":"value",selectValue:a,isAppleDevice:u};T=D.onFocus(N)}return T},[n,r,f,p,D,s,a,u]),F=Zl(function(){var T="";if(b&&v.length&&!C&&D.onFilter){var $=x({count:s.length});T=D.onFilter({inputValue:m,resultsMessage:$})}return T},[s,m,b,D,v,x,C]),R=o?.action==="initial-input-focus",I=Zl(function(){var T="";if(D.guidance){var $=r?"value":b?"menu":"input";T=D.guidance({"aria-label":S,context:$,isDisabled:n&&p(n,a),isMulti:h,isSearchable:g,tabSelectsValue:y,isInitialFocus:R})}return T},[S,n,r,h,p,g,b,D,a,y,R]),E=Te(Uh,null,Te("span",{id:"aria-selection"},_),Te("span",{id:"aria-focused"},A),Te("span",{id:"aria-results"},F),Te("span",{id:"aria-guidance"},I));return Te(Uh,null,Te(Nw,{id:c},R&&E),Te(Nw,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!R&&E))},H5=W5,Yh=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],z5=new RegExp("["+Yh.map(function(t){return t.letters}).join("")+"]","g"),Xw={};for(om=0;om<Yh.length;om++)for(rm=Yh[om],nm=0;nm<rm.letters.length;nm++)Xw[rm.letters[nm]]=rm.base;var rm,nm,om,Uw=function(e){return e.replace(z5,function(o){return Xw[o]})},X5=Pw(Uw),Lw=function(e){return e.replace(/^\s+|\s+$/g,"")},U5=function(e){return"".concat(e.label," ").concat(e.value)},Y5=function(e){return function(o,n){if(o.data.__isNew__)return!0;var r=Re({ignoreCase:!0,ignoreAccents:!0,stringify:U5,trim:!0,matchFrom:"any"},e),s=r.ignoreCase,i=r.ignoreAccents,a=r.stringify,l=r.trim,c=r.matchFrom,u=l?Lw(n):n,d=l?Lw(a(o)):a(o);return s&&(u=u.toLowerCase(),d=d.toLowerCase()),i&&(u=X5(u),d=Uw(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},Z5=["innerRef"];function J5(t){var e=t.innerRef,o=Vo(t,Z5),n=QC(o,"onExited","in","enter","exit","appear");return Te("input",Ie({ref:e},n,{css:Xl({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var q5=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Q5(t){var e=t.isEnabled,o=t.onBottomArrive,n=t.onBottomLeave,r=t.onTopArrive,s=t.onTopLeave,i=ma(!1),a=ma(!1),l=ma(0),c=ma(null),u=rs(function(g,b){if(c.current!==null){var v=c.current,x=v.scrollTop,y=v.scrollHeight,C=v.clientHeight,S=c.current,w=b>0,D=y-C-x,_=!1;D>b&&i.current&&(n&&n(g),i.current=!1),w&&a.current&&(s&&s(g),a.current=!1),w&&b>D?(o&&!i.current&&o(g),S.scrollTop=y,_=!0,i.current=!0):!w&&-b>x&&(r&&!a.current&&r(g),S.scrollTop=0,_=!0,a.current=!0),_&&q5(g)}},[o,n,r,s]),d=rs(function(g){u(g,g.deltaY)},[u]),f=rs(function(g){l.current=g.changedTouches[0].clientY},[]),m=rs(function(g){var b=l.current-g.changedTouches[0].clientY;u(g,b)},[u]),h=rs(function(g){if(g){var b=JC?{passive:!1}:!1;g.addEventListener("wheel",d,b),g.addEventListener("touchstart",f,b),g.addEventListener("touchmove",m,b)}},[m,f,d]),p=rs(function(g){g&&(g.removeEventListener("wheel",d,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",m,!1))},[m,f,d]);return zw(function(){if(e){var g=c.current;return h(g),function(){p(g)}}},[e,h,p]),function(g){c.current=g}}var $w=["boxSizing","height","overflow","paddingRight","position"],kw={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function jw(t){t.cancelable&&t.preventDefault()}function Ow(t){t.stopPropagation()}function Mw(){var t=this.scrollTop,e=this.scrollHeight,o=t+this.offsetHeight;t===0?this.scrollTop=1:o===e&&(this.scrollTop=t-1)}function Bw(){return"ontouchstart"in window||navigator.maxTouchPoints}var Vw=!!(typeof window<"u"&&window.document&&window.document.createElement),Jl=0,da={capture:!1,passive:!1};function K5(t){var e=t.isEnabled,o=t.accountForScrollbars,n=o===void 0?!0:o,r=ma({}),s=ma(null),i=rs(function(l){if(Vw){var c=document.body,u=c&&c.style;if(n&&$w.forEach(function(h){var p=u&&u[h];r.current[h]=p}),n&&Jl<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,m=window.innerWidth-f+d||0;Object.keys(kw).forEach(function(h){var p=kw[h];u&&(u[h]=p)}),u&&(u.paddingRight="".concat(m,"px"))}c&&Bw()&&(c.addEventListener("touchmove",jw,da),l&&(l.addEventListener("touchstart",Mw,da),l.addEventListener("touchmove",Ow,da))),Jl+=1}},[n]),a=rs(function(l){if(Vw){var c=document.body,u=c&&c.style;Jl=Math.max(Jl-1,0),n&&Jl<1&&$w.forEach(function(d){var f=r.current[d];u&&(u[d]=f)}),c&&Bw()&&(c.removeEventListener("touchmove",jw,da),l&&(l.removeEventListener("touchstart",Mw,da),l.removeEventListener("touchmove",Ow,da)))}},[n]);return zw(function(){if(e){var l=s.current;return i(l),function(){a(l)}}},[e,i,a]),function(l){s.current=l}}var eN=function(e){var o=e.target;return o.ownerDocument.activeElement&&o.ownerDocument.activeElement.blur()},tN={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oN(t){var e=t.children,o=t.lockEnabled,n=t.captureEnabled,r=n===void 0?!0:n,s=t.onBottomArrive,i=t.onBottomLeave,a=t.onTopArrive,l=t.onTopLeave,c=Q5({isEnabled:r,onBottomArrive:s,onBottomLeave:i,onTopArrive:a,onTopLeave:l}),u=K5({isEnabled:o}),d=function(m){c(m),u(m)};return Te(Uh,null,o&&Te("div",{onClick:eN,css:tN}),e(d))}var rN={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},nN=function(e){var o=e.name,n=e.onFocus;return Te("input",{required:!0,name:o,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:rN,value:"",onChange:function(){}})},sN=nN;function Zh(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function iN(){return Zh(/^iPhone/i)}function Yw(){return Zh(/^Mac/i)}function aN(){return Zh(/^iPad/i)||Yw()&&navigator.maxTouchPoints>1}function lN(){return iN()||aN()}function cN(){return Yw()||lN()}var uN=function(e){return e.label},Jh=function(e){return e.label},qh=function(e){return e.value},dN=function(e){return!!e.isDisabled},mN={clearIndicator:hw,container:lw,control:vw,dropdownIndicator:pw,group:xw,groupHeading:yw,indicatorsContainer:uw,indicatorSeparator:gw,input:Cw,loadingIndicator:bw,loadingMessage:iw,menu:ew,menuList:rw,menuPortal:aw,multiValue:Sw,multiValueLabel:Iw,multiValueRemove:Rw,noOptionsMessage:sw,option:Dw,placeholder:Fw,singleValue:Aw,valueContainer:cw};var fN={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},pN=4,Zw=4,hN=38,gN=Zw*2,bN={baseUnit:Zw,controlHeight:hN,menuGutter:gN},zh={borderRadius:pN,colors:fN,spacing:bN},vN={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Wh(),captureMenuScroll:!Wh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Y5(),formatGroupLabel:uN,getOptionLabel:Jh,getOptionValue:qh,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:dN,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!YC(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var o=e.count;return"".concat(o," result").concat(o!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Gw(t,e,o,n){var r=Qw(t,e,o),s=Kw(t,e,o),i=qw(t,e),a=im(t,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:i,value:a,index:n}}function sm(t,e){return t.options.map(function(o,n){if("options"in o){var r=o.options.map(function(i,a){return Gw(t,i,e,a)}).filter(function(i){return Hw(t,i)});return r.length>0?{type:"group",data:o,options:r,index:n}:void 0}var s=Gw(t,o,e,n);return Hw(t,s)?s:void 0}).filter(qC)}function Jw(t){return t.reduce(function(e,o){return o.type==="group"?e.push.apply(e,ts(o.options.map(function(n){return n.data}))):e.push(o.data),e},[])}function Ww(t,e){return t.reduce(function(o,n){return n.type==="group"?o.push.apply(o,ts(n.options.map(function(r){return{data:r.data,id:"".concat(e,"-").concat(n.index,"-").concat(r.index)}}))):o.push({data:n.data,id:"".concat(e,"-").concat(n.index)}),o},[])}function xN(t,e){return Jw(sm(t,e))}function Hw(t,e){var o=t.inputValue,n=o===void 0?"":o,r=e.data,s=e.isSelected,i=e.label,a=e.value;return(!t2(t)||!s)&&e2(t,{label:i,value:a,data:r},n)}function yN(t,e){var o=t.focusedValue,n=t.selectValue,r=n.indexOf(o);if(r>-1){var s=e.indexOf(o);if(s>-1)return o;if(r<e.length)return e[r]}return null}function CN(t,e){var o=t.focusedOption;return o&&e.indexOf(o)>-1?o:e[0]}var Xh=function(e,o){var n,r=(n=e.find(function(s){return s.data===o}))===null||n===void 0?void 0:n.id;return r||null},qw=function(e,o){return e.getOptionLabel(o)},im=function(e,o){return e.getOptionValue(o)};function Qw(t,e,o){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,o):!1}function Kw(t,e,o){if(o.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,o);var n=im(t,e);return o.some(function(r){return im(t,r)===n})}function e2(t,e,o){return t.filterOption?t.filterOption(e,o):!0}var t2=function(e){var o=e.hideSelectedOptions,n=e.isMulti;return o===void 0?n:o},wN=1,ql=function(t){zy(o,t);var e=Uy(o);function o(n){var r;if(Gy(this,o),r=e.call(this,n),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=cN(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,c){var u=r.props,d=u.onChange,f=u.name;c.name=f,r.ariaOnChange(l,c),d(l,c)},r.setValue=function(l,c,u){var d=r.props,f=d.closeMenuOnSelect,m=d.isMulti,h=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:h}),f&&(r.setState({inputIsHiddenAfterUpdate:!m}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:c,option:u})},r.selectOption=function(l){var c=r.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,m=r.state.selectValue,h=d&&r.isOptionSelected(l,m),p=r.isOptionDisabled(l,m);if(h){var g=r.getOptionValue(l);r.setValue(m.filter(function(b){return r.getOptionValue(b)!==g}),"deselect-option",l)}else if(!p)d?r.setValue([].concat(ts(m),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}u&&r.blurInput()},r.removeValue=function(l){var c=r.props.isMulti,u=r.state.selectValue,d=r.getOptionValue(l),f=u.filter(function(h){return r.getOptionValue(h)!==d}),m=Ks(c,f,f[0]||null);r.onChange(m,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(Ks(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,c=r.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=Ks(l,d,d[0]||null);u&&r.onChange(f,{action:"pop-value",removedValue:u})},r.getFocusedOptionId=function(l){return Xh(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return Ww(sm(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return zC.apply(void 0,[r.props.classNamePrefix].concat(c))},r.getOptionLabel=function(l){return qw(r.props,l)},r.getOptionValue=function(l){return im(r.props,l)},r.getStyles=function(l,c){var u=r.props.unstyled,d=mN[l](c,u);d.boxSizing="border-box";var f=r.props.styles[l];return f?f(d,c):d},r.getClassNames=function(l,c){var u,d;return(u=(d=r.props.classNames)[l])===null||u===void 0?void 0:u.call(d,c)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return Tw(r.props)},r.buildCategorizedOptions=function(){return sm(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Jw(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,c){r.setState({ariaSelection:Re({value:l},c)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var c=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():c&&r.openMenu("first"):(c&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var c=r.props,u=c.isMulti,d=c.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!u}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Yl(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var c=l.touches,u=c&&c.item(0);u&&(r.initialTouchX=u.clientX,r.initialTouchY=u.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var c=l.touches,u=c&&c.item(0);if(u){var d=Math.abs(u.clientX-r.initialTouchX),f=Math.abs(u.clientY-r.initialTouchY),m=5;r.userIsDragging=d>m||f>m}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var c=r.props.inputValue,u=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(u,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var c=r.getFocusableOptions(),u=c.indexOf(l);r.setState({focusedOption:l,focusedOptionId:u>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return t2(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var c=r.props,u=c.isMulti,d=c.backspaceRemovesValue,f=c.escapeClearsValue,m=c.inputValue,h=c.isClearable,p=c.isDisabled,g=c.menuIsOpen,b=c.onKeyDown,v=c.tabSelectsValue,x=c.openMenuOnFocus,y=r.state,C=y.focusedOption,S=y.focusedValue,w=y.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!u||m)return;r.focusValue("previous");break;case"ArrowRight":if(!u||m)return;r.focusValue("next");break;case"Delete":case"Backspace":if(m)return;if(S)r.removeValue(S);else{if(!d)return;u?r.popValue():h&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!g||!v||!C||x&&r.isOptionSelected(C,w))return;r.selectOption(C);break;case"Enter":if(l.keyCode===229)break;if(g){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":g?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:m}),r.onMenuClose()):h&&f&&r.clearValue();break;case" ":if(m)return;if(!g){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":g?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":g?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!g)return;r.focusOption("pageup");break;case"PageDown":if(!g)return;r.focusOption("pagedown");break;case"Home":if(!g)return;r.focusOption("first");break;case"End":if(!g)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++wN),r.state.selectValue=ua(n.value),n.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),a=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=i[a],r.state.focusedOptionId=Xh(s,i[a])}return r}return Hy(o,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Gh(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var s=this.props,i=s.isDisabled,a=s.menuIsOpen,l=this.state.isFocused;(l&&!i&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Gh(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,s){this.props.onInputChange(r,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var s=this,i=this.state,a=i.selectValue,l=i.isFocused,c=this.buildFocusableOptions(),u=r==="first"?0:c.length-1;if(!this.props.isMulti){var d=c.indexOf(a[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[u],focusedOptionId:this.getFocusedOptionId(c[u])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(r){var s=this.state,i=s.selectValue,a=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var c=i.length-1,u=-1;if(i.length){switch(r){case"previous":l===0?u=0:l===-1?u=c:u=l-1;break;case"next":l>-1&&l<c&&(u=l+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:i[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(i);i||(c=-1),r==="up"?l=c>0?c-1:a.length-1:r==="down"?l=(c+1)%a.length:r==="pageup"?(l=c-s,l<0&&(l=0)):r==="pagedown"?(l=c+s,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(zh):Re(Re({},zh),this.props.theme):zh}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,u=this.setValue,d=this.props,f=d.isMulti,m=d.isRtl,h=d.options,p=this.hasValue();return{clearValue:r,cx:s,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:f,isRtl:m,options:h,selectOption:c,selectProps:d,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,s=r.isClearable,i=r.isMulti;return s===void 0?i:s}},{key:"isOptionDisabled",value:function(r,s){return Qw(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return Kw(this.props,r,s)}},{key:"filterOption",value:function(r,s){return e2(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:i,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,s=r.isDisabled,i=r.isSearchable,a=r.inputId,l=r.inputValue,c=r.tabIndex,u=r.form,d=r.menuIsOpen,f=r.required,m=this.getComponents(),h=m.Input,p=this.state,g=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,x=a||this.getElementId("input"),y=Re(Re(Re({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?ut.createElement(h,Ie({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:s,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:u,type:"text",value:l},y)):ut.createElement(J5,Ie({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ul,onFocus:this.onInputFocus,disabled:s,tabIndex:c,inputMode:"none",form:u,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),i=s.MultiValue,a=s.MultiValueContainer,l=s.MultiValueLabel,c=s.MultiValueRemove,u=s.SingleValue,d=s.Placeholder,f=this.commonProps,m=this.props,h=m.controlShouldRenderValue,p=m.isDisabled,g=m.isMulti,b=m.inputValue,v=m.placeholder,x=this.state,y=x.selectValue,C=x.focusedValue,S=x.isFocused;if(!this.hasValue()||!h)return b?null:ut.createElement(d,Ie({},f,{key:"placeholder",isDisabled:p,isFocused:S,innerProps:{id:this.getElementId("placeholder")}}),v);if(g)return y.map(function(D,_){var A=D===C,F="".concat(r.getOptionLabel(D),"-").concat(r.getOptionValue(D));return ut.createElement(i,Ie({},f,{components:{Container:a,Label:l,Remove:c},isFocused:A,isDisabled:p,key:F,index:_,removeProps:{onClick:function(){return r.removeValue(D)},onTouchEnd:function(){return r.removeValue(D)},onMouseDown:function(I){I.preventDefault()}},data:D}),r.formatOptionLabel(D,"value"))});if(b)return null;var w=y[0];return ut.createElement(u,Ie({},f,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!this.isClearable()||!s||l||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return ut.createElement(s,Ie({},i,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!s||!c)return null;var d={"aria-hidden":"true"};return ut.createElement(s,Ie({},i,{innerProps:d,isDisabled:l,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,i=r.IndicatorSeparator;if(!s||!i)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return ut.createElement(i,Ie({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return ut.createElement(s,Ie({},i,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),i=s.Group,a=s.GroupHeading,l=s.Menu,c=s.MenuList,u=s.MenuPortal,d=s.LoadingMessage,f=s.NoOptionsMessage,m=s.Option,h=this.commonProps,p=this.state.focusedOption,g=this.props,b=g.captureMenuScroll,v=g.inputValue,x=g.isLoading,y=g.loadingMessage,C=g.minMenuHeight,S=g.maxMenuHeight,w=g.menuIsOpen,D=g.menuPlacement,_=g.menuPosition,A=g.menuPortalTarget,F=g.menuShouldBlockScroll,R=g.menuShouldScrollIntoView,I=g.noOptionsMessage,E=g.onMenuScrollToTop,T=g.onMenuScrollToBottom;if(!w)return null;var $=function(O,B){var G=O.type,X=O.data,Z=O.isDisabled,te=O.isSelected,U=O.label,z=O.value,ce=p===X,J=Z?void 0:function(){return r.onOptionHover(X)},ue=Z?void 0:function(){return r.selectOption(X)},re="".concat(r.getElementId("option"),"-").concat(B),q={id:re,onClick:ue,onMouseMove:J,onMouseOver:J,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:te};return ut.createElement(m,Ie({},h,{innerProps:q,data:X,isDisabled:Z,isSelected:te,key:re,label:U,type:G,value:z,isFocused:ce,innerRef:ce?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(O.data,"menu"))},j;if(this.hasOptions())j=this.getCategorizedOptions().map(function(M){if(M.type==="group"){var O=M.data,B=M.options,G=M.index,X="".concat(r.getElementId("group"),"-").concat(G),Z="".concat(X,"-heading");return ut.createElement(i,Ie({},h,{key:X,data:O,options:B,Heading:a,headingProps:{id:Z,data:M.data},label:r.formatGroupLabel(M.data)}),M.options.map(function(te){return $(te,"".concat(G,"-").concat(te.index))}))}else if(M.type==="option")return $(M,"".concat(M.index))});else if(x){var N=y({inputValue:v});if(N===null)return null;j=ut.createElement(d,h,N)}else{var P=I({inputValue:v});if(P===null)return null;j=ut.createElement(f,h,P)}var L={minMenuHeight:C,maxMenuHeight:S,menuPlacement:D,menuPosition:_,menuShouldScrollIntoView:R},V=ut.createElement(ow,Ie({},h,L),function(M){var O=M.ref,B=M.placerProps,G=B.placement,X=B.maxHeight;return ut.createElement(l,Ie({},h,L,{innerRef:O,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:x,placement:G}),ut.createElement(oN,{captureEnabled:b,onTopArrive:E,onBottomArrive:T,lockEnabled:F},function(Z){return ut.createElement(c,Ie({},h,{innerRef:function(U){r.getMenuListRef(U),Z(U)},innerProps:{role:"listbox","aria-multiselectable":h.isMulti,id:r.getElementId("listbox")},isLoading:x,maxHeight:X,focusedOption:p}),j)}))});return A||_==="fixed"?ut.createElement(u,Ie({},h,{appendTo:A,controlElement:this.controlRef,menuPlacement:D,menuPosition:_}),V):V}},{key:"renderFormField",value:function(){var r=this,s=this.props,i=s.delimiter,a=s.isDisabled,l=s.isMulti,c=s.name,u=s.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!a)return ut.createElement(sN,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(i){var f=d.map(function(p){return r.getOptionValue(p)}).join(i);return ut.createElement("input",{name:c,type:"hidden",value:f})}else{var m=d.length>0?d.map(function(p,g){return ut.createElement("input",{key:"i-".concat(g),name:c,type:"hidden",value:r.getOptionValue(p)})}):ut.createElement("input",{name:c,type:"hidden",value:""});return ut.createElement("div",null,m)}else{var h=d[0]?this.getOptionValue(d[0]):"";return ut.createElement("input",{name:c,type:"hidden",value:h})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,i=s.ariaSelection,a=s.focusedOption,l=s.focusedValue,c=s.isFocused,u=s.selectValue,d=this.getFocusableOptions();return ut.createElement(H5,Ie({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:c,selectValue:u,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,i=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,c=this.props,u=c.className,d=c.id,f=c.isDisabled,m=c.menuIsOpen,h=this.state.isFocused,p=this.commonProps=this.getCommonProps();return ut.createElement(a,Ie({},p,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:h}),this.renderLiveRegion(),ut.createElement(s,Ie({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:h,menuIsOpen:m}),ut.createElement(l,Ie({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),ut.createElement(i,Ie({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,s){var i=s.prevProps,a=s.clearFocusValueOnUpdate,l=s.inputIsHiddenAfterUpdate,c=s.ariaSelection,u=s.isFocused,d=s.prevWasFocused,f=s.instancePrefix,m=r.options,h=r.value,p=r.menuIsOpen,g=r.inputValue,b=r.isMulti,v=ua(h),x={};if(i&&(h!==i.value||m!==i.options||p!==i.menuIsOpen||g!==i.inputValue)){var y=p?xN(r,v):[],C=p?Ww(sm(r,v),"".concat(f,"-option")):[],S=a?yN(s,v):null,w=CN(s,y),D=Xh(C,w);x={selectValue:v,focusedOption:w,focusedOptionId:D,focusableOptionsWithIds:C,focusedValue:S,clearFocusValueOnUpdate:!1}}var _=l!=null&&r!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},A=c,F=u&&d;return u&&!F&&(A={value:Ks(b,v,v[0]||null),options:v,action:"initial-input-focus"},F=!d),c?.action==="initial-input-focus"&&(A=null),Re(Re(Re({},x),_),{},{prevProps:r,ariaSelection:A,prevWasFocused:F})}}]),o}(M5);ql.defaultProps=vN;import"react-dom";var IN=SN(function(t,e){var o=Ad(t);return o2.createElement(ql,Ie({ref:e},o))}),r2=IN;import*as a2 from"react";import{forwardRef as DN}from"react";import{useMemo as n2,useCallback as RN}from"react";var _N=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],s2=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),s=String(n.getOptionValue(o)).toLowerCase(),i=String(n.getOptionLabel(o)).toLowerCase();return s===r||i===r},Qh={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,o,n,r){return!(!e||o.some(function(s){return s2(e,s,r)})||n.some(function(s){return s2(e,s,r)}))},getNewOptionData:function(e,o){return{label:o,value:e,__isNew__:!0}}};function i2(t){var e=t.allowCreateWhileLoading,o=e===void 0?!1:e,n=t.createOptionPosition,r=n===void 0?"last":n,s=t.formatCreateLabel,i=s===void 0?Qh.formatCreateLabel:s,a=t.isValidNewOption,l=a===void 0?Qh.isValidNewOption:a,c=t.getNewOptionData,u=c===void 0?Qh.getNewOptionData:c,d=t.onCreateOption,f=t.options,m=f===void 0?[]:f,h=t.onChange,p=Vo(t,_N),g=p.getOptionValue,b=g===void 0?qh:g,v=p.getOptionLabel,x=v===void 0?Jh:v,y=p.inputValue,C=p.isLoading,S=p.isMulti,w=p.value,D=p.name,_=n2(function(){return l(y,ua(w),m,{getOptionValue:b,getOptionLabel:x})?u(y,i(y)):void 0},[i,u,x,b,y,l,m,w]),A=n2(function(){return(o||!C)&&_?r==="first"?[_].concat(ts(m)):[].concat(ts(m),[_]):m},[o,r,C,_,m]),F=RN(function(R,I){if(I.action!=="select-option")return h(R,I);var E=Array.isArray(R)?R:[R];if(E[E.length-1]===_){if(d)d(y);else{var T=u(y,y),$={action:"create-option",name:D,option:T};h(Ks(S,[].concat(ts(ua(w)),[T]),T),$)}return}h(R,I)},[u,y,S,D,_,d,h,w]);return Re(Re({},p),{},{options:A,onChange:F})}import"react-dom";var FN=DN(function(t,e){var o=Ad(t),n=i2(o);return a2.createElement(ql,Ie({ref:e},n))}),l2=FN;import{jsx as c2}from"react/jsx-runtime";import"react";var u2="clear-indicator",Kh=t=>{let{clearValue:e,innerProps:{ref:o,...n}}=t;return c2("div",{className:u2,ref:typeof o=="string"?null:o,...n,onKeyDown:r=>{r.key==="Enter"&&(e(),r.stopPropagation())},role:"button",tabIndex:0,children:c2(pt,{className:`${u2}__icon`})})};import{jsx as d2}from"react/jsx-runtime";import AN from"react";var eg=t=>{let{children:e,innerProps:o,selectProps:{customProps:{disableKeyDown:n,disableMouseDown:r}={}}={}}=t;return d2(AN.Fragment,{children:d2(co.Control,{...t,innerProps:{...o,onKeyDown:s=>{if(n){s.stopPropagation();let i=new CustomEvent("bypassKeyDown",{detail:s});document.dispatchEvent(i)}},onMouseDown:s=>{r||o.onMouseDown(s)}},children:e})})};import{jsx as m2}from"react/jsx-runtime";import"react";var f2="dropdown-indicator",tg=t=>{let{innerProps:{ref:e,...o}}=t;return m2("button",{className:f2,ref:e,...o,onKeyDown:n=>{n.key==="Enter"&&(n.key=" ")},type:"button",children:m2(Ze,{className:`${f2}__icon`})})};import{jsx as p2}from"react/jsx-runtime";import TN from"react";var og=t=>p2(TN.Fragment,{children:p2(co.Input,{...t,"aria-activedescendant":void 0})});import{c as EN}from"react/compiler-runtime";import{jsx as h2}from"react/jsx-runtime";import PN from"react";var g2="multi-value";function rg(t,e){return typeof e=="function"?e(t):t.value}var ng=t=>{let e=EN(26),{className:o,data:n,innerProps:r,isDisabled:s,selectProps:i}=t,a;e[0]!==i?(a=i===void 0?{}:i,e[0]=i,e[1]=a):a=e[1];let{customProps:l,getOptionValue:c,isSortable:u}=a,d;e[2]!==l?(d=l===void 0?{}:l,e[2]=l,e[3]=d):d=e[3];let{disableMouseDown:f}=d,m;e[4]!==n||e[5]!==c?(m=rg(n,c),e[4]=n,e[5]=c,e[6]=m):m=e[6];let h=!u,p;e[7]!==m||e[8]!==h?(p={id:m,disabled:h},e[7]=m,e[8]=h,e[9]=p):p=e[9];let{attributes:g,isDragging:b,listeners:v,setNodeRef:x,transform:y}=Oi(p),C=!s&&u&&"draggable",S=b&&`${g2}--is-dragging`,w;e[10]!==o||e[11]!==C||e[12]!==S?(w=[g2,o,C,S].filter(Boolean),e[10]=o,e[11]=C,e[12]=S,e[13]=w):w=e[13];let D=w.join(" "),_;if(e[14]!==g||e[15]!==D||e[16]!==f||e[17]!==r||e[18]!==u||e[19]!==v||e[20]!==t||e[21]!==x||e[22]!==y){let A;e[24]!==f?(A=F=>{f||F.stopPropagation()},e[24]=f,e[25]=A):A=e[25],_=h2(PN.Fragment,{children:h2(co.MultiValue,{...t,className:D,innerProps:{...u?{...g,...v}:{},...r,onMouseDown:A,ref:x,style:u?{transform:y,...g?.style}:{}}})}),e[14]=g,e[15]=D,e[16]=f,e[17]=r,e[18]=u,e[19]=v,e[20]=t,e[21]=x,e[22]=y,e[23]=_}else _=e[23];return _};import{jsx as b2}from"react/jsx-runtime";import"react";var v2="multi-value-label",sg=t=>{let{data:e,selectProps:{customProps:{draggableProps:o,editableProps:n}={}}={}}=t,r=`${v2}__text`;return b2("div",{className:v2,children:b2(co.MultiValueLabel,{...t,innerProps:{className:r,...n&&n(e,r,t.selectProps)||{},...o||{}}})})};import{c as NN}from"react/compiler-runtime";import{jsx as x2,jsxs as LN}from"react/jsx-runtime";import $N from"react";var ig="multi-value-remove",ag=t=>{let e=NN(12),{innerProps:o}=t,{className:n,onClick:r,onTouchEnd:s}=o,[i,a]=$N.useState(!1),{t:l}=k(),c;if(e[0]!==n||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==l){let u=l("general:remove"),d;e[6]!==n?(d=[ig,n].filter(Boolean),e[6]=n,e[7]=d):d=e[7];let f;e[8]!==r?(f=p=>{a(!1),r(p)},e[8]=r,e[9]=f):f=e[9];let m,h;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),h=()=>a(!1),e[10]=m,e[11]=h):(m=e[10],h=e[11]),c=LN("button",{"aria-label":u,className:d.join(" "),onClick:f,onKeyDown:kN,onMouseDown:jN,onMouseEnter:m,onMouseLeave:h,onTouchEnd:s,type:"button",children:[x2(go,{className:`${ig}__tooltip`,show:i,children:l("general:remove")}),x2(pt,{className:`${ig}__icon`})]}),e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=l,e[5]=c}else c=e[5];return c};function kN(t){t.key==="Enter"&&t.stopPropagation()}function jN(t){return t.stopPropagation()}import{jsx as y2}from"react/jsx-runtime";import ON from"react";var MN="react-select--single-value",lg=t=>{let{children:e,className:o}=t;return y2(ON.Fragment,{children:y2(co.SingleValue,{...t,className:[MN,o].filter(Boolean).join(" "),children:e})})};import{jsx as C2}from"react/jsx-runtime";import"react";var BN="value-container",cg=t=>{let{selectProps:{customProps:e}={}}=t;return C2("div",{className:BN,ref:e?.droppableRef,children:C2(co.ValueContainer,{...t})})};var WN=t=>({label:t,value:t}),I2=t=>{let{i18n:e,t:o}=k(),[n,r]=S2.useState(""),s=GN(),[i,a]=S2.useState(!1);VN(()=>{a(!0)},[]);let{className:l,components:c,customProps:u,disabled:d=!1,filterOption:f=void 0,getOptionValue:m,isClearable:h=!0,isCreatable:p,isLoading:g,isSearchable:b=!0,noOptionsMessage:v=()=>o("general:noOptions"),numberOnly:x=!1,onChange:y,onMenuClose:C,onMenuOpen:S,options:w,placeholder:D=o("general:selectValue"),showError:_,value:A}=t,F=()=>o("general:loading")+"...",R=[l,"react-select",_&&"react-select--error"].filter(Boolean).join(" "),I={menu:T=>({...T,zIndex:void 0})};if(!i)return ei(St,{height:"calc(var(--base) * 2 + 2px)"});if(!p)return ei(r2,{captureMenuScroll:!0,customProps:u,isLoading:g,placeholder:w2(D,e),...t,className:R,classNamePrefix:"rs",components:{ClearIndicator:Kh,Control:eg,DropdownIndicator:tg,Input:og,MultiValue:ng,MultiValueLabel:sg,MultiValueRemove:ag,SingleValue:lg,ValueContainer:cg,...c},filterOption:f,getOptionValue:m,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:F,menuPlacement:"auto",noOptionsMessage:v,onChange:y,onMenuClose:C,onMenuOpen:S,options:w,styles:I,unstyled:!0,value:A});let E=T=>{if(x===!0){let $=["Tab","Escape","Backspace","Enter","ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],j=!/\D/.test(T.key),N=$.includes(T.key);if(!j&&!N){T.preventDefault();return}}if(!(!A||!n||n.trim()==="")&&!(f&&!f(null,n)))switch(T.key){case"Enter":case"Tab":y([...A,WN(n)]),r(""),T.preventDefault();break;default:break}};return ei(l2,{captureMenuScroll:!0,isLoading:g,placeholder:w2(D,e),...t,className:R,classNamePrefix:"rs",components:{ClearIndicator:Kh,Control:eg,DropdownIndicator:tg,Input:og,MultiValue:ng,MultiValueLabel:sg,MultiValueRemove:ag,SingleValue:lg,ValueContainer:cg,...c},filterOption:f,inputValue:n,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:F,menuPlacement:"auto",noOptionsMessage:v,onChange:y,onInputChange:T=>r(T),onKeyDown:E,onMenuClose:C,onMenuOpen:S,options:w,styles:I,unstyled:!0,value:A})},HN=t=>{let{getOptionValue:e,onChange:o,value:n}=t,r=[];return n&&(r=(Array.isArray(n)?n:[n]).map(s=>rg(s,e))),ei(cr,{className:"react-select-container",ids:r,onDragEnd:({moveFromIndex:s,moveToIndex:i})=>{let a=n;n&&Array.isArray(n)&&(a=zu(n,s,i)),o(a)},children:ei(I2,{...t})})},mt=t=>{let{isMulti:e,isSortable:o}=t;return e&&o?ei(HN,{...t}):ei(I2,{...t})};var Ql=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e});var Kl=t=>{let{id:e,onChange:o,options:n,required:r,selectedTimezone:s}=t,{t:i}=k(),a=Ql(n),l=XN(()=>a.find(c=>(typeof c=="string"?c:c.value)===(s||"UTC")),[a,s]);return zN("div",{className:"timezone-picker-wrapper",children:[R2(xe,{htmlFor:e,label:`${i("general:timezone")} ${r?"*":""}`,required:r,unstyled:!0}),R2(mt,{className:"timezone-picker",inputId:e,isClearable:!0,isCreatable:!1,onChange:c=>{o&&o(c?.value||"")},options:a,value:l})]})};var F2="date-time-field",YN=t=>{let{field:e,field:{admin:{className:o,date:n,description:r,placeholder:s}={},label:i,localized:a,required:l,timezone:c},path:u,readOnly:d,validate:f}=t,m=n?.pickerAppearance||"default",h=Intl.DateTimeFormat().resolvedOptions().timeZone,{config:p}=H(),{i18n:g}=k(),{dispatchFields:b,setModified:v}=Oe(),x=ug((O,B)=>{if(typeof f=="function")return f(O,{...B,required:l})},[f,l]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:D}={},disabled:_,path:A,setValue:F,showError:R,value:I}=Ee({potentiallyStalePath:u,validate:x}),E=A+"_tz",T=Et(([O,B])=>O?.[E]),$=p.admin.timezones.supportedTimezones,j=["dayOnly","default","monthOnly"].includes(m),N=T?.value,P=D2(()=>{if(c&&N&&h&&I){let O=Mt.tz(N),B=Mt.tz(h),G=new Mt(I).withTimeZone(N),X=Ar(G,O);return Ar(X,B).toISOString()}return I},[c,N,I,h]),L=D2(()=>rt(e),[e]),V=ug(O=>{if(!(d||_))if(c&&N&&O){let B=Mt.tz(N);if(j){let G=O.getTimezoneOffset()/60,X=O.getHours()+G;O.setHours(X);let Z=Ar(O,B);F(Z.toISOString()||null)}else{let G=new Mt(O),X=Ar(G,B);F(X.toISOString()||null)}}else F(O?.toISOString()||null)},[d,_,c,N,j,F]),M=ug(O=>{E&&(b({type:"UPDATE",path:E,value:O}),v(!0))},[b,v,E]);return _2("div",{className:[Ce,F2,o,R&&`${F2}--has-error`,(d||_)&&"read-only"].filter(Boolean).join(" "),style:L,children:[ns(oe,{CustomComponent:D,Fallback:ns(xe,{label:i,localized:a,required:l})}),_2("div",{className:`${Ce}__wrap`,id:`field-${A.replace(/\./g,"__")}`,children:[ns(oe,{CustomComponent:w,Fallback:ns(He,{path:A,showError:R})}),C,ns(Qi,{...n,onChange:V,overrides:{...n?.overrides},placeholder:UN(s,g),readOnly:d||_,value:P}),c&&$.length>0&&ns(Kl,{id:`${A}-timezone-picker`,onChange:M,options:$,required:l,selectedTimezone:N}),y]}),ns(oe,{CustomComponent:S,Fallback:ns(Be,{description:r,path:A})})]})},ec=je(YN);import{jsx as ti,jsxs as A2}from"react/jsx-runtime";import{getTranslation as ZN}from"@payloadcms/translations";import{useCallback as JN,useMemo as qN}from"react";var QN=t=>{let{field:e,field:{admin:{autoComplete:o,className:n,description:r,placeholder:s}={},label:i,localized:a,required:l}={},path:c,readOnly:u,validate:d}=t,{i18n:f}=k(),m=JN((_,A)=>{if(typeof d=="function")return d(_,{...A,required:l})},[d,l]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},disabled:x,path:y,setValue:C,showError:S,value:w}=Ee({potentiallyStalePath:c,validate:m}),D=qN(()=>rt(e),[e]);return A2("div",{className:[Ce,"email",n,S&&"error",(u||x)&&"read-only"].filter(Boolean).join(" "),style:D,children:[ti(oe,{CustomComponent:v,Fallback:ti(xe,{label:i,localized:a,path:y,required:l})}),A2("div",{className:`${Ce}__wrap`,children:[ti(oe,{CustomComponent:b,Fallback:ti(He,{path:y,showError:S})}),p,ti("input",{autoComplete:o,disabled:u||x,id:`field-${y.replace(/\./g,"__")}`,name:y,onChange:C,placeholder:ZN(s,f),required:l,type:"email",value:w||""}),h]}),ti(oe,{CustomComponent:g,Fallback:ti(Be,{description:r,path:y})})]})},oi=je(QN);import{jsx as ss,jsxs as am}from"react/jsx-runtime";import{getTranslation as l9}from"@payloadcms/translations";import{useMemo as c9}from"react";import{jsx as KN}from"react/jsx-runtime";import{createContext as e9,use as t9}from"react";var T2=e9(!1),E2=({children:t,withinRow:e=!0})=>KN(T2,{value:e,children:t}),P2=()=>t9(T2);import{jsx as o9}from"react/jsx-runtime";import{createContext as r9,use as n9}from"react";var N2=r9(!1),dg=({children:t,withinTab:e=!0})=>o9(N2,{value:e,children:t}),L2=()=>n9(N2);import{jsx as s9}from"react/jsx-runtime";import{createContext as i9,use as a9}from"react";var $2=i9(!1),k2=({children:t,withinGroup:e=!0})=>s9($2,{value:e,children:t}),j2=()=>a9($2);var kr="group-field",u9=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,hideGutter:s}={},fields:i,label:a},path:l,permissions:c,readOnly:u,schemaPath:d}=t,f=d??o,{i18n:m}=k(),{isWithinCollapsible:h}=qn(),p=j2(),g=P2(),b=L2(),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Label:C}={},errorPaths:S}=Ee({path:l}),w=Xt(),D=S.length,_=w&&D>0,A=!(h||p||g),F=c9(()=>rt(e),[e]);return am("div",{className:[Ce,kr,A&&`${kr}--top-level`,h&&`${kr}--within-collapsible`,p&&`${kr}--within-group`,g&&`${kr}--within-row`,b&&`${kr}--within-tab`,!s&&p&&`${kr}--gutter`,_&&`${kr}--has-error`,n].filter(Boolean).join(" "),id:`field-${l?.replace(/\./g,"__")}`,style:F,children:[ss(k2,{children:am("div",{className:`${kr}__wrap`,children:[!!(C||y||a||_)&&am("div",{className:`${kr}__header`,children:[!!(C||y||a)&&am("header",{children:[ss(oe,{CustomComponent:C,Fallback:ss("h3",{className:`${kr}__title`,children:ss(xe,{as:"span",label:l9(a,m),localized:!1,path:l,required:!1})})}),ss(oe,{CustomComponent:y,Fallback:ss(Be,{description:r,path:l})})]}),_&&ss(io,{count:D,i18n:m,withMessage:!0})]}),x,ss(So,{fields:i,margins:"small",parentIndexPath:"",parentPath:l,parentSchemaPath:f,permissions:c===!0?c:c?.fields,readOnly:u})]})}),v]})};var tc=je(u9);import{c as d9}from"react/compiler-runtime";import{jsx as m9}from"react/jsx-runtime";import{useEffect as f9}from"react";var p9=t=>{let e=d9(12),{disableModifyingForm:o,path:n,value:r}=t,s=o===void 0?!0:o,i;e[0]!==n?(i={potentiallyStalePath:n},e[0]=n,e[1]=i):i=e[1];let{path:a,setValue:l,value:c}=Ee(i),u,d;e[2]!==s||e[3]!==l||e[4]!==r?(u=()=>{r!==void 0&&l(r,s)},d=[r,l,s],e[2]=s,e[3]=l,e[4]=r,e[5]=u,e[6]=d):(u=e[5],d=e[6]),f9(u,d);let f=`field-${a?.replace(/\./g,"__")}`,m=c||"",h;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==m?(h=m9("input",{id:f,name:a,onChange:l,type:"hidden",value:m}),e[7]=a,e[8]=l,e[9]=f,e[10]=m,e[11]=h):h=e[11],h},oc=je(p9);var Mg=Ds(fg(),1);import{jsx as si,jsxs as c$}from"react/jsx-runtime";import{flattenTopLevelFields as u$}from"payload/shared";import{useMemo as H3}from"react";import{jsx as to,jsxs as ni}from"react/jsx-runtime";import{getTranslation as kg}from"@payloadcms/translations";import{hoistQueryParamsToAnd as l$,transformColumnsToPreferences as G3}from"payload/shared";import{Fragment as W3,useCallback as Sm,useEffect as jg,useState as Rn}from"react";import{c as v9}from"react/compiler-runtime";import{useInsertionEffect as x9,useRef as y9}from"react";function eo(t){let e=v9(4),o=y9(t),n,r;e[0]!==t?(n=()=>{o.current=t},r=[t],e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),x9(n,r);let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(...i)=>{let a=i,l=o.current;return l(...a)},e[3]=s):s=e[3],s}import{jsx as Y2}from"react/jsx-runtime";import{useRouter as R9,useSearchParams as _9}from"next/navigation.js";import{isNumber as D9,transformColumnsToSearchParams as F9}from"payload/shared";import*as gg from"qs-esm";import A9,{useCallback as nc,useEffect as T9,useMemo as E9,useRef as P9,useState as Z2}from"react";import{jsx as C9}from"react/jsx-runtime";import{createContext as w9,use as S9}from"react";var H2=w9({}),pg=({children:t,...e})=>C9(H2,{value:{isInDrawer:!!e.drawerSlug,...e},children:t}),en=()=>{let t=S9(H2);if(!t)throw new Error("useListDrawerContext must be used within a ListDrawerContextProvider");return t};import*as z2 from"qs-esm";function jr(t){let e=t.toString();return z2.parse(e,{depth:10,ignoreQueryPrefix:!0})}import{createContext as X2,use as I9}from"react";var hg=X2({}),Rt=()=>I9(hg),U2=X2(!1);var bg=({children:t,collectionSlug:e,columns:o,data:n,defaultLimit:r,defaultSort:s,listPreferences:i,modifySearchParams:a,onQueryChange:l,orderableFieldName:c})=>{"use no memo";let u=R9(),d=_9(),{startRouteTransition:f}=st(),[m,h]=Z2(!1),p=E9(()=>jr(d),[d]),g=P9({});g.current.modified=m;let{onQueryChange:b}=en(),[v,x]=Z2(()=>a?p:{limit:String(r),sort:s}),y=nc(async(F,R)=>{h(R!==void 0?R:!0);let I="page"in F?F.page:v?.page;("where"in F||"search"in F)&&(I="1");let E={columns:"columns"in F?F.columns:v.columns,limit:"limit"in F?F.limit:v?.limit??String(r),page:I,preset:"preset"in F?F.preset:v?.preset,search:"search"in F?F.search:v?.search,sort:"sort"in F?F.sort:v?.sort??s,where:"where"in F?F.where:v?.where};a?f(()=>u.replace(`${gg.stringify({...E,columns:JSON.stringify(E.columns)},{addQueryPrefix:!0})}`)):(typeof b=="function"||typeof l=="function")&&(b||l)(E),x(E)},[v?.columns,v?.limit,v?.page,v?.search,v?.sort,v?.where,v?.preset,f,r,s,a,b,l,u]),C=nc(async F=>{await y({page:String(F)})},[y]),S=A9.useCallback(async F=>{await y({limit:String(F),page:"1"})},[y]),w=nc(async F=>{await y({search:F===""?void 0:F})},[y]),D=nc(async F=>{await y({sort:F})},[y]),_=nc(async F=>{await y({where:F})},[y]),A=eo(()=>{let F=!1,R={...v||{}};D9(r)&&!("limit"in v)&&(R.limit=String(r),F=!0),s&&!("sort"in v)&&(R.sort=s,F=!0),o&&i?.columns&&!("columns"in v)&&(R.columns=F9(o),F=!0),F&&(x(R),window.history.replaceState(null,"",`?${gg.stringify({...R,columns:JSON.stringify(R.columns)})}`))});return T9(()=>{a&&A()},[s,r,a,o]),Y2(hg,{value:{collectionSlug:e,data:n,handlePageChange:C,handlePerPageChange:S,handleSearchChange:w,handleSortChange:D,handleWhereChange:_,orderableFieldName:c,query:v,refineListData:y,setModified:h,...g.current},children:Y2(U2,{value:m,children:t})})};import{jsx as N9}from"react/jsx-runtime";import L9,{createContext as $9,useCallback as fa}from"react";var J2=$9(void 0),Dt=()=>{let t=L9.use(J2);if(t===void 0)throw new Error("useServerFunctions must be used within a ServerFunctionsProvider");return t},vg=({children:t,serverFunction:e})=>{if(!e)throw new Error("ServerFunctionsProvider requires a serverFunction prop");let o=fa(async l=>await e({name:"render-document-slots",args:l}),[e]),n=fa(async l=>{let{signal:c,...u}=l;try{if(!c?.aborted){let f=await e({name:"schedule-publish",args:{...u}});if(!c?.aborted)return f}}catch(f){console.error(f)}let d=`Error scheduling ${u.type}`;return u.doc&&(d+=` for document with ID ${u.doc.value} in collection ${u.doc.relationTo}`),{error:""}},[e]),r=fa(async l=>{let{signal:c,...u}=l||{};try{if(!c?.aborted){let d=await e({name:"form-state",args:{fallbackLocale:!1,...u}});if(!c?.aborted)return d}}catch(d){console.error(d)}return{state:null}},[e]),s=fa(async l=>{let{signal:c,...u}=l||{};try{if(!c?.aborted){let d=await e({name:"table-state",args:{fallbackLocale:!1,...u}});if(!c?.aborted)return d}}catch(d){console.error(d)}},[e]),i=fa(async l=>{let{signal:c,...u}=l||{};try{return await e({name:"render-document",args:{fallbackLocale:!1,...u}})}catch(d){console.error(d)}},[e]),a=fa(async l=>{let{signal:c,...u}=l||{};try{let d=await e({name:"copy-data-from-locale",args:u});if(!c?.aborted)return d}catch(d){console.error(d)}},[e]);return N9(J2,{value:{copyDataFromLocale:a,getDocumentSlots:o,getFormState:r,getTableState:s,renderDocument:i,schedulePublish:n,serverFunction:e},children:t})};import{jsx as O9}from"react/jsx-runtime";import{transformColumnsToSearchParams as q2}from"payload/shared";import Q2,{startTransition as K2,useCallback as yg,useRef as M9}from"react";import{createContext as k9,use as j9}from"react";var xg=k9({}),pa=()=>j9(xg);var sc=({children:t,collectionSlug:e,columnState:o,LinkedCellOverride:n})=>{let{getEntityConfig:r}=H(),{query:s,refineListData:i}=Rt(),{admin:{defaultColumns:a}={}}=r({collectionSlug:e}),[l,c]=Q2.useOptimistic(o,(p,g)=>g),u=M9({}),d=yg(async p=>{let g=(l||[]).map(b=>b.accessor===p?{...b,active:!b.active}:b);K2(()=>{c(g)}),await i({columns:q2(g)})},[i,l,c]),f=yg(async p=>{let{fromIndex:g,toIndex:b}=p,v=[...l||[]],[x]=v.splice(g,1);v.splice(b,0,x),K2(()=>{c(v)}),await i({columns:q2(v)})},[l,i,c]),m=yg(async p=>{let g=s.columns;p.forEach(b=>{let v=g.findIndex(x=>b===x);v!==void 0&&g[v][0]==="-"&&(g[v]=b.slice(1))}),await i({columns:g})},[s,i]),h=Q2.useCallback(async()=>{await m(a)},[a,m]);return O9(xg,{value:{columns:l,LinkedCellOverride:n,moveColumn:f,resetColumnsState:h,setActiveColumns:m,toggleColumn:d,...u.current},children:t})};import{jsx as ic}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as B9,fieldIsID as V9}from"payload/shared";import{useId as G9,useMemo as W9}from"react";var Cg="column-selector",cm=({collectionSlug:t})=>{let{columns:e,moveColumn:o,toggleColumn:n}=pa(),r=G9(),s=ct(),i=W9(()=>e.filter(a=>!(B9(a.field)&&!V9(a.field))&&!a?.field?.admin?.disableListColumn),[e]);return e?ic(cr,{className:Cg,ids:i.map(a=>a?.accessor),onDragEnd:({moveFromIndex:a,moveToIndex:l})=>{o({fromIndex:a,toIndex:l})},children:i.map((a,l)=>{let{accessor:c,active:u,field:d}=a;return ic(vt,{alignIcon:"left","aria-checked":u,className:[`${Cg}__column`,u&&`${Cg}__column--active`].filter(Boolean).join(" "),draggable:!0,icon:u?ic(pt,{}):ic(jo,{}),id:c,onClick:()=>{n(c)},children:a.CustomLabel??ic(xe,{label:d&&"label"in d&&d.label,unstyled:!0})},`${t}-${d&&"name"in d?d?.name:l}${s?`-${s}-`:""}${r}`)})}):null};import{c as m3}from"react/compiler-runtime";import{jsx as mm}from"react/jsx-runtime";import{createElement as sL}from"react";import{useEffect as iL,useId as aL,useState as lL}from"react";import{c as H9}from"react/compiler-runtime";import{useState as z9}from"react";var um=t=>{let e=H9(3),{getEntityConfig:o}=H(),n;e[0]!==o||e[1]!==t?(n=()=>t?(typeof t=="string"?[t]:t).map(i=>o({collectionSlug:i})):[],e[0]=o,e[1]=t,e[2]=n):n=e[2];let[r]=z9(n);return r};import{jsx as c3}from"react/jsx-runtime";import rL,{useCallback as lc,useEffect as u3,useRef as nL,useState as Rg}from"react";import{c as Ig}from"react/compiler-runtime";import{jsx as ri,jsxs as s3}from"react/jsx-runtime";import{getTranslation as q9}from"@payloadcms/translations";import Q9 from"react";import{c as U9}from"react/compiler-runtime";import{jsx as Y9,jsxs as Z9}from"react/jsx-runtime";import o3,{createContext as J9}from"react";import{c as X9}from"react/compiler-runtime";import*as is from"react";var wg=t=>{let e=X9(13),{delayBeforeShow:o,inTimeout:n,minShowTime:r,outTimeout:s,show:i}=t,a=n+r+s,[l,c]=Hf(o),[u,d]=is.useState(!1),[f,m]=is.useState(!1),h=is.useRef(0),p=is.useRef(void 0),g;e[0]!==s?(g=()=>{m(!0),p.current=setTimeout(()=>{d(!1),m(!1)},s)},e[0]=s,e[1]=g):g=e[1];let b=g,v,x;e[2]!==l||e[3]!==u||e[4]!==i||e[5]!==a||e[6]!==b?(v=()=>{let C=l&&!u&&i,S=u&&!i;if(C)h.current=Date.now(),d(!0);else if(S){let w=Date.now()-h.current,D=a-w;clearTimeout(p.current),p.current=setTimeout(b,Math.max(0,D))}},x=[u,i,b,a,l],e[2]=l,e[3]=u,e[4]=i,e[5]=a,e[6]=b,e[7]=v,e[8]=x):(v=e[7],x=e[8]),is.useEffect(v,x);let y;return e[9]!==u||e[10]!==f||e[11]!==c?(y={isMounted:u,isUnmounting:f,triggerDelayedRender:c},e[9]=u,e[10]=f,e[11]=c,e[12]=y):y=e[12],y};var e3={isLoading:!1,loaders:[],loadingText:"",overlayType:null},t3=(t,e)=>{let o=[...t.loaders],{type:n="fullscreen",key:r="user",loadingText:s}=e.payload;if(e.type==="add")o.push({type:n,key:r,loadingText:s});else if(e.type==="remove"){let a=o.findIndex(l=>l.key===r&&l.type===n);o.splice(a,1)}let i=o?.length>0?o[o.length-1]:null;return{isLoading:!!i,loaders:o,loadingText:i?.loadingText||t?.loadingText,overlayType:i?.type||t?.overlayType}};var Sg=250,r3=J9({isOnScreen:!1,toggleLoadingOverlay:void 0}),n3=t=>{let e=U9(21),{children:o}=t,{t:n}=k(),r;e[0]!==n?(r=n("general:loading"),e[0]=n,e[1]=r):r=e[1];let s=r,[i,a]=o3.useReducer(t3,e3),l;e[2]!==i.isLoading?(l={delayBeforeShow:1e3,inTimeout:Sg,minShowTime:500,outTimeout:Sg,show:i.isLoading},e[2]=i.isLoading,e[3]=l):l=e[3];let{isMounted:c,isUnmounting:u,triggerDelayedRender:d}=wg(l),f;e[4]!==s||e[5]!==d?(f=p=>{let{type:g,isLoading:b,key:v,loadingText:x}=p,y=x===void 0?s:x;b?(d(),a({type:"add",payload:{type:g,key:v,loadingText:y}})):a({type:"remove",payload:{type:g,key:v}})},e[4]=s,e[5]=d,e[6]=f):f=e[6];let m=f,h;if(e[7]!==o||e[8]!==s||e[9]!==c||e[10]!==u||e[11]!==i.loadingText||e[12]!==i.overlayType||e[13]!==m){let p;e[15]!==s||e[16]!==c||e[17]!==u||e[18]!==i.loadingText||e[19]!==i.overlayType?(p=c&&Y9(In,{animationDuration:`${Sg}ms`,loadingText:i.loadingText||s,overlayType:i.overlayType,show:!u}),e[15]=s,e[16]=c,e[17]=u,e[18]=i.loadingText,e[19]=i.overlayType,e[20]=p):p=e[20],h=Z9(r3,{value:{isOnScreen:c,toggleLoadingOverlay:m},children:[p,o]}),e[7]=o,e[8]=s,e[9]=c,e[10]=u,e[11]=i.loadingText,e[12]=i.overlayType,e[13]=m,e[14]=h}else h=e[14];return h},dm=()=>{let t=o3.use(r3);if(t===void 0)throw new Error("useLoadingOverlay must be used within a LoadingOverlayProvider");return t};var Or="loading-overlay",In=t=>{let e=Ig(11),{animationDuration:o,loadingText:n,overlayType:r,show:s}=t,i=s===void 0?!0:s,{t:a}=k(),l=i?`${Or}--entering`:`${Or}--exiting`,c=r?`${Or}--${r}`:"",u;e[0]!==l||e[1]!==c?(u=[Or,l,c].filter(Boolean),e[0]=l,e[1]=c,e[2]=u):u=e[2];let d=u.join(" "),f=o||"500ms",m;if(e[3]!==n||e[4]!==a||e[5]!==d||e[6]!==f){let h;e[8]!==n||e[9]!==a?(h=n||a("general:loading"),e[8]=n,e[9]=a,e[10]=h):h=e[10],m=s3("div",{className:d,style:{animationDuration:f},children:[s3("div",{className:`${Or}__bars`,children:[ri("div",{className:`${Or}__bar`}),ri("div",{className:`${Or}__bar`}),ri("div",{className:`${Or}__bar`}),ri("div",{className:`${Or}__bar`}),ri("div",{className:`${Or}__bar`})]}),ri("span",{className:`${Or}__text`,children:h})]}),e[3]=n,e[4]=a,e[5]=d,e[6]=f,e[7]=m}else m=e[7];return m},i3=t=>{let e=Ig(7),{name:o,type:n,loadingText:r,show:s}=t,i=n===void 0?"fullscreen":n,{toggleLoadingOverlay:a}=dm(),l,c;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==a||e[4]!==i?(l=()=>(a({type:i,isLoading:s,key:o,loadingText:r||void 0}),()=>{a({type:i,isLoading:!1,key:o})}),c=[s,a,o,i,r],e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=i,e[5]=l,e[6]=c):(l=e[5],c=e[6]),Q9.useEffect(l,c),null},K9=t=>{let e=Ig(6),{name:o,type:n,action:r,formIsLoading:s,loadingSuffix:i}=t,a=n===void 0?"fullscreen":n,l=s===void 0?!1:s,c=lr(),{i18n:u,t:d}=k(),m=`${{create:d("general:creating"),loading:d("general:loading"),update:d("general:updating")}[r]} ${i?q9(i,u):""}`,h;return e[0]!==l||e[1]!==c||e[2]!==o||e[3]!==m||e[4]!==a?(h=ri(i3,{loadingText:m.trim(),name:o,show:l||c,type:a}),e[0]=l,e[1]=c,e[2]=o,e[3]=m,e[4]=a,e[5]=h):h=e[5],h};function tr(t){if(t)try{t.abort()}catch{}}function or(t){let e=new AbortController;if(t.current)try{t.current.abort()}catch{}return t.current=e,e}import{jsx as eL}from"react/jsx-runtime";import{createContext as tL,use as oL}from"react";var a3=tL({}),l3=({children:t,...e})=>eL(a3,{value:e,children:t}),ac=()=>{let t=oL(a3);if(!t)throw new Error("useDocumentDrawerContext must be used within a DocumentDrawerProvider");return t};var d3=({id:t,AfterFields:e,collectionSlug:o,disableActions:n,drawerSlug:r,Header:s,initialData:i,onDelete:a,onDuplicate:l,onSave:c,overrideEntityVisibility:u=!0,redirectAfterCreate:d,redirectAfterDelete:f,redirectAfterDuplicate:m})=>{let{getEntityConfig:h}=H(),p=Ne(),[g]=Rg(()=>h({collectionSlug:o})),b=rL.useRef(null),{closeModal:v}=de(),{t:x}=k(),{renderDocument:y}=Dt(),[C,S]=Rg(void 0),[w,D]=Rg(!0),_=nL(!1),A=lc(T=>{let $=or(b);(async()=>{D(!0);try{let N=await y({collectionSlug:o,disableActions:n,docID:T,drawerSlug:r,initialData:i,locale:p,overrideEntityVisibility:u,redirectAfterCreate:d,redirectAfterDelete:f!==void 0?f:!1,redirectAfterDuplicate:m!==void 0?m:!1,signal:$.signal});N?.Document&&(S(N.Document),D(!1))}catch(N){fe.error(N?.message||x("error:unspecific")),v(r)}b.current=null})()},[o,n,r,i,f,m,y,v,u,x,p]),F=lc(T=>{A(T.doc.id),typeof c=="function"&&c({...T,collectionConfig:g})},[c,g,A]),R=lc(T=>{A(T.doc.id),typeof l=="function"&&l({...T,collectionConfig:g})},[l,g,A]),I=lc(T=>{typeof a=="function"&&a({...T,collectionConfig:g}),v(r)},[a,v,r,g]),E=lc(()=>{A()},[A]);return u3(()=>{!C&&!_.current&&(A(t),_.current=!0)},[C,A,t]),u3(()=>{let T=b.current;return()=>{tr(T)}},[]),w?c3(In,{}):c3(l3,{clearDoc:E,drawerSlug:r,onDelete:I,onDuplicate:R,onSave:F,children:C})};var as="doc-drawer",cL=({id:t,collectionSlug:e,depth:o,uuid:n})=>`doc-drawer_${e}_${o}${t?`_${t}`:""}_${n}`,uL=t=>{let e=m3(21),o,n,r,s,i,a,l,c;e[0]!==t?({id:a,children:o,className:n,collectionSlug:r,disabled:s,drawerSlug:i,onClick:l,...c}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=a,e[7]=l,e[8]=c):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],a=e[6],l=e[7],c=e[8]);let{t:u}=k(),[d]=um(r),f=a?"general:editLabel":"fields:addNewLabel",m=d?.labels.singular,h;if(e[9]!==o||e[10]!==n||e[11]!==s||e[12]!==i||e[13]!==l||e[14]!==c||e[15]!==u||e[16]!==f||e[17]!==m){let p=u(f,{label:m}),g;e[19]!==n?(g=[n,`${as}__toggler`].filter(Boolean),e[19]=n,e[20]=g):g=e[20],h=mm(ur,{"aria-label":p,className:g.join(" "),disabled:s,onClick:l,slug:i,...c,children:o}),e[9]=o,e[10]=n,e[11]=s,e[12]=i,e[13]=l,e[14]=c,e[15]=u,e[16]=f,e[17]=m,e[18]=h}else h=e[18];return h},dL=t=>{let{drawerSlug:e}=t;return mm(Pt,{className:as,gutter:!1,Header:null,slug:e,children:mm(d3,{...t})})},Jt=t=>{let e=m3(38),{id:o,collectionSlug:n,overrideEntityVisibility:r}=t,s=ct(),i=aL(),{closeModal:a,modalState:l,openModal:c,toggleModal:u}=de(),[d,f]=lL(!1),m;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==i?(m=cL({id:o,collectionSlug:n,depth:s,uuid:i}),e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=m):m=e[4];let h=m,p,g;e[5]!==h||e[6]!==l?(p=()=>{f(!!l[h]?.isOpen)},g=[l,h],e[5]=h,e[6]=l,e[7]=p,e[8]=g):(p=e[7],g=e[8]),iL(p,g);let b;e[9]!==h||e[10]!==u?(b=()=>{u(h)},e[9]=h,e[10]=u,e[11]=b):b=e[11];let v=b,x;e[12]!==a||e[13]!==h?(x=()=>{a(h)},e[12]=a,e[13]=h,e[14]=x):x=e[14];let y=x,C;e[15]!==h||e[16]!==c?(C=()=>{c(h)},e[15]=h,e[16]=c,e[17]=C):C=e[17];let S=C,w,D;e[18]!==n||e[19]!==h||e[20]!==o||e[21]!==r?(D=j=>sL(dL,{...j,collectionSlug:n,drawerSlug:h,id:o,key:h,overrideEntityVisibility:r}),e[18]=n,e[19]=h,e[20]=o,e[21]=r,e[22]=D):D=e[22],w=D;let _=w,A,F;e[23]!==n||e[24]!==h||e[25]!==o?(F=j=>mm(uL,{...j,collectionSlug:n,drawerSlug:h,id:o}),e[23]=n,e[24]=h,e[25]=o,e[26]=F):F=e[26],A=F;let R=A,I,E;e[27]!==y||e[28]!==h||e[29]!==s||e[30]!==d||e[31]!==S||e[32]!==v?(E={closeDrawer:y,drawerDepth:s,drawerSlug:h,isDrawerOpen:d,openDrawer:S,toggleDrawer:v},e[27]=y,e[28]=h,e[29]=s,e[30]=d,e[31]=S,e[32]=v,e[33]=E):E=e[33],I=E;let T=I,$;return e[34]!==_||e[35]!==T||e[36]!==R?($=[_,R,T],e[34]=_,e[35]=T,e[36]=R,e[37]=$):$=e[37],$};import{c as mL}from"react/compiler-runtime";import{jsx as fL}from"react/jsx-runtime";import{createContext as pL,use as hL,useEffect as gL,useReducer as bL,useRef as vL}from"react";function f3(t,e){switch(e.type){case"ADD_LOADED":{let o={...t};typeof o[e.relationTo]!="object"&&(o[e.relationTo]={});let n=[...e.idsToLoad];return Array.isArray(e.docs)&&e.docs.forEach(r=>{n.splice(n.indexOf(r.id),1),o[e.relationTo][r.id]=r}),n.forEach(r=>{o[e.relationTo][r]=!1}),o}case"REQUEST":{let o={...t};return e.docs.forEach(({relationTo:n,value:r})=>{typeof o[n]!="object"&&(o[n]={}),o[n][r]=null}),o}default:return t}}var p3=pL({}),cc=t=>{let e=mL(15),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=bL(f3,n),i=Jo(r,100),{config:a}=H(),{routes:l,serverURL:c}=a,{api:u}=l,{i18n:d}=k(),{code:f}=Ne(),m=vL(f),h;e[1]!==u||e[2]!==i||e[3]!==d||e[4]!==f||e[5]!==c?(h=C=>{let S=C===void 0?!1:C;Object.entries(i).forEach(async w=>{let[D,_]=w,A=[];if(Object.entries(_).forEach(F=>{let[R,I]=F;(I===null||S)&&A.push(R)}),A.length>0){let F=`${c}${u}/${D}`,R=new URLSearchParams;if(R.append("depth","0"),R.append("limit","250"),f&&R.append("locale",f),A&&A.length>0){let T=A.map(xL);R.append("where[id][in]",T.join(","))}let I=`?${R.toString()}`,E=await fetch(`${F}${I}`,{credentials:"include",headers:{"Accept-Language":d.language}});if(E.ok){let T=await E.json();T.docs&&s({type:"ADD_LOADED",docs:T.docs,idsToLoad:A,relationTo:D})}else s({type:"ADD_LOADED",docs:[],idsToLoad:A,relationTo:D})}})},e[1]=u,e[2]=i,e[3]=d,e[4]=f,e[5]=c,e[6]=h):h=e[6];let p=h,g,b;e[7]!==p||e[8]!==f?(g=()=>{p(f&&m.current!==f),m.current=f},b=[f,p],e[7]=p,e[8]=f,e[9]=g,e[10]=b):(g=e[9],b=e[10]),gL(g,b);let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=C=>{s({type:"REQUEST",docs:C})},e[11]=v):v=e[11];let x=v,y;return e[12]!==o||e[13]!==r?(y=fL(p3,{value:{documents:r,getRelationships:x},children:o}),e[12]=o,e[13]=r,e[14]=y):y=e[14],y},_g=()=>hL(p3);function xL(t){return String(t)}import{c as e$}from"react/compiler-runtime";import{jsx as Cm,jsxs as t$}from"react/jsx-runtime";import"react";import{c as qL}from"react/compiler-runtime";import{jsx as L3}from"react/jsx-runtime";import $3 from"react";import{c as HL}from"react/compiler-runtime";import{jsx as ba,jsxs as zL}from"react/jsx-runtime";import{getTranslation as XL}from"@payloadcms/translations";import{fieldAffectsData as UL,fieldIsID as YL}from"payload/shared";import ZL from"react";import{formatAdminURL as h3}from"payload/shared";import{getTranslation as yL}from"@payloadcms/translations";import CL from"react";var g3=(t,e,o)=>{if((e?.type==="select"||e?.type==="radio")&&Array.isArray(e.options)){let n=e.options.find(r=>typeof r=="object"?r.value===t:r===t);if(n)return typeof n=="object"&&"label"in n?CL.isValidElement(n.label)?n.label:yL(n.label,o)||n.value:n}return t};import{jsx as b3}from"react/jsx-runtime";import"react";var fm=({cellData:t,nowrap:e})=>{let o=t?.length>100?`${t.substring(0,100)}\u2026`:t;return b3("code",{className:"code-cell",style:e?{whiteSpace:"nowrap"}:{},children:b3("span",{children:o})})};import{c as wL}from"react/compiler-runtime";import{jsx as SL}from"react/jsx-runtime";import{getTranslation as v3}from"@payloadcms/translations";import"react";var x3=t=>{let e=wL(2),{cellData:o,field:n}=t,{labels:r}=n,{i18n:s}=k(),i=o??[],a=i.length===1?`${i.length} ${v3(r?.singular||s.t("general:rows"),s)}`:`${i.length} ${v3(r?.plural||s.t("general:rows"),s)}`,l;return e[0]!==a?(l=SL("span",{children:a}),e[0]=a,e[1]=l):l=e[1],l};import{c as IL}from"react/compiler-runtime";import{jsx as RL}from"react/jsx-runtime";import{getTranslation as pm}from"@payloadcms/translations";import"react";var y3=t=>{let e=IL(2),{cellData:o,field:n}=t,{blockReferences:r,blocks:s,labels:i}=n,{i18n:a}=k(),{config:l}=H(),c=Array.isArray(o)?o.map(_L):[],u=(r??s)?.map(h=>{let p=typeof h=="string"?l.blocksMap[h]:h;return{slug:p.slug,label:pm(p.labels.singular,a)}}),d=`0 ${pm(i?.plural,a)}`,f=h=>h.map(p=>u.filter(b=>b.slug===p)?.[0]?.label).join(", ");if(c.length>5){let h=c.length-5;d=`${c.length} ${pm(i?.plural,a)} - ${a.t("fields:itemsAndMore",{count:h,items:f(c.slice(0,5))})}`}else c.length>0&&(d=`${c.length} ${pm(c.length===1?i?.singular:i?.plural,a)} - ${f(c)}`);let m;return e[0]!==d?(m=RL("span",{children:d}),e[0]=d,e[1]=m):m=e[1],m};function _L(t){let{blockType:e}=t;return e}import{c as DL}from"react/compiler-runtime";import{jsx as C3}from"react/jsx-runtime";import"react";var w3=t=>{let e=DL(3),{cellData:o}=t,{t:n}=k(),r=`general:${o}`,s;return e[0]!==n||e[1]!==r?(s=C3("code",{className:"bool-cell",children:C3("span",{children:n(r).toLowerCase()})}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};import{c as FL}from"react/compiler-runtime";import{jsx as AL}from"react/jsx-runtime";import"react";var S3=t=>{let e=FL(8),{cellData:o,field:n}=t,{admin:r}=n,s;e[0]!==r?(s=r===void 0?{}:r,e[0]=r,e[1]=s):s=e[1];let{date:i}=s,{config:a}=H(),{admin:l}=a,{dateFormat:c}=l,u=i?.displayFormat||c,{i18n:d}=k(),f;e[2]!==o||e[3]!==u||e[4]!==d?(f=o&&xn({date:o,i18n:d,pattern:u}),e[2]=o,e[3]=u,e[4]=d,e[5]=f):f=e[5];let m;return e[6]!==f?(m=AL("span",{children:f}),e[6]=f,e[7]=m):m=e[7],m};import{jsx as Fg,jsxs as EL,Fragment as PL}from"react/jsx-runtime";import{isImage as NL}from"payload/shared";import"react";var ha=({sizes:t,targetSizeMax:e=180,targetSizeMin:o=40,thumbnailURL:n,url:r,width:s})=>n||t&&Object.values(t).reduce((a,l)=>!l.width||l.width<o?a:l.width>=o&&l.width<=e?!a.width||l.width<a.width||a.width<o||a.width>e?l:a:!a.width||!a.original&&a.width<o&&l.width>a.width||a.width>e&&l.width<a.width?l:a,{original:!0,url:r,width:s}).url||r;import{c as I3}from"react/compiler-runtime";import{jsx as ga,jsxs as R3}from"react/jsx-runtime";import gm from"react";import{jsx as Dg,jsxs as TL}from"react/jsx-runtime";import"react";var hm=()=>TL("svg",{height:"150",viewBox:"0 0 150 150",width:"150",xmlns:"http://www.w3.org/2000/svg",children:[Dg("rect",{fill:"#333333",height:"150",transform:"translate(0 0.5)",width:"150"}),Dg("path",{d:"M82.8876 50.5H55.5555V100.5H94.4444V61.9818H82.8876V50.5Z",fill:"white"}),Dg("path",{d:"M82.8876 61.9818H94.4444L82.8876 50.5V61.9818Z",fill:"#9A9A9A"})]});var bm="thumbnail",Mr=t=>{let e=I3(17),{className:o,doc:n,fileSrc:r,imageCacheTag:s,size:i}=t,a=o===void 0?"":o,l;e[0]!==n?(l=n===void 0?{}:n,e[0]=n,e[1]=l):l=e[1];let{filename:c}=l,[u,d]=gm.useState(void 0),f=`${bm}--size-${i||"medium"}`,m;e[2]!==a||e[3]!==f?(m=[bm,f,a],e[2]=a,e[3]=f,e[4]=m):m=e[4];let h=m.join(" "),p,g;e[5]!==r?(p=()=>{if(!r){d(!1);return}d(void 0);let x=new Image;x.src=r,x.onload=()=>{d(!0)},x.onerror=()=>{d(!1)}},g=[r],e[5]=r,e[6]=p,e[7]=g):(p=e[6],g=e[7]),gm.useEffect(p,g);let b=null;if(r){let x=r?.includes("?")?"&":"?";b=s?`${r}${x}${encodeURIComponent(s)}`:r}let v;if(e[8]!==h||e[9]!==u||e[10]!==c||e[11]!==b){let x;e[13]!==u||e[14]!==c||e[15]!==b?(x=u&&ga("img",{alt:c,src:b}),e[13]=u,e[14]=c,e[15]=b,e[16]=x):x=e[16],v=R3("div",{className:h,children:[u===void 0&&ga(St,{height:"100%"}),x,u===!1&&ga(hm,{})]}),e[8]=h,e[9]=u,e[10]=c,e[11]=b,e[12]=v}else v=e[12];return v};function _3(t){let e=I3(17),{alt:o,className:n,filename:r,fileSrc:s,imageCacheTag:i,size:a}=t,l=n===void 0?"":n,[c,u]=gm.useState(void 0),d=`${bm}--size-${a||"medium"}`,f;e[0]!==l||e[1]!==d?(f=[bm,d,l],e[0]=l,e[1]=d,e[2]=f):f=e[2];let m=f.join(" "),h,p;e[3]!==s?(h=()=>{if(!s){u(!1);return}u(void 0);let v=new Image;v.src=s,v.onload=()=>{u(!0)},v.onerror=()=>{u(!1)}},p=[s],e[3]=s,e[4]=h,e[5]=p):(h=e[4],p=e[5]),gm.useEffect(h,p);let g="";if(s){let v=s?.includes("?")?"&":"?";g=i?`${s}${v}${encodeURIComponent(i)}`:s}let b;if(e[6]!==o||e[7]!==m||e[8]!==c||e[9]!==r||e[10]!==g){let v;e[12]!==o||e[13]!==c||e[14]!==r||e[15]!==g?(v=c&&ga("img",{alt:o||r,src:g}),e[12]=o,e[13]=c,e[14]=r,e[15]=g,e[16]=v):v=e[16],b=R3("div",{className:m,children:[c===void 0&&ga(St,{height:"100%"}),v,c===!1&&ga(hm,{})]}),e[6]=o,e[7]=m,e[8]=c,e[9]=r,e[10]=g,e[11]=b}else b=e[11];return b}var Ag="file",vm=({cellData:t,collectionConfig:e,field:o,rowData:n})=>{if(("displayPreview"in o?o.displayPreview:void 0)??e.upload?.displayPreview??!0){let i=NL(n?.mimeType),a=i?n?.thumbnailURL||n?.url:n?.thumbnailURL;return i&&(a=ha({sizes:n?.sizes,thumbnailURL:n?.thumbnailURL,url:n?.url,width:n?.width})),EL("div",{className:Ag,children:[Fg(Mr,{className:`${Ag}__thumbnail`,collectionSlug:e?.slug,doc:{...n,filename:t},fileSrc:a,size:"small",uploadConfig:e?.upload}),Fg("span",{className:`${Ag}__filename`,children:String(t)})]})}else return Fg(PL,{children:String(t)})};import{jsx as D3}from"react/jsx-runtime";import"react";var F3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return D3("code",{className:"json-cell",children:D3("span",{children:JSON.stringify(e)})})};import{c as LL}from"react/compiler-runtime";import{jsx as $L,jsxs as T3}from"react/jsx-runtime";import{getTranslation as kL}from"@payloadcms/translations";import jL,{useEffect as E3,useState as P3}from"react";var A3=!!(typeof window<"u"&&window.document&&window.document.createElement);var OL="relationship-cell",xm=3,ym=t=>{let e=LL(40),{cellData:o,customCellProps:n,field:r,field:s}=t,{label:i}=s,a="relationTo"in r&&r.relationTo||"collection"in r&&r.collection,l;l="collection"in r?o?.docs:o;let c=l,{config:u,getEntityConfig:d}=H(),{collections:f,routes:m}=u,[h,p]=mn(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];let[b,v]=P3(g),{documents:x,getRelationships:y}=_g(),[C,S]=P3(!1),{i18n:w,t:D}=k(),_=A3?p?.boundingClientRect?.top<window.innerHeight:!1,A;e[1]!==c||e[2]!==y||e[3]!==C||e[4]!==_||e[5]!==a?(A=()=>{if((c||typeof c=="number")&&_&&!C){let T=[],$=Array.isArray(c)?c:[c];$.slice(0,$.length<xm?$.length:xm).forEach(j=>{typeof j=="object"&&"relationTo"in j&&"value"in j&&T.push(j),(typeof j=="number"||typeof j=="string")&&typeof a=="string"&&T.push({relationTo:a,value:j})}),y(T),S(!0),v(T)}},e[1]=c,e[2]=y,e[3]=C,e[4]=_,e[5]=a,e[6]=A):A=e[6];let F;e[7]!==c||e[8]!==f||e[9]!==y||e[10]!==C||e[11]!==_||e[12]!==a||e[13]!==m.api?(F=[c,a,f,_,m.api,C,y],e[7]=c,e[8]=f,e[9]=y,e[10]=C,e[11]=_,e[12]=a,e[13]=m.api,e[14]=F):F=e[14],E3(A,F);let R;e[15]!==C?(R=()=>{C&&S(!1)},e[15]=C,e[16]=R):R=e[16];let I;e[17]!==c?(I=[c],e[17]=c,e[18]=I):I=e[18],E3(R,I);let E;if(e[19]!==c||e[20]!==u.admin||e[21]!==n||e[22]!==x||e[23]!==r||e[24]!==d||e[25]!==w||e[26]!==h||e[27]!==i||e[28]!==D||e[29]!==b){let T;e[31]!==u.admin||e[32]!==n||e[33]!==x||e[34]!==r||e[35]!==d||e[36]!==w||e[37]!==D||e[38]!==b.length?(T=($,j)=>{let{relationTo:N,value:P}=$,L=x[N][P],V=d({collectionSlug:N}),M=dr({collectionConfig:V,data:L||null,dateFormat:u.admin.dateFormat,fallback:`${D("general:untitled")} - ID: ${P}`,i18n:w}),O=null;return r.type==="upload"&&(("displayPreview"in r?r.displayPreview:void 0)??V.upload?.displayPreview??!0)&&L&&(O=$L(vm,{cellData:M,collectionConfig:V,collectionSlug:V.slug,customCellProps:n,field:r,rowData:L})),T3(jL.Fragment,{children:[L===!1&&`${D("general:untitled")} - ID: ${P}`,L===null&&`${D("general:loading")}...`,L?O||M:null,b.length>j+1&&", "]},j)},e[31]=u.admin,e[32]=n,e[33]=x,e[34]=r,e[35]=d,e[36]=w,e[37]=D,e[38]=b.length,e[39]=T):T=e[39],E=T3("div",{className:OL,ref:h,children:[b.map(T),Array.isArray(c)&&c.length>xm&&D("fields:itemsAndMore",{count:c.length-xm,items:""}),b.length===0&&D("general:noLabel",{label:kL(i||"",w)})]}),e[19]=c,e[20]=u.admin,e[21]=n,e[22]=x,e[23]=r,e[24]=d,e[25]=w,e[26]=h,e[27]=i,e[28]=D,e[29]=b,e[30]=E}else E=e[30];return E};import{c as ML}from"react/compiler-runtime";import{jsx as BL}from"react/jsx-runtime";import{getTranslation as VL}from"@payloadcms/translations";import{optionsAreObjects as GL}from"payload/shared";import"react";var Tg=t=>{let e=ML(10),{cellData:o,field:n}=t,{options:r}=n,{i18n:s}=k(),i;e[0]!==s||e[1]!==r?(i=u=>u.map(d=>{let f=r.filter(m=>m.value===d)?.[0]?.label;return VL(f,s)}).join(", "),e[0]=s,e[1]=r,e[2]=i):i=e[2];let a=i,l;if(GL(r)){let u;e[3]!==o||e[4]!==a?(u=Array.isArray(o)?a(o):a([o]),e[3]=o,e[4]=a,e[5]=u):u=e[5],l=u}else{let u;e[6]!==o?(u=Array.isArray(o)?o.join(", "):o,e[6]=o,e[7]=u):u=e[7],l=u}let c;return e[8]!==l?(c=BL("span",{children:l}),e[8]=l,e[9]=c):c=e[9],c};import{jsx as WL}from"react/jsx-runtime";import"react";var N3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return WL("span",{children:e})};var Eg={array:x3,blocks:y3,checkbox:w3,code:fm,date:S3,File:vm,join:ym,json:F3,radio:Tg,relationship:ym,select:Tg,textarea:N3,upload:ym};var uc=t=>{let e=HL(14),{cellData:o,className:n,collectionSlug:r,field:s,field:i,link:a,onClick:l,rowData:c}=t,{admin:u}=i,{i18n:d}=k(),{config:f,getEntityConfig:m}=H(),{routes:h}=f,{admin:p}=h,g,b;if(e[0]!==u||e[1]!==p||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==m||e[7]!==d||e[8]!==a||e[9]!==l||e[10]!==t||e[11]!==c){b=Symbol.for("react.early_return_sentinel");e:{let v=m({collectionSlug:r}),x=u&&"className"in u?u.className:void 0,y=n||(s.admin&&"className"in s.admin?s.admin.className:null)||x,C=l,S="span",w={className:y};if(a&&(w.prefetch=!1,S=no,w.href=v?.slug?h3({adminRoute:p,path:`/collections/${v?.slug}/${encodeURIComponent(c.id)}`}):""),typeof C=="function"&&(S="button",w.type="button",w.onClick=()=>{C({cellData:o,collectionSlug:v?.slug,rowData:c})}),YL(s)){b=ba(S,{...w,children:ba(fm,{cellData:`ID: ${o}`,collectionConfig:v,collectionSlug:r,field:{...s,type:"code"},nowrap:!0,rowData:c})});break e}let D=g3(o,s,d),_=typeof o<"u"&&Eg[s.type],A=null;if(ZL.isValidElement(D))A=D;else if(_)A=ba(_,{cellData:o,rowData:c,...t});else if(!_)if(v?.upload&&UL(s)&&s.name==="filename"&&s.type==="text"){let F=Eg.File;A=ba(F,{cellData:o,rowData:c,...t,collectionConfig:v,field:s})}else{b=zL(S,{...w,children:[(D===""||typeof D>"u"||D===null)&&d.t("general:noLabel",{label:XL(("label"in s?s.label:null)||"data",d)}),typeof D=="string"&&D,typeof D=="number"&&D,typeof D=="object"&&D!==null&&JSON.stringify(D)]});break e}if((s.type==="select"||s.type==="radio")&&s.options.length&&o){let F=Array.isArray(o)?o.map(JL).join(" "):`selected--${o}`,R=[w.className,F].filter(Boolean).join(" ");b=ba(S,{...w,className:R,children:A});break e}g=ba(S,{...w,children:A})}e[0]=u,e[1]=p,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=m,e[7]=d,e[8]=a,e[9]=l,e[10]=t,e[11]=c,e[12]=g,e[13]=b}else g=e[12],b=e[13];return b!==Symbol.for("react.early_return_sentinel")?b:g};function JL(t){return`selected--${t}`}var QL="default-cell",k3=$3.createContext(null),Pg=()=>$3.use(k3),KL=t=>{let e=qL(9),{clientProps:o,columnIndex:n,isLinkedColumn:r}=t,{drawerSlug:s,onSelect:i}=en(),{LinkedCellOverride:a}=pa(),l;if(e[0]!==a||e[1]!==o||e[2]!==n||e[3]!==s||e[4]!==r||e[5]!==i){let c={...o,columnIndex:n};if(r&&s){c.className=`${QL}__first-cell`,c.link=!1;let u;e[7]!==i?(u=d=>{let{collectionSlug:f,rowData:m}=d;typeof i=="function"&&i({collectionSlug:f,doc:m,docID:m.id})},e[7]=i,e[8]=u):u=e[8],c.onClick=u}l=L3(k3,{value:c,children:r&&a?a:L3(uc,{...c})}),e[0]=a,e[1]=o,e[2]=n,e[3]=s,e[4]=r,e[5]=i,e[6]=l}else l=e[6];return l};var j3=t=>{let e=e$(15),{onDrawerDelete:o,onDrawerSave:n}=t,r=Pg(),s=r?.rowData.id,i=r?.collectionSlug,a;e[0]!==s||e[1]!==i?(a={id:s,collectionSlug:i},e[0]=s,e[1]=i,e[2]=a):a=e[2];let[l,c,u]=Jt(a),{closeDrawer:d}=u,f;e[3]!==d||e[4]!==n?(f=b=>{d(),typeof n=="function"&&n(b)},e[3]=d,e[4]=n,e[5]=f):f=e[5];let m=f,h;e[6]!==d||e[7]!==o?(h=b=>{d(),typeof o=="function"&&o(b)},e[6]=d,e[7]=o,e[8]=h):h=e[8];let p=h,g;return e[9]!==l||e[10]!==c||e[11]!==r||e[12]!==p||e[13]!==m?(g=t$("div",{className:"drawer-link",children:[Cm(uc,{...r,className:"drawer-link__cell",link:!1,onClick:null}),Cm(c,{children:Cm(_r,{})}),Cm(l,{onDelete:p,onSave:m})]}),e[9]=l,e[10]=c,e[11]=r,e[12]=p,e[13]=m,e[14]=g):g=e[14],g};import{c as i$}from"react/compiler-runtime";import{jsx as a$}from"react/jsx-runtime";import"react";import{jsx as $g}from"react/jsx-runtime";import"react";import{jsx as O3}from"react/jsx-runtime";import"react";var Ng="clickable-arrow",M3=t=>{let{direction:e="right",isDisabled:o=!1,updatePage:n}=t,r=[Ng,o&&`${Ng}--is-disabled`,e&&`${Ng}--${e}`].filter(Boolean).join(" ");return O3("button",{className:r,disabled:o,onClick:o?void 0:n,type:"button",children:O3(Ze,{})})};import{jsx as o$}from"react/jsx-runtime";import"react";var wm="paginator__page",Lg=({isCurrent:t,isFirstPage:e=!1,isLastPage:o=!1,page:n=1,updatePage:r})=>{let s=[wm,t&&`${wm}--is-current`,e&&`${wm}--is-first-page`,o&&`${wm}--is-last-page`].filter(Boolean).join(" ");return o$("button",{className:s,onClick:()=>r(n),type:"button",children:n})};import{jsx as r$}from"react/jsx-runtime";import"react";var B3=()=>r$("span",{className:"paginator__separator",children:"\u2014"});var n$={ClickableArrow:M3,Page:Lg,Separator:B3},s$="paginator",dc=t=>{let{hasNextPage:e=!1,hasPrevPage:o=!1,nextPage:n=null,numberOfNeighbors:r=1,onChange:s,page:i,prevPage:a=null,totalPages:l=null}=t;if(!e&&!o)return null;let c=h=>{typeof s=="function"&&s(h)},u=Array.from({length:l},(h,p)=>p+1),d=i-1-r;d<=0&&(d=0);let f=i-1+r+1,m=u.slice(d,f);return i-r-1>=2&&m.unshift({type:"Separator"}),i>r+1&&m.unshift({type:"Page",props:{isFirstPage:!0,page:1,updatePage:c}}),i+r+1<l&&m.push({type:"Separator"}),f<l&&m.push({type:"Page",props:{isLastPage:!0,page:l,updatePage:c}}),m.unshift({type:"ClickableArrow",props:{direction:"right",isDisabled:!e,updatePage:()=>c(n)}}),m.unshift({type:"ClickableArrow",props:{direction:"left",isDisabled:!o,updatePage:()=>c(a)}}),$g("div",{className:s$,children:m.map((h,p)=>{if(typeof h=="number")return $g(Lg,{isCurrent:i===h,page:h,updatePage:c},p);let g=n$[h.type];return $g(g,{...h.props},p)})})};var V3=()=>{let t=i$(11),{data:e,handlePageChange:o}=Rt(),n=e.nextPage||2,r;t[0]!==o?(r=l=>{o(l)},t[0]=o,t[1]=r):r=t[1];let s=e.page||1,i=e.prevPage||void 0,a;return t[2]!==e.hasNextPage||t[3]!==e.hasPrevPage||t[4]!==e.limit||t[5]!==e.totalPages||t[6]!==n||t[7]!==r||t[8]!==s||t[9]!==i?(a=a$(dc,{hasNextPage:e.hasNextPage,hasPrevPage:e.hasPrevPage,limit:e.limit,nextPage:n,numberOfNeighbors:1,onChange:r,page:s,prevPage:i,totalPages:e.totalPages}),t[2]=e.hasNextPage,t[3]=e.hasPrevPage,t[4]=e.limit,t[5]=e.totalPages,t[6]=n,t[7]=r,t[8]=s,t[9]=i,t[10]=a):a=t[10],a};var rr="relationship-table",Og=t=>{let{AfterInput:e,allowCreate:o=!0,BeforeInput:n,disableTable:r=!1,field:s,filterOptions:i,initialData:a,initialDrawerData:l,Label:c,parent:u,relationTo:d}=t,[f,m]=Rn(null),{config:h,getEntityConfig:p}=H(),{permissions:g}=Ae(),[b]=Rn(()=>{if(a)return{...a,docs:Array.isArray(a.docs)?a.docs.reduce((U,z)=>typeof z=="string"?[...U,{id:z}]:[...U,z],[]):[]}}),{i18n:v,t:x}=k(),[y,C]=Rn(),[S,w]=Rn(!1),[D]=Rn(()=>p({collectionSlug:d})),[_,A]=Rn(Array.isArray(d)?void 0:d),[F,R]=Rn(!r),[I,E]=Rn(b),[T,$]=Rn(),{getTableState:j}=Dt(),N=Sm(async U=>{let z={limit:String(s?.defaultLimit||D?.admin?.pagination?.defaultLimit),sort:s.defaultSort||D?.defaultSort,...y||{},where:{...y?.where||{}}};i&&(z.where=l$(z.where,i));let ce=s.admin.defaultColumns?s.admin.defaultColumns.map(q=>({accessor:q,active:!0})):void 0,{data:J,state:ue,Table:re}=await j({collectionSlug:d,columns:G3(y?.columns)||ce,docs:U,enableRowSelections:!1,orderableFieldName:!s.orderable||Array.isArray(s.collection)?void 0:`_${s.collection}_${s.name}_order`,parent:u,query:z,renderRowTypes:!0,tableAppearance:"condensed"});E(J),m(re),$(ue),R(!1)},[s.defaultLimit,s.defaultSort,s.admin.defaultColumns,s.collection,s.name,s.orderable,D?.admin?.pagination?.defaultLimit,D?.defaultSort,y,i,j,d,u]),P=eo((U,z)=>{!z&&(!f||U)&&N()});jg(()=>{P(y,r)},[y,r]);let[L,V,{closeDrawer:M,isDrawerOpen:O,openDrawer:B}]=Jt({collectionSlug:_}),G=Sm(U=>{let z=I?.docs?.findIndex(J=>J.id===U.doc.id),ce;if(z!==-1){let J=[...I.docs];J[z]=U.doc,ce=J}else ce=[U.doc,...I.docs];N(ce)},[I?.docs,N]),X=Sm(U=>{M(),G(U)},[M,G]),Z=Sm(U=>{let z=I.docs.filter(ce=>ce.id!==U.id);N(z)},[I?.docs,N]),te=o!==!1&&g?.collections?.[Array.isArray(d)?d[0]:d]?.create;return jg(()=>{Array.isArray(d)&&_&&B()},[_,B,d]),jg(()=>{Array.isArray(d)&&!O&&_&&A(void 0)},[O]),ni("div",{className:rr,children:[ni("div",{className:`${rr}__header`,children:[c,ni("div",{className:`${rr}__actions`,children:[!Array.isArray(d)&&te&&to(V,{className:`${rr}__add-new`,children:v.t("fields:addNew")}),Array.isArray(d)&&to(W3,{children:to(ho,{button:ni(ne,{buttonStyle:"none",className:`${rr}__add-new-polymorphic`,children:[v.t("fields:addNew"),to(jo,{})]}),buttonType:"custom",horizontalAlign:"center",render:({close:U})=>to(Me.ButtonGroup,{children:d.map(z=>g.collections[z].create?to(Me.Button,{className:`${rr}__relation-button--${z}`,onClick:()=>{U(),A(z)},children:kg(h.collections.find(ce=>ce.slug===z).labels.singular,v)},z):null)}),size:"medium"})}),to(vt,{"aria-controls":`${rr}-columns`,"aria-expanded":S,className:`${rr}__toggle-columns ${S?`${rr}__buttons-active`:""}`,icon:to(Ze,{direction:S?"up":"down"}),onClick:()=>w(!S),pillStyle:"light",children:x("general:columns")})]})]}),n,F?to("p",{children:x("general:loading")}):ni(W3,{children:[I?.docs&&I.docs.length===0&&ni("div",{className:`${rr}__no-results`,children:[to("p",{children:v.t("general:noResults",{label:Array.isArray(d)?v.t("general:documents"):kg(D?.labels?.plural,v)})}),te&&to(ne,{onClick:B,children:v.t("general:createNewLabel",{label:kg(D?.labels?.singular,v)})})]}),I?.docs&&I.docs.length>0&&to(cc,{children:to(bg,{columns:G3(T),data:I,defaultLimit:s.defaultLimit??D?.admin?.pagination?.defaultLimit,defaultSort:s.defaultSort??D?.defaultSort,modifySearchParams:!1,onQueryChange:C,orderableFieldName:!s.orderable||Array.isArray(s.collection)?void 0:`_${s.collection}_${s.name}_order`,children:ni(sc,{collectionSlug:Array.isArray(d)?d[0]:d,columnState:T,LinkedCellOverride:to(j3,{onDrawerDelete:Z,onDrawerSave:G}),children:[to(Tr,{className:`${rr}__columns`,height:S?"auto":0,id:`${rr}-columns`,children:to("div",{className:`${rr}__columns-inner`,children:D&&to(cm,{collectionSlug:D.slug})})}),f,to(V3,{})]})})})]}),e,to(L,{initialData:l,onSave:X})]})};var z3=Mg.default.default||Mg.default,Im=({collectionSlug:t,config:e,docID:o,fields:n,segments:r})=>{let s=u$(n),i=r[0],a=s.find(c=>c.name===i);if(!a)return null;if(a.type==="relationship"||a.type==="upload"){let c=o;return Array.isArray(a.relationTo)&&(c={relationTo:t,value:o}),{[a.name]:a.hasMany?[c]:c}}let l=r.slice(1,r.length);if(a.type==="tab"||a.type==="group")return{[a.name]:Im({collectionSlug:t,config:e,docID:o,fields:a.fields,segments:l})};if(a.type==="array"){let c=Im({collectionSlug:t,config:e,docID:o,fields:a.fields,segments:l});return c.id=z3().toHexString(),{[a.name]:[c]}}if(a.type==="blocks")for(let c of a.blockReferences??a.blocks){let u=typeof c=="string"?e.blocksMap[c]:c,d=Im({collectionSlug:t,config:e,docID:o,fields:u.fields,segments:l});if(d)return d.id=z3().toHexString(),d.blockType=u.slug,{[a.name]:[d]}}},d$=t=>{let{field:e,field:{admin:{allowCreate:o,description:n},collection:r,label:s,localized:i,on:a,required:l},path:c}=t,{id:u,docConfig:d}=Pe(),{config:f,getEntityConfig:m}=H(),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},path:x,showError:y,value:C}=Ee({potentiallyStalePath:c}),S=H3(()=>{if(!u)return null;let D=u;Array.isArray(e.targetField.relationTo)&&(D={relationTo:d.slug,value:D});let _=Array.isArray(r)?{}:{[a]:{equals:D}};return e.where?{and:[_,e.where]}:_},[u,r,e.targetField.relationTo,e.where,a,d?.slug]),w=H3(()=>{let D=m({collectionSlug:Array.isArray(e.collection)?e.collection[0]:e.collection});return Im({collectionSlug:d?.slug,config:f,docID:u,fields:D.fields,segments:e.on.split(".")})},[m,e.collection,e.on,d?.slug,u,f]);return d?c$("div",{className:[Ce,y&&"error","join"].filter(Boolean).join(" "),id:`field-${x?.replace(/\./g,"__")}`,children:[si(oe,{CustomComponent:b,Fallback:si(He,{path:x,showError:y})}),si(Og,{AfterInput:h,allowCreate:typeof u<"u"&&o,BeforeInput:p,disableTable:S===null,field:e,filterOptions:S,initialData:u&&C?C:{docs:[]},initialDrawerData:w,Label:si("h4",{style:{margin:0},children:v||si(xe,{label:s,localized:i,path:x,required:l})}),parent:Array.isArray(r)?{id:u,collectionSlug:d.slug,joinPath:x}:void 0,relationTo:r}),si(oe,{CustomComponent:g,Fallback:si(Be,{description:n,path:x})})]}):null},mc=je(d$);import{jsx as ii,jsxs as X3}from"react/jsx-runtime";import m$,{useCallback as Bg,useEffect as f$,useMemo as p$,useState as Vg}from"react";var h$="json-field",g$=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r,maxHeight:s}={},jsonSchema:i,label:a,localized:l,required:c},path:u,readOnly:d,validate:f}=t,[m,h]=Vg(),p=m$.useRef("system"),[g,b]=Vg(""),v=Bg((P,L)=>{if(typeof f=="function")return f(P,{...L,jsonError:m,required:c})},[f,c,m]),{customComponents:{AfterInput:x,BeforeInput:y,Description:C,Error:S,Label:w}={},disabled:D,initialValue:_,path:A,setValue:F,showError:R,value:I}=Ee({potentiallyStalePath:u,validate:v}),[E,T]=Vg(()=>(I||_)!==void 0?JSON.stringify(I??_,null,2):void 0),$=Bg((P,L)=>{if(!i)return;L.languages.json.jsonDefaults.setDiagnosticsOptions({enableSchemaRequest:!0,schemas:[...L.languages.json.jsonDefaults.diagnosticsOptions.schemas||[],i],validate:!0});let V=i.uri,M=V.includes("?")?`${V}&${crypto.randomUUID?crypto.randomUUID():wn()}`:`${V}?${crypto.randomUUID?crypto.randomUUID():wn()}`;P.setModel(L.editor.createModel(JSON.stringify(I,null,2),"json",L.Uri.parse(M)))},[i,I]),j=Bg(P=>{if(!(d||D)){p.current="user";try{F(P?JSON.parse(P):null),h(void 0)}catch(L){F(P||null),h(L)}}},[d,D,F]);f$(()=>{p.current==="system"&&(T((I||_)!==void 0?JSON.stringify(I??_,null,2):void 0),b(new Date().toString())),p.current="system"},[_,I]);let N=p$(()=>rt(e),[e]);return X3("div",{className:[Ce,h$,o,R&&"error",(d||D)&&"read-only"].filter(Boolean).join(" "),style:N,children:[ii(oe,{CustomComponent:w,Fallback:ii(xe,{label:a,localized:l,path:A,required:c})}),X3("div",{className:`${Ce}__wrap`,children:[ii(oe,{CustomComponent:S,Fallback:ii(He,{message:m,path:A,showError:R})}),y,ii($l,{defaultLanguage:"json",maxHeight:s,onChange:j,onMount:$,options:r,readOnly:d||D,value:E,wrapperProps:{id:`field-${A?.replace(/\./g,"__")}`}},g),x]}),ii(oe,{CustomComponent:C,Fallback:ii(Be,{description:n,path:A})})]})},fc=je(g$);import{jsx as _n,jsxs as U3}from"react/jsx-runtime";import{getTranslation as b$}from"@payloadcms/translations";import{isNumber as v$}from"payload/shared";import{useCallback as Gg,useEffect as x$,useMemo as y$,useState as C$}from"react";var w$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s=1}={},hasMany:i=!1,label:a,localized:l,max:c=1/0,maxRows:u=1/0,min:d=-1/0,required:f},onChange:m,path:h,readOnly:p,validate:g}=t,{i18n:b,t:v}=k(),x=Gg((P,L)=>{if(typeof g=="function")return g(P,{...L,max:c,min:d,required:f})},[g,d,c,f]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:D}={},disabled:_,path:A,setValue:F,showError:R,value:I}=Ee({potentiallyStalePath:h,validate:x}),E=Gg(P=>{let L=parseFloat(P.target.value),V=L;Number.isNaN(L)&&(V=null),typeof m=="function"&&m(V),F(V)},[m,F]),[T,$]=C$([]),j=Gg(P=>{if(!(p||_)){let L;P?Array.isArray(P)?L=P.map(V=>Number(V.value?.value||V.value)):L=[Number(P.value?.value||P.value)]:L=[],F(L)}},[p,_,F]);x$(()=>{i&&Array.isArray(I)&&$(I.map((P,L)=>({id:`${P}${L}`,label:`${P}`,value:{toString:()=>`${P}${L}`,value:P?.value||P}})))},[I,i]);let N=y$(()=>rt(e),[e]);return U3("div",{className:[Ce,"number",o,R&&"error",(p||_)&&"read-only",i&&"has-many"].filter(Boolean).join(" "),style:N,children:[_n(oe,{CustomComponent:D,Fallback:_n(xe,{label:a,localized:l,path:A,required:f})}),U3("div",{className:`${Ce}__wrap`,children:[_n(oe,{CustomComponent:w,Fallback:_n(He,{path:A,showError:R})}),C,i?_n(mt,{className:`field-${A.replace(/\./g,"__")}`,disabled:p||_,filterOption:(P,L)=>{let V=Array.isArray(I)&&I.length>=u;return v$(L)&&!V},isClearable:!0,isCreatable:!0,isMulti:!0,isSortable:!0,noOptionsMessage:()=>Array.isArray(I)&&I.length>=u?v("validation:limitReached",{max:u,value:I.length+1}):null,onChange:j,options:[],placeholder:v("general:enterAValue"),showError:R,value:T}):_n("div",{children:_n("input",{disabled:p||_,id:`field-${A.replace(/\./g,"__")}`,max:c,min:d,name:A,onChange:E,onWheel:P=>{P.target.blur()},placeholder:b$(r,b),step:s,type:"number",value:typeof I=="number"?I:""})}),y,_n(oe,{CustomComponent:S,Fallback:_n(Be,{description:n,path:A})})]})]})},pc=je(w$);import{jsx as tn,jsxs as va}from"react/jsx-runtime";import{getTranslation as Wg}from"@payloadcms/translations";import{useCallback as Y3,useMemo as S$}from"react";var Z3="point",I$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s}={},label:i,localized:a,required:l},path:c,readOnly:u,validate:d}=t,{i18n:f,t:m}=k(),h=Y3((R,I)=>{if(typeof d=="function")return d(R,{...I,required:l})},[d,l]),{customComponents:{AfterInput:p,BeforeInput:g,Description:b,Error:v,Label:x}={},disabled:y,path:C,setValue:S,showError:w,value:D=[null,null]}=Ee({potentiallyStalePath:c,validate:h}),_=Y3((R,I)=>{let E=parseFloat(R.target.value);Number.isNaN(E)&&(E=R.target.value);let T=[...D];T[I]=E,S(T)},[S,D]),A=R=>{let I=m(R==="longitude"?"fields:longitude":"fields:latitude"),E=i?Wg(i,f):"";return`${E}${E?" - ":""}${I}`},F=S$(()=>rt(e),[e]);return va("div",{className:[Ce,Z3,o,w&&"error",(u||y)&&"read-only"].filter(Boolean).join(" "),style:F,children:[va("ul",{className:`${Z3}__wrap`,children:[va("li",{children:[tn(oe,{CustomComponent:x,Fallback:tn(xe,{label:A("longitude"),localized:a,path:C,required:l})}),va("div",{className:"input-wrapper",children:[g,tn("input",{disabled:u||y,id:`field-longitude-${C?.replace(/\./g,"__")}`,name:`${C}.longitude`,onChange:R=>_(R,0),placeholder:Wg(r,f),step:s,type:"number",value:D&&typeof D[0]=="number"?D[0]:""}),p]})]}),va("li",{children:[tn(oe,{CustomComponent:x,Fallback:tn(xe,{label:A("latitude"),localized:a,path:C,required:l})}),va("div",{className:"input-wrapper",children:[tn(oe,{CustomComponent:v,Fallback:tn(He,{path:C,showError:w})}),g,tn("input",{disabled:u||y,id:`field-latitude-${C?.replace(/\./g,"__")}`,name:`${C}.latitude`,onChange:R=>_(R,1),placeholder:Wg(r,f),step:s,type:"number",value:D&&typeof D[1]=="number"?D[1]:""}),p]})]})]}),tn(oe,{CustomComponent:b,Fallback:tn(Be,{description:n,path:C})})]})},hc=je(I$);import{jsx as Dn,jsxs as J3}from"react/jsx-runtime";import{optionIsObject as q3}from"payload/shared";import{useCallback as F$,useMemo as A$}from"react";import{c as R$}from"react/compiler-runtime";import{jsx as Rm,jsxs as _$}from"react/jsx-runtime";import{getTranslation as D$}from"@payloadcms/translations";import"react";var gc="radio-input",bc=t=>{let e=R$(16),{isSelected:o,onChange:n,option:r,path:s,readOnly:i,uuid:a}=t,{i18n:l}=k(),c=ct(),u=`field-${s}-${r.value}${c>1?`-${c}`:""}${a?`-${a}`:""}`,d=o&&`${gc}--is-selected`,f;e[0]!==d?(f=[gc,d].filter(Boolean),e[0]=d,e[1]=f):f=e[1];let m=f.join(" "),h;e[2]!==n||e[3]!==r.value?(h=()=>typeof n=="function"?n(r.value):null,e[2]=n,e[3]=r.value,e[4]=h):h=e[4];let p;if(e[5]!==l||e[6]!==u||e[7]!==o||e[8]!==r.label||e[9]!==s||e[10]!==i||e[11]!==m||e[12]!==h){let g=Rm("input",{checked:o,disabled:i,id:u,name:s,onChange:h,type:"radio"}),b=i&&`${gc}__styled-radio--disabled`,v;e[14]!==b?(v=[`${gc}__styled-radio`,b].filter(Boolean),e[14]=b,e[15]=v):v=e[15],p=Rm("label",{htmlFor:u,children:_$("div",{className:m,children:[g,Rm("span",{className:v.join(" ")}),Rm("span",{className:`${gc}__label`,children:D$(r.label,l)})]})}),e[5]=l,e[6]=u,e[7]=o,e[8]=r.label,e[9]=s,e[10]=i,e[11]=m,e[12]=h,e[13]=p}else p=e[13];return p};var _m="radio-group",T$=t=>{let{disableModifyingForm:e,field:o,field:{admin:{className:n,description:r,layout:s="horizontal"}={},label:i,localized:a,options:l=[],required:c}={},onChange:u,path:d,readOnly:f,validate:m,value:h}=t,{uuid:p}=Oe(),g=F$((I,E)=>{if(typeof m=="function")return m(I,{...E,options:l,required:c})},[m,l,c]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,path:w,setValue:D,showError:_,value:A}=Ee({potentiallyStalePath:d,validate:g}),F=A||h,R=A$(()=>rt(o),[o]);return J3("div",{className:[Ce,_m,n,`${_m}--layout-${s}`,_&&"error",(f||S)&&`${_m}--read-only`].filter(Boolean).join(" "),style:R,children:[Dn(oe,{CustomComponent:y,Fallback:Dn(He,{path:w,showError:_})}),Dn(oe,{CustomComponent:C,Fallback:Dn(xe,{label:i,localized:a,path:w,required:c})}),J3("div",{className:`${Ce}__wrap`,children:[v,Dn("ul",{className:`${_m}--group`,id:`field-${w.replace(/\./g,"__")}`,children:l.map(I=>{let E="";q3(I)?E=I.value:E=I;let T=String(E)===String(F),$=`field-${w}-${E}${p?`-${p}`:""}`;return Dn("li",{children:Dn(bc,{id:$,isSelected:T,onChange:()=>{typeof u=="function"&&u(E),f||S||D(E,!!e)},option:q3(I)?I:{label:I,value:I},path:w,readOnly:f||S,uuid:p})},`${w} - ${E}`)})}),b,Dn(oe,{CustomComponent:x,Fallback:Dn(Be,{description:r,path:w})})]})]})},vc=je(T$);import{jsx as Br,jsxs as Yg}from"react/jsx-runtime";import{dequal as ok}from"dequal/lite";import{wordBoundariesRegex as rk}from"payload/shared";import*as Zg from"qs-esm";import{useCallback as Fn,useEffect as Em,useMemo as pS,useReducer as nk,useRef as Cc,useState as ls}from"react";import{c as E$}from"react/compiler-runtime";import{jsx as on,jsxs as Dm}from"react/jsx-runtime";import{getTranslation as Q3}from"@payloadcms/translations";import{Fragment as Hg,useEffect as Fm,useState as xc}from"react";var xa="relationship-add-new",K3=t=>{let e=E$(45),{Button:o,hasMany:n,path:r,relationTo:s,setValue:i,unstyled:a,value:l}=t,c=um(s),{permissions:u}=Ae(),[d,f]=xc(!1),[m,h]=xc(),p=c.length>1,g;e[0]!==c[0]||e[1]!==p?(g=()=>p?void 0:c[0],e[0]=c[0],e[1]=p,e[2]=g):g=e[2];let[b,v]=xc(g),[x,y]=xc(!1),{i18n:C,t:S}=k(),[w,D]=xc(!1),_=b?.slug,A;e[3]!==_?(A={collectionSlug:_},e[3]=_,e[4]=A):A=e[4];let[F,R,I]=Jt(A),{isDrawerOpen:E,toggleDrawer:T}=I,$;e[5]!==b?.slug||e[6]!==n||e[7]!==s||e[8]!==i||e[9]!==l?($=z=>{let{doc:ce,operation:J}=z;if(J==="create"){let ue=Array.isArray(s)?{relationTo:b?.slug,value:ce.id}:ce.id;(Array.isArray(s)&&Array.isArray(l)?!l.some(q=>q&&typeof q=="object"&&q.value===ce.id):l!==ce.id)&&i(n?[...Array.isArray(l)?l:[],ue]:ue),h(void 0)}},e[5]=b?.slug,e[6]=n,e[7]=s,e[8]=i,e[9]=l,e[10]=$):$=e[10];let j=$,N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=z=>{y(z)},e[11]=N):N=e[11];let P=N,L,V;e[12]!==u||e[13]!==c?(L=()=>{u&&(c.length===1?f(u.collections[c[0]?.slug]?.create):f(c.some(z=>u.collections[z?.slug]?.create)))},V=[u,c],e[12]=u,e[13]=c,e[14]=L,e[15]=V):(L=e[14],V=e[15]),Fm(L,V);let M,O;e[16]!==c||e[17]!==p||e[18]!==m?(O=()=>{p&&m&&v(c.find(z=>z?.slug===m))},M=[m,p,c],e[16]=c,e[17]=p,e[18]=m,e[19]=M,e[20]=O):(M=e[19],O=e[20]),Fm(O,M);let B,G;e[21]!==b||e[22]!==p||e[23]!==T?(B=()=>{p&&b&&(T(),h(void 0))},G=[T,p,b],e[21]=b,e[22]=p,e[23]=T,e[24]=B,e[25]=G):(B=e[24],G=e[25]),Fm(B,G);let X,Z;e[26]!==E||e[27]!==p?(X=()=>{p&&!E&&v(void 0)},Z=[E,p],e[26]=E,e[27]=p,e[28]=X,e[29]=Z):(X=e[28],Z=e[29]),Fm(X,Z);let te=c[0].labels.singular,U;if(e[30]!==o||e[31]!==F||e[32]!==R||e[33]!==b||e[34]!==C||e[35]!==j||e[36]!==r||e[37]!==u||e[38]!==x||e[39]!==c||e[40]!==d||e[41]!==w||e[42]!==S||e[43]!==a){U=Symbol.for("react.early_return_sentinel");e:{let z=S("fields:addNewLabel",{label:Q3(te,C)});if(d){U=Dm("div",{className:xa,id:`${r}-add-new`,children:[c.length===1&&Dm(Hg,{children:[on(R,{className:[`${xa}__add-button`,a&&`${xa}__add-button--unstyled`].filter(Boolean).join(" "),onClick:()=>D(!1),onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:o||Dm(Hg,{children:[on(go,{className:`${xa}__tooltip`,show:w,children:z}),on(jo,{})]})}),on(F,{onSave:j})]}),c.length>1&&Dm(Hg,{children:[on(ho,{button:o||on(ne,{buttonStyle:"none",className:`${xa}__add-button`,tooltip:x?void 0:S("fields:addNew"),children:on(jo,{})}),buttonType:"custom",horizontalAlign:"center",onToggleOpen:P,render:ce=>{let{close:J}=ce;return on(dp,{children:c.map(ue=>u.collections[ue?.slug].create?on(mp,{className:`${xa}__relation-button--${ue?.slug}`,onClick:()=>{J(),h(ue?.slug)},children:Q3(ue?.labels?.singular,C)},ue?.slug):null)})},size:"medium"}),b&&u.collections[b?.slug]?.create&&on(F,{onSave:j})]})]});break e}}e[30]=o,e[31]=F,e[32]=R,e[33]=b,e[34]=C,e[35]=j,e[36]=r,e[37]=u,e[38]=x,e[39]=c,e[40]=d,e[41]=w,e[42]=S,e[43]=a,e[44]=U}else U=e[44];return U!==Symbol.for("react.early_return_sentinel")?U:null};import{c as L$}from"react/compiler-runtime";import{jsx as Tm}from"react/jsx-runtime";import{createElement as $$}from"react";import{useEffect as rS,useId as k$,useState as nS}from"react";import{jsx as eS,jsxs as P$}from"react/jsx-runtime";import{hoistQueryParamsToAnd as N$}from"payload/shared";import{useCallback as Am,useEffect as tS,useState as zg}from"react";var oS=({allowCreate:t=!0,collectionSlugs:e,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,filterOptions:s,onBulkSelect:i,onSelect:a,overrideEntityVisibility:l=!0,selectedCollection:c})=>{let{closeModal:u,isModalOpen:d}=de(),{serverFunction:f}=Dt(),[m,h]=zg(void 0),[p,g]=zg(!0),{config:{collections:b},getEntityConfig:v}=H(),x=d(n),y=b.filter(({slug:T})=>e.includes(T)),[C,S]=zg(()=>{let T=c||y[0]?.slug,$=v({collectionSlug:T});return $?{label:$.labels,value:$.slug}:void 0}),[w,D,{drawerSlug:_}]=Jt({collectionSlug:C.value}),A=eo(T=>{T&&T!==C?.value&&S({label:v({collectionSlug:T})?.labels,value:T})});tS(()=>{A(c)},[c]);let F=Am(async(T,$)=>{try{let j={...$||{},where:{...$?.where||{}}},N=s?.[T];s&&typeof N!="boolean"&&(j.where=N$(j.where,N));let{List:P}=await f({name:"render-list",args:{allowCreate:t,collectionSlug:T,disableBulkDelete:!0,disableBulkEdit:!0,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,overrideEntityVisibility:l,query:j}});h(P),g(!1)}catch(j){console.error("Error rendering List View: ",j),x&&u(n)}},[f,u,t,n,x,r,s,l,o]);tS(()=>{m||F(C.value)},[F,m,C.value]);let R=Am(({doc:T})=>{typeof a=="function"&&a({collectionSlug:C.value,doc:T,docID:T.id}),u(_),u(n)},[u,_,n,a,C.value]),I=Am(T=>{F(C.value,T)},[F,C.value]),E=Am(T=>{S(T),F(T.value)},[F]);return p?eS(In,{}):P$(pg,{allowCreate:t,createNewDrawerSlug:_,DocumentDrawerToggler:D,drawerSlug:n,enabledCollections:e,onBulkSelect:i,onQueryChange:I,onSelect:a,selectedOption:C,setSelectedOption:E,children:[m,eS(w,{onSave:R})]})};var sS="list-drawer",j$=({depth:t,uuid:e})=>`list-drawer_${t}_${e}`,O$=({children:t,className:e,disabled:o,drawerSlug:n,onClick:r,...s})=>Tm(ur,{className:[e,`${sS}__toggler`].filter(Boolean).join(" "),disabled:o,onClick:r,slug:n,...s,children:t}),M$=t=>{let{drawerSlug:e}=t;return Tm(Pt,{className:sS,gutter:!1,Header:null,slug:e,children:Tm(oS,{...t})})},ai=t=>{let e=L$(42),{collectionSlugs:o,filterOptions:n,selectedCollection:r,uploads:s}=t,{config:i}=H(),{collections:a}=i,l=ct(),c=k$(),{closeModal:u,modalState:d,openModal:f,toggleModal:m}=de(),[h,p]=nS(!1),[g,b]=nS(o),v;e[0]!==l||e[1]!==c?(v=j$({depth:l,uuid:c}),e[0]=l,e[1]=c,e[2]=v):v=e[2];let x=v,y,C;e[3]!==x||e[4]!==d?(y=()=>{p(!!d[x]?.isOpen)},C=[d,x],e[3]=x,e[4]=d,e[5]=y,e[6]=C):(y=e[5],C=e[6]),rS(y,C);let S,w;e[7]!==g||e[8]!==a||e[9]!==s?(S=()=>{if(!g||g.length===0){let B=a.filter(G=>{let{upload:X}=G;return s?!!X:!0});b(B.map(B$))}},w=[g,s,a],e[7]=g,e[8]=a,e[9]=s,e[10]=S,e[11]=w):(S=e[10],w=e[11]),rS(S,w);let D;e[12]!==x||e[13]!==m?(D=()=>{m(x)},e[12]=x,e[13]=m,e[14]=D):D=e[14];let _=D,A;e[15]!==u||e[16]!==x?(A=()=>{u(x)},e[15]=u,e[16]=x,e[17]=A):A=e[17];let F=A,R;e[18]!==x||e[19]!==f?(R=()=>{f(x)},e[18]=x,e[19]=f,e[20]=R):R=e[20];let I=R,E,T;e[21]!==F||e[22]!==g||e[23]!==x||e[24]!==n||e[25]!==r||e[26]!==s?(T=B=>$$(M$,{...B,closeDrawer:F,collectionSlugs:g,drawerSlug:x,filterOptions:n,key:x,selectedCollection:r,uploads:s}),e[21]=F,e[22]=g,e[23]=x,e[24]=n,e[25]=r,e[26]=s,e[27]=T):T=e[27],E=T;let $=E,j,N;e[28]!==x?(N=B=>Tm(O$,{...B,drawerSlug:x}),e[28]=x,e[29]=N):N=e[29],j=N;let P=j,L,V;e[30]!==F||e[31]!==g||e[32]!==l||e[33]!==x||e[34]!==h||e[35]!==I||e[36]!==_?(V={closeDrawer:F,collectionSlugs:g,drawerDepth:l,drawerSlug:x,isDrawerOpen:h,openDrawer:I,setCollectionSlugs:b,toggleDrawer:_},e[30]=F,e[31]=g,e[32]=l,e[33]=x,e[34]=h,e[35]=I,e[36]=_,e[37]=V):V=e[37],L=V;let M=L,O;return e[38]!==$||e[39]!==M||e[40]!==P?(O=[$,P,M],e[38]=$,e[39]=M,e[40]=P,e[41]=O):O=e[41],O};function B$(t){let{slug:e}=t;return e}import{c as V$}from"react/compiler-runtime";import{useRef as G$}from"react";var Xg=(t,e)=>{let o=V$(3),n=G$(void 0),r;return o[0]!==t||o[1]!==e?(r=(...s)=>{let i=s,a=()=>{clearTimeout(n.current),t(...i)};clearTimeout(n.current),n.current=setTimeout(a,e)},o[0]=t,o[1]=e,o[2]=r):r=o[2],r};var Ug=({hasMany:t,relationTo:e,value:o})=>{let n=Array.isArray(e),r;if(Array.isArray(e)?r=e.reduce((i,a)=>({...i,[a]:[]}),{}):r={[e]:[]},o===null)return r;let s=(i,a)=>{(typeof a=="string"||typeof a=="number")&&typeof i=="string"&&(r[i]?r[i].push(a):r[i]=[a])};return t&&Array.isArray(o)?o.forEach(i=>{n&&typeof i=="object"&&"relationTo"in i&&"value"in i&&s(i.relationTo,i.value),!n&&typeof e=="string"&&s(e,i)}):n&&Array.isArray(e)?typeof o=="object"&&"relationTo"in o&&"value"in o&&s(o.relationTo,o.value):s(e,o),r};var iS=({allowEdit:t,options:e,value:o})=>{if(o||typeof o=="number"){if(Array.isArray(o))return o.map(r=>{let s;return e.forEach(i=>{s||(s=i.options.find(a=>typeof r=="object"?a.value===r.value&&a.relationTo===r.relationTo:r===a.value))}),s?{allowEdit:t,...s}:void 0});let n;return e.forEach(r=>{n||(n=r.options.find(s=>typeof o=="object"?s.value===o.value&&s.relationTo===o.relationTo:o===s.value))}),n?{allowEdit:t,...n}:void 0}};import{getTranslation as W$}from"@payloadcms/translations";var lS=t=>t.reduce((e,o)=>o.options?[...e,...lS(o.options)]:[...e,{id:o.value,relationTo:o.relationTo}],[]),aS=t=>t.sort((e,o)=>typeof e?.label?.localeCompare=="function"&&typeof o?.label?.localeCompare=="function"?e.label.localeCompare(o.label):0),cS=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,config:n,docs:r,i18n:s,ids:i=[],sort:a}=e,l=o.slug,c=lS(t),u=[...t],d=u.find(m=>m.label===o.labels.plural),f=r.reduce((m,h)=>{if(c.filter(p=>p.id===h.id&&p.relationTo===l).length===0){c.push({id:h.id,relationTo:l});let p=dr({collectionConfig:o,data:h,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${h.id}`,i18n:s});return[...m,{label:p,relationTo:l,value:h.id}]}return m},[]);if(i.forEach(m=>{c.filter(h=>h.id===m&&h.relationTo===l).length===0&&(c.push({id:m,relationTo:l}),f.push({allowEdit:!1,label:`${s.t("general:untitled")} - ID: ${m}`,relationTo:l,value:m}))}),d){let m=[...d.options,...f];d.options=a?aS(m):m}else u.push({label:W$(o.labels.plural,s),options:a?aS(f):f});return u}case"CLEAR":{let o=e.exemptValues?Array.isArray(e.exemptValues)?e.exemptValues:[e.exemptValues]:[];return t.filter(r=>{let s=r.options.filter(i=>o?o.some(a=>a&&i.value===(typeof a=="object"?a.value:a)):!1);return r.options=s,s.length>0})}case"REMOVE":{let{id:o,collection:n}=e,r=[...t],s=r.findIndex(i=>i.label===n.labels.plural);return s===-1||(r[s]={...r[s],options:r[s].options.filter(i=>i.value!==o)}),r}case"UPDATE":{let{collection:o,config:n,doc:r,i18n:s}=e,i=o.slug,a=[...t],l=dr({collectionConfig:o,data:r,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${r.id}`,i18n:s}),u=a.find(d=>d.label===o.labels.plural)?.options?.find(d=>d.value===r.id);return u&&(u.label=l,u.relationTo=i),a}default:return t}};import{c as H$}from"react/compiler-runtime";import{jsx as yc,jsxs as uS}from"react/jsx-runtime";import{Fragment as z$,useState as X$}from"react";var ya="relationship--multi-value-label",dS=t=>{let e=H$(26),{data:o,selectProps:n}=t,{allowEdit:r,label:s,relationTo:i,value:a}=o,l;e[0]!==n?(l=n===void 0?{}:n,e[0]=n,e[1]=l):l=e[1];let{customProps:c}=l,u;e[2]!==c?(u=c===void 0?{}:c,e[2]=c,e[3]=u):u=e[3];let{draggableProps:d,onDocumentDrawerOpen:f}=u,{permissions:m}=Ae(),[h,p]=X$(!1),{t:g}=k(),b=!!m?.collections?.[i]?.read,v;e[4]!==d?(v=d||{},e[4]=d,e[5]=v):v=e[5];let x;if(e[6]!==r||e[7]!==b||e[8]!==s||e[9]!==f||e[10]!==t||e[11]!==i||e[12]!==h||e[13]!==g||e[14]!==v||e[15]!==a){let y;e[17]!==r||e[18]!==b||e[19]!==s||e[20]!==f||e[21]!==i||e[22]!==h||e[23]!==g||e[24]!==a?(y=i&&b&&r!==!1&&yc(z$,{children:uS("button",{"aria-label":`Edit ${s}`,className:`${ya}__drawer-toggler`,onClick:()=>{p(!1),f({id:a,collectionSlug:i,hasReadPermission:b})},onKeyDown:U$,onMouseDown:Y$,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onTouchEnd:Z$,type:"button",children:[yc(go,{className:`${ya}__tooltip`,show:h,children:g("general:editLabel",{label:""})}),yc(_r,{className:`${ya}__icon`})]})}),e[17]=r,e[18]=b,e[19]=s,e[20]=f,e[21]=i,e[22]=h,e[23]=g,e[24]=a,e[25]=y):y=e[25],x=uS("div",{className:ya,children:[yc("div",{className:`${ya}__content`,children:yc(co.MultiValueLabel,{...t,innerProps:{className:`${ya}__text`,...v}})}),y]}),e[6]=r,e[7]=b,e[8]=s,e[9]=f,e[10]=t,e[11]=i,e[12]=h,e[13]=g,e[14]=v,e[15]=a,e[16]=x}else x=e[16];return x};function U$(t){t.key==="Enter"&&t.stopPropagation()}function Y$(t){return t.stopPropagation()}function Z$(t){return t.stopPropagation()}import{c as J$}from"react/compiler-runtime";import{jsx as Ca,jsxs as mS}from"react/jsx-runtime";import{Fragment as q$,useState as Q$}from"react";var wa="relationship--single-value",fS=t=>{let e=J$(24),{children:o,data:n,selectProps:r}=t,{allowEdit:s,label:i,relationTo:a,value:l}=n,c;e[0]!==r?(c=r===void 0?{}:r,e[0]=r,e[1]=c):c=e[1];let{customProps:u}=c,d;e[2]!==u?(d=u===void 0?{}:u,e[2]=u,e[3]=d):d=e[3];let{onDocumentDrawerOpen:f}=d,[m,h]=Q$(!1),{t:p}=k(),{permissions:g}=Ae(),b=!!g?.collections?.[a]?.read,v;if(e[4]!==s||e[5]!==o||e[6]!==b||e[7]!==i||e[8]!==f||e[9]!==t||e[10]!==a||e[11]!==m||e[12]!==p||e[13]!==l){let x;e[15]!==s||e[16]!==b||e[17]!==i||e[18]!==f||e[19]!==a||e[20]!==m||e[21]!==p||e[22]!==l?(x=a&&b&&s!==!1&&Ca(q$,{children:mS("button",{"aria-label":p("general:editLabel",{label:i}),className:`${wa}__drawer-toggler`,onClick:()=>{h(!1),f({id:l,collectionSlug:a,hasReadPermission:b})},onKeyDown:K$,onMouseDown:ek,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onTouchEnd:tk,type:"button",children:[Ca(go,{className:`${wa}__tooltip`,show:m,children:p("general:edit")}),Ca(_r,{})]})}),e[15]=s,e[16]=b,e[17]=i,e[18]=f,e[19]=a,e[20]=m,e[21]=p,e[22]=l,e[23]=x):x=e[23],v=Ca(co.SingleValue,{...t,className:wa,children:Ca("div",{className:`${wa}__label`,children:mS("div",{className:`${wa}__label-text`,children:[Ca("div",{className:`${wa}__text`,children:o}),x]})})}),e[4]=s,e[5]=o,e[6]=b,e[7]=i,e[8]=f,e[9]=t,e[10]=a,e[11]=m,e[12]=p,e[13]=l,e[14]=v}else v=e[14];return v};function K$(t){t.key==="Enter"&&t.stopPropagation()}function ek(t){return t.stopPropagation()}function tk(t){return t.stopPropagation()}var sk=10,wc="relationship",ik=t=>{let{field:e,field:{admin:{allowCreate:o=!0,allowEdit:n=!0,appearance:r="select",className:s,description:i,isSortable:a=!0,sortOptions:l}={},hasMany:c,label:u,localized:d,relationTo:f,required:m},path:h,readOnly:p,validate:g}=t,{config:b,getEntityConfig:v}=H(),{routes:{api:x},serverURL:y}=b,{i18n:C,t:S}=k(),{permissions:w}=Ae(),{code:D}=Ne(),_=Array.isArray(f),[A,F]=ls({id:void 0,collectionSlug:void 0,hasReadPermission:!1}),[R,I]=ls(-1),[E,T]=ls({}),[$,j]=ls(""),[N,P]=ls(""),[L,V]=ls(!1),[M,O]=ls(!1),[B,G]=ls(!1),X=Cc(!1),Z=Fn((W,ee)=>{if(typeof g=="function")return g(W,{...ee,required:m})},[g,m]),{customComponents:{AfterInput:te,BeforeInput:U,Description:z,Error:ce,Label:J}={},disabled:ue,filterOptions:re,initialValue:q,path:pe,setValue:he,showError:_e,value:ge}=Ee({potentiallyStalePath:h,validate:Z}),[Ve,Q]=nk(cS,[]),Le=Cc(ge);Le.current=ge;let[De,,{isDrawerOpen:ae,openDrawer:se}]=Jt({id:A.id,collectionSlug:A.collectionSlug}),Y=pS(()=>{let W=re;if(ge){let ee=(Array.isArray(ge)?ge:[ge]).reduce((le,ve)=>{if(typeof ve=="object"&&ve.relationTo)le[ve.relationTo]||(le[ve.relationTo]=[]),le[ve.relationTo].push(ve.value);else if(ve){let Fe=Array.isArray(f)?void 0:f;Fe&&(le[Fe]||(le[Fe]=[]),le[Fe].push(ve))}return le},{});(Array.isArray(f)?f:[f]).forEach(le=>{W={...W||{},[le]:{...typeof re?.[le]=="object"?re[le]:{},...ee[le]?{id:{not_in:ee[le]}}:{}}}})}return W},[re,ge,f]),[ie,,{closeDrawer:me,isDrawerOpen:we,openDrawer:ze}]=ai({collectionSlugs:_?f:[f],filterOptions:Y}),$e=Fn(({collectionSlug:W,doc:ee})=>{let le=_?{relationTo:W,value:ee.id}:ee.id;if(c){let ve=Array.isArray(ge)?ge:[];he([...ve,le])}else he(le);me()},[c,_,he,me,ge]),ot=Cc(!1),Xe=Fn(async({filterOptions:W,lastFullyLoadedRelation:ee,lastLoadedPage:le,onSuccess:ve,search:Fe,sort:Se,value:We})=>{if(!w)return;let Kt=typeof ee<"u"?ee:-1,Ot=Array.isArray(f)?f:[f],lt=Kt===-1?Ot:Ot.slice(Kt+1),fo=0,ro=Ug({hasMany:c,relationTo:f,value:We});$||(await lt.reduce(async(ko,ke)=>{let po=W?.[ke],Xo;if(N!==Fe?Xo=1:Xo=le[ke]+1,await ko,po===!1)return I(Ot.indexOf(ke)),Promise.resolve();if(fo<10){let zt=v({collectionSlug:ke}),wr=zt?.admin?.useAsTitle||"id",Ei=zt?.defaultSort||"id";typeof l=="string"?Ei=l:l?.[ke]&&(Ei=l[ke]);let tl={depth:0,draft:!0,limit:sk,locale:D,page:Xo,select:{[wr]:!0},sort:Ei,where:{and:[{id:{not_in:ro[ke]}}]}};Fe&&tl.where.and.push({[wr]:{like:Fe}}),po&&typeof po!="boolean"&&tl.where.and.push(po);let _s=await fetch(`${y}${x}/${ke}`,{body:Zg.stringify(tl),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(_s.ok){let Pi=await _s.json();T(Ni=>({...Ni,[ke]:Xo})),Pi.nextPage||I(Ot.indexOf(ke)),Pi.docs.length>0&&(fo+=Pi.docs.length,Q({type:"ADD",collection:zt,config:b,docs:Pi.docs,i18n:C,sort:Se}))}else _s.status===403?(I(Ot.indexOf(ke)),Q({type:"ADD",collection:zt,config:b,docs:[],i18n:C,ids:ro[ke],sort:Se})):j(S("error:unspecific"))}},Promise.resolve()),typeof ve=="function"&&ve())},[w,f,c,$,N,v,D,y,l,x,C,b,S]),Ue=Xg((W,ee)=>{Xe({filterOptions:re,lastLoadedPage:{},search:W,sort:!0,value:ee}),P(W)},300),ft=Fn((W,ee)=>{N!==W&&(T({}),Ue(W,ee,W!==""))},[N,Ue]),Qt=eo(W=>{let ee=Ug({hasMany:c,relationTo:f,value:W});Object.entries(ee).reduce(async(le,[ve,Fe])=>{await le;let Se=Fe.filter(We=>!Ve.find(Kt=>Kt?.options?.find(Ot=>Ot.value===We&&Ot.relationTo===ve)));if(Se.length>0){let We={depth:0,draft:!0,limit:Se.length,locale:D,where:{id:{in:Se}}};if(!$){let Kt=await fetch(`${y}${x}/${ve}`,{body:Zg.stringify(We),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"}),Ot=v({collectionSlug:ve}),lt=[];Kt.ok&&(lt=(await Kt.json()).docs),Q({type:"ADD",collection:Ot,config:b,docs:lt,i18n:C,ids:Se,sort:!0})}}},Promise.resolve())}),Ge=Cc(ge),Je=Cc(!0);Em(()=>{(Je.current||!ok(ge,Ge.current))&&Qt(ge),Je.current=!1,Ge.current=ge},[ge]),Em(()=>{let ee=(Array.isArray(f)?f:[f]).reduce((le,ve)=>(v({collectionSlug:ve})?.admin?.useAsTitle||"id")==="id"&&le,!0);O(!ee)},[f,v]);let Ye=eo(async W=>await Xe(W));Em(()=>{X.current&&B&&(V(!0),Ye({filterOptions:re,lastLoadedPage:{},onSuccess:()=>{X.current=!0,V(!1)},value:Le.current})),Q({type:"CLEAR",exemptValues:Le.current}),I(-1),T({})},[f,re,D,pe,B]);let xt=Fn(W=>{Q({type:"UPDATE",collection:W.collectionConfig,config:b,doc:W.doc,i18n:C});let ee=Le.current,le=W.doc.id;if(c){let ve=ee.some(Se=>typeof Se=="string"?Se===le:Se.value===le),Fe=ee.map(Se=>Se.value===le?{relationTo:W.collectionConfig.slug,value:le}:Se);he(Fe,ve)}else{let ve=ee===le;he({relationTo:W.collectionConfig.slug,value:le},ve)}},[C,b,c,he]),jt=Fn(W=>{Q({type:"ADD",collection:W.collectionConfig,config:b,docs:[W.doc],i18n:C,sort:!0}),he(c?Le.current?Le.current.concat({relationTo:W.collectionConfig.slug,value:W.doc.id}):null:{relationTo:W.collectionConfig.slug,value:W.doc.id})},[C,b,c,he]),gt=Fn(W=>{Q({id:W.id,type:"REMOVE",collection:W.collectionConfig,config:b,i18n:C}),he(c&&Le.current?Le.current.filter(ee=>ee.value!==W.id):null)},[C,b,c,he]),qe=Fn((W,ee)=>{if(!ee)return!0;let le=rk(ee||""),ve=250,Fe=String(W.label);for(;Fe.length>ve;){let Se=Fe.indexOf(" ",ee.length);if(le.test(Fe.slice(0,Se===-1?ee.length:Se+1)))return!0;Fe=Fe.slice(Se===-1?ee.length:Se+1)}return le.test(Fe.slice(-ve))},[]),Tt=Fn(({id:W,collectionSlug:ee,hasReadPermission:le})=>{ot.current=!0,F({id:W,collectionSlug:ee,hasReadPermission:le})},[]);Em(()=>{ot.current&&(se(),ot.current=!1)},[se,A]);let be=iS({allowEdit:n,options:Ve,value:ge});!Array.isArray(be)&&be?.value==="null"&&(be.value=null);let K=pS(()=>rt(e),[e]);return Yg("div",{className:[Ce,wc,s,_e&&"error",$&&"error-loading",(p||ue)&&`${wc}--read-only`,!(p||ue)&&o&&`${wc}--allow-create`].filter(Boolean).join(" "),id:`field-${pe.replace(/\./g,"__")}`,style:K,children:[Br(oe,{CustomComponent:J,Fallback:Br(xe,{label:u,localized:d,path:pe,required:m})}),Yg("div",{className:`${Ce}__wrap`,children:[Br(oe,{CustomComponent:ce,Fallback:Br(He,{path:pe,showError:_e})}),U,!$&&Yg("div",{className:`${wc}__wrap`,children:[Br(mt,{backspaceRemovesValue:!(ae||we),components:{MultiValueLabel:dS,SingleValue:fS,...r!=="select"&&{DropdownIndicator:null}},customProps:{disableKeyDown:ae||we,disableMouseDown:ae||we,onDocumentDrawerOpen:Tt,onSave:xt},disabled:p||ue||ae||we,filterOption:M?qe:void 0,getOptionValue:W=>{if(W)return c&&Array.isArray(f)?`${W.relationTo}_${W.value}`:W.value},isLoading:r==="select"&&L,isMulti:c,isSearchable:r==="select",isSortable:a,menuIsOpen:r==="select"?B:!1,onChange:p||ue?void 0:W=>{W===null?he(c?[]:null):c&&Array.isArray(W)?he(W?W.map(ee=>_?{relationTo:ee.relationTo,value:ee.value}:ee.value):null):_&&!Array.isArray(W)?he({relationTo:W.relationTo,value:W.value}):Array.isArray(W)||he(W.value)},onInputChange:W=>ft(W,ge),onMenuClose:()=>{G(!1)},onMenuOpen:()=>{r==="drawer"?ze():r==="select"&&(G(!0),X.current||(V(!0),Xe({filterOptions:re,lastLoadedPage:{},onSuccess:()=>{X.current=!0,V(!1)},value:q})))},onMenuScrollToBottom:()=>{Xe({filterOptions:re,lastFullyLoadedRelation:R,lastLoadedPage:E,search:N,sort:!1,value:q})},options:Ve,showError:_e,value:be??null}),!(p||ue)&&o&&Br(K3,{hasMany:c,path:pe,relationTo:f,setValue:he,value:ge})]}),$&&Br("div",{className:`${wc}__error-loading`,children:$}),te,Br(oe,{CustomComponent:z,Fallback:Br(Be,{description:i,path:pe})})]}),A.collectionSlug&&A.hasReadPermission&&Br(De,{onDelete:gt,onDuplicate:jt,onSave:xt}),r==="drawer"&&!p&&Br(ie,{allowCreate:o,enableRowSelections:!1,onSelect:$e})]})},Sc=je(ik);var Ic=()=>null;import{jsx as Jg}from"react/jsx-runtime";import"react";var hS="row",ak=t=>{let{field:{admin:{className:e,style:o}={},fields:n},forceRender:r=!1,indexPath:s="",parentPath:i="",parentSchemaPath:a="",permissions:l,readOnly:c}=t;return Jg(E2,{children:Jg("div",{className:[Ce,hS,e].filter(Boolean).join(" "),style:o||void 0,children:Jg(So,{className:`${hS}__fields`,fields:n,forceRender:r,margins:!1,parentIndexPath:s,parentPath:i,parentSchemaPath:a,permissions:l,readOnly:c})})})},Rc=je(ak);import{jsx as ck}from"react/jsx-runtime";import uk,{useCallback as bS,useMemo as dk}from"react";import{c as lk}from"react/compiler-runtime";import{jsx as li,jsxs as gS}from"react/jsx-runtime";import{getTranslation as qg}from"@payloadcms/translations";import"react";var Sa=t=>{let e=lk(39),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:a,hasMany:l,isClearable:c,isSortable:u,label:d,Label:f,localized:m,onChange:h,onInputChange:p,options:g,path:b,readOnly:v,required:x,showError:y,style:C,value:S}=t,w=l===void 0?!1:l,D=c===void 0?!0:c,_=u===void 0?!0:u,{i18n:A}=k(),F;if(e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==a||e[4]!==f||e[5]!==r||e[6]!==i||e[7]!==w||e[8]!==A||e[9]!==D||e[10]!==_||e[11]!==d||e[12]!==m||e[13]!==h||e[14]!==p||e[15]!==g||e[16]!==b||e[17]!==v||e[18]!==x||e[19]!==y||e[20]!==C||e[21]!==S){let R;if(w&&Array.isArray(S)){let j;e[23]!==A||e[24]!==g?(j=N=>{let P=g.find(L=>L.value===N);return{label:P?qg(P.label,A):N,value:P?.value??N}},e[23]=A,e[24]=g,e[25]=j):j=e[25],R=S.map(j)}else if(S){let j,N;if(e[26]!==A||e[27]!==g||e[28]!==S){let P;e[31]!==S?(P=L=>L.value===S,e[31]=S,e[32]=P):P=e[32],j=g.find(P),N=j?qg(j.label,A):S,e[26]=A,e[27]=g,e[28]=S,e[29]=j,e[30]=N}else j=e[29],N=e[30];R={label:N,value:j?.value??S}}else R=null;let I=y&&"error",E=v&&"read-only",T;e[33]!==r||e[34]!==I||e[35]!==E?(T=[Ce,"select",r,I,E].filter(Boolean),e[33]=r,e[34]=I,e[35]=E,e[36]=T):T=e[36];let $;e[37]!==A?($=j=>({...j,label:qg(j.label,A)}),e[37]=A,e[38]=$):$=e[38],F=gS("div",{className:T.join(" "),id:`field-${b.replace(/\./g,"__")}`,style:C,children:[li(oe,{CustomComponent:f,Fallback:li(xe,{label:d,localized:m,path:b,required:x})}),gS("div",{className:`${Ce}__wrap`,children:[li(oe,{CustomComponent:a,Fallback:li(He,{path:b,showError:y})}),n,li(mt,{disabled:v,isClearable:D,isMulti:w,isSortable:_,onChange:h,onInputChange:p,options:g.map($),showError:y,value:R}),o]}),li(oe,{CustomComponent:s,Fallback:li(Be,{description:i,path:b})})]}),e[0]=o,e[1]=n,e[2]=s,e[3]=a,e[4]=f,e[5]=r,e[6]=i,e[7]=w,e[8]=A,e[9]=D,e[10]=_,e[11]=d,e[12]=m,e[13]=h,e[14]=p,e[15]=g,e[16]=b,e[17]=v,e[18]=x,e[19]=y,e[20]=C,e[21]=S,e[22]=F}else F=e[22];return F};var mk=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e}),fk=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,isClearable:s=!0,isSortable:i=!0}={},hasMany:a=!1,label:l,localized:c,options:u=[],required:d},onChange:f,path:m,readOnly:h,validate:p}=t,g=uk.useMemo(()=>mk(u),[u]),b=bS((E,T)=>{if(typeof p=="function")return p(E,{...T,hasMany:a,options:g,required:d})},[p,d,a,g]),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Error:C,Label:S}={},disabled:w,path:D,setValue:_,showError:A,value:F}=Ee({potentiallyStalePath:m,validate:b}),R=bS(E=>{if(!h||w){let T=null;E&&a?Array.isArray(E)?T=E.map($=>$.value):T=[]:E&&!Array.isArray(E)&&(T=E.value),typeof f=="function"&&f(T),_(T)}},[h,w,a,_,f]),I=dk(()=>rt(e),[e]);return ck(Sa,{AfterInput:v,BeforeInput:x,className:n,Description:y,description:r,Error:C,hasMany:a,isClearable:s,isSortable:i,Label:S,label:l,localized:c,name:o,onChange:R,options:g,path:D,readOnly:h||w,required:d,showError:A,style:I,value:F})},_c=je(fk);import{c as kS}from"react/compiler-runtime";import{jsx as Tn,jsxs as jS}from"react/jsx-runtime";import{getTranslation as ej}from"@payloadcms/translations";import{tabHasName as km,toKebabCase as tj}from"payload/shared";import{useEffect as $S,useState as ab}from"react";var ES=Ds(eb(),1);import{jsx as Vr}from"react/jsx-runtime";import{dequal as TS}from"dequal/lite";import{useRouter as Wk}from"next/navigation.js";import{deepCopyObjectSimpleWithoutReactComponents as nb,getDataByPath as Hk,getSiblingData as zk,reduceFieldsToValues as sb,wait as Xk}from"payload/shared";import Uk,{useCallback as Wo,useEffect as ui,useReducer as Yk,useRef as Ac,useState as us}from"react";import{c as vk}from"react/compiler-runtime";import{jsx as CS,jsxs as xk}from"react/jsx-runtime";import yk from"react";function Ck(t){let e=[];for(let o of t)if(o){let n=o.split(" \u2192 "),r=!1;for(let s=0;s<e.length;s++)if(e[s].startsWith(n[0])){e.splice(s+1,0,o),r=!0;break}r||e.push(o)}return e}function wk(t){let[e,o]=t.split(":");if(!o)return{message:e};let n=o.split(",").map(r=>r.replaceAll(" > "," \u2192 ").trim());return n.length===1?{errors:n,message:`${e}:`}:{errors:Ck(n),message:`${e} (${n.length}):`}}function wS(t){let e=vk(5),{errorMessage:o}=t,n;e[0]!==o?(n=()=>wk(o),e[0]=o,e[1]=n):n=e[1];let[r]=yk.useState(n),{errors:s,message:i}=r,a;return e[2]!==s||e[3]!==i?(a=xk("div",{children:[i,Array.isArray(s)&&s.length>0?CS("ul",{"data-testid":"field-errors",children:s.map(Sk)}):null]}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function Sk(t,e){return CS("li",{children:t},e)}import{c as Ik}from"react/compiler-runtime";import{useEffect as SS,useState as Rk}from"react";function tb(t,e,o){let n=Ik(11),r;n[0]!==t?(r=()=>t,n[0]=t,n[1]=r):r=n[1];let[s,i]=Rk(r),a;n[2]!==o||n[3]!==t?(a=()=>{let d=setTimeout(()=>{i(()=>t)},o);return()=>{clearTimeout(d)}},n[2]=o,n[3]=t,n[4]=a):a=n[4];let l;n[5]!==o||n[6]!==e?(l=[...e,o],n[5]=o,n[6]=e,n[7]=l):l=n[7],SS(a,l);let c,u;n[8]!==s?(c=()=>{s()},u=[s],n[8]=s,n[9]=c,n[10]=u):(c=n[9],u=n[10]),SS(c,u)}import{useCallback as _k,useRef as IS}from"react";function Nm(){let t=IS([]),e=IS(!1);return{queueTask:_k((n,r)=>{t.current.push(n);async function s(){if(!e.current&&!(typeof r?.beforeProcess=="function"&&r.beforeProcess()===!1))for(;t.current.length>0;){let i=t.current.pop();t.current=[],e.current=!0;try{await i()}catch(a){console.error("Error in queued function:",a)}finally{e.current=!1,typeof r?.afterProcess=="function"&&r.afterProcess()}}}s()},[])}}import{c as Dk}from"react/compiler-runtime";import{jsx as Fk}from"react/jsx-runtime";import RS,{useState as Ak}from"react";var _S=RS.createContext(null),ob=t=>{let e=Dk(6),{children:o}=t,[n,r]=Ak(Tk),s;e[0]!==n?(s=u=>{let{collectionSlug:d}=u;return n.get(d)},e[0]=n,e[1]=s):s=e[1];let i=s,a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=u=>{let{collectionSlug:d,handler:f}=u;r(m=>{let h=new Map(m);return h.set(d,f),h})},e[2]=a):a=e[2];let l=a,c;return e[3]!==o||e[4]!==i?(c=Fk(_S,{value:{getUploadHandler:i,setUploadHandler:l},children:o}),e[3]=o,e[4]=i,e[5]=c):c=e[5],c},Dc=()=>{let t=RS.use(_S);if(t===null)throw new Error("useUploadHandlers must be used within UploadHandlersProvider");return t};function Tk(){return new Map}var DS={413:"Your request was too large to submit successfully."};var rb=Ds(fg(),1);import{dequal as Pk}from"dequal/lite";import{deepCopyObjectSimpleWithoutReactComponents as AS}from"payload/shared";import{dequal as Ek}from"dequal/lite";var FS=({acceptValues:t,currentState:e={},incomingState:o})=>{let n={...e};for(let[r,s]of Object.entries(o||{}))!(r in e)&&!s.addedByServer||(!t&&!s.addedByServer&&(delete s.value,delete s.initialValue),n[r]={...e[r],...s},Array.isArray(s.rows)&&r in e&&(n[r].rows=[...e[r]?.rows||[]],s.rows.forEach(i=>{let a=e[r].rows.findIndex(l=>l.id===i.id);a>-1&&(n[r].rows[a]={...e[r].rows[a],...i})})),s.valid!==!1&&(n[r].valid=!0),s.passesCondition!==!1&&(n[r].passesCondition=!0),delete n[r].addedByServer);return Ek(n,e)?e:n};var Ia=(t,e)=>{let o={},n=Object.entries(e).reduce((r,[s,i])=>{let a=r;if(s.indexOf(`${t}.`)===0){let[l]=s.replace(`${t}.`,"").split(".");a[l]||(a[l]={}),a[l][s.replace(`${t}.${String(l)}.`,"")]={...i}}else o[s]=i;return a},[]);return{remainingFields:o,rows:n}},Ra=(t,e)=>e.reduce((o,n,r)=>({...o,...Object.entries(n).reduce((s,[i,a])=>({...s,[`${t}.${r}.${i}`]:{...a}}),{})}),{});var cs=rb.default.default||rb.default;function Fc(t,e){switch(e.type){case"ADD_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,i=typeof r=="number"?r:t[n]?.rows?.length||0,a=[...t[n]?.rows||[]],l={id:s?.id?.value||new cs().toHexString(),collapsed:!1,isLoading:!0};o&&(l.blockType=o),a.splice(i,0,l),o&&(s.blockType={initialValue:o,valid:!0,value:o});let{remainingFields:c,rows:u}=Ia(n,t);return u.splice(i,0,s),{...c,...Ra(n,u),[`${n}.${i}.id`]:{initialValue:l.id,passesCondition:!0,valid:!0,value:l.id},[n]:{...t[n],disableFormData:!0,rows:a,value:u.length}}}case"ADD_SERVER_ERRORS":{let o={...t},n=[];return e.errors.forEach(({message:r,path:s})=>{o[s]={...o[s]||{initialValue:null,value:null},errorMessage:r,valid:!1};let i=s.split(".");i.length>1&&n.push({fieldErrorPath:s,parentPath:i.slice(0,i.length-1).join(".")})}),o=Object.entries(o).reduce((r,[s,i])=>{let a=n.reduce((c,{fieldErrorPath:u,parentPath:d})=>(d.startsWith(s)&&c.push(u),c),[]),l=!1;if(a.length>0){let c=Array.isArray(i.errorPaths)?i.errorPaths:[];a.forEach(u=>{c.includes(u)||(c.push(u),l=!0)}),l&&(r[s]={...i,errorPaths:c})}return l||(r[s]=i),r},{}),o}case"DUPLICATE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=Ia(o,t),i=[...t[o].rows||[]],a=AS(i[n]);a.id&&(a.id=new cs().toHexString());let l=AS(s[n]);l.id&&(l.id.value=new cs().toHexString(),l.id.initialValue=new cs().toHexString());for(let u of Object.keys(l).filter(d=>d.endsWith(".id"))){let d=l[u];d&&typeof d.value=="string"&&cs.isValid(d.value)&&(l[u].value=new cs().toHexString(),l[u].initialValue=new cs().toHexString())}return Object.keys(l).length>0&&(s.splice(n+1,0,l),i.splice(n+1,0,a)),{...r,...Ra(o,s),[o]:{...t[o],disableFormData:!0,rows:i,value:s.length}}}case"MERGE_SERVER_STATE":{let{acceptValues:o,prevStateRef:n,serverState:r}=e,s=FS({acceptValues:o,currentState:t||{},incomingState:r});return n.current=s,s}case"MOVE_ROW":{let{moveFromIndex:o,moveToIndex:n,path:r}=e,{remainingFields:s,rows:i}=Ia(r,t),a=i[o];i.splice(o,1),i.splice(n,0,a);let l=[...t[r]?.rows||[]],c={...l[o]};return l.splice(o,1),l.splice(n,0,c),{...s,...Ra(r,i),[r]:{...t[r],rows:l}}}case"REMOVE":{let o={...t};return o[e.path]&&delete o[e.path],o}case"REMOVE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=Ia(o,t),i=[...t[o]?.rows||[]];return s.splice(n,1),i.splice(n,1),{...r,[o]:{...t[o],disableFormData:s.length>0,rows:i,value:s.length},...Ra(o,s)}}case"REPLACE_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,{remainingFields:i,rows:a}=Ia(n,t),l=Math.max(0,Math.min(r,a?.length-1||0)),c=[...t[n]?.rows||[]];return c[l]={id:new cs().toHexString(),blockType:o||void 0,collapsed:!1},o&&(s.blockType={initialValue:o,valid:!0,value:o}),a[l]=s,{...i,...Ra(n,a),[n]:{...t[n],disableFormData:!0,rows:c,value:a.length}}}case"REPLACE_STATE":{if(e.optimize!==!1){let o={};for(let[n,r]of Object.entries(e.state)){let s=t[n];r.valid!==!1&&(r.valid=!0),r.passesCondition!==!1&&(r.passesCondition=!0),Pk(s,r)?s&&(o[n]=s):o[n]=r}return o}if(e.sanitize)for(let o of Object.values(e.state))o.valid!==!1&&(o.valid=!0),o.passesCondition!==!1&&(o.passesCondition=!0);return e.state}case"SET_ALL_ROWS_COLLAPSED":{let{path:o,updatedRows:n}=e;return{...t,[o]:{...t[o],rows:n}}}case"SET_ROW_COLLAPSED":{let{path:o,updatedRows:n}=e;return{...t,[o]:{...t[o],rows:n}}}case"UPDATE":{let o=Object.entries(e).reduce((r,[s,i])=>["disableFormData","errorMessage","initialValue","rows","valid","validate","value"].includes(s)?{...r,[s]:i}:r,t?.[e.path]||{});return{...t,[e.path]:o}}case"UPDATE_MANY":{let o={...t};return Object.entries(e.formState).forEach(([n,r])=>{o[n]=r}),o}default:return t}}var Nk=()=>{},Lk=()=>{},$k=()=>{},kk=()=>{},jk=()=>{},Ok=()=>{},Mk=()=>{},Bk=()=>{},Vk=()=>{},Gk=()=>{},Lm={addFieldRow:()=>{},buildRowErrors:()=>{},createFormData:jk,disabled:!1,dispatchFields:$k,fields:{},formRef:null,getData:()=>{},getDataByPath:()=>{},getField:()=>{},getFields:()=>({}),getSiblingData:Lk,initializing:void 0,isValid:!0,moveFieldRow:()=>{},removeFieldRow:()=>{},replaceFieldRow:()=>{},replaceState:()=>{},reset:Gk,setBackgroundProcessing:Bk,setDisabled:()=>{},setIsValid:()=>{},setModified:Ok,setProcessing:Mk,setSubmitted:Vk,submit:Nk,validateForm:kk};var Zk="form",An=t=>{let{id:e,collectionSlug:o,docConfig:n,docPermissions:r,getDocPreferences:s,globalSlug:i}=Pe(),{action:a,beforeSubmit:l,children:c,className:u,disabled:d,disableSuccessStatus:f,disableValidationOnSubmit:m,el:h,handleResponse:p,initialState:g,isDocumentForm:b,isInitializing:v,onChange:x,onSubmit:y,onSuccess:C,redirect:S,submitted:w,uuid:D,waitForAutocomplete:_}=t,A="method"in t?t?.method:void 0,F=Wk(),R=$i(),{code:I}=Ne(),{i18n:E,t:T}=k(),{refreshCookie:$,user:j}=Ae(),N=Qo(),{queueTask:P}=Nm(),{getFormState:L}=Dt(),{startRouteTransition:V}=st(),{getUploadHandler:M}=Dc(),{config:O}=H(),[B,G]=us(d||!1),[X,Z]=us(!1),[te,U]=us(!1),[z,ce]=us(!0),[J,ue]=us(v),[re,q]=us(!1),[pe,he]=us(!1),[_e,ge]=us(!1),Ve=Ac(null),Q=Ac({}),Le=Ac(null),De=Ac(!0),ae=Yk(Fc,{},()=>g),[se,Y]=ae;Q.current.fields=se;let ie=Ac(se),me=Wo(async()=>{let W={},ee=!0,le=Q.current.getData(),ve=Object.entries(Q.current.fields).map(async([Fe,Se])=>{let We=Se,Kt=Fe?Fe.split("."):[];if(Se.passesCondition!==!1){let Ot=We.valid;if("validate"in Se&&typeof Se.validate=="function"){let lt=Se.value;Se?.rows&&Array.isArray(Se.rows)&&(lt=Q.current.getDataByPath(Fe)),Ot=await Se.validate(lt,{...Se,id:e,collectionSlug:o,blockData:void 0,data:R?.getData?R.getData():le,event:"submit",operation:N,path:Kt,preferences:{},req:{payload:{config:O},t:T,user:j},siblingData:Q.current.getSiblingData(Fe)}),typeof Ot=="string"?(We.errorMessage=Ot,We.valid=!1):(We.valid=!0,We.errorMessage=void 0)}We.valid===!1&&(ee=!1)}W[Fe]=We});return await Promise.all(ve),TS(Q.current.fields,W)||Y({type:"REPLACE_STATE",state:W}),ce(ee),ee},[o,O,Y,e,N,T,j,R]),we=Wo(async(W={},ee)=>{let{action:le=a,method:ve=A,overrides:Fe={},skipValidation:Se}=W;if(B){ee&&ee.preventDefault();return}let We,Kt,Ot=new Promise((ke,po)=>{Kt=ke,We=po}),lt=le||typeof a=="string"||typeof a=="function";if(S||f||!lt?(Kt=ke=>fe.success(ke),We=ke=>fe.error(ke)):fe.promise(Ot,{error:ke=>ke,loading:T("general:submitting"),success:ke=>ke}),ee&&(ee.stopPropagation(),ee.preventDefault()),q(!0),G(!0),_&&await Xk(100),Array.isArray(l)){let ke,po=nb(Q.current.fields);await l.reduce(async(zt,wr)=>{await zt,ke=await wr({formState:po})},Promise.resolve());let Xo=Object.entries(ke).every(([,zt])=>zt.valid!==!1);if(ce(Xo),!Xo)return q(!1),ge(!0),G(!1),Y({type:"REPLACE_STATE",state:ke})}let fo=Se||m?!0:await Q.current.validateForm();if(ce(fo),!fo){We(T("error:correctInvalidFields")),q(!1),ge(!0),G(!1);return}let ro={};if(typeof Fe=="function"?ro=Fe(Q.current.fields):typeof Fe=="object"&&(ro=Fe),y){let ke=nb(Q.current.fields),po=sb(ke,!0);for(let[Xo,zt]of Object.entries(ro))po[Xo]=zt;y(ke,po)}if(!lt){q(!1),ge(!0),G(!1);return}let ko=await Q.current.createFormData(ro,{mergeOverrideData:typeof Fe!="function"});try{let ke;if(typeof le=="string"?ke=await Qe[ve.toLowerCase()](le,{body:ko,headers:{"Accept-Language":E.language}}):typeof a=="function"&&(ke=await a(ko)),U(!1),G(!1),typeof p=="function"){p(ke,Kt,We);return}let po=ke.headers.get("content-type"),Xo=po&&po.indexOf("application/json")!==-1,zt={};if(Xo&&(zt=await ke.json()),ke.status<400){if(typeof C=="function"){let wr=await C(zt);wr&&Y({type:"MERGE_SERVER_STATE",acceptValues:!0,prevStateRef:ie,serverState:wr})}ge(!1),q(!1),S?V(()=>F.push(S)):f||Kt(zt.message||T("general:submissionSuccessful"))}else{if(q(!1),ge(!0),Q.current={...Q.current},zt.message){We(zt.message);return}if(Array.isArray(zt.errors)){let[Ei,tl]=zt.errors.reduce(([_s,Pi],Ni)=>{let cv=[],Bf=[];return Ni?.message&&Bf.push(Ni),Array.isArray(Ni?.data?.errors)&&Ni.data?.errors.forEach(Vf=>{Vf?.path?cv.push(Vf):Bf.push(Vf)}),[[..._s,...cv],[...Pi,...Bf]]},[[],[]]);ce(!1),Y({type:"ADD_SERVER_ERRORS",errors:Ei}),tl.forEach(_s=>{We(Vr(wS,{errorMessage:_s.message||T("error:unknown")}))});return}let wr=DS?.[ke.status]||ke?.statusText||T("error:unknown");We(wr)}}catch(ke){console.error("Error submitting form",ke),q(!1),ge(!0),G(!1),We(ke.message)}},[l,V,a,f,m,B,Y,p,A,y,C,S,F,T,E,_]),ze=Wo(()=>Q.current.fields,[]),$e=Wo(W=>Q.current.fields[W],[]),ot=Wo(()=>sb(Q.current.fields,!0),[]),Xe=Wo(W=>zk(Q.current.fields,W),[]),Ue=Wo(W=>Hk(Q.current.fields,W),[]),ft=Wo(async(W,{mergeOverrideData:ee=!0})=>{let le=sb(Q.current.fields,!0),ve=le?.file;if(n&&"upload"in n&&n.upload&&ve){delete le.file;let We=M({collectionSlug:o});if(typeof We=="function"){let Kt=ve.name,Ot=await We({file:ve,updateFilename:lt=>{Kt=lt}});ve=JSON.stringify({clientUploadContext:Ot,collectionSlug:o,filename:Kt,mimeType:ve.type,size:ve.size})}}ee?le={...le,...W}:le=W;let Fe={_payload:JSON.stringify(le)};return n&&"upload"in n&&n.upload&&ve&&(Fe.file=ve),(0,ES.serialize)(Fe,{indices:!0,nullsAsUndefineds:!1})},[o,n,M]),Qt=Wo(async W=>{let ee=or(Le),le=await s(),{state:ve}=await L({id:e,collectionSlug:o,data:W,docPermissions:r,docPreferences:le,globalSlug:i,locale:I,operation:N,renderAllFields:!0,schemaPath:o||i,signal:ee.signal,skipValidation:!0});Q.current={...Lm},U(!1),Y({type:"REPLACE_STATE",state:ve}),Le.current=null},[o,Y,i,e,N,L,r,s,I]),Ge=Wo(W=>{Q.current={...Lm},U(!1),Y({type:"REPLACE_STATE",state:W})},[Y]),Je=Wo(({blockType:W,path:ee,rowIndex:le,subFieldState:ve})=>{let Fe=Ue(ee)||[],Se=le===void 0?Fe.length:le;Y({type:"ADD_ROW",blockType:W,path:ee,rowIndex:Se,subFieldState:ve}),U(!0)},[Y,Ue]),Ye=Wo(({moveFromIndex:W,moveToIndex:ee,path:le})=>{Y({type:"MOVE_ROW",moveFromIndex:W,moveToIndex:ee,path:le}),U(!0)},[Y]),xt=Wo(({path:W,rowIndex:ee})=>{Y({type:"REMOVE_ROW",path:W,rowIndex:ee}),U(!0)},[Y]),jt=Wo(({blockType:W,path:ee,rowIndex:le,subFieldState:ve})=>{let Fe=Ue(ee),Se=le===void 0?Fe.length:le;Y({type:"REPLACE_ROW",blockType:W,path:ee,rowIndex:Se,subFieldState:ve}),U(!0)},[Y,Ue]);ui(()=>{let W=Le.current;return()=>{tr(W)}},[]),ui(()=>{v!==void 0&&ue(v)},[v]),Q.current.submit=we,Q.current.getFields=ze,Q.current.getField=$e,Q.current.getData=ot,Q.current.getSiblingData=Xe,Q.current.getDataByPath=Ue,Q.current.validateForm=me,Q.current.createFormData=ft,Q.current.setModified=U,Q.current.setProcessing=q,Q.current.setBackgroundProcessing=he,Q.current.setSubmitted=ge,Q.current.setIsValid=ce,Q.current.disabled=B,Q.current.setDisabled=G,Q.current.formRef=Ve,Q.current.reset=Qt,Q.current.replaceState=Ge,Q.current.dispatchFields=Y,Q.current.addFieldRow=Je,Q.current.removeFieldRow=xt,Q.current.moveFieldRow=Ye,Q.current.replaceFieldRow=jt,Q.current.uuid=D,Q.current.initializing=J,Q.current.isValid=z,ui(()=>{Z(!0)},[]),ui(()=>{typeof d=="boolean"&&G(d)},[d]),ui(()=>{typeof w=="boolean"&&ge(w)},[w]),ui(()=>{g&&(Q.current={...Lm},Y({type:"REPLACE_STATE",optimize:!1,sanitize:!0,state:g}))},[g,Y]),Bs(()=>{$()},15e3,[se]),ui(()=>{Q.current={...Q.current},U(!1)},[I]);let gt=[u,Zk].filter(Boolean).join(" "),qe=eo(W=>{P(async()=>{if(Array.isArray(x)){let ee;for(let le of x)ee=await le({formState:nb(se),submitted:W});Y({type:"MERGE_SERVER_STATE",prevStateRef:ie,serverState:ee})}})});tb(()=>{(De.current||!TS(se,ie.current))&&te&&qe(_e),ie.current=se,De.current=!1},[te,_e,se],250);let Tt=b?Au:Uk.Fragment,be=b?{value:Q.current}:{};return Vr(h||"form",{action:typeof a=="function"?void 0:a,className:gt,method:A,noValidate:!0,onSubmit:W=>void Q.current.submit({},W),ref:Ve,children:Vr(Tt,{...be,children:Vr(Fu,{value:Q.current,children:Vr(Tu,{value:{fields:se,...Q.current},children:Vr(Eu,{value:_e,children:Vr(op,{value:!X||X&&J,children:Vr(Pu,{value:re,children:Vr(tp,{value:pe,children:Vr(Nu,{value:te,children:Vr(al.Provider,{value:ae,children:c})})})})})})})})})})};import{c as Jk}from"react/compiler-runtime";import{jsx as PS,jsxs as NS}from"react/jsx-runtime";import{getTranslation as qk}from"@payloadcms/translations";import{tabHasName as LS}from"payload/shared";import Qk,{useState as Kk}from"react";var $m="tabs-field__tab-button",ib=t=>{let e=Jk(15),{hidden:o,isActive:n,parentPath:r,setIsActive:s,tab:i}=t,{i18n:a}=k(),[l,c]=Kk(void 0),u;if(e[0]!==l||e[1]!==o||e[2]!==a||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i){let d=[...r?r.split(".").slice(0,-1):[],...LS(i)?[i.name]:[]],f=l>0,m=PS(Ys,{fields:i.fields,path:d,setErrorCount:c}),h=f&&`${$m}--has-error`,p=n&&`${$m}--active`,g=o&&`${$m}--hidden`,b;e[8]!==h||e[9]!==p||e[10]!==g?(b=[$m,h,p,g].filter(Boolean),e[8]=h,e[9]=p,e[10]=g,e[11]=b):b=e[11];let v;e[12]!==a||e[13]!==i?(v=i.label?qk(i.label,a):LS(i)?i.name:"",e[12]=a,e[13]=i,e[14]=v):v=e[14],u=NS(Qk.Fragment,{children:[m,NS("button",{className:b.join(" "),onClick:s,type:"button",children:[v,f&&PS(io,{count:l,i18n:a})]})]}),e[0]=l,e[1]=o,e[2]=a,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=u}else u=e[7];return u};var En="tabs-field";function _a({activeTabConfig:t,path:e}){let o=e;return km(t)&&t.name&&(e?o=`${e}.${t.name}`:o=t.name),o}var oj=t=>{let e=kS(89),{field:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:a,permissions:l,readOnly:c}=t,{admin:u,tabs:d}=o,f;e[0]!==u?(f=u===void 0?{}:u,e[0]=u,e[1]=f):f=e[1];let{className:m}=f,h;e[2]!==d?(h=d===void 0?[]:d,e[2]=d,e[3]=h):h=e[3];let p=h,g=n===void 0?!1:n,b=r===void 0?"":r,v=s===void 0?"":s,x=i===void 0?"":i,y=a===void 0?"":a,{getPreference:C,setPreference:S}=Fo(),{preferencesKey:w}=Pe(),{i18n:D}=k(),{isWithinCollapsible:_}=qn(),A;e[4]!==p?(A=De=>{let[ae]=De;return p.map((se,Y)=>{let ie=se?.id;return{index:Y,passesCondition:ae?.[ie]?.passesCondition??!0,tab:se}})},e[4]=p,e[5]=A):A=e[5];let F=Et(A),R;e[6]!==F?(R=()=>F.filter(nj)?.[0]?.index??0,e[6]=F,e[7]=R):R=e[7];let[I,E]=ab(R),T=`tabs-${b}`,$;e[8]!==I||e[9]!==v||e[10]!==p?($=()=>_a({activeTabConfig:p[I],path:v}),e[8]=I,e[9]=v,e[10]=p,e[11]=$):$=e[11];let[j,N]=ab($),P;e[12]!==x||e[13]!==p[0]?(P=()=>_a({activeTabConfig:p[0],path:x}),e[12]=x,e[13]=p[0],e[14]=P):P=e[14];let[L,V]=ab(P),M;e[15]!==I||e[16]!==j||e[17]!==v||e[18]!==p?(M=km(p[I])?j:v,e[15]=I,e[16]=j,e[17]=v,e[18]=p,e[19]=M):M=e[19];let O=M,B=F[I],G=B?.tab,X;e[20]!==I||e[21]!==L||e[22]!==x||e[23]!==p?(X=km(p[I])?L:x,e[20]=I,e[21]=L,e[22]=x,e[23]=p,e[24]=X):X=e[24];let Z=X,te=G.admin?.description??G.description,U;e[25]!==te||e[26]!==D?(U=typeof te=="function"?te({i18n:D,t:D.t}):te,e[25]=te,e[26]=D,e[27]=U):U=e[27];let z=U,ce=F.some(sj),J;e[28]!==C||e[29]!==v||e[30]!==x||e[31]!==y||e[32]!==w||e[33]!==S||e[34]!==p||e[35]!==T?(J=async De=>{E(De),N(_a({activeTabConfig:p[De],path:v})),V(_a({activeTabConfig:p[De],path:x}));let ae=await C(w);w&&S(w,{...ae,...y?{fields:{...ae?.fields||{},[y]:{...ae?.fields?.[y],tabIndex:De}}}:{fields:{...ae?.fields,[T]:{...ae?.fields?.[T],tabIndex:De}}}})},e[28]=C,e[29]=v,e[30]=x,e[31]=y,e[32]=w,e[33]=S,e[34]=p,e[35]=T,e[36]=J):J=e[36];let ue=J,re,q;e[37]!==C||e[38]!==v||e[39]!==x||e[40]!==y||e[41]!==w||e[42]!==p||e[43]!==T?(re=()=>{w&&(async()=>{let ae=await C(w),Y=(y?ae?.fields?.[y]?.tabIndex:ae?.fields?.[T]?.tabIndex)||0;E(Y),N(_a({activeTabConfig:p[Y],path:v})),V(_a({activeTabConfig:p[Y],path:x}))})()},q=[y,C,w,T,p,v,x],e[37]=C,e[38]=v,e[39]=x,e[40]=y,e[41]=w,e[42]=p,e[43]=T,e[44]=re,e[45]=q):(re=e[44],q=e[45]),$S(re,q);let pe;e[46]!==B?.passesCondition||e[47]!==ue||e[48]!==F?(pe=()=>{if(B?.passesCondition===!1){let De=F.find(ij);De&&ue(De.index)}},e[46]=B?.passesCondition,e[47]=ue,e[48]=F,e[49]=pe):pe=e[49];let he;e[50]!==B||e[51]!==ue||e[52]!==F?(he=[B,F,ue],e[50]=B,e[51]=ue,e[52]=F,e[53]=he):he=e[53],$S(pe,he);let _e=_&&`${En}--within-collapsible`,ge=!ce&&`${En}--hidden`,Ve;e[54]!==m||e[55]!==_e||e[56]!==ge?(Ve=[Ce,m,En,_e,ge].filter(Boolean),e[54]=m,e[55]=_e,e[56]=ge,e[57]=Ve):Ve=e[57];let Q=Ve.join(" "),Le;if(e[58]!==O||e[59]!==Z||e[60]!==G||e[61]!==I||e[62]!==B||e[63]!==j||e[64]!==z||e[65]!==g||e[66]!==ue||e[67]!==b||e[68]!==y||e[69]!==l||e[70]!==c||e[71]!==Q||e[72]!==F){let De;e[74]!==I||e[75]!==ue||e[76]!==y?(De=se=>{let{index:Y,passesCondition:ie,tab:me}=se;return Tn(ib,{hidden:!ie,isActive:I===Y,parentPath:y,setIsActive:()=>{ue(Y)},tab:me},Y)},e[74]=I,e[75]=ue,e[76]=y,e[77]=De):De=e[77];let ae;e[78]!==O||e[79]!==Z||e[80]!==G||e[81]!==B||e[82]!==j||e[83]!==z||e[84]!==g||e[85]!==b||e[86]!==l||e[87]!==c?(ae=G&&Tn(rj,{description:z,fields:G.fields,forceRender:g,hidden:!1,parentIndexPath:km(G)?"":`${b?b+"-":""}`+String(B.index),parentPath:O,parentSchemaPath:Z,path:j,permissions:l&&typeof l=="object"&&"name"in G?l[G.name]&&typeof l[G.name]=="object"&&"fields"in l[G.name]?l[G.name].fields:l[G.name]:l,readOnly:c}),e[78]=O,e[79]=Z,e[80]=G,e[81]=B,e[82]=j,e[83]=z,e[84]=g,e[85]=b,e[86]=l,e[87]=c,e[88]=ae):ae=e[88],Le=Tn("div",{className:Q,children:jS(dg,{children:[Tn("div",{className:`${En}__tabs-wrap`,children:Tn("div",{className:`${En}__tabs`,children:F.map(De)})}),Tn("div",{className:`${En}__content-wrap`,children:ae})]})}),e[58]=O,e[59]=Z,e[60]=G,e[61]=I,e[62]=B,e[63]=j,e[64]=z,e[65]=g,e[66]=ue,e[67]=b,e[68]=y,e[69]=l,e[70]=c,e[71]=Q,e[72]=F,e[73]=Le}else Le=e[73];return Le},Tc=je(oj);function rj(t){let e=kS(19),{description:o,fields:n,forceRender:r,hidden:s,label:i,parentIndexPath:a,parentPath:l,parentSchemaPath:c,permissions:u,readOnly:d}=t,{i18n:f}=k(),{customComponents:m,path:h}=Ee(),p;e[0]!==m?(p=m===void 0?{}:m,e[0]=m,e[1]=p):p=e[1];let{AfterInput:g,BeforeInput:b,Description:v,Field:x}=p;if(x)return x;let y=s&&`${En}__tab--hidden`,C=i&&`${En}__tabConfigLabel-${tj(ej(i,f))}`,S;e[2]!==y||e[3]!==C?(S=[y,`${En}__tab`,C].filter(Boolean),e[2]=y,e[3]=C,e[4]=S):S=e[4];let w=S.join(" "),D;return e[5]!==g||e[6]!==b||e[7]!==v||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==a||e[12]!==l||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==d||e[17]!==w?(D=jS("div",{className:w,children:[Tn(oe,{CustomComponent:v,Fallback:Tn(Be,{description:o,marginPlacement:"bottom",path:h})}),b,Tn(So,{fields:n,forceRender:r,parentIndexPath:a,parentPath:l,parentSchemaPath:c,permissions:u,readOnly:d}),g]}),e[5]=g,e[6]=b,e[7]=v,e[8]=o,e[9]=n,e[10]=r,e[11]=a,e[12]=l,e[13]=c,e[14]=h,e[15]=u,e[16]=d,e[17]=w,e[18]=D):D=e[18],D}function nj(t){let{passesCondition:e}=t;return e}function sj(t){let{passesCondition:e}=t;return e}function ij(t){let{passesCondition:e}=t;return e}import{jsx as dj}from"react/jsx-runtime";import{useCallback as MS,useEffect as mj,useMemo as fj,useState as pj}from"react";import{c as aj}from"react/compiler-runtime";import{jsx as ds,jsxs as OS}from"react/jsx-runtime";import{getTranslation as lj}from"@payloadcms/translations";import"react";var lb=t=>{let e=aj(31),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:a,hasMany:l,inputRef:c,Label:u,label:d,localized:f,maxRows:m,onChange:h,onKeyDown:p,path:g,placeholder:b,readOnly:v,required:x,rtl:y,showError:C,style:S,value:w,valueToRender:D}=t,{i18n:_,t:A}=k(),F=uj,R=C&&"error",I=v&&"read-only",E=l&&"has-many",T;e[0]!==r||e[1]!==R||e[2]!==I||e[3]!==E?(T=[Ce,"text",r,R,I,E].filter(Boolean),e[0]=r,e[1]=R,e[2]=I,e[3]=E,e[4]=T):T=e[4];let $=T.join(" "),j;return e[5]!==o||e[6]!==n||e[7]!==s||e[8]!==a||e[9]!==u||e[10]!==i||e[11]!==l||e[12]!==_||e[13]!==c||e[14]!==d||e[15]!==f||e[16]!==m||e[17]!==h||e[18]!==p||e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==x||e[23]!==y||e[24]!==C||e[25]!==S||e[26]!==A||e[27]!==$||e[28]!==w||e[29]!==D?(j=OS("div",{className:$,style:S,children:[ds(oe,{CustomComponent:u,Fallback:ds(xe,{label:d,localized:f,path:g,required:x})}),OS("div",{className:`${Ce}__wrap`,children:[ds(oe,{CustomComponent:a,Fallback:ds(He,{path:g,showError:C})}),n,l?ds(mt,{className:`field-${g.replace(/\./g,"__")}`,components:{DropdownIndicator:null},customProps:{editableProps:F},disabled:v,filterOption:()=>m?!(Array.isArray(w)&&m&&w.length>=m):!0,isClearable:!1,isCreatable:!0,isMulti:!0,isSortable:!0,menuIsOpen:!1,noOptionsMessage:()=>Array.isArray(w)&&w.length>=m?A("validation:limitReached",{max:m,value:w.length+1}):null,onChange:h,options:[],placeholder:A("general:enterAValue"),showError:C,value:D}):ds("input",{"data-rtl":y,disabled:v,id:`field-${g?.replace(/\./g,"__")}`,name:g,onChange:h,onKeyDown:p,placeholder:lj(b,_),ref:c,type:"text",value:w||""}),o,ds(oe,{CustomComponent:s,Fallback:ds(Be,{description:i,path:g})})]})]}),e[5]=o,e[6]=n,e[7]=s,e[8]=a,e[9]=u,e[10]=i,e[11]=l,e[12]=_,e[13]=c,e[14]=d,e[15]=f,e[16]=m,e[17]=h,e[18]=p,e[19]=g,e[20]=b,e[21]=v,e[22]=x,e[23]=y,e[24]=C,e[25]=S,e[26]=A,e[27]=$,e[28]=w,e[29]=D,e[30]=j):j=e[30],j};function cj(t){t.currentTarget.contentEditable="false"}function uj(t,e,o){let n=`${e}--editable`;return{onBlur:cj,onClick:r=>{r.currentTarget.contentEditable="true",r.currentTarget.classList.add(n),r.currentTarget.focus()},onKeyDown:r=>{if(r.key==="Enter"||r.key==="Tab"||r.key==="Escape"){if(r.currentTarget.contentEditable="false",r.currentTarget.classList.remove(n),t.value.value=r.currentTarget.innerText,t.label=r.currentTarget.innerText,t.value.value.replaceAll(`
|
|
54
|
+
`,""))o.onChange(o.value,{action:"create-option",option:t});else if(Array.isArray(o.value)){let s=o.value.filter(i=>i.id!==t.id);o.onChange(s,{action:"pop-value",removedValue:t})}r.preventDefault()}r.stopPropagation()}}}var hj=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rtl:s}={},hasMany:i,label:a,localized:l,maxLength:c,maxRows:u,minLength:d,minRows:f,required:m},inputRef:h,path:p,readOnly:g,validate:b}=t,v=Ne(),{config:{localization:x}}=H(),y=MS((L,V)=>{if(typeof b=="function")return b(L,{...V,maxLength:c,minLength:d,required:m})},[b,d,c,m]),{customComponents:{AfterInput:C,BeforeInput:S,Description:w,Error:D,Label:_}={},disabled:A,path:F,setValue:R,showError:I,value:E}=Ee({potentiallyStalePath:p,validate:y}),T=Zi({fieldLocalized:l,fieldRTL:s,locale:v,localizationConfig:x||void 0}),[$,j]=pj([]),N=MS(L=>{if(!(g||A)){let V;L?Array.isArray(L)?V=L.map(M=>M.value?.value||M.value):V=[L.value?.value||L.value]:V=[],R(V)}},[g,R,A]);mj(()=>{i&&Array.isArray(E)&&j(E.map((L,V)=>({id:`${L}${V}`,label:`${L}`,value:{toString:()=>`${L}${V}`,value:L?.value||L}})))},[E,i]);let P=fj(()=>rt(e),[e]);return dj(lb,{AfterInput:C,BeforeInput:S,className:o,Description:w,description:n,Error:D,hasMany:i,inputRef:h,Label:_,label:a,localized:l,maxRows:u,minRows:f,onChange:i?N:L=>{R(L.target.value)},path:F,placeholder:r,readOnly:g||A,required:m,rtl:T,showError:I,style:P,value:E||"",valueToRender:$})},di=je(hj);import{jsx as vj}from"react/jsx-runtime";import{getTranslation as xj}from"@payloadcms/translations";import{useCallback as yj,useMemo as Cj}from"react";import{c as gj}from"react/compiler-runtime";import{jsx as ms,jsxs as BS}from"react/jsx-runtime";import{getTranslation as bj}from"@payloadcms/translations";import"react";var cb=t=>{let e=gj(25),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:a,Label:l,label:c,localized:u,onChange:d,path:f,placeholder:m,readOnly:h,required:p,rows:g,rtl:b,showError:v,style:x,value:y}=t,{i18n:C}=k(),S=v&&"error",w=h&&"read-only",D;e[0]!==r||e[1]!==S||e[2]!==w?(D=[Ce,"textarea",r,S,w].filter(Boolean),e[0]=r,e[1]=S,e[2]=w,e[3]=D):D=e[3];let _=D.join(" "),A;return e[4]!==o||e[5]!==n||e[6]!==s||e[7]!==a||e[8]!==l||e[9]!==i||e[10]!==C||e[11]!==c||e[12]!==u||e[13]!==d||e[14]!==f||e[15]!==m||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==_||e[23]!==y?(A=BS("div",{className:_,style:x,children:[ms(oe,{CustomComponent:l,Fallback:ms(xe,{label:c,localized:u,path:f,required:p})}),BS("div",{className:`${Ce}__wrap`,children:[ms(oe,{CustomComponent:a,Fallback:ms(He,{path:f,showError:v})}),n,ms("label",{className:"textarea-outer",htmlFor:`field-${f.replace(/\./g,"__")}`,children:ms("textarea",{"data-rtl":b,disabled:h,id:`field-${f.replace(/\./g,"__")}`,name:f,onChange:d,placeholder:bj(m,C),rows:g,value:y||""})}),o,ms(oe,{CustomComponent:s,Fallback:ms(Be,{description:i,path:f})})]})]}),e[4]=o,e[5]=n,e[6]=s,e[7]=a,e[8]=l,e[9]=i,e[10]=C,e[11]=c,e[12]=u,e[13]=d,e[14]=f,e[15]=m,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=_,e[23]=y,e[24]=A):A=e[24],A};var wj=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rows:s,rtl:i}={},label:a,localized:l,maxLength:c,minLength:u,required:d},path:f,readOnly:m,validate:h}=t,{i18n:p}=k(),{config:{localization:g}}=H(),b=Ne(),v=Zi({fieldLocalized:l,fieldRTL:i,locale:b,localizationConfig:g||void 0}),x=yj((T,$)=>{if(typeof h=="function")return h(T,{...$,maxLength:c,minLength:u,required:d})},[h,d,c,u]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:D}={},disabled:_,path:A,setValue:F,showError:R,value:I}=Ee({potentiallyStalePath:f,validate:x}),E=Cj(()=>rt(e),[e]);return vj(cb,{AfterInput:y,BeforeInput:C,className:o,Description:S,description:n,Error:w,Label:D,label:a,localized:l,onChange:T=>{F(T.target.value)},path:A,placeholder:xj(r,p),readOnly:m||_,required:d,rows:s,rtl:v,showError:R,style:E,value:I})},Ec=je(wj);var Pc=()=>null;import{jsx as YO}from"react/jsx-runtime";import ZO,{useMemo as JO}from"react";import{jsx as $t,jsxs as bi,Fragment as Uc}from"react/jsx-runtime";import*as UI from"qs-esm";import Xr,{useCallback as HI,useEffect as zI,useMemo as XI}from"react";import{c as kI}from"react/compiler-runtime";import{jsx as pi,jsxs as $O}from"react/jsx-runtime";import{validateMimeType as kO}from"payload/shared";import nn from"react";import{jsx as Om,jsxs as ub}from"react/jsx-runtime";import Aj from"react";import{jsx as Sj}from"react/jsx-runtime";import fs from"react";var VS=t=>{t.preventDefault(),t.stopPropagation()},Ij="dropzone";function mi({children:t,className:e,disabled:o=!1,dropzoneStyle:n="default",multipleFiles:r,onChange:s}){let i=fs.useRef(null),[a,l]=fs.useState(!1),c=fs.useCallback(p=>{if(!r&&p.length>1){let g=new DataTransfer;g.items.add(p[0]),s(g.files)}else s(p)},[r,s]),u=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),p.clipboardData.files&&p.clipboardData.files.length>0&&c(p.clipboardData.files)},[c]),d=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),l(!0)},[]),f=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),l(!1)},[]),m=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),l(!1),p.dataTransfer.files&&p.dataTransfer.files.length>0&&(c(p.dataTransfer.files),l(!1),p.dataTransfer.clearData())},[c]);fs.useEffect(()=>{let p=i.current;return p&&!o?(p.addEventListener("dragenter",d),p.addEventListener("dragleave",f),p.addEventListener("dragover",VS),p.addEventListener("drop",m),p.addEventListener("paste",u),()=>{p.removeEventListener("dragenter",d),p.removeEventListener("dragleave",f),p.removeEventListener("dragover",VS),p.removeEventListener("drop",m),p.removeEventListener("paste",u)}):()=>null},[o,d,f,m,u]);let h=[Ij,e,a?"dragging":"",`dropzoneStyle--${n}`].filter(Boolean).join(" ");return Sj("div",{className:h,ref:i,children:t})}import{jsx as WS,jsxs as Dj}from"react/jsx-runtime";import"react";import{c as Rj}from"react/compiler-runtime";import{jsx as GS}from"react/jsx-runtime";import"react";var _j="drawer-close-button";function jm(t){let e=Rj(3),{onClick:o}=t,{t:n}=k(),r;return e[0]!==o||e[1]!==n?(r=GS("button",{"aria-label":n("general:close"),className:_j,onClick:o,type:"button",children:GS(pt,{})}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r}var Fj="bulk-upload--drawer-header";function Da({onClose:t,title:e}){return Dj("div",{className:Fj,children:[WS("h2",{title:e,children:e}),WS(jm,{onClick:t})]})}var Mm="bulk-upload--add-files";function Bm({acceptMimeTypes:t,onCancel:e,onDrop:o}){let{t:n}=k(),r=Aj.useRef(null);return ub("div",{className:Mm,children:[Om(Da,{onClose:e,title:n("upload:addFiles")}),Om("div",{className:`${Mm}__dropArea`,children:ub(mi,{multipleFiles:!0,onChange:o,children:[Om(ne,{buttonStyle:"pill",iconPosition:"left",onClick:()=>{r.current&&r.current.click()},size:"small",children:n("upload:selectFile")}),Om("input",{accept:t,"aria-hidden":"true",className:`${Mm}__hidden-input`,hidden:!0,multiple:!0,onChange:s=>{s.target.files&&s.target.files.length>0&&o(s.target.files)},ref:r,type:"file"}),ub("p",{className:`${Mm}__dragAndDropText`,children:[n("general:or")," ",n("upload:dragAndDrop")]})]})})]})}import{c as PO}from"react/compiler-runtime";import{jsx as zc,jsxs as Rb}from"react/jsx-runtime";import{getTranslation as NO}from"@payloadcms/translations";import{reduceFieldsToValues as LO}from"payload/shared";import"react";import{c as sI}from"react/compiler-runtime";import{jsx as Wr,jsxs as Lc}from"react/jsx-runtime";import"react";import{c as Yj}from"react/compiler-runtime";import{jsx as zm,jsxs as Zj}from"react/jsx-runtime";import"react";import{jsx as Ej,jsxs as Pj}from"react/jsx-runtime";import{isImage as Nj}from"payload/shared";import*as Vm from"qs-esm";import tt from"react";var HS=t=>new Promise((e,o)=>{let n=new Image;n.src=URL.createObjectURL(t),n.onload=()=>{let s,i,a=n.width/n.height;a>1?(i=280,s=280/a):(i=280*a,s=280);let l=new OffscreenCanvas(i,s);l.getContext("2d").drawImage(n,0,0,i,s),l.convertToBlob({type:"image/jpeg",quality:.25}).then(u=>{URL.revokeObjectURL(n.src);let d=new FileReader;d.onload=()=>e(d.result),d.onerror=o,d.readAsDataURL(u)}).catch(o)},n.onerror=r=>{URL.revokeObjectURL(n.src),o(r)}});var zS=Ds(eb(),1);import{reduceFieldsToValues as Tj}from"payload/shared";async function XS(t={},e={},o,n){let r=Tj(t,!0),s=r?.file;if(s&&delete r.file,s&&typeof n=="function"){let l=s.name,c=await n({file:s,updateFilename:u=>{l=u}});s=JSON.stringify({clientUploadContext:c,collectionSlug:o,filename:l,mimeType:s.type,size:s.size})}let i={...r,...e},a={_payload:JSON.stringify(i),file:s};return(0,zS.serialize)(a,{indices:!0,nullsAsUndefineds:!1})}function US(t,e){switch(e.type){case"ADD_FORMS":{let o=[];for(let n=0;n<e.files.length;n++)o[n]={errorCount:0,formState:{...e.initialState||{},file:{initialValue:e.files[n],valid:!0,value:e.files[n]}},uploadEdits:{}};return{...t,activeIndex:0,forms:[...o,...t.forms]}}case"REMOVE_FORM":{let o=[...t.forms],[n]=o.splice(e.index,1),r=t.activeIndex>=e.index,s=t.activeIndex===e.index?e.index:r?t.activeIndex-1:t.activeIndex,i=Math.min(o.length-1,s);return{...t,activeIndex:r?i:t.activeIndex,forms:o,totalErrorCount:t.totalErrorCount-n.errorCount}}case"REPLACE":return{...t,...e.state};case"SET_ACTIVE_INDEX":return{...t,activeIndex:e.index};case"UPDATE_ERROR_COUNT":{let o=[...t.forms];return o[e.index].errorCount=e.count,{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}case"UPDATE_FORM":{let o=[...t.forms];return o[e.index].errorCount=e.errorCount,o[e.index]={...o[e.index],formState:{...o[e.index].formState,...e.formState},uploadEdits:{...o[e.index].uploadEdits,...e.uploadEdits}},{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}default:return t}}var YS=tt.createContext({activeIndex:0,addFiles:()=>Promise.resolve(),bulkUpdateForm:()=>null,collectionSlug:"",docPermissions:void 0,documentSlots:{},forms:[],getFormDataRef:{current:()=>({})},hasPublishPermission:!1,hasSavePermission:!1,hasSubmitted:!1,isInitializing:!1,removeFile:()=>{},saveAllDocs:()=>Promise.resolve(),setActiveIndex:()=>0,setFormTotalErrorCount:()=>{},thumbnailUrls:[],totalErrorCount:0,updateUploadEdits:()=>{}}),Lj={activeIndex:0,forms:[],totalErrorCount:0};function ZS({children:t}){let{config:e}=H(),{routes:{api:o},serverURL:n}=e,{code:r}=Ne(),{i18n:s,t:i}=k(),{getDocumentSlots:a,getFormState:l}=Dt(),{getUploadHandler:c}=Dc(),[u,d]=tt.useState({}),[f,m]=tt.useState(!1),[h,p]=tt.useState(),[g,b]=tt.useState(!1),[v,x]=tt.useState(!1),[y,C]=tt.useState(!1),[S,w]=tt.useState(!1),[D,_]=tt.useState(!1),[A,F]=tt.useReducer(US,Lj),{activeIndex:R,forms:I,totalErrorCount:E}=A,T=tt.useRef(I);T.current=I;let $=I.length,j=tt.useRef([]),N=tt.useRef(new Set),[P,L]=tt.useState([]);tt.useEffect(()=>{(async()=>{let Y=[...j.current];for(let ie=0;ie<$;ie++){let me=T.current[ie].formState.file.value;if(N.current.has(me)||!me||!Nj(me.type))continue;N.current.add(me);let we=await HS(me);Y[ie]=we,j.current=Y,L([...Y]),await new Promise(ze=>setTimeout(ze,100))}})()},[$]);let{toggleLoadingOverlay:V}=dm(),{closeModal:M}=de(),{collectionSlug:O,drawerSlug:B,initialFiles:G,onSuccess:X}=Ho(),[Z,te]=tt.useState(!1),[U,z]=tt.useState(""),ce=tt.useRef(!1),J=tt.useRef(null),ue=tt.useRef(()=>({})),re=`${o}/${O}`,q=tt.useCallback(async()=>{let Y={locale:r||void 0},ie=`/${O}/access`,we=await(await fetch(`${n}${o}${ie}?${Vm.stringify(Y)}`,{credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"post"})).json(),ze=await fetch(`${n}${o}${ie}?${Vm.stringify(Y)}`,{body:JSON.stringify({_status:"published"}),credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"POST"}).then($e=>$e.json());p(we),b(wl({collectionSlug:O,docPermissions:we,isEditing:!1})),x(ze?.update),w(!0)},[o,r,O,s.language,n]),pe=tt.useCallback(async Y=>{Y?.signal&&Y.abort("aborting previous fetch for initial form state without files");let ie=await a({collectionSlug:O});d(ie);try{let{state:me}=await l({collectionSlug:O,docPermissions:h,docPreferences:{fields:{}},locale:r,operation:"create",renderAllFields:!0,schemaPath:O,skipValidation:!0});J.current=me,C(!0)}catch{}},[a,O,l,h,r]),he=tt.useCallback(Y=>{let ie=ue.current();F({type:"REPLACE",state:{activeIndex:Y,forms:I.map((me,we)=>we===R?{errorCount:me.errorCount,formState:ie,uploadEdits:me.uploadEdits}:me)}})},[I,R]),_e=tt.useCallback(async Y=>{V({isLoading:!0,key:"addingDocs"}),y||await pe(),F({type:"ADD_FORMS",files:Y,initialState:J.current}),V({isLoading:!1,key:"addingDocs"})},[pe,y,V]),ge=tt.useCallback(Y=>{j.current=j.current.filter((ie,me)=>!Y.includes(me)),L([...j.current])},[]),Ve=tt.useCallback(Y=>{F({type:"REMOVE_FORM",index:Y}),ge([Y])},[ge]),Q=tt.useCallback(({errorCount:Y,index:ie})=>{F({type:"UPDATE_ERROR_COUNT",count:Y,index:ie})},[]),Le=tt.useCallback(async({overrides:Y}={})=>{let ie=ue.current(),me=[...I];me[R]={errorCount:me[R].errorCount,formState:ie,uploadEdits:me[R].uploadEdits};let we=[];te(!0);for(let Ue=0;Ue<me.length;Ue++)try{let ft=me[Ue];z(i("general:uploadingBulk",{current:Ue+1,total:me.length}));let Qt=`${re}${Vm.stringify({uploadEdits:ft?.uploadEdits||void 0},{addQueryPrefix:!0})}`,Ge=await fetch(Qt,{body:await XS(ft.formState,Y,O,c({collectionSlug:O})),method:"POST"}),Je=await Ge.json();Ge.status===201&&Je?.doc&&we.push(Je.doc);let[Ye,xt]=(Je?.errors||[]).reduce(([jt,gt],qe)=>{let Tt=[],be=[];return qe?.message&&be.push(qe),Array.isArray(qe?.data?.errors)&&qe.data?.errors.forEach(K=>{K?.path?Tt.push(K):be.push(K)}),[[...jt,...Tt],[...gt,...be]]},[[],[]]);me[Ue]={errorCount:Ye.length,formState:Fc(me[Ue].formState,{type:"ADD_SERVER_ERRORS",errors:Ye})},(Ge.status===413||Ge.status===400)&&(me[Ue]={...me[Ue],errorCount:me[Ue].errorCount+1},fe.error(xt[0]?.message))}catch{}m(!0),z(""),te(!1);let ze=[],$e=[];me.forEach(({errorCount:Ue},ft)=>{Ue?ze.push(me[ft]):$e.push(ft)});let ot=Math.max(0,me.length-ze.length),Xe=me.length-ot;ot&&(fe.success(`Successfully saved ${ot} files`),typeof X=="function"&&X(we,Xe),ze.length&&$e.length&&ge($e)),Xe?fe.error(`Failed to save ${Xe} files`):M(B),F({type:"REPLACE",state:{activeIndex:0,forms:ze,totalErrorCount:ze.reduce((Ue,{errorCount:ft})=>Ue+ft,0)}})},[re,R,I,ge,X,O,c,i,M,B]),De=tt.useCallback(async(Y,ie)=>{for(let me=0;me<I.length;me++)if(Object.entries(Y).forEach(([we,ze])=>{I[me].formState[we]&&(I[me].formState[we].value=ze,F({type:"UPDATE_FORM",errorCount:I[me].errorCount,formState:I[me].formState,index:me}))}),typeof ie=="function"&&ie(),f){let{state:we}=await l({collectionSlug:O,docPermissions:h,docPreferences:null,formState:I[me].formState,operation:"create",schemaPath:O}),ze=Object.values(we).reduce(($e,ot)=>ot?.valid===!1?$e+1:$e,0);F({type:"UPDATE_FORM",errorCount:ze,formState:we,index:me})}},[O,h,I,l,f]),ae=tt.useCallback(Y=>{F({type:"UPDATE_FORM",errorCount:I[R].errorCount,formState:I[R].formState,index:R,uploadEdits:Y})},[R,I]),se=tt.useCallback(()=>{F({type:"REPLACE",state:{forms:I.map(Y=>({...Y,uploadEdits:{}}))}})},[I]);return tt.useEffect(()=>{O&&(y||pe(),S||q(),G&&_(!y||!S),y&&G&&!ce.current&&(_e(G),ce.current=!0))},[_e,G,pe,q,O,y,S]),Pj(YS,{value:{activeIndex:A.activeIndex,addFiles:_e,bulkUpdateForm:De,collectionSlug:O,docPermissions:h,documentSlots:u,forms:I,getFormDataRef:ue,hasPublishPermission:v,hasSavePermission:g,hasSubmitted:f,isInitializing:D,removeFile:Ve,resetUploadEdits:se,saveAllDocs:Le,setActiveIndex:he,setFormTotalErrorCount:Q,thumbnailUrls:P,totalErrorCount:E,updateUploadEdits:ae},children:[Z&&Ej(In,{animationDuration:"250ms",loadingText:U,overlayType:"fullscreen",show:!0}),t]})}function Io(){return tt.use(YS)}import{jsx as Gr,jsxs as db}from"react/jsx-runtime";import{getTranslation as Hj}from"@payloadcms/translations";import{unflatten as tI}from"payload/shared";import zj,{useCallback as mb,useEffect as Xj,useMemo as Uj,useState as oI}from"react";import{c as Mj}from"react/compiler-runtime";import{jsx as eI,jsxs as Bj}from"react/jsx-runtime";import{useState as Vj}from"react";var JS=t=>{let e=["file","mimeType","thumbnailURL","width","height","filesize","filename","url","focalX","focalY","sizes"];return t.filter(o=>!e.includes("name"in o&&o.name))};import{fieldAffectsData as $j,fieldHasSubFields as kj,fieldIsHiddenOrDisabled as jj,getFieldPermissions as Oj}from"payload/shared";import{fieldAffectsData as qS}from"payload/shared";var Fa=(t,e)=>t?qS(e)?`${t}.${e.name}`:t:qS(e)?e.name:"";import{jsx as Gm,jsxs as QS}from"react/jsx-runtime";import{Fragment as KS}from"react";var Nc=({CustomLabel:t,field:e,prefix:o})=>QS(KS,{children:[o?QS(KS,{children:[Gm("span",{style:{display:"inline-block"},children:o})," > "]}):null,Gm("span",{style:{display:"inline-block"},children:Gm(oe,{CustomComponent:t,Fallback:Gm(xe,{label:"label"in e&&e.label})})})]});var Wm=({fields:t,formState:e,labelPrefix:o=null,parentPath:n="",path:r="",permissions:s})=>{if(!t)return[];let i=e?.[r]?.customComponents?.Label;return t?.reduce((a,l)=>{let{operation:c,permissions:u,read:d}=Oj({field:l,operation:"update",parentName:n?.includes(".")?n.split(".")[n.split(".").length-1]:n,permissions:s});if(($j(l)||l.type==="ui")&&(l.admin?.disableBulkEdit||l.unique||jj(l)||"readOnly"in l&&l.readOnly||!c||!d))return a;if(!(l.type==="array"||l.type==="blocks")&&kj(l))return[...a,...Wm({fields:l.fields,labelPrefix:Nc({CustomLabel:i,field:l,prefix:o}),parentPath:r,path:Fa(r,l),permissions:u})];if(l.type==="tabs"&&"tabs"in l)return[...a,...l.tabs.reduce((m,h)=>{if("fields"in h){let p="name"in h&&h.name;return[...m,...Wm({fields:h.fields,labelPrefix:o,parentPath:r,path:p?Fa(r,l):r,permissions:u})]}},[])];let f={label:Nc({CustomLabel:i,field:l,prefix:o}),value:{field:l,fieldPermissions:u,path:Fa(r,l)}};return[...a,f]},[])};var Gj="field-select",Hm=t=>{let e=Mj(14),{fields:o,onChange:n,permissions:r}=t,{t:s}=k(),{dispatchFields:i,getFields:a}=Oe(),l;e[0]!==o||e[1]!==a||e[2]!==r?(l=()=>Wm({fields:JS(o),formState:a(),permissions:r}),e[0]=o,e[1]=a,e[2]=r,e[3]=l):l=e[3];let[c]=Vj(l),u;if(e[4]!==i||e[5]!==a||e[6]!==n||e[7]!==c||e[8]!==s){let d;e[10]!==i||e[11]!==a||e[12]!==n?(d=f=>n({dispatchFields:i,formState:a(),selected:f}),e[10]=i,e[11]=a,e[12]=n,e[13]=d):d=e[13],u=Bj("div",{className:Gj,children:[eI(xe,{label:s("fields:selectFieldsToEdit")}),eI(mt,{getOptionValue:Wj,isMulti:!0,onChange:d,options:c})]}),e[4]=i,e[5]=a,e[6]=n,e[7]=c,e[8]=s,e[9]=u}else u=e[9];return u};function Wj(t){return typeof t.value=="object"&&"path"in t.value?String(t.value.path):String(t.value)}var rI=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,forms:i}=t,[a,l]=oI(!1),{permissions:c}=Ae(),{i18n:u,t:d}=k(),{closeModal:f}=de(),{bulkUpdateForm:m}=Io(),{getFormState:h}=Dt(),p=zj.useRef(null),[g,b]=oI([]),v=c?.collections?.[r.slug],x=Uj(()=>tI(g.reduce((w,D)=>(w[D.value.path]=!0,w),{})),[g]),y=mb(async({formState:w,submitted:D})=>{let _=or(p),{state:A}=await h({collectionSlug:r.slug,docPermissions:v,docPreferences:null,formState:w,operation:"update",schemaPath:r.slug,select:x,signal:_.signal,skipValidation:!D});return p.current=null,A},[h,r,v,x]);Xj(()=>{let w=p.current;return()=>{tr(w)}},[]);let C=mb(w=>{let D=g.reduce((_,A)=>(w[A.value.path]&&(_[A.value.path]=w[A.value.path].value),_),{});m(D,()=>f(s))},[f,s,m,g]),S=mb(async({dispatchFields:w,formState:D,selected:_})=>{l(!0),b(_||[]);let{state:A}=await h({collectionSlug:r.slug,docPermissions:v,docPreferences:null,formState:D,operation:"update",schemaPath:r.slug,select:tI(_.reduce((F,R)=>(F[R.value.path]=!0,F),{})),skipValidation:!0});w({type:"UPDATE_MANY",formState:A}),l(!1)},[h,r,v]);return db("div",{className:`${gr}__main`,children:[db("div",{className:`${gr}__header`,children:[Gr("h2",{className:`${gr}__header__title`,children:d("general:editingLabel",{count:i.length,label:Hj(i.length>1?o:n,u)})}),Gr("button",{"aria-label":d("general:close"),className:`${gr}__header__close`,id:`close-drawer__${s}`,onClick:()=>f(s),type:"button",children:Gr(pt,{})})]}),db(An,{className:`${gr}__form`,isInitializing:a,onChange:[y],onSubmit:C,children:[Gr(Hm,{fields:e,onChange:S,permissions:v.fields}),g.length===0?null:Gr("div",{className:"render-fields",children:g.map((w,D)=>{let{value:{field:_,fieldPermissions:A,path:F}}=w;return Gr(Aa,{clientFieldConfig:_,indexPath:"",parentPath:"",parentSchemaPath:"",path:F,permissions:A},`${F}-${D}`)})}),Gr("div",{className:`${gr}__sidebar-wrap`,children:Gr("div",{className:`${gr}__sidebar`,children:Gr("div",{className:`${gr}__sidebar-sticky-wrap`,children:Gr("div",{className:`${gr}__document-actions`,children:Gr(ne,{type:"submit",children:d("general:applyChanges")})})})})})]})]})};var gr="edit-many-bulk-uploads",nI=t=>{let e=Yj(5),{collection:o,collection:n}=t,{slug:r}=o===void 0?{}:o,{permissions:s}=Ae(),{t:i}=k(),{forms:a}=Io(),c=s?.collections?.[r]?.update,u=`edit-${r}-bulk-uploads`;if(!c)return null;let d;return e[0]!==n||e[1]!==u||e[2]!==a||e[3]!==i?(d=Zj("div",{className:gr,children:[zm(ur,{"aria-label":i("general:editAll"),className:`${gr}__toggle`,slug:u,children:i("general:editAll")}),zm(Ns,{children:zm(Pt,{Header:null,slug:u,children:zm(rI,{collection:n,drawerSlug:u,forms:a})})})]}),e[0]=n,e[1]=u,e[2]=a,e[3]=i,e[4]=d):d=e[4],d};var Ta="bulk-upload--actions-bar";function iI(t){let e=sI(15),{collectionConfig:o}=t,{activeIndex:n,forms:r,setActiveIndex:s}=Io(),{t:i}=k(),a=n+1,l;if(e[0]!==n||e[1]!==o||e[2]!==r.length||e[3]!==s||e[4]!==i||e[5]!==a){let c;e[7]!==n||e[8]!==r.length||e[9]!==s?(c=()=>{let d=n-1;d<0?s(r.length-1):s(d)},e[7]=n,e[8]=r.length,e[9]=s,e[10]=c):c=e[10];let u;e[11]!==n||e[12]!==r.length||e[13]!==s?(u=()=>{let d=n+1;d===r.length?s(0):s(d)},e[11]=n,e[12]=r.length,e[13]=s,e[14]=u):u=e[14],l=Lc("div",{className:Ta,children:[Lc("div",{className:`${Ta}__navigation`,children:[Lc("p",{className:`${Ta}__locationText`,children:[Wr("strong",{children:a})," of ",Wr("strong",{children:r.length})]}),Lc("div",{className:`${Ta}__controls`,children:[Wr(ne,{"aria-label":i("general:previous"),buttonStyle:"none",onClick:c,type:"button",children:Wr(Ze,{direction:"left"})}),Wr(ne,{"aria-label":i("general:next"),buttonStyle:"none",onClick:u,type:"button",children:Wr(Ze,{direction:"right"})})]}),Wr(nI,{collection:o})]}),Wr(fb,{className:`${Ta}__saveButtons`})]}),e[0]=n,e[1]=o,e[2]=r.length,e[3]=s,e[4]=i,e[5]=a,e[6]=l}else l=e[6];return l}function fb(t){let e=sI(12),{className:o}=t,{getEntityConfig:n}=H(),{t:r}=k(),{collectionSlug:s,hasPublishPermission:i,hasSavePermission:a,saveAllDocs:l}=Io(),c;e[0]!==s||e[1]!==n?(c=n({collectionSlug:s}),e[0]=s,e[1]=n,e[2]=c):c=e[2];let u=c,d;e[3]!==o?(d=[`${Ta}__buttons`,o].filter(Boolean),e[3]=o,e[4]=d):d=e[4];let f=d.join(" "),m;return e[5]!==u?.versions?.drafts||e[6]!==i||e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==f?(m=Lc("div",{className:f,children:[u?.versions?.drafts&&a?Wr(ne,{buttonStyle:"secondary",onClick:()=>void l({overrides:{_status:"draft"}}),children:r("version:saveDraft")}):null,u?.versions?.drafts&&i?Wr(ne,{onClick:()=>void l({overrides:{_status:"published"}}),children:r("version:publish")}):null,!u?.versions?.drafts&&a?Wr(ne,{onClick:()=>void l(),children:r("general:save")}):null]}),e[5]=u?.versions?.drafts,e[6]=i,e[7]=a,e[8]=l,e[9]=r,e[10]=f,e[11]=m):m=e[11],m}import{c as Jj}from"react/compiler-runtime";import{jsx as qj}from"react/jsx-runtime";import"react";var $c="bulk-upload--discard-without-saving";function aI(){let t=Jj(9),{t:e}=k(),{closeModal:o}=de(),{drawerSlug:n}=Ho(),r;t[0]!==o?(r=()=>{o($c)},t[0]=o,t[1]=r):r=t[1];let s=r,i;t[2]!==o||t[3]!==n?(i=()=>{o(n),o($c)},t[2]=o,t[3]=n,t[4]=i):i=t[4];let a=i,l;return t[5]!==s||t[6]!==a||t[7]!==e?(l=qj(It,{body:e("general:changesNotSaved"),cancelLabel:e("general:stayOnThisPage"),confirmLabel:e("general:leaveAnyway"),heading:e("general:leaveWithoutSaving"),modalSlug:$c,onCancel:s,onConfirm:a}),t[5]=s,t[6]=a,t[7]=e,t[8]=l):l=t[8],l}import{jsx as xs,jsxs as xO}from"react/jsx-runtime";import{useRouter as yO,useSearchParams as CO}from"next/navigation.js";import{formatAdminURL as wO}from"payload/shared";import Hc,{useCallback as TI,useEffect as EI}from"react";import{c as Qj}from"react/compiler-runtime";import{jsx as Kj}from"react/jsx-runtime";import{createContext as eO,use as tO,useState as oO}from"react";var lI=eO({mostRecentUpdate:null,reportUpdate:t=>null}),pb=t=>{let e=Qj(3),{children:o}=t,[n,r]=oO(null),s;return e[0]!==o||e[1]!==n?(s=Kj(lI,{value:{mostRecentUpdate:n,reportUpdate:r},children:o}),e[0]=o,e[1]=n,e[2]=s):s=e[2],s},fi=()=>tO(lI);import{jsx as ps,jsxs as cI}from"react/jsx-runtime";import{fieldIsSidebar as rO}from"payload/shared";import{useMemo as nO}from"react";var br="document-fields",kc=({AfterFields:t,BeforeFields:e,Description:o,docPermissions:n,fields:r,forceSidebarWrap:s,readOnly:i,schemaPathSegments:a})=>{let{hasSidebarFields:l,mainFields:c,sidebarFields:u}=nO(()=>r.reduce((d,f)=>(rO(f)?(d.sidebarFields.push(f),d.mainFields.push(null),d.hasSidebarFields=!0):(d.mainFields.push(f),d.sidebarFields.push(null)),d),{hasSidebarFields:!1,mainFields:[],sidebarFields:[]}),[r]);return cI("div",{className:[br,l?`${br}--has-sidebar`:`${br}--no-sidebar`,s&&`${br}--force-sidebar-wrap`].filter(Boolean).join(" "),children:[ps("div",{className:`${br}__main`,children:cI(Bo,{className:`${br}__edit`,children:[o?ps("header",{className:`${br}__header`,children:ps("div",{className:`${br}__sub-header`,children:o})}):null,e,ps(So,{className:`${br}__fields`,fields:c,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:a.join("."),permissions:n?.fields,readOnly:i}),t]})}),l?ps("div",{className:`${br}__sidebar-wrap`,children:ps("div",{className:`${br}__sidebar`,children:ps("div",{className:`${br}__sidebar-fields`,children:ps(So,{fields:u,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:a.join("."),permissions:n?.fields,readOnly:i})})})}):null]})};import{c as DI}from"react/compiler-runtime";import{jsx as wt,jsxs as xr}from"react/jsx-runtime";import{isImage as FI}from"payload/shared";import Wc,{Fragment as gO,useCallback as Jm,useEffect as Cb,useRef as _I,useState as Gc}from"react";import{jsx as _t,jsxs as Po}from"react/jsx-runtime";import Ym,{useRef as La,useState as bs}from"react";import Vt,{PureComponent as sO,createRef as uI}from"react";var Xm={x:0,y:0,width:0,height:0,unit:"px"},Ea=(t,e,o)=>Math.min(Math.max(t,e),o),iO=(...t)=>t.filter(e=>e&&typeof e=="string").join(" "),dI=(t,e)=>t===e||t.width===e.width&&t.height===e.height&&t.x===e.x&&t.y===e.y&&t.unit===e.unit;function Pa(t,e,o){return t.unit==="%"?{...Xm,...t,unit:"%"}:{unit:"%",x:t.x?t.x/e*100:0,y:t.y?t.y/o*100:0,width:t.width?t.width/e*100:0,height:t.height?t.height/o*100:0}}function hs(t,e,o){return t.unit?t.unit==="px"?{...Xm,...t,unit:"px"}:{unit:"px",x:t.x?t.x*e/100:0,y:t.y?t.y*o/100:0,width:t.width?t.width*e/100:0,height:t.height?t.height*o/100:0}:{...Xm,...t,unit:"px"}}function mI(t,e,o,n,r,s=0,i=0,a=n,l=r){let c={...t},u=Math.min(s,n),d=Math.min(i,r),f=Math.min(a,n),m=Math.min(l,r);e&&(e>1?(u=i?i*e:u,d=u/e,f=a*e):(d=s?s/e:d,u=d*e,m=l/e)),c.y<0&&(c.height=Math.max(c.height+c.y,d),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,u),c.x=0);let h=n-(c.x+c.width);h<0&&(c.x=Math.min(c.x,n-u),c.width+=h);let p=r-(c.y+c.height);if(p<0&&(c.y=Math.min(c.y,r-d),c.height+=p),c.width<u&&((o==="sw"||o=="nw")&&(c.x-=u-c.width),c.width=u),c.height<d&&((o==="nw"||o=="ne")&&(c.y-=d-c.height),c.height=d),c.width>f&&((o==="sw"||o=="nw")&&(c.x-=f-c.width),c.width=f),c.height>m&&((o==="nw"||o=="ne")&&(c.y-=m-c.height),c.height=m),e){let g=c.width/c.height;if(g<e){let b=Math.max(c.width/e,d);(o==="nw"||o=="ne")&&(c.y-=b-c.height),c.height=b}else if(g>e){let b=Math.max(c.height*e,u);(o==="sw"||o=="nw")&&(c.x-=b-c.width),c.width=b}}return c}function aO(t,e,o,n){let r={...t};return e==="ArrowLeft"?n==="nw"?(r.x-=o,r.y-=o,r.width+=o,r.height+=o):n==="w"?(r.x-=o,r.width+=o):n==="sw"?(r.x-=o,r.width+=o,r.height+=o):n==="ne"?(r.y+=o,r.width-=o,r.height-=o):n==="e"?r.width-=o:n==="se"&&(r.width-=o,r.height-=o):e==="ArrowRight"&&(n==="nw"?(r.x+=o,r.y+=o,r.width-=o,r.height-=o):n==="w"?(r.x+=o,r.width-=o):n==="sw"?(r.x+=o,r.width-=o,r.height-=o):n==="ne"?(r.y-=o,r.width+=o,r.height+=o):n==="e"?r.width+=o:n==="se"&&(r.width+=o,r.height+=o)),e==="ArrowUp"?n==="nw"?(r.x-=o,r.y-=o,r.width+=o,r.height+=o):n==="n"?(r.y-=o,r.height+=o):n==="ne"?(r.y-=o,r.width+=o,r.height+=o):n==="sw"?(r.x+=o,r.width-=o,r.height-=o):n==="s"?r.height-=o:n==="se"&&(r.width-=o,r.height-=o):e==="ArrowDown"&&(n==="nw"?(r.x+=o,r.y+=o,r.width-=o,r.height-=o):n==="n"?(r.y+=o,r.height-=o):n==="ne"?(r.y+=o,r.width-=o,r.height-=o):n==="sw"?(r.x-=o,r.width+=o,r.height+=o):n==="s"?r.height+=o:n==="se"&&(r.width+=o,r.height+=o)),r}var Na={capture:!0,passive:!1},gs=class Hr extends sO{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=uI(),this.mediaRef=uI(),this.initChangeCalled=!1,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{let{crop:o,disabled:n}=this.props,r=this.getBox();if(!o)return;let s=hs(o,r.width,r.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let i=e.target.dataset.ord,a=!!i,l=e.clientX,c=e.clientY,u=s.x,d=s.y;if(i){let f=e.clientX-r.x,m=e.clientY-r.y,h=0,p=0;i==="ne"||i=="e"?(h=f-(s.x+s.width),p=m-s.y,u=s.x,d=s.y+s.height):i==="se"||i==="s"?(h=f-(s.x+s.width),p=m-(s.y+s.height),u=s.x,d=s.y):i==="sw"||i=="w"?(h=f-s.x,p=m-(s.y+s.height),u=s.x+s.width,d=s.y):(i==="nw"||i=="n")&&(h=f-s.x,p=m-s.y,u=s.x+s.width,d=s.y+s.height),l=u+r.x+h,c=d+r.y+p}this.evData={startClientX:l,startClientY:c,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:a,ord:i},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=e=>{let{crop:o,disabled:n,locked:r,keepSelection:s,onChange:i}=this.props,a=this.getBox();if(n||r||s&&o)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-a.x,c=e.clientY-a.y,u={unit:"px",x:l,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,i(hs(u,a.width,a.height),Pa(u,a.width,a.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=e=>{let{crop:o,disabled:n,onChange:r,onDragStart:s}=this.props,i=this.getBox();if(n||!o||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,s&&s(e));let{evData:a}=this;a.clientX=e.clientX,a.clientY=e.clientY;let l;a.isResize?l=this.resizeCrop():l=this.dragCrop(),dI(o,l)||r(hs(l,i.width,i.height),Pa(l,i.width,i.height))},this.onComponentKeyDown=e=>{let{crop:o,disabled:n,onChange:r,onComplete:s}=this.props;if(n)return;let i=e.key,a=!1;if(!o)return;let l=this.getBox(),c=this.makePixelCrop(l),u=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Hr.nudgeStepLarge:e.shiftKey?Hr.nudgeStepMedium:Hr.nudgeStep;if(i==="ArrowLeft"?(c.x-=u,a=!0):i==="ArrowRight"?(c.x+=u,a=!0):i==="ArrowUp"?(c.y-=u,a=!0):i==="ArrowDown"&&(c.y+=u,a=!0),a){e.cancelable&&e.preventDefault(),c.x=Ea(c.x,0,l.width-c.width),c.y=Ea(c.y,0,l.height-c.height);let d=hs(c,l.width,l.height),f=Pa(c,l.width,l.height);r(d,f),s&&s(d,f)}},this.onHandlerKeyDown=(e,o)=>{let{aspect:n=0,crop:r,disabled:s,minWidth:i=0,minHeight:a=0,maxWidth:l,maxHeight:c,onChange:u,onComplete:d}=this.props,f=this.getBox();if(s||!r)return;if(e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="ArrowLeft"||e.key==="ArrowRight")e.stopPropagation(),e.preventDefault();else return;let m=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Hr.nudgeStepLarge:e.shiftKey?Hr.nudgeStepMedium:Hr.nudgeStep,h=hs(r,f.width,f.height),p=aO(h,e.key,m,o),g=mI(p,n,o,f.width,f.height,i,a,l,c);if(!dI(r,g)){let b=Pa(g,f.width,f.height);u(g,b),d&&d(g,b)}},this.onDocPointerDone=e=>{let{crop:o,disabled:n,onComplete:r,onDragEnd:s}=this.props,i=this.getBox();this.unbindDocMove(),!(n||!o)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,s&&s(e),r&&r(hs(o,i.width,i.height),Pa(o,i.width,i.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=e=>{var o;(o=this.componentRef.current)==null||o.scrollTo(0,0)}}get document(){return document}getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:o,y:n,width:r,height:s}=e.getBoundingClientRect();return{x:o,y:n,width:r,height:s}}componentDidUpdate(e){let{crop:o,onComplete:n}=this.props;if(n&&!e.crop&&o){let{width:r,height:s}=this.getBox();r&&s&&n(hs(o,r,s),Pa(o,r,s))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Na),this.document.addEventListener("pointerup",this.onDocPointerDone,Na),this.document.addEventListener("pointercancel",this.onDocPointerDone,Na),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Na),this.document.removeEventListener("pointerup",this.onDocPointerDone,Na),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Na),this.docMoveBound=!1)}getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,o=this.getBox(),n=this.makePixelCrop(o),r=e.clientX-e.startClientX,s=e.clientY-e.startClientY;return n.x=Ea(e.startCropX+r,0,o.width-n.width),n.y=Ea(e.startCropY+s,0,o.height-n.height),n}getPointRegion(e,o,n,r){let{evData:s}=this,i=s.clientX-e.x,a=s.clientY-e.y,l;r&&o?l=o==="nw"||o==="n"||o==="ne":l=a<s.startCropY;let c;return n&&o?c=o==="nw"||o==="w"||o==="sw":c=i<s.startCropX,c?l?"nw":"sw":l?"ne":"se"}resolveMinDimensions(e,o,n=0,r=0){let s=Math.min(n,e.width),i=Math.min(r,e.height);return!o||!s&&!i?[s,i]:o>1?s?[s,s/o]:[i*o,i]:i?[i*o,i]:[s,s/o]}resizeCrop(){let{evData:e}=this,{aspect:o=0,maxWidth:n,maxHeight:r}=this.props,s=this.getBox(),[i,a]=this.resolveMinDimensions(s,o,this.props.minWidth,this.props.minHeight),l=this.makePixelCrop(s),c=this.getPointRegion(s,e.ord,i,a),u=e.ord||c,d=e.clientX-e.startClientX,f=e.clientY-e.startClientY;(i&&u==="nw"||u==="w"||u==="sw")&&(d=Math.min(d,-i)),(a&&u==="nw"||u==="n"||u==="ne")&&(f=Math.min(f,-a));let m={unit:"px",x:0,y:0,width:0,height:0};c==="ne"?(m.x=e.startCropX,m.width=d,o?(m.height=m.width/o,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY-m.height)):c==="se"?(m.x=e.startCropX,m.y=e.startCropY,m.width=d,o?m.height=m.width/o:m.height=f):c==="sw"?(m.x=e.startCropX+d,m.y=e.startCropY,m.width=Math.abs(d),o?m.height=m.width/o:m.height=f):c==="nw"&&(m.x=e.startCropX+d,m.width=Math.abs(d),o?(m.height=m.width/o,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY+f));let h=mI(m,o,c,s.width,s.height,i,a,n,r);return o||Hr.xyOrds.indexOf(u)>-1?l=h:Hr.xOrds.indexOf(u)>-1?(l.x=h.x,l.width=h.width):Hr.yOrds.indexOf(u)>-1&&(l.y=h.y,l.height=h.height),l.x=Ea(l.x,0,s.width-l.width),l.y=Ea(l.y,0,s.height-l.height),l}createCropSelection(){let{ariaLabels:e=Hr.defaultProps.ariaLabels,disabled:o,locked:n,renderSelectionAddon:r,ruleOfThirds:s,crop:i}=this.props,a=this.getCropStyle();if(i)return Vt.createElement("div",{style:a,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!o&&!n&&Vt.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},Vt.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"nw"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"n"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"ne"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"e"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"se"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"s"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"sw"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"w"),role:"button"})),r&&Vt.createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:l=>l.stopPropagation()},r(this.state)),s&&Vt.createElement(Vt.Fragment,null,Vt.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),Vt.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){let o={...Xm,...this.props.crop||{}};return hs(o,e.width,e.height)}render(){let{aspect:e,children:o,circularCrop:n,className:r,crop:s,disabled:i,locked:a,style:l,ruleOfThirds:c}=this.props,{cropIsActive:u,newCropIsBeingDrawn:d}=this.state,f=s?this.createCropSelection():null,m=iO("ReactCrop",r,u&&"ReactCrop--active",i&&"ReactCrop--disabled",a&&"ReactCrop--locked",d&&"ReactCrop--new-crop",s&&e&&"ReactCrop--fixed-aspect",s&&n&&"ReactCrop--circular-crop",s&&c&&"ReactCrop--rule-of-thirds",!this.dragStarted&&s&&!s.width&&!s.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return Vt.createElement("div",{ref:this.componentRef,className:m,style:l},Vt.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},o),f)}};gs.xOrds=["e","w"];gs.yOrds=["n","s"];gs.xyOrds=["nw","ne","se","sw"];gs.nudgeStep=1;gs.nudgeStepMedium=10;gs.nudgeStepLarge=100;gs.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};var fI=gs;import"react-image-crop/dist/ReactCrop.css";var yt="edit-upload",Um=t=>{let{name:e,onChange:o,ref:n,value:r}=t;return Po("div",{className:`${yt}__input`,children:[e,_t("input",{name:e,onChange:s=>o(s.target.value),ref:n,type:"number",value:r})]})},lO={height:100,unit:"%",width:100,x:0,y:0},hb=({fileName:t,fileSrc:e,imageCacheTag:o,initialCrop:n,initialFocalPoint:r,onSave:s,showCrop:i,showFocalPoint:a})=>{let{closeModal:l}=de(),{t:c}=k(),[u,d]=bs(()=>({...lO,...n||{}})),f={x:50,y:50},[m,h]=bs(()=>({...f,...r})),[p,g]=bs(!1),[b,v]=bs(0),[x,y]=bs(0),C=La(void 0),S=La(void 0),w=La(void 0),D=La(null),_=La(null),[A,F]=bs(!1),R=P=>{v(P.currentTarget.naturalHeight),y(P.currentTarget.naturalWidth),F(!0)},I=({dimension:P,value:L})=>{let V=parseInt(L);if(P==="width"&&V>=x||P==="height"&&V>=b)return null;let M=100*(V/(P==="width"?x:b));if(M===100||M===0)return null;d({...u,[P]:M})},E=({coordinate:P,value:L})=>{let V=parseInt(L);V>=0&&V<=100&&h(M=>({...M,[P]:V}))},T=()=>{typeof s=="function"&&s({crop:u||void 0,focalPoint:m,heightInPixels:Number(D?.current?.value??b),widthInPixels:Number(_?.current?.value??x)}),l(jc)},$=Ym.useCallback(({x:P,y:L})=>{h({x:P,y:L}),g(!1)},[]),j=()=>{let P=C.current.getBoundingClientRect(),L=i?w.current.getBoundingClientRect():S.current.getBoundingClientRect(),V=(L.left-P.left+L.width/2)/P.width*100,M=(L.top-P.top+L.height/2)/P.height*100;h({x:V,y:M})},N=o?`${e}?${encodeURIComponent(o)}`:e;return Po("div",{className:yt,children:[Po("div",{className:`${yt}__header`,children:[Po("h2",{title:`${c("general:editing")} ${t}`,children:[c("general:editing")," ",t]}),Po("div",{className:`${yt}__actions`,children:[_t(ne,{"aria-label":c("general:cancel"),buttonStyle:"secondary",className:`${yt}__cancel`,onClick:()=>l(jc),children:c("general:cancel")}),_t(ne,{"aria-label":c("general:applyChanges"),buttonStyle:"primary",className:`${yt}__save`,disabled:!A,onClick:T,children:c("general:applyChanges")})]})]}),Po("div",{className:`${yt}__toolWrap`,children:[_t("div",{className:`${yt}__crop`,children:Po("div",{className:`${yt}__focal-wrapper`,ref:C,style:{aspectRatio:`${x/b}`},children:[i?_t(fI,{className:`${yt}__reactCrop`,crop:u,onChange:(P,L)=>d(L),onComplete:()=>g(!0),renderSelectionAddon:()=>_t("div",{className:`${yt}__crop-window`,ref:w}),children:_t("img",{alt:c("upload:setCropArea"),onLoad:R,ref:S,src:N})}):_t("img",{alt:c("upload:setFocalPoint"),onLoad:R,ref:S,src:N}),a&&_t(cO,{boundsRef:i?w:S,checkBounds:i?p:!1,className:`${yt}__focalPoint`,containerRef:C,initialPosition:m,onDragEnd:$,setCheckBounds:i?g:!1,children:_t(jo,{})})]})}),(i||a)&&Po("div",{className:`${yt}__sidebar`,children:[i&&Po("div",{className:`${yt}__groupWrap`,children:[_t("div",{children:Po("div",{className:`${yt}__titleWrap`,children:[_t("h3",{children:c("upload:crop")}),_t(ne,{buttonStyle:"none",className:`${yt}__reset`,onClick:()=>d({height:100,unit:"%",width:100,x:0,y:0}),children:c("general:reset")})]})}),_t("span",{className:`${yt}__description`,children:c("upload:cropToolDescription")}),Po("div",{className:`${yt}__inputsWrap`,children:[_t(Um,{name:`${c("upload:width")} (px)`,onChange:P=>I({dimension:"width",value:P}),ref:_,value:(u.width/100*x).toFixed(0)}),_t(Um,{name:`${c("upload:height")} (px)`,onChange:P=>I({dimension:"height",value:P}),ref:D,value:(u.height/100*b).toFixed(0)})]})]}),a&&Po("div",{className:`${yt}__groupWrap`,children:[_t("div",{children:Po("div",{className:`${yt}__titleWrap`,children:[_t("h3",{children:c("upload:focalPoint")}),_t(ne,{buttonStyle:"none",className:`${yt}__reset`,onClick:j,children:c("general:reset")})]})}),_t("span",{className:`${yt}__description`,children:c("upload:focalPointDescription")}),Po("div",{className:`${yt}__inputsWrap`,children:[_t(Um,{name:"X %",onChange:P=>E({coordinate:"x",value:P}),value:m.x.toFixed(0)}),_t(Um,{name:"Y %",onChange:P=>E({coordinate:"y",value:P}),value:m.y.toFixed(0)})]})]})]})]})]})},cO=({boundsRef:t,checkBounds:e,children:o,className:n,containerRef:r,initialPosition:s={x:50,y:50},onDragEnd:i,setCheckBounds:a})=>{let[l,c]=bs({x:s.x,y:s.y}),[u,d]=bs(!1),f=La(void 0),m=Ym.useCallback((b,v,x)=>{let y=r.current.getBoundingClientRect(),C=t.current.getBoundingClientRect(),S=b??C.left,w=v??C.top,D=S<C.left||S>C.right,_=w<C.top||w>C.bottom,A=(S-y.left)/y.width*100,F=(w-y.top)/y.height*100,R=(C.left-y.left+C.width/2)/y.width*100,I=(C.top-y.top+C.height/2)/y.height*100;return(D||_)&&(d(!1),S<C.left?A=(C.left-y.left)/y.width*100:S>C.right&&(A=(y.width-(y.right-C.right))/y.width*100),w<C.top?F=(C.top-y.top)/y.height*100:w>C.bottom&&(F=(y.height-(y.bottom-C.bottom))/y.height*100),x&&(A=D?R:A,F=_?I:F)),{x:A,y:F}},[t,r]),h=b=>{b.preventDefault(),d(!0)},p=b=>{if(!u)return null;let{x:v,y:x}=m(b.clientX,b.clientY);c({x:v,y:x})},g=()=>{d(!1),i(l)};return Ym.useEffect(()=>{if(!(u||!f.current)&&e){let{height:b,left:v,top:x,width:y}=f.current.getBoundingClientRect(),{x:C,y:S}=m(v+y/2,x+b/2,!0);i({x:C,y:S}),c({x:C,y:S}),a(!1);return}},[m,u,e,a,l.x,l.y,i]),Ym.useEffect(()=>{c({x:s.x,y:s.y})},[s.x,s.y]),Po("div",{className:[`${yt}__draggable-container`,u&&`${yt}__draggable-container--dragging`].filter(Boolean).join(" "),onMouseMove:p,children:[_t("button",{className:[`${yt}__draggable`,n].filter(Boolean).join(" "),onMouseDown:h,onMouseUp:g,ref:f,style:{left:`${l.x}%`,top:`${l.y}%`},type:"button",children:o}),_t("div",{})]})};import{jsx as wI}from"react/jsx-runtime";import"react";import{c as uO}from"react/compiler-runtime";import{jsx as Pn,jsxs as gb}from"react/jsx-runtime";import"react";var vs="file-details-draggable",pI=t=>{let e=uO(20),{collectionSlug:o,doc:n,hideRemoveFile:r,imageCacheTag:s,isSortable:i,removeItem:a,rowIndex:l,uploadConfig:c}=t,{id:u,filename:d,thumbnailURL:f,url:m}=n,h;e[0]!==o||e[1]!==u?(h={id:u,collectionSlug:o},e[0]=o,e[1]=u,e[2]=h):h=e[2];let[p,g]=Jt(h),b;e[3]!==p||e[4]!==g||e[5]!==o||e[6]!==n||e[7]!==d||e[8]!==r||e[9]!==s||e[10]!==i||e[11]!==a||e[12]!==l||e[13]!==f||e[14]!==c||e[15]!==m?(b=x=>gb("div",{className:[vs,x&&i&&`${vs}--has-drag-handle`].filter(Boolean).join(" "),ref:x.setNodeRef,style:{transform:x.transform,transition:x.transition,zIndex:x.isDragging?1:void 0},children:[gb("div",{className:`${vs}--drag-wrapper`,children:[i&&x&&Pn("div",{className:`${vs}__drag`,...x.attributes,...x.listeners,children:Pn(Cn,{})}),Pn(Mr,{className:`${vs}__thumbnail`,collectionSlug:o,doc:n,fileSrc:f||m,imageCacheTag:s,uploadConfig:c})]}),Pn("div",{className:`${vs}__main-detail`,children:d}),gb("div",{className:`${vs}__actions`,children:[Pn(p,{}),Pn(g,{children:Pn(_r,{})}),!r&&a&&Pn(ne,{buttonStyle:"icon-label",className:`${vs}__remove`,icon:"x",iconStyle:"none",onClick:()=>a(l),round:!0})]})]}),e[3]=p,e[4]=g,e[5]=o,e[6]=n,e[7]=d,e[8]=r,e[9]=s,e[10]=i,e[11]=a,e[12]=l,e[13]=f,e[14]=c,e[15]=m,e[16]=b):b=e[16];let v;return e[17]!==u||e[18]!==b?(v=Pn(Jr,{id:u,children:b},u),e[17]=u,e[18]=b,e[19]=v):v=e[19],v};import{jsx as Vc,jsxs as yI}from"react/jsx-runtime";import"react";import{jsx as vI,jsxs as Mc}from"react/jsx-runtime";import{formatFilesize as fO}from"payload/shared";import xI from"react";import{jsx as hI,jsxs as gI}from"react/jsx-runtime";import{useRef as dO,useState as bI}from"react";var mO="copy-to-clipboard",Oc=({defaultMessage:t,successMessage:e,value:o})=>{let n=dO(null),[r,s]=bI(!1),[i,a]=bI(!1),{t:l}=k();return o?gI("button",{className:mO,onClick:()=>{n&&n.current&&(n.current.select(),n.current.setSelectionRange(0,o.length+1),document.execCommand("copy"),s(!0))},onMouseEnter:()=>{a(!0),s(!1)},onMouseLeave:()=>{a(!1),s(!1)},type:"button",children:[hI(Al,{}),gI(go,{delay:r?0:void 0,show:i||r,children:[r&&(e??l("general:copied")),!r&&(t??l("general:copy"))]}),hI("textarea",{readOnly:!0,ref:n,tabIndex:-1,value:o})]}):null};var bb="file-meta",Bc=t=>{let{filename:e,filesize:o,height:n,mimeType:r,url:s,width:i}=t;return Mc("div",{className:bb,children:[Mc("div",{className:`${bb}__url`,children:[vI("a",{href:s,rel:"noopener noreferrer",target:"_blank",children:e}),vI(Oc,{defaultMessage:"Copy URL",value:s})]}),Mc("div",{className:`${bb}__size-type`,children:[fO(o),typeof i=="number"&&typeof n=="number"&&Mc(xI.Fragment,{children:["\xA0-\xA0",i,"x",n]}),r&&Mc(xI.Fragment,{children:["\xA0-\xA0",r]})]})]})};var Zm="file-details",CI=t=>{let{customUploadActions:e,doc:o,enableAdjustments:n,handleRemove:r,hasImageSizes:s,hideRemoveFile:i,imageCacheTag:a,uploadConfig:l}=t,{filename:c,filesize:u,height:d,mimeType:f,thumbnailURL:m,url:h,width:p}=o,g=l.displayPreview??!0;return Vc("div",{className:Zm,children:yI("header",{children:[g&&Vc(Mr,{className:`${Zm}__thumbnail`,doc:o,fileSrc:m||h,imageCacheTag:a,uploadConfig:l}),yI("div",{className:`${Zm}__main-detail`,children:[Vc(Bc,{filename:c,filesize:u,height:d,mimeType:f,url:h,width:p}),(n||e)&&Vc(vb,{customActions:e,enableAdjustments:!!n,enablePreviewSizes:s&&o.filename,mimeType:f})]}),!i&&r&&Vc(ne,{buttonStyle:"icon-label",className:`${Zm}__remove`,icon:"x",iconStyle:"with-border",onClick:r,round:!0})]})})};var xb=t=>{let{hasMany:e}=t;return e?wI(pI,{...t}):wI(CI,{...t})};import{jsx as rn,jsxs as $a}from"react/jsx-runtime";import{useEffect as pO,useMemo as hO,useState as SI}from"react";var vr="preview-sizes",II=(t,e)=>{if(!e||e.length===0)return t;let o={};return e.forEach(({name:n})=>{t[n]&&(o[n]=t[n])}),o},RI=({name:t,active:e,meta:o,onClick:n,previewSrc:r})=>$a("div",{className:[`${vr}__sizeOption`,e&&`${vr}--selected`].filter(Boolean).join(" "),onClick:typeof n=="function"?n:void 0,onKeyDown:s=>{typeof n=="function"&&s.key==="Enter"&&n()},role:"button",tabIndex:0,children:[rn("div",{className:`${vr}__image`,children:rn("img",{alt:o.filename,src:r})}),$a("div",{className:`${vr}__sizeMeta`,children:[rn("div",{className:`${vr}__sizeName`,children:t}),rn(Bc,{...o})]})]}),yb=({doc:t,imageCacheTag:e,uploadConfig:o})=>{let{imageSizes:n}=o,{sizes:r}=t,[s,i]=SI(()=>II(r,n)),[a,l]=SI(null),c=m=>{if(!m.filename)return null;if(m.url)return`${m.url}${e?`?${encodeURIComponent(e)}`:""}`};pO(()=>{i(II(r,n))},[r,n,e]);let u=c(a?t.sizes[a]:t),d=hO(()=>({filename:t.filename,filesize:t.filesize,height:t.height,mimeType:t.mimeType,url:t.url,width:t.width}),[t]),f="Original";return $a("div",{className:vr,children:[$a("div",{className:`${vr}__imageWrap`,children:[$a("div",{className:`${vr}__meta`,children:[rn("div",{className:`${vr}__sizeName`,children:a||f}),rn(Bc,{...a?s[a]:d})]}),rn("img",{alt:t.filename,className:`${vr}__preview`,src:u})]}),rn("div",{className:`${vr}__listWrap`,children:$a("div",{className:`${vr}__list`,children:[rn(RI,{active:!a,meta:d,name:f,onClick:()=>l(null),previewSrc:c(t)}),Object.entries(s).map(([m,h])=>{let p=a===m,g=c(h);return g?rn(RI,{active:p,meta:h,name:m,onClick:()=>l(m),previewSrc:g},m):null})]})})]})};var qt="file-field",jc="edit-upload",AI="preview-sizes",bO=t=>!t&&t!==void 0?"A file is required.":!0,vb=t=>{let e=DI(9),{customActions:o,enableAdjustments:n,enablePreviewSizes:r,mimeType:s}=t,{t:i}=k(),a,l;if(e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i){l=Symbol.for("react.early_return_sentinel");e:{let c=FI(s)&&s!=="image/svg+xml"&&s!=="image/jxl";if(!c&&(!o||o.length===0)){l=null;break e}let u;e[7]!==o?(u=o&&o.map(vO),e[7]=o,e[8]=u):u=e[8],a=xr("div",{className:`${qt}__upload-actions`,children:[c&&xr(Wc.Fragment,{children:[r&&wt(ur,{className:`${qt}__previewSizes`,slug:AI,children:i("upload:previewSizes")}),n&&wt(ur,{className:`${qt}__edit`,slug:jc,children:i("upload:editImage")})]}),u]})}e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=a,e[6]=l}else a=e[5],l=e[6];return l!==Symbol.for("react.early_return_sentinel")?l:a},wb=t=>{let e=DI(5),{resetUploadEdits:o,updateUploadEdits:n,uploadEdits:r}=Ws(),s;return e[0]!==t||e[1]!==o||e[2]!==n||e[3]!==r?(s=wt(Sb,{...t,resetUploadEdits:o,updateUploadEdits:n,uploadEdits:r}),e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s):s=e[4],s},Sb=t=>{let{collectionSlug:e,customActions:o,initialState:n,onChange:r,resetUploadEdits:s,updateUploadEdits:i,uploadConfig:a,uploadEdits:l}=t,{config:{routes:{api:c},serverURL:u}}=H(),{t:d}=k(),{setModified:f}=Oe(),{id:m,docPermissions:h,savedDocumentData:p,setUploadStatus:g}=Pe(),b=lr(),{errorMessage:v,setValue:x,showError:y,value:C}=Ee({path:"file",validate:bO}),[S,w]=Gc(null),[D,_]=Gc(!1),[A,F]=Gc(C?.name||""),[R,I]=Gc(!1),[E,T]=Gc(""),$=_I(null),j=_I(null),N=typeof a?.pasteURL=="object"&&a.pasteURL.allowList?.length>0,P=Jm(q=>{q instanceof File&&w(URL.createObjectURL(q)),x(q),I(!1),typeof r=="function"&&r(q)},[r,x]),L=(q,pe)=>new File([q],pe,{type:q.type,lastModified:q.lastModified}),V=Wc.useCallback(q=>{let pe=q.target.value;C&&(P(L(C,pe)),F(pe))},[P,C]),M=Jm(q=>{let pe=q?.[0];P(pe)},[P]),O=Jm(()=>{_(!0),P(null),w(""),T(""),s(),I(!1)},[P,s]),B=Jm(q=>{f(!0),i(q)},[f,i]),G=async()=>{if(!(!E||a?.pasteURL===!1)){g("uploading");try{let q=await fetch(E);if(!q.ok)throw new Error(`Fetch failed with status: ${q.status}`);let pe=await q.blob(),he=decodeURIComponent(E.split("/").pop()||""),_e=new File([pe],he,{type:pe.type});P(_e),g("idle");return}catch{if(!N){fe.error("Failed to fetch the file."),g("failed");return}}try{let q=`/${e}/paste-url${m?`/${m}?`:"?"}src=${encodeURIComponent(E)}`,pe=await fetch(`${u}${c}${q}`);if(!pe.ok)throw new Error(`Fetch failed with status: ${pe.status}`);let he=await pe.blob(),_e=decodeURIComponent(E.split("/").pop()||""),ge=new File([he],_e,{type:he.type});P(ge),g("idle")}catch{fe.error("The provided URL is not allowed."),g("failed")}}};Cb(()=>{n?.file?.value instanceof File&&(w(URL.createObjectURL(n.file.value)),_(!1))},[n]),Cb(()=>{R&&$.current},[R]),Cb(()=>{b&&_(!1)},[b]);let X=h?.update&&"delete"in h&&h?.delete,Z=a?.imageSizes?.length>0,te=!!a?.resizeOptions,U=a?.focalPoint===!0,{crop:z=!0,focalPoint:ce=!0}=a,J=ce&&(Z||te||U),ue=a.mimeTypes?.join(", "),re=a?.cacheTags&&p?.updatedAt;return a.hideFileInputOnCreate&&!p?.filename?null:xr("div",{className:[Ce,qt].filter(Boolean).join(" "),children:[wt(He,{message:v,showError:y}),p&&p.filename&&!D&&wt(xb,{collectionSlug:e,customUploadActions:o,doc:p,enableAdjustments:z||J,handleRemove:X?O:void 0,hasImageSizes:Z,hideRemoveFile:a.hideRemoveFile,imageCacheTag:re,uploadConfig:a}),(!a.hideFileInputOnCreate&&!p?.filename||D)&&xr("div",{className:`${qt}__upload`,children:[!C&&!R&&wt(mi,{onChange:M,children:xr("div",{className:`${qt}__dropzoneContent`,children:[xr("div",{className:`${qt}__dropzoneButtons`,children:[wt(ne,{buttonStyle:"pill",onClick:()=>{j.current&&j.current.click()},size:"small",children:d("upload:selectFile")}),wt("input",{accept:ue,"aria-hidden":"true",className:`${qt}__hidden-input`,hidden:!0,onChange:q=>{q.target.files&&q.target.files.length>0&&M(q.target.files)},ref:j,type:"file"}),a?.pasteURL!==!1&&xr(gO,{children:[wt("span",{className:`${qt}__orText`,children:d("general:or")}),wt(ne,{buttonStyle:"pill",onClick:()=>{I(!0)},size:"small",children:d("upload:pasteURL")})]})]}),xr("p",{className:`${qt}__dragAndDropText`,children:[d("general:or")," ",d("upload:dragAndDrop")]})]})}),R&&xr(Wc.Fragment,{children:[xr("div",{className:`${qt}__remote-file-wrap`,children:[wt("input",{className:`${qt}__remote-file`,onChange:q=>{T(q.target.value)},ref:$,type:"text",value:E}),wt("div",{className:`${qt}__add-file-wrap`,children:wt("button",{className:`${qt}__add-file`,onClick:()=>{G()},type:"button",children:d("upload:addFile")})})]}),wt(ne,{buttonStyle:"icon-label",className:`${qt}__remove`,icon:"x",iconStyle:"with-border",onClick:()=>{I(!1)},round:!0,tooltip:d("general:cancel")})]}),C&&S&&xr(Wc.Fragment,{children:[wt("div",{className:`${qt}__thumbnail-wrap`,children:wt(Mr,{collectionSlug:e,fileSrc:FI(C.type)?S:null})}),xr("div",{className:`${qt}__file-adjustments`,children:[wt("input",{className:`${qt}__filename`,onChange:V,type:"text",value:A||C.name}),wt(vb,{customActions:o,enableAdjustments:z||J,enablePreviewSizes:Z&&p?.filename&&!D,mimeType:C.type})]}),wt(ne,{buttonStyle:"icon-label",className:`${qt}__remove`,icon:"x",iconStyle:"with-border",onClick:O,round:!0,tooltip:d("general:cancel")})]})]}),(C||p?.filename)&&wt(Ns,{children:wt(Pt,{Header:null,slug:jc,children:wt(hb,{fileName:C?.name||p?.filename,fileSrc:p?.url||S,imageCacheTag:re,initialCrop:l?.crop??void 0,initialFocalPoint:{x:l?.focalPoint?.x||p?.focalX||50,y:l?.focalPoint?.y||p?.focalY||50},onSave:B,showCrop:z,showFocalPoint:J})})}),p&&Z&&wt(Pt,{className:`${qt}__previewDrawer`,hoverTitle:!0,slug:AI,title:d("upload:sizesFor",{label:p.filename}),children:wt(yb,{doc:p,imageCacheTag:re,uploadConfig:a})})]})};function vO(t,e){return wt(Wc.Fragment,{children:t},e)}var SO="collection-edit";function PI({resetUploadEdits:t,submitted:e,updateUploadEdits:o,uploadEdits:n}){let{action:r,collectionSlug:s,docPermissions:i,getDocPreferences:a,hasSavePermission:l,initialState:c,isEditing:u,isInitializing:d,Upload:f}=Pe(),{onSave:m}=ac(),{getFormState:h}=Dt(),{config:{routes:{admin:p}},getEntityConfig:g}=H(),b=Hc.useRef(null),v=g({collectionSlug:s}),x=yO(),y=ct(),C=CO(),{reportUpdate:S}=fi(),{startRouteTransition:w}=st(),D=C.get("locale"),_=v.slug,[A]=Hc.useState(_),F=TI(I=>{if(S({entitySlug:_,updatedAt:I?.result?.updatedAt||new Date().toISOString()}),typeof m=="function"&&m({...I,operation:"create"}),!u&&y<2){let E=wO({adminRoute:p,path:`/collections/${_}/${I?.doc?.id}${D?`?locale=${D}`:""}`});w(()=>x.push(E))}else t()},[p,_,y,u,D,m,S,t,x,w]),R=TI(async({formState:I,submitted:E})=>{let T=or(b),$=await a(),{state:j}=await h({collectionSlug:_,docPermissions:i,docPreferences:$,formState:I,operation:"create",schemaPath:A,signal:T.signal,skipValidation:!E});return b.current=null,j},[_,A,a,h,i]);return EI(()=>{let I=b.current;return()=>{tr(I)}},[]),xs(Il,{operation:"create",children:xs(Ib,{children:xO(An,{action:r,className:`${SO}__form`,disabled:d||!l,initialState:d?void 0:c,isInitializing:d,method:"POST",onChange:[R],onSuccess:F,submitted:e,children:[xs(kc,{BeforeFields:xs(Hc.Fragment,{children:f||xs(Sb,{collectionSlug:v.slug,initialState:c,resetUploadEdits:t,updateUploadEdits:o,uploadConfig:v.upload,uploadEdits:n})}),docPermissions:i,fields:v.fields,schemaPathSegments:[v.slug]}),xs(RO,{}),xs(IO,{})]})})})}function IO(){let{getFields:t}=Oe(),{getFormDataRef:e}=Io();return EI(()=>{e.current=t},[t,e]),null}function RO(){let{docConfig:t}=Pe(),{activeIndex:e,setFormTotalErrorCount:o}=Io(),n=Hc.useRef(0),r=Hc.useCallback(s=>{s!==n.current&&(o({errorCount:s,index:e}),n.current=s)},[e,o]);return t?xs(Ys,{fields:t.fields,path:[],setErrorCount:r}):null}import{c as _O}from"react/compiler-runtime";import{jsx as Lt,jsxs as zr}from"react/jsx-runtime";import{isImage as DO}from"payload/shared";import FO from"react";var qm="bulk-upload-drawer--add-more-files",Ct="file-selections";function NI(){let t=_O(36),{activeIndex:e,addFiles:o,forms:n,isInitializing:r,removeFile:s,setActiveIndex:i,thumbnailUrls:a,totalErrorCount:l}=Io(),{initialFiles:c,maxFiles:u}=Ho(),{i18n:d,t:f}=k(),{closeModal:m,openModal:h}=de(),[p,g]=FO.useState(!1),{breakpoints:b}=Co(),v;t[0]!==s?(v=R=>{s(R)},t[0]=s,t[1]=v):v=t[1];let x=v,y;t[2]!==o||t[3]!==m?(y=R=>{o(R),m(qm)},t[2]=o,t[3]=m,t[4]=y):y=t[4];let C=y,S=EO,w=r?c.length:n.length,D=p&&`${Ct}__showingFiles`,_;t[5]!==D?(_=[Ct,D].filter(Boolean),t[5]=D,t[6]=_):_=t[6];let A=_.join(" "),F;if(t[7]!==e||t[8]!==b.m||t[9]!==m||t[10]!==n||t[11]!==C||t[12]!==x||t[13]!==d||t[14]!==c||t[15]!==r||t[16]!==u||t[17]!==h||t[18]!==i||t[19]!==p||t[20]!==f||t[21]!==A||t[22]!==a||t[23]!==l||t[24]!==w){let R;t[26]===Symbol.for("react.memo_cache_sentinel")?(R=()=>g(TO),t[26]=R):R=t[26];let I;t[27]!==m?(I=()=>m(qm),t[27]=m,t[28]=I):I=t[28];let E;t[29]!==e||t[30]!==x||t[31]!==d||t[32]!==i||t[33]!==f||t[34]!==a?(E=(T,$)=>{let{errorCount:j,formState:N}=T,P=N?.file?.value||{};return zr("div",{className:[`${Ct}__fileRowContainer`,$===e&&`${Ct}__fileRowContainer--active`,j&&j>0&&`${Ct}__fileRowContainer--error`].filter(Boolean).join(" "),children:[zr("button",{className:`${Ct}__fileRow`,onClick:()=>i($),type:"button",children:[Lt(Mr,{className:`${Ct}__thumbnail`,fileSrc:DO(P.type)?a[$]:null}),Lt("div",{className:`${Ct}__fileDetails`,children:Lt("p",{className:`${Ct}__fileName`,title:P.name,children:P.name||f("upload:noFile")})}),P instanceof File?Lt("p",{className:`${Ct}__fileSize`,children:S(P)}):null,Lt("div",{className:`${Ct}__remove ${Ct}__remove--underlay`,children:Lt(pt,{})}),j?Lt(io,{className:`${Ct}__errorCount`,count:j,i18n:d}):null]}),Lt("button",{"aria-label":f("general:remove"),className:`${Ct}__remove ${Ct}__remove--overlay`,onClick:()=>x($),type:"button",children:Lt(pt,{})})]},$)},t[29]=e,t[30]=x,t[31]=d,t[32]=i,t[33]=f,t[34]=a,t[35]=E):E=t[35],F=zr("div",{className:A,children:[b.m&&p?Lt("div",{className:`${Ct}__mobileBlur`}):null,zr("div",{className:`${Ct}__header`,children:[zr("div",{className:`${Ct}__headerTopRow`,children:[zr("div",{className:`${Ct}__header__text`,children:[Lt(io,{count:l,i18n:d,withMessage:!0}),Lt("p",{children:zr("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})})]}),zr("div",{className:`${Ct}__header__actions`,children:[typeof u!="number"||w<u?Lt(vt,{className:`${Ct}__header__addFile`,onClick:()=>h(qm),children:f("upload:addFile")}):null,zr(ne,{buttonStyle:"transparent",className:`${Ct}__toggler`,onClick:R,children:[Lt("span",{className:`${Ct}__toggler__label`,children:zr("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})}),Lt(Ze,{direction:p?"down":"up"})]}),Lt(Pt,{gutter:!1,Header:null,slug:qm,children:Lt(Bm,{onCancel:I,onDrop:C})})]})]}),Lt("div",{className:`${Ct}__header__mobileDocActions`,children:Lt(fb,{})})]}),Lt("div",{className:`${Ct}__animateWrapper`,children:Lt(Tr,{height:!b.m||p?"auto":0,children:zr("div",{className:`${Ct}__filesContainer`,children:[r&&n.length===0&&c.length>0?Array.from(c).map(AO):null,n.map(E)]})})})]}),t[7]=e,t[8]=b.m,t[9]=m,t[10]=n,t[11]=C,t[12]=x,t[13]=d,t[14]=c,t[15]=r,t[16]=u,t[17]=h,t[18]=i,t[19]=p,t[20]=f,t[21]=A,t[22]=a,t[23]=l,t[24]=w,t[25]=F}else F=t[25];return F}function AO(t,e){return Lt(St,{animationDelay:`calc(${e} * 60ms)`,height:"35px"},e)}function TO(t){return!t}function EO(t){let e=t.size,o=e===0?0:Math.floor(Math.log(e)/Math.log(1024)),n=o>1?1:0;return(e/Math.pow(1024,o)).toFixed(n)+" "+["B","kB","MB","GB","TB"][o]}var LI="bulk-upload--file-manager";function $I(){let t=PO(18),{activeIndex:e,collectionSlug:o,docPermissions:n,documentSlots:r,forms:s,hasPublishPermission:i,hasSavePermission:a,hasSubmitted:l,resetUploadEdits:c,updateUploadEdits:u}=Io(),d=s[e],{getEntityConfig:f}=H(),{i18n:m}=k(),{user:h}=Ae(),{openModal:p}=de(),g;if(t[0]!==d||t[1]!==e||t[2]!==o||t[3]!==n||t[4]!==r||t[5]!==s.length||t[6]!==f||t[7]!==i||t[8]!==a||t[9]!==l||t[10]!==m||t[11]!==p||t[12]!==c||t[13]!==u||t[14]!==h){let b=f({collectionSlug:o}),v;t[16]!==p?(v=()=>p($c),t[16]=p,t[17]=v):v=t[17],g=Rb("div",{className:LI,children:[zc(NI,{}),Rb("div",{className:`${LI}__editView`,children:[zc(Da,{onClose:v,title:NO(b.labels.singular,m)}),d?Rb(Sl,{collectionSlug:o,currentEditor:h,docPermissions:n,hasPublishedDoc:!1,hasPublishPermission:i,hasSavePermission:a,id:null,initialData:LO(d.formState,!0),initialState:d.formState,isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,Upload:r.Upload,versionCount:0,children:[zc(iI,{collectionConfig:b}),zc(PI,{resetUploadEdits:c,submitted:l,updateUploadEdits:u,uploadEdits:d?.uploadEdits})]},`${e}-${s.length}`):null]}),zc(aI,{})]}),t[0]=d,t[1]=e,t[2]=o,t[3]=n,t[4]=r,t[5]=s.length,t[6]=f,t[7]=i,t[8]=a,t[9]=l,t[10]=m,t[11]=p,t[12]=c,t[13]=u,t[14]=h,t[15]=g}else g=t[15];return g}var jO="bulk-upload-drawer-slug";function OO(){let{addFiles:t,forms:e,isInitializing:o}=Io(),{closeModal:n}=de(),{collectionSlug:r,drawerSlug:s}=Ho(),{getEntityConfig:i}=H(),{t:a}=k(),u=i({collectionSlug:r})?.upload?.mimeTypes,d=nn.useCallback(f=>{let m=new DataTransfer;for(let h of f)(u===void 0||u.length===0||kO(h.type,u))&&m.items.add(h);m.files.length===0?fe.error(a("error:invalidFileType")):t(m.files)},[t,a,u]);return r?!e.length&&!o?pi(Bm,{acceptMimeTypes:u?.join(", "),onCancel:()=>n(s),onDrop:d}):pi($I,{}):null}function jI(){let t=kI(2),{drawerSlug:e}=Ho(),o;return t[0]!==e?(o=pi(Pt,{gutter:!1,Header:null,slug:e,children:pi(ZS,{children:pi(OO,{})})}),t[0]=e,t[1]=o):o=t[1],o}var OI=nn.createContext({collectionSlug:"",currentActivePath:void 0,drawerSlug:"",initialFiles:void 0,maxFiles:void 0,onCancel:()=>null,onSuccess:()=>null,setCollectionSlug:()=>null,setCurrentActivePath:()=>null,setInitialFiles:()=>null,setMaxFiles:()=>null,setOnCancel:()=>null,setOnSuccess:()=>null});function Ib(t){let e=kI(16),{children:o}=t,[n,r]=nn.useState(),[s,i]=nn.useState(),[a,l]=nn.useState(),[c,u]=nn.useState(void 0),[d,f]=nn.useState(void 0),[m,h]=nn.useState(void 0),p=MI(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=w=>{r(w)},e[0]=g):g=e[0];let b=g,v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=(w,D)=>{i(_=>({..._,[w]:D}))},e[1]=v):v=e[1];let x=v,y;e[2]!==a?(y=()=>{typeof a=="function"&&a()},e[2]=a,e[3]=y):y=e[3];let C;e[4]!==m||e[5]!==s?(C=(w,D)=>{if(s&&Object.hasOwn(s,m)){let _=s[m];_(w,D)}},e[4]=m,e[5]=s,e[6]=C):C=e[6];let S;return e[7]!==o||e[8]!==n||e[9]!==m||e[10]!==p||e[11]!==c||e[12]!==d||e[13]!==y||e[14]!==C?(S=pi(OI,{value:{collectionSlug:n,currentActivePath:m,drawerSlug:p,initialFiles:c,maxFiles:d,onCancel:y,onSuccess:C,setCollectionSlug:b,setCurrentActivePath:h,setInitialFiles:u,setMaxFiles:f,setOnCancel:l,setOnSuccess:x},children:$O(nn.Fragment,{children:[o,pi(jI,{})]})}),e[7]=o,e[8]=n,e[9]=m,e[10]=p,e[11]=c,e[12]=d,e[13]=y,e[14]=C,e[15]=S):S=e[15],S}var Ho=()=>nn.use(OI);function MI(){let t=Wi();return`${jO}-${t||1}`}import{c as GO}from"react/compiler-runtime";import{jsx as gi,jsxs as WO}from"react/jsx-runtime";import"react";import{c as MO}from"react/compiler-runtime";import{jsx as hi,jsxs as Qm}from"react/jsx-runtime";import{formatFilesize as BO}from"payload/shared";import"react";var Nn="upload-relationship-details";function Km(t){let e=MO(34),{id:o,allowEdit:n,allowRemove:r,alt:s,byteSize:i,className:a,collectionSlug:l,displayPreview:c,filename:u,mimeType:d,onRemove:f,reloadDoc:m,src:h,thumbnailSrc:p,withMeta:g,x:b,y:v}=t,x=g===void 0?!0:g,{config:y}=H(),C;e[0]!==l||e[1]!==y?(C="collections"in y?y.collections.find(O=>O.slug===l):void 0,e[0]=l,e[1]=y,e[2]=C):C=e[2];let S=C,w=h?o:void 0,D;e[3]!==l||e[4]!==w?(D={id:w,collectionSlug:l},e[3]=l,e[4]=w,e[5]=D):D=e[5];let[_,,A]=Jt(D),{openDrawer:F}=A,R;e[6]!==l||e[7]!==m?(R=async O=>{let{doc:B}=O;return m(B.id,l)},e[6]=l,e[7]=m,e[8]=R):R=e[8];let I=R,E;e[9]!==b||e[10]!==v?(E=function(B,G){let X=[];return G&&X.push(BO(G)),b&&v&&X.push(`${b}x${v}`),B&&X.push(B),X.join(" \u2014 ")},e[9]=b,e[10]=v,e[11]=E):E=e[11];let $=x?E(d,i):"",j=c??S.upload?.displayPreview??!0,N;e[12]!==a?(N=[Nn,a].filter(Boolean),e[12]=a,e[13]=N):N=e[13];let P=N.join(" "),L;e[14]!==s||e[15]!==u||e[16]!==j||e[17]!==p?(L=j&&hi(_3,{alt:s,className:`${Nn}__thumbnail`,filename:u,fileSrc:p,size:"small"}),e[14]=s,e[15]=u,e[16]=j,e[17]=p,e[18]=L):L=e[18];let V;e[19]!==u||e[20]!==h?(V=h?hi("a",{href:h,target:"_blank",children:u}):u,e[19]=u,e[20]=h,e[21]=V):V=e[21];let M;return e[22]!==_||e[23]!==n||e[24]!==r||e[25]!==$||e[26]!==f||e[27]!==I||e[28]!==F||e[29]!==V||e[30]!==P||e[31]!==L||e[32]!==x?(M=Qm("div",{className:P,children:[Qm("div",{className:`${Nn}__imageAndDetails`,children:[L,Qm("div",{className:`${Nn}__details`,children:[hi("p",{className:`${Nn}__filename`,children:V}),x?hi("p",{className:`${Nn}__meta`,children:$}):null]})]}),n!==!1||r!==!1?Qm("div",{className:`${Nn}__actions`,children:[n!==!1?hi(ne,{buttonStyle:"icon-label",className:`${Nn}__edit`,icon:"edit",iconStyle:"none",onClick:F}):null,r!==!1?hi(ne,{buttonStyle:"icon-label",className:`${Nn}__remove`,icon:"x",iconStyle:"none",onClick:()=>f()}):null,hi(_,{onSave:I})]}):null]}),e[22]=_,e[23]=n,e[24]=r,e[25]=$,e[26]=f,e[27]=I,e[28]=F,e[29]=V,e[30]=P,e[31]=L,e[32]=x,e[33]=M):M=e[33],M}import{jsx as VO}from"react/jsx-runtime";import"react";var BI="upload-field-card";function ef({children:t,className:e,size:o="medium"}){return VO("div",{className:[BI,e,`${BI}--size-${o}`].filter(Boolean).join(" "),children:t})}import{isImage as HO}from"payload/shared";var Xc="upload upload--has-many";function VI(t){let e=GO(27),{className:o,displayPreview:n,fileDocs:r,isSortable:s,onRemove:i,onReorder:a,readonly:l,reloadDoc:c,serverURL:u}=t,d;e[0]!==r||e[1]!==a?(d=(v,x)=>{if(v===x)return;let y=[...r],[C]=y.splice(v,1);y.splice(x,0,C),a(y)},e[0]=r,e[1]=a,e[2]=d):d=e[2];let f=d,m;e[3]!==r||e[4]!==i?(m=v=>{let x=[...r||[]];x.splice(v,1),i(x.length===0?[]:x)},e[3]=r,e[4]=i,e[5]=m):m=e[5];let h=m,p;e[6]!==o?(p=[Xc,o].filter(Boolean),e[6]=o,e[7]=p):p=e[7];let g=p.join(" "),b;if(e[8]!==n||e[9]!==r||e[10]!==s||e[11]!==f||e[12]!==l||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==g){let v;e[18]!==f?(v=y=>{let{moveFromIndex:C,moveToIndex:S}=y;return f(C,S)},e[18]=f,e[19]=v):v=e[19];let x;e[20]!==n||e[21]!==s||e[22]!==l||e[23]!==c||e[24]!==h||e[25]!==u?(x=(y,C)=>{let{relationTo:S,value:w}=y,D=String(w.id),_,A;if(w.url)try{_=new URL(w.url,u).toString()}catch{_=`${u}${w.url}`}if(w.thumbnailURL)try{A=new URL(w.thumbnailURL,u).toString()}catch{A=`${u}${w.thumbnailURL}`}return HO(w.mimeType)&&(A=ha({sizes:w.sizes,thumbnailURL:A,url:_,width:w.width})),gi(Jr,{disabled:!s||l,id:D,children:F=>gi("div",{className:[`${Xc}__dragItem`,F&&s&&`${Xc}--has-drag-handle`].filter(Boolean).join(" "),ref:F.setNodeRef,style:{transform:F.transform,transition:F.transition,zIndex:F.isDragging?1:void 0},children:WO(ef,{size:"small",children:[F&&gi("div",{className:`${Xc}__drag`,...F.attributes,...F.listeners,children:gi(Cn,{})}),gi(Km,{allowEdit:!l,allowRemove:!l,alt:w?.alt||w?.filename,byteSize:w.filesize,collectionSlug:S,displayPreview:n,filename:w.filename,id:D,mimeType:w?.mimeType,onRemove:()=>h(C),reloadDoc:c,src:_,thumbnailSrc:A,withMeta:!1,x:w?.width,y:w?.height})]})})},D)},e[20]=n,e[21]=s,e[22]=l,e[23]=c,e[24]=h,e[25]=u,e[26]=x):x=e[26],b=gi("div",{className:g,children:gi(cr,{className:`${Xc}__draggable-rows`,ids:r?.map(zO),onDragEnd:v,children:r.map(x)})}),e[8]=n,e[9]=r,e[10]=s,e[11]=f,e[12]=l,e[13]=c,e[14]=h,e[15]=u,e[16]=g,e[17]=b}else b=e[17];return b}function zO(t){let{value:e}=t;return String(e.id)}import{jsx as GI}from"react/jsx-runtime";import{isImage as XO}from"payload/shared";import"react";var UO="upload upload--has-one";function WI(t){let{className:e,displayPreview:o,fileDoc:n,onRemove:r,readonly:s,reloadDoc:i,serverURL:a}=t,{relationTo:l,value:c}=n,u=String(c?.id),d,f;if(c.url)try{d=new URL(c.url,a).toString()}catch{d=`${a}${c.url}`}if(c.thumbnailURL)try{f=new URL(c.thumbnailURL,a).toString()}catch{f=`${a}${c.thumbnailURL}`}return XO(c.mimeType)&&(f=ha({sizes:c.sizes,thumbnailURL:f,url:d,width:c.width})),GI(ef,{className:[UO,e].filter(Boolean).join(" "),children:GI(Km,{allowEdit:!s,allowRemove:!s,alt:c?.alt||c?.filename,byteSize:c.filesize,collectionSlug:l,displayPreview:o,filename:c.filename,id:u,mimeType:c?.mimeType,onRemove:r,reloadDoc:i,src:d,thumbnailSrc:f,x:c?.width,y:c?.height})})}var sn="upload";function tf(t){let{AfterInput:e,allowCreate:o,api:n,BeforeInput:r,className:s,Description:i,description:a,displayPreview:l,Error:c,filterOptions:u,hasMany:d,isSortable:f,Label:m,label:h,localized:p,maxRows:g,onChange:b,path:v,readOnly:x,relationTo:y,required:C,serverURL:S,showError:w,style:D,value:_}=t,[A,F]=Xr.useState(),[R,I]=Xr.useState(Array.isArray(y)?y[0]:y),{openModal:E}=de(),{drawerSlug:T,setCollectionSlug:$,setCurrentActivePath:j,setInitialFiles:N,setMaxFiles:P,setOnSuccess:L}=Ho(),{permissions:V}=Ae(),{code:M}=Ne(),{i18n:O,t:B}=k(),G=XI(()=>({...u,[R]:{...u?.[R]||{},id:{...u?.[R]?.id||{},not_in:(u?.[R]?.id?.not_in||[]).concat(...Array.isArray(_)||_?[_]:[])}}}),[_,R,u]),[X,,{closeDrawer:Z,openDrawer:te}]=ai({collectionSlugs:typeof y=="string"?[y]:y,filterOptions:G}),[U,,{closeDrawer:z,openDrawer:ce}]=Jt({collectionSlug:R}),J=Xr.useRef(!1),ue=XI(()=>o?!!(typeof R=="string"&&V?.collections&&V.collections?.[R]?.create):!1,[R,V,o]),re=Xr.useCallback(se=>{typeof b=="function"&&b(se)},[b]),q=Xr.useCallback(async(se,Y)=>{if(!se.length)return;let ie={depth:0,draft:!0,limit:se.length,locale:M,where:{and:[{id:{in:se}}]}},me=await fetch(`${S}${n}/${Y}`,{body:UI.stringify(ie),credentials:"include",headers:{"Accept-Language":O.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(me.ok){let we=await me.json(),ze=se.map($e=>we.docs.find(ot=>String(ot.id)===String($e)));return ze.includes(void 0)&&d&&(ze=ze.map(($e,ot)=>$e||{id:se[ot],filename:`${B("general:untitled")} - ID: ${se[ot]}`,isPlaceholder:!0})),{...we,docs:ze}}return null},[M,S,n,O.language,B,d]),pe=HI(se=>{if(d){let Y=[...Array.isArray(_)?_:[],...se.map(ie=>ie.id)];re(Y),F(ie=>[...ie||[],...se.map(me=>({relationTo:R,value:me}))])}else{let Y=se[0];re(Y.id),F([{relationTo:R,value:Y}])}},[_,re,R,d]),he=Xr.useCallback(se=>{let Y=se;if(!d&&se&&se.length>1){let ie=new DataTransfer;ie.items.add(se[0]),Y=ie.files}Y&&N(Y),$(y),typeof g=="number"&&P(g),j(v),E(T)},[T,d,E,y,$,N,g,P,v,j]),_e=Xr.useCallback(async se=>{let Y=[];for(let[me,we]of se)we&&Y.push(me);let ie=await q(Y,R);ie&&F(me=>[...me||[],...ie.docs.map(we=>({relationTo:R,value:we}))]),re([...Array.isArray(_)?_:[],...Y]),Z()},[R,Z,re,q,_]),ge=Xr.useCallback(se=>{se.doc&&(F(Y=>[...Y||[],{relationTo:R,value:se.doc}]),re(se.doc.id)),z()},[z,R,re]),Ve=HI(async({collectionSlug:se,doc:Y})=>{let ie=await q([Y.id],se),me=ie?ie.docs?.[0]:null;F(we=>me?d?[...we||[],{relationTo:R,value:me}]:[{relationTo:R,value:me}]:we),re(d?[...Array.isArray(_)?_:[],Y.id]:Y.id),Z()},[Z,d,q,re,_,R]),Q=Xr.useCallback(async(se,Y)=>{let{docs:ie}=await q([se],Y);if(ie[0]){let me=[];F(we=>{let ze=we?.findIndex($e=>($e.value?.id===ie[0].id||$e.value?.isPlaceholder)&&$e.relationTo===Y);if(ze>-1){let $e=[...we];return $e[ze]={relationTo:Y,value:ie[0]},me=$e,$e}}),me.length&&d&&re(me.map(we=>we.value?.id))}},[q,re,d]),Le=Xr.useCallback(se=>{let Y=se.map(({value:ie})=>ie.id);re(Y),F(se)},[re]),De=Xr.useCallback(se=>{let Y=se?se.map(({value:ie})=>ie.id):null;re(d?Y:Y?Y[0]:null),F(se||[])},[re,d]);zI(()=>{async function se(){if(_){J.current=!0;let Y=await q(Array.isArray(_)?_:[_],R);Y&&F(Y.docs.map(ie=>({relationTo:R,value:ie})))}}J.current||se()},[q,R,_]),zI(()=>{L(v,pe)},[_,v,pe,L]);let ae=!_||d&&Array.isArray(_)&&(typeof g!="number"||_.length<g)||!d&&A?.[0]&&typeof A[0].value>"u";return bi("div",{className:[Ce,sn,s,w&&"error",x&&"read-only"].filter(Boolean).join(" "),id:`field-${v?.replace(/\./g,"__")}`,style:D,children:[$t(oe,{CustomComponent:m,Fallback:$t(xe,{label:h,localized:p,path:v,required:C})}),$t("div",{className:`${sn}__wrap`,children:$t(oe,{CustomComponent:c,Fallback:$t(He,{path:v,showError:w})})}),r,bi("div",{className:`${sn}__dropzoneAndUpload`,children:[d&&Array.isArray(_)&&_.length>0?$t(Uc,{children:A&&A?.length>0?$t(VI,{displayPreview:l,fileDocs:A,isSortable:f&&!x,onRemove:De,onReorder:Le,readonly:x,reloadDoc:Q,serverURL:S}):$t("div",{className:`${sn}__loadingRows`,children:_.map(se=>$t(St,{height:"40px"},se))})}):null,!d&&_?$t(Uc,{children:A&&A?.length>0&&A[0].value?$t(WI,{displayPreview:l,fileDoc:A[0],onRemove:De,readonly:x,reloadDoc:Q,serverURL:S}):A&&_&&!A?.[0]?.value?bi(Uc,{children:[B("general:untitled")," - ID: ",_]}):$t(St,{height:"62px"})}):null,ae?$t(mi,{disabled:x||!ue,multipleFiles:d,onChange:he,children:bi("div",{className:`${sn}__dropzoneContent`,children:[bi("div",{className:`${sn}__dropzoneContent__buttons`,children:[ue&&bi(Uc,{children:[$t(ne,{buttonStyle:"pill",className:`${sn}__createNewToggler`,disabled:x||!ue,onClick:()=>{x||(d?he():ce())},size:"small",children:B("general:createNew")}),$t("span",{className:`${sn}__dropzoneContent__orText`,children:B("general:or")})]}),$t(ne,{buttonStyle:"pill",className:`${sn}__listToggler`,disabled:x,onClick:te,size:"small",children:B("fields:chooseFromExisting")}),$t(U,{onSave:ge}),$t(X,{allowCreate:ue,enableRowSelections:d,onBulkSelect:_e,onSelect:Ve})]}),ue&&!x&&bi("p",{className:`${sn}__dragAndDropText`,children:[B("general:or")," ",B("upload:dragAndDrop")]})]})}):$t(Uc,{children:!x&&!A&&(!_||typeof g!="number"||Array.isArray(_)&&_.length<g)?$t(St,{height:"40px"}):null})]}),e,$t(oe,{CustomComponent:i,Fallback:$t(Be,{description:a,path:v})})]})}function qO(t){let{field:e,field:{admin:{allowCreate:o,className:n,description:r,isSortable:s}={},hasMany:i,label:a,localized:l,maxRows:c,relationTo:u,required:d},path:f,readOnly:m,validate:h}=t,{config:p}=H(),g=e.displayPreview,b=ZO.useCallback((E,T)=>{if(typeof h=="function")return h(E,{...T,required:d})},[h,d]),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Error:C,Label:S}={},disabled:w,filterOptions:D,path:_,setValue:A,showError:F,value:R}=Ee({potentiallyStalePath:f,validate:b}),I=JO(()=>rt(e),[e]);return YO(tf,{AfterInput:v,allowCreate:o!==!1,api:p.routes.api,BeforeInput:x,className:n,Description:y,description:r,displayPreview:g,Error:C,filterOptions:D,hasMany:i,isSortable:s,label:a,Label:S,localized:l,maxRows:c,onChange:A,path:_,readOnly:m||w,relationTo:u,required:d,serverURL:p.serverURL,showError:F,style:I,value:R})}var Yc=je(qO);function Aa(t){let e=QO(13),{clientFieldConfig:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:a,permissions:l,readOnly:c,schemaPath:u}=t,d;e[0]!==a?(d=h=>{let[p]=h;return p&&p?.[a]?.customComponents?.Field},e[0]=a,e[1]=d):d=e[1];let f=Et(d);if(f!==void 0)return f||null;let m;if(e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==a||e[8]!==l||e[9]!==c||e[10]!==u){m=Symbol.for("react.early_return_sentinel");e:{let h={forceRender:n,permissions:l,readOnly:c,schemaPath:u},p={...h,indexPath:r,parentPath:s,parentSchemaPath:i};if(o.admin?.hidden){m=Ft(oc,{...h,path:a});break e}switch(o.type){case"array":{m=Ft(Zc,{...p,field:o,path:a});break e}case"blocks":{m=Ft(Ll,{...p,field:o,path:a});break e}case"checkbox":{m=Ft(mr,{...h,field:o,path:a});break e}case"code":{m=Ft(kl,{...h,field:o,path:a});break e}case"collapsible":{m=Ft(Ol,{...p,field:o,path:a});break e}case"date":{m=Ft(ec,{...h,field:o,path:a});break e}case"email":{m=Ft(oi,{...h,field:o,path:a});break e}case"group":{m=Ft(tc,{...p,field:o,path:a});break e}case"join":{m=Ft(mc,{...h,field:o,path:a});break e}case"json":{m=Ft(fc,{...h,field:o,path:a});break e}case"number":{m=Ft(pc,{...h,field:o,path:a});break e}case"point":{m=Ft(hc,{...h,field:o,path:a});break e}case"radio":{m=Ft(vc,{...h,field:o,path:a});break e}case"relationship":{m=Ft(Sc,{...h,field:o,path:a});break e}case"richText":{m=Ft(Ic,{...h,field:o,path:a});break e}case"row":{m=Ft(Rc,{...p,field:o});break e}case"select":{m=Ft(_c,{...h,field:o,path:a});break e}case"tabs":{m=Ft(Tc,{...p,field:o,path:a});break e}case"text":{m=Ft(di,{...h,field:o,path:a});break e}case"textarea":{m=Ft(Ec,{...h,field:o,path:a});break e}case"ui":{let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=Ft(Pc,{}),e[12]=g):g=e[12],m=g;break e}case"upload":{m=Ft(Yc,{...h,field:o,path:a});break e}}}e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=a,e[8]=l,e[9]=c,e[10]=u,e[11]=m}else m=e[11];if(m!==Symbol.for("react.early_return_sentinel"))return m}var Db="render-fields",So=t=>{let e=KO(22),{className:o,fields:n,forceRender:r,margins:s,parentIndexPath:i,parentPath:a,parentSchemaPath:l,permissions:c,readOnly:u}=t,d=Qo();if(n&&n.length>0){let f=s&&`${Db}--margins-${s}`,m=s===!1&&`${Db}--margins-none`,h;e[0]!==o||e[1]!==f||e[2]!==m?(h=[Db,o,f,m].filter(Boolean),e[0]=o,e[1]=f,e[2]=m,e[3]=h):h=e[3];let p=h.join(" "),g;if(e[4]!==n||e[5]!==r||e[6]!==d||e[7]!==i||e[8]!==a||e[9]!==l||e[10]!==c||e[11]!==u||e[12]!==p){let b;e[14]!==r||e[15]!==d||e[16]!==i||e[17]!==a||e[18]!==l||e[19]!==c||e[20]!==u?(b=(v,x)=>{if(!v||eM(v))return null;let{operation:y,permissions:C,read:S}=oM({field:v,operation:d,parentName:a?.includes(".")?a.split(".")[a.split(".").length-1]:a,permissions:c});if("name"in v&&!S)return null;let w=u||v?.admin?.readOnly;w&&v.admin?.readOnly===!1&&(w=!1),"name"in v&&!y&&(w=!0);let{indexPath:D,path:_,schemaPath:A}=tM({field:v,index:x,parentIndexPath:i,parentPath:a,parentSchemaPath:l});return _b(nh,{value:_,children:_b(Aa,{clientFieldConfig:v,forceRender:r,indexPath:D,parentPath:a,parentSchemaPath:l,path:_,permissions:C,readOnly:w,schemaPath:A})},`${_}-${x}`)},e[14]=r,e[15]=d,e[16]=i,e[17]=a,e[18]=l,e[19]=c,e[20]=u,e[21]=b):b=e[21],g=_b(py,{className:p,forceRender:r,children:n.map(b)}),e[4]=n,e[5]=r,e[6]=d,e[7]=i,e[8]=a,e[9]=l,e[10]=c,e[11]=u,e[12]=p,e[13]=g}else g=e[13];return g}return null};var Jc="array-field",YI=t=>{let e=rM(42),{addRow:o,attributes:n,CustomRowLabel:r,duplicateRow:s,errorCount:i,fields:a,forceRender:l,hasMaxRows:c,isDragging:u,isLoading:d,isSortable:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:v,readOnly:x,removeRow:y,row:C,rowCount:S,rowIndex:w,schemaPath:D,setCollapse:_,setNodeRef:A,transform:F,transition:R}=t,I=l===void 0?!1:l,E=Cd(d,500),{i18n:T}=k(),$=Xt(),j=`${sM(m.singular,T)} ${String(w+1).padStart(2,"0")}`,N=i>0&&$,P=N?`${Jc}__row--has-errors`:`${Jc}__row--no-errors`,L;e[0]!==P?(L=[`${Jc}__row`,P].filter(Boolean),e[0]=P,e[1]=L):L=e[1];let V=L.join(" "),M=`${g.split(".").join("-")}-row-${w}`,O=u?1:void 0,B;if(e[2]!==r||e[3]!==o||e[4]!==n||e[5]!==V||e[6]!==s||e[7]!==i||e[8]!==j||e[9]!==N||e[10]!==a||e[11]!==I||e[12]!==c||e[13]!==T||e[14]!==E||e[15]!==f||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==y||e[23]!==C.collapsed||e[24]!==C.id||e[25]!==S||e[26]!==w||e[27]!==D||e[28]!==_||e[29]!==A||e[30]!==M||e[31]!==O||e[32]!==F||e[33]!==R){let G;e[35]!==i||e[36]!==N||e[37]!==T?(G=N&&ys(io,{count:i,i18n:T,withMessage:!0}),e[35]=i,e[36]=N,e[37]=T,e[38]=G):G=e[38];let X;e[39]!==C.id||e[40]!==_?(X=Z=>_(C.id,Z),e[39]=C.id,e[40]=_,e[41]=X):X=e[41],B=ys("div",{id:M,ref:A,style:{transform:F,transition:R,zIndex:O},children:ys(Xs,{actions:x?void 0:ys(xd,{addRow:o,duplicateRow:s,hasMaxRows:c,index:w,isSortable:f,moveRow:p,removeRow:y,rowCount:S}),className:V,collapsibleStyle:N?"error":"default",dragHandleProps:f?{id:C.id,attributes:n,listeners:h}:void 0,header:nM("div",{className:`${Jc}__row-header`,children:[E?ys(St,{height:"1rem",width:"8rem"}):ys(dn,{CustomComponent:r,label:j,path:b,rowNumber:w}),G]}),isCollapsed:C.collapsed,onToggle:X,children:E?ys(St,{}):ys(So,{className:`${Jc}__fields`,fields:a,forceRender:I,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:D,permissions:v===!0?v:v?.fields,readOnly:x})})},`${g}-row-${C.id}`),e[2]=r,e[3]=o,e[4]=n,e[5]=V,e[6]=s,e[7]=i,e[8]=j,e[9]=N,e[10]=a,e[11]=I,e[12]=c,e[13]=T,e[14]=E,e[15]=f,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=y,e[23]=C.collapsed,e[24]=C.id,e[25]=S,e[26]=w,e[27]=D,e[28]=_,e[29]=A,e[30]=M,e[31]=O,e[32]=F,e[33]=R,e[34]=B}else B=e[34];return B};var yr="array-field",lM=t=>{let e=iM(52),{field:o,forceRender:n,path:r,permissions:s,readOnly:i,schemaPath:a,validate:l}=t,{name:c,admin:u,fields:d,label:f,localized:m,maxRows:h,minRows:p,required:g}=o,b;e[0]!==u?(b=u===void 0?{}:u,e[0]=u,e[1]=b):b=e[1];let{className:v,description:x,isSortable:y}=b,C=y===void 0?!0:y,S=n===void 0?!1:n,w=a??c,D=p??g?1:0,{setDocFieldPreferences:_}=Pe(),{addFieldRow:A,dispatchFields:F,moveFieldRow:R,removeFieldRow:I,setModified:E}=Oe(),T=Xt(),{code:$}=Ne(),{i18n:j,t:N}=k(),{config:P}=H(),{localization:L}=P,V;e:{if(L&&L.fallback){let K=L.defaultLocale;V=$===K;break e}V=!0}let M=V,O;e[2]!==N?(O=K=>"labels"in K&&K?.labels?K.labels:"labels"in K.field&&K.field.labels?{plural:K.field.labels?.plural,singular:K.field.labels?.singular}:"label"in K.field&&K.field.label?{plural:void 0,singular:K.field.label}:{plural:N("general:rows"),singular:N("general:row")},e[2]=N,e[3]=O):O=e[3];let G=O(t),X;e[4]!==M||e[5]!==h||e[6]!==D||e[7]!==g||e[8]!==l?(X=(K,W)=>{if(!M&&K===null)return!0;if(typeof l=="function")return l(K,{...W,maxRows:h,minRows:D,required:g})},e[4]=M,e[5]=h,e[6]=D,e[7]=g,e[8]=l,e[9]=X):X=e[9];let Z=X,te;e[10]!==Z||e[11]!==r?(te={hasRows:!0,potentiallyStalePath:r,validate:Z},e[10]=Z,e[11]=r,e[12]=te):te=e[12];let{customComponents:U,disabled:z,errorPaths:ce,path:J,rows:ue,showError:re,valid:q,value:pe}=Ee(te),he;e[13]!==U?(he=U===void 0?{}:U,e[13]=U,e[14]=he):he=e[14];let{AfterInput:_e,BeforeInput:ge,Description:Ve,Error:Q,Label:Le}=he,De;e[15]!==ue?(De=ue===void 0?[]:ue,e[15]=ue,e[16]=De):De=e[16];let ae=De,se;e[17]!==A||e[18]!==J||e[19]!==w?(se=K=>{A({path:J,rowIndex:K,schemaPath:w}),setTimeout(()=>{Ji(`${J}-row-${K}`)},0)},e[17]=A,e[18]=J,e[19]=w,e[20]=se):se=e[20];let Y=se,ie;e[21]!==F||e[22]!==J||e[23]!==E?(ie=K=>{F({type:"DUPLICATE_ROW",path:J,rowIndex:K}),E(!0),setTimeout(()=>{Ji(`${J}-row-${K}`)},0)},e[21]=F,e[22]=J,e[23]=E,e[24]=ie):ie=e[24];let me=ie,we;e[25]!==J||e[26]!==I?(we=K=>{I({path:J,rowIndex:K})},e[25]=J,e[26]=I,e[27]=we):we=e[27];let ze=we,$e;e[28]!==R||e[29]!==J?($e=(K,W)=>{R({moveFromIndex:K,moveToIndex:W,path:J})},e[28]=R,e[29]=J,e[30]=$e):$e=e[30];let ot=$e,Xe;e[31]!==F||e[32]!==J||e[33]!==ae||e[34]!==_?(Xe=K=>{let{collapsedIDs:W,updatedRows:ee}=fd({collapsed:K,rows:ae});_(J,{collapsed:W}),F({type:"SET_ALL_ROWS_COLLAPSED",path:J,updatedRows:ee})},e[31]=F,e[32]=J,e[33]=ae,e[34]=_,e[35]=Xe):Xe=e[35];let Ue=Xe,ft;e[36]!==F||e[37]!==J||e[38]!==ae||e[39]!==_?(ft=(K,W)=>{let{collapsedIDs:ee,updatedRows:le}=md({collapsed:W,rowID:K,rows:ae});F({type:"SET_ROW_COLLAPSED",path:J,updatedRows:le}),_(J,{collapsed:ee})},e[36]=F,e[37]=J,e[38]=ae,e[39]=_,e[40]=ft):ft=e[40];let Qt=ft,Ge=h&&ae.length>=h,Je=ce.length,Ye=T&&ce.length>0,xt=(i||z)&&ae.length===0,jt=ae.length&&ae.length<D||g&&ae.length===0,gt=Ye?`${yr}--has-error`:`${yr}--has-no-error`,qe;e[41]!==v||e[42]!==gt?(qe=[Ce,yr,v,gt].filter(Boolean),e[41]=v,e[42]=gt,e[43]=qe):qe=e[43];let Tt;e[44]!==Q||e[45]!==J||e[46]!==re?(Tt=re&&uo(oe,{CustomComponent:Q,Fallback:uo(He,{path:J,showError:re})}),e[44]=Q,e[45]=J,e[46]=re,e[47]=Tt):Tt=e[47];let be;return e[48]!==Je||e[49]!==Ye||e[50]!==j?(be=Ye&&Je>0&&uo(io,{count:Je,i18n:j,withMessage:!0}),e[48]=Je,e[49]=Ye,e[50]=j,e[51]=be):be=e[51],vi("div",{className:qe.join(" "),id:`field-${J.replace(/\./g,"__")}`,children:[Tt,vi("header",{className:`${yr}__header`,children:[vi("div",{className:`${yr}__header-wrap`,children:[vi("div",{className:`${yr}__header-content`,children:[uo("h3",{className:`${yr}__title`,children:uo(oe,{CustomComponent:Le,Fallback:uo(xe,{as:"span",label:f,localized:m,path:J,required:g})})}),be]}),ae?.length>0&&vi("ul",{className:`${yr}__header-actions`,children:[uo("li",{children:uo("button",{className:`${yr}__header-action`,onClick:()=>Ue(!0),type:"button",children:N("fields:collapseAll")})}),uo("li",{children:uo("button",{className:`${yr}__header-action`,onClick:()=>Ue(!1),type:"button",children:N("fields:showAll")})})]})]}),uo(oe,{CustomComponent:Ve,Fallback:uo(Be,{description:x,path:J})})]}),uo(Fl,{fieldValue:pe,localized:m,path:J}),ge,(ae?.length>0||!q&&(xt||jt))&&vi(cr,{className:`${yr}__draggable-rows`,ids:ae.map(cM),onDragEnd:K=>{let{moveFromIndex:W,moveToIndex:ee}=K;return ot(W,ee)},children:[ae.map((K,W)=>{let{id:ee,isLoading:le}=K,ve=`${J}.${W}`,Fe=ce?.filter(Se=>Se.startsWith(ve+".")).length;return uo(Jr,{disabled:i||z||!C,id:ee,children:Se=>uo(YI,{...Se,addRow:Y,CustomRowLabel:ae?.[W]?.customComponents?.RowLabel,duplicateRow:me,errorCount:Fe,fields:d,forceRender:S,hasMaxRows:Ge,isLoading:le,isSortable:C,labels:G,moveRow:ot,parentPath:J,path:ve,permissions:s,readOnly:i||z,removeRow:ze,row:K,rowCount:ae?.length,rowIndex:W,schemaPath:w,setCollapse:Qt})},ee)}),!q&&vi(aM.Fragment,{children:[xt&&uo(Rr,{children:N("validation:fieldHasNo",{label:Fb(G.plural,j)})}),jt&&uo(Rr,{type:"error",children:N("validation:requiresAtLeast",{count:D,label:Fb(D>1?G.plural:G.singular,j)||N(D>1?"general:rows":"general:row")})})]})]}),!Ge&&!i&&uo(ne,{buttonStyle:"icon-label",className:`${yr}__add-row`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:()=>{Y(pe||0)},children:N("fields:addLabel",{label:Fb(G.singular,j)})}),_e]})},Zc=je(lM);function cM(t){return t.id}import{c as uM}from"react/compiler-runtime";import{jsx as Ab,jsxs as ZI}from"react/jsx-runtime";import{confirmPassword as dM}from"payload/shared";import"react";var qc=t=>{let e=uM(12),{disabled:o,path:n}=t,r=n===void 0?"confirm-password":n,{t:s}=k(),i;e[0]!==r?(i={path:r,validate:mM},e[0]=r,e[1]=i):i=e[1];let{disabled:a,setValue:l,showError:c,value:u}=Ee(i),d=c&&"error",f;e[2]!==d?(f=[Ce,"confirm-password",d].filter(Boolean),e[2]=d,e[3]=f):f=e[3];let m=f.join(" "),h;return e[4]!==a||e[5]!==o||e[6]!==r||e[7]!==l||e[8]!==s||e[9]!==m||e[10]!==u?(h=ZI("div",{className:m,children:[Ab(xe,{htmlFor:"field-confirm-password",label:s("authentication:confirmPassword"),required:!0}),ZI("div",{className:`${Ce}__wrap`,children:[Ab(He,{path:r}),Ab("input",{"aria-label":s("authentication:confirmPassword"),autoComplete:"off",disabled:!!(a||o),id:"field-confirm-password",name:"confirm-password",onChange:l,type:"password",value:u||""})]})]}),e[4]=a,e[5]=o,e[6]=r,e[7]=l,e[8]=s,e[9]=m,e[10]=u,e[11]=h):h=e[11],h};function mM(t,e){return dM(t,{name:"confirm-password",type:"text",required:!0,...e})}import{jsx as pM}from"react/jsx-runtime";import{password as hM}from"payload/shared";import{useCallback as gM,useMemo as bM}from"react";import{c as fM}from"react/compiler-runtime";import{jsx as xi,jsxs as Tb}from"react/jsx-runtime";import{getTranslation as JI}from"@payloadcms/translations";import"react";var qI=t=>{let e=fM(28),{AfterInput:o,autoComplete:n,BeforeInput:r,className:s,description:i,Description:a,Error:l,inputRef:c,Label:u,label:d,localized:f,onChange:m,onKeyDown:h,path:p,placeholder:g,readOnly:b,required:v,rtl:x,showError:y,style:C,value:S,width:w}=t,D=n===void 0?"off":n,{i18n:_}=k(),A=y&&"error",F=b&&"read-only",R;e[0]!==s||e[1]!==A||e[2]!==F?(R=[Ce,"password",s,A,F].filter(Boolean),e[0]=s,e[1]=A,e[2]=F,e[3]=R):R=e[3];let I=R.join(" "),E;return e[4]!==o||e[5]!==r||e[6]!==a||e[7]!==l||e[8]!==u||e[9]!==D||e[10]!==i||e[11]!==_||e[12]!==c||e[13]!==d||e[14]!==f||e[15]!==m||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==y||e[23]!==C||e[24]!==I||e[25]!==S||e[26]!==w?(E=Tb("div",{className:I,style:{...C,width:w},children:[xi(oe,{CustomComponent:u,Fallback:xi(xe,{label:d,localized:f,path:p,required:v})}),Tb("div",{className:`${Ce}__wrap`,children:[xi(oe,{CustomComponent:l,Fallback:xi(He,{path:p,showError:y})}),Tb("div",{children:[r,xi("input",{"aria-label":JI(d,_),autoComplete:D,"data-rtl":x,disabled:b,id:`field-${p.replace(/\./g,"__")}`,name:p,onChange:m,onKeyDown:h,placeholder:JI(g,_),ref:c,type:"password",value:S||""}),o]}),xi(oe,{CustomComponent:a,Fallback:xi(Be,{description:i,path:p})})]})]}),e[4]=o,e[5]=r,e[6]=a,e[7]=l,e[8]=u,e[9]=D,e[10]=i,e[11]=_,e[12]=c,e[13]=d,e[14]=f,e[15]=m,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=y,e[23]=C,e[24]=I,e[25]=S,e[26]=w,e[27]=E):E=e[27],E};var vM=t=>{let{autoComplete:e,field:o,field:{admin:{className:n,disabled:r,placeholder:s,rtl:i}={},label:a,localized:l,required:c}={},inputRef:u,path:d,validate:f}=t,{t:m}=k(),h=Ne(),{config:p}=H(),g=gM((R,I)=>{let E=d?d.split("."):[];return typeof f=="function"?f(R,{...I,required:c}):hM(R,{name:"password",type:"text",blockData:{},data:{},event:"onChange",path:E,preferences:{fields:{}},req:{payload:{config:p},t:m},required:!0,siblingData:{}})},[f,p,m,c,d]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,setValue:w,showError:D,value:_}=Ee({path:d,validate:g}),A=Zi({fieldLocalized:!1,fieldRTL:i,locale:h,localizationConfig:p.localization||void 0}),F=bM(()=>rt(o),[o]);return pM(qI,{AfterInput:b,autoComplete:e,BeforeInput:v,className:n,Description:x,Error:y,inputRef:u,Label:C,label:a,localized:l,onChange:R=>{w(R.target.value)},path:d,placeholder:s,readOnly:S||r,required:c,rtl:A,showError:D,style:F,value:_||""})},Qc=je(vM);var QI={array:Zc,blocks:Ll,checkbox:mr,code:kl,collapsible:Ol,confirmPassword:qc,date:ec,email:oi,group:tc,hidden:oc,join:mc,json:fc,number:pc,password:Qc,point:hc,radio:vc,relationship:Sc,richText:Ic,row:Rc,select:_c,tabs:Tc,text:di,textarea:Ec,ui:Pc,upload:Yc},xM={...QI,Description:Be,Error:He,Label:xe,RowLabel:dn};import{c as yM}from"react/compiler-runtime";import{setsAreEqual as CM}from"payload/shared";import{useEffect as wM}from"react";var Ln=new Map([]),SM={altleft:"alt",altright:"alt",controlleft:"ctrl",controlright:"ctrl",ctrlleft:"ctrl",ctrlright:"ctrl",escape:"esc",metaleft:"meta",metaright:"meta",osleft:"meta",osright:"meta",shiftleft:"shift",shiftright:"shift"},KI=t=>(SM[t.toLowerCase()]||t).trim().toLowerCase().replace("key",""),IM=t=>{let e=KI(t);e==="meta"&&Ln.forEach((o,n)=>n!=="meta"&&Ln.delete(n)),Ln.set(e,Date.now())},RM=t=>{let e=KI(t);e==="meta"&&Ln.clear(),Ln.delete(e)},yi=(t,e)=>{let o=yM(9),{cmdCtrlKey:n,editDepth:r,keyCodes:s}=t,{modalState:i}=de(),a;o[0]!==n||o[1]!==r||o[2]!==e||o[3]!==s||o[4]!==i?(a=f=>{let m=f.detail?.key?f.detail:f;if(m.key===void 0)return;Ln.forEach(_M),m.code&&IM(m.code);let h=window.navigator.userAgent.includes("Mac OS X"),p=[...Ln.keys()].filter(DM);if(CM(new Set(p),new Set(s))&&(!n||h&&Ln.has("meta")||!h&&m.ctrlKey)){if((Object.keys(i).filter(b=>i[b]?.isOpen)?.length+1||1)!==r)return;e(m)}},o[0]=n,o[1]=r,o[2]=e,o[3]=s,o[4]=i,o[5]=a):a=o[5];let l=a,c=FM,u,d;o[6]!==l?(u=()=>(document.addEventListener("keydown",l,!1),document.addEventListener("bypassKeyDown",l,!1),document.addEventListener("keyup",c,!1),()=>{document.removeEventListener("keydown",l),document.removeEventListener("bypassKeyDown",l),document.removeEventListener("keyup",c)}),d=[l,c],o[6]=l,o[7]=u,o[8]=d):(u=o[7],d=o[8]),wM(u,d)};function _M(t,e){Date.now()-t>3e3&&Ln.delete(e)}function DM(t){return!["alt","ctrl","meta","shift"].includes(t)}function FM(t){t.code&&RM(t.code)}import{c as AM}from"react/compiler-runtime";import*as t4 from"qs-esm";import{useEffect as e4,useRef as TM,useState as of}from"react";var EM=(t,e)=>{let o=AM(32),n;o[0]!==e?(n=e===void 0?{}:e,o[0]=e,o[1]=n):n=o[1];let r=n,{initialData:s,initialParams:i}=r,a;o[2]!==i?(a=i===void 0?{}:i,o[2]=i,o[3]=a):a=o[3];let l=a,{i18n:c}=k(),u;o[4]!==s?(u=s||{},o[4]=s,o[5]=u):u=o[5];let[d,f]=of(u),[m,h]=of(l),[p,g]=of(!s),[b,v]=of(!1),{code:x}=Ne(),y=TM(!1),C;if(o[6]!==x||o[7]!==m){let E;o[9]!==m?(E=typeof m=="object"?m:{},o[9]=m,o[10]=E):E=o[10],C=t4.stringify({locale:x,...E},{addQueryPrefix:!0}),o[6]=x,o[7]=m,o[8]=C}else C=o[8];let S=C,w;o[11]!==c.language||o[12]!==s||o[13]!==S||o[14]!==t?(w=()=>{if(s&&!y.current){y.current=!0;return}let E=new AbortController;return t?(async()=>{v(!1),g(!0);try{let $=await Qe.get(`${t}${S}`,{headers:{"Accept-Language":c.language},signal:E.signal});$.status>201&&v(!0);let j=await $.json();f(j),g(!1)}catch{E.signal.aborted||(v(!0),g(!1))}})():(v(!1),g(!1)),()=>{try{E.abort()}catch($){let j=$}}},o[11]=c.language,o[12]=s,o[13]=S,o[14]=t,o[15]=w):w=o[15];let D;o[16]!==c.language||o[17]!==s||o[18]!==x||o[19]!==S||o[20]!==t?(D=[t,x,S,c.language,s],o[16]=c.language,o[17]=s,o[18]=x,o[19]=S,o[20]=t,o[21]=D):D=o[21],e4(w,D);let _,A;o[22]!==s?(_=()=>{s&&y.current&&f(s)},A=[s],o[22]=s,o[23]=_,o[24]=A):(_=o[23],A=o[24]),e4(_,A);let F;o[25]!==d||o[26]!==b||o[27]!==p?(F={data:d,isError:b,isLoading:p},o[25]=d,o[26]=b,o[27]=p,o[28]=F):F=o[28];let R;o[29]===Symbol.for("react.memo_cache_sentinel")?(R={setParams:h},o[29]=R):R=o[29];let I;return o[30]!==F?(I=[F,R],o[30]=F,o[31]=I):I=o[31],I};import{c as PM}from"react/compiler-runtime";import{useEffect as NM,useState as LM}from"react";var $M=t=>{let e=PM(5),[o,n]=LM(),r,s;e[0]!==t?(r=()=>{let a;return t&&(a=new ResizeObserver(l=>{l.forEach(c=>{let{contentBoxSize:u,contentRect:d}=c,f=0,m=0;if(u){let h=Array.isArray(u)?u[0]:u;if(h){let{blockSize:p,inlineSize:g}=h;f=g,m=p}}else if(d){let{height:h,width:p}=d;f=p,m=h}n({height:m,width:f})})}),a.observe(t)),()=>{a&&a.unobserve(t)}},s=[t],e[0]=t,e[1]=r,e[2]=s):(r=e[1],s=e[2]),NM(r,s);let i;return e[3]!==o?(i={size:o},e[3]=o,e[4]=i):i=e[4],i};import{flattenTopLevelFields as kM}from"payload/shared";var Eb=t=>{let{admin:{useAsTitle:e},fields:o}=t;return kM(o)?.find(r=>"name"in r&&r.name===e)};import{c as n4}from"react/compiler-runtime";import{jsx as ka}from"react/jsx-runtime";import{useEffect as jM,useRef as OM}from"react";import{jsx as rf}from"react/jsx-runtime";import"react";var o4=({className:t})=>rf("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rf("path",{className:"fill",d:"M2.5 13.3333L5.83333 16.6667M5.83333 16.6667L9.16667 13.3333M5.83333 16.6667V3.33333M9.16667 7.08333H17.5M9.16667 10.4167H15M11.6667 13.75H12.5",stroke:"#2F2F2F",strokeLinecap:"round",strokeLinejoin:"round"})}),r4=({className:t})=>rf("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rf("path",{className:"fill",d:"M2.5 6.66668L5.83333 3.33334M5.83333 3.33334L9.16667 6.66668M5.83333 3.33334V16.6667M11.6667 7.08354H17.5M9.16667 10.4169H15M9.16667 13.7502H12.5",stroke:"#2F2F2F",strokeLinecap:"round",strokeLinejoin:"round"})});var $n="sort-header";function MM(){let t=n4(12),{handleSortChange:e,orderableFieldName:o,query:n}=Rt(),r=Array.isArray(n.sort)?n.sort[0]:n.sort,s=OM(r===`-${o}`?"desc":"asc"),i=r===`-${o}`||r===o,a,l;t[0]!==i||t[1]!==o||t[2]!==r?(a=()=>{i&&(s.current=r===`-${o}`?"desc":"asc")},l=[o,r,i],t[0]=i,t[1]=o,t[2]=r,t[3]=a,t[4]=l):(a=t[3],l=t[4]),jM(a,l);let c;t[5]!==e||t[6]!==i||t[7]!==o?(c=()=>{if(i){e(s.current==="asc"?`-${o}`:o),s.current=s.current==="asc"?"desc":"asc";return}e(s.current==="asc"?o:`-${o}`)},t[5]=e,t[6]=i,t[7]=o,t[8]=c):c=t[8];let u=c,d;return t[9]!==u||t[10]!==i?(d={handleSortPress:u,isActive:i,sort:s},t[9]=u,t[10]=i,t[11]=d):d=t[11],d}var BM=t=>{let e=n4(8),{appearance:o}=t,{handleSortPress:n,isActive:r,sort:s}=MM(),{t:i}=k(),a=o&&`${$n}--appearance-${o}`,l;e[0]!==a?(l=[$n,a].filter(Boolean),e[0]=a,e[1]=l):l=e[1];let c=l.join(" "),u;return e[2]!==n||e[3]!==r||e[4]!==s.current||e[5]!==i||e[6]!==c?(u=ka("div",{className:c,children:ka("div",{className:`${$n}__buttons`,children:s.current==="desc"?ka("button",{"aria-label":i("general:sortByLabelDirection",{direction:i("general:ascending"),label:"Order"}),className:`${$n}__button ${$n}__${s.current} ${r?`${$n}--active`:""}`,onClick:n,type:"button",children:ka(o4,{})}):ka("button",{"aria-label":i("general:sortByLabelDirection",{direction:i("general:descending"),label:"Order"}),className:`${$n}__button ${$n}__${s.current} ${r?`${$n}--active`:""}`,onClick:n,type:"button",children:ka(r4,{})})})}),e[2]=n,e[3]=r,e[4]=s.current,e[5]=i,e[6]=c,e[7]=u):u=e[7],u};import{c as VM}from"react/compiler-runtime";import{jsx as s4}from"react/jsx-runtime";import"react";var i4="sort-row",GM=()=>{let t=VM(2),{orderableFieldName:e,query:o}=Rt(),n=o.sort===e||o.sort===`-${e}`,r=`${i4} ${n?"active":""}`,s;return t[0]!==r?(s=s4("div",{className:r,role:"button",tabIndex:0,children:s4(Cn,{className:`${i4}__icon`})}),t[0]=r,t[1]=s):s=t[1],s};import{jsx as Ur,jsxs as l4}from"react/jsx-runtime";import{DragOverlay as WM}from"@dnd-kit/core";import{useEffect as HM,useState as Lb}from"react";import{jsx as nf}from"react/jsx-runtime";var Pb=({cellMap:t,columns:e,dragAttributes:o={},dragListeners:n={},rowId:r,...s})=>nf("tr",{...s,children:e.map((i,a)=>{let{accessor:l}=i,c=i.renderedCells[t[r]];return l==="_dragHandle"?nf("td",{className:`cell-${l}`,children:nf("div",{...o,...n,children:c})},a):nf("td",{className:`cell-${l}`,children:c},a)})});import{jsx as Nb}from"react/jsx-runtime";var a4=({children:t,className:e,rowId:o})=>typeof o>"u"?null:Nb("div",{className:e,children:Nb("table",{cellPadding:0,cellSpacing:0,children:Nb("tbody",{children:t})})});var sf="table",zM=({appearance:t="default",collection:e,columns:o,data:n})=>{let{config:r}=H(),{data:s,orderableFieldName:i,query:a}=Rt(),l=s?.docs||n,[c,u]=Lb(l),[d,f]=Lb({}),[m,h]=Lb();HM(()=>{u(l),f(Object.fromEntries(l.map((x,y)=>[String(x.id??x._id),y])))},[l]);let p=o?.filter(x=>x?.active);if(!p||p.filter(x=>!["_dragHandle","_select"].includes(x.accessor)).length===0)return Ur("div",{children:"No columns selected"});let g=async({moveFromIndex:x,moveToIndex:y})=>{if(a.sort!==i&&a.sort!==`-${i}`){fe.warning('To reorder the rows you must first sort them by the "Order" column'),h(void 0);return}if(x===y){h(void 0);return}let C=c[x].id??c[x]._id,S=y>x?c[y]:c[y-1],w=y>x?c[y+1]:c[y],D=[...c];u(_=>{let A=[..._];return A[x][i]="pending",A.splice(y,0,A.splice(x,1)[0]),A});try{let _=S?{id:S.id??S._id,key:S[i]}:{id:w.id??w._id,key:w[i]},A=S&&a.sort===i||!S&&a.sort===`-${i}`?"greater":"less",F={collectionSlug:e.slug,docsToMove:[C],newKeyWillBe:A,orderableFieldName:i,target:_},R=await fetch(`${r.routes.api}/reorder`,{body:JSON.stringify(F),headers:{"Content-Type":"application/json"},method:"POST"});if(R.status===403)throw new Error("You do not have permission to reorder these rows");if(!R.ok)throw new Error("Failed to reorder. This can happen if you reorder several rows too quickly. Please try again.")}catch(_){let A=_ instanceof Error?_.message:String(_);u(D),fe.error(A)}finally{h(void 0)}},b=({id:x})=>{h(x)},v=c.map(x=>x.id??x._id);return Ur("div",{className:[sf,t&&`${sf}--appearance-${t}`].filter(Boolean).join(" "),children:l4(cr,{ids:v,onDragEnd:g,onDragStart:b,children:[l4("table",{cellPadding:"0",cellSpacing:"0",children:[Ur("thead",{children:Ur("tr",{children:p.map((x,y)=>Ur("th",{id:`heading-${x.accessor}`,children:x.Heading},y))})}),Ur("tbody",{children:c.map((x,y)=>Ur(Jr,{id:v[y],children:({attributes:C,isDragging:S,listeners:w,setNodeRef:D,transform:_,transition:A})=>Ur(Pb,{cellMap:d,className:`row-${y+1}`,columns:p,dragAttributes:C,dragListeners:w,ref:D,rowId:x.id??x._id,style:{opacity:S?0:1,transform:_,transition:A}})},v[y]))})]}),Ur(WM,{children:Ur(a4,{className:[sf,`${sf}--drag-preview`].join(" "),rowId:m,children:Ur(Pb,{cellMap:d,columns:p,rowId:m})})})]})})};import{jsx as c4}from"react/jsx-runtime";import{toWords as XM,transformColumnsToSearchParams as UM}from"payload/shared";import"react";var YM="query-preset-columns-cell",ZM=({cellData:t})=>c4("div",{className:YM,children:t?UM(t).map((e,o)=>{let n=!e.startsWith("-");return n?c4(vt,{pillStyle:n?"always-white":"light",children:XM(e)},o):null}):"No columns selected"});import{jsx as JM}from"react/jsx-runtime";import{toWords as u4}from"payload/shared";import"react";var qM=t=>{if(t.or&&t.or.length>0&&t.or[0].and&&t.or[0].and.length>0){let o=t.or[0]?.and?.[0];if(!o)return"No where query";let n=Object.keys(o)[0];if(!o[n])return"No where query";let r=Object.keys(o[n])[0],s=o[n][r];return`${u4(n)} ${r} ${u4(s)}`}return""},QM=({cellData:t})=>JM("div",{children:t?qM(t):"No where query"});import{jsx as d4,jsxs as m4}from"react/jsx-runtime";import{toWords as f4}from"payload/shared";import{Fragment as KM}from"react";var eB=({cellData:t})=>{let e=["read","update","delete"];return d4("p",{children:e.reduce((o,n,r)=>{let s=t?.[n];return s&&s.constraint&&o.push(m4(KM,{children:[m4("span",{children:[d4("strong",{children:f4(n)}),": ",f4(s.constraint)]}),r!==e.length-1&&", "]},n)),o},[])})};import{c as tB}from"react/compiler-runtime";import{jsx as $b,jsxs as oB}from"react/jsx-runtime";import{toWords as rB,transformColumnsToSearchParams as nB}from"payload/shared";import"react";var sB=t=>{let e=tB(5),{field:o}=t,{label:n,required:r}=o,{path:s,value:i}=Ee(),a;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==i?(a=oB("div",{className:"field-type query-preset-columns-field",children:[$b(xe,{as:"h3",label:n,path:s,required:r}),$b("div",{className:"value-wrapper",children:i?nB(i).map(iB):"No columns selected"})]}),e[0]=n,e[1]=s,e[2]=r,e[3]=i,e[4]=a):a=e[4],a};function iB(t,e){let o=!t.startsWith("-");return $b(vt,{pillStyle:o?"always-white":"light-gray",children:rB(t)},e)}import{jsx as kn,jsxs as af}from"react/jsx-runtime";import{getTranslation as aB}from"@payloadcms/translations";import{toWords as p4}from"payload/shared";import h4 from"react";var lB=(t,e)=>{if(!t)return null;let o=r=>{let s=Object.keys(r)[0];if(!r[s])return"No where query";let i=Object.keys(r[s])[0],a=r[s][i];if(typeof a=="object")try{a=new Date(a).toLocaleDateString()}catch{a="Unknown error has occurred"}return af(vt,{pillStyle:"always-white",children:[kn("b",{children:p4(s)})," ",i," ",kn("b",{children:p4(a)})]})};return((r,s)=>r.or&&r.or.length>0?kn("div",{className:"or-condition",children:r.or.map((i,a)=>kn(h4.Fragment,{children:i.and&&i.and.length>0?af("div",{className:"and-condition",children:[a===0&&kn("span",{className:"label",children:`Filter ${s} where `}),a>0&&kn("span",{className:"label",children:" or "}),i.and.map((l,c)=>af(h4.Fragment,{children:[o(l),c<i.and.length-1&&kn("span",{className:"label",children:" and "})]},c))]}):o(i)},a))}):o(r))(t,e)},cB=t=>{let{field:e}=t,{label:o,required:n}=e,{path:r,value:s}=Ee(),{collectionSlug:i}=Rt(),{getEntityConfig:a}=H(),l=a({collectionSlug:i}),{i18n:c}=k();return af("div",{className:"field-type query-preset-where-field",children:[kn(xe,{as:"h3",label:o,path:r,required:n}),kn("div",{className:"value-wrapper",children:s?lB(s,aB(l.labels.plural,c)):"No where query"})]})};import{c as gB}from"react/compiler-runtime";import{jsx as bB}from"react/jsx-runtime";import vB from"react";import{c as uB}from"react/compiler-runtime";import{useRouter as dB}from"next/navigation.js";import{useEffect as kb,useRef as mB}from"react";function fB(t,...e){t&&t.addEventListener&&t.addEventListener(...e)}function pB(t,...e){t&&t.removeEventListener&&t.removeEventListener(...e)}var hB=(t,e)=>{let o=uB(7),n=t===void 0?!0:t,r;o[0]!==n||o[1]!==e?(r=l=>{if(typeof n!="function"||n())return l.preventDefault(),e&&(l.returnValue=e),e},o[0]=n,o[1]=e,o[2]=r):r=o[2];let s=r,i,a;o[3]!==n||o[4]!==s?(i=()=>{if(n)return fB(window,"beforeunload",s),()=>pB(window,"beforeunload",s)},a=[n,s],o[3]=n,o[4]=s,o[5]=i,o[6]=a):(i=o[5],a=o[6]),kb(i,a)},g4=({hasAccepted:t=!1,message:e="Are you sure want to leave this page?",onAccept:o,onPrevent:n,prevent:r=!0})=>{hB(r,e);let{startRouteTransition:s}=st(),i=dB(),a=mB("");kb(()=>{function l(d,f){let m=new URL(d),h=new URL(f);if(m.hostname===h.hostname&&m.pathname===h.pathname&&m.search===h.search){let p=m.hash,g=h.hash;return p!==g&&m.href.replace(p,"")===h.href.replace(g,"")}return!1}function c(d){for(;d&&d.tagName.toLowerCase()!=="a";)d=d.parentElement;return d}function u(d){try{let f=d.target,m=c(f);if(m){let h=window.location.href,p=m.href,g=l(h,p),b=m.download!=="",v=m.target==="_blank"||d.metaKey||d.ctrlKey;!(p===h||g||b||v)&&r&&(n||!window.confirm(e))&&(a.current=p,d.preventDefault(),d.stopPropagation(),typeof n=="function"&&n())}}catch(f){alert(f)}}return document.addEventListener("click",u,!0),()=>{document.removeEventListener("click",u,!0)}},[n,r,e]),kb(()=>{t&&a.current&&(o&&o(),s(()=>i.push(a.current)))},[t,o,i,s])};var lf="leave-without-saving",Kc=()=>{let t=gB(15),{closeModal:e,openModal:o}=de(),n=Ut(),{isValid:r}=Oe(),{user:s}=Ae(),[i,a]=vB.useState(!1),{t:l}=k(),c=!!((n||!r)&&s),u;t[0]!==o?(u=()=>{o(lf)},t[0]=o,t[1]=u):u=t[1];let d=u,f;t[2]!==e?(f=()=>{e(lf)},t[2]=e,t[3]=f):f=t[3];let m=f,h;t[4]!==m||t[5]!==i||t[6]!==d||t[7]!==c?(h={hasAccepted:i,onAccept:m,onPrevent:d,prevent:c},t[4]=m,t[5]=i,t[6]=d,t[7]=c,t[8]=h):h=t[8],g4(h);let p;t[9]!==e?(p=()=>{e(lf)},t[9]=e,t[10]=p):p=t[10];let g=p,b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{a(!0)},t[11]=b):b=t[11];let v=b,x;return t[12]!==g||t[13]!==l?(x=bB(It,{body:l("general:changesNotSaved"),cancelLabel:l("general:stayOnThisPage"),confirmLabel:l("general:leaveAnyway"),heading:l("general:leaveWithoutSaving"),modalSlug:lf,onCancel:g,onConfirm:v}),t[12]=g,t[13]=l,t[14]=x):x=t[14],x};import{c as xB}from"react/compiler-runtime";import{jsx as eu,jsxs as jb}from"react/jsx-runtime";import{useEffect as yB}from"react";var ja="document-take-over",cf="document-take-over",Ob=t=>{let e=xB(17),{handleBackToDashboard:o,isActive:n,onReadOnly:r}=t,{closeModal:s,openModal:i}=de(),{t:a}=k(),{startRouteTransition:l}=st(),c,u;e[0]!==s||e[1]!==n||e[2]!==i?(c=()=>{n?i(ja):s(ja)},u=[n,i,s],e[0]=s,e[1]=n,e[2]=i,e[3]=c,e[4]=u):(c=e[3],u=e[4]),yB(c,u);let d;if(e[5]!==s||e[6]!==o||e[7]!==r||e[8]!==l||e[9]!==a){let f;e[11]!==o||e[12]!==l?(f=()=>{l(()=>o())},e[11]=o,e[12]=l,e[13]=f):f=e[13];let m;e[14]!==s||e[15]!==r?(m=()=>{r(),s(ja)},e[14]=s,e[15]=r,e[16]=m):m=e[16],d=eu(Yo,{className:cf,slug:ja,children:jb("div",{className:`${cf}__wrapper`,children:[jb("div",{className:`${cf}__content`,children:[eu("h1",{children:a("general:editingTakenOver")}),eu("p",{children:a("general:anotherUserTakenOver")})]}),jb("div",{className:`${cf}__controls`,children:[eu(ne,{buttonStyle:"primary",id:`${ja}-back-to-dashboard`,onClick:f,size:"large",children:a("general:backToDashboard")}),eu(ne,{buttonStyle:"secondary",id:`${ja}-view-read-only`,onClick:m,size:"large",children:a("general:viewReadOnly")})]})]})}),e[5]=s,e[6]=o,e[7]=r,e[8]=l,e[9]=a,e[10]=d}else d=e[10];return d};import{c as CB}from"react/compiler-runtime";import{jsx as Ci,jsxs as tu}from"react/jsx-runtime";import{useEffect as wB}from"react";var uf=t=>t&&typeof t=="object";var Cs="document-locked",df="document-locked",SB=t=>t?new Intl.DateTimeFormat("en-US",{day:"numeric",hour:"numeric",hour12:!0,minute:"numeric",month:"short",year:"numeric"}).format(t):"",Mb=t=>{let e=CB(30),{handleGoBack:o,isActive:n,onReadOnly:r,onTakeOver:s,updatedAt:i,user:a}=t,{closeModal:l,openModal:c}=de(),{t:u}=k(),{startRouteTransition:d}=st(),f,m;e[0]!==l||e[1]!==n||e[2]!==c?(f=()=>{n?c(Cs):l(Cs)},m=[n,c,l],e[0]=l,e[1]=n,e[2]=c,e[3]=f,e[4]=m):(f=e[3],m=e[4]),wB(f,m);let h;e[5]!==o||e[6]!==d?(h=()=>{d(()=>o())},e[5]=o,e[6]=d,e[7]=h):h=e[7];let p;if(e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==s||e[12]!==d||e[13]!==u||e[14]!==h||e[15]!==i||e[16]!==a){let g;e[18]!==u||e[19]!==a?(g=uf(a)?a.email??a.id:`${u("general:user")}: ${a}`,e[18]=u,e[19]=a,e[20]=g):g=e[20];let b;e[21]!==o||e[22]!==d?(b=()=>{d(()=>o())},e[21]=o,e[22]=d,e[23]=b):b=e[23];let v;e[24]!==l||e[25]!==r?(v=()=>{r(),l(Cs)},e[24]=l,e[25]=r,e[26]=v):v=e[26];let x;e[27]!==l||e[28]!==s?(x=()=>{s(),l(Cs)},e[27]=l,e[28]=s,e[29]=x):x=e[29],p=Ci(Yo,{className:df,onClose:h,slug:Cs,children:tu("div",{className:`${df}__wrapper`,children:[tu("div",{className:`${df}__content`,children:[Ci("h1",{children:u("general:documentLocked")}),tu("p",{children:[Ci("strong",{children:g})," ",u("general:currentlyEditing")]}),tu("p",{children:[u("general:editedSince")," ",Ci("strong",{children:SB(i)})]})]}),tu("div",{className:`${df}__controls`,children:[Ci(ne,{buttonStyle:"secondary",id:`${Cs}-go-back`,onClick:b,size:"large",children:u("general:goBack")}),Ci(ne,{buttonStyle:"secondary",id:`${Cs}-view-read-only`,onClick:v,size:"large",children:u("general:viewReadOnly")}),Ci(ne,{buttonStyle:"primary",id:`${Cs}-take-over`,onClick:x,size:"large",children:u("general:takeOver")})]})]})}),e[8]=l,e[9]=o,e[10]=r,e[11]=s,e[12]=d,e[13]=u,e[14]=h,e[15]=i,e[16]=a,e[17]=p}else p=e[17];return p};import{jsx as mf}from"react/jsx-runtime";import"react";var b4=({elements:t,translationString:e})=>{let o=/(<[^>]+>.*?<\/[^>]+>)/g,n=e.split(o);return mf("span",{children:n.map((r,s)=>{if(t&&r.startsWith("<")&&r.endsWith(">")){let i=r[1],a=t[i];if(a){let l=new RegExp(`<${i}>(.*?)</${i}>`,"g"),c=r.replace(l,(u,d)=>d);return mf(a,{children:mf(b4,{translationString:c})},s)}}return r})})},wi=({elements:t,i18nKey:e,t:o,variables:n})=>{let r=o(e,n||{});return t?mf(b4,{elements:t,translationString:r}):r};import{c as IB}from"react/compiler-runtime";import{jsx as RB}from"react/jsx-runtime";import{getTranslation as _B}from"@payloadcms/translations";import NFe from"react";function Bb(t){let e=IB(3),{i18n:o}=k(),{description:n}=t;if(n){let r;return e[0]!==n||e[1]!==o?(r=RB("div",{className:"custom-view-description",children:_B(n,o)}),e[0]=n,e[1]=o,e[2]=r):r=e[2],r}return null}import{jsx as zo,jsxs as bf}from"react/jsx-runtime";import{formatAdminURL as d7}from"payload/shared";import{useEffect as m7,useRef as f7,useState as p7}from"react";import{c as EB}from"react/compiler-runtime";import{jsx as A4}from"react/jsx-runtime";import{usePathname as PB}from"next/navigation.js";import{formatAdminURL as NB}from"payload/shared";import"react";import{jsx as Vb,jsxs as DB}from"react/jsx-runtime";import"react";var ou="graphic-account",v4=t=>DB("svg",{className:[ou,t?.active&&`${ou}--active`].filter(Boolean).join(" "),height:"25",viewBox:"0 0 25 25",width:"25",xmlns:"http://www.w3.org/2000/svg",children:[Vb("circle",{className:`${ou}__bg`,cx:"12.5",cy:"12.5",r:"11.5"}),Vb("circle",{className:`${ou}__head`,cx:"12.5",cy:"10.73",r:"3.98"}),Vb("path",{className:`${ou}__body`,d:"M12.5,24a11.44,11.44,0,0,0,7.66-2.94c-.5-2.71-3.73-4.8-7.66-4.8s-7.16,2.09-7.66,4.8A11.44,11.44,0,0,0,12.5,24Z"})]});var D4=Ds(_4(),1);import{c as AB}from"react/compiler-runtime";import{jsx as TB}from"react/jsx-runtime";import"react";var F4=()=>{let t=AB(2),{user:e}=Ae(),o=(0,D4.default)(e.email.trim().toLowerCase()),r=`?${new URLSearchParams({default:"mp",r:"g",s:"50"}).toString()}`,s=`https://www.gravatar.com/avatar/${o}?${r}`,i;return t[0]!==s?(i=TB("img",{alt:"yas",className:"gravatar-account",height:25,src:s,style:{borderRadius:"50%"},width:25}),t[0]=s,t[1]=i):i=t[1],i};var Hb=()=>{let t=EB(3),{config:e}=H(),{admin:o,routes:n}=e,{avatar:r,routes:s}=o,{account:i}=s,{admin:a}=n,{user:l}=Ae(),u=PB()===NB({adminRoute:a,path:i});if(!l?.email||r==="default"){let d;return t[0]!==u?(d=A4(v4,{active:u}),t[0]=u,t[1]=d):d=t[1],d}if(r==="gravatar"){let d;return t[2]===Symbol.for("react.memo_cache_sentinel")?(d=A4(F4,{}),t[2]=d):d=t[2],d}};import{c as LB}from"react/compiler-runtime";import{jsx as $B}from"react/jsx-runtime";import{createContext as kB,use as jB,useState as OB}from"react";var T4=kB({Actions:{},setViewActions:()=>{}}),zb=()=>jB(T4),MB=t=>{let e=LB(4),{Actions:o,children:n}=t,[r,s]=OB(o),i;return e[0]!==o||e[1]!==n||e[2]!==r?(i=$B(T4,{value:{Actions:{...r,...o},setViewActions:s},children:n}),e[0]=o,e[1]=n,e[2]=r,e[3]=i):i=e[3],i};import{c as BB}from"react/compiler-runtime";import{jsx as ff,jsxs as N4}from"react/jsx-runtime";import"react";import{jsx as E4}from"react/jsx-runtime";import"react";var Xb=()=>E4("svg",{className:"icon icon--close-menu",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:E4("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})});import{jsx as P4}from"react/jsx-runtime";import"react";var Ub=()=>P4("svg",{className:"icon icon--menu",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:P4("path",{className:"stroke",d:"M4.66667 10H15.3333M4.66667 6H15.3333M4.66667 14H15.3333",strokeLinecap:"square"})});var Yb="hamburger",Zb=t=>{let e=BB(4),{t:o}=k(),{closeIcon:n,isActive:r}=t,s=n===void 0?"x":n,i=r===void 0?!1:r,a;return e[0]!==s||e[1]!==i||e[2]!==o?(a=N4("div",{className:Yb,children:[!i&&ff("div",{"aria-label":o("general:open"),className:`${Yb}__open-icon`,title:o("general:open"),children:ff(Ub,{})}),i&&N4("div",{"aria-label":o(s==="collapse"?"general:collapse":"general:close"),className:`${Yb}__close-icon`,title:o(s==="collapse"?"general:collapse":"general:close"),children:[s==="x"&&ff(Xb,{}),s==="collapse"&&ff(Ze,{direction:"left"})]})]}),e[0]=s,e[1]=i,e[2]=o,e[3]=a):a=e[3],a};import{c as WB}from"react/compiler-runtime";import{jsx as Si,jsxs as HB}from"react/jsx-runtime";import{getTranslation as zB}from"@payloadcms/translations";import{useRouter as XB}from"next/navigation.js";import*as hf from"qs-esm";import{Fragment as UB}from"react";import{c as VB}from"react/compiler-runtime";import{jsx as L4,jsxs as Jb}from"react/jsx-runtime";import{getTranslation as GB}from"@payloadcms/translations";import"react";var ru="localizer-button",pf=t=>{let e=VB(12),{ariaLabel:o,className:n}=t,r=Ne(),{i18n:s,t:i}=k(),a;e[0]!==o||e[1]!==i?(a=o||i("general:locale"),e[0]=o,e[1]=i,e[2]=a):a=e[2];let l;e[3]!==n?(l=[ru,n].filter(Boolean),e[3]=n,e[4]=l):l=e[4];let c=l.join(" "),u=r?r.code:void 0,d=`${i("general:locale")}:`,f;return e[5]!==s||e[6]!==r.label||e[7]!==a||e[8]!==c||e[9]!==u||e[10]!==d?(f=Jb("div",{"aria-label":a,className:c,"data-locale":u,children:[Jb("div",{className:`${ru}__label`,children:[d,"\xA0"]}),Jb("div",{className:`${ru}__current`,children:[L4("span",{className:`${ru}__current-label`,children:`${GB(r.label,s)}`}),L4(Ze,{className:`${ru}__chevron`})]})]}),e[5]=s,e[6]=r.label,e[7]=a,e[8]=c,e[9]=u,e[10]=d,e[11]=f):f=e[11],f};var qb="localizer",$4=t=>{let e=WB(17),{className:o}=t,{config:n}=H(),{localization:r}=n,s=XB(),{startRouteTransition:i}=st(),{setLocaleIsLoading:a}=ud(),{i18n:l}=k(),c=Ne();if(r){let{locales:u}=r,d;e[0]!==o?(d=[qb,o].filter(Boolean),e[0]=o,e[1]=d):d=e[1];let f=d.join(" "),m;if(e[2]!==l||e[3]!==c||e[4]!==u||e[5]!==s||e[6]!==a||e[7]!==i||e[8]!==f){let h;e[10]!==l||e[11]!==c||e[12]!==u||e[13]!==s||e[14]!==a||e[15]!==i?(h=p=>{let{close:g}=p;return Si(Me.ButtonGroup,{children:u.map(b=>{let v=zB(b.label,l);return Si(Me.Button,{active:c.code===b.code,disabled:c.code===b.code,onClick:()=>{a(!0),g();let x=new URLSearchParams(window.location.search),y=hf.stringify({...hf.parse(x.toString(),{depth:10,ignoreQueryPrefix:!0}),locale:b.code},{addQueryPrefix:!0});i(()=>{s.push(y)})},children:v!==b.code?HB(UB,{children:[v,"\xA0",Si("span",{className:`${qb}__locale-code`,"data-locale":b.code,children:`(${b.code})`})]}):Si("span",{className:`${qb}__locale-code`,"data-locale":b.code,children:v})},b.code)})})},e[10]=l,e[11]=c,e[12]=u,e[13]=s,e[14]=a,e[15]=i,e[16]=h):h=e[16],m=Si("div",{className:f,children:Si(ho,{button:Si(pf,{}),horizontalAlign:"right",render:h,showScrollbar:!0,size:"large"})}),e[2]=l,e[3]=c,e[4]=u,e[5]=s,e[6]=a,e[7]=i,e[8]=f,e[9]=m}else m=e[9];return m}return null};import{jsx as YB}from"react/jsx-runtime";import{usePathname as ZB}from"next/navigation.js";import su,{useEffect as nu,useRef as JB}from"react";var k4=su.createContext({hydrated:!1,navOpen:!0,navRef:null,setNavOpen:()=>{},shouldAnimate:!1}),Ii=()=>su.use(k4),qB=async t=>{let o=(await t("nav"))?.open;return typeof o=="boolean"?o:!0},j4=({children:t,initialIsOpen:e})=>{let{breakpoints:{l:o,m:n,s:r}}=Co(),s=ZB(),{getPreference:i}=Fo(),a=JB(null),[l,c]=su.useState(e),[u,d]=su.useState(!1),[f,m]=su.useState(!1);return nu(()=>{o===!1&&(async()=>{let p=await qB(i);c(p)})()},[o,i,c]),nu(()=>{r===!0&&c(!1)},[s]),nu(()=>{a.current&&(l&&n?a.current.style.overscrollBehavior="contain":a.current.style.overscrollBehavior="auto")},[l,n]),nu(()=>{(o===!0||n===!0||r===!0)&&c(!1),m(!0),setTimeout(()=>{d(!0)},100)},[o,n,r]),nu(()=>()=>{a.current&&(a.current.style.overscrollBehavior="auto")},[]),YB(k4,{value:{hydrated:f,navOpen:l,navRef:a,setNavOpen:c,shouldAnimate:u},children:t})};import{c as QB}from"react/compiler-runtime";import{jsx as KB}from"react/jsx-runtime";import"react";var O4="nav-toggler",Qb=t=>{let e=QB(15),{id:o,children:n,className:r,tabIndex:s}=t,i=s===void 0?0:s,{t:a}=k(),{setPreference:l}=Fo(),{navOpen:c,setNavOpen:u}=Ii(),{breakpoints:d}=Co(),{l:f}=d,m=`${a(c?"general:close":"general:open")} ${a("general:menu")}`,h=c&&`${O4}--is-open`,p;e[0]!==r||e[1]!==h?(p=[O4,h,r].filter(Boolean),e[0]=r,e[1]=h,e[2]=p):p=e[2];let g=p.join(" "),b;e[3]!==f||e[4]!==c||e[5]!==u||e[6]!==l?(b=async()=>{u(!c),f||await l("nav",{open:!c},!0)},e[3]=f,e[4]=c,e[5]=u,e[6]=l,e[7]=b):b=e[7];let v;return e[8]!==n||e[9]!==o||e[10]!==m||e[11]!==g||e[12]!==b||e[13]!==i?(v=KB("button",{"aria-label":m,className:g,id:o,onClick:b,tabIndex:i,type:"button",children:n}),e[8]=n,e[9]=o,e[10]=m,e[11]=g,e[12]=b,e[13]=i,e[14]=v):v=e[14],v};import{c as c7}from"react/compiler-runtime";import{jsx as Ro,jsxs as V4}from"react/jsx-runtime";import{getTranslation as u7}from"@payloadcms/translations";import{Fragment as G4}from"react";import{jsx as M4,jsxs as e7}from"react/jsx-runtime";import"react";var gf=({fill:t})=>{let e=t||"var(--theme-elevation-1000)";return e7("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:[M4("path",{d:"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z",fill:e}),M4("path",{d:"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z",fill:e})]})};import{c as t7}from"react/compiler-runtime";import{jsx as o7}from"react/jsx-runtime";import{createContext as r7,use as n7,useState as s7}from"react";var jn=()=>n7(B4),B4=r7({}),Kb=t=>{let e=t7(4),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];let[r,s]=s7(n),i;return e[1]!==o||e[2]!==r?(i=o7(B4,{value:{setStepNav:s,stepNav:r},children:o}),e[1]=o,e[2]=r,e[3]=i):i=e[3],i};import{c as i7}from"react/compiler-runtime";import{useEffect as a7}from"react";var l7=t=>{let e=i7(4),{nav:o}=t,{setStepNav:n}=jn(),r,s;return e[0]!==o||e[1]!==n?(r=()=>{n(o)},s=[n,o],e[0]=o,e[1]=n,e[2]=r,e[3]=s):(r=e[2],s=e[3]),a7(r,s),null};var iu="step-nav",W4=t=>{let e=c7(7),{className:o,CustomIcon:n}=t,{i18n:r}=k(),{stepNav:s}=jn(),{config:i}=H(),{routes:a}=i,{admin:l}=a,{t:c}=k(),u;return e[0]!==n||e[1]!==l||e[2]!==o||e[3]!==r||e[4]!==s||e[5]!==c?(u=Ro(G4,{children:s.length>0?V4("nav",{className:[iu,o].filter(Boolean).join(" "),children:[Ro(no,{className:`${iu}__home`,href:l,prefetch:!1,tabIndex:0,children:Ro("span",{title:c("general:dashboard"),children:Ro(oe,{CustomComponent:n,Fallback:Ro(gf,{})})})}),Ro("span",{children:"/"}),s.map((d,f)=>{let m=u7(d.label,r);return s.length===f+1?Ro("span",{className:`${iu}__last`,children:m},f):V4(G4,{children:[d.url?Ro(no,{href:d.url,prefetch:!1,children:Ro("span",{children:m},f)}):Ro("span",{children:m},f),Ro("span",{children:"/"})]},f)})]}):Ro("div",{className:[iu,o].filter(Boolean).join(" "),children:Ro("div",{className:`${iu}__home`,children:Ro("span",{title:c("general:dashboard"),children:Ro(oe,{CustomComponent:n,Fallback:Ro(gf,{})})})})})}),e[0]=n,e[1]=l,e[2]=o,e[3]=r,e[4]=s,e[5]=c,e[6]=u):u=e[6],u};var _o="app-header";function h7({CustomAvatar:t,CustomIcon:e}){let{t:o}=k(),{Actions:n}=zb(),{config:{admin:{routes:{account:r}},localization:s,routes:{admin:i}}}=H(),{navOpen:a}=Ii(),l=f7(null),[c,u]=p7(!1);m7(()=>{let f=()=>{let m=l.current;if(m){let h=m.scrollWidth>m.clientWidth;u(h)}};return f(),window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[n]);let d=n?Object.values(n):[];return bf("header",{className:[_o,a&&`${_o}--nav-open`].filter(Boolean).join(" "),children:[zo("div",{className:`${_o}__bg`}),zo("div",{className:`${_o}__content`,children:bf("div",{className:`${_o}__wrapper`,children:[zo(Qb,{className:`${_o}__mobile-nav-toggler`,tabIndex:-1,children:zo(Zb,{})}),bf("div",{className:`${_o}__controls-wrapper`,children:[zo("div",{className:`${_o}__step-nav-wrapper`,children:zo(W4,{className:`${_o}__step-nav`,CustomIcon:e})}),bf("div",{className:`${_o}__actions-wrapper`,children:[zo("div",{className:`${_o}__actions`,ref:l,children:d.map((f,m)=>zo("div",{className:c&&m===d.length-1?`${_o}__last-action`:"",children:f},m))}),c&&zo("div",{className:`${_o}__gradient-placeholder`})]}),s&&zo(pf,{ariaLabel:"invisible",className:`${_o}__localizer-spacing`}),zo(no,{"aria-label":o("authentication:account"),className:`${_o}__account`,href:d7({adminRoute:i,path:r}),prefetch:!1,tabIndex:0,children:zo(oe,{CustomComponent:t,Fallback:zo(Hb,{})})})]})]})}),zo($4,{className:`${_o}__localizer`})]})}import{jsx as e1,jsxs as g7}from"react/jsx-runtime";import"react";var au="card",b7=t=>{let{id:e,actions:o,buttonAriaLabel:n,href:r,onClick:s,title:i,titleAs:a}=t,l=[au,e,(s||r)&&`${au}--has-onclick`].filter(Boolean).join(" ");return g7("div",{className:l,id:e,children:[e1(a??"div",{className:`${au}__title`,children:i}),o&&e1("div",{className:`${au}__actions`,children:o}),(s||r)&&e1(ne,{"aria-label":n,buttonStyle:"none",className:`${au}__click`,el:"link",onClick:s,to:r})]})};import{c as v7}from"react/compiler-runtime";import{jsx as ws,jsxs as vf}from"react/jsx-runtime";import{getTranslation as x7}from"@payloadcms/translations";import{useRouter as y7}from"next/navigation.js";import Oa from"react";var xf="copy-locale-data",yf="copy-locale",t1=()=>{let t=v7(38),{config:e}=H(),{localization:o,routes:n,serverURL:r}=e,{admin:s}=n,{code:i}=Ne(),{id:a,collectionSlug:l,globalSlug:c}=Pe(),{i18n:u,t:d}=k(),f=Ut(),{toggleModal:m}=de(),{copyDataFromLocale:h}=Dt(),p=y7(),{startRouteTransition:g}=st(),b;t[0]!==o?(b=o&&o.locales.map(C7)||[],t[0]=o,t[1]=b):b=t[1];let v=b,x;t[2]!==i?(x=G=>G.value!==i,t[2]=i,t[3]=x):x=t[3];let y=v.filter(x),C;t[4]!==u||t[5]!==o?(C=G=>{let X=o&&o.locales.find(Z=>Z.code===G);return X&&X.label?x7(X.label,u):G},t[4]=u,t[5]=o,t[6]=C):C=t[6];let S=C,[w,D]=Oa.useState(!1),[_,A]=Oa.useState(null),[F,R]=Oa.useState(i),[I,E]=Oa.useState(!1),T,$;t[7]!==i||t[8]!==F?(T=()=>{F!==i&&R(i)},$=[i,F],t[7]=i,t[8]=F,t[9]=T,t[10]=$):(T=t[9],$=t[10]),Oa.useEffect(T,$);let j;t[11]!==s||t[12]!==l||t[13]!==h||t[14]!==c||t[15]!==a||t[16]!==I||t[17]!==p||t[18]!==r||t[19]!==g||t[20]!==m?(j=async G=>{let{from:X,to:Z}=G;D(!0);try{await h({collectionSlug:l,docID:a,fromLocale:X,globalSlug:c,overrideData:I,toLocale:Z}),D(!1),g(()=>p.push(`${r}${s}/${l?`collections/${l}/${a}`:`globals/${c}`}?locale=${Z}`)),m(yf)}catch(te){let U=te;fe.error(U.message)}},t[11]=s,t[12]=l,t[13]=h,t[14]=c,t[15]=a,t[16]=I,t[17]=p,t[18]=r,t[19]=g,t[20]=m,t[21]=j):j=t[21];let N=j;if(!a&&!c)return null;let P;t[22]!==f||t[23]!==d||t[24]!==m?(P=()=>{f?fe.info(d("general:unsavedChanges")):m(yf)},t[22]=f,t[23]=d,t[24]=m,t[25]=P):P=t[25];let L;t[26]!==m?(L=()=>{m(yf)},t[26]=m,t[27]=L):L=t[27];let V;t[28]!==N||t[29]!==w||t[30]!==F||t[31]!==d||t[32]!==_?(V=async()=>{if(F===_){fe.error(d("localization:cannotCopySameLocale"));return}w||await N({from:F,to:_})},t[28]=N,t[29]=w,t[30]=F,t[31]=d,t[32]=_,t[33]=V):V=t[33];let M;t[34]===Symbol.for("react.memo_cache_sentinel")?(M=G=>{G?.value&&R(G.value)},t[34]=M):M=t[34];let O;t[35]===Symbol.for("react.memo_cache_sentinel")?(O=G=>{G?.value&&A(G.value)},t[35]=O):O=t[35];let B;return t[36]!==I?(B=()=>E(!I),t[36]=I,t[37]=B):B=t[37],vf(Oa.Fragment,{children:[ws(Me.Button,{id:`${xf}__button`,onClick:P,children:d("localization:copyToLocale")}),vf(Pt,{className:xf,gutter:!1,Header:ws(Da,{onClose:L,title:d("localization:copyToLocale")}),slug:yf,children:[vf("div",{className:`${xf}__sub-header`,children:[ws("span",{children:F&&_?ws("div",{children:d("localization:copyFromTo",{from:S(F),to:S(_)})}):d("localization:selectLocaleToCopy")}),ws(ne,{buttonStyle:"primary",disabled:!F||!_,iconPosition:"left",onClick:V,size:"medium",children:w?d("general:copying")+"...":d("general:copy")})]}),vf("div",{className:`${xf}__content`,children:[ws(Sa,{label:d("localization:copyFrom"),name:"fromLocale",onChange:M,options:v,path:"fromLocale",readOnly:!0,value:F}),ws(Sa,{label:d("localization:copyTo"),name:"toLocale",onChange:O,options:y,path:"toLocale",value:_}),ws(mr,{checked:I,field:{name:"overwriteExisting",label:d("general:overwriteExistingData")},onChange:B,path:"overwriteExisting"})]})]})]})};function C7(t){return{label:t.label,value:t.code}}import{jsx as Y4,jsxs as L7}from"react/jsx-runtime";import{getTranslation as Z4}from"@payloadcms/translations";import{useRouter as $7,useSearchParams as k7}from"next/navigation.js";import{mergeListSearchAndWhere as j7}from"payload/shared";import*as q4 from"qs-esm";import O7,{useCallback as J4}from"react";import{c as w7}from"react/compiler-runtime";import{jsx as S7}from"react/jsx-runtime";import{usePathname as I7,useRouter as R7}from"next/navigation.js";import{createContext as _7,use as D7,useEffect as F7}from"react";var H4=_7({clearRouteCache:()=>{}}),o1=t=>{let e=w7(10),{children:o}=t,n=I7(),r=R7(),s;e[0]!==r?(s=()=>{r.refresh()},e[0]=r,e[1]=s):s=e[1];let i=s,a;e[2]!==i?(a=()=>{i()},e[2]=i,e[3]=a):a=e[3];let l;e[4]!==i||e[5]!==n?(l=[n,i],e[4]=i,e[5]=n,e[6]=l):l=e[6],F7(a,l);let c;return e[7]!==o||e[8]!==i?(c=S7(H4,{value:{clearRouteCache:i},children:o}),e[7]=o,e[8]=i,e[9]=c):c=e[9],c},On=()=>D7(H4);import{jsx as A7}from"react/jsx-runtime";import{useSearchParams as T7}from"next/navigation.js";import*as X4 from"qs-esm";import{createContext as E7,use as P7,useCallback as r1,useEffect as z4,useRef as N7,useState as n1}from"react";var xo=function(t){return t.AllAvailable="allAvailable",t.AllInPage="allInPage",t.None="none",t.Some="some",t}({}),U4=E7({}),s1=({children:t,docs:e=[],totalDocs:o,user:n})=>{let r=N7({}),{code:s}=Ne(),[i,a]=n1(()=>{let g=new Map;return e.forEach(({id:b})=>{g.set(b,!1)}),g}),[l,c]=n1("none"),[u,d]=n1(0),f=T7(),m=r1((g=!1)=>{let b=new Map;g?(c("allAvailable"),e.forEach(({id:v,_isLocked:x,_userEditing:y})=>{(!x||y?.id===n?.id)&&b.set(v,!0)})):l==="allAvailable"||l==="allInPage"?c("none"):e.forEach(({id:v,_isLocked:x,_userEditing:y})=>{(!x||y?.id===n?.id)&&b.set(v,l!=="some")}),a(b)},[e,l,n?.id]),h=r1(g=>{let b=e.find(C=>C.id===g);if(b?._isLocked&&n?.id!==b?._userEditing.id)return;let v=i.get(g),x=typeof v=="boolean"?!v:!0,y=new Map(i.set(g,x));l==="allAvailable"&&!x&&c("some"),a(y)},[i,e,l,n?.id]),p=r1(g=>{let b;if(l==="allAvailable")b=jr(f)?.where||{id:{not_equals:""}};else{let v=[];for(let[x,y]of i)y&&v.push(x);b={id:{in:v}}}return g&&(b={and:[{...g},b]}),X4.stringify({locale:s,where:b},{addQueryPrefix:!0})},[l,i,s,f]);return z4(()=>{if(l==="allAvailable")return;let g=!1,b=!0;if(!i.size)b=!1,g=!1;else for(let[v,x]of i)b=b&&x,g=g||x;b&&i.size===e.length?c("allInPage"):c(g?"some":"none")},[l,i,o,e]),z4(()=>{let g=0;if(l==="allAvailable")g=o;else for(let[b,v]of i)v&&g++;d(g)},[l,i,o]),r.current={count:u,getQueryParams:p,selectAll:l,selected:i,setSelection:h,toggleAll:m,totalDocs:o},A7(U4,{value:r.current,children:t})},oo=()=>P7(U4);var M7="delete-documents",i1=t=>{let{collection:e,collection:{slug:o,labels:{plural:n,singular:r}}={}}=t,{permissions:s}=Ae(),{config:{routes:{api:i},serverURL:a}}=H(),{openModal:l}=de(),{count:c,getQueryParams:u,selectAll:d,toggleAll:f}=oo(),{i18n:m,t:h}=k(),p=$7(),g=k7(),{clearRouteCache:b}=On(),x=s?.collections?.[o]?.delete,y=`delete-${o}`,C=J4(()=>{fe.error(h("error:unknown"))},[h]),S=J4(async()=>{let w=j7({collectionConfig:e,search:g.get("search")}),D=u(w);await Qe.delete(`${a}${i}/${o}${D}`,{headers:{"Accept-Language":m.language,"Content-Type":"application/json"}}).then(async _=>{try{let A=await _.json(),F=A?.docs.length||0,R=F>1?n:r;if(_.status<400||F>0)return fe.success(h("general:deletedCountSuccessfully",{count:F,label:Z4(R,m)})),A?.errors.length>0&&fe.error(A.message,{description:A.errors.map(I=>I.message).join(`
|
|
55
|
+
`)}),f(),p.replace(q4.stringify({page:d?"1":void 0},{addQueryPrefix:!0})),b(),null;if(A.errors)fe.error(A.message,{description:A.errors.map(I=>I.message).join(`
|
|
56
|
+
`)});else return C();return!1}catch{return C()}})},[g,C,i,u,m,n,p,d,a,r,o,h,f,b,e]);return d===xo.None||!x?null:L7(O7.Fragment,{children:[Y4("button",{className:`${M7}__toggle`,onClick:()=>{l(y)},type:"button",children:h("general:delete")}),Y4(It,{body:h("general:aboutToDeleteCount",{count:c,label:Z4(c>1?n:r,m)}),confirmingLabel:h("general:deleting"),heading:h("general:confirmDeletion"),modalSlug:y,onConfirm:S})]})};import{c as I8}from"react/compiler-runtime";import{jsx as at,jsxs as Lo}from"react/jsx-runtime";import{getTranslation as R8}from"@payloadcms/translations";import{formatAdminURL as _8}from"payload/shared";import p1,{Fragment as cu,useEffect as D8}from"react";import{jsx as K4,jsxs as V7}from"react/jsx-runtime";import{dequal as G7}from"dequal/lite";import{reduceFieldsToValues as eR,versionDefaults as W7}from"payload/shared";import H7,{useDeferredValue as z7,useEffect as tR,useRef as Ri,useState as X7}from"react";import{unflatten as B7}from"payload/shared";var Q4=(t,e,o)=>{let n={data:{},valid:!0};return t&&(Object.keys(t).forEach(r=>{(o===!0||!t[r]?.disableFormData)&&(n.data[r]=t[r]?.value,t[r].valid||(n.valid=!1))}),e&&(n.data=B7(n.data))),n};var U7="autosave",oR=1e3,rR=({id:t,collection:e,global:o})=>{let{config:{routes:{api:n},serverURL:r}}=H(),{docConfig:s,incrementVersionCount:i,lastUpdateTime:a,mostRecentVersionIsAutosaved:l,setLastUpdateTime:c,setMostRecentVersionIsAutosaved:u,setUnpublishedVersionCount:d,updateSavedDocumentData:f}=Pe(),{reportUpdate:m}=fi(),{dispatchFields:h,isValid:p,setBackgroundProcessing:g,setIsValid:b,setSubmitted:v}=Oe(),[x]=ki(),y=Ut(),C=Xt(),{code:S}=Ne(),{i18n:w,t:D}=k(),_=s?.versions,A=W7.autosaveInterval;_.drafts&&_.drafts.autosave&&(A=_.drafts.autosave.interval);let F=!!(s?.versions?.drafts&&s?.versions?.drafts.validate),[R,I]=X7(!1),E=z7(R),T=Jo(x,A),$=Ri(x),j=Ri(y),N=Ri(S),P=Ri(p);$.current=x,j.current=y,N.current=S;let{queueTask:L}=Nm(),V=Ri(null),M=eo(()=>{V.current=void 0;let X,Z,te=()=>{Z-X<oR?V.current=setTimeout(()=>{I(!1)},oR-(Z-X)):G()};L(async()=>{if(y){X=new Date().getTime(),I(!0);let U,z,ce;if(e&&t&&(ce=e.slug,U=`${r}${n}/${ce}/${t}?draft=true&autosave=true&locale=${N.current}`,z="PATCH"),o&&(ce=o.slug,U=`${r}${n}/globals/${ce}?draft=true&autosave=true&locale=${N.current}`,z="POST"),U&&j.current){let{data:J,valid:ue}=Q4($.current,!0);if(J._status="draft",!(C&&!ue&&_?.drafts&&_?.drafts?.validate)&&P.current){let q;try{q=await fetch(U,{body:JSON.stringify(J),credentials:"include",headers:{"Accept-Language":w.language,"Content-Type":"application/json"},method:z})}catch{}let pe=new Date;Z=pe.getTime(),q.status===200&&(c(pe.getTime()),m({id:t,entitySlug:ce,updatedAt:pe.toISOString()}),l||(i(),u(!0),d(_e=>_e+1)));let he=await q.json();if(_?.drafts&&_?.drafts?.validate&&he?.errors){if(Array.isArray(he.errors)){let[_e,ge]=he.errors.reduce(([Ve,Q],Le)=>{let De=[],ae=[];return Le?.message&&ae.push(Le),Array.isArray(Le?.data)&&Le.data.forEach(se=>{se?.field?De.push(se):ae.push(se)}),[[...Ve,...De],[...Q,...ae]]},[[],[]]);h({type:"ADD_SERVER_ERRORS",errors:_e}),ge.forEach(Ve=>{fe.error(Ve.message||w.t("error:unknown"))}),P.current=!1,b(!1),v(!0),te();return}}else{let _e=he?.doc||he?.result;_e&&(b(!0),P.current=!0,f(_e))}te()}}}},{afterProcess:()=>{g(!1)},beforeProcess:()=>{if(!P.current)return P.current=!0,!1;g(!0)}})}),O=Ri(!1),B=Ri(eR(T));tR(()=>{if(!O.current){O.current=!0;return}let X=eR(T);G7(X,B)||(B.current=X,M())},[T]),tR(()=>()=>{G()},[]);let G=eo(()=>{V.current&&clearTimeout(V.current),I(!1)});return V7("div",{className:U7,children:[F&&!p&&K4(Kc,{}),E&&D("general:saving"),!E&&!!a&&K4(H7.Fragment,{children:D("version:lastSavedAgo",{distance:Hx({date:a,i18n:w})})})]})};import{jsx as Cf,jsxs as Y7}from"react/jsx-runtime";import{getTranslation as nR}from"@payloadcms/translations";import{useRouter as Z7}from"next/navigation.js";import{formatAdminURL as J7}from"payload/shared";import q7,{useCallback as sR}from"react";var iR=t=>{let{id:e,buttonId:o,collectionSlug:n,onDelete:r,redirectAfterDelete:s=!0,singularLabel:i,title:a}=t,{config:{routes:{admin:l,api:c},serverURL:u},getEntityConfig:d}=H(),f=d({collectionSlug:n}),{setModified:m}=Oe(),h=Z7(),{i18n:p,t:g}=k(),{title:b}=Pe(),{startRouteTransition:v}=st(),{openModal:x}=de(),y=`delete-${e}`,C=sR(()=>{fe.error(g("error:deletingTitle",{title:b}))},[g,b]),S=sR(async()=>{m(!1);try{await Qe.delete(`${u}${c}/${n}/${e}`,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(async w=>{try{let D=await w.json();if(w.status<400){if(fe.success(g("general:titleDeleted",{label:nR(i,p),title:b})||D.message),s)return v(()=>h.push(J7({adminRoute:l,path:`/collections/${n}`})));typeof r=="function"&&await r({id:e,collectionConfig:f});return}return D.errors?D.errors.forEach(_=>fe.error(_.message)):C(),!1}catch{return C()}})}catch{return C()}},[m,u,c,n,e,g,i,C,p,b,h,l,s,r,f,v]);return e?Y7(q7.Fragment,{children:[Cf(Me.Button,{id:o,onClick:()=>{x(y)},children:g("general:delete")}),Cf(It,{body:Cf(wi,{elements:{1:({children:w})=>Cf("strong",{children:w})},i18nKey:"general:aboutToDelete",t:g,variables:{label:nR(i,p),title:a||b||e}}),confirmingLabel:g("general:deleting"),heading:g("general:confirmDeletion"),modalSlug:y,onConfirm:S})]}):null};import{jsx as aR,jsxs as Q7}from"react/jsx-runtime";import{getTranslation as lR}from"@payloadcms/translations";import{useRouter as K7}from"next/navigation.js";import{formatAdminURL as e8}from"payload/shared";import cR,{useCallback as uR}from"react";var dR=({id:t,slug:e,onDuplicate:o,redirectAfterDuplicate:n=!0,singularLabel:r})=>{let s=K7(),i=Ut(),{openModal:a}=de(),l=Ne(),{setModified:c}=Oe(),{startRouteTransition:u}=st(),{config:{routes:{admin:d,api:f},serverURL:m},getEntityConfig:h}=H(),p=h({collectionSlug:e}),[g,b]=cR.useState(!1),{i18n:v,t:x}=k(),y=`duplicate-${t}`,C=uR(async()=>{b(!0),await Qe.post(`${m}${f}/${e}/${t}/duplicate${l?.code?`?locale=${l.code}`:""}`,{body:JSON.stringify({}),headers:{"Accept-Language":v.language,"Content-Type":"application/json",credentials:"include"}}).then(async w=>{let{doc:D,errors:_,message:A}=await w.json();if(w.status<400){if(fe.success(A||x("general:successfullyDuplicated",{label:lR(r,v)})),c(!1),n)return u(()=>s.push(e8({adminRoute:d,path:`/collections/${e}/${D.id}${l?.code?`?locale=${l.code}`:""}`})));typeof o=="function"&&o({collectionConfig:p,doc:D})}else fe.error(_?.[0].message||A||x("error:unspecific",{label:lR(r,v)}))})},[l,m,f,e,t,v,x,r,o,n,c,s,d,p,u]),S=uR(async()=>{b(!1),await C()},[C]);return Q7(cR.Fragment,{children:[aR(Me.Button,{id:"action-duplicate",onClick:()=>i?(b(!0),a(y)):C(),children:x("general:duplicate")}),g&&aR(It,{body:x("general:unsavedChangesDuplicate"),confirmLabel:x("general:duplicateWithoutSaving"),heading:x("general:unsavedChanges"),modalSlug:y,onConfirm:S})]})};import{c as o8}from"react/compiler-runtime";import{jsx as pR,jsxs as r8}from"react/jsx-runtime";import{useState as n8}from"react";import{jsx as mR,jsxs as t8}from"react/jsx-runtime";import"react";var fR=({className:t})=>t8("svg",{className:["icon icon--lock",t].filter(Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[mR("path",{className:"stroke",d:"M7.5 9.5V7.5C7.5 6.83696 7.76339 6.20107 8.23223 5.73223C8.70107 5.26339 9.33696 5 10 5C10.663 5 11.2989 5.26339 11.7678 5.73223C12.2366 6.20107 12.5 6.83696 12.5 7.5V9.5",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:"1"}),mR("path",{className:"stroke",d:"M13.5 9.5H6.5C5.94772 9.5 5.5 9.94772 5.5 10.5V14C5.5 14.5523 5.94772 15 6.5 15H13.5C14.0523 15 14.5 14.5523 14.5 14V10.5C14.5 9.94772 14.0523 9.5 13.5 9.5Z",stopOpacity:"1",strokeLinecap:"round",strokeLinejoin:"round"})]});var hR="locked",lu=t=>{let e=o8(8),{className:o,user:n}=t,[r,s]=n8(!1),{t:i}=k(),a=uf(n)?n.email??n.id:i("general:anotherUser"),l;e[0]!==o?(l=[hR,o].filter(Boolean),e[0]=o,e[1]=l):l=e[1];let c=l.join(" "),u,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>s(!0),d=()=>s(!1),e[2]=u,e[3]=d):(u=e[2],d=e[3]);let f=`${a} ${i("general:isEditing")}`,m;return e[4]!==r||e[5]!==c||e[6]!==f?(m=r8("div",{className:c,onMouseEnter:u,onMouseLeave:d,role:"button",tabIndex:0,children:[pR(go,{alignCaret:"left",className:`${hR}__tooltip`,position:"top",show:r,children:f}),pR(fR,{})]}),e[4]=r,e[5]=c,e[6]=f,e[7]=m):m=e[7],m};import{c as a8}from"react/compiler-runtime";import{jsx as l8}from"react/jsx-runtime";import"react";import*as bR from"qs-esm";import{useCallback as s8,useRef as i8,useState as gR}from"react";var vR=()=>{let{id:t,collectionSlug:e,globalSlug:o,versionCount:n}=Pe(),[r,s]=gR(!1),[i,a]=gR(""),{code:l}=Ne(),c=n>0,{config:{routes:{api:u},serverURL:d}}=H(),{t:f}=k(),m=i8(!1);return{generatePreviewURL:s8(async({openPreviewWindow:p=!1})=>{if(!m.current){m.current=!0;try{s(!0);let g=`${d}${u}`;e&&(g=`${g}/${e}/${t}/preview`),o&&(g=`${g}/globals/${o}/preview`);let v=await fetch(`${g}?${bR.stringify({draft:c?"true":"false",locale:l||void 0})}`);if(!v.ok)throw new Error;let x=await v.json();if(!x)throw new Error;a(x),s(!1),m.current=!1,p&&window.open(x,"_blank")}catch{s(!1),m.current=!1,fe.error(f("error:previewing"))}}},[d,u,e,o,c,l,t,f]),isLoading:r,label:f(r?"general:loading":"version:preview"),previewURL:i}};var c8="preview-btn";function a1(t){let e=a8(5),{generatePreviewURL:o,label:n}=vR(),r;e[0]!==o?(r=()=>o({openPreviewWindow:!0}),e[0]=o,e[1]=r):r=e[1];let s;return e[2]!==n||e[3]!==r?(s=l8(ne,{buttonStyle:"secondary",className:c8,icon:"link",iconPosition:"left",onClick:r,size:"medium",children:n}),e[2]=n,e[3]=r,e[4]=s):s=e[4],s}import{jsx as Ba,jsxs as RR}from"react/jsx-runtime";import*as _R from"qs-esm";import c1,{useCallback as u1}from"react";import{jsx as xR}from"react/jsx-runtime";import"react";var u8="form-submit",Yr=t=>{let{type:e="submit",buttonId:o,children:n,disabled:r,onClick:s,programmaticSubmit:i,ref:a}=t,l=lr(),c=rp(),u=Ts(),{disabled:d,submit:f}=Oe();return xR("div",{className:u8,children:xR(ne,{ref:a,...t,disabled:!(r||u||l||c||d)?void 0:!0,id:o,onClick:s??(i?()=>{f()}:void 0),type:e,children:n})})};import{jsx as Gt,jsxs as _i}from"react/jsx-runtime";import{getTranslation as p8}from"@payloadcms/translations";import*as SR from"qs-esm";import No,{useCallback as h8,useMemo as g8}from"react";import{jsx as Ss,jsxs as d8}from"react/jsx-runtime";import"react";var yR="table",l1=({appearance:t,columns:e,data:o})=>{let n=e?.filter(r=>r?.active);return!n||n.length===0?Ss("div",{children:"No columns selected"}):Ss("div",{className:[yR,t&&`${yR}--appearance-${t}`].filter(Boolean).join(" "),children:d8("table",{cellPadding:"0",cellSpacing:"0",children:[Ss("thead",{children:Ss("tr",{children:n.map((r,s)=>Ss("th",{id:`heading-${r.accessor}`,children:r.Heading},s))})}),Ss("tbody",{children:o&&o.map((r,s)=>Ss("tr",{className:`row-${s+1}`,children:n.map((i,a)=>{let{accessor:l}=i;return Ss("td",{className:`cell-${l}`,children:i.renderedCells[s]},a)})},typeof r.id=="string"||typeof r.id=="number"?String(r.id):s))})]})})};import{jsx as an,jsxs as m8}from"react/jsx-runtime";import{getTranslation as f8}from"@payloadcms/translations";import"react";var CR=({dateFormat:t,deleteHandler:e,docs:o,i18n:n,localization:r,supportedTimezones:s,t:i})=>{let a=[{accessor:"input.type",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("version:type")}),renderedCells:o.map(l=>{let c=l.input?.type;return m8(vt,{pillStyle:c==="publish"?"success":"warning",children:[c==="publish"&&i("version:publish"),c==="unpublish"&&i("version:unpublish")]},l.id)})},{accessor:"waitUntil",active:!0,field:{name:"",type:"date"},Heading:an("span",{children:i("general:time")}),renderedCells:o.map(l=>an("span",{children:xn({date:l.waitUntil,i18n:n,pattern:t,timezone:l.input.timezone})},l.id))},{accessor:"input.timezone",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("general:timezone")}),renderedCells:o.map(l=>{let u=s.find(d=>d.value===l.input.timezone)?.label||l.input.timezone;return an("span",{children:u||i("general:noValue")},l.id)})}];return r&&a.push({accessor:"input.locale",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("general:locale")}),renderedCells:o.map(l=>{if(l.input.locale){let c=r.locales.find(u=>u.code===l.input.locale);if(c)return an("span",{children:f8(c.label,n)},l.id)}return an("span",{children:i("general:all")},l.id)})}),a.push({accessor:"delete",active:!0,field:{name:"delete",type:"text"},Heading:an("span",{children:i("general:delete")}),renderedCells:o.map(l=>an(ne,{buttonStyle:"icon-label",className:"schedule-publish__delete",icon:"x",onClick:c=>{c.preventDefault(),e(l.id)},tooltip:i("general:delete")},l.id))}),a};var Ma="schedule-publish",wR={label:"All",value:"all"},IR=({slug:t,defaultType:e,schedulePublishConfig:o})=>{let{toggleModal:n}=de(),{config:{admin:{dateFormat:r,timezones:{defaultTimezone:s,supportedTimezones:i}},localization:a,routes:{api:l},serverURL:c}}=H(),{id:u,collectionSlug:d,globalSlug:f,title:m}=Pe(),{i18n:h,t:p}=k(),{schedulePublish:g}=Dt(),[b,v]=No.useState(e||"publish"),[x,y]=No.useState(),[C,S]=No.useState(s),[w,D]=No.useState(wR),[_,A]=No.useState(!1),F=p("general:schedulePublishFor",{title:m}),[R,I]=No.useState(),[E,T]=No.useState(),$=No.useRef(()=>null),j=Intl.DateTimeFormat().resolvedOptions().timeZone,N=No.useMemo(()=>{if(a){let B=a.locales.map(({code:G,label:X})=>({label:p8(X,h),value:G}));return B.unshift(wR),B}return[]},[a,h]),P=No.useCallback(async()=>{let B={sort:"waitUntil",where:{and:[{taskSlug:{equals:"schedulePublish"}},{waitUntil:{greater_than:new Date}}]}};d&&(B.where.and.push({"input.doc.value":{equals:String(u)}}),B.where.and.push({"input.doc.relationTo":{equals:d}})),f&&B.where.and.push({"input.global":{equals:f}});let{docs:G}=await Qe.post(`${c}${l}/payload-jobs`,{body:SR.stringify(B),headers:{"Accept-Language":h.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"}}).then(X=>X.json());T(CR({dateFormat:r,deleteHandler:$.current,docs:G,i18n:h,localization:a,supportedTimezones:i,t:p})),I(G)},[d,f,c,l,h,r,a,i,p,u]),L=No.useCallback(async B=>{try{await g({deleteID:B}),await P(),fe.success(p("general:deletedSuccessfully"))}catch(G){console.error(G),fe.error(G.message)}},[P,g,p]);No.useEffect(()=>{$.current=L},[L]);let V=No.useCallback(async()=>{if(!x)return fe.error(p("general:noDateSelected"));A(!0);let B;typeof w=="object"&&w.value!=="all"&&b==="publish"&&(B=w.value);try{await g({type:b,date:x,doc:d?{relationTo:d,value:String(u)}:void 0,global:f||void 0,locale:B,timezone:C}),y(void 0),fe.success(p("version:scheduledSuccessfully")),P()}catch(G){console.error(G),fe.error(G.message)}A(!1)},[x,w,b,p,g,d,u,f,C,P]),M=g8(()=>{if(C&&j&&x){let B=Mt.tz(C),G=Mt.tz(j),X=new Mt(x).withTimeZone(C),Z=Ar(X,B);return Ar(Z,G).toISOString()}return x},[C,x,j]),O=h8(B=>{if(C&&B){let G=Mt.tz(C),X=new Mt(B),Z=Ar(X,G);y(Z||null)}else y(B||null)},[y,C]);return No.useEffect(()=>{R||(async()=>await P())()},[R,P]),_i(Pt,{className:Ma,gutter:!1,Header:_i("div",{className:`${Ma}__drawer-header`,children:[Gt("h2",{title:F,children:F}),Gt(jm,{onClick:()=>n(t)})]}),slug:t,children:[_i(Bo,{className:`${Ma}__scheduler`,children:[Gt(xe,{label:p("version:type"),required:!0}),_i("ul",{className:`${Ma}__type`,children:[Gt("li",{children:Gt(bc,{id:`${t}-type`,isSelected:b==="publish",onChange:()=>v("publish"),option:{label:p("version:publish"),value:"publish"},path:`${t}-type`,readOnly:_})}),Gt("li",{children:Gt(bc,{id:`${t}-type`,isSelected:b==="unpublish",onChange:()=>v("unpublish"),option:{label:p("version:unpublish"),value:"unpublish"},path:`${t}-type`,readOnly:_})})]}),Gt("br",{}),Gt(xe,{label:p("general:time"),path:"time",required:!0}),Gt(Qi,{id:"time",minDate:new Date,onChange:B=>O(B),pickerAppearance:"dayAndTime",readOnly:_,timeFormat:o?.timeFormat,timeIntervals:o?.timeIntervals??5,value:M}),i.length>0&&Gt(Kl,{id:"timezone-picker",onChange:S,options:i,selectedTimezone:C}),Gt("br",{}),N.length>0&&b==="publish"&&_i(No.Fragment,{children:[Gt(xe,{label:p("localization:localeToPublish")}),Gt(mt,{onChange:B=>D(B),options:N,value:w}),Gt("br",{})]}),_i("div",{className:`${Ma}__actions`,children:[Gt(ne,{buttonStyle:"primary",disabled:_,id:"scheduled-publish-save",onClick:V,type:"button",children:p("general:save")}),_?Gt("span",{children:p("general:saving")}):null]})]}),_i(Bo,{className:`${Ma}__upcoming`,children:[Gt("h4",{children:p("general:upcomingEvents")}),!R&&Gt(St,{}),R?.length===0&&Gt(Rr,{type:"info",children:p("general:noUpcomingEventsScheduled")}),R?.length>0&&Gt(l1,{appearance:"condensed",columns:E,data:R})]})]})};function d1({label:t}){let{id:e,collectionSlug:o,docConfig:n,globalSlug:r,hasPublishedDoc:s,hasPublishPermission:i,setHasPublishedDoc:a,setMostRecentVersionIsAutosaved:l,setUnpublishedVersionCount:c,unpublishedVersionCount:u,uploadStatus:d}=Pe(),{config:f,getEntityConfig:m}=H(),{submit:h}=Oe(),p=Ut(),g=ct(),{code:b}=Ne(),{isModalOpen:v,toggleModal:x}=de(),y=`schedule-publish-${e}`,{localization:C,routes:{api:S},serverURL:w}=f,{t:D}=k(),_=t||D("version:publishChanges"),A=c1.useMemo(()=>{if(o)return m({collectionSlug:o});if(r)return m({globalSlug:r})},[o,r,m]),F=u>0,R=typeof A?.versions?.drafts=="object"&&A?.versions?.drafts.schedulePublish,I=i&&(p||F||!s)&&d!=="uploading",E=!!R,T=!!(typeof A?.versions?.drafts=="object"&&A?.versions?.drafts.autosave),$=!!(E&&i&&(r||o&&e)&&(T||!p)),N=Qo()==="update"&&!p,P=u1(async()=>{if(N)return;let U=`?locale=${b}&depth=0&fallback-locale=null&draft=true`,z,ce="POST";o&&(z=`${w}${S}/${o}${e?`/${e}`:""}${U}`,e&&(ce="PATCH")),r&&(z=`${w}${S}/globals/${r}${U}`),await h({action:z,method:ce,overrides:{_status:"draft"},skipValidation:!0})},[h,o,r,w,S,b,e,N]);yi({cmdCtrlKey:!0,editDepth:g,keyCodes:["s"]},U=>{U.preventDefault(),U.stopPropagation(),P&&n.versions?.drafts&&n.versions?.drafts?.autosave&&P()});let L=u1(()=>{d!=="uploading"&&(h({overrides:{_status:"published"}}),c(0),l(!1),a(!0))},[a,h,c,d,l]),V=u1(U=>{if(d==="uploading")return;let z=_R.stringify({publishSpecificLocale:U}),ce=`${w}${S}${r?`/globals/${r}`:`/${o}/${e?`${"/"+e}`:""}`}${z?"?"+z:""}`;h({action:ce,overrides:{_status:"published"}}),a(!0)},[S,o,r,e,w,a,h,d]),M=!C||C&&C.defaultLocalePublishOption!=="active",O=C&&C?.locales.find(U=>typeof U=="string"?U===b:U.code===b),B=O&&(typeof O.label=="string"?O.label:O.label?.[b]??void 0),G=M?L:()=>V(O.code),X=M?_:D("version:publishIn",{locale:B}),Z=M?()=>V(O.code):L,te=M?D("version:publishIn",{locale:B}):D("version:publishAllLocales");return i?RR(c1.Fragment,{children:[Ba(Yr,{buttonId:"action-save",disabled:!I,enableSubMenu:$,onClick:G,size:"medium",SubMenuPopupContent:C||$?({close:U})=>RR(c1.Fragment,{children:[$&&Ba(Me.ButtonGroup,{children:Ba(Me.Button,{id:"schedule-publish",onClick:()=>[x(y),U()],children:D("version:schedulePublish")})},"schedule-publish"),C&&I&&Ba(Me.ButtonGroup,{children:Ba(Me.Button,{id:"publish-locale",onClick:Z,children:te})})]}):void 0,type:"button",children:C?X:_}),$&&v(y)&&Ba(IR,{defaultType:F?"publish":"unpublish",schedulePublishConfig:typeof R=="object"&&R,slug:y})]}):null}import{jsx as b8}from"react/jsx-runtime";import{useRef as v8}from"react";function m1({label:t}){let{uploadStatus:e}=Pe(),{t:o}=k(),{submit:n}=Oe(),r=Ut(),s=t||o("general:save"),i=v8(null),a=ct(),c=Qo()==="update"&&!r||e==="uploading";return yi({cmdCtrlKey:!0,editDepth:a,keyCodes:["s"]},d=>{d.preventDefault(),d.stopPropagation(),i?.current&&i.current.click()}),b8(Yr,{buttonId:"action-save",disabled:c,onClick:()=>{if(e!=="uploading")return void n()},ref:i,size:"medium",type:"button",children:s})}import{jsx as x8}from"react/jsx-runtime";import{useCallback as y8,useRef as C8}from"react";var w8="save-draft";function f1(t){let{config:{routes:{api:e},serverURL:o}}=H(),{id:n,collectionSlug:r,globalSlug:s,setUnpublishedVersionCount:i,uploadStatus:a}=Pe(),l=Ut(),{code:c}=Ne(),u=C8(null),d=ct(),{t:f}=k(),{submit:m}=Oe(),p=Qo()==="update"&&!l||a==="uploading",g=y8(async()=>{if(p)return;let b=`?locale=${c}&depth=0&fallback-locale=null&draft=true`,v,x="POST";r&&(v=`${o}${e}/${r}${n?`/${n}`:""}${b}`,n&&(x="PATCH")),s&&(v=`${o}${e}/globals/${s}${b}`),await m({action:v,method:x,overrides:{_status:"draft"},skipValidation:!0}),i(y=>y+1)},[m,r,s,o,e,c,n,p,i]);return yi({cmdCtrlKey:!0,editDepth:d,keyCodes:["s"]},b=>{b.preventDefault(),b.stopPropagation(),u?.current&&u.current.click()}),x8(Yr,{buttonId:"action-save-draft",buttonStyle:"secondary",className:w8,disabled:p,onClick:()=>void g(),ref:u,size:"medium",type:"button",children:f("version:saveDraft")})}import{jsx as Va,jsxs as wf}from"react/jsx-runtime";import DR,{useCallback as S8}from"react";var Ga="status",FR=()=>{let{id:t,collectionSlug:e,docPermissions:o,globalSlug:n,hasPublishedDoc:r,incrementVersionCount:s,setHasPublishedDoc:i,setMostRecentVersionIsAutosaved:a,setUnpublishedVersionCount:l,unpublishedVersionCount:c}=Pe(),{toggleModal:u}=de(),{config:{routes:{api:d},serverURL:f}}=H(),{reset:m}=Oe(),{code:h}=Ne(),{i18n:p,t:g}=k(),b=`confirm-un-publish-${t}`,v=`confirm-revert-${t}`,x;c>0&&r?x="changed":r?r&&c<=0&&(x="published"):x="draft";let y=S8(async S=>{let w,D,_;S==="unpublish"&&(_={_status:"draft"}),e&&(w=`${f}${d}/${e}/${t}?locale=${h}&fallback-locale=null&depth=0`,D="patch"),n&&(w=`${f}${d}/globals/${n}?locale=${h}&fallback-locale=null&depth=0`,D="post"),S==="revert"&&(_=await Qe.get(w,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(R=>R.json()));let A=await Qe[D](w,{body:JSON.stringify(_),headers:{"Accept-Language":p.language,"Content-Type":"application/json"}});if(A.status===200){let F,R=await A.json();n?F=R.result:e&&(F=R.doc),m(F),fe.success(R.message),s(),a(!1),S==="unpublish"?i(!1):S==="revert"&&l(0)}else fe.error(g("error:unPublishingDocument"))},[d,e,n,t,p.language,s,h,m,f,l,a,g,i]),C=o?.update;return x?Va("div",{className:Ga,title:`${g("version:status")}: ${g(`version:${x}`)}`,children:wf("div",{className:`${Ga}__value-wrap`,children:[wf("span",{className:`${Ga}__label`,children:[g("version:status"),":\xA0"]}),Va("span",{className:`${Ga}__value`,children:g(`version:${x}`)}),C&&x==="published"&&wf(DR.Fragment,{children:["\xA0\u2014\xA0",Va(ne,{buttonStyle:"none",className:`${Ga}__action`,onClick:()=>u(b),children:g("version:unpublish")}),Va(It,{body:g("version:aboutToUnpublish"),confirmingLabel:g("version:unpublishing"),heading:g("version:confirmUnpublish"),modalSlug:b,onConfirm:()=>y("unpublish")})]}),C&&x==="changed"&&wf(DR.Fragment,{children:["\xA0\u2014\xA0",Va(ne,{buttonStyle:"none",className:`${Ga}__action`,id:"action-revert-to-published",onClick:()=>u(v),children:g("version:revertToPublished")}),Va(It,{body:g("version:aboutToRevertToPublished"),confirmingLabel:g("version:reverting"),heading:g("version:confirmRevertToSaved"),modalSlug:v,onConfirm:()=>y("revert")})]})]})}):null};var At="doc-controls",h1=t=>{let e=I8(15),{id:o,slug:n,BeforeDocumentControls:r,customComponents:s,data:i,disableActions:a,disableCreate:l,hasSavePermission:c,isAccountView:u,isEditing:d,onDelete:f,onDrawerCreateNew:m,onDuplicate:h,onTakeOver:p,permissions:g,readOnlyForIncomingUser:b,redirectAfterDelete:v,redirectAfterDuplicate:x,user:y}=t,C;e[0]!==s?(C=s===void 0?{}:s,e[0]=s,e[1]=C):C=e[1];let{PreviewButton:S,PublishButton:w,SaveButton:D,SaveDraftButton:_}=C,{i18n:A,t:F}=k(),R=ct(),{config:I,getEntityConfig:E}=H(),T=E({collectionSlug:n}),$=E({globalSlug:n}),{admin:j,localization:N,routes:P}=I,{dateFormat:L}=j,{admin:V}=P,[M,O]=p1.useState(""),[B,G]=p1.useState(""),X=lr(),Z=Ts(),te,U;e[2]!==i||e[3]!==L||e[4]!==A?(te=()=>{i?.updatedAt&&O(xn({date:i.updatedAt,i18n:A,pattern:L})),i?.createdAt&&G(xn({date:i.createdAt,i18n:A,pattern:L}))},U=[i,A,L],e[2]=i,e[3]=L,e[4]=A,e[5]=te,e[6]=U):(te=e[5],U=e[6]),D8(te,U);let z=g&&"create"in g&&g.create,ce=g&&"delete"in g&&g.delete,J=!!(T&&o&&!a&&(z||ce)),ue=!o&&T?.versions?.drafts&&T.versions?.drafts.validate,re=T?.versions?.drafts,q=$?.versions?.drafts,pe=re&&re?.autosave||q&&q?.autosave,he=re&&re?.autosave,_e=q&&q?.autosave,ge=he&&re.autosave!==!1&&re.autosave.showSaveDraftButton===!0||_e&&q.autosave!==!1&&q.autosave.showSaveDraftButton===!0,Ve=N&&!T?.admin?.disableCopyToLocale,Q;e[7]!==b||e[8]!==y?(Q=y&&b&&at(lu,{className:`${At}__locked-controls`,user:y}),e[7]=b,e[8]=y,e[9]=Q):Q=e[9];let Le;return e[10]!==p||e[11]!==b||e[12]!==F||e[13]!==y?(Le=y&&b&&at(ne,{buttonStyle:"secondary",id:"take-over",onClick:p,size:"medium",type:"button",children:F("general:takeOver")}),e[10]=p,e[11]=b,e[12]=F,e[13]=y,e[14]=Le):Le=e[14],Lo(Bo,{className:At,children:[Lo("div",{className:`${At}__wrapper`,children:[at("div",{className:`${At}__content`,children:Lo("ul",{className:`${At}__meta`,children:[T&&!d&&!u&&at("li",{className:`${At}__list-item`,children:at("p",{className:`${At}__value`,children:A.t("general:creatingNewLabel",{label:R8(T?.labels?.singular??A.t("general:document"),A)})})}),Q,(T?.versions?.drafts||$?.versions?.drafts)&&Lo(cu,{children:[($||T&&d)&&at("li",{className:[`${At}__status`,`${At}__list-item`].filter(Boolean).join(" "),children:at(FR,{})}),c&&pe&&!ue&&at("li",{className:`${At}__list-item`,children:at(rR,{collection:T,global:$,id:o,publishedDocUpdatedAt:i?.createdAt})})]}),T?.timestamps&&(d||u)&&Lo(cu,{children:[Lo("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:i?.updatedAt?M:"",children:[Lo("p",{className:`${At}__label`,children:[A.t("general:lastModified"),":\xA0"]}),i?.updatedAt&&at("p",{className:`${At}__value`,children:M})]}),Lo("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:i?.createdAt?B:"",children:[Lo("p",{className:`${At}__label`,children:[A.t("general:created"),":\xA0"]}),i?.createdAt&&at("p",{className:`${At}__value`,children:B})]})]})]})}),Lo("div",{className:`${At}__controls-wrapper`,children:[Lo("div",{className:`${At}__controls`,children:[r,(T?.admin.preview||$?.admin.preview)&&at(oe,{CustomComponent:S,Fallback:at(a1,{})}),c&&at(cu,{children:T?.versions?.drafts||$?.versions?.drafts?Lo(cu,{children:[(ue||!pe||pe&&ge)&&at(oe,{CustomComponent:_,Fallback:at(f1,{})}),at(oe,{CustomComponent:w,Fallback:at(d1,{})})]}):at(oe,{CustomComponent:D,Fallback:at(m1,{})})}),Le]}),J&&!b&&at(ho,{button:Lo("div",{className:`${At}__dots`,children:[at("div",{}),at("div",{}),at("div",{})]}),className:`${At}__popup`,disabled:Z||X,horizontalAlign:"right",size:"large",verticalAlign:"bottom",children:Lo(Me.ButtonGroup,{children:[Ve&&at(t1,{}),z&&Lo(p1.Fragment,{children:[!l&&at(cu,{children:R>1?at(Me.Button,{id:"action-create",onClick:m,children:A.t("general:createNew")}):at(Me.Button,{href:_8({adminRoute:V,path:`/collections/${T?.slug}/create`}),id:"action-create",children:A.t("general:createNew")})}),T.disableDuplicate!==!0&&d&&at(dR,{id:o.toString(),onDuplicate:h,redirectAfterDuplicate:x,singularLabel:T?.labels?.singular,slug:T?.slug})]}),ce&&at(iR,{buttonId:"action-delete",collectionSlug:T?.slug,id:o.toString(),onDelete:f,redirectAfterDelete:v,singularLabel:T?.labels?.singular,useAsTitle:T?.admin?.useAsTitle})]})})]})]}),at("div",{className:`${At}__divider`})]})};import{c as j8}from"react/compiler-runtime";import{jsx as If,jsxs as O8}from"react/jsx-runtime";import{useState as M8}from"react";import{c as g1}from"react/compiler-runtime";import{jsx as mo,jsxs as Sf}from"react/jsx-runtime";import{getTranslation as F8}from"@payloadcms/translations";import{useRouter as A8,useSearchParams as T8}from"next/navigation.js";import{mergeListSearchAndWhere as E8,unflatten as AR}from"payload/shared";import*as NR from"qs-esm";import TR,{useCallback as ER,useEffect as P8,useMemo as PR,useState as N8}from"react";var L8=t=>{let e=g1(7),{action:o,disabled:n}=t,{submit:r}=Oe(),{t:s}=k(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let a=i,l;return e[3]!==n||e[4]!==a||e[5]!==s?(l=mo(Yr,{className:`${$o}__save`,disabled:n,onClick:a,children:s("general:save")}),e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l},$8=t=>{let e=g1(7),{action:o,disabled:n}=t,{submit:r}=Oe(),{t:s}=k(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",overrides:{_status:"published"},skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let a=i,l;return e[3]!==n||e[4]!==a||e[5]!==s?(l=mo(Yr,{className:`${$o}__publish`,disabled:n,onClick:a,children:s("version:publishChanges")}),e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l},k8=t=>{let e=g1(7),{action:o,disabled:n}=t,{submit:r}=Oe(),{t:s}=k(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",overrides:{_status:"draft"},skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let a=i,l;return e[3]!==n||e[4]!==a||e[5]!==s?(l=mo(Yr,{buttonStyle:"secondary",className:`${$o}__draft`,disabled:n,onClick:a,children:s("version:saveDraft")}),e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l},LR=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,selectedFields:i,setSelectedFields:a}=t,{permissions:l,user:c}=Ae(),{closeModal:u}=de(),{config:{routes:{api:d},serverURL:f}}=H(),{getFormState:m}=Dt(),{count:h,getQueryParams:p,selectAll:g}=oo(),{i18n:b,t:v}=k(),[x,y]=N8(!1),C=A8(),S=TR.useRef(null),{clearRouteCache:w}=On(),D=l?.collections?.[r.slug],_=T8(),A=PR(()=>AR(i.reduce((T,$)=>(T[$.value.path]=!0,T),{})),[i]),F=ER(async({formState:T,submitted:$})=>{let j=or(S),{state:N}=await m({collectionSlug:r.slug,docPermissions:D,docPreferences:null,formState:T,operation:"update",schemaPath:r.slug,select:A,signal:j.signal,skipValidation:!$});return S.current=null,N},[m,r,D,A]);P8(()=>{let T=S.current;return()=>{tr(T)}},[]);let R=PR(()=>{let T=E8({collectionConfig:r,search:_.get("search")});return p(T)},[r,_,p]),I=()=>{C.replace(NR.stringify({...jr(_),page:g===xo.AllAvailable?"1":void 0},{addQueryPrefix:!0})),w(),u(s)},E=ER(async({dispatchFields:T,formState:$,selected:j})=>{y(!0),a(j||[]);let{state:N}=await m({collectionSlug:r.slug,docPermissions:D,docPreferences:null,formState:$,operation:"update",schemaPath:r.slug,select:AR(j.reduce((P,L)=>(P[L.value.path]=!0,P),{})),skipValidation:!0});T({type:"UPDATE_MANY",formState:N}),y(!1)},[m,r.slug,D,a]);return mo(Sl,{collectionSlug:r.slug,currentEditor:c,hasPublishedDoc:!1,id:null,initialData:{},isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,versionCount:0,children:mo(vd,{value:"update",children:Sf("div",{className:`${$o}__main`,children:[Sf("div",{className:`${$o}__header`,children:[mo("h2",{className:`${$o}__header__title`,children:v("general:editingLabel",{count:h,label:F8(h>1?o:n,b)})}),mo("button",{"aria-label":v("general:close"),className:`${$o}__header__close`,id:`close-drawer__${s}`,onClick:()=>u(s),type:"button",children:mo(pt,{})})]}),Sf(An,{className:`${$o}__form`,isInitializing:x,onChange:[F],onSuccess:I,children:[mo(Hm,{fields:e,onChange:E,permissions:D.fields}),i.length===0?null:mo("div",{className:"render-fields",children:i.map((T,$)=>{let{value:{field:j,fieldPermissions:N,path:P}}=T;return mo(Aa,{clientFieldConfig:j,indexPath:"",parentPath:"",parentSchemaPath:"",path:P,permissions:N},`${P}-${$}`)})}),mo("div",{className:`${$o}__sidebar-wrap`,children:mo("div",{className:`${$o}__sidebar`,children:mo("div",{className:`${$o}__sidebar-sticky-wrap`,children:mo("div",{className:`${$o}__document-actions`,children:r?.versions?.drafts?Sf(TR.Fragment,{children:[mo(k8,{action:`${f}${d}/${r.slug}${R}&draft=true`,disabled:i.length===0}),mo($8,{action:`${f}${d}/${r.slug}${R}&draft=true`,disabled:i.length===0})]}):mo(L8,{action:`${f}${d}/${r.slug}${R}`,disabled:i.length===0})})})})})]})]})})})};var $o="edit-many",b1=t=>{let e=j8(10),{collection:o}=t,{slug:n}=o,{permissions:r}=Ae(),{openModal:s}=de(),{selectAll:i}=oo(),{t:a}=k(),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];let[c,u]=M8(l),d=r?.collections?.[n],f=`edit-${n}`;if(i===xo.None||!d?.update)return null;let m;if(e[1]!==f||e[2]!==s||e[3]!==t.collection||e[4]!==c||e[5]!==a){let h;e[7]!==f||e[8]!==s?(h=()=>{s(f),u([])},e[7]=f,e[8]=s,e[9]=h):h=e[9],m=O8("div",{className:$o,children:[If("button",{"aria-label":a("general:edit"),className:`${$o}__toggle`,onClick:h,type:"button",children:a("general:edit")}),If(Ns,{children:If(Pt,{Header:null,slug:f,children:If(LR,{collection:t.collection,drawerSlug:f,selectedFields:c,setSelectedFields:u})})})]}),e[1]=f,e[2]=s,e[3]=t.collection,e[4]=c,e[5]=a,e[6]=m}else m=e[6];return m};import{c as B8}from"react/compiler-runtime";import{jsx as V8}from"react/jsx-runtime";import"react";function G8(t){let e=B8(6),o=ct(),n;e[0]!==t.style?(n=t.style||{},e[0]=t.style,e[1]=n):n=e[1];let r=`calc(100 + ${o||0} + 1)`,s;return e[2]!==t||e[3]!==n||e[4]!==r?(s=V8(Yo,{...t,style:{...n,zIndex:r}}),e[2]=t,e[3]=n,e[4]=r,e[5]=s):s=e[5],s}import{c as W8}from"react/compiler-runtime";import{jsx as Rf,jsxs as H8}from"react/jsx-runtime";import z8 from"react";function v1(t){let e=W8(12),{highlightField:o,setKey:n}=t,{id:r}=Pe(),{toggleModal:s}=de(),{t:i}=k(),a=`generate-confirmation-${r}`,l;e[0]!==o||e[1]!==n||e[2]!==i?(l=()=>{n(),fe.success(i("authentication:newAPIKeyGenerated")),o(!0)},e[0]=o,e[1]=n,e[2]=i,e[3]=l):l=e[3];let c=l,u;e[4]!==a||e[5]!==s?(u=()=>{s(a)},e[4]=a,e[5]=s,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==a||e[9]!==i||e[10]!==u?(d=H8(z8.Fragment,{children:[Rf(ne,{buttonStyle:"secondary",onClick:u,size:"small",children:i("authentication:generateNewAPIKey")}),Rf(It,{body:Rf(wi,{elements:{1:X8},i18nKey:"authentication:generatingNewAPIKeyWillInvalidate",t:i}),confirmLabel:i("authentication:generate"),heading:i("authentication:confirmGeneration"),modalSlug:a,onConfirm:c})]}),e[7]=c,e[8]=a,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function X8(t){let{children:e}=t;return Rf("strong",{children:e})}import{c as U8}from"react/compiler-runtime";import{useEffect as Y8}from"react";function Z8(t){let e=U8(4),{permissions:o}=t,{setPermissions:n}=Ae(),r,s;return e[0]!==o||e[1]!==n?(r=()=>{n(o)},s=[o,n],e[0]=o,e[1]=n,e[2]=r,e[3]=s):(r=e[2],s=e[3]),Y8(r,s),null}import{jsx as Wt,jsxs as Ef}from"react/jsx-runtime";import{getTranslation as Xa}from"@payloadcms/translations";import{validateWhereQuery as EV}from"payload/shared";import PV,{Fragment as v_,useEffect as x_,useRef as y_,useState as NV}from"react";import{jsx as x1,jsxs as J8}from"react/jsx-runtime";import"react";var y1="dots",$R=({ariaLabel:t,className:e,noBackground:o,orientation:n="vertical"})=>J8("div",{"aria-label":t,className:[e,y1,o&&`${y1}--no-background`,n&&`${y1}--${n}`].filter(Boolean).join(" "),children:[x1("div",{}),x1("div",{}),x1("div",{})]});import{jsx as kR}from"react/jsx-runtime";import{useEffect as jR,useRef as OR,useState as q8}from"react";import{usePathname as Q8}from"next/navigation.js";var MR="search-filter",C1=t=>{let{handleChange:e,initialParams:o,label:n}=t,r=Q8(),[s,i]=q8(typeof o?.search=="string"?o?.search:void 0),a=OR(!0),l=OR(typeof o?.search=="string"?o?.search:void 0),c=Jo(s,300);return jR(()=>{o?.search!==l.current&&(a.current=!1,i(o?.search),l.current=o?.search)},[o?.search,r]),jR(()=>{c!==l.current&&a.current&&(e&&e(c),l.current=c)},[c,e]),kR("div",{className:MR,children:kR("input",{"aria-label":n,className:`${MR}__input`,id:"search-filter-input",onChange:u=>{a.current=!0,i(u.target.value)},placeholder:n,type:"text",value:s||""})})};import{jsx as Vn,jsxs as fu}from"react/jsx-runtime";import{getTranslation as wV}from"@payloadcms/translations";import{transformWhereQuery as SV,validateWhereQuery as i_}from"payload/shared";import Ff,{useMemo as a_}from"react";import{jsx as Mn,jsxs as T1}from"react/jsx-runtime";import{useCallback as t_,useEffect as hV,useState as gV}from"react";import{jsx as uu}from"react/jsx-runtime";import"react";import{jsx as BR}from"react/jsx-runtime";import"react";var K8="condition-value-date",w1=({disabled:t,field:{admin:e},onChange:o,value:n})=>{let{date:r}=e||{};return BR("div",{className:K8,children:BR(Qi,{...r,onChange:o,readOnly:t,value:n})})};import{c as eV}from"react/compiler-runtime";import{jsx as VR}from"react/jsx-runtime";import GR from"react";var tV="condition-value-number",S1=t=>{let e=eV(18),{disabled:o,field:n,onChange:r,operator:s,value:i}=t,{hasMany:a}=n,{t:l}=k(),c;e[0]!==a||e[1]!==s?(c=["in","not_in"].includes(s)||a,e[0]=a,e[1]=s,e[2]=c):c=e[2];let u=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[3]=d):d=e[3];let[f,m]=GR.useState(d),h;e[4]!==u||e[5]!==r?(h=x=>{let y;x?u&&(Array.isArray(x)?y=x.map(oV):y=[Number(x.value?.value||x.value)]):y=[],r(y)},e[4]=u,e[5]=r,e[6]=h):h=e[6];let p=h,g,b;e[7]!==i?(g=()=>{Array.isArray(i)?m(i.map(rV)):m([])},b=[i],e[7]=i,e[8]=g,e[9]=b):(g=e[8],b=e[9]),GR.useEffect(g,b);let v;return e[10]!==o||e[11]!==u||e[12]!==r||e[13]!==p||e[14]!==l||e[15]!==i||e[16]!==f?(v=u?VR(mt,{disabled:o,isClearable:!0,isCreatable:!0,isMulti:u,isSortable:!0,numberOnly:!0,onChange:p,options:[],placeholder:l("general:enterAValue"),value:f||[]}):VR("input",{className:tV,disabled:o,onChange:x=>r(x.target.value),placeholder:l("general:enterAValue"),type:"number",value:i}),e[10]=o,e[11]=u,e[12]=r,e[13]=p,e[14]=l,e[15]=i,e[16]=f,e[17]=v):v=e[17],v};function oV(t){return Number(t.value?.value||t.value)}function rV(t,e){return{id:`${t}${e}`,label:`${t}`,value:{toString:()=>`${t}${e}`,value:t?.value||t}}}import{jsx as XR,jsxs as sV}from"react/jsx-runtime";import*as JR from"qs-esm";import UR,{useCallback as _f,useEffect as YR,useReducer as iV,useState as I1}from"react";import{getTranslation as WR}from"@payloadcms/translations";var HR=t=>t.reduce((e,o)=>o.options?[...e,...HR(o.options)]:[...e,o.id],[]),nV=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,data:n,hasMultipleRelations:r,i18n:s,relation:i}=e,a=o.admin.useAsTitle||"id",l=HR(t);if(!r)return[...t,...n.docs.reduce((f,m)=>l.indexOf(m.id)===-1?(l.push(m.id),[...f,{label:m[a],value:m.id}]):f,[])];let c=[...t],u=c.find(f=>f.label===WR(o.labels.plural,s)),d=n.docs.reduce((f,m)=>l.indexOf(m.id)===-1?(l.push(m.id),[...f,{label:m[a],relationTo:i,value:m.id}]):f,[]);return u?u.options=[...u.options,...d]:c.push({label:WR(o.labels.plural,s),options:d,value:void 0}),c}case"CLEAR":return e.required?[]:[{label:e.i18n.t("general:none"),value:"null"}];default:return t}},zR=nV;var ZR="condition-value-relationship",aV=10,R1=t=>{let{disabled:e,field:{admin:{isSortable:o}={},hasMany:n,relationTo:r},filterOptions:s,onChange:i,value:a}=t,{config:{routes:{api:l},serverURL:c},getEntityConfig:u}=H(),d=Array.isArray(r),[f,m]=iV(zR,[]),[h,p]=I1(""),g=Jo(h,300),[b,v]=I1(""),[x,y]=I1(!1),{i18n:C,t:S}=k(),w=Ne(),D=d?r:[r],_=UR.useRef(new Map(D.map(N=>[N,{hasLoadedAll:!1,nextPage:1}]))),A=_f((N,P)=>{let L=u({collectionSlug:P});m({type:"ADD",collection:L,data:N,hasMultipleRelations:d,i18n:C,relation:P})},[d,C,u]),F=eo(async({abortController:N,relationSlug:P})=>{let L=_.current.get(P);if(P&&!L.hasLoadedAll){let M=u({collectionSlug:P})?.admin?.useAsTitle||"id",O={and:[]},B={depth:0,limit:aV,locale:w.code,page:L.nextPage,select:{[M]:!0},where:O};s&&s?.[P]&&B.where.and.push(s[P]),g&&B.where.and.push({[M]:{like:g}});try{let G=await fetch(`${c}${l}/${P}${JR.stringify(B,{addQueryPrefix:!0})}`,{credentials:"include",headers:{"Accept-Language":C.language},signal:N.signal});if(G.ok){let X=await G.json();X.docs.length>0&&(A(X,P),X.nextPage?_.current.set(P,{hasLoadedAll:!1,nextPage:X.nextPage}):_.current.set(P,{hasLoadedAll:!0,nextPage:null}))}else v(S("error:unspecific"))}catch(G){N.signal.aborted||console.error(G)}}y(!0)}),R=UR.useCallback(()=>{let N=_.current.entries().next().value;if(N[0]&&!N[1].hasLoadedAll){let P=new AbortController;F({abortController:P,relationSlug:N[0]})}},[]),I=_f(()=>{if(a){if(n)return Array.isArray(a)?a.map(N=>{if(d){let P;return f.forEach(L=>{L.options&&L.options.some(V=>V?.value==N.value?(P=V,!0):!1)}),P}return f.find(P=>P.value==N)}):void 0;if(d){let N,P=a;return f.forEach(L=>{L?.options&&L.options.some(V=>V?.value==P.value?(N=V,!0):!1)}),N}return f.find(N=>N.value==a)}},[n,d,a,f]),E=_f(N=>{if(N!==h){m({type:"CLEAR",i18n:C,required:!1});let P=Array.isArray(r)?r:[r];_.current=new Map(P.map(L=>[L,{hasLoadedAll:!1,nextPage:1}])),p(N)}},[C,r,h]),T=_f(async(N,P)=>{if(!b&&N!=="null"&&N&&P){let L=await fetch(`${c}${l}/${P}/${N}?depth=0`,{credentials:"include",headers:{"Accept-Language":C.language}});if(L.ok){let V=await L.json();A({docs:[V]},P)}else console.error(S("error:loadingDocument",{id:N}))}},[C,A,l,b,c,S]);YR(()=>{let N=Array.isArray(r)?r:[r];_.current=new Map(N.map(L=>[L,{hasLoadedAll:!1,nextPage:1}])),m({type:"CLEAR",i18n:C,required:!1}),y(!1);let P=[];return N.forEach(L=>{let V=new AbortController;F({abortController:V,relationSlug:L}),P.push(V)}),()=>{P.forEach(L=>{if(L.signal)try{L.abort()}catch{}})}},[C,r,g]),YR(()=>{if(a&&x){if(n)(I()||[]).forEach((P,L)=>{P||(d?T(a[L].value,a[L].relationTo):T(a[L],r))});else if(!I())if(d){let P=a;T(P.value,P.relationTo)}else T(a,r)}},[T,I,n,d,r,a,x]);let $=["field-type",ZR,b&&"error-loading"].filter(Boolean).join(" "),j=I()||a;return sV("div",{className:$,children:[!b&&XR(mt,{disabled:e,isMulti:n,isSortable:o,onChange:N=>{if(!N){i(null);return}n&&Array.isArray(N)?i(N?N.map(P=>d?{relationTo:P?.relationTo,value:P?.value}:P?.value):null):d&&!Array.isArray(N)?i({relationTo:N?.relationTo,value:N?.value}):Array.isArray(N)||i(N?.value)},onInputChange:E,onMenuScrollToBottom:R,options:f,placeholder:S("general:selectValue"),value:j}),b&&XR("div",{className:`${ZR}__error-loading`,children:b})]})};import{c as lV}from"react/compiler-runtime";import{jsx as cV}from"react/jsx-runtime";import{getTranslation as _1}from"@payloadcms/translations";import D1 from"react";var F1=t=>{let e=lV(26),{disabled:o,isClearable:n,onChange:r,operator:s,options:i,value:a}=t,{i18n:l}=k(),c;e[0]!==i?(c=Ql(i),e[0]=i,e[1]=c):c=e[1];let[u,d]=D1.useState(c),f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=["in","not_in"],e[2]=f):f=e[2];let m=f.includes(s),h;if(m&&Array.isArray(a)){let S;e[3]!==l||e[4]!==u?(S=w=>{let D=u.find(_=>_.value===w);return{label:D?_1(D.label,l):w,value:D?.value??w}},e[3]=l,e[4]=u,e[5]=S):S=e[5],h=a.map(S)}else if(a){let S,w;if(e[6]!==l||e[7]!==u||e[8]!==a){let D;e[11]!==a?(D=_=>_.value===a,e[11]=a,e[12]=D):D=e[12],S=u.find(D),w=S?_1(S.label,l):a,e[6]=l,e[7]=u,e[8]=a,e[9]=S,e[10]=w}else S=e[9],w=e[10];h={label:w,value:S?.value??a}}let p;e[13]!==m||e[14]!==r?(p=S=>{let w;S?m?Array.isArray(S)?w=S.map(uV):w=[]:w=S.value:w=null,r(w)},e[13]=m,e[14]=r,e[15]=p):p=e[15];let g=p,b,v;e[16]!==i?(b=()=>{d(Ql(i))},v=[i],e[16]=i,e[17]=b,e[18]=v):(b=e[17],v=e[18]),D1.useEffect(b,v);let x,y;e[19]!==m||e[20]!==r||e[21]!==a?(x=()=>{!m&&Array.isArray(a)&&r(a[0])},y=[m,r,a],e[19]=m,e[20]=r,e[21]=a,e[22]=x,e[23]=y):(x=e[22],y=e[23]),D1.useEffect(x,y);let C;return e[24]!==l?(C=S=>({...S,label:_1(S.label,l)}),e[24]=l,e[25]=C):C=e[25],cV(mt,{disabled:o,isClearable:n,isMulti:m,onChange:g,options:u.map(C),value:h})};function uV(t){return t.value}import{c as dV}from"react/compiler-runtime";import{jsx as qR}from"react/jsx-runtime";import QR from"react";var mV="condition-value-text",A1=t=>{let e=dV(18),{disabled:o,field:n,onChange:r,operator:s,value:i}=t,{hasMany:a}=n,{t:l}=k(),c;e[0]!==a||e[1]!==s?(c=["in","not_in"].includes(s)||a,e[0]=a,e[1]=s,e[2]=c):c=e[2];let u=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[3]=d):d=e[3];let[f,m]=QR.useState(d),h;e[4]!==u||e[5]!==r?(h=x=>{let y;x?u&&(Array.isArray(x)?y=x.map(fV):y=[x.value?.value||x.value]):y=[],r(y)},e[4]=u,e[5]=r,e[6]=h):h=e[6];let p=h,g,b;e[7]!==i?(g=()=>{Array.isArray(i)?m(i.map(pV)):m([])},b=[i],e[7]=i,e[8]=g,e[9]=b):(g=e[8],b=e[9]),QR.useEffect(g,b);let v;return e[10]!==o||e[11]!==u||e[12]!==r||e[13]!==p||e[14]!==l||e[15]!==i||e[16]!==f?(v=u?qR(mt,{disabled:o,isClearable:!0,isCreatable:!0,isMulti:u,isSortable:!0,onChange:p,options:[],placeholder:l("general:enterAValue"),value:f||[]}):qR("input",{className:mV,disabled:o,onChange:x=>r(x.target.value),placeholder:l("general:enterAValue"),type:"text",value:i||""}),e[10]=o,e[11]=u,e[12]=r,e[13]=p,e[14]=l,e[15]=i,e[16]=f,e[17]=v):v=e[17],v};function fV(t){return t.value?.value||t.value}function pV(t,e){return{id:`${t}${e}`,label:`${t}`,value:{toString:()=>`${t}${e}`,value:t?.value||t}}}var KR=({booleanSelect:t,disabled:e,filterOptions:o,internalField:n,onChange:r,operator:s,options:i,value:a})=>{if(t||["radio","select"].includes(n?.field?.type))return uu(F1,{disabled:e,field:n.field,isClearable:!t,onChange:r,operator:s,options:i,value:a});switch(n?.field?.type){case"date":return uu(w1,{disabled:e,field:n.field,onChange:r,operator:s,value:a});case"number":return uu(S1,{disabled:e,field:n.field,onChange:r,operator:s,value:a});case"relationship":return uu(R1,{disabled:e,field:n.field,filterOptions:o,onChange:r,operator:s,value:a});default:return uu(A1,{disabled:e,field:n?.field,onChange:r,operator:s,value:a})}};var e_=t=>({all:"any",contains:"string",equals:"any",exists:"boolean",greater_than:t==="date"?"object":"string",greater_than_equal:t==="date"?"object":"string",in:"any",intersects:"any",less_than:t==="date"?"object":"string",less_than_equal:t==="date"?"object":"string",like:"string",near:"any",not_equals:"any",not_in:"any",not_like:"string",within:"any"});var Bn="condition",o_=t=>{let{addCondition:e,andIndex:o,fieldName:n,filterOptions:r,operator:s,orIndex:i,reducedFields:a,removeCondition:l,RenderedFilter:c,updateCondition:u,value:d}=t,{t:f}=k(),m=a.find(w=>w.value===n),[h,p]=gV(d),g=Jo(h,300),b=["exists"].includes(s)||m?.field?.type==="checkbox",v=[];b?v=[{label:f("general:true"),value:"true"},{label:f("general:false"),value:"false"}]:m?.field&&"options"in m.field&&(v=m.field.options);let x=eo(async w=>{s&&await u({andIndex:o,field:m,operator:s,orIndex:i,value:w===null?"":w})});hV(()=>{x(g)},[g]);let y=!m?.value&&typeof m?.value!="number"||m?.field?.admin?.disableListFilter,C=t_(async w=>{p(void 0),await u({andIndex:o,field:a.find(D=>D.value===w.value),operator:s,orIndex:i,value:void 0})},[o,s,i,a,u]),S=t_(async w=>{let _=e_(m.field.type)[w.value]||"any",A=_==="any"||typeof d===_||_==="boolean"&&(d==="true"||d==="false");A||p(void 0),await u({andIndex:o,field:m,operator:w.value,orIndex:i,value:A?d:void 0})},[o,m,i,u,d]);return Mn("div",{className:Bn,children:T1("div",{className:`${Bn}__wrap`,children:[T1("div",{className:`${Bn}__inputs`,children:[Mn("div",{className:`${Bn}__field`,children:Mn(mt,{disabled:y,isClearable:!1,onChange:C,options:a.filter(w=>!w.field.admin.disableListFilter),value:m||{value:m?.value}})}),Mn("div",{className:`${Bn}__operator`,children:Mn(mt,{disabled:y,isClearable:!1,onChange:S,options:m?.operators,value:m?.operators.find(w=>s===w.value)||null})}),Mn("div",{className:`${Bn}__value`,children:c||Mn(KR,{booleanSelect:b,disabled:!s||!m||m?.field?.admin?.disableListFilter,filterOptions:r,internalField:m,onChange:p,operator:s,options:v,value:h??""})})]}),T1("div",{className:`${Bn}__actions`,children:[Mn(ne,{buttonStyle:"icon-label",className:`${Bn}__actions-remove`,icon:"x",iconStyle:"with-border",onClick:()=>l({andIndex:o,orIndex:i}),round:!0}),Mn(ne,{buttonStyle:"icon-label",className:`${Bn}__actions-add`,icon:"plus",iconStyle:"with-border",onClick:()=>e({andIndex:o+1,field:a.find(w=>!w.field.admin?.disableListFilter),orIndex:i,relation:"and"}),round:!0})]})]})})};var E1=[{label:"equals",value:"equals"},{label:"isNotEqualTo",value:"not_equals"}],nr=[...E1,{label:"isIn",value:"in"},{label:"isNotIn",value:"not_in"},{label:"exists",value:"exists"}],r_=[...nr,{label:"isGreaterThan",value:"greater_than"},{label:"isLessThan",value:"less_than"},{label:"isLessThanOrEqualTo",value:"less_than_equal"},{label:"isGreaterThanOrEqualTo",value:"greater_than_equal"}],bV=[...E1,{label:"exists",value:"exists"},{label:"near",value:"near"}],n_={label:"within",value:"within"},s_={label:"intersects",value:"intersects"},du={label:"isLike",value:"like"},mu={label:"isNotLike",value:"not_like"},Wa={label:"contains",value:"contains"},vV={checkbox:{component:"Text",operators:E1},code:{component:"Text",operators:[...nr,du,mu,Wa]},date:{component:"Date",operators:[...nr,...r_]},email:{component:"Text",operators:[...nr,Wa]},json:{component:"Text",operators:[...nr,du,Wa,mu,n_,s_]},number:{component:"Number",operators:[...nr,...r_]},point:{component:"Point",operators:[...bV,n_,s_]},radio:{component:"Select",operators:[...nr]},relationship:{component:"Relationship",operators:[...nr]},richText:{component:"Text",operators:[...nr,du,mu,Wa]},select:{component:"Select",operators:[...nr]},text:{component:"Text",operators:[...nr,du,mu,Wa]},textarea:{component:"Text",operators:[...nr,du,mu,Wa]},upload:{component:"Text",operators:[...nr]}},Di=vV;import{getTranslation as Df}from"@payloadcms/translations";import{fieldIsHiddenOrDisabled as xV,fieldIsID as yV,tabHasName as CV}from"payload/shared";var Ha=({fields:t,i18n:e,labelPrefix:o,pathPrefix:n})=>t.reduce((r,s)=>{if(xV(s)&&!yV(s))return r;if(s.type==="tabs"&&"tabs"in s)return s.tabs.forEach(a=>{if(typeof a.label!="boolean"){let l=Df(a.label,e),c=o?o+" > "+l:l,u=CV(a)&&a.name?n?n+"."+a.name:a.name:n;typeof l=="string"&&r.push(...Ha({fields:a.fields,i18n:e,labelPrefix:c,pathPrefix:u}))}}),r;if(s.type==="row"&&"fields"in s)return r.push(...Ha({fields:s.fields,i18n:e,labelPrefix:o,pathPrefix:n})),r;if(s.type==="collapsible"&&"fields"in s){let i=Df(s.label||"",e),a=o?o+" > "+i:i;return r.push(...Ha({fields:s.fields,i18n:e,labelPrefix:a,pathPrefix:n})),r}if(s.type==="group"&&"fields"in s){let i=Df(s.label||"",e),a=o?i?o+" > "+i:o:i,l=s.name?n?n+"."+s.name:s.name:n;return r.push(...Ha({fields:s.fields,i18n:e,labelPrefix:a,pathPrefix:l})),r}if(typeof Di[s.type]=="object"){let i=new Set,a=Di[s.type].operators.reduce((f,m)=>{if(!i.has(m.value)){i.add(m.value);let h=`operators:${m.label}`;f.push({...m,label:e.t(h)})}return f},[]),l=Df(s.label||"",e),c=o?Nc({field:s,prefix:o}):l,u=n?Fa(n,s):s.name,d={label:c,value:u,...Di[s.type],field:s,operators:a};return r.push(d),r}return r},[]);var ln="where-builder",l_=t=>{let{collectionPluralLabel:e,fields:o,renderedFilters:n,resolvedFilterOptions:r}=t,{i18n:s,t:i}=k(),a=a_(()=>Ha({fields:o,i18n:s}),[o,s]),{handleWhereChange:l,query:c}=Rt(),u=a_(()=>{let h=c.where;if(h){if(i_(h))return h.or;let p=SV(h);if(i_(p))return p.or;console.warn(`Invalid where query in URL: ${JSON.stringify(h)}`)}return[]},[c.where]),d=Ff.useCallback(async({andIndex:h,field:p,orIndex:g,relation:b})=>{let v=[...u],x=Di[p.field.type].operators[0].value;b==="and"?v[g].and.splice(h,0,{[String(p.value)]:{[x]:void 0}}):v.push({and:[{[String(p.value)]:{[x]:void 0}}]}),await l({or:v})},[u,l]),f=Ff.useCallback(async({andIndex:h,field:p,operator:g,orIndex:b,value:v})=>{let x=u[b].and[h],y=Di[p.field.type],C=g||y.operators[0].value;if(typeof x=="object"&&p.value){let S=v??x?.[C],w=S!==x?.[String(p.value)]?.[String(C)],D=C!==Object.keys(x?.[String(p.value)]||{})?.[0];if(w||D){let _={[String(p.value)]:{[C]:S}},A=[...u];A[b].and[h]=_,await l({or:A})}}},[u,l]),m=Ff.useCallback(async({andIndex:h,orIndex:p})=>{let g=[...u];g[p].and.splice(h,1),g[p].and.length===0&&g.splice(p,1),await l({or:g})},[u,l]);return fu("div",{className:ln,children:[u.length>0&&fu(Ff.Fragment,{children:[Vn("div",{className:`${ln}__label`,children:i("general:filterWhere",{label:wV(e,s)})}),Vn("ul",{className:`${ln}__or-filters`,children:u.map((h,p)=>{let g=`${p}_${Array.isArray(h?.and)?h.and.length:""}`;return fu("li",{children:[p!==0&&Vn("div",{className:`${ln}__label`,children:i("general:or")}),Vn("ul",{className:`${ln}__and-filters`,children:Array.isArray(h?.and)&&h.and.map((b,v)=>{let x=u[p].and[v],y=Object.keys(x)[0],C=Object.keys(x?.[y]||{})?.[0]||void 0,S=x?.[y]?.[C]||void 0;return fu("li",{children:[v!==0&&Vn("div",{className:`${ln}__label`,children:i("general:and")}),Vn(o_,{addCondition:d,andIndex:v,fieldName:y,filterOptions:r?.get(y),operator:C,orIndex:p,reducedFields:a,removeCondition:m,RenderedFilter:n?.get(y),updateCondition:f,value:S})]},v)})})]},g)})}),Vn(ne,{buttonStyle:"icon-label",className:`${ln}__add-or`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{await d({andIndex:0,field:a[0],orIndex:u.length,relation:"or"})},children:i("general:or")})]}),u.length===0&&fu("div",{className:`${ln}__no-filters`,children:[Vn("div",{className:`${ln}__label`,children:i("general:noFiltersSet")}),Vn(ne,{buttonStyle:"icon-label",className:`${ln}__add-first-filter`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{a.length>0&&await d({andIndex:0,field:a.find(h=>!h.field.admin?.disableListFilter),orIndex:u.length,relation:"or"})},children:i("general:addFilter")})]})]})};import{c as IV}from"react/compiler-runtime";import{jsx as Af,jsxs as RV}from"react/jsx-runtime";import{getTranslation as _V}from"@payloadcms/translations";import{jsx as c_}from"react/jsx-runtime";import"react";var u_=({className:t})=>c_("svg",{className:["icon","icon--people",t].filter(Boolean).join(" "),height:"14",viewBox:"0 0 16 14",width:"16",xmlns:"http://www.w3.org/2000/svg",children:c_("path",{className:"stroke",d:"M12.0002 13C12.0002 11.5855 11.4383 10.229 10.4381 9.22876C9.43787 8.22857 8.08132 7.66667 6.66683 7.66667M6.66683 7.66667C5.25234 7.66667 3.89579 8.22857 2.89559 9.22876C1.8954 10.229 1.3335 11.5855 1.3335 13M6.66683 7.66667C8.50778 7.66667 10.0002 6.17428 10.0002 4.33333C10.0002 2.49238 8.50778 1 6.66683 1C4.82588 1 3.3335 2.49238 3.3335 4.33333C3.3335 6.17428 4.82588 7.66667 6.66683 7.66667ZM14.6668 12.3333C14.6668 10.0867 13.3335 8 12.0002 7C12.4384 6.67118 12.7889 6.23939 13.0205 5.74285C13.2522 5.2463 13.3578 4.70031 13.3282 4.1532C13.2985 3.60609 13.1344 3.07472 12.8505 2.60613C12.5665 2.13754 12.1714 1.74617 11.7002 1.46667",strokeLinecap:"square"})});var pu="active-query-preset";function d_(t){let e=IV(36),{activePreset:o,openPresetListDrawer:n,resetPreset:r}=t,{i18n:s,t:i}=k(),{getEntityConfig:a}=H(),l,c,u,d,f,m,h,p,g,b,v;if(e[0]!==o||e[1]!==a||e[2]!==s||e[3]!==n||e[4]!==i){let y=a({collectionSlug:"payload-query-presets"});c=RV,u=vt;let C=o&&`${pu}--active`,S;e[16]!==C?(S=[pu,C].filter(Boolean),e[16]=C,e[17]=S):S=e[17],p=S.join(" "),g="select-preset",e[18]!==n?(b=()=>{n()},e[18]=n,e[19]=b):b=e[19],v=o?"always-white":"light",e[20]!==o?.isShared?(h=o?.isShared&&Af(u_,{className:`${pu}__shared`}),e[20]=o?.isShared,e[21]=h):h=e[21],f=Af,m="div",l=`${pu}__label-text`,d=o?.title||i("general:selectLabel",{label:_V(y.labels.singular,s)}),e[0]=o,e[1]=a,e[2]=s,e[3]=n,e[4]=i,e[5]=l,e[6]=c,e[7]=u,e[8]=d,e[9]=f,e[10]=m,e[11]=h,e[12]=p,e[13]=g,e[14]=b,e[15]=v}else l=e[5],c=e[6],u=e[7],d=e[8],f=e[9],m=e[10],h=e[11],p=e[12],g=e[13],b=e[14],v=e[15];let x;return e[22]!==o||e[23]!==r||e[24]!==l||e[25]!==c||e[26]!==u||e[27]!==d||e[28]!==f||e[29]!==m||e[30]!==h||e[31]!==p||e[32]!==g||e[33]!==b||e[34]!==v?(x=c(u,{className:p,id:g,onClick:b,pillStyle:v,children:[h,f(m,{className:l,children:d}),o?Af("div",{className:`${pu}__clear`,id:"clear-preset",onClick:async y=>{y.stopPropagation(),await r()},onKeyDown:async y=>{y.stopPropagation(),await r()},role:"button",tabIndex:0,children:Af(pt,{})}):null]}),e[22]=o,e[23]=r,e[24]=l,e[25]=c,e[26]=u,e[27]=d,e[28]=f,e[29]=m,e[30]=h,e[31]=p,e[32]=g,e[33]=b,e[34]=v,e[35]=x):x=e[35],x}import{fieldAffectsData as DV,flattenTopLevelFields as FV}from"payload/shared";var m_=(t,e)=>t?FV(e).filter(n=>DV(n)&&t.includes(n.name)):null;import{jsx as Cr,jsxs as AV}from"react/jsx-runtime";import{getTranslation as P1}from"@payloadcms/translations";import{transformColumnsToPreferences as f_,transformColumnsToSearchParams as p_}from"payload/shared";import{Fragment as TV,useCallback as Tf,useMemo as h_}from"react";var g_="confirm-delete-preset",za="payload-query-presets",b_=({activePreset:t,collectionSlug:e,queryPresetPermissions:o})=>{let{modified:n,query:r,refineListData:s,setModified:i}=Rt(),{i18n:a,t:l}=k(),{openModal:c}=de(),{config:{routes:{api:u}},getEntityConfig:d}=H(),f=d({collectionSlug:za}),[m,,{openDrawer:h}]=Jt({id:t?.id,collectionSlug:za}),[p,,{closeDrawer:g,openDrawer:b}]=Jt({collectionSlug:za}),v=h_(()=>({"payload-query-presets":{relatedCollection:{equals:e}}}),[e]),[x,,{closeDrawer:y,openDrawer:C}]=ai({collectionSlugs:[za],filterOptions:v,selectedCollection:za}),S=Tf(async F=>{await s({columns:F.columns?p_(F.columns):void 0,preset:F.id,where:F.where},!1)},[s]),w=Tf(async()=>{await s({columns:void 0,preset:void 0,where:void 0},!1)},[s]),D=Tf(async()=>{try{await fetch(`${u}/${za}/${t.id}`,{method:"DELETE"}).then(async F=>{try{let R=await F.json();F.status<400?(fe.success(l("general:titleDeleted",{label:P1(f?.labels?.singular,a),title:t.title})),await w()):R.errors?R.errors.forEach(I=>fe.error(I.message)):fe.error(l("error:deletingTitle",{title:t.title}))}catch{fe.error(l("error:deletingTitle",{title:t.title}))}})}catch{fe.error(l("error:deletingTitle",{title:t.title}))}},[u,t?.id,t?.title,l,f,a,w]),_=Tf(async()=>{try{await fetch(`${u}/payload-query-presets/${t.id}`,{body:JSON.stringify({columns:f_(r.columns),where:r.where}),credentials:"include",headers:{"Content-Type":"application/json"},method:"PATCH"}).then(async F=>{try{let R=await F.json();F.status<400?(fe.success(l("general:updatedLabelSuccessfully",{label:P1(f?.labels?.singular,a)})),i(!1)):R.errors?R.errors.forEach(I=>fe.error(I.message)):fe.error(l("error:unknown"))}catch{fe.error(l("error:unknown"))}})}catch{fe.error(l("error:unknown"))}},[u,t?.id,r.columns,r.where,l,f?.labels?.singular,a,i]),A=h_(()=>{let F=[Cr($u,{label:P1(f?.labels?.plural,a)},"preset-group-label")];return t&&n&&(F.push(Cr(Me.Button,{onClick:async()=>{await s({columns:p_(t.columns),where:t.where},!1)},children:l("general:reset")})),o.update&&F.push(Cr(Me.Button,{onClick:async()=>{await _()},children:t.isShared?l("general:updateForEveryone"):l("general:save")}))),F.push(Cr(Me.Button,{onClick:()=>{b()},children:l("general:createNew")})),t&&o?.delete&&F.push(AV(TV,{children:[Cr(Me.Button,{onClick:()=>c(g_),children:l("general:delete")}),Cr(Me.Button,{onClick:()=>{h()},children:l("general:edit")})]})),F},[t,o?.delete,o?.update,b,h,c,_,l,s,n,f?.labels?.plural,a]);return{CreateNewPresetDrawer:Cr(p,{initialData:{columns:f_(r.columns),relatedCollection:e,where:r.where},onSave:async({doc:F})=>{g(),await S(F)},redirectAfterCreate:!1}),DeletePresetModal:Cr(It,{body:Cr(wi,{elements:{1:({children:F})=>Cr("strong",{children:F})},i18nKey:"general:aboutToDelete",t:l,variables:{label:f?.labels?.singular,title:t?.title}}),confirmingLabel:l("general:deleting"),heading:l("general:confirmDeletion"),modalSlug:g_,onConfirm:D}),EditPresetDrawer:Cr(m,{onDelete:()=>{},onDuplicate:async({doc:F})=>{await S(F)},onSave:async({doc:F})=>{await S(F)}}),hasModifiedPreset:n,openPresetListDrawer:C,PresetListDrawer:Cr(x,{allowCreate:!1,disableQueryPresets:!0,onSelect:async({doc:F})=>{y(),await S(F)}}),queryPresetMenuItems:A,resetPreset:w}};var Do="list-controls",N1=t=>{let{beforeActions:e,collectionConfig:o,collectionSlug:n,disableQueryPresets:r,enableColumns:s=!0,enableSort:i=!1,listMenuItems:a,queryPreset:l,queryPresetPermissions:c,renderedFilters:u,resolvedFilterOptions:d}=t,{handleSearchChange:f,query:m}=Rt(),{CreateNewPresetDrawer:h,DeletePresetModal:p,EditPresetDrawer:g,hasModifiedPreset:b,openPresetListDrawer:v,PresetListDrawer:x,queryPresetMenuItems:y,resetPreset:C}=b_({activePreset:l,collectionSlug:n,queryPresetPermissions:c}),S=Eb(o),{i18n:w,t:D}=k(),{breakpoints:{s:_}}=Co(),A=(S&&Xa("label"in S&&(typeof S.label=="string"||typeof S.label=="object")?S.label:"name"in S?S.name:null,w))??"ID",F=m_(o.admin.listSearchableFields,o.fields),R=y_(D("general:searchBy",{label:Xa(A,w)})),I=y_(!!m?.where),E=EV(m?.where),[T,$]=NV(E?"where":void 0);x_(()=>{I.current&&!m?.where?I.current=!1:m?.where&&(I.current=!0)},[$,m?.where]),x_(()=>{F?.length>0?R.current=F.reduce((N,P,L)=>{let V="label"in P&&P.label?P.label:"name"in P?P.name:null;return L===0?`${D("general:searchBy",{label:Xa(V,w)})}`:L===F.length-1?`${N} ${D("general:or")} ${Xa(V,w)}`:`${N}, ${Xa(V,w)}`},""):R.current=D("general:searchBy",{label:Xa(A,w)})},[D,F,w,A]);let j=a;return o?.enableQueryPresets&&!r&&y?.length>0&&(j=[...y,a?.length>0?Wt(Me.Divider,{},"divider"):null,...a||[]]),Ef(v_,{children:[Ef("div",{className:Do,children:[Ef("div",{className:`${Do}__wrap`,children:[Wt(Pl,{}),Wt(C1,{fieldName:S&&"name"in S?S?.name:null,handleChange:N=>void f(N),initialParams:m,label:R.current},n),l&&b?Wt("div",{className:`${Do}__modified`,children:"Modified"}):null,Wt("div",{className:`${Do}__buttons`,children:Ef("div",{className:`${Do}__buttons-wrap`,children:[!_&&Wt(PV.Fragment,{children:e&&e}),s&&Wt(vt,{"aria-controls":`${Do}-columns`,"aria-expanded":T==="columns",className:`${Do}__toggle-columns`,icon:Wt(Ze,{direction:T==="columns"?"up":"down"}),onClick:()=>$(T!=="columns"?"columns":void 0),pillStyle:"light",children:D("general:columns")}),Wt(vt,{"aria-controls":`${Do}-where`,"aria-expanded":T==="where",className:`${Do}__toggle-where`,icon:Wt(Ze,{direction:T==="where"?"up":"down"}),onClick:()=>$(T!=="where"?"where":void 0),pillStyle:"light",children:D("general:filters")}),i&&Wt(vt,{"aria-controls":`${Do}-sort`,"aria-expanded":T==="sort",className:`${Do}__toggle-sort`,icon:Wt(Ze,{}),onClick:()=>$(T!=="sort"?"sort":void 0),pillStyle:"light",children:D("general:sort")}),!r&&Wt(d_,{activePreset:l,openPresetListDrawer:v,resetPreset:C}),j&&Array.isArray(j)&&j.length>0&&Wt(ho,{button:Wt($R,{ariaLabel:D("general:moreOptions")}),className:`${Do}__popup`,horizontalAlign:"right",id:"list-menu",size:"large",verticalAlign:"bottom",children:Wt(Me.ButtonGroup,{children:j.map((N,P)=>Wt(v_,{children:N},`list-menu-item-${P}`))})})]})})]}),s&&Wt(Tr,{className:`${Do}__columns`,height:T==="columns"?"auto":0,id:`${Do}-columns`,children:Wt(cm,{collectionSlug:o.slug})}),Wt(Tr,{className:`${Do}__where`,height:T==="where"?"auto":0,id:`${Do}-where`,children:Wt(l_,{collectionPluralLabel:o?.labels?.plural,collectionSlug:o.slug,fields:o?.fields,renderedFilters:u,resolvedFilterOptions:d})})]}),x,g,h,p]})};import{c as HV}from"react/compiler-runtime";import{jsx as Fi,jsxs as A_}from"react/jsx-runtime";import{Fragment as zV}from"react";import{jsx as C_,jsxs as LV}from"react/jsx-runtime";import{getTranslation as w_}from"@payloadcms/translations";import{useRouter as $V,useSearchParams as kV}from"next/navigation.js";import*as I_ from"qs-esm";import jV,{useCallback as S_}from"react";var OV="publish-many",L1=t=>{let{clearRouteCache:e}=On(),{collection:{slug:o,labels:{plural:n,singular:r},versions:s}={}}=t,{config:{routes:{api:i},serverURL:a}}=H(),{permissions:l}=Ae(),{i18n:c,t:u}=k(),{getQueryParams:d,selectAll:f}=oo(),m=$V(),h=kV(),{openModal:p}=de(),b=l?.collections?.[o]?.update,v=`publish-${o}`,x=S_(()=>{fe.error(u("error:unknown"))},[u]),y=S_(async()=>{await Qe.patch(`${a}${i}/${o}${d({_status:{not_equals:"published"}})}&draft=true`,{body:JSON.stringify({_status:"published"}),headers:{"Accept-Language":c.language,"Content-Type":"application/json"}}).then(async C=>{try{let S=await C.json(),w=S?.docs.length||0,D=w>1?n:r;return C.status<400||w>0?(fe.success(u("general:updatedCountSuccessfully",{count:w,label:w_(D,c)})),S?.errors.length>0&&fe.error(S.message,{description:S.errors.map(_=>_.message).join(`
|
|
57
|
+
`)}),m.replace(I_.stringify({...jr(h),page:f?"1":void 0},{addQueryPrefix:!0})),e(),null):(S.errors?S.errors.forEach(_=>fe.error(_.message)):x(),!1)}catch{return x()}})},[a,i,o,d,c,n,r,u,m,h,f,e,x]);return!s?.drafts||f===xo.None||!b?null:LV(jV.Fragment,{children:[C_("button",{className:`${OV}__toggle`,onClick:()=>{p(v)},type:"button",children:u("version:publish")}),C_(It,{body:u("version:aboutToPublishSelection",{label:w_(n,c)}),cancelLabel:u("general:cancel"),confirmingLabel:u("version:publishing"),confirmLabel:u("general:confirm"),heading:u("version:confirmPublish"),modalSlug:v,onConfirm:y})]})};import{jsx as R_,jsxs as MV}from"react/jsx-runtime";import{getTranslation as __}from"@payloadcms/translations";import{useRouter as BV,useSearchParams as VV}from"next/navigation.js";import*as F_ from"qs-esm";import GV,{useCallback as D_}from"react";var WV="unpublish-many",$1=t=>{let{collection:{slug:e,labels:{plural:o,singular:n},versions:r}={}}=t,{config:{routes:{api:s},serverURL:i}}=H(),{permissions:a}=Ae(),{toggleModal:l}=de(),{i18n:c,t:u}=k(),d=VV(),{getQueryParams:f,selectAll:m}=oo(),h=BV(),{clearRouteCache:p}=On(),b=a?.collections?.[e]?.update,v=`unpublish-${e}`,x=D_(()=>{fe.error(u("error:unknown"))},[u]),y=D_(async()=>{await Qe.patch(`${i}${s}/${e}${f({_status:{not_equals:"draft"}})}`,{body:JSON.stringify({_status:"draft"}),headers:{"Accept-Language":c.language,"Content-Type":"application/json"}}).then(async C=>{try{let S=await C.json(),w=S?.docs.length||0,D=w>1?o:n;return C.status<400||w>0?(fe.success(u("general:updatedCountSuccessfully",{count:w,label:__(D,c)})),S?.errors.length>0&&fe.error(S.message,{description:S.errors.map(_=>_.message).join(`
|
|
58
|
+
`)}),h.replace(F_.stringify({...jr(d),page:m?"1":void 0},{addQueryPrefix:!0})),p(),null):(S.errors?S.errors.forEach(_=>fe.error(_.message)):x(),!1)}catch{return x()}})},[i,s,e,f,c,o,n,u,h,d,m,p,x]);return!r?.drafts||m===xo.None||!b?null:MV(GV.Fragment,{children:[R_("button",{className:`${WV}__toggle`,onClick:()=>{l(v)},type:"button",children:u("version:unpublish")}),R_(It,{body:u("version:aboutToUnpublishSelection",{label:__(o,c)}),confirmingLabel:u("version:unpublishing"),heading:u("version:confirmUnpublish"),modalSlug:v,onConfirm:y})]})};var T_="list-selection",hu=t=>{let e=HV(10),{collectionConfig:o,disableBulkDelete:n,disableBulkEdit:r,label:s}=t,{count:i,selectAll:a,toggleAll:l,totalDocs:c}=oo(),{t:u}=k();if(i===0)return null;let d;return e[0]!==o||e[1]!==i||e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==a||e[6]!==u||e[7]!==l||e[8]!==c?(d=A_("div",{className:T_,children:[Fi("span",{children:u("general:selectedCount",{count:i,label:""})}),a!==xo.AllAvailable&&i<c&&Fi("button",{"aria-label":u("general:selectAll",{count:i,label:s}),className:`${T_}__button`,id:"select-all-across-pages",onClick:()=>l(!0),type:"button",children:u("general:selectAll",{count:c,label:""})}),!r&&!n&&Fi("span",{children:"\u2014"}),!r&&A_(zV,{children:[Fi(b1,{collection:o}),Fi(L1,{collection:o}),Fi($1,{collection:o})]}),!n&&Fi(i1,{collection:o})]}),e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=a,e[6]=u,e[7]=l,e[8]=c,e[9]=d):d=e[9],d};import{jsx as sr,jsxs as Ua,Fragment as XV}from"react/jsx-runtime";import{getTranslation as Ya}from"@payloadcms/translations";import"react";var E_="list-header",Ai="list-drawer",UV=({className:t,collectionConfig:e,Description:o,disableBulkDelete:n,disableBulkEdit:r,hasCreatePermission:s,i18n:i,isBulkUploadEnabled:a,newDocumentURL:l,openBulkUpload:c,smallBreak:u,t:d})=>Ua("header",{className:[E_,t].filter(Boolean).join(" "),children:[sr("h1",{children:Ya(e?.labels?.plural,i)}),s&&Ua(XV,{children:[sr(ne,{"aria-label":i.t("general:createNewLabel",{label:Ya(e?.labels?.singular,i)}),buttonStyle:"pill",el:"link",size:"small",to:l,children:i.t("general:createNew")}),a&&sr(ne,{"aria-label":d("upload:bulkUpload"),buttonStyle:"pill",onClick:c,size:"small",children:d("upload:bulkUpload")})]}),!u&&sr(hu,{collectionConfig:e,disableBulkDelete:n,disableBulkEdit:r,label:Ya(e?.labels?.plural,i)}),o]}),YV=({Description:t,hasCreatePermission:e,i18n:o,t:n})=>{let{config:{collections:r},getEntityConfig:s}=H(),{closeModal:i}=de(),{DocumentDrawerToggler:a,drawerSlug:l,enabledCollections:c,selectedOption:u,setSelectedOption:d}=en(),f=s({collectionSlug:u.value}),m=r.filter(({slug:p})=>c.includes(p)),h=c.length>1;return Ua("header",{className:`${Ai}__header`,children:[Ua("div",{className:`${Ai}__header-wrap`,children:[Ua("div",{className:`${Ai}__header-content`,children:[sr("h2",{className:`${Ai}__header-text`,children:Ya(f?.labels?.plural,o)}),e&&sr(a,{className:`${Ai}__create-new-button`,children:sr(vt,{children:n("general:createNew")})})]}),sr("button",{"aria-label":n("general:close"),className:`${Ai}__header-close`,onClick:()=>{i(l)},type:"button",children:sr(pt,{})})]}),t,h&&Ua("div",{className:`${Ai}__select-collection-wrap`,children:[sr(xe,{label:n("upload:selectCollectionToBrowse")}),sr(mt,{className:`${E_}__select-collection`,onChange:d,options:m.map(p=>({label:Ya(p.labels.singular,o),value:p.slug})),value:{label:Ya(f?.labels.singular,o),value:f?.slug}})]})]})},k1=t=>{let{isInDrawer:e}=en();return e?sr(YV,{...t}):sr(UV,{...t})};import{c as ZV}from"react/compiler-runtime";import{jsx as N_}from"react/jsx-runtime";import{formatAdminURL as JV}from"payload/shared";import"react";import{jsx as P_}from"react/jsx-runtime";import"react";var j1=()=>P_("svg",{className:"icon icon--logout",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:P_("path",{className:"stroke",d:"M12 16H14.6667C15.0203 16 15.3594 15.8595 15.6095 15.6095C15.8595 15.3594 16 15.0203 16 14.6667V5.33333C16 4.97971 15.8595 4.64057 15.6095 4.39052C15.3594 4.14048 15.0203 4 14.6667 4H12M7.33333 13.3333L4 10M4 10L7.33333 6.66667M4 10H12",strokeLinecap:"square"})});var qV="nav",QV=t=>{let e=ZV(5),{tabIndex:o}=t,n=o===void 0?0:o,{t:r}=k(),{config:s}=H(),{admin:i,routes:a}=s,{routes:l}=i,{logout:c}=l,{admin:u}=a,d;return e[0]!==u||e[1]!==c||e[2]!==r||e[3]!==n?(d=N_(no,{"aria-label":r("authentication:logOut"),className:`${qV}__log-out`,href:JV({adminRoute:u,path:c}),prefetch:!1,tabIndex:n,title:r("authentication:logOut"),children:N_(j1,{})}),e[0]=u,e[1]=c,e[2]=r,e[3]=n,e[4]=d):d=e[4],d};import{c as KV}from"react/compiler-runtime";import{jsx as Za,jsxs as L_}from"react/jsx-runtime";import eG,{useState as $_}from"react";var Is="nav-group",tG="nav",oG=t=>{let e=KV(21),{children:o,isOpen:n,label:r}=t,[s,i]=$_(typeof n<"u"?!n:!1),[a,l]=$_(!1),{setPreference:c}=Fo(),{navOpen:u}=Ii();if(r){let f;e[0]!==s||e[1]!==r||e[2]!==c?(f=()=>{l(!0);let D={};D?.[r]?D[r].open=!!s:D[r]={open:!!s},c(tG,{groups:D},!0),i(!s)},e[0]=s,e[1]=r,e[2]=c,e[3]=f):f=e[3];let m=f,h=`${r}`,p=s&&`${Is}--collapsed`,g;e[4]!==h||e[5]!==p?(g=[`${Is}`,h,p].filter(Boolean),e[4]=h,e[5]=p,e[6]=g):g=e[6];let b=g.join(" "),v=`nav-group-${r}`,x=`${Is}__toggle--${s?"collapsed":"open"}`,y;e[7]!==x?(y=[`${Is}__toggle`,x].filter(Boolean),e[7]=x,e[8]=y):y=e[8];let C=y.join(" "),S=u?0:-1,w;return e[9]!==a||e[10]!==o||e[11]!==s||e[12]!==r||e[13]!==S||e[14]!==b||e[15]!==v||e[16]!==C||e[17]!==m?(w=L_("div",{className:b,id:v,children:[L_("button",{className:C,onClick:m,tabIndex:S,type:"button",children:[Za("div",{className:`${Is}__label`,children:r}),Za("div",{className:`${Is}__indicator`,children:Za(Ze,{className:`${Is}__indicator`,direction:s?void 0:"up"})})]}),Za(Tr,{duration:a?200:0,height:s?0:"auto",children:Za("div",{className:`${Is}__content`,children:o})})]}),e[9]=a,e[10]=o,e[11]=s,e[12]=r,e[13]=S,e[14]=b,e[15]=v,e[16]=C,e[17]=m,e[18]=w):w=e[18],w}let d;return e[19]!==o?(d=Za(eG.Fragment,{children:o}),e[19]=o,e[20]=d):d=e[20],d};import{c as rG}from"react/compiler-runtime";import{jsx as Rs,jsxs as k_}from"react/jsx-runtime";import{collectionDefaults as nG,isNumber as sG}from"payload/shared";import"react";var Ja="per-page",iG=nG.admin.pagination.limits,O1=t=>{let e=rG(9),{defaultLimit:o,handleChange:n,limit:r,limits:s}=t,i=o===void 0?10:o,a=s===void 0?iG:s,{t:l}=k(),c=sG(r)?r:i,u;if(e[0]!==n||e[1]!==c||e[2]!==a||e[3]!==l){let d;e[5]!==n||e[6]!==c||e[7]!==a?(d=f=>{let{close:m}=f;return Rs(Me.ButtonGroup,{children:a.map((h,p)=>k_(Me.Button,{className:[`${Ja}__button`,h===c&&`${Ja}__button-active`].filter(Boolean).join(" "),onClick:()=>{m(),n&&n(h)},children:[h===c&&Rs("div",{className:`${Ja}__chevron`,children:Rs(Ze,{direction:"right",size:"small"})}),"\xA0",Rs("span",{children:h})]},p))})},e[5]=n,e[6]=c,e[7]=a,e[8]=d):d=e[8],u=Rs("div",{className:Ja,children:Rs(ho,{button:k_("div",{className:`${Ja}__base-button`,children:[Rs("span",{children:l("general:perPage",{limit:c})}),"\xA0",Rs(Ze,{className:`${Ja}__icon`})]}),horizontalAlign:"right",render:d,size:"small"})}),e[0]=n,e[1]=c,e[2]=a,e[3]=l,e[4]=u}else u=e[4];return u};import{c as cG}from"react/compiler-runtime";import{jsx as Nf}from"react/jsx-runtime";import{Fragment as O_}from"react";import{jsxs as aG}from"react/jsx-runtime";import"react";function j_(t){return t===void 0||typeof t=="number"?t:decodeURIComponent(t)}var lG="id-label",Pf=({id:t,className:e,prefix:o="ID:"})=>aG("div",{className:[lG,e].filter(Boolean).join(" "),title:t,children:[o,"\xA0",j_(t)]});var M1="render-title",B1=t=>{let e=cG(10),{className:o,element:n,fallback:r,title:s}=t,i=n===void 0?"h1":n,{id:a,isInitializing:l,title:c}=Pe(),u=s||c||r,d=u===a,f=i,m;if(e[0]!==f||e[1]!==o||e[2]!==a||e[3]!==d||e[4]!==l||e[5]!==u){let h=Nf(O_,{children:"\xA0"}),p=d&&`${M1}--has-id`,g;e[7]!==o||e[8]!==p?(g=[o,M1,p].filter(Boolean),e[7]=o,e[8]=p,e[9]=g):g=e[9],m=Nf(f,{className:g.join(" "),title:u,children:l?h:Nf(O_,{children:d?Nf(Pf,{className:`${M1}__id`,id:a}):u||h})}),e[0]=f,e[1]=o,e[2]=a,e[3]=d,e[4]=l,e[5]=u,e[6]=m}else m=e[6];return m};import{c as uG}from"react/compiler-runtime";import{jsx as qa,jsxs as M_}from"react/jsx-runtime";import"react";var cn="sort-column",dG=t=>{let e=uG(22),{name:o,appearance:n,disable:r,Label:s,label:i}=t,a=r===void 0?!1:r,{handleSortChange:l,query:c}=Rt(),{t:u}=k(),{sort:d}=c,f=`-${o}`,m=o,h;e[0]!==m||e[1]!==d?(h=[`${cn}__asc`],d===m&&h.push(`${cn}--active`),e[0]=m,e[1]=d,e[2]=h):h=e[2];let p;e[3]!==f||e[4]!==d?(p=[`${cn}__desc`],d===f&&p.push(`${cn}--active`),e[3]=f,e[4]=d,e[5]=p):p=e[5];let g=n&&`${cn}--appearance-${n}`,b;e[6]!==g?(b=[cn,g].filter(Boolean),e[6]=g,e[7]=b):b=e[7];let v=b.join(" "),x;e[8]!==s||e[9]!==i?(x=s??qa(xe,{hideLocale:!0,label:i,unstyled:!0}),e[8]=s,e[9]=i,e[10]=x):x=e[10];let y;return e[11]!==m||e[12]!==h||e[13]!==f||e[14]!==p||e[15]!==a||e[16]!==l||e[17]!==i||e[18]!==u||e[19]!==v||e[20]!==x?(y=M_("div",{className:v,children:[qa("span",{className:`${cn}__label`,children:x}),!a&&M_("div",{className:`${cn}__buttons`,children:[qa("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:ascending"),label:i}),className:[...h,`${cn}__button`].filter(Boolean).join(" "),onClick:()=>void l(m),type:"button",children:qa(Ze,{direction:"up"})}),qa("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:descending"),label:i}),className:[...p,`${cn}__button`].filter(Boolean).join(" "),onClick:()=>void l(f),type:"button",children:qa(Ze,{})})]})]}),e[11]=m,e[12]=h,e[13]=f,e[14]=p,e[15]=a,e[16]=l,e[17]=i,e[18]=u,e[19]=v,e[20]=x,e[21]=y):y=e[21],y};import{jsx as B_}from"react/jsx-runtime";import"react";var mG=t=>{let{className:e}=t;return B_("svg",{className:[e,"icon icon--externalLink"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:B_("path",{className:"stroke",d:"M16 10.6667V14.6667C16 15.0203 15.8595 15.3594 15.6095 15.6095C15.3594 15.8595 15.0203 16 14.6667 16H5.33333C4.97971 16 4.64057 15.8595 4.39052 15.6095C4.14048 15.3594 4 15.0203 4 14.6667V5.33333C4 4.97971 4.14048 4.64057 4.39052 4.39052C4.64057 4.14048 4.97971 4 5.33333 4H9.33333M16 4L10 10M16 4H12M16 4V8",strokeLinecap:"square"})})};import{jsx as V_}from"react/jsx-runtime";import"react";var fG=()=>V_("svg",{"aria-hidden":"true",className:"graphic code-block-icon",focusable:"false",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:V_("path",{className:"stroke",d:"M14 12.6667L16.6667 9.99999L14 7.33332M5.99999 7.33332L3.33333 9.99999L5.99999 12.6667M11.6667 4.66666L8.33333 15.3333",strokeLinecap:"square"})});import{jsx as V1}from"react/jsx-runtime";import"react";var G1="minimize-maximize",pG=({className:t,isMinimized:e})=>{let o=[G1,e?`${G1}--minimized`:`${G1}--maximized`,t].filter(Boolean).join(" ");return V1("svg",{className:o,height:"20",stroke:"currentColor",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:e?V1("path",{d:"M7.33333 4H5.33333C4.97971 4 4.64057 4.14048 4.39052 4.39052C4.14048 4.64057 4 4.97971 4 5.33333V7.33333M16 7.33333V5.33333C16 4.97971 15.8595 4.64057 15.6095 4.39052C15.3594 4.14048 15.0203 4 14.6667 4H12.6667M4 12.6667V14.6667C4 15.0203 4.14048 15.3594 4.39052 15.6095C4.64057 15.8595 4.97971 16 5.33333 16H7.33333M12.6667 16H14.6667C15.0203 16 15.3594 15.8595 15.6095 15.6095C15.8595 15.3594 16 15.0203 16 14.6667V12.6667"}):V1("path",{d:"M7.33333 4V6C7.33333 6.35362 7.19286 6.69276 6.94281 6.94281C6.69276 7.19286 6.35362 7.33333 6 7.33333H4M16 7.33333H14C13.6464 7.33333 13.3072 7.19286 13.0572 6.94281C12.8071 6.69276 12.6667 6.35362 12.6667 6V4M4 12.6667H6C6.35362 12.6667 6.69276 12.8071 6.94281 13.0572C7.19286 13.3072 7.33333 13.6464 7.33333 14V16M12.6667 16V14C12.6667 13.6464 12.8071 13.3072 13.0572 13.0572C13.3072 12.8071 13.6464 12.6667 14 12.6667H16"})})};import{jsx as G_,jsxs as hG}from"react/jsx-runtime";import"react";var W1=()=>hG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[G_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-error-500)"}),G_("path",{d:"M15.4001 10.5996L10.6001 15.3996M10.6001 10.5996L15.4001 15.3996",stroke:"var(--theme-error-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as W_,jsxs as gG}from"react/jsx-runtime";import"react";var H1=()=>gG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[W_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-elevation-500)"}),W_("path",{d:"M13 16.1998V12.9998M13 9.7998H13.0077",stroke:"var(--theme-elevation-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as H_,jsxs as bG}from"react/jsx-runtime";import"react";var z1=()=>bG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[H_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-success-500)"}),H_("path",{d:"M10.6001 13.0004L12.2001 14.6004L15.4001 11.4004",stroke:"var(--theme-success-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as z_,jsxs as vG}from"react/jsx-runtime";import"react";var X1=()=>vG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[z_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-warning-500)"}),z_("path",{d:"M13 10V13.2M13 16.4H13.008",stroke:"var(--theme-warning-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{c as U_}from"react/compiler-runtime";import{jsx as X_}from"react/jsx-runtime";import Qa from"react";var Y_=Qa.createContext({addClientFunction:()=>null,removeClientFunction:()=>null}),Z_=Qa.createContext({}),U1=t=>{let e=U_(6),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=Qa.useState(n),i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=d=>{s(f=>{let m={...f};return m[d.key]=d.func,m})},e[1]=i):i=e[1];let a=i,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=d=>{s(f=>{let m={...f};return delete m[d.key],m})},e[2]=l):l=e[2];let c=l,u;return e[3]!==o||e[4]!==r?(u=X_(Y_,{value:{addClientFunction:a,removeClientFunction:c},children:X_(Z_,{value:r,children:o})}),e[3]=o,e[4]=r,e[5]=u):u=e[5],u},xG=(t,e)=>{let o=U_(6),{addClientFunction:n,removeClientFunction:r}=Qa.use(Y_),s,i;o[0]!==n||o[1]!==e||o[2]!==t||o[3]!==r?(s=()=>(n({func:e,key:t}),()=>{r({func:e,key:t})}),i=[e,t,n,r],o[0]=n,o[1]=e,o[2]=t,o[3]=r,o[4]=s,o[5]=i):(s=o[4],i=o[5]),Qa.useEffect(s,i)},yG=()=>Qa.use(Z_);import{c as CG}from"react/compiler-runtime";import{jsx as J_}from"react/jsx-runtime";import wG,{useEffect as SG,useRef as IG}from"react";var q_=200,Y1="progress-bar",RG=150,_G=()=>{let t=CG(9),{isTransitioning:e,transitionProgress:o}=st(),[n,r]=wG.useState(null),s=IG(!0),i,a;if(t[0]!==e||t[1]!==o?(i=()=>{let l,c;return e?s.current?c=setTimeout(()=>{r(o),s.current=!1},RG):r(o):(s.current=!0,r(1),l=setTimeout(()=>{r(null)},q_*2)),()=>{clearTimeout(l),clearTimeout(c)}},a=[e,o],t[0]=e,t[1]=o,t[2]=i,t[3]=a):(i=t[2],a=t[3]),SG(i,a),typeof n=="number"){let l=n===1&&`${Y1}--fade-out`,c;t[4]!==l?(c=[Y1,l].filter(Boolean),t[4]=l,t[5]=c):c=t[5];let u=c.join(" "),d;return t[6]!==n||t[7]!==u?(d=J_("div",{className:u,style:{"--transition-duration":`${q_}ms`},children:J_("div",{className:`${Y1}__progress`,style:{width:`${(n||0)*100}%`}})}),t[6]=n,t[7]=u,t[8]=d):d=t[8],d}return null};import{c as DG}from"react/compiler-runtime";import{jsx as FG}from"react/jsx-runtime";import{createContext as AG,use as TG}from"react";var Q_=AG({}),EG=t=>{let e=DG(6),{children:o,visibleEntities:n}=t,r;e[0]!==n?(r=a=>{let{collectionSlug:l,globalSlug:c}=a;return l?n.collections.includes(l):c?n.globals.includes(c):!1},e[0]=n,e[1]=r):r=e[1];let s=r,i;return e[2]!==o||e[3]!==s||e[4]!==n?(i=FG(Q_,{value:{isEntityVisible:s,visibleEntities:n},children:o}),e[2]=o,e[3]=s,e[4]=n,e[5]=i):i=e[5],i},Z1=()=>TG(Q_);import{c as PG}from"react/compiler-runtime";import{jsx as NG}from"react/jsx-runtime";import{useParams as LG}from"next/navigation.js";import{createContext as $G,use as kG}from"react";var K_=$G({}),J1=t=>{let e=PG(3),{children:o}=t,n=LG(),r;return e[0]!==o||e[1]!==n?(r=NG(K_,{value:n,children:o}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r},jG=()=>kG(K_);import{jsx as kt,jsxs as rD}from"react/jsx-runtime";import IMe,{Fragment as RMe}from"react";import{useContext as MG}from"react";import{createContext as OG}from"react";var gu=OG({});var bu=()=>MG(gu);import BG,{useCallback as VG,useEffect as GG,useReducer as WG,useRef as HG}from"react";var zG=(t,e)=>{let{timestamp:o,animationRef:n}=e;n.current=null;let{x:r,y:s,xDirection:i,yDirection:a,eventsFired:l,hasScrolled:c}=t,u=c||!!o,d=u?window.pageXOffset:0,f=u?window.pageYOffset:0,m=u?l+1:l,h=d-r,p=f-s,g=d/(document.body.scrollWidth-window.innerWidth)*100,b=f/(document.body.scrollHeight-window.innerHeight)*100,v=(g+b)/2,x=h>0?"right":h<0?"left":i,y=p>0?"down":p<0?"up":a;return{x:d,y:f,xDifference:h,yDifference:p,xDirection:x,yDirection:y,xPercentage:g,yPercentage:b,totalPercentage:v,eventsFired:m,hasScrolled:u}},vu=t=>{let{children:e}=t,o=HG(null),[n,r]=WG(zG,{x:0,y:0,xDifference:0,yDifference:0,xDirection:void 0,yDirection:void 0,xPercentage:0,yPercentage:0,totalPercentage:0,eventsFired:0,hasScrolled:!1}),s=VG(i=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(a=>{r({e:i,timestamp:a,animationRef:o})})},[]);return GG(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[s]),BG.createElement(gu.Provider,{value:Object.assign({},n)},e&&e)};import PMe from"react";import{Fragment as nD}from"react";var{WindowInfoProvider:q1}=Xn&&"WindowInfoProvider"in Xn?Xn:{WindowInfoProvider:void 0},{useWindowInfo:Q1}=Xn&&"useWindowInfo"in Xn?Xn:{useWindowInfo:void 0};import{jsx as XG}from"react/jsx-runtime";import{useSearchParams as UG}from"next/navigation.js";import*as Lf from"qs-esm";import eD,{createContext as YG,use as ZG}from"react";var JG={searchParams:{},stringifyParams:()=>""},tD=YG(JG),K1=({children:t})=>{let o=UG().toString(),n=eD.useMemo(()=>Lf.parse(o,{depth:10,ignoreQueryPrefix:!0}),[o]),r=eD.useCallback(({params:s,replace:i=!1})=>Lf.stringify({...i?{}:n,...s},{addQueryPrefix:!0}),[n]);return XG(tD,{value:{searchParams:n,stringifyParams:r},children:t})},qG=()=>ZG(tD);import{jsx as xu}from"react/jsx-runtime";import"react";var oD=()=>xu(H0,{className:"payload-toast-container",closeButton:!0,dir:"undefined",gap:8,icons:{error:xu(W1,{}),info:xu(H1,{}),success:xu(z1,{}),warning:xu(X1,{})},offset:"calc(var(--gutter-h) / 2)",toastOptions:{classNames:{closeButton:"payload-toast-close-button",content:"toast-content",error:"toast-error",icon:"toast-icon",info:"toast-info",success:"toast-success",title:"toast-title",toast:"payload-toast-item",warning:"toast-warning"},unstyled:!0},visibleToasts:5});var QG=({children:t,config:e,dateFNSKey:o,fallbackLang:n,isNavOpen:r,languageCode:s,languageOptions:i,locale:a,permissions:l,serverFunction:c,switchLanguageServerAction:u,theme:d,translations:f,user:m})=>{let h=process.env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH==="true"?o1:nD;return rD(nD,{children:[kt(vg,{serverFunction:c,children:kt(ap,{children:kt(h,{children:kt(Wf,{config:e,children:kt(U1,{children:kt(Gf,{dateFNSKey:o,fallbackLang:n,language:s,languageOptions:i,switchLanguageServerAction:u,translations:f,children:kt(q1,{breakpoints:{l:"(max-width: 1440px)",m:"(max-width: 1024px)",s:"(max-width: 768px)",xs:"(max-width: 400px)"},children:kt(vu,{children:kt(K1,{children:kt(Lp,{classPrefix:"payload",transTime:0,zIndex:"var(--z-modal)",children:rD(Gp,{permissions:l,user:m,children:[kt(zp,{children:kt(zf,{theme:d,children:kt(J1,{children:kt(Xp,{locale:a,children:kt(Kb,{children:kt(n3,{children:kt(pb,{children:kt(j4,{initialIsOpen:r,children:kt(ob,{children:t})})})})})})})})}),kt(Ep,{}),kt(Y0,{})]})})})})})})})})})})}),kt(oD,{})]})};import{jsx as sD,jsxs as KG}from"react/jsx-runtime";import{email as eW,username as tW}from"payload/shared";import"react";function ev(t){let{className:e,loginWithUsername:o,readOnly:n,t:r}=t,s=!o||o?.requireEmail||o?.allowEmailLogin,i=!!o;return KG("div",{className:e,children:[s?sD(oi,{field:{name:"email",admin:{autoComplete:"off"},label:r("general:email"),required:!o||o&&o.requireEmail},path:"email",readOnly:n,schemaPath:"email",validate:eW}):null,i&&sD(di,{field:{name:"username",label:r("authentication:username"),required:o&&o.requireUsername},path:"username",readOnly:n,schemaPath:"username",validate:tW})]})}import{c as oW}from"react/compiler-runtime";import{jsx as rW}from"react/jsx-runtime";import"react";var iD="select-all",nW=()=>{let t=oW(7),{selectAll:e,toggleAll:o}=oo(),{i18n:n}=k(),r;if(t[0]!==n||t[1]!==e||t[2]!==o){let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=[iD,`${iD}__checkbox`],t[4]=s):s=t[4];let i;t[5]!==o?(i=()=>o(),t[5]=o,t[6]=i):i=t[6],r=rW(Hs,{"aria-label":e===xo.None?n.t("general:selectAllRows"):n.t("general:deselectAllRows"),checked:e===xo.AllInPage||e===xo.AllAvailable,className:s.join(" "),id:"select-all",name:"select-all",onToggle:i,partialChecked:e===xo.Some}),t[0]=n,t[1]=e,t[2]=o,t[3]=r}else r=t[3];return r};import{c as sW}from"react/compiler-runtime";import{jsx as aD}from"react/jsx-runtime";import"react";var lD="select-row",iW=t=>{let e=sW(14),{rowData:o}=t,{user:n}=Ae(),{selected:r,setSelection:s}=oo(),i;e[0]!==o?(i=o||{},e[0]=o,e[1]=i):i=e[1];let{_isLocked:a,_userEditing:l}=i;if(a&&l&&l.id!==n?.id){let p;return e[2]!==l?(p=aD(lu,{user:l}),e[2]=l,e[3]=p):p=e[3],p}let u;e[4]!==o.id||e[5]!==r?(u=r.get(o.id),e[4]=o.id,e[5]=r,e[6]=u):u=e[6];let d=!!u,f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=[lD,`${lD}__checkbox`],e[7]=f):f=e[7];let m;e[8]!==o.id||e[9]!==s?(m=()=>s(o.id),e[8]=o.id,e[9]=s,e[10]=m):m=e[10];let h;return e[11]!==d||e[12]!==m?(h=aD(Hs,{checked:d,className:f.join(" "),onToggle:m}),e[11]=d,e[12]=m,e[13]=h):h=e[13],h};import{jsx as aW}from"react/jsx-runtime";import"react";var Ka=t=>{let{onClick:e}=t,{count:o,selected:n}=oo();return!n||!o?null:aW(vt,{onClick:()=>{typeof e=="function"&&e(n)},pillStyle:"white",children:`Select ${o}`})};import{c as lW}from"react/compiler-runtime";import{jsx as Ht,jsxs as Ti}from"react/jsx-runtime";import{getTranslation as $f}from"@payloadcms/translations";import{useRouter as cW}from"next/navigation.js";import{formatFilesize as uW,isNumber as dW}from"payload/shared";import{Fragment as tv,useEffect as cD,useState as mW}from"react";var Gn="collection-list";function fW(t){let e=lW(17),{AfterList:o,AfterListTable:n,beforeActions:r,BeforeList:s,BeforeListTable:i,collectionSlug:a,columnState:l,Description:c,disableBulkDelete:u,disableBulkEdit:d,disableQueryPresets:f,enableRowSelections:m,hasCreatePermission:h,listMenuItems:p,newDocumentURL:g,queryPreset:b,queryPresetPermissions:v,renderedFilters:x,resolvedFilterOptions:y,Table:C}=t,[S,w]=mW(C),{allowCreate:D,createNewDrawerSlug:_,drawerSlug:A,onBulkSelect:F}=en(),R=D!==void 0?D&&h:h,I,E;e[0]!==C?(I=()=>{C&&w(C)},E=[C],e[0]=C,e[1]=I,e[2]=E):(I=e[1],E=e[2]),cD(I,E);let{user:T}=Ae(),{getEntityConfig:$}=H(),j=cW(),{data:N,defaultLimit:P,handlePageChange:L,handlePerPageChange:V,query:M}=Rt(),{openModal:O}=de(),{setCollectionSlug:B,setCurrentActivePath:G,setOnSuccess:X}=Ho(),{drawerSlug:Z}=Ho(),te=$({collectionSlug:a}),{labels:U,upload:z}=te,ce=!!z,J=ce&&te.upload.bulkUpload,ue=!!A,{i18n:re,t:q}=k(),{setStepNav:pe}=jn(),{breakpoints:he}=Q1(),{s:_e}=he,ge;if(ce){let ae;e[3]!==N.docs?(ae=N.docs.map(pW),e[3]=N.docs,e[4]=ae):ae=e[4],ge=ae}else ge=N.docs;let Ve=ge,Q;e[5]!==Z||e[6]!==a||e[7]!==O||e[8]!==j||e[9]!==B||e[10]!==G||e[11]!==X?(Q=()=>{B(a),G(a),O(Z),X(a,()=>j.refresh())},e[5]=Z,e[6]=a,e[7]=O,e[8]=j,e[9]=B,e[10]=G,e[11]=X,e[12]=Q):Q=e[12];let Le=Q;cD(()=>{ue||pe([{label:U?.plural}])},[pe,U,ue]);let De;return e[13]!==r||e[14]!==m||e[15]!==F?(De=m&&typeof F=="function"?r?[...r,Ht(Ka,{onClick:F},"select-many")]:[Ht(Ka,{onClick:F},"select-many")]:r,e[13]=r,e[14]=m,e[15]=F,e[16]=De):De=e[16],Ht(tv,{children:Ht(sc,{collectionSlug:a,columnState:l,children:Ht("div",{className:`${Gn} ${Gn}--${a}`,children:Ti(s1,{docs:Ve,totalDocs:N.totalDocs,user:T,children:[s,Ti(Bo,{className:`${Gn}__wrap`,children:[Ht(k1,{collectionConfig:te,Description:Ht("div",{className:`${Gn}__sub-header`,children:Ht(oe,{CustomComponent:c,Fallback:Ht(Bb,{collectionSlug:a,description:te?.admin?.description})})}),disableBulkDelete:u,disableBulkEdit:d,hasCreatePermission:R,i18n:re,isBulkUploadEnabled:J&&!z.hideFileInputOnCreate,newDocumentURL:g,openBulkUpload:Le,smallBreak:_e,t:q}),Ht(N1,{beforeActions:De,collectionConfig:te,collectionSlug:a,disableQueryPresets:te?.enableQueryPresets!==!0||f,listMenuItems:p,queryPreset:b,queryPresetPermissions:v,renderedFilters:x,resolvedFilterOptions:y}),i,Ve.length>0&&Ht(cc,{children:S}),Ve.length===0&&Ti("div",{className:`${Gn}__no-results`,children:[Ht("p",{children:re.t("general:noResults",{label:$f(U?.plural,re)})}),R&&g&&Ht(tv,{children:ue?Ht(ne,{el:"button",onClick:()=>O(_),children:re.t("general:createNewLabel",{label:$f(U?.singular,re)})}):Ht(ne,{el:"link",to:g,children:re.t("general:createNewLabel",{label:$f(U?.singular,re)})})})]}),n,Ve.length>0&&Ti("div",{className:`${Gn}__page-controls`,children:[Ht(dc,{hasNextPage:N.hasNextPage,hasPrevPage:N.hasPrevPage,limit:N.limit,nextPage:N.nextPage,numberOfNeighbors:1,onChange:ae=>void L(ae),page:N.page,prevPage:N.prevPage,totalPages:N.totalPages}),N.totalDocs>0&&Ti(tv,{children:[Ti("div",{className:`${Gn}__page-info`,children:[N.page*N.limit-(N.limit-1),"-",N.totalPages>1&&N.totalPages!==N.page?N.limit*N.page:N.totalDocs," ",re.t("general:of")," ",N.totalDocs]}),Ht(O1,{handleChange:ae=>void V(ae),limit:dW(M?.limit)?Number(M.limit):P,limits:te?.admin?.pagination?.limits,resetPage:N.totalDocs<=N.pagingCounter}),_e&&Ti("div",{className:`${Gn}__list-selection`,children:[Ht(hu,{collectionConfig:te,disableBulkDelete:u,disableBulkEdit:d,label:$f(te.labels.plural,re)}),Ht("div",{className:`${Gn}__list-selection-actions`,children:m&&typeof F=="function"?r?[...r,Ht(Ka,{onClick:F},"select-many")]:[Ht(Ka,{onClick:F},"select-many")]:r})]})]})]})]}),o]})})})})}function pW(t){return{...t,filesize:uW(t.filesize)}}import{jsx as ir,jsxs as yD}from"react/jsx-runtime";import{useRouter as jW,useSearchParams as OW}from"next/navigation.js";import{formatAdminURL as MW}from"payload/shared";import BW,{Fragment as VW,useCallback as av,useEffect as CD,useMemo as GW,useRef as lv,useState as Of}from"react";import{c as dD}from"react/compiler-runtime";import{jsx as el,jsxs as uD}from"react/jsx-runtime";var mD=t=>{let e=dD(7),{drawerSlug:o}=t,{closeModal:n}=de(),{t:r}=k(),s;if(e[0]!==n||e[1]!==o||e[2]!==r){let i;e[4]!==n||e[5]!==o?(i=()=>n(o),e[4]=n,e[5]=o,e[6]=i):i=e[6],s=uD(Bo,{className:`${as}__header`,children:[uD("div",{className:`${as}__header-content`,children:[el("h2",{className:`${as}__header-text`,children:el(B1,{element:"span"})}),el("button",{"aria-label":r("general:close"),className:`${as}__header-close`,onClick:i,type:"button",children:el(pt,{})})]}),el(hW,{})]}),e[0]=n,e[1]=o,e[2]=r,e[3]=s}else s=e[3];return s},hW=()=>{let t=dD(3),{id:e,title:o}=Pe(),n;return t[0]!==e||t[1]!==o?(n=e&&e!==o?el(Pf,{id:e.toString()}):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],n};import{formatAdminURL as gW}from"payload/shared";var fD=({adminRoute:t,router:e})=>{let o=gW({adminRoute:t,path:"/"});e.push(o)};import{formatAdminURL as bW}from"payload/shared";var pD=({adminRoute:t,collectionSlug:e,router:o})=>{let n=bW({adminRoute:t,path:e?`/collections/${e}`:"/"});o.push(n)};var ov=(t,e,o,n,r,s,i,a,l,c)=>{if(l)try{s(t,e??o,n),r||(a.current.hasShownLockedModal=!0),a.current={hasShownLockedModal:a.current?.hasShownLockedModal,isLocked:!0,user:n},i(n),r&&c&&c(!1)}catch(u){console.error("Error during document takeover:",u)}};import{c as IW}from"react/compiler-runtime";import{jsx as un,jsxs as yu}from"react/jsx-runtime";import RW,{Fragment as _W,useEffect as DW,useState as FW}from"react";import{jsx as kf,jsxs as rv}from"react/jsx-runtime";import{getTranslation as vW}from"@payloadcms/translations";import{text as xW}from"payload/shared";import yW,{useEffect as hD,useMemo as gD,useState as bD}from"react";var CW="apiKey",wW="api-key",SW="field-type",vD=({enabled:t,readOnly:e})=>{let[o]=bD(wn()),[n,r]=bD(!1),{i18n:s,t:i}=k(),{config:a,getEntityConfig:l}=H(),{collectionSlug:c}=Pe(),u=Et(([y])=>y&&y[CW]||null),d=l({collectionSlug:c})?.fields?.find(y=>"name"in y&&y.name==="apiKey"),f=y=>xW(y,{name:"apiKey",type:"text",blockData:{},data:{},event:"onChange",maxLength:48,minLength:24,path:["apiKey"],preferences:{fields:{}},req:{payload:{config:a},t:i},siblingData:{}}),m=u?.value,h=gD(()=>{let y="API Key";return d?.label&&(y=d.label),vW(y,s)},[d,s]),p=gD(()=>rv("div",{className:`${wW}__label`,children:[kf("span",{children:h}),kf(Oc,{value:m})]}),[h,m]),g=Ee({path:"apiKey",validate:f}),b=()=>{n&&r(!1),setTimeout(()=>{r(!0)},1)},{setValue:v,value:x}=g;return hD(()=>{!m&&t&&v(o),!t&&m&&v(null)},[m,t,v,o]),hD(()=>{n&&setTimeout(()=>{r(!1)},1e4)},[n]),t?rv(yW.Fragment,{children:[rv("div",{className:[SW,"api-key","read-only"].filter(Boolean).join(" "),children:[p,kf("input",{"aria-label":h,className:n?"highlight":void 0,disabled:!0,id:"apiKey",name:"apiKey",type:"text",value:x||""})]}),!e&&kf(v1,{highlightField:b,setKey:()=>v(wn())})]}):null};var jf="auth-fields",xD=t=>{let e=IW(57),{className:o,collectionSlug:n,disableLocalStrategy:r,email:s,loginWithUsername:i,operation:a,readOnly:l,requirePassword:c,setValidateBeforeSubmit:u,useAPIKey:d,username:f,verify:m}=t,{permissions:h}=Ae(),[p,g]=FW(c),b=Et(AW),v=Et(TW),x=Ut(),{i18n:y,t:C}=k(),{docPermissions:S,isEditing:w,isInitializing:D}=Pe(),{config:_}=H(),{routes:A,serverURL:F}=_,{api:R}=A,I=!r||typeof r=="object"&&r.enableFields===!0,E=l||D,T=S?.fields===!0?!0:S?.fields?.enableAPIKey,$=l||T===!0||T&&typeof T=="object"&&!T?.update,j=l||T!==!0&&!T?.update,N=T===!0||T?.read,P;e:{let z=h?.collections?.[n];if(z){P=!!("unlock"in z&&z.unlock);break e}P=!1}let L=P,V;e[0]!==v||e[1]!==u||e[2]!==C?(V=z=>{z?(u(!0),v({type:"UPDATE",errorMessage:C("validation:required"),path:"password",valid:!1}),v({type:"UPDATE",errorMessage:C("validation:required"),path:"confirm-password",valid:!1})):(u(!1),v({type:"REMOVE",path:"password"}),v({type:"REMOVE",path:"confirm-password"})),g(z)},e[0]=v,e[1]=u,e[2]=C,e[3]=V):V=e[3];let M=V,O;e[4]!==R||e[5]!==n||e[6]!==s||e[7]!==y||e[8]!==i||e[9]!==F||e[10]!==C||e[11]!==f?(O=async()=>{let z=`${F}${R}/${n}/unlock`;(await fetch(z,{body:JSON.stringify(i&&f?{username:f}:{email:s}),credentials:"include",headers:{"Accept-Language":y.language,"Content-Type":"application/json"},method:"post"})).status===200?fe.success(C("authentication:successfullyUnlocked")):fe.error(C("authentication:failedToUnlock"))},e[4]=R,e[5]=n,e[6]=s,e[7]=y,e[8]=i,e[9]=F,e[10]=C,e[11]=f,e[12]=O):O=e[12];let B=O,G,X;if(e[13]!==x?(G=()=>{x||g(!1)},X=[x],e[13]=x,e[14]=G,e[15]=X):(G=e[14],X=e[15]),DW(G,X),r&&!I&&!d)return null;let Z;e[16]!==o?(Z=[jf,o].filter(Boolean),e[16]=o,e[17]=Z):Z=e[17];let te=Z.join(" "),U;if(e[18]!==$||e[19]!==N||e[20]!==p||e[21]!==n||e[22]!==r||e[23]!==E||e[24]!==S?.fields||e[25]!==b?.value||e[26]!==j||e[27]!==I||e[28]!==M||e[29]!==L||e[30]!==w||e[31]!==i||e[32]!==a||e[33]!==l||e[34]!==c||e[35]!==C||e[36]!==te||e[37]!==B||e[38]!==d||e[39]!==m){let z;e[41]!==$||e[42]!==N||e[43]!==n||e[44]!==E||e[45]!==b?.value||e[46]!==j||e[47]!==C||e[48]!==d?(z=d&&un("div",{className:`${jf}__api-key`,children:N&&yu(_W,{children:[un(mr,{field:{name:"enableAPIKey",admin:{disabled:E,readOnly:j},label:C("authentication:enableAPIKey")},path:"enableAPIKey",schemaPath:`${n}.enableAPIKey`}),un(vD,{enabled:!!b?.value,readOnly:$})]})}),e[41]=$,e[42]=N,e[43]=n,e[44]=E,e[45]=b?.value,e[46]=j,e[47]=C,e[48]=d,e[49]=z):z=e[49];let ce;e[50]!==n||e[51]!==E||e[52]!==w||e[53]!==l||e[54]!==C||e[55]!==m?(ce=m&&w&&un(mr,{field:{name:"_verified",admin:{disabled:E,readOnly:l},label:C("authentication:verified")},path:"_verified",schemaPath:`${n}._verified`}),e[50]=n,e[51]=E,e[52]=w,e[53]=l,e[54]=C,e[55]=m,e[56]=ce):ce=e[56],U=yu("div",{className:te,children:[I&&yu(RW.Fragment,{children:[un(ev,{loginWithUsername:i,operation:a,permissions:S?.fields,readOnly:l,t:C}),(p||c)&&(!r||!I)&&yu("div",{className:`${jf}__changing-password`,children:[un(Qc,{autoComplete:"new-password",field:{name:"password",label:C("authentication:newPassword"),required:!0},indexPath:"",parentPath:"",parentSchemaPath:"",path:"password",schemaPath:"password"}),un(qc,{disabled:l})]}),yu("div",{className:`${jf}__controls`,children:[p&&!c&&un(ne,{buttonStyle:"secondary",disabled:E,onClick:()=>M(!1),size:"medium",children:C("general:cancel")}),!p&&!c&&!r&&un(ne,{buttonStyle:"secondary",disabled:E,id:"change-password",onClick:()=>M(!0),size:"medium",children:C("authentication:changePassword")}),a==="update"&&L&&un(ne,{buttonStyle:"secondary",disabled:E,onClick:()=>void B(),size:"medium",children:C("authentication:forceUnlock")})]})]}),z,ce]}),e[18]=$,e[19]=N,e[20]=p,e[21]=n,e[22]=r,e[23]=E,e[24]=S?.fields,e[25]=b?.value,e[26]=j,e[27]=I,e[28]=M,e[29]=L,e[30]=w,e[31]=i,e[32]=a,e[33]=l,e[34]=c,e[35]=C,e[36]=te,e[37]=B,e[38]=d,e[39]=m,e[40]=U}else U=e[40];return U};function AW(t){let[e]=t;return e&&e?.enableAPIKey||null}function TW(t){return t[1]}import{c as EW}from"react/compiler-runtime";import{getTranslation as PW}from"@payloadcms/translations";import{formatAdminURL as nv}from"payload/shared";import{useEffect as NW}from"react";var sv=t=>{let e=EW(20),{id:o,collectionSlug:n,globalSlug:r,pluralLabel:s,useAsTitle:i}=t,a=t?.view||void 0,{isEditing:l,isInitializing:c,title:u}=Pe(),{isEntityVisible:d}=Z1(),f;e[0]!==n||e[1]!==r||e[2]!==d?(f=d({collectionSlug:n,globalSlug:r}),e[0]=n,e[1]=r,e[2]=d,e[3]=f):f=e[3];let m=f,{setStepNav:h}=jn(),{i18n:p,t:g}=k(),{config:b}=H(),{routes:v}=b,{admin:x}=v,y,C;return e[4]!==x||e[5]!==n||e[6]!==r||e[7]!==p||e[8]!==o||e[9]!==l||e[10]!==c||e[11]!==m||e[12]!==s||e[13]!==h||e[14]!==g||e[15]!==u||e[16]!==i||e[17]!==a?(y=()=>{let S=[];c||(n?(S.push({label:PW(s,p),url:m?nv({adminRoute:x,path:`/collections/${n}`}):void 0}),l?S.push({label:i&&i!=="id"&&u||`${o}`,url:m?nv({adminRoute:x,path:`/collections/${n}/${o}`}):void 0}):S.push({label:g("general:createNew")})):r&&S.push({label:u,url:m?nv({adminRoute:x,path:`/globals/${r}`}):void 0}),a&&S.push({label:a}),h(S))},C=[h,c,l,s,o,i,x,g,p,u,n,r,a,m],e[4]=x,e[5]=n,e[6]=r,e[7]=p,e[8]=o,e[9]=l,e[10]=c,e[11]=m,e[12]=s,e[13]=h,e[14]=g,e[15]=u,e[16]=i,e[17]=a,e[18]=y,e[19]=C):(y=e[18],C=e[19]),NW(y,C),null};import{c as LW}from"react/compiler-runtime";import{useEffect as $W,useRef as kW}from"react";var iv=t=>{let e=LW(13),{collectionConfig:o,config:n,fallback:r,globalConfig:s}=t,i=o?.admin?.useAsTitle,a;e[0]!==i?(a=b=>{let[v]=b;return i&&v&&v?.[i]||null},e[0]=i,e[1]=a):a=e[1];let l=Et(a),c=kW(!1),{i18n:u}=k(),{setDocumentTitle:d}=Pe(),f=n?.admin?.dateFormat,m;e[2]!==o||e[3]!==f||e[4]!==r||e[5]!==l||e[6]!==s||e[7]!==u?(m=dr({collectionConfig:o,data:{id:""},dateFormat:f,fallback:typeof l=="string"?l:typeof l=="number"?String(l):l?.value||r,globalConfig:s,i18n:u}),e[2]=o,e[3]=f,e[4]=r,e[5]=l,e[6]=s,e[7]=u,e[8]=m):m=e[8];let h=m,p,g;return e[9]!==d||e[10]!==h?(p=()=>{if(!c.current){c.current=!0;return}d(h)},g=[d,h],e[9]=d,e[10]=h,e[11]=p,e[12]=g):(p=e[11],g=e[12]),$W(p,g),null};var Mf="collection-edit";function WW({BeforeDocumentControls:t,Description:e,PreviewButton:o,PublishButton:n,SaveButton:r,SaveDraftButton:s,Upload:i}){let{id:a,action:l,AfterDocument:c,AfterFields:u,apiURL:d,BeforeFields:f,collectionSlug:m,currentEditor:h,disableActions:p,disableCreate:g,disableLeaveWithoutSaving:b,docPermissions:v,documentIsLocked:x,getDocPermissions:y,getDocPreferences:C,globalSlug:S,hasPublishPermission:w,hasSavePermission:D,incrementVersionCount:_,initialState:A,isEditing:F,isInitializing:R,lastUpdateTime:I,redirectAfterCreate:E,redirectAfterDelete:T,redirectAfterDuplicate:$,savedDocumentData:j,setCurrentEditor:N,setDocumentIsLocked:P,unlockDocument:L,updateDocumentEditor:V,updateSavedDocumentData:M}=Pe(),{clearDoc:O,drawerSlug:B,onDelete:G,onDuplicate:X,onSave:Z}=ac(),te=!!B,{refreshCookieAsync:U,user:z}=Ae(),{config:ce,config:{admin:{user:J},routes:{admin:ue}},getEntityConfig:re}=H(),q=re({collectionSlug:m}),pe=re({globalSlug:S}),he=ct(),_e=jW(),ge=OW(),{reportUpdate:Ve}=fi(),{resetUploadEdits:Q}=Ws(),{getFormState:Le}=Dt(),{startRouteTransition:De}=st(),ae=lv(null),se=lv(null),Y=ge.get("locale"),ie=q?.slug||pe?.slug,me=m&&!a?"create":"update",we=q?q.auth:void 0,ze=q?q.upload:void 0,$e=q||pe,ot=$e?.lockDocuments!==void 0?$e?.lockDocuments:!0,Xe=ot!==!1,Qt=(typeof ot=="object"?ot.duration:300)*1e3,Ge=!!(q?.versions?.drafts&&q?.versions?.drafts?.autosave||pe?.versions?.drafts&&pe?.versions?.drafts?.autosave),Je=typeof b<"u"?!b:!Ge,[Ye,xt]=Of(!1),[jt,gt]=Of(!1),[qe,Tt]=Of(Date.now()),be=I+Qt,K=Date.now()>be,W=lv({hasShownLockedModal:!1,isLocked:!1,user:null}),ee=[Mf,(a||S)&&`${Mf}--is-editing`];S&&ee.push(`global-edit--${S}`),m&&ee.push(`collection-edit--${m}`);let le=GW(()=>[ie],[ie]),[ve,Fe]=Of(()=>!!(me==="create"&&we&&!we.disableLocalStrategy)),Se=av(lt=>{P(!0);let fo=typeof W.current?.user=="object"?W.current?.user?.id:W.current?.user;if(lt){let ro=typeof lt.user=="string"||typeof lt.user=="number"?lt.user:lt.user.id;(!W.current||ro!==fo)&&(fo===z.id&&ro!==z.id&&(gt(!0),W.current.hasShownLockedModal=!0),W.current={hasShownLockedModal:W.current?.hasShownLockedModal||!1,isLocked:!0,user:lt.user},N(lt.user))}},[N,P,z?.id]),We=av(async lt=>{let fo=or(se),ro=lt?.doc||lt?.result;if(Ve({id:a,entitySlug:ie,updatedAt:ro?.updatedAt||new Date().toISOString()}),z&&m===J&&a===z.id&&U(),_(),typeof M=="function"&&M(ro||{}),typeof Z=="function"){let ko=a?"update":"create";Z({...lt,operation:ko,updatedAt:ko==="update"?new Date().toISOString():ro?.updatedAt||new Date().toISOString()})}if(!F&&he<2&&E!==!1){let ko=MW({adminRoute:ue,path:`/collections/${m}/${ro?.id}${Y?`?locale=${Y}`:""}`});De(()=>_e.push(ko))}else Q();if(await y(lt),(a||S)&&!Ge){let ko=await C(),{state:ke}=await Le({id:a,collectionSlug:m,data:ro,docPermissions:v,docPreferences:ko,globalSlug:S,operation:me,renderAllFields:!0,returnLockStatus:!1,schemaPath:le.join("."),signal:fo.signal,skipValidation:!0});return Xe&&P(!1),se.current=null,ke}},[Ve,a,ie,z,m,J,_,M,Z,F,he,y,S,Ge,U,ue,Y,_e,Q,C,Le,v,me,le,Xe,P,De,E]),Kt=av(async({formState:lt,submitted:fo})=>{let ro=or(ae),ko=Date.now(),ke=ko-qe,po=Xe&&ke>=1e4;po&&Tt(ko);let Xo=await C(),{lockedState:zt,state:wr}=await Le({id:a,collectionSlug:m,docPermissions:v,docPreferences:Xo,formState:lt,globalSlug:S,operation:me,skipValidation:!fo,renderAllFields:!1,returnLockStatus:Xe,schemaPath:le.join("."),signal:ro.signal,updateLastEdited:po});return Xe&&Se(zt),ae.current=null,wr},[a,m,C,Le,S,Se,Xe,me,le,v,qe]);CD(()=>()=>{Xe&&x&&(a||S)&&!["preview","api","versions"].some(fo=>window.location.pathname.includes(fo))&&(typeof W.current?.user=="object"?W.current?.user?.id===z?.id:W.current?.user===z?.id)&&(L(a,m??S),P(!1),N(null)),gt(!1)},[m,S,a,L,z,N,Xe,x,P]),CD(()=>{let lt=ae.current,fo=se.current;return()=>{tr(lt),tr(fo)}},[]);let Ot=x&&h&&(typeof h=="object"?h.id!==z?.id:h!==z?.id)&&!Ye&&!jt&&!W.current?.hasShownLockedModal&&!K;return ir("main",{className:ee.filter(Boolean).join(" "),children:ir(Il,{operation:me,children:yD(An,{action:l,className:`${Mf}__form`,disabled:Ye||R||!D,disableValidationOnSubmit:!ve,initialState:!R&&A,isDocumentForm:!0,isInitializing:R,method:a?"PATCH":"POST",onChange:[Kt],onSuccess:We,children:[te&&ir(mD,{drawerSlug:B}),Xe&&Ot&&!Ye&&ir(Mb,{handleGoBack:()=>pD({adminRoute:ue,collectionSlug:m,router:_e}),isActive:Ot,onReadOnly:()=>{xt(!0),gt(!1)},onTakeOver:()=>ov(a,m,S,z,!1,V,N,W,Xe),updatedAt:I,user:h}),Xe&&jt&&ir(Ob,{handleBackToDashboard:()=>fD({adminRoute:ue,router:_e}),isActive:jt,onReadOnly:()=>{xt(!0),gt(!1)}}),!Ye&&Je&&ir(Kc,{}),!te&&ir(sv,{collectionSlug:q?.slug,globalSlug:pe?.slug,id:a,pluralLabel:q?.labels?.plural,useAsTitle:q?.admin?.useAsTitle}),ir(iv,{collectionConfig:q,config:ce,fallback:he<=1?a?.toString():void 0,globalConfig:pe}),ir(h1,{apiURL:d,BeforeDocumentControls:t,customComponents:{PreviewButton:o,PublishButton:n,SaveButton:r,SaveDraftButton:s},data:j,disableActions:p,disableCreate:g,hasPublishPermission:w,hasSavePermission:D,id:a,isEditing:F,onDelete:G,onDrawerCreateNew:O,onDuplicate:X,onSave:We,onTakeOver:()=>ov(a,m,S,z,!0,V,N,W,Xe,xt),permissions:v,readOnlyForIncomingUser:Ye,redirectAfterDelete:T,redirectAfterDuplicate:$,slug:q?.slug||pe?.slug,user:h}),ir(kc,{AfterFields:u,BeforeFields:f||yD(VW,{children:[we&&ir(xD,{className:`${Mf}__auth`,collectionSlug:q.slug,disableLocalStrategy:q.auth?.disableLocalStrategy,email:j?.email,loginWithUsername:we?.loginWithUsername,operation:me,readOnly:!D,requirePassword:!a,setValidateBeforeSubmit:Fe,useAPIKey:we.useAPIKey,username:j?.username,verify:we.verify}),ze&&ir(BW.Fragment,{children:i||ir(wb,{collectionSlug:q.slug,initialState:A,uploadConfig:ze})})]}),Description:e,docPermissions:v,fields:$e.fields,readOnly:Ye||!D,schemaPathSegments:le}),c]})})})}import{jsx as HW}from"react/jsx-runtime";import"react";var zW="field-diff-label",XW=({children:t})=>HW("div",{className:zW,children:t});export{Hb as Account,MB as ActionsProvider,h7 as AppHeader,Zc as ArrayField,Gp as AuthProvider,Rr as Banner,Nl as BlocksDrawer,Ll as BlocksField,jI as BulkUploadDrawer,Ib as BulkUploadProvider,ne as Button,FD as CalendarIcon,b7 as Card,ih as CheckIcon,mr as CheckboxField,Hs as CheckboxInput,Ze as ChevronIcon,U1 as ClientFunctionProvider,Xb as CloseMenuIcon,fG as CodeBlockIcon,_D as CodeEdiftor,$l as CodeEditorLazy,kl as CodeField,Xs as Collapsible,Ol as CollapsibleField,Wf as ConfigProvider,qc as ConfirmPasswordField,It as ConfirmationModal,Al as CopyIcon,t1 as CopyLocaleData,Oc as CopyToClipboard,w1 as DateCondition,AD as DatePicker,ec as DateTimeField,bh as DefaultBlockImage,uc as DefaultCell,WW as DefaultEditView,fW as DefaultListView,i1 as DeleteMany,h1 as DocumentControls,pb as DocumentEventsProvider,kc as DocumentFields,Sl as DocumentInfoProvider,Mb as DocumentLocked,Ob as DocumentTakeOver,Cn as DragHandleIcon,Pt as Drawer,ur as DrawerToggler,mi as Dropzone,Ns as EditDepthProvider,_r as EditIcon,b1 as EditMany,hb as EditUpload,ev as EmailAndUsernameFields,oi as EmailField,EG as EntityVisibilityProvider,W1 as ErrorIcon,io as ErrorPill,mG as ExternalLinkIcon,Be as FieldDescription,XW as FieldDiffLabel,He as FieldError,xe as FieldLabel,hm as File,xb as FileDetails,An as Form,K9 as FormLoadingOverlayToggle,Yr as FormSubmit,G8 as FullscreenModal,v1 as GenerateConfirmation,tc as GroupField,Bo as Gutter,Zb as Hamburger,oc as HiddenField,Z8 as HydrateAuthProvider,H1 as InfoIcon,fc as JSONField,mc as JoinField,Kc as LeaveWithoutSaving,ah as LineIcon,no as Link,cp as LinkIcon,N1 as ListControls,pg as ListDrawerContextProvider,k1 as ListHeader,bg as ListQueryProvider,hu as ListSelection,In as LoadingOverlay,i3 as LoadingOverlayToggle,Xp as LocaleProvider,lu as Locked,j1 as LogOutIcon,QV as Logout,Ub as MenuIcon,pG as MinimizeMaximizeIcon,Yo as Modal,dh as MoreIcon,oG as NavGroup,Qb as NavToggler,Fl as NullifyLocaleField,S1 as NumberCondition,pc as NumberField,Il as OperationProvider,zM as OrderableTable,dc as Pagination,J1 as ParamsProvider,Qc as PasswordField,gf as PayloadIcon,O1 as PerPage,vt as Pill,jo as PlusIcon,hc as PointField,ho as Popup,Me as PopupList,zp as PreferencesProvider,a1 as PreviewButton,yb as PreviewSizes,_G as ProgressBar,d1 as PublishButton,L1 as PublishMany,eB as QueryPresetsAccessCell,sB as QueryPresetsColumnField,ZM as QueryPresetsColumnsCell,QM as QueryPresetsWhereCell,cB as QueryPresetsWhereField,vc as RadioGroupField,mt as ReactSelect,R1 as RelationshipCondition,Sc as RelationshipField,cc as RelationshipProvider,Og as RelationshipTable,oe as RenderCustomComponent,KL as RenderDefaultCell,So as RenderFields,B1 as RenderTitle,Ic as RichTextField,QG as RootProvider,o1 as RouteCacheProvider,ap as RouteTransitionProvider,Rc as RowField,dn as RowLabel,np as RowLabelProvider,m1 as SaveButton,f1 as SaveDraftButton,vu as ScrollInfoProvider,C1 as SearchFilter,Pl as SearchIcon,K1 as SearchParamsProvider,vh as SectionTitle,mt as Select,nW as SelectAll,F1 as SelectCondition,_c as SelectField,Sa as SelectInput,Ka as SelectMany,iW as SelectRow,s1 as SelectionProvider,vg as ServerFunctionsProvider,sv as SetDocumentStepNav,iv as SetDocumentTitle,l7 as SetStepNav,St as ShimmerEffect,dG as SortColumn,BM as SortHeader,GM as SortRow,SD as StaggeredShimmers,z1 as SuccessIcon,up as SwapIcon,ib as TabComponent,l1 as Table,sc as TableColumnsProvider,Tc as TabsField,dg as TabsProvider,A1 as TextCondition,di as TextField,lb as TextInput,Ec as TextareaField,cb as TextareaInput,zf as ThemeProvider,Mr as Thumbnail,Kl as TimezonePicker,go as Tooltip,wi as Translation,Gf as TranslationProvider,Pc as UIField,$1 as UnpublishMany,wb as Upload,th as UploadEditsProvider,Yc as UploadField,ob as UploadHandlersProvider,tf as UploadInput,Bb as ViewDescription,X1 as WarningIcon,Ys as WatchChildErrors,sh as WatchCondition,q1 as WindowInfoProvider,pt as XIcon,xM as allFieldComponents,ID as defaultTheme,as as documentDrawerBaseClass,Ce as fieldBaseClass,QI as fieldComponents,Fc as fieldReducer,jp as formatDrawerSlug,jr as parseSearchParams,fe as toast,zb as useActions,xG as useAddClientFunction,ki as useAllFormFields,Ae as useAuth,Ho as useBulkUpload,MI as useBulkUploadDrawerSlug,Pg as useCellProps,yG as useClientFunctions,qn as useCollapsible,H as useConfig,Jo as useDebounce,Xg as useDebouncedCallback,tb as useDebouncedEffect,Hf as useDelay,wg as useDelayedRender,Jt as useDocumentDrawer,ac as useDocumentDrawerContext,fi as useDocumentEvents,$i as useDocumentForm,Pe as useDocumentInfo,bl as useDrawerSlug,ct as useEditDepth,eo as useEffectEvent,Z1 as useEntityVisibility,Ee as useField,Oe as useForm,rp as useFormBackgroundProcessing,Et as useFormFields,Ts as useFormInitializing,Ut as useFormModified,lr as useFormProcessing,Xt as useFormSubmitted,yi as useHotkey,mn as useIntersect,ai as useListDrawer,en as useListDrawerContext,Rt as useListQuery,_g as useListRelationships,Ne as useLocale,de as useModal,Ii as useNav,Qo as useOperation,jG as useParams,EM as usePayloadAPI,Fo as usePreferences,$M as useResize,On as useRouteCache,st as useRouteTransition,HD as useRowLabel,bu as useScrollInfo,qG as useSearchParams,oo as useSelection,Dt as useServerFunctions,jn as useStepNav,pa as useTableColumns,RD as useTheme,Bs as useThrottledEffect,k as useTranslation,Ws as useUploadEdits,Dc as useUploadHandlers,Eb as useUseTitleField,Lu as useWatchForm,Q1 as useWindowInfo,je as withCondition};
|
|
59
59
|
/*! Bundled license information:
|
|
60
60
|
|
|
61
61
|
scheduler/cjs/scheduler.production.js:
|