@payloadcms/ui 3.31.0-canary.0 → 3.31.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.
@@ -10,7 +10,7 @@ function require(m) {
10
10
  }
11
11
  // Workaround end
12
12
 
13
- import{a as Pf,b as W,c as Nf,d as wt,e as Z_,f as J_,g as Lf,h as q_,i as Q_}from"./chunk-PKQOCWZD.js";import{a as pt,b as za,c as Ef,d as $,e as Ri,f as Z1,g as J1,h as Is,i as fu,j as Y_,k as q1,l as K_,m as eD,n as tD}from"./chunk-3AA2TJQ5.js";import{c as xr,d as Y1,e as ws}from"./chunk-5LKBKI4T.js";var av=xr(gt=>{"use strict";function Of(t,e){var o=t.length;t.push(e);e:for(;0<o;){var n=o-1>>>1,r=t[n];if(0<pu(r,e))t[n]=e,t[o]=r,o=n;else break e}}function Cr(t){return t.length===0?null:t[0]}function gu(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,l=t[i],a=i+1,c=t[a];if(0>pu(l,o))a<r&&0>pu(c,l)?(t[n]=c,t[a]=o,n=a):(t[n]=l,t[i]=o,n=i);else if(a<r&&0>pu(c,o))t[n]=c,t[a]=o,n=a;else break e}}return e}function pu(t,e){var o=t.sortIndex-e.sortIndex;return o!==0?o:t.id-e.id}gt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Q1=performance,gt.unstable_now=function(){return Q1.now()}):(kf=Date,K1=kf.now(),gt.unstable_now=function(){return kf.now()-K1});var Q1,kf,K1,Wr=[],jn=[],oD=1,ir=null,vo=3,bu=!1,Ss=!1,Xa=!1,ov=typeof setTimeout=="function"?setTimeout:null,rv=typeof clearTimeout=="function"?clearTimeout:null,ev=typeof setImmediate<"u"?setImmediate:null;function hu(t){for(var e=Cr(jn);e!==null;){if(e.callback===null)gu(jn);else if(e.startTime<=t)gu(jn),e.sortIndex=e.expirationTime,Of(Wr,e);else break;e=Cr(jn)}}function Mf(t){if(Xa=!1,hu(t),!Ss)if(Cr(Wr)!==null)Ss=!0,Bf();else{var e=Cr(jn);e!==null&&Vf(Mf,e.startTime-t)}}var vu=!1,Ua=-1,nv=5,sv=-1;function iv(){return!(gt.unstable_now()-sv<nv)}function $f(){if(vu){var t=gt.unstable_now();sv=t;var e=!0;try{e:{Ss=!1,Xa&&(Xa=!1,rv(Ua),Ua=-1),bu=!0;var o=vo;try{t:{for(hu(t),ir=Cr(Wr);ir!==null&&!(ir.expirationTime>t&&iv());){var n=ir.callback;if(typeof n=="function"){ir.callback=null,vo=ir.priorityLevel;var r=n(ir.expirationTime<=t);if(t=gt.unstable_now(),typeof r=="function"){ir.callback=r,hu(t),e=!0;break t}ir===Cr(Wr)&&gu(Wr),hu(t)}else gu(Wr);ir=Cr(Wr)}if(ir!==null)e=!0;else{var s=Cr(jn);s!==null&&Vf(Mf,s.startTime-t),e=!1}}break e}finally{ir=null,vo=o,bu=!1}e=void 0}}finally{e?Ha():vu=!1}}}var Ha;typeof ev=="function"?Ha=function(){ev($f)}:typeof MessageChannel<"u"?(jf=new MessageChannel,tv=jf.port2,jf.port1.onmessage=$f,Ha=function(){tv.postMessage(null)}):Ha=function(){ov($f,0)};var jf,tv;function Bf(){vu||(vu=!0,Ha())}function Vf(t,e){Ua=ov(function(){t(gt.unstable_now())},e)}gt.unstable_IdlePriority=5;gt.unstable_ImmediatePriority=1;gt.unstable_LowPriority=4;gt.unstable_NormalPriority=3;gt.unstable_Profiling=null;gt.unstable_UserBlockingPriority=2;gt.unstable_cancelCallback=function(t){t.callback=null};gt.unstable_continueExecution=function(){Ss||bu||(Ss=!0,Bf())};gt.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"):nv=0<t?Math.floor(1e3/t):5};gt.unstable_getCurrentPriorityLevel=function(){return vo};gt.unstable_getFirstCallbackNode=function(){return Cr(Wr)};gt.unstable_next=function(t){switch(vo){case 1:case 2:case 3:var e=3;break;default:e=vo}var o=vo;vo=e;try{return t()}finally{vo=o}};gt.unstable_pauseExecution=function(){};gt.unstable_requestPaint=function(){};gt.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var o=vo;vo=t;try{return e()}finally{vo=o}};gt.unstable_scheduleCallback=function(t,e,o){var n=gt.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:oD++,callback:e,priorityLevel:t,startTime:o,expirationTime:r,sortIndex:-1},o>n?(t.sortIndex=o,Of(jn,t),Cr(Wr)===null&&t===Cr(jn)&&(Xa?(rv(Ua),Ua=-1):Xa=!0,Vf(Mf,o-n))):(t.sortIndex=r,Of(Wr,t),Ss||bu||(Ss=!0,Bf())),t};gt.unstable_shouldYield=iv;gt.unstable_wrapCallback=function(t){var e=vo;return function(){var o=vo;vo=e;try{return t.apply(this,arguments)}finally{vo=o}}}});var cv=xr((cW,lv)=>{"use strict";lv.exports=av()});var oy=xr(ft=>{"use strict";var ro=typeof Symbol=="function"&&Symbol.for,bh=ro?Symbol.for("react.element"):60103,vh=ro?Symbol.for("react.portal"):60106,Ad=ro?Symbol.for("react.fragment"):60107,Fd=ro?Symbol.for("react.strict_mode"):60108,Ed=ro?Symbol.for("react.profiler"):60114,Pd=ro?Symbol.for("react.provider"):60109,Nd=ro?Symbol.for("react.context"):60110,xh=ro?Symbol.for("react.async_mode"):60111,Ld=ro?Symbol.for("react.concurrent_mode"):60111,kd=ro?Symbol.for("react.forward_ref"):60112,$d=ro?Symbol.for("react.suspense"):60113,jP=ro?Symbol.for("react.suspense_list"):60120,jd=ro?Symbol.for("react.memo"):60115,Od=ro?Symbol.for("react.lazy"):60116,OP=ro?Symbol.for("react.block"):60121,MP=ro?Symbol.for("react.fundamental"):60117,BP=ro?Symbol.for("react.responder"):60118,VP=ro?Symbol.for("react.scope"):60119;function Qo(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case bh:switch(t=t.type,t){case xh:case Ld:case Ad:case Ed:case Fd:case $d:return t;default:switch(t=t&&t.$$typeof,t){case Nd:case kd:case Od:case jd:case Pd:return t;default:return e}}case vh:return e}}}function ty(t){return Qo(t)===Ld}ft.AsyncMode=xh;ft.ConcurrentMode=Ld;ft.ContextConsumer=Nd;ft.ContextProvider=Pd;ft.Element=bh;ft.ForwardRef=kd;ft.Fragment=Ad;ft.Lazy=Od;ft.Memo=jd;ft.Portal=vh;ft.Profiler=Ed;ft.StrictMode=Fd;ft.Suspense=$d;ft.isAsyncMode=function(t){return ty(t)||Qo(t)===xh};ft.isConcurrentMode=ty;ft.isContextConsumer=function(t){return Qo(t)===Nd};ft.isContextProvider=function(t){return Qo(t)===Pd};ft.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===bh};ft.isForwardRef=function(t){return Qo(t)===kd};ft.isFragment=function(t){return Qo(t)===Ad};ft.isLazy=function(t){return Qo(t)===Od};ft.isMemo=function(t){return Qo(t)===jd};ft.isPortal=function(t){return Qo(t)===vh};ft.isProfiler=function(t){return Qo(t)===Ed};ft.isStrictMode=function(t){return Qo(t)===Fd};ft.isSuspense=function(t){return Qo(t)===$d};ft.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Ad||t===Ld||t===Ed||t===Fd||t===$d||t===jP||typeof t=="object"&&t!==null&&(t.$$typeof===Od||t.$$typeof===jd||t.$$typeof===Pd||t.$$typeof===Nd||t.$$typeof===kd||t.$$typeof===MP||t.$$typeof===BP||t.$$typeof===VP||t.$$typeof===OP)};ft.typeOf=Qo});var ny=xr((Jne,ry)=>{"use strict";ry.exports=oy()});var dy=xr((qne,uy)=>{"use strict";var Ch=ny(),GP={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},WP={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},zP={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ly={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},yh={};yh[Ch.ForwardRef]=zP;yh[Ch.Memo]=ly;function sy(t){return Ch.isMemo(t)?ly:yh[t.$$typeof]||GP}var HP=Object.defineProperty,XP=Object.getOwnPropertyNames,iy=Object.getOwnPropertySymbols,UP=Object.getOwnPropertyDescriptor,YP=Object.getPrototypeOf,ay=Object.prototype;function cy(t,e,o){if(typeof e!="string"){if(ay){var n=YP(e);n&&n!==ay&&cy(t,n,o)}var r=XP(e);iy&&(r=r.concat(iy(e)));for(var s=sy(t),i=sy(e),l=0;l<r.length;++l){var a=r[l];if(!WP[a]&&!(o&&o[a])&&!(i&&i[a])&&!(s&&s[a])){var c=UP(e,a);try{HP(t,a,c)}catch{}}}}return t}uy.exports=cy});var tg=xr((Nce,R2)=>{var eg=Math.floor(Math.random()*16777215),C2=ht.index=parseInt(Math.random()*16777215,10),y2=(typeof process>"u"||typeof process.pid!="number"?Math.floor(Math.random()*1e5):process.pid)%65535,w2=(()=>{try{return _Buffer}catch{try{return Buffer}catch{return null}}})(),em=function(t){return!!(t!=null&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))},S2=[];for(Go=0;Go<256;Go++)S2[Go]=(Go<=15?"0":"")+Go.toString(16);var Go,I2=new RegExp("^[0-9a-fA-F]{24}$"),Hl=[];Go=0;for(;Go<10;)Hl[48+Go]=Go++;for(;Go<16;)Hl[55+Go]=Hl[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")}}R2.exports=ht;ht.default=ht;ht.createFromTime=function(t){return t=parseInt(t,10)%4294967295,new ht(GN(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(Hl[t.charCodeAt(o++)]<<4|Hl[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&&I2.test(t):t instanceof ht?!0:em(t)?ht.isValid(t.toString("hex")):typeof t.toHexString=="function"&&w2&&(t.id instanceof w2||typeof t.id=="string")?t.id.length===12||t.id.length===24&&I2.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(em(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=S2[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&&em(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 em(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=VN();return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255,eg>>16&255,eg>>8&255,eg&255,y2>>8&255,y2&255,e>>16&255,e>>8&255,e&255)}};function VN(){return C2=(C2+1)%16777215}function GN(t,e){return e=e.toString(16),e.length===t?e:"00000000".substring(e.length,t)+e}var WN=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";ht.prototype[WN]=function(){return"ObjectID("+this+")"};ht.prototype.toJSON=ht.prototype.toHexString;ht.prototype.toString=ht.prototype.toHexString});var Gg=xr((g1e,Z3)=>{function Vg(t){return t===void 0}function Fk(t){return t===null}function Ek(t){return typeof t=="boolean"}function Im(t){return t===Object(t)}function U3(t){return Array.isArray(t)}function Pk(t){return t instanceof Date}function Y3(t,e){return e?Im(t)&&!Vg(t.uri):Im(t)&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.slice=="function"}function Nk(t,e){return Y3(t,e)&&typeof t.name=="string"&&(Im(t.lastModifiedDate)||typeof t.lastModified=="number")}function ri(t){return Vg(t)?!1:t}function Bg(t,e,o,n){e=e||{},o=o||new FormData,e.indices=ri(e.indices),e.nullsAsUndefineds=ri(e.nullsAsUndefineds),e.booleansAsIntegers=ri(e.booleansAsIntegers),e.allowEmptyArrays=ri(e.allowEmptyArrays),e.noAttributesWithArrayNotation=ri(e.noAttributesWithArrayNotation),e.noFilesWithArrayNotation=ri(e.noFilesWithArrayNotation),e.dotsForObjectNotation=ri(e.dotsForObjectNotation);let r=typeof o.getParts=="function";return Vg(t)||(Fk(t)?e.nullsAsUndefineds||o.append(n,""):Ek(t)?e.booleansAsIntegers?o.append(n,t?1:0):o.append(n,t):U3(t)?t.length?t.forEach((s,i)=>{let l=n+"["+(e.indices?i:"")+"]";(e.noAttributesWithArrayNotation||e.noFilesWithArrayNotation&&Nk(s,r))&&(l=n),Bg(s,e,o,l)}):e.allowEmptyArrays&&o.append(e.noAttributesWithArrayNotation?n:n+"[]",""):Pk(t)?o.append(n,t.toISOString()):Im(t)&&!Y3(t,r)?Object.keys(t).forEach(s=>{let i=t[s];if(U3(i))for(;s.length>2&&s.lastIndexOf("[]")===s.length-2;)s=s.substring(0,s.length-2);let l=n?e.dotsForObjectNotation?n+"."+s:n+"["+s+"]":s;Bg(i,e,o,l)}):o.append(n,t)),o}Z3.exports={serialize:Bg}});var YS=xr((mDe,US)=>{(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}};US.exports=e})()});var Ab=xr((fDe,ZS)=>{var Tb={utf8:{stringToBytes:function(t){return Tb.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Tb.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("")}}};ZS.exports=Tb});var QS=xr((pDe,qS)=>{qS.exports=function(t){return t!=null&&(JS(t)||XM(t)||!!t._isBuffer)};function JS(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function XM(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&JS(t.slice(0,0))}});var e4=xr((hDe,KS)=>{(function(){var t=YS(),e=Ab().utf8,o=QS(),n=Ab().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 l=t.bytesToWords(s),a=s.length*8,c=1732584193,u=-271733879,d=-1732584194,f=271733878,m=0;m<l.length;m++)l[m]=(l[m]<<8|l[m]>>>24)&16711935|(l[m]<<24|l[m]>>>8)&4278255360;l[a>>>5]|=128<<a%32,l[(a+64>>>9<<4)+14]=a;for(var h=r._ff,p=r._gg,g=r._hh,b=r._ii,m=0;m<l.length;m+=16){var x=c,v=u,C=d,y=f;c=h(c,u,d,f,l[m+0],7,-680876936),f=h(f,c,u,d,l[m+1],12,-389564586),d=h(d,f,c,u,l[m+2],17,606105819),u=h(u,d,f,c,l[m+3],22,-1044525330),c=h(c,u,d,f,l[m+4],7,-176418897),f=h(f,c,u,d,l[m+5],12,1200080426),d=h(d,f,c,u,l[m+6],17,-1473231341),u=h(u,d,f,c,l[m+7],22,-45705983),c=h(c,u,d,f,l[m+8],7,1770035416),f=h(f,c,u,d,l[m+9],12,-1958414417),d=h(d,f,c,u,l[m+10],17,-42063),u=h(u,d,f,c,l[m+11],22,-1990404162),c=h(c,u,d,f,l[m+12],7,1804603682),f=h(f,c,u,d,l[m+13],12,-40341101),d=h(d,f,c,u,l[m+14],17,-1502002290),u=h(u,d,f,c,l[m+15],22,1236535329),c=p(c,u,d,f,l[m+1],5,-165796510),f=p(f,c,u,d,l[m+6],9,-1069501632),d=p(d,f,c,u,l[m+11],14,643717713),u=p(u,d,f,c,l[m+0],20,-373897302),c=p(c,u,d,f,l[m+5],5,-701558691),f=p(f,c,u,d,l[m+10],9,38016083),d=p(d,f,c,u,l[m+15],14,-660478335),u=p(u,d,f,c,l[m+4],20,-405537848),c=p(c,u,d,f,l[m+9],5,568446438),f=p(f,c,u,d,l[m+14],9,-1019803690),d=p(d,f,c,u,l[m+3],14,-187363961),u=p(u,d,f,c,l[m+8],20,1163531501),c=p(c,u,d,f,l[m+13],5,-1444681467),f=p(f,c,u,d,l[m+2],9,-51403784),d=p(d,f,c,u,l[m+7],14,1735328473),u=p(u,d,f,c,l[m+12],20,-1926607734),c=g(c,u,d,f,l[m+5],4,-378558),f=g(f,c,u,d,l[m+8],11,-2022574463),d=g(d,f,c,u,l[m+11],16,1839030562),u=g(u,d,f,c,l[m+14],23,-35309556),c=g(c,u,d,f,l[m+1],4,-1530992060),f=g(f,c,u,d,l[m+4],11,1272893353),d=g(d,f,c,u,l[m+7],16,-155497632),u=g(u,d,f,c,l[m+10],23,-1094730640),c=g(c,u,d,f,l[m+13],4,681279174),f=g(f,c,u,d,l[m+0],11,-358537222),d=g(d,f,c,u,l[m+3],16,-722521979),u=g(u,d,f,c,l[m+6],23,76029189),c=g(c,u,d,f,l[m+9],4,-640364487),f=g(f,c,u,d,l[m+12],11,-421815835),d=g(d,f,c,u,l[m+15],16,530742520),u=g(u,d,f,c,l[m+2],23,-995338651),c=b(c,u,d,f,l[m+0],6,-198630844),f=b(f,c,u,d,l[m+7],10,1126891415),d=b(d,f,c,u,l[m+14],15,-1416354905),u=b(u,d,f,c,l[m+5],21,-57434055),c=b(c,u,d,f,l[m+12],6,1700485571),f=b(f,c,u,d,l[m+3],10,-1894986606),d=b(d,f,c,u,l[m+10],15,-1051523),u=b(u,d,f,c,l[m+1],21,-2054922799),c=b(c,u,d,f,l[m+8],6,1873313359),f=b(f,c,u,d,l[m+15],10,-30611744),d=b(d,f,c,u,l[m+6],15,-1560198380),u=b(u,d,f,c,l[m+13],21,1309151649),c=b(c,u,d,f,l[m+4],6,-145523070),f=b(f,c,u,d,l[m+11],10,-1120210379),d=b(d,f,c,u,l[m+2],15,718787259),u=b(u,d,f,c,l[m+9],21,-343485551),c=c+x>>>0,u=u+v>>>0,d=d+C>>>0,f=f+y>>>0}return t.endian([c,u,d,f])};r._ff=function(s,i,l,a,c,u,d){var f=s+(i&l|~i&a)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._gg=function(s,i,l,a,c,u,d){var f=s+(i&a|l&~a)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._hh=function(s,i,l,a,c,u,d){var f=s+(i^l^a)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._ii=function(s,i,l,a,c,u,d){var f=s+(l^(i|~a))+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._blocksize=16,r._digestsize=16,KS.exports=function(s,i){if(s==null)throw new Error("Illegal argument "+s);var l=t.wordsToBytes(r(s,i));return i&&i.asBytes?l:i&&i.asString?n.bytesToString(l):t.bytesToHex(l)}})()});import{jsx as Yf}from"react/jsx-runtime";import"react";function oe({CustomComponent:t,Fallback:e}){return t!==void 0?t:e}import{jsx as hD}from"react/jsx-runtime";import fv from"react";import{createContext as On,use as Mn}from"react";var Ya=ws(cv(),1);import{createElement as rD,createContext as nD,useContext as sD,useEffect as iD,useLayoutEffect as aD,useReducer as lD,useRef as Gf,useState as cD}from"react";var xu=Symbol(),uD=Symbol(),dD=typeof window>"u"||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent),uv=dD?iD:aD,mD=Ya.unstable_runWithPriority?t=>{try{(0,Ya.unstable_runWithPriority)(Ya.unstable_NormalPriority,t)}catch(e){if(e.message==="Not implemented.")t();else throw e}}:t=>t(),fD=t=>({value:o,children:n})=>{let r=Gf(o),s=Gf(0),[i,l]=cD(null);i&&(i(o),l(null));let a=Gf();if(!a.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=>{l(()=>p=>{m.v=p,delete m.p,h(p)})})),c.forEach(h=>h(m)),d()};a.current={[xu]:{v:r,n:s,l:c,u}}}return uv(()=>{r.current=o,s.current+=1,mD(()=>{a.current[xu].l.forEach(c=>{c({n:s.current,v:o})})})},[o]),rD(t,{value:a.current},n)},pD=t=>t;function dv(t){let e=nD({[xu]:{v:{current:t},n:{current:-1},l:new Set,u:o=>o()}});return e[uD]=e.Provider,e.Provider=fD(e.Provider),delete e.Consumer,e}function Wf(t,e){let o=sD(t)[xu],{v:{current:n},n:{current:r},l:s}=o,i=e(n),[l,a]=lD((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(l[1],i)||a(),uv(()=>(s.add(a),()=>{s.delete(a)}),[s]),l[1]}function mv(t){return Wf(t,pD)}var Cu=On({}),yu=On({}),wu=On({}),Iu=On(!1),Su=On(!1),zf=On(!1),Ru=On(!1),Hf=On(!1),Za=dv([{},()=>null]),Me=()=>Mn(Cu),_i=()=>Mn(yu),_u=()=>Mn(wu),zt=()=>Mn(Iu),$o=()=>Mn(Su),Xf=()=>Mn(zf),Ht=()=>Mn(Ru),Rs=()=>Mn(Hf),Et=t=>Wf(Za,t),Di=()=>mv(Za);var pv=fv.createContext({data:{},path:"",rowNumber:void 0}),Uf=({children:t,path:e,rowNumber:o})=>{"use no memo";let{getDataByPath:n,getSiblingData:r}=_u(),s=r(e),l=n(e)||s;return hD(pv,{value:{data:l,path:e,rowNumber:o},children:t})},gD=()=>fv.use(pv);var bD="row-label",sn=t=>{let{className:e,CustomComponent:o,label:n,path:r,rowNumber:s}=t;return Yf(Uf,{path:r,rowNumber:s,children:Yf(oe,{CustomComponent:o,Fallback:typeof n=="string"?Yf("span",{className:[bD,e].filter(Boolean).join(" "),style:{pointerEvents:"none"},children:n}):n})})};import{c as PO}from"react/compiler-runtime";import{jsx as io,jsxs as mi}from"react/jsx-runtime";import{getTranslation as bb}from"@payloadcms/translations";import NO from"react";import{jsx as qf,jsxs as AD}from"react/jsx-runtime";import Cv from"react";import{jsx as RD}from"react/jsx-runtime";import xv from"next/link.js";import{useRouter as _D}from"next/navigation.js";import"react";import{c as vD}from"react/compiler-runtime";import{jsx as xD}from"react/jsx-runtime";import Zf,{startTransition as CD,useEffect as yD,useOptimistic as wD,useRef as hv}from"react";var Jf=t=>{let e=vD(11),{children:o}=t,[n,r]=wD(!1),[s,i]=Zf.useState(0),l=hv(s),a=hv(null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{a.current=setInterval(()=>{let g=l.current+(.93-l.current)*Math.random()*.2*Math.pow(Math.log(1+(1-l.current)*.75),.75);i(g),l.current=g},250)},e[0]=c):c=e[0];let u=c,d,f;e[1]!==n?(d=()=>{i(0),l.current=0,n?u():a.current&&clearInterval(a.current)},f=[n,u],e[1]=n,e[2]=d,e[3]=f):(d=e[2],f=e[3]),yD(d,f);let m;e[4]!==r?(m=g=>{CD(()=>{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=xD(gv,{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},gv=Zf.createContext({isTransitioning:!1,startRouteTransition:()=>{},transitionProgress:0}),it=()=>Zf.use(gv);var ID=/https?|ftp|gopher|file/;function bv(t){return typeof t=="string"||typeof t=="number"&&!isNaN(t)||typeof t=="boolean"?String(t):""}function SD(t){let e=new URLSearchParams;return Object.entries(t).forEach(([o,n])=>{Array.isArray(n)?n.forEach(r=>e.append(o,bv(r))):e.set(o,bv(n))}),e}function vv(t){let{auth:e}=t,{hostname:o}=t,n=t.protocol||"",r=t.pathname||"",s=t.hash||"",i=t.query||"",l=!1;e=e?encodeURIComponent(e).replace(/%3A/i,":")+"@":"",t.host?l=e+t.host:o&&(l=e+(~o.indexOf(":")?`[${o}]`:o),t.port&&(l+=":"+t.port)),i&&typeof i=="object"&&(i=String(SD(i)));let a=t.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),t.slashes||(!n||ID.test(n))&&l!==!1?(l="//"+(l||""),r&&r[0]!=="/"&&(r="/"+r)):l||(l=""),s&&s[0]!=="#"&&(s="#"+s),a&&a[0]!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,encodeURIComponent),a=a.replace("#","%23"),`${n}${l}${r}${a}${s}`}var DD=xv.default||xv;function TD(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 Kt=({children:t,href:e,onClick:o,preventDefault:n=!0,ref:r,replace:s,scroll:i,...l})=>{let a=_D(),{startRouteTransition:c}=it();return RD(DD,{href:e,onClick:u=>{TD(u)||(o&&o(u),n&&u.preventDefault(),c(()=>{let d=typeof e=="string"?e:vv(e);s?a.replace(d,{scroll:i}):a.push(d,{scroll:i})}))},ref:r,...l,children:t})};var _s="banner",yr=({type:t="default",alignIcon:e="right",children:o,className:n,icon:r,onClick:s,to:i})=>{let l=[_s,`${_s}--type-${t}`,n&&n,i&&`${_s}--has-link`,(i||s)&&`${_s}--has-action`,r&&`${_s}--has-icon`,r&&`${_s}--align-icon-${e}`].filter(Boolean).join(" "),a="div";return s&&!i&&(a="button"),i&&(a=Kt),AD(a,{className:l,href:i||null,onClick:s,children:[r&&e==="left"&&qf(Cv.Fragment,{children:r}),qf("span",{className:`${_s}__content`,children:o}),r&&e==="right"&&qf(Cv.Fragment,{children:r})]})};import{jsx as Ho,jsxs as Pu}from"react/jsx-runtime";import YD,{Fragment as ZD,isValidElement as JD}from"react";import{jsx as yv}from"react/jsx-runtime";import"react";var Je=({ariaLabel:t,className:e,direction:o,size:n})=>yv("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 22 12",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:yv("path",{className:"stroke",d:"M1 1.12109L11 11.1211L21 1.12109",strokeLinecap:"square"})});import{jsx as wv}from"react/jsx-runtime";import"react";var wr=({className:t})=>wv("svg",{className:[t,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:wv("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 Iv}from"react/jsx-runtime";import"react";var Qf=()=>Iv("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:Iv("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 Sv}from"react/jsx-runtime";import"react";var jo=()=>Sv("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Sv("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})});import{jsx as Rv}from"react/jsx-runtime";import"react";var Kf=()=>Rv("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Rv("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 Ds,jsxs as rp}from"react/jsx-runtime";var Be={};Y1(Be,{Button:()=>tp,ButtonGroup:()=>ep,Divider:()=>_v,GroupLabel:()=>Du});import{jsx as Tu}from"react/jsx-runtime";import"react";import{jsx as FD}from"react/jsx-runtime";import"react";var ED="popup-divider",_v=()=>FD("hr",{className:ED});import{jsx as PD}from"react/jsx-runtime";import"react";var ND="popup-list-group-label",Du=({label:t})=>PD("p",{className:ND,children:t});var Ja="popup-button-list",ep=({buttonSize:t="default",children:e,className:o,textAlign:n="left"})=>{let r=[Ja,o,`${Ja}__text-align--${n}`,`${Ja}__button-size--${t}`].filter(Boolean).join(" ");return Tu("div",{className:r,children:e})},tp=({id:t,active:e,children:o,className:n,disabled:r,href:s,onClick:i})=>{let l=[`${Ja}__button`,e&&`${Ja}__button--selected`,n].filter(Boolean).join(" ");if(!r){if(s)return Tu(Kt,{className:l,href:s,id:t,onClick:a=>{i&&i(a)},prefetch:!1,children:o});if(i)return Tu("button",{className:l,id:t,onClick:a=>{i&&i(a)},type:"button",children:o})}return Tu("div",{className:l,id:t,children:o})};var Bn={};Y1(Bn,{WindowInfo:()=>Av,WindowInfoContext:()=>Ti,WindowInfoProvider:()=>Pv,useWindowInfo:()=>xo,withWindowInfo:()=>Nv});import{useContext as kD}from"react";import{createContext as LD}from"react";var Ti=LD({});var xo=()=>kD(Ti);import Dv,{Fragment as Tv}from"react";var Av=t=>{let{children:e}=t,o=xo();return e?typeof e=="function"?Dv.createElement(Tv,null,e(o)):Dv.createElement(Tv,null,e):null};import $D,{useCallback as Fv,useEffect as Ev,useReducer as jD,useRef as OD}from"react";var MD=(t,e)=>{let{payload:{breakpoints:o,animationRef:n}}=e;n.current=null;let{eventsFired:r}=t,{documentElement:{style:s,clientWidth:i,clientHeight:l}}=document,{innerWidth:a,innerHeight:c}=window,u=`${i/100}px`,d=`${l/100}px`,f=o?Object.keys(o).reduce((h,p)=>Object.assign(Object.assign({},h),{[p]:window.matchMedia(o[p]).matches}),{}):{},m={width:a,height:c,"--vw":u,"--vh":d,breakpoints:f,eventsFired:r+1};return s.setProperty("--vw",u),s.setProperty("--vh",d),m},Pv=t=>{let{breakpoints:e,children:o}=t,n=OD(null),[r,s]=jD(MD,{width:void 0,height:void 0,"--vw":"","--vh":"",breakpoints:{},eventsFired:0}),i=Fv(()=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}}))},[e]),l=Fv(()=>{setTimeout(()=>{i()},500)},[i]);return Ev(()=>(window.addEventListener("resize",i),window.addEventListener("orientationchange",l),()=>{window.removeEventListener("resize",i),window.removeEventListener("orientationchange",l)}),[i,l]),Ev(()=>{r.eventsFired===0&&s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}})},[e,r]),$D.createElement(Ti.Provider,{value:Object.assign({},r)},o&&o)};import BD from"react";var Nv=t=>o=>{let n=xo();return BD.createElement(t,Object.assign({},o,{windowInfo:n}))};import{useCallback as $v,useEffect as Au,useRef as zD,useState as np}from"react";import{c as VD}from"react/compiler-runtime";import{useEffect as GD,useRef as WD,useState as Lv}from"react";var an=(t,e)=>{let o=VD(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,l=r===void 0?null:r,a=s===void 0?"0px":s,c=i===void 0?0:i,[u,d]=Lv(),[f,m]=Lv(null),h;o[2]!==e||o[3]!==l||o[4]!==a||o[5]!==c?(h=typeof window<"u"&&"IntersectionObserver"in window&&!e?new window.IntersectionObserver(v=>{let[C]=v;return d(C)},{root:l,rootMargin:a,threshold:c}):null,o[2]=e,o[3]=l,o[4]=a,o[5]=c,o[6]=h):h=o[6];let p=WD(h),g,b;o[7]!==e||o[8]!==f?(g=()=>{if(e)return;let{current:v}=p;return v.disconnect(),f&&v.observe(f),()=>v.disconnect()},b=[f,e],o[7]=e,o[8]=f,o[9]=g,o[10]=b):(g=o[9],b=o[10]),GD(g,b);let x;return o[11]!==u||o[12]!==f?(x=[m,u,f],o[11]=u,o[12]=f,o[13]=x):x=o[13],x};import{jsx as kv}from"react/jsx-runtime";import"react";var qa="popup-button",op=t=>{let{active:e,button:o,buttonType:n,className:r,disabled:s,noBackground:i,setActive:l,size:a}=t,c=[qa,r,`${qa}--${n}`,!i&&`${qa}--background`,a&&`${qa}--size-${a}`,s&&`${qa}--disabled`].filter(Boolean).join(" "),u=()=>{l(!e)};return n==="none"?null:n==="custom"?kv("div",{className:c,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},role:"button",tabIndex:0,children:o}):kv("button",{className:c,disabled:s,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},tabIndex:0,type:"button",children:o})};var Oo="popup",fo=t=>{let{id:e,boundingRef:o,button:n,buttonClassName:r,buttonSize:s,buttonType:i="default",caret:l=!0,children:a,className:c,disabled:u,forceOpen:d,horizontalAlign:f="left",initActive:m=!1,noBackground:h,onToggleOpen:p,render:g,showOnHover:b=!1,showScrollbar:x=!1,size:v="medium",verticalAlign:C="top"}=t,{height:y,width:I}=xo(),[w,A]=an({root:o?.current||null,rootMargin:"-100px 0px 0px 0px",threshold:1}),_=zD(null),[D,T]=np(m),[S,R]=np(C),[E,F]=np(f),L=$v(({horizontal:P=!1,vertical:j=!1})=>{if(_.current){let V=_.current.getBoundingClientRect(),{bottom:M,left:O,right:B,top:G}=V,Y=100,X=document.documentElement.clientWidth,ee=document.documentElement.clientHeight,q=0;o?.current&&({bottom:ee,left:q,right:X,top:Y}=o.current.getBoundingClientRect()),P&&(B>X&&O>q?F("right"):O<q&&B<X&&F("left")),j&&(G<Y&&M<ee?R("bottom"):M>ee&&G>Y&&R("top"))}},[o]),k=$v(P=>{_.current.contains(P.target)||T(!1)},[_]);Au(()=>{L({horizontal:!0})},[A,L,I]),Au(()=>{L({vertical:!0})},[A,L,y]),Au(()=>(typeof p=="function"&&p(D),D?document.addEventListener("mousedown",k):document.removeEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}),[D,k,p]),Au(()=>{T(d)},[d]);let N=[Oo,c,`${Oo}--size-${v}`,s&&`${Oo}--button-size-${s}`,`${Oo}--v-align-${S}`,`${Oo}--h-align-${E}`,D&&`${Oo}--active`,x&&`${Oo}--show-scrollbar`].filter(Boolean).join(" ");return rp("div",{className:N,id:e,children:[Ds("div",{className:`${Oo}__trigger-wrap`,children:b?Ds("div",{className:`${Oo}__on-hover-watch`,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:Ds(op,{active:D,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:T,size:s})}):Ds(op,{active:D,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:T,size:s})}),rp("div",{className:`${Oo}__content`,ref:_,children:[Ds("div",{className:`${Oo}__hide-scrollbar`,ref:w,children:Ds("div",{className:`${Oo}__scroll-container`,children:rp("div",{className:`${Oo}__scroll-content`,children:[g&&g({close:()=>T(!1)}),a]})})}),l&&Ds("div",{className:`${Oo}__caret`})]})]})};import{c as HD}from"react/compiler-runtime";import{jsx as Fu,jsxs as XD}from"react/jsx-runtime";import sp,{useEffect as jv}from"react";var po=t=>{let e=HD(26),{alignCaret:o,boundingRef:n,children:r,className:s,delay:i,position:l,show:a,staticPositioning:c}=t,u=o===void 0?"center":o,d=i===void 0?350:i,f=a===void 0?!0:a,m=c===void 0?!1:c,[h,p]=sp.useState(f),[g,b]=sp.useState("top"),x=UD,v=n?.current||null,C;e[0]!==v?(C={root:v,rootMargin:"-145px 0px 0px 100px",threshold:0},e[0]=v,e[1]=C):C=e[1];let[y,I]=an(C,m),w,A;e[2]!==d||e[3]!==f?(w=()=>{let S;return d&&f?S=setTimeout(()=>{p(f)},d):p(f),()=>{S&&clearTimeout(S)}},A=[f,d],e[2]=d,e[3]=f,e[4]=w,e[5]=A):(w=e[4],A=e[5]),jv(w,A);let _;e[6]!==I?.isIntersecting||e[7]!==m?(_=()=>{m||b(I?.isIntersecting?"top":"bottom")},e[6]=I?.isIntersecting,e[7]=m,e[8]=_):_=e[8];let D;e[9]!==I||e[10]!==m?(D=[I,m],e[9]=I,e[10]=m,e[11]=D):D=e[11],jv(_,D);let T;if(e[12]!==u||e[13]!==r||e[14]!==s||e[15]!==g||e[16]!==l||e[17]!==y||e[18]!==h||e[19]!==m){let S=h&&"tooltip--show",R=`tooltip--caret-${u}`,E=`tooltip--position-${l||g}`,F;e[21]!==s||e[22]!==S||e[23]!==R||e[24]!==E?(F=["tooltip",s,S,R,E].filter(Boolean),e[21]=s,e[22]=S,e[23]=R,e[24]=E,e[25]=F):F=e[25],T=XD(sp.Fragment,{children:[!m&&Fu("aside",{"aria-hidden":"true",className:["tooltip",s,`tooltip--caret-${u}`,"tooltip--position-top"].filter(Boolean).join(" "),ref:y,style:{opacity:"0"},children:Fu("div",{className:"tooltip-content",children:r})}),Fu("aside",{className:F.join(" "),title:x(r),children:Fu("div",{className:"tooltip-content",children:r})})]}),e[12]=u,e[13]=r,e[14]=s,e[15]=g,e[16]=l,e[17]=y,e[18]=h,e[19]=m,e[20]=T}else T=e[20];return T};function UD(t){return typeof t=="string"?t:""}var qD={chevron:Je,edit:wr,link:Qf,plus:jo,swap:Kf,x:pt},eo="btn",Eu=({children:t,icon:e,showTooltip:o,tooltip:n})=>{let r=qD[e];return Pu(ZD,{children:[n&&Ho(po,{className:`${eo}__tooltip`,show:o,children:n}),Pu("span",{className:`${eo}__content`,children:[t&&Ho("span",{className:`${eo}__label`,children:t}),e&&Pu("span",{className:`${eo}__icon`,children:[JD(e)&&e,r&&Ho(r,{})]})]})]})},ae=t=>{let{id:e,type:o="button","aria-label":n,buttonStyle:r="primary",children:s,className:i,disabled:l,el:a="button",enableSubMenu:c,icon:u,iconPosition:d="right",iconStyle:f="without-border",newTab:m,onClick:h,onMouseDown:p,ref:g,round:b,size:x="medium",SubMenuPopupContent:v,to:C,tooltip:y,url:I}=t,[w,A]=YD.useState(!1),_=[eo,i&&i,u&&`${eo}--icon`,f&&`${eo}--icon-style-${f}`,u&&!s&&`${eo}--icon-only`,x&&`${eo}--size-${x}`,u&&d&&`${eo}--icon-position-${d}`,y&&`${eo}--has-tooltip`,!v&&`${eo}--withoutPopup`].filter(Boolean).join(" ");function D(F){A(!1),o!=="submit"&&h&&F.preventDefault(),h&&h(F)}let T=[r&&`${eo}--style-${r}`,l&&`${eo}--disabled`,b&&`${eo}--round`,v?`${eo}--withPopup`:`${eo}--withoutPopup`].filter(Boolean).join(" "),S={id:e,type:o,"aria-disabled":l,"aria-label":n,className:v?_:[_,T].join(" "),disabled:l,onClick:l?void 0:D,onMouseDown:l?void 0:p,onPointerEnter:y?()=>A(!0):void 0,onPointerLeave:y?()=>A(!1):void 0,rel:m?"noopener noreferrer":void 0,target:m?"_blank":void 0},R,E;switch(a){case"anchor":R=Ho("a",{...S,href:l?void 0:I,ref:g,children:Ho(Eu,{icon:u,showTooltip:w,tooltip:y,children:s})});break;case"link":l&&(R=Ho("div",{...S,children:Ho(Eu,{icon:u,showTooltip:w,tooltip:y,children:s})})),R=Ho(Kt,{...S,href:C||I,prefetch:E,children:Ho(Eu,{icon:u,showTooltip:w,tooltip:y,children:s})});break;default:R=Ho(a,{ref:g,type:"submit",...S,children:Ho(Eu,{icon:u,showTooltip:w,tooltip:y,children:s})});break}return v?Pu("div",{className:T,children:[R,Ho(fo,{button:Ho(Je,{}),buttonSize:x,className:l&&!c?`${eo}--popup-disabled`:"",disabled:l&&!c,horizontalAlign:"right",id:`${e}-popup`,noBackground:!0,render:({close:F})=>v({close:()=>F()}),size:"large",verticalAlign:"bottom"})]}):R};import{c as DT}from"react/compiler-runtime";import{jsx as TT}from"react/jsx-runtime";import{Fragment as AT}from"react";import{c as _T}from"react/compiler-runtime";import Wv,{useMemo as Lu,useRef as lp,useEffect as ku,useState as sT,useContext as iT}from"react";import{useDndContext as aT,getClientRect as lT,useDroppable as cT,useDraggable as uT,closestCorners as dT,getFirstCollision as mT,getScrollableAncestors as fT,KeyboardCode as Vn}from"@dnd-kit/core";import{useMemo as Ov,useLayoutEffect as QD,useEffect as KD,useRef as xH,useCallback as CH}from"react";function Mv(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return Ov(()=>n=>{e.forEach(r=>r(n))},e)}var eT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function tT(t){let e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function oT(t){return"nodeType"in t}function rT(t){var e,o;return t?tT(t)?t:oT(t)&&(e=(o=t.ownerDocument)==null?void 0:o.defaultView)!=null?e:window:window}var ap=eT?QD:KD;var ip={};function Bv(t,e){return Ov(()=>{if(e)return e;let o=ip[t]==null?0:ip[t]+1;return ip[t]=o,t+"-"+o},[t,e])}function nT(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 l=Object.entries(i);for(let[a,c]of l){let u=s[a];u!=null&&(s[a]=u+t*c)}return s},{...e})}}var Vv=nT(-1);function Gv(t){if(!t)return!1;let{KeyboardEvent:e}=rT(t.target);return e&&t instanceof e}var Qa=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[Qa.Translate.toString(t),Qa.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:o,easing:n}=t;return e+" "+o+"ms "+n}}});function ju(t,e,o){let n=t.slice();return n.splice(o<0?n.length+o:o,0,n.splice(e,1)[0]),n}function pT(t,e){return t.reduce((o,n,r)=>{let s=e.get(n);return s&&(o[r]=s),o},Array(t.length))}function Nu(t){return t!==null&&t>=0}function hT(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 gT(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}var zv=t=>{let{rects:e,activeIndex:o,overIndex:n,index:r}=t,s=ju(e,n,o),i=e[r],l=s[r];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}};var Hv="Sortable",Xv=Wv.createContext({activeIndex:-1,containerId:Hv,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:zv,disabled:{draggable:!1,droppable:!1}});function Uv(t){let{children:e,id:o,items:n,strategy:r=zv,disabled:s=!1}=t,{active:i,dragOverlay:l,droppableRects:a,over:c,measureDroppableContainers:u}=aT(),d=Bv(Hv,o),f=l.rect!==null,m=Lu(()=>n.map(I=>typeof I=="object"&&"id"in I?I.id:I),[n]),h=i!=null,p=i?m.indexOf(i.id):-1,g=c?m.indexOf(c.id):-1,b=lp(m),x=!hT(m,b.current),v=g!==-1&&p===-1||x,C=gT(s);ap(()=>{x&&h&&u(m)},[x,m,h,u]),ku(()=>{b.current=m},[m]);let y=Lu(()=>({activeIndex:p,containerId:d,disabled:C,disableTransforms:v,items:m,overIndex:g,useDragOverlay:f,sortedRects:pT(m,a),strategy:r}),[p,d,C.draggable,C.droppable,v,m,g,a,f,r]);return Wv.createElement(Xv.Provider,{value:y},e)}var bT=t=>{let{id:e,items:o,activeIndex:n,overIndex:r}=t;return ju(o,n,r).indexOf(e)},vT=t=>{let{containerId:e,isSorting:o,wasDragging:n,index:r,items:s,newIndex:i,previousItems:l,previousContainerId:a,transition:c}=t;return!c||!n||l!==s&&r===i?!1:o?!0:i!==r&&e===a},xT={duration:200,easing:"ease"},Yv="transform",CT=Qa.Transition.toString({property:Yv,duration:0,easing:"linear"}),yT={roleDescription:"sortable"};function wT(t){let{disabled:e,index:o,node:n,rect:r}=t,[s,i]=sT(null),l=lp(o);return ap(()=>{if(!e&&o!==l.current&&n.current){let a=r.current;if(a){let c=lT(n.current,{ignoreTransform:!0}),u={x:a.left-c.left,y:a.top-c.top,scaleX:a.width/c.width,scaleY:a.height/c.height};(u.x||u.y)&&i(u)}}o!==l.current&&(l.current=o)},[e,o,n,r]),ku(()=>{s&&i(null)},[s]),s}function Zv(t){let{animateLayoutChanges:e=vT,attributes:o,disabled:n,data:r,getNewIndex:s=bT,id:i,strategy:l,resizeObserverConfig:a,transition:c=xT}=t,{items:u,containerId:d,activeIndex:f,disabled:m,disableTransforms:h,sortedRects:p,overIndex:g,useDragOverlay:b,strategy:x}=iT(Xv),v=IT(n,m),C=u.indexOf(i),y=Lu(()=>({sortable:{containerId:d,index:C,items:u},...r}),[d,r,C,u]),I=Lu(()=>u.slice(u.indexOf(i)),[u,i]),{rect:w,node:A,isOver:_,setNodeRef:D}=cT({id:i,data:y,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...a}}),{active:T,activatorEvent:S,activeNodeRect:R,attributes:E,setNodeRef:F,listeners:L,isDragging:k,over:N,setActivatorNodeRef:P,transform:j}=uT({id:i,data:y,attributes:{...yT,...o},disabled:v.draggable}),V=Mv(D,F),M=!!T,O=M&&!h&&Nu(f)&&Nu(g),B=!b&&k,G=B&&O?j:null,X=O?G??(l??x)({rects:p,activeNodeRect:R,activeIndex:f,overIndex:g,index:C}):null,ee=Nu(f)&&Nu(g)?s({id:i,items:u,activeIndex:f,overIndex:g}):C,q=T?.id,z=lp({activeId:q,items:u,newIndex:ee,containerId:d}),re=u!==z.current.items,me=e({active:T,containerId:d,isDragging:k,isSorting:M,id:i,index:C,items:u,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:c,wasDragging:z.current.activeId!=null}),se=wT({disabled:!me,index:C,node:A,rect:w});return ku(()=>{M&&z.current.newIndex!==ee&&(z.current.newIndex=ee),d!==z.current.containerId&&(z.current.containerId=d),u!==z.current.items&&(z.current.items=u)},[M,ee,d,u]),ku(()=>{if(q===z.current.activeId)return;if(q&&!z.current.activeId){z.current.activeId=q;return}let Q=setTimeout(()=>{z.current.activeId=q},50);return()=>clearTimeout(Q)},[q]),{active:T,activeIndex:f,attributes:E,data:y,rect:w,index:C,newIndex:ee,items:u,isOver:_,isSorting:M,isDragging:k,listeners:L,node:A,overIndex:g,over:N,setNodeRef:V,setActivatorNodeRef:P,setDroppableNodeRef:D,setDraggableNodeRef:F,transform:se??X,transition:Z()};function Z(){if(se||re&&z.current.newIndex===C)return CT;if(!(B&&!Gv(S)||!c)&&(M||me))return Qa.Transition.toString({...c,property:Yv})}}function IT(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 $u(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 ST=[Vn.Down,Vn.Right,Vn.Up,Vn.Left],Jv=(t,e)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:s,over:i,scrollableAncestors:l}}=e;if(ST.includes(t.code)){if(t.preventDefault(),!o||!n)return;let a=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;let f=r.get(d.id);if(f)switch(t.code){case Vn.Down:n.top<f.top&&a.push(d);break;case Vn.Up:n.top>f.top&&a.push(d);break;case Vn.Left:n.left>f.left&&a.push(d);break;case Vn.Right:n.left<f.left&&a.push(d);break}});let c=dT({active:o,collisionRect:n,droppableRects:r,droppableContainers:a,pointerCoordinates:null}),u=mT(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=fT(h).some((I,w)=>l[w]!==I),b=qv(d,f),x=RT(d,f),v=g||!b?{x:0,y:0}:{x:x?n.width-m.width:0,y:x?n.height-m.height:0},C={x:m.left,y:m.top};return v.x&&v.y?C:Vv(C,v)}}}};function qv(t,e){return!$u(t)||!$u(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function RT(t,e){return!$u(t)||!$u(e)||!qv(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}var Ai=t=>{let e=_T(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:l,listeners:a,setNodeRef:c,transform:u,transition:d}=Zv(s),f=l?"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]!==l||e[11]!==a||e[12]!==c||e[13]!==h||e[14]!==p||e[15]!==d?(g={attributes:h,isDragging:l,listeners:a,setNodeRef:c,transform:p,transition:d},e[10]=l,e[11]=a,e[12]=c,e[13]=h,e[14]=p,e[15]=d,e[16]=g):g=e[16],g};var Gn=t=>{let e=DT(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:l,listeners:a,setNodeRef:c,transform:u,transition:d}=Ai(s),f=l?"grabbing":"grab",m;return e[3]!==i||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==f||e[9]!==u||e[10]!==d?(m=TT(AT,{children:n({attributes:{...i,style:{cursor:f}},isDragging:l,listeners:a,setNodeRef:c,transform:u,transition:d})}),e[3]=i,e[4]=n,e[5]=l,e[6]=a,e[7]=c,e[8]=f,e[9]=u,e[10]=d,e[11]=m):m=e[11],m};import{c as FT}from"react/compiler-runtime";import{jsx as cp}from"react/jsx-runtime";import{closestCenter as ET,DndContext as PT,KeyboardSensor as NT,PointerSensor as LT,useDroppable as kT,useSensor as Qv,useSensors as $T}from"@dnd-kit/core";import{useId as jT}from"react";var zr=t=>{let e=FT(15),{children:o,className:n,ids:r,onDragEnd:s}=t,i=jT(),l;e[0]!==i?(l={id:i},e[0]=i,e[1]=l):l=e[1];let{setNodeRef:a}=kT(l),c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={activationConstraint:{distance:5}},e[2]=c):c=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Jv},e[3]=u):u=e[3];let d=$T(Qv(LT,c),Qv(NT,u)),f;e[4]!==r||e[5]!==s?(f=p=>{let{active:g,over:b}=p;p.activatorEvent.stopPropagation(),!(!g||!b)&&typeof s=="function"&&s({event:p,moveFromIndex:r.findIndex(x=>x===g.id),moveToIndex:r.findIndex(x=>x===b.id)})},e[4]=r,e[5]=s,e[6]=f):f=e[6];let m=f,h;return e[7]!==o||e[8]!==n||e[9]!==m||e[10]!==i||e[11]!==r||e[12]!==d||e[13]!==a?(h=cp(PT,{collisionDetection:ET,id:i,onDragEnd:m,sensors:d,children:cp(Uv,{items:r,children:cp("div",{className:n,ref:a,children:o})})}),e[7]=o,e[8]=n,e[9]=m,e[10]=i,e[11]=r,e[12]=d,e[13]=a,e[14]=h):h=e[14],h};import{jsx as Kv,jsxs as OT}from"react/jsx-runtime";import"react";var Ou="error-pill",to=t=>{let{className:e,count:o,i18n:n,withMessage:r}=t,s=!r&&o<99,i=[Ou,s&&`${Ou}--fixed-width`,e&&e].filter(Boolean).join(" ");return o===0?null:Kv("div",{className:i,children:OT("div",{className:`${Ou}__content`,children:[Kv("span",{className:`${Ou}__count`,children:o}),r&&` ${o>1?n.t("general:errors"):n.t("general:error")}`]})})};import{c as MT}from"react/compiler-runtime";import{jsx as BT}from"react/jsx-runtime";import{getTranslation as VT}from"@payloadcms/translations";import"react";var e0="field-description",We=t=>{let e=MT(8),{className:o,description:n,marginPlacement:r,path:s}=t,{i18n:i}=$();if(n){let l=`field-description-${s?.replace(/\./g,"__")}`,a=r&&`${e0}--margin-${r}`,c;e[0]!==o||e[1]!==l||e[2]!==a?(c=[e0,o,l,a].filter(Boolean),e[0]=o,e[1]=l,e[2]=a,e[3]=c):c=e[3];let u=c.join(" "),d;return e[4]!==n||e[5]!==i||e[6]!==u?(d=BT("div",{className:u,children:VT(n,i)}),e[4]=n,e[5]=i,e[6]=u,e[7]=d):d=e[7],d}return null};import{c as GT}from"react/compiler-runtime";import{jsx as WT}from"react/jsx-runtime";import"react";var zT="field-error",Xe=t=>{let e=GT(7),{alignCaret:o,message:n,path:r,showError:s}=t,i=o===void 0?"right":o,l=zt(),a;e[0]!==r?(a=p=>{let[g]=p;return g&&g?.[r]||null},e[0]=r,e[1]=a):a=e[1];let c=Et(a),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||l&&f===!1)&&m?.length){let p;return e[4]!==i||e[5]!==m?(p=WT(po,{alignCaret:i,className:zT,delay:0,staticPositioning:!0,children:m}),e[4]=i,e[5]=m,e[6]=p):p=e[6],p}return null};import{c as AF}from"react/compiler-runtime";import{jsx as FF,jsxs as Y0}from"react/jsx-runtime";import{getTranslation as EF}from"@payloadcms/translations";import"react";import{c as HT}from"react/compiler-runtime";import{jsx as XT}from"react/jsx-runtime";import{createContext as UT,use as YT}from"react";var t0=UT(0),Ts=t=>{let e=HT(3),{children:o}=t,r=ut()+1,s;return e[0]!==o||e[1]!==r?(s=XT(t0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},ut=()=>YT(t0);import{c as wF}from"react/compiler-runtime";import{jsx as G0}from"react/jsx-runtime";import{useSearchParams as IF}from"next/navigation.js";import SF,{createContext as z0,use as H0,useEffect as W0,useRef as RF,useState as _F}from"react";var Wn=(t,e)=>!t?.locales||t.locales.length===0?null:t.locales.find(o=>o?.code===e);import{jsx as mF}from"react/jsx-runtime";import{jsx as vp}from"react/jsx-runtime";import{useRef as m0,useEffect as Es,useState as xp}from"react";import lA from"react-dom";function ye(){return ye=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},ye.apply(null,arguments)}function Fi(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 Ei(t,e){return Ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,n){return o.__proto__=n,o},Ei(t,e)}function Mu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ei(t,e)}function up(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function dp(t,e){t.classList?t.classList.add(e):up(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function o0(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function mp(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=o0(t.className,e):t.setAttribute("class",o0(t.className&&t.className.baseVal||"",e))}import n0 from"react";import Vu from"react";import Gu from"react-dom";var fp={disabled:!1};import ZT from"react";var pp=ZT.createContext(null);var Bu=function(e){return e.scrollTop};var Ka="unmounted",As="exited",Fs="entering",Ni="entered",hp="exiting",ln=function(t){Mu(e,t);function e(n,r){var s;s=t.call(this,n,r)||this;var i=r,l=i&&!i.isMounting?n.enter:n.appear,a;return s.appearStatus=null,n.in?l?(a=As,s.appearStatus=Fs):a=Ni:n.unmountOnExit||n.mountOnEnter?a=Ka:a=As,s.state={status:a},s.nextCallback=null,s}e.getDerivedStateFromProps=function(r,s){var i=r.in;return i&&s.status===Ka?{status:As}: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!==Fs&&i!==Ni&&(s=Fs):(i===Fs||i===Ni)&&(s=hp)}this.updateStatus(!1,s)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var r=this.props.timeout,s,i,l;return s=i=l=r,r!=null&&typeof r!="number"&&(s=r.exit,i=r.enter,l=r.appear!==void 0?r.appear:i),{exit:s,enter:i,appear:l}},o.updateStatus=function(r,s){if(r===void 0&&(r=!1),s!==null)if(this.cancelNextCallback(),s===Fs){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:Gu.findDOMNode(this);i&&Bu(i)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===As&&this.setState({status:Ka})},o.performEnter=function(r){var s=this,i=this.props.enter,l=this.context?this.context.isMounting:r,a=this.props.nodeRef?[l]:[Gu.findDOMNode(this),l],c=a[0],u=a[1],d=this.getTimeouts(),f=l?d.appear:d.enter;if(!r&&!i||fp.disabled){this.safeSetState({status:Ni},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Fs},function(){s.props.onEntering(c,u),s.onTransitionEnd(f,function(){s.safeSetState({status:Ni},function(){s.props.onEntered(c,u)})})})},o.performExit=function(){var r=this,s=this.props.exit,i=this.getTimeouts(),l=this.props.nodeRef?void 0:Gu.findDOMNode(this);if(!s||fp.disabled){this.safeSetState({status:As},function(){r.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:hp},function(){r.props.onExiting(l),r.onTransitionEnd(i.exit,function(){r.safeSetState({status:As},function(){r.props.onExited(l)})})})},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(l){i&&(i=!1,s.nextCallback=null,r(l))},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:Gu.findDOMNode(this),l=r==null&&!this.props.addEndListener;if(!i||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=a[0],u=a[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},o.render=function(){var r=this.state.status;if(r===Ka)return null;var s=this.props,i=s.children,l=s.in,a=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,x=s.onExit,v=s.onExiting,C=s.onExited,y=s.nodeRef,I=Fi(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Vu.createElement(pp.Provider,{value:null},typeof i=="function"?i(r,I):Vu.cloneElement(Vu.Children.only(i),I))},e}(Vu.Component);ln.contextType=pp;ln.propTypes={};function Pi(){}ln.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Pi,onEntering:Pi,onEntered:Pi,onExit:Pi,onExiting:Pi,onExited:Pi};ln.UNMOUNTED=Ka;ln.EXITED=As;ln.ENTERING=Fs;ln.ENTERED=Ni;ln.EXITING=hp;var r0=ln;var JT=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return dp(e,n)})},gp=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return mp(e,n)})},bp=function(t){Mu(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(l,a){var c=n.resolveArguments(l,a),u=c[0],d=c[1];n.removeClasses(u,"exit"),n.addClass(u,d?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(l,a)},n.onEntering=function(l,a){var c=n.resolveArguments(l,a),u=c[0],d=c[1],f=d?"appear":"enter";n.addClass(u,f,"active"),n.props.onEntering&&n.props.onEntering(l,a)},n.onEntered=function(l,a){var c=n.resolveArguments(l,a),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(l,a)},n.onExit=function(l){var a=n.resolveArguments(l),c=a[0];n.removeClasses(c,"appear"),n.removeClasses(c,"enter"),n.addClass(c,"exit","base"),n.props.onExit&&n.props.onExit(l)},n.onExiting=function(l){var a=n.resolveArguments(l),c=a[0];n.addClass(c,"exit","active"),n.props.onExiting&&n.props.onExiting(l)},n.onExited=function(l){var a=n.resolveArguments(l),c=a[0];n.removeClasses(c,"exit"),n.addClass(c,"exit","done"),n.props.onExited&&n.props.onExited(l)},n.resolveArguments=function(l,a){return n.props.nodeRef?[n.props.nodeRef.current,l]:[l,a]},n.getClassNames=function(l){var a=n.props.classNames,c=typeof a=="string",u=c&&a?a+"-":"",d=c?""+u+l:a[l],f=c?d+"-active":a[l+"Active"],m=c?d+"-done":a[l+"Done"];return{baseClassName:d,activeClassName:f,doneClassName:m}},n}var o=e.prototype;return o.addClass=function(r,s,i){var l=this.getClassNames(s)[i+"ClassName"],a=this.getClassNames("enter"),c=a.doneClassName;s==="appear"&&i==="done"&&c&&(l+=" "+c),i==="active"&&r&&Bu(r),l&&(this.appliedClasses[s][i]=l,JT(r,l))},o.removeClasses=function(r,s){var i=this.appliedClasses[s],l=i.base,a=i.active,c=i.done;this.appliedClasses[s]={},l&&gp(r,l),a&&gp(r,a),c&&gp(r,c)},o.render=function(){var r=this.props,s=r.classNames,i=Fi(r,["classNames"]);return n0.createElement(r0,ye({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(n0.Component);bp.defaultProps={classNames:""};bp.propTypes={};var el=bp;function s0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}import{useContext as QT}from"react";import{createContext as qT}from"react";var Wu=qT({});var de=()=>QT(Wu);var zu=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`}:{};Y_();function i0(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 a0(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?i0(Object(o),!0).forEach(function(n){KT(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):i0(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function KT(t,e,o){return e=tA(e),e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function eA(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 tA(t){var e=eA(t,"string");return typeof e=="symbol"?e:String(e)}var l0={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()}},oA=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},rA=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},ol=function(e){return e?.key==="Tab"||e?.keyCode===9},nA=function(e){return ol(e)&&!e.shiftKey},sA=function(e){return ol(e)&&e.shiftKey},c0=function(e){return setTimeout(e,0)},u0=function(e,o){var n=-1;return e.every(function(r,s){return o(r)?(n=s,!1):!0}),n},tl=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},Hu=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},iA=[],d0=function(e,o){var n=o?.document||document,r=o?.trapStack||iA,s=a0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:nA,isKeyBackward:sA},o),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,a=function(S,R,E){return S&&S[R]!==void 0?S[R]:s[E||R]},c=function(S,R){var E=typeof R?.composedPath=="function"?R.composedPath():void 0;return i.containerGroups.findIndex(function(F){var L=F.container,k=F.tabbableNodes;return L.contains(S)||E?.includes(L)||k.find(function(N){return N===S})})},u=function(S){var R=s[S];if(typeof R=="function"){for(var E=arguments.length,F=new Array(E>1?E-1:0),L=1;L<E;L++)F[L-1]=arguments[L];R=R.apply(void 0,F)}if(R===!0&&(R=void 0),!R){if(R===void 0||R===!1)return R;throw new Error("`".concat(S,"` was specified but was not a node, or did not return a node"))}var k=R;if(typeof R=="string"&&(k=n.querySelector(R),!k))throw new Error("`".concat(S,"` as selector refers to no known node"));return k},d=function(){var S=u("initialFocus");if(S===!1)return!1;if(S===void 0||!fu(S,s.tabbableOptions))if(c(n.activeElement)>=0)S=n.activeElement;else{var R=i.tabbableGroups[0],E=R&&R.firstTabbableNode;S=E||u("fallbackFocus")}if(!S)throw new Error("Your focus-trap needs to have at least one focusable element");return S},f=function(){if(i.containerGroups=i.containers.map(function(S){var R=Z1(S,s.tabbableOptions),E=J1(S,s.tabbableOptions),F=R.length>0?R[0]:void 0,L=R.length>0?R[R.length-1]:void 0,k=E.find(function(j){return Is(j)}),N=E.slice().reverse().find(function(j){return Is(j)}),P=!!R.find(function(j){return Ri(j)>0});return{container:S,tabbableNodes:R,focusableNodes:E,posTabIndexesFound:P,firstTabbableNode:F,lastTabbableNode:L,firstDomTabbableNode:k,lastDomTabbableNode:N,nextTabbableNode:function(V){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,O=R.indexOf(V);return O<0?M?E.slice(E.indexOf(V)+1).find(function(B){return Is(B)}):E.slice(0,E.indexOf(V)).reverse().find(function(B){return Is(B)}):R[O+(M?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(S){return S.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(S){return S.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 T(S){var R=S.activeElement;if(R)return R.shadowRoot&&R.shadowRoot.activeElement!==null?T(R.shadowRoot):R},h=function T(S){if(S!==!1&&S!==m(document)){if(!S||!S.focus){T(d());return}S.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=S,oA(S)&&S.select()}},p=function(S){var R=u("setReturnFocus",S);return R||(R===!1?!1:S)},g=function(S){var R=S.target,E=S.event,F=S.isBackward,L=F===void 0?!1:F;R=R||Hu(E),f();var k=null;if(i.tabbableGroups.length>0){var N=c(R,E),P=N>=0?i.containerGroups[N]:void 0;if(N<0)L?k=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:k=i.tabbableGroups[0].firstTabbableNode;else if(L){var j=u0(i.tabbableGroups,function(Y){var X=Y.firstTabbableNode;return R===X});if(j<0&&(P.container===R||fu(R,s.tabbableOptions)&&!Is(R,s.tabbableOptions)&&!P.nextTabbableNode(R,!1))&&(j=N),j>=0){var V=j===0?i.tabbableGroups.length-1:j-1,M=i.tabbableGroups[V];k=Ri(R)>=0?M.lastTabbableNode:M.lastDomTabbableNode}else ol(E)||(k=P.nextTabbableNode(R,!1))}else{var O=u0(i.tabbableGroups,function(Y){var X=Y.lastTabbableNode;return R===X});if(O<0&&(P.container===R||fu(R,s.tabbableOptions)&&!Is(R,s.tabbableOptions)&&!P.nextTabbableNode(R))&&(O=N),O>=0){var B=O===i.tabbableGroups.length-1?0:O+1,G=i.tabbableGroups[B];k=Ri(R)>=0?G.firstTabbableNode:G.firstDomTabbableNode}else ol(E)||(k=P.nextTabbableNode(R))}}else k=u("fallbackFocus");return k},b=function(S){var R=Hu(S);if(!(c(R,S)>=0)){if(tl(s.clickOutsideDeactivates,S)){l.deactivate({returnFocus:s.returnFocusOnDeactivate});return}tl(s.allowOutsideClick,S)||S.preventDefault()}},x=function(S){var R=Hu(S),E=c(R,S)>=0;if(E||R instanceof Document)E&&(i.mostRecentlyFocusedNode=R);else{S.stopImmediatePropagation();var F,L=!0;if(i.mostRecentlyFocusedNode)if(Ri(i.mostRecentlyFocusedNode)>0){var k=c(i.mostRecentlyFocusedNode),N=i.containerGroups[k].tabbableNodes;if(N.length>0){var P=N.findIndex(function(j){return j===i.mostRecentlyFocusedNode});P>=0&&(s.isKeyForward(i.recentNavEvent)?P+1<N.length&&(F=N[P+1],L=!1):P-1>=0&&(F=N[P-1],L=!1))}}else i.containerGroups.some(function(j){return j.tabbableNodes.some(function(V){return Ri(V)>0})})||(L=!1);else L=!1;L&&(F=g({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),h(F||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},v=function(S){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=S;var E=g({event:S,isBackward:R});E&&(ol(S)&&S.preventDefault(),h(E))},C=function(S){if(rA(S)&&tl(s.escapeDeactivates,S)!==!1){S.preventDefault(),l.deactivate();return}(s.isKeyForward(S)||s.isKeyBackward(S))&&v(S,s.isKeyBackward(S))},y=function(S){var R=Hu(S);c(R,S)>=0||tl(s.clickOutsideDeactivates,S)||tl(s.allowOutsideClick,S)||(S.preventDefault(),S.stopImmediatePropagation())},I=function(){if(i.active)return l0.activateTrap(r,l),i.delayInitialFocusTimer=s.delayInitialFocus?c0(function(){h(d())}):h(d()),n.addEventListener("focusin",x,!0),n.addEventListener("mousedown",b,{capture:!0,passive:!1}),n.addEventListener("touchstart",b,{capture:!0,passive:!1}),n.addEventListener("click",y,{capture:!0,passive:!1}),n.addEventListener("keydown",C,{capture:!0,passive:!1}),l},w=function(){if(i.active)return n.removeEventListener("focusin",x,!0),n.removeEventListener("mousedown",b,!0),n.removeEventListener("touchstart",b,!0),n.removeEventListener("click",y,!0),n.removeEventListener("keydown",C,!0),l},A=function(S){var R=S.some(function(E){var F=Array.from(E.removedNodes);return F.some(function(L){return L===i.mostRecentlyFocusedNode})});R&&h(d())},_=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,D=function(){_&&(_.disconnect(),i.active&&!i.paused&&i.containers.map(function(S){_.observe(S,{subtree:!0,childList:!0})}))};return l={get active(){return i.active},get paused(){return i.paused},activate:function(S){if(i.active)return this;var R=a(S,"onActivate"),E=a(S,"onPostActivate"),F=a(S,"checkCanFocusTrap");F||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=n.activeElement,R?.();var L=function(){F&&f(),I(),D(),E?.()};return F?(F(i.containers.concat()).then(L,L),this):(L(),this)},deactivate:function(S){if(!i.active)return this;var R=a0({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},S);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,w(),i.active=!1,i.paused=!1,D(),l0.deactivateTrap(r,l);var E=a(R,"onDeactivate"),F=a(R,"onPostDeactivate"),L=a(R,"checkCanReturnFocus"),k=a(R,"returnFocus","returnFocusOnDeactivate");E?.();var N=function(){c0(function(){k&&h(p(i.nodeFocusedBeforeActivation)),F?.()})};return k&&L?(L(p(i.nodeFocusedBeforeActivation)).then(N,N),this):(N(),this)},pause:function(S){if(i.paused||!i.active)return this;var R=a(S,"onPause"),E=a(S,"onPostPause");return i.paused=!0,R?.(),w(),D(),E?.(),this},unpause:function(S){if(!i.paused||!i.active)return this;var R=a(S,"onUnpause"),E=a(S,"onPostUnpause");return i.paused=!1,R?.(),f(),I(),D(),E?.(),this},updateContainerElements:function(S){var R=[].concat(S).filter(Boolean);return i.containers=R.map(function(E){return typeof E=="string"?n.querySelector(E):E}),i.active&&f(),D(),this}},l.updateContainerElements(e),l};var aA=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},cn="modal-item",f0=(t,e)=>n=>{let r=de(),s=m0(null),[i,l]=xp(!1),a=m0(!1),[c,u]=xp(null),{modalState:d,classPrefix:f,containerRef:m,transTime:h,setCloseOnBlur:p,setBodyScrollLock:g,openModal:b}=r,{className:x,htmlElement:v="dialog",slug:C="",closeOnBlur:y=!0,lockBodyScroll:I=!0,classPrefix:w,onEnter:A,onEntering:_,onEntered:D,onExit:T,onExiting:S,onExited:R,openOnInit:E,trapFocus:F=!0,focusTrapOptions:L={}}=n,k=aA(n,["className","htmlElement","slug","closeOnBlur","lockBodyScroll","classPrefix","onEnter","onEntering","onEntered","onExit","onExiting","onExited","openOnInit","trapFocus","focusTrapOptions"]),N=w||f,P=e||C,j=d[P]&&d[P].isOpen;Es(()=>{if(F){let O=s.current;if(a.current===!1&&O){let B=d0(O,Object.assign(Object.assign({},L),{fallbackFocus:L?.fallbackFocus||O,allowOutsideClick:typeof L.allowOutsideClick<"u"?L.allowOutsideClick:!0}));u(B),a.current=!0}}},[F,i,L]),Es(()=>{l(!0)},[]),Es(()=>(c&&(j?c.activate():c.deactivate()),()=>{c&&c.deactivate()}),[j,c]),Es(()=>{j&&p(y)},[j,y,p]),Es(()=>{let O=s.current;return O&&g(!!(j&&I),O),()=>{O&&g(!1,O)}},[j,I,g]);let[V,M]=xp(j);if(Es(()=>{j?M(j):setTimeout(()=>M(!1),h)},[j,h]),Es(()=>{E&&b(P)},[P,E,b]),m.current){let O=N?`${N}__${cn}`:cn,B=[O,`${O}--slug-${P}`,x].filter(Boolean).join(" "),G=Object.assign({role:v!=="dialog"?"dialog":void 0,open:v==="dialog"?V||j:void 0,"aria-modal":!0,"aria-label":k["aria-labelledby"]?void 0:P},k);return lA.createPortal(vp(el,{nodeRef:s,timeout:h,in:j,classNames:zu(O),appear:!0,onEnter:A,onEntering:_,onEntered:D,onExit:T,onExiting:S,onExited:R,children:vp(v,Object.assign({ref:s,id:k?.id||P,className:B},G,{children:vp(t,Object.assign({},n,{isOpen:j,modal:r}))}))}),m.current)}return null};import{jsx as p0}from"react/jsx-runtime";import{Fragment as h0}from"react";var cA=t=>{let{children:e}=t;return e?typeof e=="function"?p0(h0,{children:e(t)}):p0(h0,{children:e}):null},Xo=f0(cA);import{jsx as g0}from"react/jsx-runtime";var uA=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},un="modal-container",Cp=t=>{let{oneModalIsOpen:e,classPrefix:o,transTime:n,setContainerRef:r,containerRef:s,closeAllModals:i,closeOnBlur:l}=de(),{className:a,htmlElement:c="div",children:u,onClick:d}=t,f=uA(t,["className","htmlElement","children","onClick"]),m=o?`${o}__${un}`:un,h=[m,a].filter(Boolean).join(" "),p=Object.assign(Object.assign({},f),{onClick:g=>{l&&i(),typeof d=="function"&&d(g)}});return g0(el,{nodeRef:s,in:e,timeout:n,classNames:zu(m),appear:!0,children:g0(c,Object.assign({className:h,ref:r},p,{children:u&&u}))})};import{jsx as I0,jsxs as vA}from"react/jsx-runtime";import{Fragment as xA,useState as Zu,useRef as S0,useEffect as Ju,useCallback as zn,useReducer as CA}from"react";function dA(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 wp=!1;typeof window<"u"&&(yp={get passive(){wp=!0}},window.addEventListener("testPassive",null,yp),window.removeEventListener("testPassive",null,yp));var yp,Xu=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),Ns=[],Uu=!1,b0=-1,rl=void 0,Ps=void 0,nl=void 0,v0=function(e){return Ns.some(function(o){return!!(o.options.allowTouchMove&&o.options.allowTouchMove(e))})},Yu=function(e){var o=e||window.event;return v0(o.target)||o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)},mA=function(e){if(nl===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);nl=document.body.style.paddingRight,document.body.style.paddingRight=r+n+"px"}}rl===void 0&&(rl=document.body.style.overflow,document.body.style.overflow="hidden")},fA=function(){nl!==void 0&&(document.body.style.paddingRight=nl,nl=void 0),rl!==void 0&&(document.body.style.overflow=rl,rl=void 0)},pA=function(){return window.requestAnimationFrame(function(){if(Ps===void 0){Ps={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)}})},hA=function(){if(Ps!==void 0){var e=-parseInt(document.body.style.top,10),o=-parseInt(document.body.style.left,10);document.body.style.position=Ps.position,document.body.style.top=Ps.top,document.body.style.left=Ps.left,window.scrollTo(o,e),Ps=void 0}},gA=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},bA=function(e,o){var n=e.targetTouches[0].clientY-b0;return v0(e.target)?!1:o&&o.scrollTop===0&&n>0||gA(o)&&n<0?Yu(e):(e.stopPropagation(),!0)},x0=function(e,o){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Ns.some(function(r){return r.targetElement===e})){var n={targetElement:e,options:o||{}};Ns=[].concat(dA(Ns),[n]),Xu?pA():mA(o),Xu&&(e.ontouchstart=function(r){r.targetTouches.length===1&&(b0=r.targetTouches[0].clientY)},e.ontouchmove=function(r){r.targetTouches.length===1&&bA(r,e)},Uu||(document.addEventListener("touchmove",Yu,wp?{passive:!1}:void 0),Uu=!0))}};var C0=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Ns=Ns.filter(function(o){return o.targetElement!==e}),Xu&&(e.ontouchstart=null,e.ontouchmove=null,Uu&&Ns.length===0&&(document.removeEventListener("touchmove",Yu,wp?{passive:!1}:void 0),Uu=!1)),Xu?hA():fA()};var y0=({classPrefix:t,zIndex:e})=>{let o=t?`${t}__`:"";return`
13
+ import{a as Pf,b as W,c as Nf,d as wt,e as Z_,f as J_,g as Lf,h as q_,i as Q_}from"./chunk-PKQOCWZD.js";import{a as pt,b as za,c as Ef,d as $,e as _i,f as Z1,g as J1,h as Ss,i as fu,j as Y_,k as q1,l as K_,m as eD,n as tD}from"./chunk-3AA2TJQ5.js";import{c as xr,d as Y1,e as Is}from"./chunk-5LKBKI4T.js";var av=xr(gt=>{"use strict";function Of(t,e){var o=t.length;t.push(e);e:for(;0<o;){var n=o-1>>>1,r=t[n];if(0<pu(r,e))t[n]=e,t[o]=r,o=n;else break e}}function Cr(t){return t.length===0?null:t[0]}function gu(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,l=t[i],a=i+1,c=t[a];if(0>pu(l,o))a<r&&0>pu(c,l)?(t[n]=c,t[a]=o,n=a):(t[n]=l,t[i]=o,n=i);else if(a<r&&0>pu(c,o))t[n]=c,t[a]=o,n=a;else break e}}return e}function pu(t,e){var o=t.sortIndex-e.sortIndex;return o!==0?o:t.id-e.id}gt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Q1=performance,gt.unstable_now=function(){return Q1.now()}):(kf=Date,K1=kf.now(),gt.unstable_now=function(){return kf.now()-K1});var Q1,kf,K1,Wr=[],On=[],oD=1,ir=null,vo=3,bu=!1,Rs=!1,Xa=!1,ov=typeof setTimeout=="function"?setTimeout:null,rv=typeof clearTimeout=="function"?clearTimeout:null,ev=typeof setImmediate<"u"?setImmediate:null;function hu(t){for(var e=Cr(On);e!==null;){if(e.callback===null)gu(On);else if(e.startTime<=t)gu(On),e.sortIndex=e.expirationTime,Of(Wr,e);else break;e=Cr(On)}}function Mf(t){if(Xa=!1,hu(t),!Rs)if(Cr(Wr)!==null)Rs=!0,Bf();else{var e=Cr(On);e!==null&&Vf(Mf,e.startTime-t)}}var vu=!1,Ua=-1,nv=5,sv=-1;function iv(){return!(gt.unstable_now()-sv<nv)}function $f(){if(vu){var t=gt.unstable_now();sv=t;var e=!0;try{e:{Rs=!1,Xa&&(Xa=!1,rv(Ua),Ua=-1),bu=!0;var o=vo;try{t:{for(hu(t),ir=Cr(Wr);ir!==null&&!(ir.expirationTime>t&&iv());){var n=ir.callback;if(typeof n=="function"){ir.callback=null,vo=ir.priorityLevel;var r=n(ir.expirationTime<=t);if(t=gt.unstable_now(),typeof r=="function"){ir.callback=r,hu(t),e=!0;break t}ir===Cr(Wr)&&gu(Wr),hu(t)}else gu(Wr);ir=Cr(Wr)}if(ir!==null)e=!0;else{var s=Cr(On);s!==null&&Vf(Mf,s.startTime-t),e=!1}}break e}finally{ir=null,vo=o,bu=!1}e=void 0}}finally{e?Ha():vu=!1}}}var Ha;typeof ev=="function"?Ha=function(){ev($f)}:typeof MessageChannel<"u"?(jf=new MessageChannel,tv=jf.port2,jf.port1.onmessage=$f,Ha=function(){tv.postMessage(null)}):Ha=function(){ov($f,0)};var jf,tv;function Bf(){vu||(vu=!0,Ha())}function Vf(t,e){Ua=ov(function(){t(gt.unstable_now())},e)}gt.unstable_IdlePriority=5;gt.unstable_ImmediatePriority=1;gt.unstable_LowPriority=4;gt.unstable_NormalPriority=3;gt.unstable_Profiling=null;gt.unstable_UserBlockingPriority=2;gt.unstable_cancelCallback=function(t){t.callback=null};gt.unstable_continueExecution=function(){Rs||bu||(Rs=!0,Bf())};gt.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"):nv=0<t?Math.floor(1e3/t):5};gt.unstable_getCurrentPriorityLevel=function(){return vo};gt.unstable_getFirstCallbackNode=function(){return Cr(Wr)};gt.unstable_next=function(t){switch(vo){case 1:case 2:case 3:var e=3;break;default:e=vo}var o=vo;vo=e;try{return t()}finally{vo=o}};gt.unstable_pauseExecution=function(){};gt.unstable_requestPaint=function(){};gt.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var o=vo;vo=t;try{return e()}finally{vo=o}};gt.unstable_scheduleCallback=function(t,e,o){var n=gt.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:oD++,callback:e,priorityLevel:t,startTime:o,expirationTime:r,sortIndex:-1},o>n?(t.sortIndex=o,Of(On,t),Cr(Wr)===null&&t===Cr(On)&&(Xa?(rv(Ua),Ua=-1):Xa=!0,Vf(Mf,o-n))):(t.sortIndex=r,Of(Wr,t),Rs||bu||(Rs=!0,Bf())),t};gt.unstable_shouldYield=iv;gt.unstable_wrapCallback=function(t){var e=vo;return function(){var o=vo;vo=e;try{return t.apply(this,arguments)}finally{vo=o}}}});var cv=xr((cW,lv)=>{"use strict";lv.exports=av()});var oy=xr(ft=>{"use strict";var ro=typeof Symbol=="function"&&Symbol.for,bh=ro?Symbol.for("react.element"):60103,vh=ro?Symbol.for("react.portal"):60106,Ad=ro?Symbol.for("react.fragment"):60107,Fd=ro?Symbol.for("react.strict_mode"):60108,Ed=ro?Symbol.for("react.profiler"):60114,Pd=ro?Symbol.for("react.provider"):60109,Nd=ro?Symbol.for("react.context"):60110,xh=ro?Symbol.for("react.async_mode"):60111,Ld=ro?Symbol.for("react.concurrent_mode"):60111,kd=ro?Symbol.for("react.forward_ref"):60112,$d=ro?Symbol.for("react.suspense"):60113,jP=ro?Symbol.for("react.suspense_list"):60120,jd=ro?Symbol.for("react.memo"):60115,Od=ro?Symbol.for("react.lazy"):60116,OP=ro?Symbol.for("react.block"):60121,MP=ro?Symbol.for("react.fundamental"):60117,BP=ro?Symbol.for("react.responder"):60118,VP=ro?Symbol.for("react.scope"):60119;function Qo(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case bh:switch(t=t.type,t){case xh:case Ld:case Ad:case Ed:case Fd:case $d:return t;default:switch(t=t&&t.$$typeof,t){case Nd:case kd:case Od:case jd:case Pd:return t;default:return e}}case vh:return e}}}function ty(t){return Qo(t)===Ld}ft.AsyncMode=xh;ft.ConcurrentMode=Ld;ft.ContextConsumer=Nd;ft.ContextProvider=Pd;ft.Element=bh;ft.ForwardRef=kd;ft.Fragment=Ad;ft.Lazy=Od;ft.Memo=jd;ft.Portal=vh;ft.Profiler=Ed;ft.StrictMode=Fd;ft.Suspense=$d;ft.isAsyncMode=function(t){return ty(t)||Qo(t)===xh};ft.isConcurrentMode=ty;ft.isContextConsumer=function(t){return Qo(t)===Nd};ft.isContextProvider=function(t){return Qo(t)===Pd};ft.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===bh};ft.isForwardRef=function(t){return Qo(t)===kd};ft.isFragment=function(t){return Qo(t)===Ad};ft.isLazy=function(t){return Qo(t)===Od};ft.isMemo=function(t){return Qo(t)===jd};ft.isPortal=function(t){return Qo(t)===vh};ft.isProfiler=function(t){return Qo(t)===Ed};ft.isStrictMode=function(t){return Qo(t)===Fd};ft.isSuspense=function(t){return Qo(t)===$d};ft.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Ad||t===Ld||t===Ed||t===Fd||t===$d||t===jP||typeof t=="object"&&t!==null&&(t.$$typeof===Od||t.$$typeof===jd||t.$$typeof===Pd||t.$$typeof===Nd||t.$$typeof===kd||t.$$typeof===MP||t.$$typeof===BP||t.$$typeof===VP||t.$$typeof===OP)};ft.typeOf=Qo});var ny=xr((Jne,ry)=>{"use strict";ry.exports=oy()});var dy=xr((qne,uy)=>{"use strict";var Ch=ny(),GP={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},WP={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},zP={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ly={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},yh={};yh[Ch.ForwardRef]=zP;yh[Ch.Memo]=ly;function sy(t){return Ch.isMemo(t)?ly:yh[t.$$typeof]||GP}var HP=Object.defineProperty,XP=Object.getOwnPropertyNames,iy=Object.getOwnPropertySymbols,UP=Object.getOwnPropertyDescriptor,YP=Object.getPrototypeOf,ay=Object.prototype;function cy(t,e,o){if(typeof e!="string"){if(ay){var n=YP(e);n&&n!==ay&&cy(t,n,o)}var r=XP(e);iy&&(r=r.concat(iy(e)));for(var s=sy(t),i=sy(e),l=0;l<r.length;++l){var a=r[l];if(!WP[a]&&!(o&&o[a])&&!(i&&i[a])&&!(s&&s[a])){var c=UP(e,a);try{HP(t,a,c)}catch{}}}}return t}uy.exports=cy});var tg=xr((Nce,R2)=>{var eg=Math.floor(Math.random()*16777215),C2=ht.index=parseInt(Math.random()*16777215,10),y2=(typeof process>"u"||typeof process.pid!="number"?Math.floor(Math.random()*1e5):process.pid)%65535,w2=(()=>{try{return _Buffer}catch{try{return Buffer}catch{return null}}})(),em=function(t){return!!(t!=null&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))},S2=[];for(Go=0;Go<256;Go++)S2[Go]=(Go<=15?"0":"")+Go.toString(16);var Go,I2=new RegExp("^[0-9a-fA-F]{24}$"),Hl=[];Go=0;for(;Go<10;)Hl[48+Go]=Go++;for(;Go<16;)Hl[55+Go]=Hl[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")}}R2.exports=ht;ht.default=ht;ht.createFromTime=function(t){return t=parseInt(t,10)%4294967295,new ht(GN(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(Hl[t.charCodeAt(o++)]<<4|Hl[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&&I2.test(t):t instanceof ht?!0:em(t)?ht.isValid(t.toString("hex")):typeof t.toHexString=="function"&&w2&&(t.id instanceof w2||typeof t.id=="string")?t.id.length===12||t.id.length===24&&I2.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(em(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=S2[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&&em(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 em(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=VN();return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255,eg>>16&255,eg>>8&255,eg&255,y2>>8&255,y2&255,e>>16&255,e>>8&255,e&255)}};function VN(){return C2=(C2+1)%16777215}function GN(t,e){return e=e.toString(16),e.length===t?e:"00000000".substring(e.length,t)+e}var WN=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";ht.prototype[WN]=function(){return"ObjectID("+this+")"};ht.prototype.toJSON=ht.prototype.toHexString;ht.prototype.toString=ht.prototype.toHexString});var Gg=xr((b1e,Z3)=>{function Vg(t){return t===void 0}function Fk(t){return t===null}function Ek(t){return typeof t=="boolean"}function Im(t){return t===Object(t)}function U3(t){return Array.isArray(t)}function Pk(t){return t instanceof Date}function Y3(t,e){return e?Im(t)&&!Vg(t.uri):Im(t)&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.slice=="function"}function Nk(t,e){return Y3(t,e)&&typeof t.name=="string"&&(Im(t.lastModifiedDate)||typeof t.lastModified=="number")}function ni(t){return Vg(t)?!1:t}function Bg(t,e,o,n){e=e||{},o=o||new FormData,e.indices=ni(e.indices),e.nullsAsUndefineds=ni(e.nullsAsUndefineds),e.booleansAsIntegers=ni(e.booleansAsIntegers),e.allowEmptyArrays=ni(e.allowEmptyArrays),e.noAttributesWithArrayNotation=ni(e.noAttributesWithArrayNotation),e.noFilesWithArrayNotation=ni(e.noFilesWithArrayNotation),e.dotsForObjectNotation=ni(e.dotsForObjectNotation);let r=typeof o.getParts=="function";return Vg(t)||(Fk(t)?e.nullsAsUndefineds||o.append(n,""):Ek(t)?e.booleansAsIntegers?o.append(n,t?1:0):o.append(n,t):U3(t)?t.length?t.forEach((s,i)=>{let l=n+"["+(e.indices?i:"")+"]";(e.noAttributesWithArrayNotation||e.noFilesWithArrayNotation&&Nk(s,r))&&(l=n),Bg(s,e,o,l)}):e.allowEmptyArrays&&o.append(e.noAttributesWithArrayNotation?n:n+"[]",""):Pk(t)?o.append(n,t.toISOString()):Im(t)&&!Y3(t,r)?Object.keys(t).forEach(s=>{let i=t[s];if(U3(i))for(;s.length>2&&s.lastIndexOf("[]")===s.length-2;)s=s.substring(0,s.length-2);let l=n?e.dotsForObjectNotation?n+"."+s:n+"["+s+"]":s;Bg(i,e,o,l)}):o.append(n,t)),o}Z3.exports={serialize:Bg}});var YS=xr((fDe,US)=>{(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}};US.exports=e})()});var Ab=xr((pDe,ZS)=>{var Tb={utf8:{stringToBytes:function(t){return Tb.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Tb.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("")}}};ZS.exports=Tb});var QS=xr((hDe,qS)=>{qS.exports=function(t){return t!=null&&(JS(t)||XM(t)||!!t._isBuffer)};function JS(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function XM(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&JS(t.slice(0,0))}});var e4=xr((gDe,KS)=>{(function(){var t=YS(),e=Ab().utf8,o=QS(),n=Ab().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 l=t.bytesToWords(s),a=s.length*8,c=1732584193,u=-271733879,d=-1732584194,f=271733878,m=0;m<l.length;m++)l[m]=(l[m]<<8|l[m]>>>24)&16711935|(l[m]<<24|l[m]>>>8)&4278255360;l[a>>>5]|=128<<a%32,l[(a+64>>>9<<4)+14]=a;for(var h=r._ff,p=r._gg,g=r._hh,b=r._ii,m=0;m<l.length;m+=16){var x=c,v=u,C=d,y=f;c=h(c,u,d,f,l[m+0],7,-680876936),f=h(f,c,u,d,l[m+1],12,-389564586),d=h(d,f,c,u,l[m+2],17,606105819),u=h(u,d,f,c,l[m+3],22,-1044525330),c=h(c,u,d,f,l[m+4],7,-176418897),f=h(f,c,u,d,l[m+5],12,1200080426),d=h(d,f,c,u,l[m+6],17,-1473231341),u=h(u,d,f,c,l[m+7],22,-45705983),c=h(c,u,d,f,l[m+8],7,1770035416),f=h(f,c,u,d,l[m+9],12,-1958414417),d=h(d,f,c,u,l[m+10],17,-42063),u=h(u,d,f,c,l[m+11],22,-1990404162),c=h(c,u,d,f,l[m+12],7,1804603682),f=h(f,c,u,d,l[m+13],12,-40341101),d=h(d,f,c,u,l[m+14],17,-1502002290),u=h(u,d,f,c,l[m+15],22,1236535329),c=p(c,u,d,f,l[m+1],5,-165796510),f=p(f,c,u,d,l[m+6],9,-1069501632),d=p(d,f,c,u,l[m+11],14,643717713),u=p(u,d,f,c,l[m+0],20,-373897302),c=p(c,u,d,f,l[m+5],5,-701558691),f=p(f,c,u,d,l[m+10],9,38016083),d=p(d,f,c,u,l[m+15],14,-660478335),u=p(u,d,f,c,l[m+4],20,-405537848),c=p(c,u,d,f,l[m+9],5,568446438),f=p(f,c,u,d,l[m+14],9,-1019803690),d=p(d,f,c,u,l[m+3],14,-187363961),u=p(u,d,f,c,l[m+8],20,1163531501),c=p(c,u,d,f,l[m+13],5,-1444681467),f=p(f,c,u,d,l[m+2],9,-51403784),d=p(d,f,c,u,l[m+7],14,1735328473),u=p(u,d,f,c,l[m+12],20,-1926607734),c=g(c,u,d,f,l[m+5],4,-378558),f=g(f,c,u,d,l[m+8],11,-2022574463),d=g(d,f,c,u,l[m+11],16,1839030562),u=g(u,d,f,c,l[m+14],23,-35309556),c=g(c,u,d,f,l[m+1],4,-1530992060),f=g(f,c,u,d,l[m+4],11,1272893353),d=g(d,f,c,u,l[m+7],16,-155497632),u=g(u,d,f,c,l[m+10],23,-1094730640),c=g(c,u,d,f,l[m+13],4,681279174),f=g(f,c,u,d,l[m+0],11,-358537222),d=g(d,f,c,u,l[m+3],16,-722521979),u=g(u,d,f,c,l[m+6],23,76029189),c=g(c,u,d,f,l[m+9],4,-640364487),f=g(f,c,u,d,l[m+12],11,-421815835),d=g(d,f,c,u,l[m+15],16,530742520),u=g(u,d,f,c,l[m+2],23,-995338651),c=b(c,u,d,f,l[m+0],6,-198630844),f=b(f,c,u,d,l[m+7],10,1126891415),d=b(d,f,c,u,l[m+14],15,-1416354905),u=b(u,d,f,c,l[m+5],21,-57434055),c=b(c,u,d,f,l[m+12],6,1700485571),f=b(f,c,u,d,l[m+3],10,-1894986606),d=b(d,f,c,u,l[m+10],15,-1051523),u=b(u,d,f,c,l[m+1],21,-2054922799),c=b(c,u,d,f,l[m+8],6,1873313359),f=b(f,c,u,d,l[m+15],10,-30611744),d=b(d,f,c,u,l[m+6],15,-1560198380),u=b(u,d,f,c,l[m+13],21,1309151649),c=b(c,u,d,f,l[m+4],6,-145523070),f=b(f,c,u,d,l[m+11],10,-1120210379),d=b(d,f,c,u,l[m+2],15,718787259),u=b(u,d,f,c,l[m+9],21,-343485551),c=c+x>>>0,u=u+v>>>0,d=d+C>>>0,f=f+y>>>0}return t.endian([c,u,d,f])};r._ff=function(s,i,l,a,c,u,d){var f=s+(i&l|~i&a)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._gg=function(s,i,l,a,c,u,d){var f=s+(i&a|l&~a)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._hh=function(s,i,l,a,c,u,d){var f=s+(i^l^a)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._ii=function(s,i,l,a,c,u,d){var f=s+(l^(i|~a))+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._blocksize=16,r._digestsize=16,KS.exports=function(s,i){if(s==null)throw new Error("Illegal argument "+s);var l=t.wordsToBytes(r(s,i));return i&&i.asBytes?l:i&&i.asString?n.bytesToString(l):t.bytesToHex(l)}})()});import{jsx as Yf}from"react/jsx-runtime";import"react";function oe({CustomComponent:t,Fallback:e}){return t!==void 0?t:e}import{jsx as hD}from"react/jsx-runtime";import fv from"react";import{createContext as Mn,use as Bn}from"react";var Ya=Is(cv(),1);import{createElement as rD,createContext as nD,useContext as sD,useEffect as iD,useLayoutEffect as aD,useReducer as lD,useRef as Gf,useState as cD}from"react";var xu=Symbol(),uD=Symbol(),dD=typeof window>"u"||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent),uv=dD?iD:aD,mD=Ya.unstable_runWithPriority?t=>{try{(0,Ya.unstable_runWithPriority)(Ya.unstable_NormalPriority,t)}catch(e){if(e.message==="Not implemented.")t();else throw e}}:t=>t(),fD=t=>({value:o,children:n})=>{let r=Gf(o),s=Gf(0),[i,l]=cD(null);i&&(i(o),l(null));let a=Gf();if(!a.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=>{l(()=>p=>{m.v=p,delete m.p,h(p)})})),c.forEach(h=>h(m)),d()};a.current={[xu]:{v:r,n:s,l:c,u}}}return uv(()=>{r.current=o,s.current+=1,mD(()=>{a.current[xu].l.forEach(c=>{c({n:s.current,v:o})})})},[o]),rD(t,{value:a.current},n)},pD=t=>t;function dv(t){let e=nD({[xu]:{v:{current:t},n:{current:-1},l:new Set,u:o=>o()}});return e[uD]=e.Provider,e.Provider=fD(e.Provider),delete e.Consumer,e}function Wf(t,e){let o=sD(t)[xu],{v:{current:n},n:{current:r},l:s}=o,i=e(n),[l,a]=lD((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(l[1],i)||a(),uv(()=>(s.add(a),()=>{s.delete(a)}),[s]),l[1]}function mv(t){return Wf(t,pD)}var Cu=Mn({}),yu=Mn({}),wu=Mn({}),Iu=Mn(!1),Su=Mn(!1),zf=Mn(!1),Ru=Mn(!1),Hf=Mn(!1),Za=dv([{},()=>null]),Me=()=>Bn(Cu),Di=()=>Bn(yu),_u=()=>Bn(wu),zt=()=>Bn(Iu),$o=()=>Bn(Su),Xf=()=>Bn(zf),Ht=()=>Bn(Ru),_s=()=>Bn(Hf),Et=t=>Wf(Za,t),Ti=()=>mv(Za);var pv=fv.createContext({data:{},path:"",rowNumber:void 0}),Uf=({children:t,path:e,rowNumber:o})=>{"use no memo";let{getDataByPath:n,getSiblingData:r}=_u(),s=r(e),l=n(e)||s;return hD(pv,{value:{data:l,path:e,rowNumber:o},children:t})},gD=()=>fv.use(pv);var bD="row-label",sn=t=>{let{className:e,CustomComponent:o,label:n,path:r,rowNumber:s}=t;return Yf(Uf,{path:r,rowNumber:s,children:Yf(oe,{CustomComponent:o,Fallback:typeof n=="string"?Yf("span",{className:[bD,e].filter(Boolean).join(" "),style:{pointerEvents:"none"},children:n}):n})})};import{c as PO}from"react/compiler-runtime";import{jsx as io,jsxs as fi}from"react/jsx-runtime";import{getTranslation as bb}from"@payloadcms/translations";import NO from"react";import{jsx as qf,jsxs as AD}from"react/jsx-runtime";import Cv from"react";import{jsx as RD}from"react/jsx-runtime";import xv from"next/link.js";import{useRouter as _D}from"next/navigation.js";import"react";import{c as vD}from"react/compiler-runtime";import{jsx as xD}from"react/jsx-runtime";import Zf,{startTransition as CD,useEffect as yD,useOptimistic as wD,useRef as hv}from"react";var Jf=t=>{let e=vD(11),{children:o}=t,[n,r]=wD(!1),[s,i]=Zf.useState(0),l=hv(s),a=hv(null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{a.current=setInterval(()=>{let g=l.current+(.93-l.current)*Math.random()*.2*Math.pow(Math.log(1+(1-l.current)*.75),.75);i(g),l.current=g},250)},e[0]=c):c=e[0];let u=c,d,f;e[1]!==n?(d=()=>{i(0),l.current=0,n?u():a.current&&clearInterval(a.current)},f=[n,u],e[1]=n,e[2]=d,e[3]=f):(d=e[2],f=e[3]),yD(d,f);let m;e[4]!==r?(m=g=>{CD(()=>{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=xD(gv,{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},gv=Zf.createContext({isTransitioning:!1,startRouteTransition:()=>{},transitionProgress:0}),it=()=>Zf.use(gv);var ID=/https?|ftp|gopher|file/;function bv(t){return typeof t=="string"||typeof t=="number"&&!isNaN(t)||typeof t=="boolean"?String(t):""}function SD(t){let e=new URLSearchParams;return Object.entries(t).forEach(([o,n])=>{Array.isArray(n)?n.forEach(r=>e.append(o,bv(r))):e.set(o,bv(n))}),e}function vv(t){let{auth:e}=t,{hostname:o}=t,n=t.protocol||"",r=t.pathname||"",s=t.hash||"",i=t.query||"",l=!1;e=e?encodeURIComponent(e).replace(/%3A/i,":")+"@":"",t.host?l=e+t.host:o&&(l=e+(~o.indexOf(":")?`[${o}]`:o),t.port&&(l+=":"+t.port)),i&&typeof i=="object"&&(i=String(SD(i)));let a=t.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),t.slashes||(!n||ID.test(n))&&l!==!1?(l="//"+(l||""),r&&r[0]!=="/"&&(r="/"+r)):l||(l=""),s&&s[0]!=="#"&&(s="#"+s),a&&a[0]!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,encodeURIComponent),a=a.replace("#","%23"),`${n}${l}${r}${a}${s}`}var DD=xv.default||xv;function TD(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 Kt=({children:t,href:e,onClick:o,preventDefault:n=!0,ref:r,replace:s,scroll:i,...l})=>{let a=_D(),{startRouteTransition:c}=it();return RD(DD,{href:e,onClick:u=>{TD(u)||(o&&o(u),n&&u.preventDefault(),c(()=>{let d=typeof e=="string"?e:vv(e);s?a.replace(d,{scroll:i}):a.push(d,{scroll:i})}))},ref:r,...l,children:t})};var Ds="banner",yr=({type:t="default",alignIcon:e="right",children:o,className:n,icon:r,onClick:s,to:i})=>{let l=[Ds,`${Ds}--type-${t}`,n&&n,i&&`${Ds}--has-link`,(i||s)&&`${Ds}--has-action`,r&&`${Ds}--has-icon`,r&&`${Ds}--align-icon-${e}`].filter(Boolean).join(" "),a="div";return s&&!i&&(a="button"),i&&(a=Kt),AD(a,{className:l,href:i||null,onClick:s,children:[r&&e==="left"&&qf(Cv.Fragment,{children:r}),qf("span",{className:`${Ds}__content`,children:o}),r&&e==="right"&&qf(Cv.Fragment,{children:r})]})};import{jsx as Ho,jsxs as Pu}from"react/jsx-runtime";import YD,{Fragment as ZD,isValidElement as JD}from"react";import{jsx as yv}from"react/jsx-runtime";import"react";var Je=({ariaLabel:t,className:e,direction:o,size:n})=>yv("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 22 12",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:yv("path",{className:"stroke",d:"M1 1.12109L11 11.1211L21 1.12109",strokeLinecap:"square"})});import{jsx as wv}from"react/jsx-runtime";import"react";var wr=({className:t})=>wv("svg",{className:[t,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:wv("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 Iv}from"react/jsx-runtime";import"react";var Qf=()=>Iv("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:Iv("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 Sv}from"react/jsx-runtime";import"react";var jo=()=>Sv("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Sv("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})});import{jsx as Rv}from"react/jsx-runtime";import"react";var Kf=()=>Rv("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Rv("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 Ts,jsxs as rp}from"react/jsx-runtime";var Be={};Y1(Be,{Button:()=>tp,ButtonGroup:()=>ep,Divider:()=>_v,GroupLabel:()=>Du});import{jsx as Tu}from"react/jsx-runtime";import"react";import{jsx as FD}from"react/jsx-runtime";import"react";var ED="popup-divider",_v=()=>FD("hr",{className:ED});import{jsx as PD}from"react/jsx-runtime";import"react";var ND="popup-list-group-label",Du=({label:t})=>PD("p",{className:ND,children:t});var Ja="popup-button-list",ep=({buttonSize:t="default",children:e,className:o,textAlign:n="left"})=>{let r=[Ja,o,`${Ja}__text-align--${n}`,`${Ja}__button-size--${t}`].filter(Boolean).join(" ");return Tu("div",{className:r,children:e})},tp=({id:t,active:e,children:o,className:n,disabled:r,href:s,onClick:i})=>{let l=[`${Ja}__button`,e&&`${Ja}__button--selected`,n].filter(Boolean).join(" ");if(!r){if(s)return Tu(Kt,{className:l,href:s,id:t,onClick:a=>{i&&i(a)},prefetch:!1,children:o});if(i)return Tu("button",{className:l,id:t,onClick:a=>{i&&i(a)},type:"button",children:o})}return Tu("div",{className:l,id:t,children:o})};var Vn={};Y1(Vn,{WindowInfo:()=>Av,WindowInfoContext:()=>Ai,WindowInfoProvider:()=>Pv,useWindowInfo:()=>xo,withWindowInfo:()=>Nv});import{useContext as kD}from"react";import{createContext as LD}from"react";var Ai=LD({});var xo=()=>kD(Ai);import Dv,{Fragment as Tv}from"react";var Av=t=>{let{children:e}=t,o=xo();return e?typeof e=="function"?Dv.createElement(Tv,null,e(o)):Dv.createElement(Tv,null,e):null};import $D,{useCallback as Fv,useEffect as Ev,useReducer as jD,useRef as OD}from"react";var MD=(t,e)=>{let{payload:{breakpoints:o,animationRef:n}}=e;n.current=null;let{eventsFired:r}=t,{documentElement:{style:s,clientWidth:i,clientHeight:l}}=document,{innerWidth:a,innerHeight:c}=window,u=`${i/100}px`,d=`${l/100}px`,f=o?Object.keys(o).reduce((h,p)=>Object.assign(Object.assign({},h),{[p]:window.matchMedia(o[p]).matches}),{}):{},m={width:a,height:c,"--vw":u,"--vh":d,breakpoints:f,eventsFired:r+1};return s.setProperty("--vw",u),s.setProperty("--vh",d),m},Pv=t=>{let{breakpoints:e,children:o}=t,n=OD(null),[r,s]=jD(MD,{width:void 0,height:void 0,"--vw":"","--vh":"",breakpoints:{},eventsFired:0}),i=Fv(()=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}}))},[e]),l=Fv(()=>{setTimeout(()=>{i()},500)},[i]);return Ev(()=>(window.addEventListener("resize",i),window.addEventListener("orientationchange",l),()=>{window.removeEventListener("resize",i),window.removeEventListener("orientationchange",l)}),[i,l]),Ev(()=>{r.eventsFired===0&&s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}})},[e,r]),$D.createElement(Ai.Provider,{value:Object.assign({},r)},o&&o)};import BD from"react";var Nv=t=>o=>{let n=xo();return BD.createElement(t,Object.assign({},o,{windowInfo:n}))};import{useCallback as $v,useEffect as Au,useRef as zD,useState as np}from"react";import{c as VD}from"react/compiler-runtime";import{useEffect as GD,useRef as WD,useState as Lv}from"react";var an=(t,e)=>{let o=VD(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,l=r===void 0?null:r,a=s===void 0?"0px":s,c=i===void 0?0:i,[u,d]=Lv(),[f,m]=Lv(null),h;o[2]!==e||o[3]!==l||o[4]!==a||o[5]!==c?(h=typeof window<"u"&&"IntersectionObserver"in window&&!e?new window.IntersectionObserver(v=>{let[C]=v;return d(C)},{root:l,rootMargin:a,threshold:c}):null,o[2]=e,o[3]=l,o[4]=a,o[5]=c,o[6]=h):h=o[6];let p=WD(h),g,b;o[7]!==e||o[8]!==f?(g=()=>{if(e)return;let{current:v}=p;return v.disconnect(),f&&v.observe(f),()=>v.disconnect()},b=[f,e],o[7]=e,o[8]=f,o[9]=g,o[10]=b):(g=o[9],b=o[10]),GD(g,b);let x;return o[11]!==u||o[12]!==f?(x=[m,u,f],o[11]=u,o[12]=f,o[13]=x):x=o[13],x};import{jsx as kv}from"react/jsx-runtime";import"react";var qa="popup-button",op=t=>{let{active:e,button:o,buttonType:n,className:r,disabled:s,noBackground:i,setActive:l,size:a}=t,c=[qa,r,`${qa}--${n}`,!i&&`${qa}--background`,a&&`${qa}--size-${a}`,s&&`${qa}--disabled`].filter(Boolean).join(" "),u=()=>{l(!e)};return n==="none"?null:n==="custom"?kv("div",{className:c,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},role:"button",tabIndex:0,children:o}):kv("button",{className:c,disabled:s,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},tabIndex:0,type:"button",children:o})};var Oo="popup",fo=t=>{let{id:e,boundingRef:o,button:n,buttonClassName:r,buttonSize:s,buttonType:i="default",caret:l=!0,children:a,className:c,disabled:u,forceOpen:d,horizontalAlign:f="left",initActive:m=!1,noBackground:h,onToggleOpen:p,render:g,showOnHover:b=!1,showScrollbar:x=!1,size:v="medium",verticalAlign:C="top"}=t,{height:y,width:I}=xo(),[w,A]=an({root:o?.current||null,rootMargin:"-100px 0px 0px 0px",threshold:1}),_=zD(null),[D,T]=np(m),[S,R]=np(C),[E,F]=np(f),L=$v(({horizontal:P=!1,vertical:j=!1})=>{if(_.current){let V=_.current.getBoundingClientRect(),{bottom:M,left:O,right:B,top:G}=V,Y=100,X=document.documentElement.clientWidth,ee=document.documentElement.clientHeight,q=0;o?.current&&({bottom:ee,left:q,right:X,top:Y}=o.current.getBoundingClientRect()),P&&(B>X&&O>q?F("right"):O<q&&B<X&&F("left")),j&&(G<Y&&M<ee?R("bottom"):M>ee&&G>Y&&R("top"))}},[o]),k=$v(P=>{_.current.contains(P.target)||T(!1)},[_]);Au(()=>{L({horizontal:!0})},[A,L,I]),Au(()=>{L({vertical:!0})},[A,L,y]),Au(()=>(typeof p=="function"&&p(D),D?document.addEventListener("mousedown",k):document.removeEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}),[D,k,p]),Au(()=>{T(d)},[d]);let N=[Oo,c,`${Oo}--size-${v}`,s&&`${Oo}--button-size-${s}`,`${Oo}--v-align-${S}`,`${Oo}--h-align-${E}`,D&&`${Oo}--active`,x&&`${Oo}--show-scrollbar`].filter(Boolean).join(" ");return rp("div",{className:N,id:e,children:[Ts("div",{className:`${Oo}__trigger-wrap`,children:b?Ts("div",{className:`${Oo}__on-hover-watch`,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:Ts(op,{active:D,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:T,size:s})}):Ts(op,{active:D,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:T,size:s})}),rp("div",{className:`${Oo}__content`,ref:_,children:[Ts("div",{className:`${Oo}__hide-scrollbar`,ref:w,children:Ts("div",{className:`${Oo}__scroll-container`,children:rp("div",{className:`${Oo}__scroll-content`,children:[g&&g({close:()=>T(!1)}),a]})})}),l&&Ts("div",{className:`${Oo}__caret`})]})]})};import{c as HD}from"react/compiler-runtime";import{jsx as Fu,jsxs as XD}from"react/jsx-runtime";import sp,{useEffect as jv}from"react";var po=t=>{let e=HD(26),{alignCaret:o,boundingRef:n,children:r,className:s,delay:i,position:l,show:a,staticPositioning:c}=t,u=o===void 0?"center":o,d=i===void 0?350:i,f=a===void 0?!0:a,m=c===void 0?!1:c,[h,p]=sp.useState(f),[g,b]=sp.useState("top"),x=UD,v=n?.current||null,C;e[0]!==v?(C={root:v,rootMargin:"-145px 0px 0px 100px",threshold:0},e[0]=v,e[1]=C):C=e[1];let[y,I]=an(C,m),w,A;e[2]!==d||e[3]!==f?(w=()=>{let S;return d&&f?S=setTimeout(()=>{p(f)},d):p(f),()=>{S&&clearTimeout(S)}},A=[f,d],e[2]=d,e[3]=f,e[4]=w,e[5]=A):(w=e[4],A=e[5]),jv(w,A);let _;e[6]!==I?.isIntersecting||e[7]!==m?(_=()=>{m||b(I?.isIntersecting?"top":"bottom")},e[6]=I?.isIntersecting,e[7]=m,e[8]=_):_=e[8];let D;e[9]!==I||e[10]!==m?(D=[I,m],e[9]=I,e[10]=m,e[11]=D):D=e[11],jv(_,D);let T;if(e[12]!==u||e[13]!==r||e[14]!==s||e[15]!==g||e[16]!==l||e[17]!==y||e[18]!==h||e[19]!==m){let S=h&&"tooltip--show",R=`tooltip--caret-${u}`,E=`tooltip--position-${l||g}`,F;e[21]!==s||e[22]!==S||e[23]!==R||e[24]!==E?(F=["tooltip",s,S,R,E].filter(Boolean),e[21]=s,e[22]=S,e[23]=R,e[24]=E,e[25]=F):F=e[25],T=XD(sp.Fragment,{children:[!m&&Fu("aside",{"aria-hidden":"true",className:["tooltip",s,`tooltip--caret-${u}`,"tooltip--position-top"].filter(Boolean).join(" "),ref:y,style:{opacity:"0"},children:Fu("div",{className:"tooltip-content",children:r})}),Fu("aside",{className:F.join(" "),title:x(r),children:Fu("div",{className:"tooltip-content",children:r})})]}),e[12]=u,e[13]=r,e[14]=s,e[15]=g,e[16]=l,e[17]=y,e[18]=h,e[19]=m,e[20]=T}else T=e[20];return T};function UD(t){return typeof t=="string"?t:""}var qD={chevron:Je,edit:wr,link:Qf,plus:jo,swap:Kf,x:pt},eo="btn",Eu=({children:t,icon:e,showTooltip:o,tooltip:n})=>{let r=qD[e];return Pu(ZD,{children:[n&&Ho(po,{className:`${eo}__tooltip`,show:o,children:n}),Pu("span",{className:`${eo}__content`,children:[t&&Ho("span",{className:`${eo}__label`,children:t}),e&&Pu("span",{className:`${eo}__icon`,children:[JD(e)&&e,r&&Ho(r,{})]})]})]})},ae=t=>{let{id:e,type:o="button","aria-label":n,buttonStyle:r="primary",children:s,className:i,disabled:l,el:a="button",enableSubMenu:c,icon:u,iconPosition:d="right",iconStyle:f="without-border",newTab:m,onClick:h,onMouseDown:p,ref:g,round:b,size:x="medium",SubMenuPopupContent:v,to:C,tooltip:y,url:I}=t,[w,A]=YD.useState(!1),_=[eo,i&&i,u&&`${eo}--icon`,f&&`${eo}--icon-style-${f}`,u&&!s&&`${eo}--icon-only`,x&&`${eo}--size-${x}`,u&&d&&`${eo}--icon-position-${d}`,y&&`${eo}--has-tooltip`,!v&&`${eo}--withoutPopup`].filter(Boolean).join(" ");function D(F){A(!1),o!=="submit"&&h&&F.preventDefault(),h&&h(F)}let T=[r&&`${eo}--style-${r}`,l&&`${eo}--disabled`,b&&`${eo}--round`,v?`${eo}--withPopup`:`${eo}--withoutPopup`].filter(Boolean).join(" "),S={id:e,type:o,"aria-disabled":l,"aria-label":n,className:v?_:[_,T].join(" "),disabled:l,onClick:l?void 0:D,onMouseDown:l?void 0:p,onPointerEnter:y?()=>A(!0):void 0,onPointerLeave:y?()=>A(!1):void 0,rel:m?"noopener noreferrer":void 0,target:m?"_blank":void 0},R,E;switch(a){case"anchor":R=Ho("a",{...S,href:l?void 0:I,ref:g,children:Ho(Eu,{icon:u,showTooltip:w,tooltip:y,children:s})});break;case"link":l&&(R=Ho("div",{...S,children:Ho(Eu,{icon:u,showTooltip:w,tooltip:y,children:s})})),R=Ho(Kt,{...S,href:C||I,prefetch:E,children:Ho(Eu,{icon:u,showTooltip:w,tooltip:y,children:s})});break;default:R=Ho(a,{ref:g,type:"submit",...S,children:Ho(Eu,{icon:u,showTooltip:w,tooltip:y,children:s})});break}return v?Pu("div",{className:T,children:[R,Ho(fo,{button:Ho(Je,{}),buttonSize:x,className:l&&!c?`${eo}--popup-disabled`:"",disabled:l&&!c,horizontalAlign:"right",id:`${e}-popup`,noBackground:!0,render:({close:F})=>v({close:()=>F()}),size:"large",verticalAlign:"bottom"})]}):R};import{c as DT}from"react/compiler-runtime";import{jsx as TT}from"react/jsx-runtime";import{Fragment as AT}from"react";import{c as _T}from"react/compiler-runtime";import Wv,{useMemo as Lu,useRef as lp,useEffect as ku,useState as sT,useContext as iT}from"react";import{useDndContext as aT,getClientRect as lT,useDroppable as cT,useDraggable as uT,closestCorners as dT,getFirstCollision as mT,getScrollableAncestors as fT,KeyboardCode as Gn}from"@dnd-kit/core";import{useMemo as Ov,useLayoutEffect as QD,useEffect as KD,useRef as xH,useCallback as CH}from"react";function Mv(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return Ov(()=>n=>{e.forEach(r=>r(n))},e)}var eT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function tT(t){let e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function oT(t){return"nodeType"in t}function rT(t){var e,o;return t?tT(t)?t:oT(t)&&(e=(o=t.ownerDocument)==null?void 0:o.defaultView)!=null?e:window:window}var ap=eT?QD:KD;var ip={};function Bv(t,e){return Ov(()=>{if(e)return e;let o=ip[t]==null?0:ip[t]+1;return ip[t]=o,t+"-"+o},[t,e])}function nT(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 l=Object.entries(i);for(let[a,c]of l){let u=s[a];u!=null&&(s[a]=u+t*c)}return s},{...e})}}var Vv=nT(-1);function Gv(t){if(!t)return!1;let{KeyboardEvent:e}=rT(t.target);return e&&t instanceof e}var Qa=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[Qa.Translate.toString(t),Qa.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:o,easing:n}=t;return e+" "+o+"ms "+n}}});function ju(t,e,o){let n=t.slice();return n.splice(o<0?n.length+o:o,0,n.splice(e,1)[0]),n}function pT(t,e){return t.reduce((o,n,r)=>{let s=e.get(n);return s&&(o[r]=s),o},Array(t.length))}function Nu(t){return t!==null&&t>=0}function hT(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 gT(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}var zv=t=>{let{rects:e,activeIndex:o,overIndex:n,index:r}=t,s=ju(e,n,o),i=e[r],l=s[r];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}};var Hv="Sortable",Xv=Wv.createContext({activeIndex:-1,containerId:Hv,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:zv,disabled:{draggable:!1,droppable:!1}});function Uv(t){let{children:e,id:o,items:n,strategy:r=zv,disabled:s=!1}=t,{active:i,dragOverlay:l,droppableRects:a,over:c,measureDroppableContainers:u}=aT(),d=Bv(Hv,o),f=l.rect!==null,m=Lu(()=>n.map(I=>typeof I=="object"&&"id"in I?I.id:I),[n]),h=i!=null,p=i?m.indexOf(i.id):-1,g=c?m.indexOf(c.id):-1,b=lp(m),x=!hT(m,b.current),v=g!==-1&&p===-1||x,C=gT(s);ap(()=>{x&&h&&u(m)},[x,m,h,u]),ku(()=>{b.current=m},[m]);let y=Lu(()=>({activeIndex:p,containerId:d,disabled:C,disableTransforms:v,items:m,overIndex:g,useDragOverlay:f,sortedRects:pT(m,a),strategy:r}),[p,d,C.draggable,C.droppable,v,m,g,a,f,r]);return Wv.createElement(Xv.Provider,{value:y},e)}var bT=t=>{let{id:e,items:o,activeIndex:n,overIndex:r}=t;return ju(o,n,r).indexOf(e)},vT=t=>{let{containerId:e,isSorting:o,wasDragging:n,index:r,items:s,newIndex:i,previousItems:l,previousContainerId:a,transition:c}=t;return!c||!n||l!==s&&r===i?!1:o?!0:i!==r&&e===a},xT={duration:200,easing:"ease"},Yv="transform",CT=Qa.Transition.toString({property:Yv,duration:0,easing:"linear"}),yT={roleDescription:"sortable"};function wT(t){let{disabled:e,index:o,node:n,rect:r}=t,[s,i]=sT(null),l=lp(o);return ap(()=>{if(!e&&o!==l.current&&n.current){let a=r.current;if(a){let c=lT(n.current,{ignoreTransform:!0}),u={x:a.left-c.left,y:a.top-c.top,scaleX:a.width/c.width,scaleY:a.height/c.height};(u.x||u.y)&&i(u)}}o!==l.current&&(l.current=o)},[e,o,n,r]),ku(()=>{s&&i(null)},[s]),s}function Zv(t){let{animateLayoutChanges:e=vT,attributes:o,disabled:n,data:r,getNewIndex:s=bT,id:i,strategy:l,resizeObserverConfig:a,transition:c=xT}=t,{items:u,containerId:d,activeIndex:f,disabled:m,disableTransforms:h,sortedRects:p,overIndex:g,useDragOverlay:b,strategy:x}=iT(Xv),v=IT(n,m),C=u.indexOf(i),y=Lu(()=>({sortable:{containerId:d,index:C,items:u},...r}),[d,r,C,u]),I=Lu(()=>u.slice(u.indexOf(i)),[u,i]),{rect:w,node:A,isOver:_,setNodeRef:D}=cT({id:i,data:y,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:I,...a}}),{active:T,activatorEvent:S,activeNodeRect:R,attributes:E,setNodeRef:F,listeners:L,isDragging:k,over:N,setActivatorNodeRef:P,transform:j}=uT({id:i,data:y,attributes:{...yT,...o},disabled:v.draggable}),V=Mv(D,F),M=!!T,O=M&&!h&&Nu(f)&&Nu(g),B=!b&&k,G=B&&O?j:null,X=O?G??(l??x)({rects:p,activeNodeRect:R,activeIndex:f,overIndex:g,index:C}):null,ee=Nu(f)&&Nu(g)?s({id:i,items:u,activeIndex:f,overIndex:g}):C,q=T?.id,z=lp({activeId:q,items:u,newIndex:ee,containerId:d}),re=u!==z.current.items,me=e({active:T,containerId:d,isDragging:k,isSorting:M,id:i,index:C,items:u,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:c,wasDragging:z.current.activeId!=null}),se=wT({disabled:!me,index:C,node:A,rect:w});return ku(()=>{M&&z.current.newIndex!==ee&&(z.current.newIndex=ee),d!==z.current.containerId&&(z.current.containerId=d),u!==z.current.items&&(z.current.items=u)},[M,ee,d,u]),ku(()=>{if(q===z.current.activeId)return;if(q&&!z.current.activeId){z.current.activeId=q;return}let Q=setTimeout(()=>{z.current.activeId=q},50);return()=>clearTimeout(Q)},[q]),{active:T,activeIndex:f,attributes:E,data:y,rect:w,index:C,newIndex:ee,items:u,isOver:_,isSorting:M,isDragging:k,listeners:L,node:A,overIndex:g,over:N,setNodeRef:V,setActivatorNodeRef:P,setDroppableNodeRef:D,setDraggableNodeRef:F,transform:se??X,transition:Z()};function Z(){if(se||re&&z.current.newIndex===C)return CT;if(!(B&&!Gv(S)||!c)&&(M||me))return Qa.Transition.toString({...c,property:Yv})}}function IT(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 $u(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 ST=[Gn.Down,Gn.Right,Gn.Up,Gn.Left],Jv=(t,e)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:s,over:i,scrollableAncestors:l}}=e;if(ST.includes(t.code)){if(t.preventDefault(),!o||!n)return;let a=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;let f=r.get(d.id);if(f)switch(t.code){case Gn.Down:n.top<f.top&&a.push(d);break;case Gn.Up:n.top>f.top&&a.push(d);break;case Gn.Left:n.left>f.left&&a.push(d);break;case Gn.Right:n.left<f.left&&a.push(d);break}});let c=dT({active:o,collisionRect:n,droppableRects:r,droppableContainers:a,pointerCoordinates:null}),u=mT(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=fT(h).some((I,w)=>l[w]!==I),b=qv(d,f),x=RT(d,f),v=g||!b?{x:0,y:0}:{x:x?n.width-m.width:0,y:x?n.height-m.height:0},C={x:m.left,y:m.top};return v.x&&v.y?C:Vv(C,v)}}}};function qv(t,e){return!$u(t)||!$u(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function RT(t,e){return!$u(t)||!$u(e)||!qv(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}var Fi=t=>{let e=_T(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:l,listeners:a,setNodeRef:c,transform:u,transition:d}=Zv(s),f=l?"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]!==l||e[11]!==a||e[12]!==c||e[13]!==h||e[14]!==p||e[15]!==d?(g={attributes:h,isDragging:l,listeners:a,setNodeRef:c,transform:p,transition:d},e[10]=l,e[11]=a,e[12]=c,e[13]=h,e[14]=p,e[15]=d,e[16]=g):g=e[16],g};var Wn=t=>{let e=DT(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:l,listeners:a,setNodeRef:c,transform:u,transition:d}=Fi(s),f=l?"grabbing":"grab",m;return e[3]!==i||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==f||e[9]!==u||e[10]!==d?(m=TT(AT,{children:n({attributes:{...i,style:{cursor:f}},isDragging:l,listeners:a,setNodeRef:c,transform:u,transition:d})}),e[3]=i,e[4]=n,e[5]=l,e[6]=a,e[7]=c,e[8]=f,e[9]=u,e[10]=d,e[11]=m):m=e[11],m};import{c as FT}from"react/compiler-runtime";import{jsx as cp}from"react/jsx-runtime";import{closestCenter as ET,DndContext as PT,KeyboardSensor as NT,PointerSensor as LT,useDroppable as kT,useSensor as Qv,useSensors as $T}from"@dnd-kit/core";import{useId as jT}from"react";var zr=t=>{let e=FT(15),{children:o,className:n,ids:r,onDragEnd:s}=t,i=jT(),l;e[0]!==i?(l={id:i},e[0]=i,e[1]=l):l=e[1];let{setNodeRef:a}=kT(l),c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c={activationConstraint:{distance:5}},e[2]=c):c=e[2];let u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u={coordinateGetter:Jv},e[3]=u):u=e[3];let d=$T(Qv(LT,c),Qv(NT,u)),f;e[4]!==r||e[5]!==s?(f=p=>{let{active:g,over:b}=p;p.activatorEvent.stopPropagation(),!(!g||!b)&&typeof s=="function"&&s({event:p,moveFromIndex:r.findIndex(x=>x===g.id),moveToIndex:r.findIndex(x=>x===b.id)})},e[4]=r,e[5]=s,e[6]=f):f=e[6];let m=f,h;return e[7]!==o||e[8]!==n||e[9]!==m||e[10]!==i||e[11]!==r||e[12]!==d||e[13]!==a?(h=cp(PT,{collisionDetection:ET,id:i,onDragEnd:m,sensors:d,children:cp(Uv,{items:r,children:cp("div",{className:n,ref:a,children:o})})}),e[7]=o,e[8]=n,e[9]=m,e[10]=i,e[11]=r,e[12]=d,e[13]=a,e[14]=h):h=e[14],h};import{jsx as Kv,jsxs as OT}from"react/jsx-runtime";import"react";var Ou="error-pill",to=t=>{let{className:e,count:o,i18n:n,withMessage:r}=t,s=!r&&o<99,i=[Ou,s&&`${Ou}--fixed-width`,e&&e].filter(Boolean).join(" ");return o===0?null:Kv("div",{className:i,children:OT("div",{className:`${Ou}__content`,children:[Kv("span",{className:`${Ou}__count`,children:o}),r&&` ${o>1?n.t("general:errors"):n.t("general:error")}`]})})};import{c as MT}from"react/compiler-runtime";import{jsx as BT}from"react/jsx-runtime";import{getTranslation as VT}from"@payloadcms/translations";import"react";var e0="field-description",We=t=>{let e=MT(8),{className:o,description:n,marginPlacement:r,path:s}=t,{i18n:i}=$();if(n){let l=`field-description-${s?.replace(/\./g,"__")}`,a=r&&`${e0}--margin-${r}`,c;e[0]!==o||e[1]!==l||e[2]!==a?(c=[e0,o,l,a].filter(Boolean),e[0]=o,e[1]=l,e[2]=a,e[3]=c):c=e[3];let u=c.join(" "),d;return e[4]!==n||e[5]!==i||e[6]!==u?(d=BT("div",{className:u,children:VT(n,i)}),e[4]=n,e[5]=i,e[6]=u,e[7]=d):d=e[7],d}return null};import{c as GT}from"react/compiler-runtime";import{jsx as WT}from"react/jsx-runtime";import"react";var zT="field-error",Xe=t=>{let e=GT(7),{alignCaret:o,message:n,path:r,showError:s}=t,i=o===void 0?"right":o,l=zt(),a;e[0]!==r?(a=p=>{let[g]=p;return g&&g?.[r]||null},e[0]=r,e[1]=a):a=e[1];let c=Et(a),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||l&&f===!1)&&m?.length){let p;return e[4]!==i||e[5]!==m?(p=WT(po,{alignCaret:i,className:zT,delay:0,staticPositioning:!0,children:m}),e[4]=i,e[5]=m,e[6]=p):p=e[6],p}return null};import{c as AF}from"react/compiler-runtime";import{jsx as FF,jsxs as Y0}from"react/jsx-runtime";import{getTranslation as EF}from"@payloadcms/translations";import"react";import{c as HT}from"react/compiler-runtime";import{jsx as XT}from"react/jsx-runtime";import{createContext as UT,use as YT}from"react";var t0=UT(0),As=t=>{let e=HT(3),{children:o}=t,r=ut()+1,s;return e[0]!==o||e[1]!==r?(s=XT(t0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},ut=()=>YT(t0);import{c as wF}from"react/compiler-runtime";import{jsx as G0}from"react/jsx-runtime";import{useSearchParams as IF}from"next/navigation.js";import SF,{createContext as z0,use as H0,useEffect as W0,useRef as RF,useState as _F}from"react";var zn=(t,e)=>!t?.locales||t.locales.length===0?null:t.locales.find(o=>o?.code===e);import{jsx as mF}from"react/jsx-runtime";import{jsx as vp}from"react/jsx-runtime";import{useRef as m0,useEffect as Ps,useState as xp}from"react";import lA from"react-dom";function ye(){return ye=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},ye.apply(null,arguments)}function Ei(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 Pi(t,e){return Pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,n){return o.__proto__=n,o},Pi(t,e)}function Mu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Pi(t,e)}function up(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function dp(t,e){t.classList?t.classList.add(e):up(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function o0(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function mp(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=o0(t.className,e):t.setAttribute("class",o0(t.className&&t.className.baseVal||"",e))}import n0 from"react";import Vu from"react";import Gu from"react-dom";var fp={disabled:!1};import ZT from"react";var pp=ZT.createContext(null);var Bu=function(e){return e.scrollTop};var Ka="unmounted",Fs="exited",Es="entering",Li="entered",hp="exiting",ln=function(t){Mu(e,t);function e(n,r){var s;s=t.call(this,n,r)||this;var i=r,l=i&&!i.isMounting?n.enter:n.appear,a;return s.appearStatus=null,n.in?l?(a=Fs,s.appearStatus=Es):a=Li:n.unmountOnExit||n.mountOnEnter?a=Ka:a=Fs,s.state={status:a},s.nextCallback=null,s}e.getDerivedStateFromProps=function(r,s){var i=r.in;return i&&s.status===Ka?{status:Fs}: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!==Es&&i!==Li&&(s=Es):(i===Es||i===Li)&&(s=hp)}this.updateStatus(!1,s)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var r=this.props.timeout,s,i,l;return s=i=l=r,r!=null&&typeof r!="number"&&(s=r.exit,i=r.enter,l=r.appear!==void 0?r.appear:i),{exit:s,enter:i,appear:l}},o.updateStatus=function(r,s){if(r===void 0&&(r=!1),s!==null)if(this.cancelNextCallback(),s===Es){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:Gu.findDOMNode(this);i&&Bu(i)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Fs&&this.setState({status:Ka})},o.performEnter=function(r){var s=this,i=this.props.enter,l=this.context?this.context.isMounting:r,a=this.props.nodeRef?[l]:[Gu.findDOMNode(this),l],c=a[0],u=a[1],d=this.getTimeouts(),f=l?d.appear:d.enter;if(!r&&!i||fp.disabled){this.safeSetState({status:Li},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:Es},function(){s.props.onEntering(c,u),s.onTransitionEnd(f,function(){s.safeSetState({status:Li},function(){s.props.onEntered(c,u)})})})},o.performExit=function(){var r=this,s=this.props.exit,i=this.getTimeouts(),l=this.props.nodeRef?void 0:Gu.findDOMNode(this);if(!s||fp.disabled){this.safeSetState({status:Fs},function(){r.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:hp},function(){r.props.onExiting(l),r.onTransitionEnd(i.exit,function(){r.safeSetState({status:Fs},function(){r.props.onExited(l)})})})},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(l){i&&(i=!1,s.nextCallback=null,r(l))},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:Gu.findDOMNode(this),l=r==null&&!this.props.addEndListener;if(!i||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=a[0],u=a[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},o.render=function(){var r=this.state.status;if(r===Ka)return null;var s=this.props,i=s.children,l=s.in,a=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,x=s.onExit,v=s.onExiting,C=s.onExited,y=s.nodeRef,I=Ei(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Vu.createElement(pp.Provider,{value:null},typeof i=="function"?i(r,I):Vu.cloneElement(Vu.Children.only(i),I))},e}(Vu.Component);ln.contextType=pp;ln.propTypes={};function Ni(){}ln.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ni,onEntering:Ni,onEntered:Ni,onExit:Ni,onExiting:Ni,onExited:Ni};ln.UNMOUNTED=Ka;ln.EXITED=Fs;ln.ENTERING=Es;ln.ENTERED=Li;ln.EXITING=hp;var r0=ln;var JT=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return dp(e,n)})},gp=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return mp(e,n)})},bp=function(t){Mu(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(l,a){var c=n.resolveArguments(l,a),u=c[0],d=c[1];n.removeClasses(u,"exit"),n.addClass(u,d?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(l,a)},n.onEntering=function(l,a){var c=n.resolveArguments(l,a),u=c[0],d=c[1],f=d?"appear":"enter";n.addClass(u,f,"active"),n.props.onEntering&&n.props.onEntering(l,a)},n.onEntered=function(l,a){var c=n.resolveArguments(l,a),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(l,a)},n.onExit=function(l){var a=n.resolveArguments(l),c=a[0];n.removeClasses(c,"appear"),n.removeClasses(c,"enter"),n.addClass(c,"exit","base"),n.props.onExit&&n.props.onExit(l)},n.onExiting=function(l){var a=n.resolveArguments(l),c=a[0];n.addClass(c,"exit","active"),n.props.onExiting&&n.props.onExiting(l)},n.onExited=function(l){var a=n.resolveArguments(l),c=a[0];n.removeClasses(c,"exit"),n.addClass(c,"exit","done"),n.props.onExited&&n.props.onExited(l)},n.resolveArguments=function(l,a){return n.props.nodeRef?[n.props.nodeRef.current,l]:[l,a]},n.getClassNames=function(l){var a=n.props.classNames,c=typeof a=="string",u=c&&a?a+"-":"",d=c?""+u+l:a[l],f=c?d+"-active":a[l+"Active"],m=c?d+"-done":a[l+"Done"];return{baseClassName:d,activeClassName:f,doneClassName:m}},n}var o=e.prototype;return o.addClass=function(r,s,i){var l=this.getClassNames(s)[i+"ClassName"],a=this.getClassNames("enter"),c=a.doneClassName;s==="appear"&&i==="done"&&c&&(l+=" "+c),i==="active"&&r&&Bu(r),l&&(this.appliedClasses[s][i]=l,JT(r,l))},o.removeClasses=function(r,s){var i=this.appliedClasses[s],l=i.base,a=i.active,c=i.done;this.appliedClasses[s]={},l&&gp(r,l),a&&gp(r,a),c&&gp(r,c)},o.render=function(){var r=this.props,s=r.classNames,i=Ei(r,["classNames"]);return n0.createElement(r0,ye({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(n0.Component);bp.defaultProps={classNames:""};bp.propTypes={};var el=bp;function s0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}import{useContext as QT}from"react";import{createContext as qT}from"react";var Wu=qT({});var de=()=>QT(Wu);var zu=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`}:{};Y_();function i0(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 a0(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?i0(Object(o),!0).forEach(function(n){KT(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):i0(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function KT(t,e,o){return e=tA(e),e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function eA(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 tA(t){var e=eA(t,"string");return typeof e=="symbol"?e:String(e)}var l0={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()}},oA=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},rA=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},ol=function(e){return e?.key==="Tab"||e?.keyCode===9},nA=function(e){return ol(e)&&!e.shiftKey},sA=function(e){return ol(e)&&e.shiftKey},c0=function(e){return setTimeout(e,0)},u0=function(e,o){var n=-1;return e.every(function(r,s){return o(r)?(n=s,!1):!0}),n},tl=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},Hu=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},iA=[],d0=function(e,o){var n=o?.document||document,r=o?.trapStack||iA,s=a0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:nA,isKeyBackward:sA},o),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,a=function(S,R,E){return S&&S[R]!==void 0?S[R]:s[E||R]},c=function(S,R){var E=typeof R?.composedPath=="function"?R.composedPath():void 0;return i.containerGroups.findIndex(function(F){var L=F.container,k=F.tabbableNodes;return L.contains(S)||E?.includes(L)||k.find(function(N){return N===S})})},u=function(S){var R=s[S];if(typeof R=="function"){for(var E=arguments.length,F=new Array(E>1?E-1:0),L=1;L<E;L++)F[L-1]=arguments[L];R=R.apply(void 0,F)}if(R===!0&&(R=void 0),!R){if(R===void 0||R===!1)return R;throw new Error("`".concat(S,"` was specified but was not a node, or did not return a node"))}var k=R;if(typeof R=="string"&&(k=n.querySelector(R),!k))throw new Error("`".concat(S,"` as selector refers to no known node"));return k},d=function(){var S=u("initialFocus");if(S===!1)return!1;if(S===void 0||!fu(S,s.tabbableOptions))if(c(n.activeElement)>=0)S=n.activeElement;else{var R=i.tabbableGroups[0],E=R&&R.firstTabbableNode;S=E||u("fallbackFocus")}if(!S)throw new Error("Your focus-trap needs to have at least one focusable element");return S},f=function(){if(i.containerGroups=i.containers.map(function(S){var R=Z1(S,s.tabbableOptions),E=J1(S,s.tabbableOptions),F=R.length>0?R[0]:void 0,L=R.length>0?R[R.length-1]:void 0,k=E.find(function(j){return Ss(j)}),N=E.slice().reverse().find(function(j){return Ss(j)}),P=!!R.find(function(j){return _i(j)>0});return{container:S,tabbableNodes:R,focusableNodes:E,posTabIndexesFound:P,firstTabbableNode:F,lastTabbableNode:L,firstDomTabbableNode:k,lastDomTabbableNode:N,nextTabbableNode:function(V){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,O=R.indexOf(V);return O<0?M?E.slice(E.indexOf(V)+1).find(function(B){return Ss(B)}):E.slice(0,E.indexOf(V)).reverse().find(function(B){return Ss(B)}):R[O+(M?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(S){return S.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(S){return S.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 T(S){var R=S.activeElement;if(R)return R.shadowRoot&&R.shadowRoot.activeElement!==null?T(R.shadowRoot):R},h=function T(S){if(S!==!1&&S!==m(document)){if(!S||!S.focus){T(d());return}S.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=S,oA(S)&&S.select()}},p=function(S){var R=u("setReturnFocus",S);return R||(R===!1?!1:S)},g=function(S){var R=S.target,E=S.event,F=S.isBackward,L=F===void 0?!1:F;R=R||Hu(E),f();var k=null;if(i.tabbableGroups.length>0){var N=c(R,E),P=N>=0?i.containerGroups[N]:void 0;if(N<0)L?k=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:k=i.tabbableGroups[0].firstTabbableNode;else if(L){var j=u0(i.tabbableGroups,function(Y){var X=Y.firstTabbableNode;return R===X});if(j<0&&(P.container===R||fu(R,s.tabbableOptions)&&!Ss(R,s.tabbableOptions)&&!P.nextTabbableNode(R,!1))&&(j=N),j>=0){var V=j===0?i.tabbableGroups.length-1:j-1,M=i.tabbableGroups[V];k=_i(R)>=0?M.lastTabbableNode:M.lastDomTabbableNode}else ol(E)||(k=P.nextTabbableNode(R,!1))}else{var O=u0(i.tabbableGroups,function(Y){var X=Y.lastTabbableNode;return R===X});if(O<0&&(P.container===R||fu(R,s.tabbableOptions)&&!Ss(R,s.tabbableOptions)&&!P.nextTabbableNode(R))&&(O=N),O>=0){var B=O===i.tabbableGroups.length-1?0:O+1,G=i.tabbableGroups[B];k=_i(R)>=0?G.firstTabbableNode:G.firstDomTabbableNode}else ol(E)||(k=P.nextTabbableNode(R))}}else k=u("fallbackFocus");return k},b=function(S){var R=Hu(S);if(!(c(R,S)>=0)){if(tl(s.clickOutsideDeactivates,S)){l.deactivate({returnFocus:s.returnFocusOnDeactivate});return}tl(s.allowOutsideClick,S)||S.preventDefault()}},x=function(S){var R=Hu(S),E=c(R,S)>=0;if(E||R instanceof Document)E&&(i.mostRecentlyFocusedNode=R);else{S.stopImmediatePropagation();var F,L=!0;if(i.mostRecentlyFocusedNode)if(_i(i.mostRecentlyFocusedNode)>0){var k=c(i.mostRecentlyFocusedNode),N=i.containerGroups[k].tabbableNodes;if(N.length>0){var P=N.findIndex(function(j){return j===i.mostRecentlyFocusedNode});P>=0&&(s.isKeyForward(i.recentNavEvent)?P+1<N.length&&(F=N[P+1],L=!1):P-1>=0&&(F=N[P-1],L=!1))}}else i.containerGroups.some(function(j){return j.tabbableNodes.some(function(V){return _i(V)>0})})||(L=!1);else L=!1;L&&(F=g({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),h(F||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},v=function(S){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=S;var E=g({event:S,isBackward:R});E&&(ol(S)&&S.preventDefault(),h(E))},C=function(S){if(rA(S)&&tl(s.escapeDeactivates,S)!==!1){S.preventDefault(),l.deactivate();return}(s.isKeyForward(S)||s.isKeyBackward(S))&&v(S,s.isKeyBackward(S))},y=function(S){var R=Hu(S);c(R,S)>=0||tl(s.clickOutsideDeactivates,S)||tl(s.allowOutsideClick,S)||(S.preventDefault(),S.stopImmediatePropagation())},I=function(){if(i.active)return l0.activateTrap(r,l),i.delayInitialFocusTimer=s.delayInitialFocus?c0(function(){h(d())}):h(d()),n.addEventListener("focusin",x,!0),n.addEventListener("mousedown",b,{capture:!0,passive:!1}),n.addEventListener("touchstart",b,{capture:!0,passive:!1}),n.addEventListener("click",y,{capture:!0,passive:!1}),n.addEventListener("keydown",C,{capture:!0,passive:!1}),l},w=function(){if(i.active)return n.removeEventListener("focusin",x,!0),n.removeEventListener("mousedown",b,!0),n.removeEventListener("touchstart",b,!0),n.removeEventListener("click",y,!0),n.removeEventListener("keydown",C,!0),l},A=function(S){var R=S.some(function(E){var F=Array.from(E.removedNodes);return F.some(function(L){return L===i.mostRecentlyFocusedNode})});R&&h(d())},_=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(A):void 0,D=function(){_&&(_.disconnect(),i.active&&!i.paused&&i.containers.map(function(S){_.observe(S,{subtree:!0,childList:!0})}))};return l={get active(){return i.active},get paused(){return i.paused},activate:function(S){if(i.active)return this;var R=a(S,"onActivate"),E=a(S,"onPostActivate"),F=a(S,"checkCanFocusTrap");F||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=n.activeElement,R?.();var L=function(){F&&f(),I(),D(),E?.()};return F?(F(i.containers.concat()).then(L,L),this):(L(),this)},deactivate:function(S){if(!i.active)return this;var R=a0({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},S);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,w(),i.active=!1,i.paused=!1,D(),l0.deactivateTrap(r,l);var E=a(R,"onDeactivate"),F=a(R,"onPostDeactivate"),L=a(R,"checkCanReturnFocus"),k=a(R,"returnFocus","returnFocusOnDeactivate");E?.();var N=function(){c0(function(){k&&h(p(i.nodeFocusedBeforeActivation)),F?.()})};return k&&L?(L(p(i.nodeFocusedBeforeActivation)).then(N,N),this):(N(),this)},pause:function(S){if(i.paused||!i.active)return this;var R=a(S,"onPause"),E=a(S,"onPostPause");return i.paused=!0,R?.(),w(),D(),E?.(),this},unpause:function(S){if(!i.paused||!i.active)return this;var R=a(S,"onUnpause"),E=a(S,"onPostUnpause");return i.paused=!1,R?.(),f(),I(),D(),E?.(),this},updateContainerElements:function(S){var R=[].concat(S).filter(Boolean);return i.containers=R.map(function(E){return typeof E=="string"?n.querySelector(E):E}),i.active&&f(),D(),this}},l.updateContainerElements(e),l};var aA=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},cn="modal-item",f0=(t,e)=>n=>{let r=de(),s=m0(null),[i,l]=xp(!1),a=m0(!1),[c,u]=xp(null),{modalState:d,classPrefix:f,containerRef:m,transTime:h,setCloseOnBlur:p,setBodyScrollLock:g,openModal:b}=r,{className:x,htmlElement:v="dialog",slug:C="",closeOnBlur:y=!0,lockBodyScroll:I=!0,classPrefix:w,onEnter:A,onEntering:_,onEntered:D,onExit:T,onExiting:S,onExited:R,openOnInit:E,trapFocus:F=!0,focusTrapOptions:L={}}=n,k=aA(n,["className","htmlElement","slug","closeOnBlur","lockBodyScroll","classPrefix","onEnter","onEntering","onEntered","onExit","onExiting","onExited","openOnInit","trapFocus","focusTrapOptions"]),N=w||f,P=e||C,j=d[P]&&d[P].isOpen;Ps(()=>{if(F){let O=s.current;if(a.current===!1&&O){let B=d0(O,Object.assign(Object.assign({},L),{fallbackFocus:L?.fallbackFocus||O,allowOutsideClick:typeof L.allowOutsideClick<"u"?L.allowOutsideClick:!0}));u(B),a.current=!0}}},[F,i,L]),Ps(()=>{l(!0)},[]),Ps(()=>(c&&(j?c.activate():c.deactivate()),()=>{c&&c.deactivate()}),[j,c]),Ps(()=>{j&&p(y)},[j,y,p]),Ps(()=>{let O=s.current;return O&&g(!!(j&&I),O),()=>{O&&g(!1,O)}},[j,I,g]);let[V,M]=xp(j);if(Ps(()=>{j?M(j):setTimeout(()=>M(!1),h)},[j,h]),Ps(()=>{E&&b(P)},[P,E,b]),m.current){let O=N?`${N}__${cn}`:cn,B=[O,`${O}--slug-${P}`,x].filter(Boolean).join(" "),G=Object.assign({role:v!=="dialog"?"dialog":void 0,open:v==="dialog"?V||j:void 0,"aria-modal":!0,"aria-label":k["aria-labelledby"]?void 0:P},k);return lA.createPortal(vp(el,{nodeRef:s,timeout:h,in:j,classNames:zu(O),appear:!0,onEnter:A,onEntering:_,onEntered:D,onExit:T,onExiting:S,onExited:R,children:vp(v,Object.assign({ref:s,id:k?.id||P,className:B},G,{children:vp(t,Object.assign({},n,{isOpen:j,modal:r}))}))}),m.current)}return null};import{jsx as p0}from"react/jsx-runtime";import{Fragment as h0}from"react";var cA=t=>{let{children:e}=t;return e?typeof e=="function"?p0(h0,{children:e(t)}):p0(h0,{children:e}):null},Xo=f0(cA);import{jsx as g0}from"react/jsx-runtime";var uA=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},un="modal-container",Cp=t=>{let{oneModalIsOpen:e,classPrefix:o,transTime:n,setContainerRef:r,containerRef:s,closeAllModals:i,closeOnBlur:l}=de(),{className:a,htmlElement:c="div",children:u,onClick:d}=t,f=uA(t,["className","htmlElement","children","onClick"]),m=o?`${o}__${un}`:un,h=[m,a].filter(Boolean).join(" "),p=Object.assign(Object.assign({},f),{onClick:g=>{l&&i(),typeof d=="function"&&d(g)}});return g0(el,{nodeRef:s,in:e,timeout:n,classNames:zu(m),appear:!0,children:g0(c,Object.assign({className:h,ref:r},p,{children:u&&u}))})};import{jsx as I0,jsxs as vA}from"react/jsx-runtime";import{Fragment as xA,useState as Zu,useRef as S0,useEffect as Ju,useCallback as Hn,useReducer as CA}from"react";function dA(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 wp=!1;typeof window<"u"&&(yp={get passive(){wp=!0}},window.addEventListener("testPassive",null,yp),window.removeEventListener("testPassive",null,yp));var yp,Xu=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),Ls=[],Uu=!1,b0=-1,rl=void 0,Ns=void 0,nl=void 0,v0=function(e){return Ls.some(function(o){return!!(o.options.allowTouchMove&&o.options.allowTouchMove(e))})},Yu=function(e){var o=e||window.event;return v0(o.target)||o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)},mA=function(e){if(nl===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);nl=document.body.style.paddingRight,document.body.style.paddingRight=r+n+"px"}}rl===void 0&&(rl=document.body.style.overflow,document.body.style.overflow="hidden")},fA=function(){nl!==void 0&&(document.body.style.paddingRight=nl,nl=void 0),rl!==void 0&&(document.body.style.overflow=rl,rl=void 0)},pA=function(){return window.requestAnimationFrame(function(){if(Ns===void 0){Ns={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)}})},hA=function(){if(Ns!==void 0){var e=-parseInt(document.body.style.top,10),o=-parseInt(document.body.style.left,10);document.body.style.position=Ns.position,document.body.style.top=Ns.top,document.body.style.left=Ns.left,window.scrollTo(o,e),Ns=void 0}},gA=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},bA=function(e,o){var n=e.targetTouches[0].clientY-b0;return v0(e.target)?!1:o&&o.scrollTop===0&&n>0||gA(o)&&n<0?Yu(e):(e.stopPropagation(),!0)},x0=function(e,o){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Ls.some(function(r){return r.targetElement===e})){var n={targetElement:e,options:o||{}};Ls=[].concat(dA(Ls),[n]),Xu?pA():mA(o),Xu&&(e.ontouchstart=function(r){r.targetTouches.length===1&&(b0=r.targetTouches[0].clientY)},e.ontouchmove=function(r){r.targetTouches.length===1&&bA(r,e)},Uu||(document.addEventListener("touchmove",Yu,wp?{passive:!1}:void 0),Uu=!0))}};var C0=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Ls=Ls.filter(function(o){return o.targetElement!==e}),Xu&&(e.ontouchstart=null,e.ontouchmove=null,Uu&&Ls.length===0&&(document.removeEventListener("touchmove",Yu,wp?{passive:!1}:void 0),Uu=!1)),Xu?hA():fA()};var y0=({classPrefix:t,zIndex:e})=>{let o=t?`${t}__`:"";return`
14
14
  .${o}${un} {
15
15
  top: 0;
16
16
  right: 0;
@@ -44,18 +44,18 @@ import{a as Pf,b as W,c as Nf,d as wt,e as Z_,f as J_,g as Lf,h as q_,i as Q_}fr
44
44
  .${o}${cn}--exit {
45
45
  visibility: visible;
46
46
  }
47
- `};var w0=(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,l)=>{let a=o[l];return a.isOpen&&typeof a.openedOn=="number"&&(!i||typeof i.openedOn=="number"&&a.openedOn>i.openedOn)?a: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,l])=>(s[i]=Object.assign(Object.assign({},l),{isOpen:!1,openedOn:void 0}),s),{});break}default:break}return o};var yA=()=>{if(typeof window<"u")return new URLSearchParams(window.location.search)},wA=()=>{let t=yA(),e=[];if(t){let o=t.get("modal");o&&(o.includes(",")?e=o.split(","):e=[o])}return e},Ip=t=>{let{classPrefix:e,minifyCSS:o=!0,generateCSS:n=!0,zIndex:r=9999,handleParamChange:s,children:i,transTime:l=250}=t,a=S0(null),[c,u]=CA(w0,{},()=>wA().reduce((F,L)=>(F[L]={slug:L,isOpen:!0,openedOn:Date.now()},F),{})),[d,f]=Zu(!1),[m,h]=Zu(!1),[p,g]=Zu(!1),[b,x]=Zu(""),v=S0(!1),C=zn(R=>{R.keyCode===27&&u({type:"CLOSE_LATEST_MODAL"})},[]);Ju(()=>(v.current||(document.addEventListener("keydown",R=>C(R),!1),v.current=!0),()=>{v.current&&document.removeEventListener("keydown",R=>C(R),!1)}),[C]),Ju(()=>{if(n){let R="";R=y0({classPrefix:e,zIndex:r}),o&&(R=R.replace(/\n/g,"").replace(/\s\s+/g," ")),x(R)}},[n,o,r,e]),Ju(()=>{if(typeof s=="function"&&s(c),typeof s=="boolean"&&s){let R=Object.keys(c).filter(k=>c[k].isOpen),E=new URLSearchParams;for(let k of R)E.append("modal",k);let F=E.toString()?`?${E}`:"",L=`${window.location.pathname}${F}`;window.history.pushState({},"",L)}},[c,s]),Ju(()=>{let R=Object.keys(c).some(E=>c[E].isOpen);f(R)},[c]);let y=zn((R,E)=>{E&&(R?(x0(E),g(!0)):(C0(E),g(!1)))},[]),I=zn(R=>{a.current=R},[]),w=zn(R=>{u({type:"OPEN_MODAL",payload:{slug:R}})},[]),A=zn(R=>{u({type:"CLOSE_MODAL",payload:{slug:R}})},[]),_=zn(()=>{u({type:"CLOSE_ALL_MODALS"})},[]),D=zn(R=>{u({type:"TOGGLE_MODAL",payload:{slug:R}})},[]),T=zn(R=>c[R]&&c[R].isOpen,[c]),S=Object.assign({},t);return delete S.children,vA(xA,{children:[n&&I0("style",{dangerouslySetInnerHTML:{__html:b}}),I0(Wu.Provider,{value:Object.assign(Object.assign({},S),{transTime:l,containerRef:a,modalState:c,oneModalIsOpen:d,isModalOpen:T,closeOnBlur:m,bodyScrollIsLocked:p,classPrefix:e,closeAllModals:_,setCloseOnBlur:h,openModal:w,closeModal:A,toggleModal:D,setBodyScrollLock:y,setContainerRef:I}),children:i})]})};import{usePathname as fF,useRouter as pF}from"next/navigation.js";import{formatAdminURL as hF}from"payload/shared";import*as $0 from"qs-esm";import L0,{createContext as gF,use as bF,useCallback as Ls,useEffect as td,useState as al}from"react";import xe,{forwardRef as IA,isValidElement as Sp}from"react";import SA from"react-dom";import Mo from"react";import R0 from"react";import LA from"react";var RA=t=>{switch(t){case"success":return TA;case"info":return FA;case"warning":return AA;case"error":return EA;default:return null}},_A=Array(12).fill(0),DA=({visible:t,className:e})=>Mo.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Mo.createElement("div",{className:"sonner-spinner"},_A.map((o,n)=>Mo.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),TA=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"})),AA=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"})),FA=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"})),EA=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"})),PA=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"})),NA=()=>{let[t,e]=R0.useState(document.hidden);return R0.useEffect(()=>{let o=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),t},Rp=1,kA=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:Rp++,s=this.toasts.find(l=>l.id===r),i=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(l=>l.id===r?(this.publish({...l,...t,id:r,title:o}),{...l,...t,id:r,dismissible:i,title:o}):l):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 a=>{if(s=["resolve",a],LA.isValidElement(a))r=!1,this.create({id:o,type:"default",message:a});else if(jA(a)&&!a.ok){r=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${a.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${a.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(a):e.success,u=typeof e.description=="function"?await e.description(a):e.description;this.create({id:o,type:"success",message:c,description:u})}}).catch(async a=>{if(s=["reject",a],e.error!==void 0){r=!1;let c=typeof e.error=="function"?await e.error(a):e.error,u=typeof e.description=="function"?await e.description(a):e.description;this.create({id:o,type:"error",message:c,description:u})}}).finally(()=>{var a;r&&(this.dismiss(o),o=void 0),(a=e.finally)==null||a.call(e)}),l=()=>new Promise((a,c)=>i.then(()=>s[0]==="reject"?c(s[1]):a(s[1])).catch(c));return typeof o!="string"&&typeof o!="number"?{unwrap:l}:Object.assign(o,{unwrap:l})},this.custom=(t,e)=>{let o=e?.id||Rp++;return this.create({jsx:t(o),id:o,...e}),o},this.subscribers=[],this.toasts=[]}},Uo=new kA,$A=(t,e)=>{let o=e?.id||Rp++;return Uo.addToast({title:t,...e,id:o}),o},jA=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",OA=$A,MA=()=>Uo.toasts,fe=Object.assign(OA,{success:Uo.success,info:Uo.info,warning:Uo.warning,error:Uo.error,custom:Uo.custom,message:Uo.message,promise:Uo.promise,dismiss:Uo.dismiss,loading:Uo.loading},{getHistory:MA});function BA(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))}BA(`: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 qu(t){return t.label!==void 0}var VA=3,GA="32px",WA="16px",_0=4e3,zA=356,HA=14,XA=20,UA=200;function Ir(...t){return t.filter(Boolean).join(" ")}function YA(t){let[e,o]=t.split("-"),n=[];return e&&n.push(e),o&&n.push(o),n}var ZA=t=>{var e,o,n,r,s,i,l,a,c,u,d;let{invert:f,toast:m,unstyled:h,interacting:p,setHeights:g,visibleToasts:b,heights:x,index:v,toasts:C,expanded:y,removeToast:I,defaultRichColors:w,closeButton:A,style:_,cancelButtonStyle:D,actionButtonStyle:T,className:S="",descriptionClassName:R="",duration:E,position:F,gap:L,loadingIcon:k,expandByDefault:N,classNames:P,icons:j,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:M}=t,[O,B]=xe.useState(null),[G,Y]=xe.useState(null),[X,ee]=xe.useState(!1),[q,z]=xe.useState(!1),[re,me]=xe.useState(!1),[se,Z]=xe.useState(!1),[Q,ge]=xe.useState(!1),[Ie,Fe]=xe.useState(0),[Le,K]=xe.useState(0),_e=xe.useRef(m.duration||E||_0),pe=xe.useRef(null),ce=xe.useRef(null),ne=v===0,H=v+1<=b,U=m.type,le=m.dismissible!==!1,De=m.className||"",Ne=m.descriptionClassName||"",qe=xe.useMemo(()=>x.findIndex(J=>J.toastId===m.id)||0,[x,m.id]),Ue=xe.useMemo(()=>{var J;return(J=m.closeButton)!=null?J:A},[m.closeButton,A]),ke=xe.useMemo(()=>m.duration||E||_0,[m.duration,E]),ot=xe.useRef(0),Ft=xe.useRef(0),Wt=xe.useRef(0),mt=xe.useRef(null),[ze,rt]=F.split("-"),ue=xe.useMemo(()=>x.reduce((J,te,he)=>he>=qe?J:J+te.height,0),[x,qe]),ve=NA(),Ve=m.invert||f,Ge=U==="loading";Ft.current=xe.useMemo(()=>qe*L+ue,[qe,ue]),xe.useEffect(()=>{_e.current=ke},[ke]),xe.useEffect(()=>{ee(!0)},[]),xe.useEffect(()=>{let J=ce.current;if(J){let te=J.getBoundingClientRect().height;return K(te),g(he=>[{toastId:m.id,height:te,position:m.position},...he]),()=>g(he=>he.filter(Pe=>Pe.toastId!==m.id))}},[g,m.id]),xe.useLayoutEffect(()=>{if(!X)return;let J=ce.current,te=J.style.height;J.style.height="auto";let he=J.getBoundingClientRect().height;J.style.height=te,K(he),g(Pe=>Pe.find(je=>je.toastId===m.id)?Pe.map(je=>je.toastId===m.id?{...je,height:he}:je):[{toastId:m.id,height:he,position:m.position},...Pe])},[X,m.title,m.description,g,m.id]);let $e=xe.useCallback(()=>{z(!0),Fe(Ft.current),g(J=>J.filter(te=>te.toastId!==m.id)),setTimeout(()=>{I(m)},UA)},[m,I,g,Ft]);xe.useEffect(()=>{if(m.promise&&U==="loading"||m.duration===1/0||m.type==="loading")return;let J;return y||p||M&&ve?(()=>{if(Wt.current<ot.current){let te=new Date().getTime()-ot.current;_e.current=_e.current-te}Wt.current=new Date().getTime()})():_e.current!==1/0&&(ot.current=new Date().getTime(),J=setTimeout(()=>{var te;(te=m.onAutoClose)==null||te.call(m,m),$e()},_e.current)),()=>clearTimeout(J)},[y,p,m,U,M,ve,$e]),xe.useEffect(()=>{m.delete&&$e()},[$e,m.delete]);function ie(){var J,te,he;return j!=null&&j.loading?xe.createElement("div",{className:Ir(P?.loader,(J=m?.classNames)==null?void 0:J.loader,"sonner-loader"),"data-visible":U==="loading"},j.loading):k?xe.createElement("div",{className:Ir(P?.loader,(te=m?.classNames)==null?void 0:te.loader,"sonner-loader"),"data-visible":U==="loading"},k):xe.createElement(DA,{className:Ir(P?.loader,(he=m?.classNames)==null?void 0:he.loader),visible:U==="loading"})}return xe.createElement("li",{tabIndex:0,ref:ce,className:Ir(S,De,P?.toast,(e=m?.classNames)==null?void 0:e.toast,P?.default,P?.[U],(o=m?.classNames)==null?void 0:o[U]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:w,"data-styled":!(m.jsx||m.unstyled||h),"data-mounted":X,"data-promise":!!m.promise,"data-swiped":Q,"data-removed":q,"data-visible":H,"data-y-position":ze,"data-x-position":rt,"data-index":v,"data-front":ne,"data-swiping":re,"data-dismissible":le,"data-type":U,"data-invert":Ve,"data-swipe-out":se,"data-swipe-direction":G,"data-expanded":!!(y||N&&X),style:{"--index":v,"--toasts-before":v,"--z-index":C.length-v,"--offset":`${q?Ie:Ft.current}px`,"--initial-height":N?"auto":`${Le}px`,..._,...m.style},onPointerDown:J=>{Ge||!le||(pe.current=new Date,Fe(Ft.current),J.target.setPointerCapture(J.pointerId),J.target.tagName!=="BUTTON"&&(me(!0),mt.current={x:J.clientX,y:J.clientY}))},onPointerUp:()=>{var J,te,he,Pe;if(se||!le)return;mt.current=null;let je=Number(((J=ce.current)==null?void 0:J.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ye=Number(((te=ce.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qe=new Date().getTime()-((he=pe.current)==null?void 0:he.getTime()),Ze=O==="x"?je:Ye,_t=Math.abs(Ze)/Qe;if(Math.abs(Ze)>=XA||_t>.11){Fe(Ft.current),(Pe=m.onDismiss)==null||Pe.call(m,m),Y(O==="x"?je>0?"right":"left":Ye>0?"down":"up"),$e(),Z(!0),ge(!1);return}me(!1),B(null)},onPointerMove:J=>{var te,he,Pe,je;if(!mt.current||!le||((te=window.getSelection())==null?void 0:te.toString().length)>0)return;let Ye=J.clientY-mt.current.y,Qe=J.clientX-mt.current.x,Ze=(he=t.swipeDirections)!=null?he:YA(F);!O&&(Math.abs(Qe)>1||Math.abs(Ye)>1)&&B(Math.abs(Qe)>Math.abs(Ye)?"x":"y");let _t={x:0,y:0};O==="y"?(Ze.includes("top")||Ze.includes("bottom"))&&(Ze.includes("top")&&Ye<0||Ze.includes("bottom")&&Ye>0)&&(_t.y=Ye):O==="x"&&(Ze.includes("left")||Ze.includes("right"))&&(Ze.includes("left")&&Qe<0||Ze.includes("right")&&Qe>0)&&(_t.x=Qe),(Math.abs(_t.x)>0||Math.abs(_t.y)>0)&&ge(!0),(Pe=ce.current)==null||Pe.style.setProperty("--swipe-amount-x",`${_t.x}px`),(je=ce.current)==null||je.style.setProperty("--swipe-amount-y",`${_t.y}px`)}},Ue&&!m.jsx?xe.createElement("button",{"aria-label":V,"data-disabled":Ge,"data-close-button":!0,onClick:Ge||!le?()=>{}:()=>{var J;$e(),(J=m.onDismiss)==null||J.call(m,m)},className:Ir(P?.closeButton,(r=m?.classNames)==null?void 0:r.closeButton)},(s=j?.close)!=null?s:PA):null,m.jsx||Sp(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:xe.createElement(xe.Fragment,null,U||m.icon||m.promise?xe.createElement("div",{"data-icon":"",className:Ir(P?.icon,(i=m?.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ie():null,m.type!=="loading"?m.icon||j?.[U]||RA(U):null):null,xe.createElement("div",{"data-content":"",className:Ir(P?.content,(l=m?.classNames)==null?void 0:l.content)},xe.createElement("div",{"data-title":"",className:Ir(P?.title,(a=m?.classNames)==null?void 0:a.title)},typeof m.title=="function"?m.title():m.title),m.description?xe.createElement("div",{"data-description":"",className:Ir(R,Ne,P?.description,(c=m?.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),Sp(m.cancel)?m.cancel:m.cancel&&qu(m.cancel)?xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||D,onClick:J=>{var te,he;qu(m.cancel)&&le&&((he=(te=m.cancel).onClick)==null||he.call(te,J),$e())},className:Ir(P?.cancelButton,(u=m?.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,Sp(m.action)?m.action:m.action&&qu(m.action)?xe.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:J=>{var te,he;qu(m.action)&&((he=(te=m.action).onClick)==null||he.call(te,J),!J.defaultPrevented&&$e())},className:Ir(P?.actionButton,(d=m?.classNames)==null?void 0:d.actionButton)},m.action.label):null))};function D0(){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 JA(t,e){let o={};return[t,e].forEach((n,r)=>{let s=r===1,i=s?"--mobile-offset":"--offset",l=s?WA:GA;function a(c){["top","right","bottom","left"].forEach(u=>{o[`${i}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?a(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?o[`${i}-${c}`]=l:o[`${i}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):a(l)}),o}var T0=IA(function(t,e){let{invert:o,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:l,offset:a,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:m,visibleToasts:h=VA,toastOptions:p,dir:g=D0(),gap:b=HA,loadingIcon:x,icons:v,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:y}=t,[I,w]=xe.useState([]),A=xe.useMemo(()=>Array.from(new Set([n].concat(I.filter(M=>M.position).map(M=>M.position)))),[I,n]),[_,D]=xe.useState([]),[T,S]=xe.useState(!1),[R,E]=xe.useState(!1),[F,L]=xe.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),k=xe.useRef(null),N=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=xe.useRef(null),j=xe.useRef(!1),V=xe.useCallback(M=>{w(O=>{var B;return(B=O.find(G=>G.id===M.id))!=null&&B.delete||Uo.dismiss(M.id),O.filter(({id:G})=>G!==M.id)})},[]);return xe.useEffect(()=>Uo.subscribe(M=>{if(M.dismiss){w(O=>O.map(B=>B.id===M.id?{...B,delete:!0}:B));return}setTimeout(()=>{SA.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"){L(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{L(O?"dark":"light")})}catch{M.addListener(({matches:B})=>{try{L(B?"dark":"light")}catch(G){console.error(G)}})}},[u]),xe.useEffect(()=>{I.length<=1&&S(!1)},[I]),xe.useEffect(()=>{let M=O=>{var B,G;r.every(Y=>O[Y]||O.code===Y)&&(S(!0),(B=k.current)==null||B.focus()),O.code==="Escape"&&(document.activeElement===k.current||(G=k.current)!=null&&G.contains(document.activeElement))&&S(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[r]),xe.useEffect(()=>{if(k.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,j.current=!1)}},[k.current]),xe.createElement("section",{ref:e,"aria-label":`${C} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((M,O)=>{var B;let[G,Y]=M.split("-");return I.length?xe.createElement("ol",{key:M,dir:g==="auto"?D0():g,tabIndex:-1,ref:k,className:l,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":G,"data-lifted":T&&I.length>1&&!s,"data-x-position":Y,style:{"--front-toast-height":`${((B=_[0])==null?void 0:B.height)||0}px`,"--width":`${zA}px`,"--gap":`${b}px`,...m,...JA(a,c)},onBlur:X=>{j.current&&!X.currentTarget.contains(X.relatedTarget)&&(j.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||j.current||(j.current=!0,P.current=X.relatedTarget)},onMouseEnter:()=>S(!0),onMouseMove:()=>S(!0),onMouseLeave:()=>{R||S(!1)},onPointerDown:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},I.filter(X=>!X.position&&O===0||X.position===M).map((X,ee)=>{var q,z;return xe.createElement(ZA,{key:X.id,icons:v,index:ee,toast:X,defaultRichColors:d,duration:(q=p?.duration)!=null?q:f,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:o,visibleToasts:h,closeButton:(z=p?.closeButton)!=null?z:i,interacting:R,position:M,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:V,toasts:I.filter(re=>re.position==X.position),heights:_.filter(re=>re.position==X.position),setHeights:D,expandByDefault:s,gap:b,loadingIcon:x,expanded:T,pauseWhenPageIsHidden:y,swipeDirections:t.swipeDirections})})):null}))});import{c as sF}from"react/compiler-runtime";import{jsx as iF}from"react/jsx-runtime";import{useRouter as aF}from"next/navigation.js";import{formatAdminURL as lF}from"payload/shared";import"react";import{c as rF}from"react/compiler-runtime";import{jsx as il,jsxs as Ap}from"react/jsx-runtime";import nF from"react";import{c as Dp}from"react/compiler-runtime";import{jsx as dn,jsxs as Ku}from"react/jsx-runtime";import{createContext as eF,use as tF,useEffect as A0,useState as F0}from"react";import{jsx as qA}from"react/jsx-runtime";import"react";var Qu="gutter",Bo=t=>{let{children:e,className:o,left:n=!0,negativeLeft:r=!1,negativeRight:s=!1,ref:i,right:l=!0}=t,a=n&&!r,c=l&&!s;return qA("div",{className:[a&&`${Qu}--left`,c&&`${Qu}--right`,r&&`${Qu}--negative-left`,s&&`${Qu}--negative-right`,o].filter(Boolean).join(" "),ref:i,children:e})};import{c as QA}from"react/compiler-runtime";import{useId as KA}from"react";var sl=t=>{let e=QA(3),o=KA(),n=ut(),r=`${t}-${o}`,s;return e[0]!==n||e[1]!==r?(s=_p({slug:r,depth:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};var Sr="drawer",Tp=100,_p=({slug:t,depth:e})=>`drawer_${e}_${t}`,ar=t=>{let e=Dp(17),o,n,r,s,i,l;e[0]!==t?({slug:l,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]=l):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],l=e[6]);let{openModal:a}=de(),c;e[7]!==s||e[8]!==a||e[9]!==l?(c=f=>{a(l),typeof s=="function"&&s(f)},e[7]=s,e[8]=a,e[9]=l,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=dn("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=Dp(26),{slug:o,children:n,className:r,gutter:s,Header:i,hoverTitle:l,title:a}=t,c=s===void 0?!0:s,{t:u}=$(),{closeModal:d,modalState:f}=de(),m=Li(),[h,p]=F0(!1),[g,b]=F0(!1),x,v;e[0]!==f||e[1]!==o?(x=()=>{p(f[o]?.isOpen)},v=[o,f],e[0]=f,e[1]=o,e[2]=x,e[3]=v):(x=e[2],v=e[3]),A0(x,v);let C,y;if(e[4]!==h?(C=()=>{b(h)},y=[h],e[4]=h,e[5]=C,e[6]=y):(C=e[5],y=e[6]),A0(C,y),h){let I=g&&`${Sr}--is-open`,w=m>1&&`${Sr}--nested`,A;e[7]!==r||e[8]!==I||e[9]!==w?(A=[r,Sr,I,w].filter(Boolean),e[7]=r,e[8]=I,e[9]=w,e[10]=A):A=e[10];let _=A.join(" "),D=Tp+m,T;if(e[11]!==i||e[12]!==n||e[13]!==d||e[14]!==m||e[15]!==c||e[16]!==l||e[17]!==o||e[18]!==u||e[19]!==D||e[20]!==_||e[21]!==a){let S;e[23]!==d||e[24]!==o?(S=()=>d(o),e[23]=d,e[24]=o,e[25]=S):S=e[25],T=dn(oF,{children:Ku(Xo,{className:_,slug:o,style:{zIndex:D},children:[(!m||m===1)&&dn("div",{className:`${Sr}__blur-bg`}),dn("button",{"aria-label":u("general:close"),className:`${Sr}__close`,id:`close-drawer__${o}`,onClick:S,type:"button"}),Ku("div",{className:`${Sr}__content`,style:{width:`calc(100% - (${m} * var(--gutter-h)))`},children:[dn("div",{className:`${Sr}__blur-bg-content`}),Ku(Bo,{className:`${Sr}__content-children`,left:c,right:c,children:[i,i===void 0&&Ku("div",{className:`${Sr}__header`,children:[dn("h2",{className:`${Sr}__header__title`,title:l?a:null,children:a}),dn("button",{"aria-label":u("general:close"),className:`${Sr}__header__close`,id:`close-drawer__${o}`,onClick:()=>d(o),type:"button",children:dn(pt,{})})]}),n]})]})]})}),e[11]=i,e[12]=n,e[13]=d,e[14]=m,e[15]=c,e[16]=l,e[17]=o,e[18]=u,e[19]=D,e[20]=_,e[21]=a,e[22]=T}else T=e[22];return T}return null},E0=eF(1),oF=t=>{let e=Dp(3),{children:o}=t,r=Li()+1,s;return e[0]!==o||e[1]!==r?(s=dn(E0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},Li=()=>tF(E0);var ed="confirmation-modal";function It(t){let e=rF(33),{body:o,cancelLabel:n,className:r,confirmingLabel:s,confirmLabel:i,heading:l,modalSlug:a,onCancel:c,onConfirm:u}=t,d=Li(),[f,m]=nF.useState(!1),{closeModal:h}=de(),{t:p}=$(),g;e[0]!==h||e[1]!==f||e[2]!==a||e[3]!==u?(g=async()=>{f||(m(!0),typeof u=="function"&&await u(),m(!1),h(a))},e[0]=h,e[1]=f,e[2]=a,e[3]=u,e[4]=g):g=e[4];let b=g,x;e[5]!==h||e[6]!==f||e[7]!==a||e[8]!==c?(x=()=>{f||(h(a),typeof c=="function"&&c())},e[5]=h,e[6]=f,e[7]=a,e[8]=c,e[9]=x):x=e[9];let v=x,C;e[10]!==r?(C=[ed,r].filter(Boolean),e[10]=r,e[11]=C):C=e[11];let y=C.join(" "),I=Tp+d,w;if(e[12]!==o||e[13]!==n||e[14]!==i||e[15]!==f||e[16]!==s||e[17]!==l||e[18]!==a||e[19]!==v||e[20]!==b||e[21]!==p||e[22]!==y||e[23]!==I){let A;e[25]!==n||e[26]!==p?(A=n||p("general:cancel"),e[25]=n,e[26]=p,e[27]=A):A=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=il(Xo,{className:y,slug:a,style:{zIndex:I},children:Ap("div",{className:`${ed}__wrapper`,children:[Ap("div",{className:`${ed}__content`,children:[il("h1",{children:l}),il("p",{children:o})]}),Ap("div",{className:`${ed}__controls`,children:[il(ae,{buttonStyle:"secondary",disabled:f,id:"confirm-cancel",onClick:v,size:"large",type:"button",children:A}),il(ae,{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]=l,e[18]=a,e[19]=v,e[20]=b,e[21]=p,e[22]=y,e[23]=I,e[24]=w}else w=e[24];return w}var Fp="stay-logged-in",P0=()=>{let t=sF(11),{refreshCookie:e}=Se(),o=aF(),{config:n}=W(),{admin:r,routes:s}=n,{routes:i}=r,{logout:l}=i,{admin:a}=s,{t:c}=$(),{startRouteTransition:u}=it(),d;t[0]!==a||t[1]!==l||t[2]!==o||t[3]!==u?(d=()=>u(()=>o.push(lF({adminRoute:a,path:l}))),t[0]=a,t[1]=l,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=iF(It,{body:c("authentication:youAreInactive"),cancelLabel:c("authentication:stayLoggedIn"),confirmLabel:c("authentication:logOut"),heading:c("authentication:stayLoggedIn"),modalSlug:Fp,onCancel:h,onConfirm:f}),t[7]=h,t[8]=f,t[9]=c,t[10]=p):p=t[10],p};import{c as cF}from"react/compiler-runtime";import{useEffect as uF,useState as dF}from"react";function Yo(t,e){let o=cF(4),[n,r]=dF(t),s,i;return o[0]!==e||o[1]!==t?(s=()=>{let l=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(l)}},i=[t,e],o[0]=e,o[1]=t,o[2]=s,o[3]=i):(s=o[2],i=o[3]),uF(s,i),n}import*as N0 from"qs-esm";var Ke={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=N0.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 j0=gF({}),k0=2147483647;function Ep({children:t,permissions:e,user:o}){let[n,r]=al(o),[s,i]=al(),[l,a]=al(),c=fF(),u=pF(),{config:d}=W(),{admin:{routes:{inactivity:f},user:m},routes:{admin:h,api:p},serverURL:g}=d,[b,x]=al(e),{i18n:v}=$(),{closeAllModals:C,openModal:y}=de(),[I,w]=al(0),A=Yo(I,1e4),_=L0.useRef(null),{startRouteTransition:D}=it(),T=n?.id,S=Ls(()=>{D(()=>u.replace(hF({adminRoute:h,path:`${f}${window.location.pathname.startsWith(h)?`?redirect=${encodeURIComponent(window.location.pathname)}`:""}`}))),C()},[u,h,f,C,D]),R=Ls(()=>{i(void 0),a(void 0),clearTimeout(_.current)},[]),E=Ls(j=>{j?.user?(r(j.user),i(j.token),a(j.exp)):(r(null),R())},[R]),F=Ls(j=>{let V=Math.round(new Date().getTime()/1e3),M=(typeof l=="number"?l:0)-V;return(j||l&&M<120)&&(_.current=setTimeout(()=>{async function O(){try{let B=await Ke.post(`${g}${p}/${m}/refresh-token?refresh`,{headers:{"Accept-Language":v.language}});if(B.status===200){let G=await B.json();E(G)}else E(null),S()}catch(B){fe.error(B.message)}}O()},1e3)),()=>{clearTimeout(_.current)}},[p,v.language,S,g,E,l,m]),L=Ls(async j=>{try{let V=await Ke.post(`${g}${p}/${m}/refresh-token`,{headers:{"Accept-Language":v.language}});if(V.status===200){let M=await V.json();return j||E(M),M.user}return E(null),S(),null}catch(V){return fe.error(`Refreshing token failed: ${V.message}`),null}},[p,v.language,S,g,E,m]),k=Ls(async()=>{try{return await Ke.post(`${g}${p}/${n.collection}/logout`),E(null),R(),!0}catch(j){return fe.error(`Logging out failed: ${j.message}`),!1}},[p,R,g,E,n]),N=Ls(async({locale:j}={})=>{let V=$0.stringify({locale:j},{addQueryPrefix:!0});try{let M=await Ke.get(`${g}${p}/access${V}`,{headers:{"Accept-Language":v.language}});if(M.status===200){let O=await M.json();x(O)}else throw new Error(`Fetching permissions failed with status code ${M.status}`)}catch(M){fe.error(`Refreshing permissions failed: ${M.message}`)}},[g,p,v]),P=L0.useCallback(async()=>{try{let j=await Ke.get(`${g}${p}/${m}/me`,{credentials:"include",headers:{"Accept-Language":v.language}});if(j.status===200){let V=await j.json(),M=null;return E(V),M}}catch(j){fe.error(`Fetching user failed: ${j.message}`)}return null},[g,p,m,v.language,E]);return td(()=>{P()},[P]),td(()=>{T&&F()},[A,F,T]),td(()=>{w(Date.now())},[c]),td(()=>{let j,V,M=Math.round(new Date().getTime()/1e3),O=typeof l=="number"?l-M:0,B=Math.max(Math.min((O-60)*1e3,k0),0),G=Math.max(Math.min(O*1e3,k0),0);if(!n){clearTimeout(j),clearTimeout(V);return}return O>0&&(j=setTimeout(()=>{y(Fp)},B),V=setTimeout(()=>{E(null),S()},G)),()=>{j&&clearTimeout(j),V&&clearTimeout(V)}},[l,y,v,E,n,S]),mF(j0,{value:{fetchFullUser:P,logOut:k,permissions:b,refreshCookie:F,refreshCookieAsync:L,refreshPermissions:N,setPermissions:x,setUser:E,token:s,user:n},children:t})}var Se=()=>bF(j0);import{jsx as vF}from"react/jsx-runtime";import{dequal as O0}from"dequal/lite";import{createContext as xF,use as CF,useCallback as M0,useEffect as yF,useRef as Np}from"react";function Pp(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]=Pp(t[n],e[n]):o[n]=e[n]);return o}var V0=xF({}),B0=(t,e)=>({body:JSON.stringify({value:t}),headers:{"Accept-Language":e,"Content-Type":"application/json"}}),Lp=({children:t})=>{let e=Np({}),o=Np({}),n=Np({}),{config:r}=W(),{user:s}=Se(),{i18n:i}=$(),{routes:{api:l},serverURL:a}=r;yF(()=>{s||(o.current={})},[s]);let c=M0(async d=>{let f=o.current;if(typeof f[d]<"u")return f[d];let m=new Promise(h=>{(async()=>{let p=await Ke.get(`${a}${l}/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,l,o,a]),u=M0(async(d,f,m=!1)=>{if(m===!1){o.current[d]=f,await Ke.post(`${a}${l}/payload-preferences/${d}`,B0(f,i.language));return}let h=f,p=await c(d);if(typeof f=="object"&&typeof p=="object"&&typeof h=="object"){if(p&&(h=Pp(p,h)),O0(h,p))return;n.current[d]={...n.current[d],...h}}else{if(h===p)return;n.current[d]=h}let g=async()=>{O0(n.current[d],o.current[d])||(o.current[d]=n.current[d],await Ke.post(`${a}${l}/payload-preferences/${d}`,B0(o.current[d],i.language)),delete n.current[d])};setTimeout(()=>{g()})},[l,c,i.language,n,a]);return e.current.getPreference=c,e.current.setPreference=u,vF(V0,{value:e.current,children:t})},Do=()=>CF(V0);var X0=z0({}),U0=z0({localeIsLoading:!1,setLocaleIsLoading:t=>{}}),DF=async(t,e)=>await fetch(`${e}/payload-preferences/${t}`,{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"})?.then(o=>o.json()),kp=t=>{let e=wF(27),{children:o,locale:n}=t,{config:r}=W(),{localization:s,routes:i,serverURL:l}=r,a=s===void 0?!1:s,{api:c}=i,{user:u}=Se(),d=a?a.defaultLocale:"en",{getPreference:f}=Do(),m=IF(),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]!==a?(g=()=>!a||a&&!a.locales.length?{}:Wn(a,p)||Wn(a,n)||Wn(a,d)||Wn(a,a.locales[0].code),e[2]=d,e[3]=n,e[4]=p,e[5]=a,e[6]=g):g=e[6];let[b,x]=SF.useState(g),[v,C]=_F(!1),y=RF(b),I,w;e[7]!==b?(I=()=>{b.code!==y.current.code&&C(!1),y.current=b},w=[b],e[7]=b,e[8]=I,e[9]=w):(I=e[8],w=e[9]),W0(I,w);let A=`${l}${c}`,_;e[10]!==d||e[11]!==A||e[12]!==p||e[13]!==a||e[14]!==u?.id?(_=()=>{(async function(){if(a&&u?.id){let F=p||await DF("locale",A)?.then(TF),L=Wn(a,F)||Wn(a,d)||Wn(a,a?.locales?.[0]?.code);L&&x(L)}})()},e[10]=d,e[11]=A,e[12]=p,e[13]=a,e[14]=u?.id,e[15]=_):_=e[15];let D=u?.id,T;e[16]!==d||e[17]!==A||e[18]!==f||e[19]!==p||e[20]!==a||e[21]!==D?(T=[d,f,a,A,p,D],e[16]=d,e[17]=A,e[18]=f,e[19]=p,e[20]=a,e[21]=D,e[22]=T):T=e[22],W0(_,T);let S;return e[23]!==o||e[24]!==v||e[25]!==b?(S=G0(X0,{value:b,children:G0(U0,{value:{localeIsLoading:v,setLocaleIsLoading:C},children:o})}),e[23]=o,e[24]=v,e[25]=b,e[26]=S):S=e[26],S},od=()=>H0(U0),Ee=()=>H0(X0);function TF(t){return t.value}var rd=(t,e,o)=>`field-${t?.replace(/\./g,"__")}${e>1?`-${e}`:""}${o?`-${o}`:""}`;var be=t=>{let e=AF(25),{as:o,hideLocale:n,htmlFor:r,label:s,localized:i,path:l,required:a,unstyled:c}=t,u=o===void 0?"label":o,d=n===void 0?!1:n,f=i===void 0?!1:i,m=a===void 0?!1:a,h=c===void 0?!1:c,{uuid:p}=Me(),g=ut(),b;e[0]!==g||e[1]!==r||e[2]!==l||e[3]!==p?(b=r||rd(l,g,p),e[0]=g,e[1]=r,e[2]=l,e[3]=p,e[4]=b):b=e[4];let x=b,{i18n:v}=$(),{code:C,label:y}=Ee();if(s){let I=`field-label ${h?"unstyled":""}`,w;if(e[5]!==u||e[6]!==C||e[7]!==d||e[8]!==x||e[9]!==v||e[10]!==s||e[11]!==y||e[12]!==f||e[13]!==m||e[14]!==I||e[15]!==h){let A;e[17]!==m||e[18]!==h?(A=m&&!h&&FF("span",{className:"required",children:"*"}),e[17]=m,e[18]=h,e[19]=A):A=e[19];let _;e[20]!==C||e[21]!==d||e[22]!==y||e[23]!==f?(_=f&&!d&&Y0("span",{className:"localized",children:["\u2014 ",typeof y=="string"?y:C]}),e[20]=C,e[21]=d,e[22]=y,e[23]=f,e[24]=_):_=e[24],w=Y0(u,{className:I,htmlFor:x,children:[EF(s,v),A,_]}),e[5]=u,e[6]=C,e[7]=d,e[8]=x,e[9]=v,e[10]=s,e[11]=y,e[12]=f,e[13]=m,e[14]=I,e[15]=h,e[16]=w}else w=e[16];return w}return null};var nd=({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:[]}),sd=({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 xE}from"react/compiler-runtime";import{jsx as Vx}from"react/jsx-runtime";import*as Gx from"react";import{jsx as hl,jsxs as gE}from"react/jsx-runtime";import{useCallback as Bx,useMemo as bE}from"react";import{c as fE}from"react/compiler-runtime";import{useRef as $x}from"react";import{c as PF}from"react/compiler-runtime";import{useEffect as NF,useRef as LF}from"react";var ks=(t,e,o)=>{let n=PF(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 l=LF(i),a;n[3]!==t||n[4]!==e?(a=()=>{let u=setTimeout(()=>{Date.now()-l.current>=e&&(t(),l.current=Date.now())},e-(Date.now()-l.current));return()=>{clearTimeout(u)}},n[3]=t,n[4]=e,n[5]=a):a=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],NF(a,c)};import{jsx as Xp}from"react/jsx-runtime";import*as Lx from"qs-esm";import Px,{createContext as sE,use as iE,useCallback as Mi,useEffect as Nx,useMemo as aE,useRef as lE,useState as Zo}from"react";import{getTranslation as tE}from"@payloadcms/translations";var kF={},ll={};function ki(t,e){try{let n=(kF[t]||=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format)(e).split("GMT")[1]||"";return n in ll?ll[n]:Z0(n,n.split(":"))}catch{if(t in ll)return ll[t];let o=t?.match($F);return o?Z0(t,o.slice(1)):NaN}}var $F=/([+-]\d\d):?(\d\d)?/;function Z0(t,e){let o=+e[0],n=+(e[1]||0);return ll[t]=o>0?o*60+n:o*60-n}var jt=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(ki(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)),q0(this,NaN),$p(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-ki(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),$p(this),+this}[Symbol.for("constructDateFrom")](e){return new t(+new Date(e),this.timeZone)}},J0=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!J0.test(t))return;let e=t.replace(J0,"$1UTC");jt.prototype[e]&&(t.startsWith("get")?jt.prototype[t]=function(){return this.internal[e]()}:(jt.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),jF(this),+this},jt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),$p(this),+this}))});function $p(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function jF(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()),q0(t)}function q0(t){let e=ki(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 l=n-e;l&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+l);let a=ki(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-a,d=a!==e,f=u-l;if(d&&f){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+f);let m=ki(t.timeZone,t),h=a-m;h&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+h),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+h))}}var OF=Math.pow(10,8)*24*60*60*1e3,FZ=-OF,id=6048e5,Q0=864e5;var cl=43200,jp=1440;var MF=3600;var K0=MF*24,EZ=K0*7,BF=K0*365.2425,VF=BF/12,PZ=VF*3,Op=Symbol.for("constructDateFrom");function oo(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Op in t?t[Op](e):t instanceof Date?new t.constructor(e):new Date(e)}function et(t,e){return oo(e||t,t)}var GF={};function Hr(){return GF}function mn(t,e){let o=Hr(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,r=et(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 $s(t,e){return mn(t,{...e,weekStartsOn:1})}function ad(t,e){let o=et(t,e?.in),n=o.getFullYear(),r=oo(o,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let s=$s(r),i=oo(o,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let l=$s(i);return o.getTime()>=s.getTime()?n+1:o.getTime()>=l.getTime()?n:n-1}function $i(t){let e=et(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 Hn(t,...e){let o=oo.bind(null,t||e.find(n=>typeof n=="object"));return e.map(o)}function Mp(t,e){let o=et(t,e?.in);return o.setHours(0,0,0,0),o}function ex(t,e,o){let[n,r]=Hn(o?.in,t,e),s=Mp(n),i=Mp(r),l=+s-$i(s),a=+i-$i(i);return Math.round((l-a)/Q0)}function tx(t,e){let o=ad(t,e),n=oo(e?.in||t,0);return n.setFullYear(o,0,4),n.setHours(0,0,0,0),$s(n)}function ji(t,e){let o=+et(t)-+et(e);return o<0?-1:o>0?1:o}function ox(t){return oo(t,Date.now())}function rx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nx(t){return!(!rx(t)&&typeof t!="number"||isNaN(+et(t)))}function sx(t,e,o){let[n,r]=Hn(o?.in,t,e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function ix(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function ax(t,e){return+et(t)-+et(e)}function lx(t,e){let o=et(t,e?.in);return o.setHours(23,59,59,999),o}function cx(t,e){let o=et(t,e?.in),n=o.getMonth();return o.setFullYear(o.getFullYear(),n+1,0),o.setHours(23,59,59,999),o}function ux(t,e){let o=et(t,e?.in);return+lx(o,e)==+cx(o,e)}function dx(t,e,o){let[n,r,s]=Hn(o?.in,t,t,e),i=ji(r,s),l=Math.abs(sx(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*l);let a=ji(r,s)===-i;ux(n)&&l===1&&ji(n,s)===1&&(a=!1);let c=i*(l-+a);return c===0?0:c}function mx(t,e,o){let n=ax(t,e)/1e3;return ix(o?.roundingMethod)(n)}function fx(t,e){let o=et(t,e?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}function px(t,e){let o=et(t,e?.in);return ex(o,fx(o))+1}function hx(t,e){let o=et(t,e?.in),n=+$s(o)-+tx(o);return Math.round(n/id)+1}function ld(t,e){let o=et(t,e?.in),n=o.getFullYear(),r=Hr(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=oo(e?.in||t,0);i.setFullYear(n+1,0,s),i.setHours(0,0,0,0);let l=mn(i,e),a=oo(e?.in||t,0);a.setFullYear(n,0,s),a.setHours(0,0,0,0);let c=mn(a,e);return+o>=+l?n+1:+o>=+c?n:n-1}function gx(t,e){let o=Hr(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,r=ld(t,e),s=oo(e?.in||t,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),mn(s,e)}function bx(t,e){let o=et(t,e?.in),n=+mn(o,e)-+gx(o,e);return Math.round(n/id)+1}function at(t,e){let o=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return o+n}var fn={y(t,e){let o=t.getFullYear(),n=o>0?o:1-o;return at(e==="yy"?n%100:n,e.length)},M(t,e){let o=t.getMonth();return e==="M"?String(o+1):at(o+1,2)},d(t,e){return at(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 at(t.getHours()%12||12,e.length)},H(t,e){return at(t.getHours(),e.length)},m(t,e){return at(t.getMinutes(),e.length)},s(t,e){return at(t.getSeconds(),e.length)},S(t,e){let o=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,o-3));return at(r,e.length)}};var Oi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bp={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 fn.y(t,e)},Y:function(t,e,o,n){let r=ld(t,n),s=r>0?r:1-r;if(e==="YY"){let i=s%100;return at(i,2)}return e==="Yo"?o.ordinalNumber(s,{unit:"year"}):at(s,e.length)},R:function(t,e){let o=ad(t);return at(o,e.length)},u:function(t,e){let o=t.getFullYear();return at(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 at(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 at(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 fn.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 at(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=bx(t,n);return e==="wo"?o.ordinalNumber(r,{unit:"week"}):at(r,e.length)},I:function(t,e,o){let n=hx(t);return e==="Io"?o.ordinalNumber(n,{unit:"week"}):at(n,e.length)},d:function(t,e,o){return e==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):fn.d(t,e)},D:function(t,e,o){let n=px(t);return e==="Do"?o.ordinalNumber(n,{unit:"dayOfYear"}):at(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 at(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 at(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 at(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=Oi.noon:n===0?r=Oi.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=Oi.evening:n>=12?r=Oi.afternoon:n>=4?r=Oi.morning:r=Oi.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 fn.h(t,e)},H:function(t,e,o){return e==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):fn.H(t,e)},K:function(t,e,o){let n=t.getHours()%12;return e==="Ko"?o.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},k:function(t,e,o){let n=t.getHours();return n===0&&(n=24),e==="ko"?o.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},m:function(t,e,o){return e==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):fn.m(t,e)},s:function(t,e,o){return e==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):fn.s(t,e)},S:function(t,e){return fn.S(t,e)},X:function(t,e,o){let n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return xx(n);case"XXXX":case"XX":return js(n);case"XXXXX":case"XXX":default:return js(n,":")}},x:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"x":return xx(n);case"xxxx":case"xx":return js(n);case"xxxxx":case"xxx":default:return js(n,":")}},O:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+vx(n,":");case"OOOO":default:return"GMT"+js(n,":")}},z:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+vx(n,":");case"zzzz":default:return"GMT"+js(n,":")}},t:function(t,e,o){let n=Math.trunc(+t/1e3);return at(n,e.length)},T:function(t,e,o){return at(+t,e.length)}};function vx(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+at(s,2)}function xx(t,e){return t%60===0?(t>0?"-":"+")+at(Math.abs(t)/60,2):js(t,e)}function js(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=at(Math.trunc(n/60),2),s=at(n%60,2);return o+r+e+s}var Cx=(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"})}},yx=(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"})}},WF=(t,e)=>{let o=t.match(/(P+)(p+)?/)||[],n=o[1],r=o[2];if(!r)return Cx(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}}",Cx(n,e)).replace("{{time}}",yx(r,e))},wx={p:yx,P:WF};var zF=/^D+$/,HF=/^Y+$/,XF=["D","DD","YY","YYYY"];function Ix(t){return zF.test(t)}function Sx(t){return HF.test(t)}function Rx(t,e,o){let n=UF(t,e,o);if(console.warn(n),XF.includes(t))throw new RangeError(n)}function UF(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 YF=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ZF=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,JF=/^'([^]*?)'?$/,qF=/''/g,QF=/[a-zA-Z]/;function Vp(t,e,o){let n=Hr(),r=o?.locale??n.locale??za,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,l=et(t,o?.in);if(!nx(l))throw new RangeError("Invalid time value");let a=e.match(ZF).map(u=>{let d=u[0];if(d==="p"||d==="P"){let f=wx[d];return f(u,r.formatLong)}return u}).join("").match(YF).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:KF(u)};if(Bp[d])return{isToken:!0,value:u};if(d.match(QF))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(a=r.localize.preprocessor(l,a));let c={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return a.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!o?.useAdditionalWeekYearTokens&&Sx(d)||!o?.useAdditionalDayOfYearTokens&&Ix(d))&&Rx(d,e,String(t));let f=Bp[d[0]];return f(l,d,r.localize,c)}).join("")}function KF(t){let e=t.match(JF);return e?e[1].replace(qF,"'"):t}function _x(t,e,o){let n=Hr(),r=o?.locale??n.locale??za,s=2520,i=ji(t,e);if(isNaN(i))throw new RangeError("Invalid time value");let l=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:i}),[a,c]=Hn(o?.in,...i>0?[e,t]:[t,e]),u=mx(c,a),d=($i(c)-$i(a))/1e3,f=Math.round((u-d)/60),m;if(f<2)return o?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,l):u<10?r.formatDistance("lessThanXSeconds",10,l):u<20?r.formatDistance("lessThanXSeconds",20,l):u<40?r.formatDistance("halfAMinute",0,l):u<60?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",1,l):f===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",f,l);if(f<45)return r.formatDistance("xMinutes",f,l);if(f<90)return r.formatDistance("aboutXHours",1,l);if(f<jp){let h=Math.round(f/60);return r.formatDistance("aboutXHours",h,l)}else{if(f<s)return r.formatDistance("xDays",1,l);if(f<cl){let h=Math.round(f/jp);return r.formatDistance("xDays",h,l)}else if(f<cl*2)return m=Math.round(f/cl),r.formatDistance("aboutXMonths",m,l)}if(m=dx(c,a),m<12){let h=Math.round(f/cl);return r.formatDistance("xMonths",h,l)}else{let h=m%12,p=Math.trunc(m/12);return h<3?r.formatDistance("aboutXYears",p,l):h<9?r.formatDistance("overXYears",p,l):r.formatDistance("almostXYears",p+1,l)}}function Dx(t,e){return _x(t,ox(t),e)}function Rr(t,e){let o=eE(e)?new e(0):oo(e,0);return o.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),o.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),o}function eE(t){return typeof t=="function"&&t.prototype?.constructor===t}var pn=({date:t,i18n:e,pattern:o,timezone:n})=>{let r=new jt(new Date(t));if(n){let s=jt.tz(n),i=r.withTimeZone(n),l=Rr(i,s);return e.dateFNS?Vp(l,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`}return e.dateFNS?Vp(r,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`},Tx=({date:t,i18n:e})=>{let o=new Date(t);return e?.dateFNS?Dx(o,{locale:e.dateFNS}):`${e.t("general:loading")}...`};function Gp(t){return typeof t=="object"&&"root"in t}function cd(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+=cd(o.children,e));return e}var lr=({collectionConfig:t,data:e,dateFormat:o,fallback:n,globalConfig:r,i18n:s})=>{let i;if(t){let l=t?.admin?.useAsTitle;if(l&&(i=e?.[l]||i,i)){let a=t.fields.find(u=>"name"in u&&u.name===l);if(a?.type==="date"){let u="date"in a.admin&&a?.admin?.date?.displayFormat||o;i=pn({date:i,i18n:s,pattern:u})||i}}}return r&&(i=tE(r?.label,s)||r?.slug),Gp(i)&&(i=cd(i.root.children?.[0]?.children||[],"")),!i&&Gp(n)&&(i=cd(n.root.children?.[0]?.children||[],"")),i||(i=typeof n=="string"?n:`[${s.t("general:untitled")}]`),i};import{c as oE}from"react/compiler-runtime";import{jsx as rE}from"react/jsx-runtime";import Wp from"react";var Ax=Wp.createContext({resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),zp=t=>{let e=oE(5),{children:o}=t,[n,r]=Wp.useState(void 0),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{r({})},e[0]=s):s=e[0];let i=s,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=u=>{r(d=>({...d||{},...u||{}}))},e[1]=l):l=e[1];let a=l,c;return e[2]!==o||e[3]!==n?(c=rE(Ax,{value:{resetUploadEdits:i,updateUploadEdits:a,uploadEdits:n},children:o}),e[2]=o,e[3]=n,e[4]=c):c=e[4],c},hn=()=>Wp.use(Ax);import*as Hp from"qs-esm";import nE from"react";var ul=t=>{let{collectionSlug:e,docPermissions:o,globalSlug:n,isEditing:r}=t;return e?!!(r&&o?.update||!r&&o?.create):n?!!o?.update:!1};var Fx=({id:t,collectionSlug:e,globalSlug:o})=>!!(o||e&&t);var Ex=({id:t,api:e,collectionSlug:o,globalSlug:n,i18n:r,locale:s,permissions:i,serverURL:l,setDocPermissions:a,setHasPublishPermission:c,setHasSavePermission:u})=>nE.useCallback(async d=>{let f={locale:s||void 0},m=d?.id||t,h=Fx({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(`${l}${e}${p}?${Hp.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"post"})).json(),x=await fetch(`${l}${e}${p}?${Hp.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"POST"}).then(v=>v.json());a(b),u(ul({collectionSlug:o,docPermissions:b,globalSlug:n,isEditing:h})),c(x?.update)}}else{let p=o?i?.collections?.[o]:i?.globals?.[n];a(p),u(ul({collectionSlug:o,docPermissions:p,globalSlug:n,isEditing:h}))}},[l,e,t,i,r.language,s,o,n]);var kx=sE({}),Ae=()=>iE(kx),cE=({children:t,...e})=>{let{id:o,collectionSlug:n,currentEditor:r,docPermissions:s,globalSlug:i,hasPublishedDoc:l,hasPublishPermission:a,hasSavePermission:c,initialData:u,initialState:d,isLocked:f,lastUpdateTime:m,mostRecentVersionIsAutosaved:h,unpublishedVersionCount:p,versionCount:g}=e,[b,x]=Zo(s),[v,C]=Zo(c),[y,I]=Zo(a),{permissions:w}=Se(),{config:{admin:{dateFormat:A},routes:{api:_},serverURL:D},getEntityConfig:T}=W(),S=T({collectionSlug:n}),R=T({globalSlug:i}),E=lE(new AbortController),F=S||R,{i18n:L}=$(),{uploadEdits:k}=hn(),[N,P]=Zo(()=>lr({collectionConfig:S,data:{...u||{},id:o},dateFormat:A,fallback:o?.toString(),globalConfig:R,i18n:L})),[j,V]=Zo(h),[M,O]=Zo(g),[B,G]=Zo(l),[Y,X]=Zo(p),[ee,q]=Zo(f),[z,re]=Zo(r),[me,se]=Zo(m),[Z,Q]=Zo(u),[ge,Ie]=Zo("idle"),Fe=Mi(ze=>{Ie(ze)},[]),{getPreference:Le,setPreference:K}=Do(),{code:_e}=Ee(),{localeIsLoading:pe}=od(),ce=aE(()=>d===void 0||u===void 0||pe,[u,d,pe]),ne=`${D}${_}`,H,U,le;i&&(H=i,U="globals",le=`global-${H}`),n&&(H=n,U="collections",o&&(le=`collection-${H}-${o}`));let De=Mi(async(ze,rt)=>{try{let ve=rt===i?`where[globalSlug][equals]=${rt}`:`where[document.value][equals]=${ze}&where[document.relationTo][equals]=${rt}`,Ve=await Ke.get(`${D}${_}/payload-locked-documents?${ve}`),{docs:Ge}=await Ve.json();if(Ge.length>0){let $e=Ge[0].id;await Ke.delete(`${D}${_}/payload-locked-documents/${$e}`,{headers:{"Content-Type":"application/json"}}),q(!1)}}catch(ue){console.error("Failed to unlock the document",ue)}},[D,_,i]),Ne=Mi(async(ze,rt,ue)=>{try{let Ve=rt===i?`where[globalSlug][equals]=${rt}`:`where[document.value][equals]=${ze}&where[document.relationTo][equals]=${rt}`,Ge=await Ke.get(`${D}${_}/payload-locked-documents?${Ve}`),{docs:$e}=await Ge.json();if($e.length>0){let ie=$e[0].id,J=typeof ue=="object"?{relationTo:ue.collection,value:ue.id}:{relationTo:"users",value:ue};await Ke.patch(`${D}${_}/payload-locked-documents/${ie}`,{body:JSON.stringify({user:J}),headers:{"Content-Type":"application/json"}})}}catch(ve){console.error("Failed to update the document editor",ve)}},[D,_,i]),qe=Ex({id:o,api:_,collectionSlug:n,globalSlug:i,i18n:L,locale:_e,permissions:w,serverURL:D,setDocPermissions:x,setHasPublishPermission:I,setHasSavePermission:C}),Ue=Mi(()=>Le(le),[Le,le]),ke=Mi(async(ze,rt)=>{let ue=await Ue();if(le)try{await K(le,{...ue,fields:{...ue?.fields||{},[ze]:{...ue?.fields?.[ze],...rt}}})}catch(ve){console.error(ve)}},[K,le,Ue]),ot=Mi(()=>{let ze=M+1;S&&S.versions?S.versions.maxPerDoc>0?O(Math.min(ze,S.versions.maxPerDoc)):O(ze):R&&R.versions&&(R.versions.max>0?O(Math.min(ze,R.versions.max)):O(ze))},[S,R,M]),Ft=Px.useCallback(ze=>{Q(ze)},[]);Nx(()=>{P(lr({collectionConfig:S,data:{...Z,id:o},dateFormat:A,fallback:o?.toString(),globalConfig:R,i18n:L}))},[S,R,Z,A,L,o]),Nx(()=>{let ze=E.current;return()=>{if(ze)try{ze.abort()}catch{}}},[]);let Wt=Px.useMemo(()=>`${`${ne}${U==="globals"?"/globals":""}/${H}${o?`/${o}`:""}`}${Lx.stringify({depth:0,"fallback-locale":"null",locale:_e,uploadEdits:k||void 0},{addQueryPrefix:!0})}`,[ne,_e,U,o,H,k]),mt={...e,action:Wt,currentEditor:z,docConfig:F,docPermissions:b,documentIsLocked:ee,getDocPermissions:qe,getDocPreferences:Ue,hasPublishedDoc:B,hasPublishPermission:y,hasSavePermission:v,incrementVersionCount:ot,initialData:u,initialState:d,isInitializing:ce,lastUpdateTime:me,mostRecentVersionIsAutosaved:j,preferencesKey:le,savedDocumentData:Z,setCurrentEditor:re,setDocFieldPreferences:ke,setDocumentIsLocked:q,setDocumentTitle:P,setHasPublishedDoc:G,setLastUpdateTime:se,setMostRecentVersionIsAutosaved:V,setUnpublishedVersionCount:X,setUploadStatus:Fe,title:N,unlockDocument:De,unpublishedVersionCount:Y,updateDocumentEditor:Ne,updateSavedDocumentData:Ft,uploadStatus:ge,versionCount:M};return Xp(kx,{value:mt,children:t})},dl=t=>Xp(zp,{children:Xp(cE,{...t})});import{jsx as uE}from"react/jsx-runtime";import{createContext as dE,use as mE}from"react";var ud=dE(""),ml=({children:t,operation:e})=>uE(ud,{value:e,children:t}),Jo=()=>mE(ud);var Te=t=>{let e=fE(62),{disableFormData:o,hasRows:n,path:r,validate:s}=t,i=o===void 0?!1:o,l=zt(),a=$o(),c=Rs(),{user:u}=Se(),{id:d,collectionSlug:f}=Ae(),m=Jo(),h=Et(pE),p;e[0]!==r?(p=me=>{let[se]=me;return se&&se?.[r]||null},e[0]=r,e[1]=p):p=e[1];let g=Et(p),{t:b}=$(),{config:x}=W(),{getData:v,getDataByPath:C,getSiblingData:y,setModified:I}=Me(),w=_i(),A=Ht(),_=g?.filterOptions,D=g?.value,T=g?.initialValue,S=typeof g?.valid=="boolean"?g.valid:!0,R=S===!1&&l,E=$x(S),F=$x(g?.errorMessage),L;e[2]!==r?(L=r?r.split("."):[],e[2]=r,e[3]=L):L=e[3];let k=L,N;e[4]!==i||e[5]!==h||e[6]!==n||e[7]!==A||e[8]!==r||e[9]!==I?(N=(me,se)=>{let Z=se===void 0?!1:se,Q=me&&me.target?me.target.value:me;h({type:"UPDATE",disableFormData:i||n&&Q>0,path:r,value:Q}),Z||typeof I=="function"&&A===!1&&setTimeout(()=>{I(!0)},10)},e[4]=i,e[5]=h,e[6]=n,e[7]=A,e[8]=r,e[9]=I,e[10]=N):N=e[10];let P=N,j,V=g?.customComponents,M=a||c,O=g?.errorMessage,B;e[11]!==g?.errorPaths?(B=g?.errorPaths||[],e[11]=g?.errorPaths,e[12]=B):B=e[12];let G=g?.rows,Y=g?.valid,X;e[13]!==_||e[14]!==T||e[15]!==c||e[16]!==r||e[17]!==a||e[18]!==P||e[19]!==R||e[20]!==l||e[21]!==Y||e[22]!==V||e[23]!==M||e[24]!==O||e[25]!==B||e[26]!==G||e[27]!==D?(X={customComponents:V,disabled:M,errorMessage:O,errorPaths:B,filterOptions:_,formInitializing:c,formProcessing:a,formSubmitted:l,initialValue:T,path:r,rows:G,setValue:P,showError:R,valid:Y,value:D},e[13]=_,e[14]=T,e[15]=c,e[16]=r,e[17]=a,e[18]=P,e[19]=R,e[20]=l,e[21]=Y,e[22]=V,e[23]=M,e[24]=O,e[25]=B,e[26]=G,e[27]=D,e[28]=X):X=e[28],j=X;let ee=j,q;e[29]!==f||e[30]!==x||e[31]!==i||e[32]!==h||e[33]!==w||e[34]!==g||e[35]!==v||e[36]!==C||e[37]!==y||e[38]!==n||e[39]!==d||e[40]!==m||e[41]!==r||e[42]!==k||e[43]!==b||e[44]!==u||e[45]!==s||e[46]!==D?(q=()=>{(async()=>{let se=D;g?.rows&&Array.isArray(g.rows)&&(se=C(r));let Z=F.current,Q=E.current,ge=v(),Ie=typeof s=="function"?await s(se,{id:d,blockData:void 0,collectionSlug:f,data:w?.getData?w.getData():ge,event:"onChange",operation:m,path:k,preferences:{},req:{payload:{config:x},t:b,user:u},siblingData:y(r)}):typeof F.current=="string"?F.current:E.current;if(typeof Ie=="string"?(Q=!1,Z=Ie):typeof Ie=="boolean"&&(Q=Ie,Z=void 0),Q!==E.current||Z!==F.current){E.current=Q,F.current=Z;let Fe={type:"UPDATE",errorMessage:Z,path:r,rows:g?.rows,valid:Q,validate:s,value:D};(i||n&&typeof D=="number"&&D>0)&&(Fe.disableFormData=!0),typeof h=="function"&&h(Fe)}})()},e[29]=f,e[30]=x,e[31]=i,e[32]=h,e[33]=w,e[34]=g,e[35]=v,e[36]=C,e[37]=y,e[38]=n,e[39]=d,e[40]=m,e[41]=r,e[42]=k,e[43]=b,e[44]=u,e[45]=s,e[46]=D,e[47]=q):q=e[47];let z=g?.rows,re;return e[48]!==f||e[49]!==i||e[50]!==h||e[51]!==v||e[52]!==C||e[53]!==y||e[54]!==d||e[55]!==m||e[56]!==r||e[57]!==z||e[58]!==u||e[59]!==s||e[60]!==D?(re=[D,i,h,v,y,C,d,m,r,u,s,z,f],e[48]=f,e[49]=i,e[50]=h,e[51]=v,e[52]=C,e[53]=y,e[54]=d,e[55]=m,e[56]=r,e[57]=z,e[58]=u,e[59]=s,e[60]=D,e[61]=re):re=e[61],ks(q,150,re),ee};function pE(t){let[,e]=t;return e}import{jsx as jx}from"react/jsx-runtime";import"react";import{c as hE}from"react/compiler-runtime";var Up=t=>{let e=hE(2),{children:o,path:n}=t,r;e[0]!==n?(r=l=>{let[a]=l;return a&&a?.[n]||null},e[0]=n,e[1]=r):r=e[1];let s=Et(r),{passesCondition:i}=s||{};return i===!1?null:o};var Oe=t=>o=>{let{path:n}=o;return jx(Up,{path:n,children:jx(t,{...o})})};var nt=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 Bi({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 fl,jsxs as Jp}from"react/jsx-runtime";import"react";import{jsx as Ox}from"react/jsx-runtime";import"react";var Yp=()=>Ox("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Ox("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})});import{jsx as Mx}from"react/jsx-runtime";import"react";var Zp=()=>Mx("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Mx("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})});var pl="checkbox-input",Os=({id:t,name:e,AfterInput:o,BeforeInput:n,checked:r,className:s,inputRef:i,Label:l,label:a,localized:c,onToggle:u,partialChecked:d,readOnly:f,required:m})=>Jp("div",{className:[s,pl,r&&`${pl}--checked`,f&&`${pl}--read-only`].filter(Boolean).join(" "),children:[Jp("div",{className:`${pl}__input`,children:[n,fl("input",{"aria-label":"",defaultChecked:!!r,disabled:f,id:t,name:e,onInput:u,ref:i,required:m,type:"checkbox"}),Jp("span",{className:[`${pl}__icon`,!r&&d?"partial":"check"].filter(Boolean).join(" "),children:[r&&fl(Yp,{}),!r&&d&&fl(Zp,{})]}),o]}),fl(oe,{CustomComponent:l,Fallback:fl(be,{htmlFor:t,label:a,localized:c,required:m})})]});var qp="checkbox";var vE=t=>{let{id:e,checked:o,disableFormData:n,field:r,field:{admin:{className:s,description:i}={},label:l,required:a}={},onChange:c,partialChecked:u,path:d,readOnly:f,validate:m}=t,{uuid:h}=Me(),p=ut(),g=Bx((E,F)=>{if(typeof m=="function")return m(E,{...F,required:a})},[m,a]),{customComponents:{AfterInput:b,BeforeInput:x,Description:v,Error:C,Label:y}={},disabled:I,setValue:w,showError:A,value:_}=Te({disableFormData:n,path:d,validate:g}),D=Bx(()=>{f||(w(!_),typeof c=="function"&&c(!_))},[c,f,w,_]),T=o||!!_,S=e||rd(d,p,h),R=bE(()=>nt(r),[r]);return gE("div",{className:[Ce,qp,A&&"error",s,_&&`${qp}--checked`,(f||I)&&`${qp}--read-only`].filter(Boolean).join(" "),style:R,children:[hl(oe,{CustomComponent:C,Fallback:hl(Xe,{path:d,showError:A})}),hl(Os,{AfterInput:b,BeforeInput:x,checked:T,id:S,inputRef:null,Label:y,label:l,name:d,onToggle:D,partialChecked:u,readOnly:f||I,required:a}),hl(oe,{CustomComponent:v,Fallback:hl(We,{description:i,path:d})})]})},cr=Oe(vE);var gl=t=>{let e=xE(4),{fieldValue:o,localized:n,path:r}=t,{code:s}=Ee(),{config:i}=W(),{localization:l}=i,[a,c]=Gx.useState(typeof o!="number"),{t:u}=$();if(!n||!l||l.defaultLocale===s||!l.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 a&&c(!1),null}let d;return e[0]!==a||e[1]!==r||e[2]!==u?(d=Vx(yr,{children:Vx(cr,{checked:a,field:{name:"",label:u("general:fallbackToDefaultLocale")},id:`field-${r.replace(/\./g,"__")}`,path:r,schemaPath:""})}),e[0]=a,e[1]=r,e[2]=u,e[3]=d):d=e[3],d};var Vi=t=>{let e=document.getElementById(t);if(e){let o=e.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:o.top-100})}};import{c as AO}from"react/compiler-runtime";import{jsx as gs,jsxs as FO}from"react/jsx-runtime";import{getTranslation as EO}from"@payloadcms/translations";import"react";import{c as yE}from"react/compiler-runtime";import{jsx as gn,jsxs as Ms}from"react/jsx-runtime";import wE from"react";import{jsx as Wx}from"react/jsx-runtime";import"react";var bl=()=>Wx("svg",{className:"icon icon--copy",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Wx("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 Qp,jsxs as CE}from"react/jsx-runtime";import"react";var Kp=({className:t})=>CE("svg",{className:["icon icon--more",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[Qp("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"}),Qp("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"}),Qp("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 qo="array-actions",dd=t=>{let e=yE(10),{addRow:o,duplicateRow:n,hasMaxRows:r,index:s,isSortable:i,moveRow:l,removeRow:a,rowCount:c}=t,{t:u}=$(),d;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==u?(d=gn(fo,{button:gn(Kp,{}),buttonClassName:`${qo}__button`,className:qo,horizontalAlign:"center",render:f=>{let{close:m}=f;return Ms(Be.ButtonGroup,{buttonSize:"small",children:[i&&s!==0&&Ms(Be.Button,{className:`${qo}__action ${qo}__move-up`,onClick:()=>{l(s,s-1),m()},children:[gn("div",{className:`${qo}__action-chevron`,children:gn(Je,{direction:"up"})}),u("general:moveUp")]}),i&&s<c-1&&Ms(Be.Button,{className:`${qo}__action`,onClick:()=>{l(s,s+1),m()},children:[gn("div",{className:`${qo}__action-chevron`,children:gn(Je,{})}),u("general:moveDown")]}),!r&&Ms(wE.Fragment,{children:[Ms(Be.Button,{className:`${qo}__action ${qo}__add`,onClick:()=>{o(s+1),m()},children:[gn(jo,{}),u("general:addBelow")]}),Ms(Be.Button,{className:`${qo}__action ${qo}__duplicate`,onClick:()=>{n(s),m()},children:[gn(bl,{}),u("general:duplicate")]})]}),Ms(Be.Button,{className:`${qo}__action ${qo}__remove`,onClick:()=>{a(s),m()},children:[gn(pt,{}),u("general:remove")]})]})},size:"medium"}),e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=l,e[6]=a,e[7]=c,e[8]=u,e[9]=d):d=e[9],d};import{c as PE}from"react/compiler-runtime";import{jsx as Dr,jsxs as oh}from"react/jsx-runtime";import{useState as Yx}from"react";import{jsx as Gi,jsxs as IE}from"react/jsx-runtime";import"react";var Bs=({className:t})=>IE("svg",{className:["icon icon--drag-handle",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[Gi("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"}),Gi("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"}),Gi("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"}),Gi("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"}),Gi("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"}),Gi("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 Hx}from"react/jsx-runtime";import md,{useEffect as DE,useRef as th}from"react";import{useEffect as SE,useMemo as RE,useRef as eh,useState as _E}from"react";var zx=({containerRef:t,contentRef:e,duration:o,open:n})=>{let r=RE(()=>typeof CSS<"u"&&CSS&&CSS.supports?CSS.supports("interpolate-size","allow-keywords"):!1,[]),s=eh(!1),i=eh(n),[l,a]=_E(!1),c=eh(null);return SE(()=>{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",a(!1))};return(()=>{if(!s.current&&n){f("auto"),a(!1);return}s.current=!0,i.current!==n&&f(n?"0px":`${d.scrollHeight}px`),u.offsetHeight,a(!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(()=>{l&&(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 _r=({id:t,children:e,className:o,duration:n=300,height:r})=>{let[s,i]=md.useState(()=>!!r),l=th(s),[a,c]=md.useState(()=>s?"":"none"),[u,d]=md.useState(()=>s?"":"hidden"),[f,m]=md.useState(!1),h=th(null),p=th(null);return DE(()=>{let g,b,x=!!r,v=l.current!==x;return l.current=x,v&&(m(!0),d("hidden"),x?c(""):g=window.setTimeout(()=>{c("none")},n),i(x),b=window.setTimeout(()=>{d(""),m(!1)},n)),()=>{g&&clearTimeout(g),b&&clearTimeout(b)}},[r,n]),zx({containerRef:h,contentRef:p,duration:n,open:s}),Hx("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:Hx("div",{ref:p,...a?{style:{display:a}}:{},children:e})})};import{jsx as TE}from"react/jsx-runtime";import AE,{createContext as FE,use as EE}from"react";var Xx=FE({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),Ux=({children:t,isCollapsed:e,isWithinCollapsible:o=!0,toggle:n})=>{let{isCollapsed:r,isVisible:s}=Xn(),i=AE.useMemo(()=>({isCollapsed:e,isVisible:s&&!r,isWithinCollapsible:o,toggle:n}),[e,o,n,r,s]);return TE(Xx,{value:i,children:t})},Xn=()=>EE(Xx);var Co="collapsible";var Vs=t=>{let e=PE(26),{actions:o,children:n,className:r,collapsibleStyle:s,dragHandleProps:i,header:l,initCollapsed:a,isCollapsed:c,onToggle:u}=t,d=s===void 0?"default":s,[f,m]=Yx(!!a),[h,p]=Yx(!1),{isWithinCollapsible:g}=Xn(),{t:b}=$(),x=typeof c=="boolean"?c:f,v;e[0]!==x||e[1]!==u?(v=()=>{typeof u=="function"&&u(!x),m(!x)},e[0]=x,e[1]=u,e[2]=v):v=e[2];let C=v,y=i&&`${Co}--has-drag-handle`,I=x&&`${Co}--collapsed`,w=g&&`${Co}--nested`,A=h&&`${Co}--hovered`,_=`${Co}--style-${d}`,D;e[3]!==r||e[4]!==y||e[5]!==I||e[6]!==w||e[7]!==A||e[8]!==_?(D=[Co,r,y,I,w,A,_].filter(Boolean),e[3]=r,e[4]=y,e[5]=I,e[6]=w,e[7]=A,e[8]=_,e[9]=D):D=e[9];let T=D.join(" "),S,R;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=()=>p(!0),R=()=>p(!1),e[10]=S,e[11]=R):(S=e[10],R=e[11]);let E=`${Co}__toggle--${x?"collapsed":"open"}`,F;e[12]!==E?(F=[`${Co}__toggle`,E].filter(Boolean),e[12]=E,e[13]=F):F=e[13];let L=F.join(" "),k;if(e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==l||e[18]!==x||e[19]!==b||e[20]!==L||e[21]!==T||e[22]!==C){let N;e[24]!==i?(N=i&&Dr("div",{className:`${Co}__drag`,...i.attributes,...i.listeners,children:Dr(Bs,{})}),e[24]=i,e[25]=N):N=e[25],k=Dr("div",{className:T,children:oh(Ux,{isCollapsed:x,toggle:C,children:[oh("div",{className:`${Co}__toggle-wrap`,onMouseEnter:S,onMouseLeave:R,children:[Dr("button",{className:L,onClick:C,type:"button",children:Dr("span",{children:b("fields:toggleBlock")})}),N,l?Dr("div",{className:[`${Co}__header-wrap`,i&&`${Co}__header-wrap--has-drag-handle`].filter(Boolean).join(" "),children:l}):null,oh("div",{className:`${Co}__actions-wrap`,children:[o?Dr("div",{className:`${Co}__actions`,children:o}):null,Dr("div",{className:`${Co}__indicator`,children:Dr(Je,{direction:x?void 0:"up"})})]})]}),Dr(_r,{height:x?0:"auto",children:Dr("div",{className:`${Co}__content`,children:n})})]})}),e[14]=o,e[15]=n,e[16]=i,e[17]=l,e[18]=x,e[19]=b,e[20]=L,e[21]=T,e[22]=C,e[23]=k}else k=e[23];return k};import{c as RO}from"react/compiler-runtime";import{jsx as TS}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as _O,getFieldPaths as DO,getFieldPermissions as TO}from"payload/shared";import"react";import{c as NE}from"react/compiler-runtime";import{jsx as LE}from"react/jsx-runtime";import Zx from"react";var Jx=t=>{let e=NE(9),{children:o,className:n,forceRender:r}=t,[s,i]=Zx.useState(!!r),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={rootMargin:"1000px"},e[0]=l):l=e[0];let[a,c]=an(l,!!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]),Zx.useEffect(m,h);let p=s?o:null,g;return e[5]!==n||e[6]!==a||e[7]!==p?(g=LE("div",{className:n,ref:a,children:p}),e[5]=n,e[6]=a,e[7]=p,e[8]=g):g=e[8],g};import{c as SO}from"react/compiler-runtime";import{jsx as Tt}from"react/jsx-runtime";import"react";import{c as oP}from"react/compiler-runtime";import{jsx as Xt,jsxs as Zn}from"react/jsx-runtime";import{getTranslation as ah}from"@payloadcms/translations";import rP,{Fragment as nP}from"react";import{c as KE}from"react/compiler-runtime";import{jsx as Tr,jsxs as pC,Fragment as eP}from"react/jsx-runtime";import{getTranslation as tP}from"@payloadcms/translations";import"react";import{c as kE}from"react/compiler-runtime";import{jsx as vl,jsxs as $E}from"react/jsx-runtime";import"react";var ur="pill",jE=t=>{let e=kE(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:l,setNodeRef:a,transform:c}=Ai(r),u=i&&`${ur}--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]!==l||e[7]!==t||e[8]!==a||e[9]!==f||e[10]!==c?(m=vl(qx,{...t,className:f,elementProps:{...l,...s,ref:a,style:{transform:c}}}),e[5]=s,e[6]=l,e[7]=t,e[8]=a,e[9]=f,e[10]=c,e[11]=m):m=e[11],m},qx=t=>{let{id:e,alignIcon:o="right","aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,children:l,className:a,draggable:c,elementProps:u,icon:d,onClick:f,pillStyle:m="light",rounded:h,size:p="medium",to:g}=t,b=[ur,`${ur}--style-${m}`,`${ur}--size-${p}`,a&&a,g&&`${ur}--has-link`,(g||f)&&`${ur}--has-action`,d&&`${ur}--has-icon`,d&&`${ur}--align-icon-${o}`,c&&`${ur}--draggable`,h&&`${ur}--rounded`].filter(Boolean).join(" "),x="div";return f&&!g&&(x="button"),g&&(x=Kt),$E(x,{...u,"aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,className:b,href:g||null,id:e,onClick:f,type:x==="button"?"button":void 0,children:[vl("span",{className:`${ur}__label`,children:l}),!!d&&vl("span",{className:`${ur}__icon`,children:d})]})},bt=t=>{let{draggable:e}=t;return e?vl(jE,{...t}):vl(qx,{...t})};import{useEffect as OE,useState as ME}from"react";function fd(t,e){let[o,n]=ME(t);return OE(()=>{let r=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(r)}},[t,e]),o}import{c as JE}from"react/compiler-runtime";import{jsx as cC,jsxs as qE}from"react/jsx-runtime";import uC from"react";import{jsx as Xr,jsxs as iC}from"react/jsx-runtime";import{getTranslation as gd}from"@payloadcms/translations";import{useEffect as aC,useMemo as YE,useState as lC}from"react";import{c as BE}from"react/compiler-runtime";import{jsx as Qx,jsxs as VE}from"react/jsx-runtime";import"react";var xl="thumbnail-card",Kx=t=>{let e=BE(15),{alignLabel:o,className:n,collection:r,doc:s,label:i,onClick:l,thumbnail:a}=t,{config:c}=W(),{i18n:u}=$(),d=typeof l=="function"&&`${xl}--has-on-click`,f=o&&`${xl}--align-label-${o}`,m;e[0]!==n||e[1]!==d||e[2]!==f?(m=[xl,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,x;e[4]!==r||e[5]!==c.admin.dateFormat||e[6]!==s||e[7]!==u||e[8]!==b?(x=lr({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]=x):x=e[9],p=x}let g;return e[10]!==h||e[11]!==l||e[12]!==a||e[13]!==p?(g=VE("button",{className:h,onClick:l,title:p,type:"button",children:[Qx("div",{className:`${xl}__thumbnail`,children:a}),Qx("div",{className:`${xl}__label`,children:p})]}),e[10]=h,e[11]=l,e[12]=a,e[13]=p,e[14]=g):g=e[14],g};import{jsx as bn,jsxs as tC}from"react/jsx-runtime";import{useState as HE}from"react";var ho=[];for(pd=0;pd<256;++pd)ho.push((pd+256).toString(16).slice(1));var pd;function eC(t,e=0){return(ho[t[e+0]]+ho[t[e+1]]+ho[t[e+2]]+ho[t[e+3]]+"-"+ho[t[e+4]]+ho[t[e+5]]+"-"+ho[t[e+6]]+ho[t[e+7]]+"-"+ho[t[e+8]]+ho[t[e+9]]+"-"+ho[t[e+10]]+ho[t[e+11]]+ho[t[e+12]]+ho[t[e+13]]+ho[t[e+14]]+ho[t[e+15]]).toLowerCase()}var hd,GE=new Uint8Array(16);function rh(){if(!hd&&(hd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hd(GE)}var WE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nh={randomUUID:WE};function zE(t,e,o){if(nh.randomUUID&&!e&&!t)return nh.randomUUID();t=t||{};var n=t.random||(t.rng||rh)();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 eC(n)}var Wi=zE;var sh=()=>{let[t]=HE(()=>`pattern${Wi()}`);return tC("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[tC("g",{clipPath:`url(#${t})`,children:[bn("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),bn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),bn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),bn("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),bn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),bn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),bn("defs",{children:bn("clipPath",{id:`${t}`,children:bn("rect",{fill:"white",height:"151",width:"231"})})})]})};import{c as XE}from"react/compiler-runtime";import{jsx as rC,jsxs as UE}from"react/jsx-runtime";import"react";import{jsx as oC}from"react/jsx-runtime";import"react";var Cl=()=>oC("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:oC("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 nC="block-search",sC=t=>{let e=XE(5),{setSearchTerm:o}=t,{t:n}=$(),r;e[0]!==o?(r=l=>{o(l.target.value)},e[0]=o,e[1]=r):r=e[1];let s=r,i;return e[2]!==s||e[3]!==n?(i=UE("div",{className:nC,children:[rC("input",{className:`${nC}__input`,onChange:s,placeholder:n("fields:searchForBlock")}),rC(Cl,{})]}),e[2]=s,e[3]=n,e[4]=i):i=e[4],i};var Un="blocks-drawer",ZE=(t,e)=>typeof t.labels.singular=="string"?t.labels.singular.toLowerCase():typeof t.labels.singular=="object"?gd(t.labels.singular,e).toLowerCase():"",yl=t=>{let{addRow:e,addRowIndex:o,blocks:n,drawerSlug:r,labels:s}=t,[i,l]=lC(""),[a,c]=lC(n),{closeModal:u,isModalOpen:d}=de(),{i18n:f,t:m}=$(),{config:h}=W(),p=YE(()=>{let g={_none:[]};return a.forEach(b=>{if(typeof b=="object"&&b.admin?.group){let x=b.admin.group,v=typeof x=="string"?x:gd(x,f);Object.hasOwn(g,v)?g[v].push(b):g[v]=[b]}else g._none.push(b)}),g},[a,f]);return aC(()=>{d(r)||l("")},[d,r]),aC(()=>{let g=i.toLowerCase(),b=n?.reduce((x,v)=>{let C=typeof v=="string"?h.blocksMap[v]:v;return ZE(C,f).includes(g)&&x.push(C),x},[]);c(b)},[i,n,f,h.blocksMap]),iC(Pt,{slug:r,title:m("fields:addLabel",{label:gd(s.singular,f)}),children:[Xr(sC,{setSearchTerm:l}),Xr("div",{className:`${Un}__blocks-wrapper`,children:Xr("ul",{className:`${Un}__block-groups`,children:Object.entries(p).map(([g,b])=>b.length?iC("li",{className:[`${Un}__block-group`,g==="_none"&&`${Un}__block-group-none`].filter(Boolean).join(" "),children:[g!=="_none"&&Xr("h3",{className:`${Un}__block-group-label`,children:g}),Xr("ul",{className:`${Un}__blocks`,children:b.map((x,v)=>{let C=typeof x=="string"?h.blocksMap[x]:x,{slug:y,imageAltText:I,imageURL:w,labels:A}=C;return Xr("li",{className:`${Un}__block`,children:Xr(Kx,{alignLabel:"center",label:gd(A?.singular,f),onClick:()=>{e(o,y),u(r)},thumbnail:Xr("div",{className:`${Un}__default-image`,children:w?Xr("img",{alt:I,src:w}):Xr(sh,{})})})},v)})})]},g):null)})})]})};var dC=t=>{let e=JE(26),{addRow:o,blocks:n,blockType:r,duplicateRow:s,hasMaxRows:i,isSortable:l,labels:a,moveRow:c,removeRow:u,rowCount:d,rowIndex:f}=t,{closeModal:m,openModal:h}=de(),p=sl("blocks-drawer"),[g,b]=uC.useState(null),x;e[0]!==o||e[1]!==m||e[2]!==p||e[3]!==g?(x=(C,y)=>{typeof o=="function"&&o(g,y),m(p)},e[0]=o,e[1]=m,e[2]=p,e[3]=g,e[4]=x):x=e[4];let v;if(e[5]!==r||e[6]!==n||e[7]!==p||e[8]!==s||e[9]!==i||e[10]!==l||e[11]!==a||e[12]!==c||e[13]!==h||e[14]!==u||e[15]!==d||e[16]!==f||e[17]!==x){let C;e[19]!==p||e[20]!==h?(C=I=>{b(I),h(p)},e[19]=p,e[20]=h,e[21]=C):C=e[21];let y;e[22]!==r||e[23]!==s||e[24]!==f?(y=()=>s(f,r),e[22]=r,e[23]=s,e[24]=f,e[25]=y):y=e[25],v=qE(uC.Fragment,{children:[cC(yl,{addRow:x,addRowIndex:f,blocks:n,drawerSlug:p,labels:a}),cC(dd,{addRow:C,duplicateRow:y,hasMaxRows:i,index:f,isSortable:l,moveRow:c,removeRow:u,rowCount:d})]}),e[5]=r,e[6]=n,e[7]=p,e[8]=s,e[9]=i,e[10]=l,e[11]=a,e[12]=c,e[13]=h,e[14]=u,e[15]=d,e[16]=f,e[17]=x,e[18]=v}else v=e[18];return v};import{c as QE}from"react/compiler-runtime";import{jsx as mC}from"react/jsx-runtime";import"react";var fC="section-title",ih=t=>{let e=QE(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:l,value:a}=Te(i),{t:c}=$(),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=[fC].filter(Boolean),e[2]=u):u=e[2];let d=u.join(" "),f;e[3]!==o||e[4]!==l?(f=o||(g=>{g.stopPropagation(),g.preventDefault(),l(g.target.value)}),e[3]=o,e[4]=l,e[5]=f):f=e[5];let m=f,h=n||a,p;return e[6]!==n||e[7]!==m||e[8]!==r||e[9]!==s||e[10]!==c||e[11]!==h||e[12]!==a?(p=mC("div",{className:d,"data-value":h,children:mC("input",{className:`${fC}__input`,id:r,name:r,onChange:m,placeholder:c("general:untitled"),readOnly:s,type:"text",value:n||a||""})}),e[6]=n,e[7]=m,e[8]=r,e[9]=s,e[10]=c,e[11]=h,e[12]=a,e[13]=p):p=e[13],p};var Yn="blocks-field",hC=t=>{let e=KE(40),{addRow:o,attributes:n,block:r,blocks:s,duplicateRow:i,errorCount:l,fields:a,hasMaxRows:c,isLoading:u,isSortable:d,Label:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:x,readOnly:v,removeRow:C,row:y,rowCount:I,rowIndex:w,schemaPath:A,setCollapse:_,setNodeRef:D,transform:T}=t,S=fd(u,500),{i18n:R}=$(),F=zt()&&l>0,L=!r.admin?.disableBlockName,k=F?`${Yn}__row--has-errors`:`${Yn}__row--no-errors`,N;e[0]!==k?(N=[`${Yn}__row`,k].filter(Boolean),e[0]=k,e[1]=N):N=e[1];let P=N.join(" "),j;if(x===!0)j=!0;else{let O=x?.blocks?.[r.slug];O===!0?j=!0:j=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]!==j||e[8]!==s||e[9]!==P||e[10]!==i||e[11]!==l||e[12]!==F||e[13]!==a||e[14]!==c||e[15]!==R||e[16]!==S||e[17]!==d||e[18]!==m||e[19]!==h||e[20]!==p||e[21]!==g||e[22]!==b||e[23]!==v||e[24]!==C||e[25]!==y.blockType||e[26]!==y.collapsed||e[27]!==y.id||e[28]!==I||e[29]!==w||e[30]!==A||e[31]!==_||e[32]!==D||e[33]!==L||e[34]!==V||e[35]!==T){let O;e[37]!==y.id||e[38]!==_?(O=B=>_(y.id,B),e[37]=y.id,e[38]=_,e[39]=O):O=e[39],M=Tr("div",{id:V,ref:D,style:{transform:T},children:Tr(Vs,{actions:v?void 0:Tr(dC,{addRow:o,blocks:s,blockType:y.blockType,duplicateRow:i,fields:r.fields,hasMaxRows:c,isSortable:d,labels:m,moveRow:p,removeRow:C,rowCount:I,rowIndex:w}),className:P,collapsibleStyle:F?"error":"default",dragHandleProps:d?{id:y.id,attributes:n,listeners:h}:void 0,header:S?Tr(wt,{height:"1rem",width:"8rem"}):pC("div",{className:`${Yn}__block-header`,children:[Tr(sn,{CustomComponent:f,label:pC(eP,{children:[Tr("span",{className:`${Yn}__block-number`,children:String(w+1).padStart(2,"0")}),Tr(bt,{className:`${Yn}__block-pill ${Yn}__block-pill-${y.blockType}`,pillStyle:"white",children:tP(r.labels.singular,R)}),L&&Tr(ih,{path:`${b}.blockName`,readOnly:v})]}),path:b,rowNumber:w}),F&&Tr(to,{count:l,i18n:R,withMessage:!0})]}),isCollapsed:y.collapsed,onToggle:O,children:S?Tr(wt,{}):Tr(yo,{className:`${Yn}__fields`,fields:a,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:A,permissions:j,readOnly:v})},y.id)},`${g}-row-${w}`),e[2]=f,e[3]=o,e[4]=n,e[5]=r.fields,e[6]=r.labels,e[7]=j,e[8]=s,e[9]=P,e[10]=i,e[11]=l,e[12]=F,e[13]=a,e[14]=c,e[15]=R,e[16]=S,e[17]=d,e[18]=m,e[19]=h,e[20]=p,e[21]=g,e[22]=b,e[23]=v,e[24]=C,e[25]=y.blockType,e[26]=y.collapsed,e[27]=y.id,e[28]=I,e[29]=w,e[30]=A,e[31]=_,e[32]=D,e[33]=L,e[34]=V,e[35]=T,e[36]=M}else M=e[36];return M};var Ar="blocks-field",sP=t=>{let e=oP(52),{i18n:o,t:n}=$(),{field:r,path:s,permissions:i,readOnly:l,schemaPath:a,validate:c}=t,{name:u,admin:d,blockReferences:f,blocks:m,label:h,labels:p,localized:g,maxRows:b,minRows:x,required:v}=r,C;e[0]!==d?(C=d===void 0?{}:d,e[0]=d,e[1]=C):C=e[1];let{className:y,description:I,isSortable:w}=C,A=w===void 0?!0:w,_=a??u,D=x??v?1:0,{setDocFieldPreferences:T}=Ae(),{addFieldRow:S,dispatchFields:R,setModified:E}=Me(),{code:F}=Ee(),{config:L,config:k}=W(),{localization:N}=L,P=sl("blocks-drawer"),j=zt(),V={plural:n("fields:blocks"),singular:n("fields:block"),...p},M;e:{if(N&&N.fallback){let ie=N.defaultLocale;M=F===ie;break e}M=!0}let O=M,B;e[2]!==O||e[3]!==b||e[4]!==D||e[5]!==v||e[6]!==c?(B=(ie,J)=>{if(!O&&ie===null)return!0;if(typeof c=="function")return c(ie,{...J,maxRows:b,minRows:D,required:v})},e[2]=O,e[3]=b,e[4]=D,e[5]=v,e[6]=c,e[7]=B):B=e[7];let G=B,Y;e[8]!==G||e[9]!==s?(Y={hasRows:!0,path:s,validate:G},e[8]=G,e[9]=s,e[10]=Y):Y=e[10];let{customComponents:X,disabled:ee,errorPaths:q,rows:z,showError:re,valid:me,value:se}=Te(Y),Z;e[11]!==X?(Z=X===void 0?{}:X,e[11]=X,e[12]=Z):Z=e[12];let{AfterInput:Q,BeforeInput:ge,Description:Ie,Error:Fe,Label:Le,RowLabels:K}=Z,_e;e[13]!==z?(_e=z===void 0?[]:z,e[13]=z,e[14]=_e):_e=e[14];let pe=_e,ce;e[15]!==S||e[16]!==s||e[17]!==_?(ce=(ie,J)=>{S({blockType:J,path:s,rowIndex:ie,schemaPath:_}),setTimeout(()=>{Vi(`${s}-row-${ie+1}`)},0)},e[15]=S,e[16]=s,e[17]=_,e[18]=ce):ce=e[18];let ne=ce,H;e[19]!==R||e[20]!==s||e[21]!==E?(H=ie=>{R({type:"DUPLICATE_ROW",path:s,rowIndex:ie}),E(!0),setTimeout(()=>{Vi(`${s}-row-${ie+1}`)},0)},e[19]=R,e[20]=s,e[21]=E,e[22]=H):H=e[22];let U=H,le;e[23]!==R||e[24]!==s||e[25]!==E?(le=ie=>{R({type:"REMOVE_ROW",path:s,rowIndex:ie}),E(!0)},e[23]=R,e[24]=s,e[25]=E,e[26]=le):le=e[26];let De=le,Ne;e[27]!==R||e[28]!==s||e[29]!==E?(Ne=(ie,J)=>{R({type:"MOVE_ROW",moveFromIndex:ie,moveToIndex:J,path:s}),E(!0)},e[27]=R,e[28]=s,e[29]=E,e[30]=Ne):Ne=e[30];let qe=Ne,Ue;e[31]!==R||e[32]!==s||e[33]!==pe||e[34]!==T?(Ue=ie=>{let{collapsedIDs:J,updatedRows:te}=sd({collapsed:ie,rows:pe});R({type:"SET_ALL_ROWS_COLLAPSED",path:s,updatedRows:te}),T(s,{collapsed:J})},e[31]=R,e[32]=s,e[33]=pe,e[34]=T,e[35]=Ue):Ue=e[35];let ke=Ue,ot;e[36]!==R||e[37]!==s||e[38]!==pe||e[39]!==T?(ot=(ie,J)=>{let{collapsedIDs:te,updatedRows:he}=nd({collapsed:J,rowID:ie,rows:pe});R({type:"SET_ROW_COLLAPSED",path:s,updatedRows:he}),T(s,{collapsed:te})},e[36]=R,e[37]=s,e[38]=pe,e[39]=T,e[40]=ot):ot=e[40];let Ft=ot,Wt=b&&pe.length>=b,mt=q.length,ze=j&&mt+(me?0:1)>0,rt=pe.length<D||v&&pe.length===0,ue=l&&pe.length===0,ve=ze?`${Ar}--has-error`:`${Ar}--has-no-error`,Ve;e[41]!==y||e[42]!==ve?(Ve=[Ce,Ar,y,ve].filter(Boolean),e[41]=y,e[42]=ve,e[43]=Ve):Ve=e[43];let Ge;e[44]!==Fe||e[45]!==s||e[46]!==re?(Ge=re&&Xt(oe,{CustomComponent:Fe,Fallback:Xt(Xe,{path:s,showError:re})}),e[44]=Fe,e[45]=s,e[46]=re,e[47]=Ge):Ge=e[47];let $e;return e[48]!==mt||e[49]!==ze||e[50]!==o?($e=ze&&mt>0&&Xt(to,{count:mt,i18n:o,withMessage:!0}),e[48]=mt,e[49]=ze,e[50]=o,e[51]=$e):$e=e[51],Zn("div",{className:Ve.join(" "),id:`field-${s?.replace(/\./g,"__")}`,children:[Ge,Zn("header",{className:`${Ar}__header`,children:[Zn("div",{className:`${Ar}__header-wrap`,children:[Zn("div",{className:`${Ar}__heading-with-error`,children:[Xt("h3",{children:Xt(oe,{CustomComponent:Le,Fallback:Xt(be,{label:h,localized:g,path:s,required:v})})}),$e]}),pe.length>0&&Zn("ul",{className:`${Ar}__header-actions`,children:[Xt("li",{children:Xt("button",{className:`${Ar}__header-action`,onClick:()=>ke(!0),type:"button",children:n("fields:collapseAll")})}),Xt("li",{children:Xt("button",{className:`${Ar}__header-action`,onClick:()=>ke(!1),type:"button",children:n("fields:showAll")})})]})]}),Xt(oe,{CustomComponent:Ie,Fallback:Xt(We,{description:I,path:s})})]}),ge,Xt(gl,{fieldValue:se,localized:g,path:s}),(pe.length>0||!me&&(ue||rt))&&Zn(zr,{className:`${Ar}__rows`,ids:pe.map(iP),onDragEnd:ie=>{let{moveFromIndex:J,moveToIndex:te}=ie;return qe(J,te)},children:[pe.map((ie,J)=>{let{blockType:te,isLoading:he}=ie,Pe=k.blocksMap[te]??(f??m).find(je=>typeof je!="string"&&je.slug===te);if(Pe){let je=`${s}.${J}`,Ye=q.filter(Qe=>Qe.startsWith(je+".")).length;return Xt(Gn,{disabled:l||ee||!A,id:ie.id,children:Qe=>Xt(hC,{...Qe,addRow:ne,block:Pe,blocks:f??m,duplicateRow:U,errorCount:Ye,fields:Pe.fields,hasMaxRows:Wt,isLoading:he,isSortable:A,Label:K?.[J],labels:V,moveRow:qe,parentPath:s,path:je,permissions:i,readOnly:l||ee,removeRow:De,row:ie,rowCount:pe.length,rowIndex:J,schemaPath:_+Pe.slug,setCollapse:Ft})},ie.id)}return null}),!O&&Zn(rP.Fragment,{children:[rt&&Xt(yr,{type:"error",children:n("validation:requiresAtLeast",{count:D,label:ah(D>1?V.plural:V.singular,o)||n(D>1?"general:row":"general:rows")})}),ue&&Xt(yr,{children:n("validation:fieldHasNo",{label:ah(V.plural,o)})})]})]}),!Wt&&Zn(nP,{children:[Xt(ar,{className:`${Ar}__drawer-toggler`,disabled:l||ee,slug:P,children:Xt(ae,{buttonStyle:"icon-label",disabled:l||ee,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:n("fields:addLabel",{label:ah(V.singular,o)})})}),Xt(yl,{addRow:ne,addRowIndex:pe?.length||0,blocks:f??m,drawerSlug:P,labels:V})]}),Q]})},wl=Oe(sP);function iP(t){return t.id}import{jsx as Gs,jsxs as gC}from"react/jsx-runtime";import{useCallback as uP,useMemo as dP}from"react";import{jsx as lh}from"react/jsx-runtime";import{lazy as aP,Suspense as lP}from"react";var cP=aP(()=>import("./CodeEditor-J4IKAVAK.js")),Il=t=>lh(lP,{fallback:lh(wt,{}),children:lh(cP,{...t})});var mP={js:"javascript",ts:"typescript"},fP="code-field",pP=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r={},language:s="javascript"}={},label:i,localized:l,required:a},onMount:c,path:u,readOnly:d,validate:f}=t,m=uP((A,_)=>{if(typeof f=="function")return f(A,{..._,required:a})},[f,a]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:x}={},disabled:v,setValue:C,showError:y,value:I}=Te({path:u,validate:m}),w=dP(()=>nt(e),[e]);return gC("div",{className:[Ce,fP,o,y&&"error",(d||v)&&"read-only"].filter(Boolean).join(" "),style:w,children:[Gs(oe,{CustomComponent:x,Fallback:Gs(be,{label:i,localized:l,path:u,required:a})}),gC("div",{className:`${Ce}__wrap`,children:[Gs(oe,{CustomComponent:b,Fallback:Gs(Xe,{path:u,showError:y})}),p,Gs(Il,{defaultLanguage:mP[s]||s,onChange:d||v?()=>null:A=>C(A),onMount:c,options:r,readOnly:d||v,value:I||""}),h]}),Gs(oe,{CustomComponent:g,Fallback:Gs(We,{description:n,path:u})})]})},Sl=Oe(pP);import{jsx as zs,jsxs as ch}from"react/jsx-runtime";import{getTranslation as gP}from"@payloadcms/translations";import{Fragment as bP,useCallback as vP,useEffect as xP,useMemo as CP,useState as vC}from"react";import{c as hP}from"react/compiler-runtime";import{fieldAffectsData as bC}from"payload/shared";var bd=t=>t.reduce((e,o)=>{let n="fields"in o?o.fields:void 0;return n?bC(o)?e.push(`${o.name}.`):e.push(...bd(n)):o.type==="tabs"?"tabs"in o&&o.tabs?.forEach(r=>{"name"in r?e.push(`${r.name}.`):e.push(...bd(r.fields))}):bC(o)&&e.push(o.name),e},[]);var Ws=t=>{let e=hP(12),{fields:o,path:n,setErrorCount:r}=t,[s]=Di(),i=zt(),l;e[0]!==o?(l=bd(o),e[0]=o,e[1]=l):l=e[1];let a=l,c;e[2]!==s||e[3]!==i||e[4]!==n||e[5]!==a||e[6]!==r?(c=()=>{if(i){let d;d=0,Object.entries(s).forEach(f=>{let[m]=f;if(a?.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]=a,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],ks(c,250,u),null};var Rl="collapsible-field",yP=t=>{let{field:e,field:{admin:{className:o,description:n,initCollapsed:r=!1}={},fields:s,label:i}={},indexPath:l,parentPath:a,parentSchemaPath:c,path:u,permissions:d,readOnly:f}=t,{i18n:m}=$(),{getPreference:h,setPreference:p}=Do(),{preferencesKey:g}=Ae(),[b,x]=vC(),v=`collapsible-${u?.replace(/\./g,"__")}`,[C,y]=vC(0),I=C>0,{customComponents:{AfterInput:w,BeforeInput:A,Description:_,Label:D}={},disabled:T}=Te({path:u}),S=vP(async E=>{let F=await h(g);g&&p(g,{...F,...u?{fields:{...F?.fields||{},[u]:{...F?.fields?.[u],collapsed:E}}}:{fields:{...F?.fields||{},[v]:{...F?.fields?.[v],collapsed:E}}}})},[g,v,h,p,u]);xP(()=>{(async()=>{if(g){let F=await h(g),L=u?F?.fields?.[u]?.collapsed:F?.fields?.[v]?.collapsed;x(L!==void 0?!!L:typeof r=="boolean"?r:!1)}else x(typeof r=="boolean"?r:!1)})()},[h,g,v,r,u]);let R=CP(()=>nt(e),[e]);return typeof b!="boolean"?null:ch(bP,{children:[zs(Ws,{fields:s,path:u.split(".").slice(0,-1),setErrorCount:y}),ch("div",{className:[Ce,Rl,o,I?`${Rl}--has-error`:`${Rl}--has-no-error`].filter(Boolean).join(" "),id:`field-${v}`,style:R,children:[A,zs(Vs,{className:`${Rl}__collapsible`,collapsibleStyle:I?"error":"default",header:ch("div",{className:`${Rl}__row-label-wrap`,children:[zs(sn,{CustomComponent:D,label:gP(i,m),path:u}),I&&zs(to,{count:C,i18n:m,withMessage:!0})]}),initCollapsed:b,onToggle:S,children:zs(yo,{fields:s,margins:"small",parentIndexPath:l,parentPath:a,parentSchemaPath:c,permissions:d,readOnly:f||T})}),w,zs(oe,{CustomComponent:_,Fallback:zs(We,{description:n,path:u})})]})]})},_l=Oe(yP);import{jsx as Kn,jsxs as l2}from"react/jsx-runtime";import{getTranslation as xN}from"@payloadcms/translations";import{useCallback as Qh,useMemo as c2}from"react";import{jsx as uh}from"react/jsx-runtime";import{lazy as wP,Suspense as IP}from"react";var SP=wP(()=>import("./DatePicker-DMHV2M2L.js")),zi=t=>uh(IP,{fallback:uh(wt,{height:50}),children:uh(SP,{...t})});import{jsx as a2,jsxs as bN}from"react/jsx-runtime";import{useMemo as vN}from"react";import{jsx as Zs}from"react/jsx-runtime";import{getTranslation as n2}from"@payloadcms/translations";import s2,{useEffect as fN,useId as pN}from"react";function Fr(t){"@babel/helpers - typeof";return Fr=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},Fr(t)}function xC(t,e){if(Fr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(Fr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vd(t){var e=xC(t,"string");return Fr(e)=="symbol"?e:e+""}function Hs(t,e,o){return(e=vd(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function CC(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 we(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?CC(Object(o),!0).forEach(function(n){Hs(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):CC(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function yC(t){if(Array.isArray(t))return t}function wC(t,e){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n,r,s,i,l=[],a=!0,c=!1;try{if(s=(o=o.call(t)).next,e===0){if(Object(o)!==o)return;a=!1}else for(;!(a=(n=s.call(o)).done)&&(l.push(n.value),l.length!==e);a=!0);}catch(u){c=!0,r=u}finally{try{if(!a&&o.return!=null&&(i=o.return(),Object(i)!==i))return}finally{if(c)throw r}}return l}}function Dl(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 xd(t,e){if(t){if(typeof t=="string")return Dl(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)?Dl(t,e):void 0}}function IC(){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 Er(t,e){return yC(t)||wC(t,e)||xd(t,e)||IC()}function Vo(t,e){if(t==null)return{};var o,n,r=Fi(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 dh,useCallback as Cd}from"react";var RP=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function yd(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,l=t.inputValue,a=t.menuIsOpen,c=t.onChange,u=t.onInputChange,d=t.onMenuClose,f=t.onMenuOpen,m=t.value,h=Vo(t,RP),p=dh(l!==void 0?l:o),g=Er(p,2),b=g[0],x=g[1],v=dh(a!==void 0?a:r),C=Er(v,2),y=C[0],I=C[1],w=dh(m!==void 0?m:i),A=Er(w,2),_=A[0],D=A[1],T=Cd(function(N,P){typeof c=="function"&&c(N,P),D(N)},[c]),S=Cd(function(N,P){var j;typeof u=="function"&&(j=u(N,P)),x(j!==void 0?j:N)},[u]),R=Cd(function(){typeof f=="function"&&f(),I(!0)},[f]),E=Cd(function(){typeof d=="function"&&d(),I(!1)},[d]),F=l!==void 0?l:b,L=a!==void 0?a:y,k=m!==void 0?m:_;return we(we({},h),{},{inputValue:F,menuIsOpen:L,onChange:T,onInputChange:S,onMenuClose:E,onMenuOpen:R,value:k})}import*as Ow from"react";import{forwardRef as Z6,useMemo as aie}from"react";function SC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function RC(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,vd(n.key),n)}}function _C(t,e,o){return e&&RC(t.prototype,e),o&&RC(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function DC(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&&Ei(t,e)}function Tl(t){return Tl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tl(t)}function mh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mh=function(){return!!t})()}function TC(t,e){if(e&&(Fr(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s0(t)}function AC(t){var e=mh();return function(){var o,n=Tl(t);if(e){var r=Tl(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return TC(this,o)}}function FC(t){if(Array.isArray(t))return Dl(t)}function EC(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function PC(){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 Jn(t){return FC(t)||EC(t)||xd(t)||PC()}import*as dt from"react";import{useMemo as jl,Fragment as kh,useRef as na,useCallback as Qn,useEffect as Dw,Component as d6}from"react";import*as mr from"react";import{useContext as r5,forwardRef as n5}from"react";var _P=!1;function DP(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 TP(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 NC=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?!_P: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(TP(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=DP(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 go="-ms-",Al="-moz-",st="-webkit-",wd="comm",Hi="rule",Xi="decl";var LC="@import";var Id="@keyframes";var kC="@layer";var $C=Math.abs,Xs=String.fromCharCode,jC=Object.assign;function OC(t,e){return Ot(t,0)^45?(((e<<2^Ot(t,0))<<2^Ot(t,1))<<2^Ot(t,2))<<2^Ot(t,3):0}function Sd(t){return t.trim()}function fh(t,e){return(t=e.exec(t))?t[0]:t}function tt(t,e,o){return t.replace(e,o)}function Fl(t,e){return t.indexOf(e)}function Ot(t,e){return t.charCodeAt(e)|0}function qn(t,e,o){return t.slice(e,o)}function To(t){return t.length}function Ui(t){return t.length}function Yi(t,e){return e.push(t),t}function ph(t,e){return t.map(e).join("")}var Rd=1,Zi=1,MC=0,Ao=0,Ut=0,qi="";function El(t,e,o,n,r,s,i){return{value:t,root:e,parent:o,type:n,props:r,children:s,line:Rd,column:Zi,length:i,return:""}}function Qi(t,e){return jC(El("",null,null,"",null,null,0),t,{length:-t.length},e)}function BC(){return Ut}function VC(){return Ut=Ao>0?Ot(qi,--Ao):0,Zi--,Ut===10&&(Zi=1,Rd--),Ut}function Fo(){return Ut=Ao<MC?Ot(qi,Ao++):0,Zi++,Ut===10&&(Zi=1,Rd++),Ut}function dr(){return Ot(qi,Ao)}function Pl(){return Ao}function Ki(t,e){return qn(qi,t,e)}function Ji(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 _d(t){return Rd=Zi=1,MC=To(qi=t),Ao=0,[]}function Dd(t){return qi="",t}function ea(t){return Sd(Ki(Ao-1,hh(t===91?t+2:t===40?t+1:t)))}function GC(t){for(;(Ut=dr())&&Ut<33;)Fo();return Ji(t)>2||Ji(Ut)>3?"":" "}function WC(t,e){for(;--e&&Fo()&&!(Ut<48||Ut>102||Ut>57&&Ut<65||Ut>70&&Ut<97););return Ki(t,Pl()+(e<6&&dr()==32&&Fo()==32))}function hh(t){for(;Fo();)switch(Ut){case t:return Ao;case 34:case 39:t!==34&&t!==39&&hh(Ut);break;case 40:t===41&&hh(t);break;case 92:Fo();break}return Ao}function zC(t,e){for(;Fo()&&t+Ut!==57;)if(t+Ut===84&&dr()===47)break;return"/*"+Ki(e,Ao-1)+"*"+Xs(t===47?t:Fo())}function HC(t){for(;!Ji(dr());)Fo();return Ki(t,Ao)}function YC(t){return Dd(Td("",null,null,null,[""],t=_d(t),0,[0],t))}function Td(t,e,o,n,r,s,i,l,a){for(var c=0,u=0,d=i,f=0,m=0,h=0,p=1,g=1,b=1,x=0,v="",C=r,y=s,I=n,w=v;g;)switch(h=x,x=Fo()){case 40:if(h!=108&&Ot(w,d-1)==58){Fl(w+=tt(ea(x),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:w+=ea(x);break;case 9:case 10:case 13:case 32:w+=GC(h);break;case 92:w+=WC(Pl()-1,7);continue;case 47:switch(dr()){case 42:case 47:Yi(AP(zC(Fo(),Pl()),e,o),a);break;default:w+="/"}break;case 123*p:l[c++]=To(w)*b;case 125*p:case 59:case 0:switch(x){case 0:case 125:g=0;case 59+u:b==-1&&(w=tt(w,/\f/g,"")),m>0&&To(w)-d&&Yi(m>32?UC(w+";",n,o,d-1):UC(tt(w," ","")+";",n,o,d-2),a);break;case 59:w+=";";default:if(Yi(I=XC(w,e,o,c,u,r,l,v,C=[],y=[],d),s),x===123)if(u===0)Td(w,e,I,I,C,s,d,l,y);else switch(f===99&&Ot(w,3)===110?100:f){case 100:case 108:case 109:case 115:Td(t,I,I,n&&Yi(XC(t,I,I,0,0,r,l,v,r,C=[],d),y),r,y,d,l,n?C:y);break;default:Td(w,I,I,I,[""],y,0,l,y)}}c=u=m=0,p=b=1,v=w="",d=i;break;case 58:d=1+To(w),m=h;default:if(p<1){if(x==123)--p;else if(x==125&&p++==0&&VC()==125)continue}switch(w+=Xs(x),x*p){case 38:b=u>0?1:(w+="\f",-1);break;case 44:l[c++]=(To(w)-1)*b,b=1;break;case 64:dr()===45&&(w+=ea(Fo())),f=dr(),u=d=To(v=w+=HC(Pl())),x++;break;case 45:h===45&&To(w)==2&&(p=0)}}return s}function XC(t,e,o,n,r,s,i,l,a,c,u){for(var d=r-1,f=r===0?s:[""],m=Ui(f),h=0,p=0,g=0;h<n;++h)for(var b=0,x=qn(t,d+1,d=$C(p=i[h])),v=t;b<m;++b)(v=Sd(p>0?f[b]+" "+x:tt(x,/&\f/g,f[b])))&&(a[g++]=v);return El(t,e,o,r===0?Hi:l,a,c,u)}function AP(t,e,o){return El(t,e,o,wd,Xs(BC()),qn(t,2,-2),0)}function UC(t,e,o,n){return El(t,e,o,Xi,qn(t,0,n),qn(t,n+1,-1),n)}function Us(t,e){for(var o="",n=Ui(t),r=0;r<n;r++)o+=e(t[r],r,t,e)||"";return o}function ZC(t,e,o,n){switch(t.type){case kC:if(t.children.length)break;case LC:case Xi:return t.return=t.return||t.value;case wd:return"";case Id:return t.return=t.value+"{"+Us(t.children,n)+"}";case Hi:t.value=t.props.join(",")}return To(o=Us(t.children,n))?t.return=t.value+"{"+o+"}":""}function JC(t){var e=Ui(t);return function(o,n,r,s){for(var i="",l=0;l<e;l++)i+=t[l](o,n,r,s)||"";return i}}function qC(t){return function(e){e.root||(e=e.return)&&t(e)}}function QC(t){var e=Object.create(null);return function(o){return e[o]===void 0&&(e[o]=t(o)),e[o]}}var FP=function(e,o,n){for(var r=0,s=0;r=s,s=dr(),r===38&&s===12&&(o[n]=1),!Ji(s);)Fo();return Ki(e,Ao)},EP=function(e,o){var n=-1,r=44;do switch(Ji(r)){case 0:r===38&&dr()===12&&(o[n]=1),e[n]+=FP(Ao-1,o,n);break;case 2:e[n]+=ea(r);break;case 4:if(r===44){e[++n]=dr()===58?"&\f":"",o[n]=e[n].length;break}default:e[n]+=Xs(r)}while(r=Fo());return e},PP=function(e,o){return Dd(EP(_d(e),o))},KC=new WeakMap,NP=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&&!KC.get(n))&&!r){KC.set(e,!0);for(var s=[],i=PP(o,s),l=n.props,a=0,c=0;a<i.length;a++)for(var u=0;u<l.length;u++,c++)e.props[c]=s[a]?i[a].replace(/&\f/g,l[u]):l[u]+" "+i[a]}}},LP=function(e){if(e.type==="decl"){var o=e.value;o.charCodeAt(0)===108&&o.charCodeAt(2)===98&&(e.return="",e.value="")}};function ey(t,e){switch(OC(t,e)){case 5103:return st+"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 st+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return st+t+Al+t+go+t+t;case 6828:case 4268:return st+t+go+t+t;case 6165:return st+t+go+"flex-"+t+t;case 5187:return st+t+tt(t,/(\w+).+(:[^]+)/,st+"box-$1$2"+go+"flex-$1$2")+t;case 5443:return st+t+go+"flex-item-"+tt(t,/flex-|-self/,"")+t;case 4675:return st+t+go+"flex-line-pack"+tt(t,/align-content|flex-|-self/,"")+t;case 5548:return st+t+go+tt(t,"shrink","negative")+t;case 5292:return st+t+go+tt(t,"basis","preferred-size")+t;case 6060:return st+"box-"+tt(t,"-grow","")+st+t+go+tt(t,"grow","positive")+t;case 4554:return st+tt(t,/([^-])(transform)/g,"$1"+st+"$2")+t;case 6187:return tt(tt(tt(t,/(zoom-|grab)/,st+"$1"),/(image-set)/,st+"$1"),t,"")+t;case 5495:case 3959:return tt(t,/(image-set\([^]*)/,st+"$1$`$1");case 4968:return tt(tt(t,/(.+:)(flex-)?(.*)/,st+"box-pack:$3"+go+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+st+t+t;case 4095:case 3583:case 4068:case 2532:return tt(t,/(.+)-inline(.+)/,st+"$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(To(t)-1-e>6)switch(Ot(t,e+1)){case 109:if(Ot(t,e+4)!==45)break;case 102:return tt(t,/(.+:)(.+)-([^]+)/,"$1"+st+"$2-$3$1"+Al+(Ot(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Fl(t,"stretch")?ey(tt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Ot(t,e+1)!==115)break;case 6444:switch(Ot(t,To(t)-3-(~Fl(t,"!important")&&10))){case 107:return tt(t,":",":"+st)+t;case 101:return tt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+st+(Ot(t,14)===45?"inline-":"")+"box$3$1"+st+"$2$3$1"+go+"$2box$3")+t}break;case 5936:switch(Ot(t,e+11)){case 114:return st+t+go+tt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return st+t+go+tt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return st+t+go+tt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return st+t+go+t+t}return t}var kP=function(e,o,n,r){if(e.length>-1&&!e.return)switch(e.type){case Xi:e.return=ey(e.value,e.length);break;case Id:return Us([Qi(e,{value:tt(e.value,"@","@"+st)})],r);case Hi:if(e.length)return ph(e.props,function(s){switch(fh(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Us([Qi(e,{props:[tt(s,/:(read-\w+)/,":"+Al+"$1")]})],r);case"::placeholder":return Us([Qi(e,{props:[tt(s,/:(plac\w+)/,":"+st+"input-$1")]}),Qi(e,{props:[tt(s,/:(plac\w+)/,":"+Al+"$1")]}),Qi(e,{props:[tt(s,/:(plac\w+)/,go+"input-$1")]})],r)}return""})}},$P=[kP],gh=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||$P,s={},i,l=[];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;l.push(p)});var a,c=[NP,LP];{var u,d=[ZC,qC(function(p){u.insert(p)})],f=JC(c.concat(r,d)),m=function(g){return Us(YC(g),f)};a=function(g,b,x,v){u=x,m(g?g+"{"+b.styles+"}":b.styles),v&&(h.inserted[b.name]=!0)}}var h={key:o,sheet:new NC({key:o,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:a};return h.sheet.hydrate(l),h};var ZP=!0;function wh(t,e,o){var n="";return o.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):r&&(n+=r+" ")}),n}var Md=function(e,o,n){var r=e.key+"-"+o.name;(n===!1||ZP===!1)&&e.registered[r]===void 0&&(e.registered[r]=o.styles)},Ih=function(e,o,n){Md(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 my(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 fy={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 JP=!1,qP=/[A-Z]|^ms/g,QP=/_EMO_([^_]+?)_([^]*?)_EMO_/g,by=function(e){return e.charCodeAt(1)===45},py=function(e){return e!=null&&typeof e!="boolean"},Sh=QC(function(t){return by(t)?t:t.replace(qP,"-$&").toLowerCase()}),hy=function(e,o){switch(e){case"animation":case"animationName":if(typeof o=="string")return o.replace(QP,function(n,r,s){return Ur={name:r,styles:s,next:Ur},r})}return fy[e]!==1&&!by(e)&&typeof o=="number"&&o!==0?o+"px":o},KP="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Nl(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 Ur={name:r.name,styles:r.styles,next:Ur},r.name;var s=o;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)Ur={name:i.name,styles:i.styles,next:Ur},i=i.next;var l=s.styles+";";return l}return e5(t,e,o)}case"function":{if(t!==void 0){var a=Ur,c=o(t);return Ur=a,Nl(t,e,c)}break}}var u=o;if(e==null)return u;var d=e[u];return d!==void 0?d:u}function e5(t,e,o){var n="";if(Array.isArray(o))for(var r=0;r<o.length;r++)n+=Nl(t,e,o[r])+";";else for(var s in o){var i=o[s];if(typeof i!="object"){var l=i;e!=null&&e[l]!==void 0?n+=s+"{"+e[l]+"}":py(l)&&(n+=Sh(s)+":"+hy(s,l)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&JP)throw new Error(KP);if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var a=0;a<i.length;a++)py(i[a])&&(n+=Sh(s)+":"+hy(s,i[a])+";");else{var c=Nl(t,e,i);switch(s){case"animation":case"animationName":{n+=Sh(s)+":"+c+";";break}default:n+=s+"{"+c+"}"}}}}return n}var gy=/label:\s*([^\s;{]+)\s*(;|$)/g,Ur;function Bd(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="";Ur=void 0;var s=t[0];if(s==null||s.raw===void 0)n=!1,r+=Nl(o,e,s);else{var i=s;r+=i[0]}for(var l=1;l<t.length;l++)if(r+=Nl(o,e,t[l]),n){var a=s;r+=a[l]}gy.lastIndex=0;for(var c="",u;(u=gy.exec(r))!==null;)c+="-"+u[1];var d=my(r)+c;return{name:d,styles:r,next:Ur}}import*as Vd from"react";var t5=function(e){return e()},o5=Vd.useInsertionEffect?Vd.useInsertionEffect:!1,Rh=o5||t5;var vy=!1,xy=mr.createContext(typeof HTMLElement<"u"?gh({key:"css"}):null),pse=xy.Provider;var Cy=function(e){return n5(function(o,n){var r=r5(xy);return e(o,r,n)})},yy=mr.createContext({});var Gd={}.hasOwnProperty,_h="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",wy=function(e,o){var n={};for(var r in o)Gd.call(o,r)&&(n[r]=o[r]);return n[_h]=e,n},s5=function(e){var o=e.cache,n=e.serialized,r=e.isStringTag;return Md(o,n,r),Rh(function(){return Ih(o,n,r)}),null},i5=Cy(function(t,e,o){var n=t.css;typeof n=="string"&&e.registered[n]!==void 0&&(n=e.registered[n]);var r=t[_h],s=[n],i="";typeof t.className=="string"?i=wh(e.registered,s,t.className):t.className!=null&&(i=t.className+" ");var l=Bd(s,void 0,mr.useContext(yy));i+=e.key+"-"+l.name;var a={};for(var c in t)Gd.call(t,c)&&c!=="css"&&c!==_h&&!vy&&(a[c]=t[c]);return a.className=i,o&&(a.ref=o),mr.createElement(mr.Fragment,null,mr.createElement(s5,{cache:e,serialized:l,isStringTag:typeof r=="string"}),mr.createElement(r,a))}),Iy=i5;import*as ta from"react";var Sse=ws(dy()),Re=function(e,o){var n=arguments;if(o==null||!Gd.call(o,"css"))return ta.createElement.apply(void 0,n);var r=n.length,s=new Array(r);s[0]=Iy,s[1]=wy(e,o);for(var i=2;i<r;i++)s[i]=n[i];return ta.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(Re||(Re={}));function Ll(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return Bd(e)}function Sy(){var t=Ll.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 Ry(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}K_();import{useContext as l5,useRef as Ah,useState as Xd,useMemo as c5,useCallback as Dh,createContext as u5}from"react";import{createPortal as d5}from"react-dom";import{useLayoutEffect as a5}from"react";var Wd=a5;var m5=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],kl=function(){};function f5(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function Dy(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(f5(t,i)));return s.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var oa=function(e){return x5(e)?e.filter(Boolean):Fr(e)==="object"&&e!==null?[e]:[]},Ty=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,m5);return we({},o)},Nt=function(e,o,n){var r=e.cx,s=e.getStyles,i=e.getClassNames,l=e.className;return{css:s(o,e),className:r(n??{},i(o,e),l)}};function $l(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function p5(t){return $l(t)?window.innerHeight:t.clientHeight}function Ay(t){return $l(t)?window.pageYOffset:t.scrollTop}function Ud(t,e){if($l(t)){window.scrollTo(0,e);return}t.scrollTop=e}function h5(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 g5(t,e,o,n){return o*((t=t/n-1)*t*t+1)+e}function zd(t,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:kl,r=Ay(t),s=e-r,i=10,l=0;function a(){l+=i;var c=g5(l,r,s,o);Ud(t,c),l<o?window.requestAnimationFrame(a):n(t)}a()}function Fh(t,e){var o=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=e.offsetHeight/3;n.bottom+r>o.bottom?Ud(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):n.top-r<o.top&&Ud(t,Math.max(e.offsetTop-r,0))}function b5(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 Eh(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Fy(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Ey=!1,v5={get passive(){return Ey=!0}},Hd=typeof window<"u"?window:{};Hd.addEventListener&&Hd.removeEventListener&&(Hd.addEventListener("p",kl,v5),Hd.removeEventListener("p",kl,!1));var Py=Ey;function Ny(t){return t!=null}function x5(t){return Array.isArray(t)}function Ys(t,e,o){return t?e:o}var Ly=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 l=Er(i,1),a=l[0];return!n.includes(a)});return s.reduce(function(i,l){var a=Er(l,2),c=a[0],u=a[1];return i[c]=u,i},{})},C5=["children","innerProps"],y5=["children","innerProps"];function w5(t){var e=t.maxHeight,o=t.menuEl,n=t.minHeight,r=t.placement,s=t.shouldScroll,i=t.isFixedPosition,l=t.controlHeight,a=h5(o),c={placement:"bottom",maxHeight:e};if(!o||!o.offsetParent)return c;var u=a.getBoundingClientRect(),d=u.height,f=o.getBoundingClientRect(),m=f.bottom,h=f.height,p=f.top,g=o.offsetParent.getBoundingClientRect(),b=g.top,x=i?window.innerHeight:p5(a),v=Ay(a),C=parseInt(getComputedStyle(o).marginBottom,10),y=parseInt(getComputedStyle(o).marginTop,10),I=b-y,w=x-p,A=I+v,_=d-v-p,D=m-x+v+C,T=v+p-y,S=160;switch(r){case"auto":case"bottom":if(w>=h)return{placement:"bottom",maxHeight:e};if(_>=h&&!i)return s&&zd(a,D,S),{placement:"bottom",maxHeight:e};if(!i&&_>=n||i&&w>=n){s&&zd(a,D,S);var R=i?w-C:_-C;return{placement:"bottom",maxHeight:R}}if(r==="auto"||i){var E=e,F=i?I:A;return F>=n&&(E=Math.min(F-C-l,e)),{placement:"top",maxHeight:E}}if(r==="bottom")return s&&Ud(a,D),{placement:"bottom",maxHeight:e};break;case"top":if(I>=h)return{placement:"top",maxHeight:e};if(A>=h&&!i)return s&&zd(a,T,S),{placement:"top",maxHeight:e};if(!i&&A>=n||i&&I>=n){var L=e;return(!i&&A>=n||i&&I>=n)&&(L=i?I-y:A-y),s&&zd(a,T,S),{placement:"top",maxHeight:L}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function I5(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var ky=function(e){return e==="auto"?"bottom":e},$y=function(e,o){var n,r=e.placement,s=e.theme,i=s.borderRadius,l=s.spacing,a=s.colors;return we((n={label:"menu"},Hs(n,I5(r),"100%"),Hs(n,"position","absolute"),Hs(n,"width","100%"),Hs(n,"zIndex",1),n),o?{}:{backgroundColor:a.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},jy=u5(null),Oy=function(e){var o=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,i=e.menuPosition,l=e.menuShouldScrollIntoView,a=e.theme,c=l5(jy)||{},u=c.setPortalPlacement,d=Ah(null),f=Xd(r),m=Er(f,2),h=m[0],p=m[1],g=Xd(null),b=Er(g,2),x=b[0],v=b[1],C=a.spacing.controlHeight;return Wd(function(){var y=d.current;if(y){var I=i==="fixed",w=l&&!I,A=w5({maxHeight:r,menuEl:y,minHeight:n,placement:s,shouldScroll:w,isFixedPosition:I,controlHeight:C});p(A.maxHeight),v(A.placement),u?.(A.placement)}},[r,s,i,l,n,u,C]),o({ref:d,placerProps:we(we({},e),{},{placement:x||ky(s),maxHeight:h})})},S5=function(e){var o=e.children,n=e.innerRef,r=e.innerProps;return Re("div",ye({},Nt(e,"menu",{menu:!0}),{ref:n},r),o)},R5=S5,My=function(e,o){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return we({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},o?{}:{paddingBottom:r,paddingTop:r})},_5=function(e){var o=e.children,n=e.innerProps,r=e.innerRef,s=e.isMulti;return Re("div",ye({},Nt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},n),o)},By=function(e,o){var n=e.theme,r=n.spacing.baseUnit,s=n.colors;return we({textAlign:"center"},o?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Vy=By,Gy=By,D5=function(e){var o=e.children,n=o===void 0?"No options":o,r=e.innerProps,s=Vo(e,C5);return Re("div",ye({},Nt(we(we({},s),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},T5=function(e){var o=e.children,n=o===void 0?"Loading...":o,r=e.innerProps,s=Vo(e,y5);return Re("div",ye({},Nt(we(we({},s),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},Wy=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}},A5=function(e){var o=e.appendTo,n=e.children,r=e.controlElement,s=e.innerProps,i=e.menuPlacement,l=e.menuPosition,a=Ah(null),c=Ah(null),u=Xd(ky(i)),d=Er(u,2),f=d[0],m=d[1],h=c5(function(){return{setPortalPlacement:m}},[]),p=Xd(null),g=Er(p,2),b=g[0],x=g[1],v=Dh(function(){if(r){var w=b5(r),A=l==="fixed"?0:window.pageYOffset,_=w[f]+A;(_!==b?.offset||w.left!==b?.rect.left||w.width!==b?.rect.width)&&x({offset:_,rect:w})}},[r,l,f,b?.offset,b?.rect.left,b?.rect.width]);Wd(function(){v()},[v]);var C=Dh(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&a.current&&(c.current=q1(r,a.current,v,{elementResize:"ResizeObserver"in window}))},[r,v]);Wd(function(){C()},[C]);var y=Dh(function(w){a.current=w,C()},[C]);if(!o&&l!=="fixed"||!b)return null;var I=Re("div",ye({ref:y},Nt(we(we({},e),{},{offset:b.offset,position:l,rect:b.rect}),"menuPortal",{"menu-portal":!0}),s),n);return Re(jy.Provider,{value:h},o?d5(I,o):I)},zy=function(e){var o=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:o?"none":void 0,position:"relative"}},F5=function(e){var o=e.children,n=e.innerProps,r=e.isDisabled,s=e.isRtl;return Re("div",ye({},Nt(e,"container",{"--is-disabled":r,"--is-rtl":s}),n),o)},Hy=function(e,o){var n=e.theme.spacing,r=e.isMulti,s=e.hasValue,i=e.selectProps.controlShouldRenderValue;return we({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")})},E5=function(e){var o=e.children,n=e.innerProps,r=e.isMulti,s=e.hasValue;return Re("div",ye({},Nt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),n),o)},Xy=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},P5=function(e){var o=e.children,n=e.innerProps;return Re("div",ye({},Nt(e,"indicatorsContainer",{indicators:!0}),n),o)},_y,N5=["size"],L5=["innerProps","isRtl","size"];var k5={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Uy=function(e){var o=e.size,n=Vo(e,N5);return Re("svg",ye({height:o,width:o,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:k5},n))},Ph=function(e){return Re(Uy,ye({size:20},e),Re("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"}))},Yy=function(e){return Re(Uy,ye({size:20},e),Re("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"}))},Zy=function(e,o){var n=e.isFocused,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return we({label:"indicatorContainer",display:"flex",transition:"color 150ms"},o?{}:{color:n?i.neutral60:i.neutral20,padding:s*2,":hover":{color:n?i.neutral80:i.neutral40}})},Jy=Zy,$5=function(e){var o=e.children,n=e.innerProps;return Re("div",ye({},Nt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),o||Re(Yy,null))},qy=Zy,j5=function(e){var o=e.children,n=e.innerProps;return Re("div",ye({},Nt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),o||Re(Ph,null))},Qy=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return we({label:"indicatorSeparator",alignSelf:"stretch",width:1},o?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:s*2,marginTop:s*2})},O5=function(e){var o=e.innerProps;return Re("span",ye({},o,Nt(e,"indicatorSeparator",{"indicator-separator":!0})))},M5=Sy(_y||(_y=Ry([`
47
+ `};var w0=(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,l)=>{let a=o[l];return a.isOpen&&typeof a.openedOn=="number"&&(!i||typeof i.openedOn=="number"&&a.openedOn>i.openedOn)?a: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,l])=>(s[i]=Object.assign(Object.assign({},l),{isOpen:!1,openedOn:void 0}),s),{});break}default:break}return o};var yA=()=>{if(typeof window<"u")return new URLSearchParams(window.location.search)},wA=()=>{let t=yA(),e=[];if(t){let o=t.get("modal");o&&(o.includes(",")?e=o.split(","):e=[o])}return e},Ip=t=>{let{classPrefix:e,minifyCSS:o=!0,generateCSS:n=!0,zIndex:r=9999,handleParamChange:s,children:i,transTime:l=250}=t,a=S0(null),[c,u]=CA(w0,{},()=>wA().reduce((F,L)=>(F[L]={slug:L,isOpen:!0,openedOn:Date.now()},F),{})),[d,f]=Zu(!1),[m,h]=Zu(!1),[p,g]=Zu(!1),[b,x]=Zu(""),v=S0(!1),C=Hn(R=>{R.keyCode===27&&u({type:"CLOSE_LATEST_MODAL"})},[]);Ju(()=>(v.current||(document.addEventListener("keydown",R=>C(R),!1),v.current=!0),()=>{v.current&&document.removeEventListener("keydown",R=>C(R),!1)}),[C]),Ju(()=>{if(n){let R="";R=y0({classPrefix:e,zIndex:r}),o&&(R=R.replace(/\n/g,"").replace(/\s\s+/g," ")),x(R)}},[n,o,r,e]),Ju(()=>{if(typeof s=="function"&&s(c),typeof s=="boolean"&&s){let R=Object.keys(c).filter(k=>c[k].isOpen),E=new URLSearchParams;for(let k of R)E.append("modal",k);let F=E.toString()?`?${E}`:"",L=`${window.location.pathname}${F}`;window.history.pushState({},"",L)}},[c,s]),Ju(()=>{let R=Object.keys(c).some(E=>c[E].isOpen);f(R)},[c]);let y=Hn((R,E)=>{E&&(R?(x0(E),g(!0)):(C0(E),g(!1)))},[]),I=Hn(R=>{a.current=R},[]),w=Hn(R=>{u({type:"OPEN_MODAL",payload:{slug:R}})},[]),A=Hn(R=>{u({type:"CLOSE_MODAL",payload:{slug:R}})},[]),_=Hn(()=>{u({type:"CLOSE_ALL_MODALS"})},[]),D=Hn(R=>{u({type:"TOGGLE_MODAL",payload:{slug:R}})},[]),T=Hn(R=>c[R]&&c[R].isOpen,[c]),S=Object.assign({},t);return delete S.children,vA(xA,{children:[n&&I0("style",{dangerouslySetInnerHTML:{__html:b}}),I0(Wu.Provider,{value:Object.assign(Object.assign({},S),{transTime:l,containerRef:a,modalState:c,oneModalIsOpen:d,isModalOpen:T,closeOnBlur:m,bodyScrollIsLocked:p,classPrefix:e,closeAllModals:_,setCloseOnBlur:h,openModal:w,closeModal:A,toggleModal:D,setBodyScrollLock:y,setContainerRef:I}),children:i})]})};import{usePathname as fF,useRouter as pF}from"next/navigation.js";import{formatAdminURL as hF}from"payload/shared";import*as $0 from"qs-esm";import L0,{createContext as gF,use as bF,useCallback as ks,useEffect as td,useState as al}from"react";import xe,{forwardRef as IA,isValidElement as Sp}from"react";import SA from"react-dom";import Mo from"react";import R0 from"react";import LA from"react";var RA=t=>{switch(t){case"success":return TA;case"info":return FA;case"warning":return AA;case"error":return EA;default:return null}},_A=Array(12).fill(0),DA=({visible:t,className:e})=>Mo.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Mo.createElement("div",{className:"sonner-spinner"},_A.map((o,n)=>Mo.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),TA=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"})),AA=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"})),FA=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"})),EA=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"})),PA=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"})),NA=()=>{let[t,e]=R0.useState(document.hidden);return R0.useEffect(()=>{let o=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),t},Rp=1,kA=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:Rp++,s=this.toasts.find(l=>l.id===r),i=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(l=>l.id===r?(this.publish({...l,...t,id:r,title:o}),{...l,...t,id:r,dismissible:i,title:o}):l):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 a=>{if(s=["resolve",a],LA.isValidElement(a))r=!1,this.create({id:o,type:"default",message:a});else if(jA(a)&&!a.ok){r=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${a.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${a.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(a):e.success,u=typeof e.description=="function"?await e.description(a):e.description;this.create({id:o,type:"success",message:c,description:u})}}).catch(async a=>{if(s=["reject",a],e.error!==void 0){r=!1;let c=typeof e.error=="function"?await e.error(a):e.error,u=typeof e.description=="function"?await e.description(a):e.description;this.create({id:o,type:"error",message:c,description:u})}}).finally(()=>{var a;r&&(this.dismiss(o),o=void 0),(a=e.finally)==null||a.call(e)}),l=()=>new Promise((a,c)=>i.then(()=>s[0]==="reject"?c(s[1]):a(s[1])).catch(c));return typeof o!="string"&&typeof o!="number"?{unwrap:l}:Object.assign(o,{unwrap:l})},this.custom=(t,e)=>{let o=e?.id||Rp++;return this.create({jsx:t(o),id:o,...e}),o},this.subscribers=[],this.toasts=[]}},Uo=new kA,$A=(t,e)=>{let o=e?.id||Rp++;return Uo.addToast({title:t,...e,id:o}),o},jA=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",OA=$A,MA=()=>Uo.toasts,fe=Object.assign(OA,{success:Uo.success,info:Uo.info,warning:Uo.warning,error:Uo.error,custom:Uo.custom,message:Uo.message,promise:Uo.promise,dismiss:Uo.dismiss,loading:Uo.loading},{getHistory:MA});function BA(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))}BA(`: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 qu(t){return t.label!==void 0}var VA=3,GA="32px",WA="16px",_0=4e3,zA=356,HA=14,XA=20,UA=200;function Ir(...t){return t.filter(Boolean).join(" ")}function YA(t){let[e,o]=t.split("-"),n=[];return e&&n.push(e),o&&n.push(o),n}var ZA=t=>{var e,o,n,r,s,i,l,a,c,u,d;let{invert:f,toast:m,unstyled:h,interacting:p,setHeights:g,visibleToasts:b,heights:x,index:v,toasts:C,expanded:y,removeToast:I,defaultRichColors:w,closeButton:A,style:_,cancelButtonStyle:D,actionButtonStyle:T,className:S="",descriptionClassName:R="",duration:E,position:F,gap:L,loadingIcon:k,expandByDefault:N,classNames:P,icons:j,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:M}=t,[O,B]=xe.useState(null),[G,Y]=xe.useState(null),[X,ee]=xe.useState(!1),[q,z]=xe.useState(!1),[re,me]=xe.useState(!1),[se,Z]=xe.useState(!1),[Q,ge]=xe.useState(!1),[Ie,Fe]=xe.useState(0),[Le,K]=xe.useState(0),_e=xe.useRef(m.duration||E||_0),pe=xe.useRef(null),ce=xe.useRef(null),ne=v===0,H=v+1<=b,U=m.type,le=m.dismissible!==!1,De=m.className||"",Ne=m.descriptionClassName||"",qe=xe.useMemo(()=>x.findIndex(J=>J.toastId===m.id)||0,[x,m.id]),Ue=xe.useMemo(()=>{var J;return(J=m.closeButton)!=null?J:A},[m.closeButton,A]),ke=xe.useMemo(()=>m.duration||E||_0,[m.duration,E]),ot=xe.useRef(0),Ft=xe.useRef(0),Wt=xe.useRef(0),mt=xe.useRef(null),[ze,rt]=F.split("-"),ue=xe.useMemo(()=>x.reduce((J,te,he)=>he>=qe?J:J+te.height,0),[x,qe]),ve=NA(),Ve=m.invert||f,Ge=U==="loading";Ft.current=xe.useMemo(()=>qe*L+ue,[qe,ue]),xe.useEffect(()=>{_e.current=ke},[ke]),xe.useEffect(()=>{ee(!0)},[]),xe.useEffect(()=>{let J=ce.current;if(J){let te=J.getBoundingClientRect().height;return K(te),g(he=>[{toastId:m.id,height:te,position:m.position},...he]),()=>g(he=>he.filter(Pe=>Pe.toastId!==m.id))}},[g,m.id]),xe.useLayoutEffect(()=>{if(!X)return;let J=ce.current,te=J.style.height;J.style.height="auto";let he=J.getBoundingClientRect().height;J.style.height=te,K(he),g(Pe=>Pe.find(je=>je.toastId===m.id)?Pe.map(je=>je.toastId===m.id?{...je,height:he}:je):[{toastId:m.id,height:he,position:m.position},...Pe])},[X,m.title,m.description,g,m.id]);let $e=xe.useCallback(()=>{z(!0),Fe(Ft.current),g(J=>J.filter(te=>te.toastId!==m.id)),setTimeout(()=>{I(m)},UA)},[m,I,g,Ft]);xe.useEffect(()=>{if(m.promise&&U==="loading"||m.duration===1/0||m.type==="loading")return;let J;return y||p||M&&ve?(()=>{if(Wt.current<ot.current){let te=new Date().getTime()-ot.current;_e.current=_e.current-te}Wt.current=new Date().getTime()})():_e.current!==1/0&&(ot.current=new Date().getTime(),J=setTimeout(()=>{var te;(te=m.onAutoClose)==null||te.call(m,m),$e()},_e.current)),()=>clearTimeout(J)},[y,p,m,U,M,ve,$e]),xe.useEffect(()=>{m.delete&&$e()},[$e,m.delete]);function ie(){var J,te,he;return j!=null&&j.loading?xe.createElement("div",{className:Ir(P?.loader,(J=m?.classNames)==null?void 0:J.loader,"sonner-loader"),"data-visible":U==="loading"},j.loading):k?xe.createElement("div",{className:Ir(P?.loader,(te=m?.classNames)==null?void 0:te.loader,"sonner-loader"),"data-visible":U==="loading"},k):xe.createElement(DA,{className:Ir(P?.loader,(he=m?.classNames)==null?void 0:he.loader),visible:U==="loading"})}return xe.createElement("li",{tabIndex:0,ref:ce,className:Ir(S,De,P?.toast,(e=m?.classNames)==null?void 0:e.toast,P?.default,P?.[U],(o=m?.classNames)==null?void 0:o[U]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:w,"data-styled":!(m.jsx||m.unstyled||h),"data-mounted":X,"data-promise":!!m.promise,"data-swiped":Q,"data-removed":q,"data-visible":H,"data-y-position":ze,"data-x-position":rt,"data-index":v,"data-front":ne,"data-swiping":re,"data-dismissible":le,"data-type":U,"data-invert":Ve,"data-swipe-out":se,"data-swipe-direction":G,"data-expanded":!!(y||N&&X),style:{"--index":v,"--toasts-before":v,"--z-index":C.length-v,"--offset":`${q?Ie:Ft.current}px`,"--initial-height":N?"auto":`${Le}px`,..._,...m.style},onPointerDown:J=>{Ge||!le||(pe.current=new Date,Fe(Ft.current),J.target.setPointerCapture(J.pointerId),J.target.tagName!=="BUTTON"&&(me(!0),mt.current={x:J.clientX,y:J.clientY}))},onPointerUp:()=>{var J,te,he,Pe;if(se||!le)return;mt.current=null;let je=Number(((J=ce.current)==null?void 0:J.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ye=Number(((te=ce.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Qe=new Date().getTime()-((he=pe.current)==null?void 0:he.getTime()),Ze=O==="x"?je:Ye,_t=Math.abs(Ze)/Qe;if(Math.abs(Ze)>=XA||_t>.11){Fe(Ft.current),(Pe=m.onDismiss)==null||Pe.call(m,m),Y(O==="x"?je>0?"right":"left":Ye>0?"down":"up"),$e(),Z(!0),ge(!1);return}me(!1),B(null)},onPointerMove:J=>{var te,he,Pe,je;if(!mt.current||!le||((te=window.getSelection())==null?void 0:te.toString().length)>0)return;let Ye=J.clientY-mt.current.y,Qe=J.clientX-mt.current.x,Ze=(he=t.swipeDirections)!=null?he:YA(F);!O&&(Math.abs(Qe)>1||Math.abs(Ye)>1)&&B(Math.abs(Qe)>Math.abs(Ye)?"x":"y");let _t={x:0,y:0};O==="y"?(Ze.includes("top")||Ze.includes("bottom"))&&(Ze.includes("top")&&Ye<0||Ze.includes("bottom")&&Ye>0)&&(_t.y=Ye):O==="x"&&(Ze.includes("left")||Ze.includes("right"))&&(Ze.includes("left")&&Qe<0||Ze.includes("right")&&Qe>0)&&(_t.x=Qe),(Math.abs(_t.x)>0||Math.abs(_t.y)>0)&&ge(!0),(Pe=ce.current)==null||Pe.style.setProperty("--swipe-amount-x",`${_t.x}px`),(je=ce.current)==null||je.style.setProperty("--swipe-amount-y",`${_t.y}px`)}},Ue&&!m.jsx?xe.createElement("button",{"aria-label":V,"data-disabled":Ge,"data-close-button":!0,onClick:Ge||!le?()=>{}:()=>{var J;$e(),(J=m.onDismiss)==null||J.call(m,m)},className:Ir(P?.closeButton,(r=m?.classNames)==null?void 0:r.closeButton)},(s=j?.close)!=null?s:PA):null,m.jsx||Sp(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:xe.createElement(xe.Fragment,null,U||m.icon||m.promise?xe.createElement("div",{"data-icon":"",className:Ir(P?.icon,(i=m?.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ie():null,m.type!=="loading"?m.icon||j?.[U]||RA(U):null):null,xe.createElement("div",{"data-content":"",className:Ir(P?.content,(l=m?.classNames)==null?void 0:l.content)},xe.createElement("div",{"data-title":"",className:Ir(P?.title,(a=m?.classNames)==null?void 0:a.title)},typeof m.title=="function"?m.title():m.title),m.description?xe.createElement("div",{"data-description":"",className:Ir(R,Ne,P?.description,(c=m?.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),Sp(m.cancel)?m.cancel:m.cancel&&qu(m.cancel)?xe.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||D,onClick:J=>{var te,he;qu(m.cancel)&&le&&((he=(te=m.cancel).onClick)==null||he.call(te,J),$e())},className:Ir(P?.cancelButton,(u=m?.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,Sp(m.action)?m.action:m.action&&qu(m.action)?xe.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||T,onClick:J=>{var te,he;qu(m.action)&&((he=(te=m.action).onClick)==null||he.call(te,J),!J.defaultPrevented&&$e())},className:Ir(P?.actionButton,(d=m?.classNames)==null?void 0:d.actionButton)},m.action.label):null))};function D0(){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 JA(t,e){let o={};return[t,e].forEach((n,r)=>{let s=r===1,i=s?"--mobile-offset":"--offset",l=s?WA:GA;function a(c){["top","right","bottom","left"].forEach(u=>{o[`${i}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?a(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?o[`${i}-${c}`]=l:o[`${i}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):a(l)}),o}var T0=IA(function(t,e){let{invert:o,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:l,offset:a,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:m,visibleToasts:h=VA,toastOptions:p,dir:g=D0(),gap:b=HA,loadingIcon:x,icons:v,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:y}=t,[I,w]=xe.useState([]),A=xe.useMemo(()=>Array.from(new Set([n].concat(I.filter(M=>M.position).map(M=>M.position)))),[I,n]),[_,D]=xe.useState([]),[T,S]=xe.useState(!1),[R,E]=xe.useState(!1),[F,L]=xe.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),k=xe.useRef(null),N=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=xe.useRef(null),j=xe.useRef(!1),V=xe.useCallback(M=>{w(O=>{var B;return(B=O.find(G=>G.id===M.id))!=null&&B.delete||Uo.dismiss(M.id),O.filter(({id:G})=>G!==M.id)})},[]);return xe.useEffect(()=>Uo.subscribe(M=>{if(M.dismiss){w(O=>O.map(B=>B.id===M.id?{...B,delete:!0}:B));return}setTimeout(()=>{SA.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"){L(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{L(O?"dark":"light")})}catch{M.addListener(({matches:B})=>{try{L(B?"dark":"light")}catch(G){console.error(G)}})}},[u]),xe.useEffect(()=>{I.length<=1&&S(!1)},[I]),xe.useEffect(()=>{let M=O=>{var B,G;r.every(Y=>O[Y]||O.code===Y)&&(S(!0),(B=k.current)==null||B.focus()),O.code==="Escape"&&(document.activeElement===k.current||(G=k.current)!=null&&G.contains(document.activeElement))&&S(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[r]),xe.useEffect(()=>{if(k.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,j.current=!1)}},[k.current]),xe.createElement("section",{ref:e,"aria-label":`${C} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((M,O)=>{var B;let[G,Y]=M.split("-");return I.length?xe.createElement("ol",{key:M,dir:g==="auto"?D0():g,tabIndex:-1,ref:k,className:l,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":G,"data-lifted":T&&I.length>1&&!s,"data-x-position":Y,style:{"--front-toast-height":`${((B=_[0])==null?void 0:B.height)||0}px`,"--width":`${zA}px`,"--gap":`${b}px`,...m,...JA(a,c)},onBlur:X=>{j.current&&!X.currentTarget.contains(X.relatedTarget)&&(j.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||j.current||(j.current=!0,P.current=X.relatedTarget)},onMouseEnter:()=>S(!0),onMouseMove:()=>S(!0),onMouseLeave:()=>{R||S(!1)},onPointerDown:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},I.filter(X=>!X.position&&O===0||X.position===M).map((X,ee)=>{var q,z;return xe.createElement(ZA,{key:X.id,icons:v,index:ee,toast:X,defaultRichColors:d,duration:(q=p?.duration)!=null?q:f,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:o,visibleToasts:h,closeButton:(z=p?.closeButton)!=null?z:i,interacting:R,position:M,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:V,toasts:I.filter(re=>re.position==X.position),heights:_.filter(re=>re.position==X.position),setHeights:D,expandByDefault:s,gap:b,loadingIcon:x,expanded:T,pauseWhenPageIsHidden:y,swipeDirections:t.swipeDirections})})):null}))});import{c as sF}from"react/compiler-runtime";import{jsx as iF}from"react/jsx-runtime";import{useRouter as aF}from"next/navigation.js";import{formatAdminURL as lF}from"payload/shared";import"react";import{c as rF}from"react/compiler-runtime";import{jsx as il,jsxs as Ap}from"react/jsx-runtime";import nF from"react";import{c as Dp}from"react/compiler-runtime";import{jsx as dn,jsxs as Ku}from"react/jsx-runtime";import{createContext as eF,use as tF,useEffect as A0,useState as F0}from"react";import{jsx as qA}from"react/jsx-runtime";import"react";var Qu="gutter",Bo=t=>{let{children:e,className:o,left:n=!0,negativeLeft:r=!1,negativeRight:s=!1,ref:i,right:l=!0}=t,a=n&&!r,c=l&&!s;return qA("div",{className:[a&&`${Qu}--left`,c&&`${Qu}--right`,r&&`${Qu}--negative-left`,s&&`${Qu}--negative-right`,o].filter(Boolean).join(" "),ref:i,children:e})};import{c as QA}from"react/compiler-runtime";import{useId as KA}from"react";var sl=t=>{let e=QA(3),o=KA(),n=ut(),r=`${t}-${o}`,s;return e[0]!==n||e[1]!==r?(s=_p({slug:r,depth:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};var Sr="drawer",Tp=100,_p=({slug:t,depth:e})=>`drawer_${e}_${t}`,ar=t=>{let e=Dp(17),o,n,r,s,i,l;e[0]!==t?({slug:l,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]=l):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],l=e[6]);let{openModal:a}=de(),c;e[7]!==s||e[8]!==a||e[9]!==l?(c=f=>{a(l),typeof s=="function"&&s(f)},e[7]=s,e[8]=a,e[9]=l,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=dn("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=Dp(26),{slug:o,children:n,className:r,gutter:s,Header:i,hoverTitle:l,title:a}=t,c=s===void 0?!0:s,{t:u}=$(),{closeModal:d,modalState:f}=de(),m=ki(),[h,p]=F0(!1),[g,b]=F0(!1),x,v;e[0]!==f||e[1]!==o?(x=()=>{p(f[o]?.isOpen)},v=[o,f],e[0]=f,e[1]=o,e[2]=x,e[3]=v):(x=e[2],v=e[3]),A0(x,v);let C,y;if(e[4]!==h?(C=()=>{b(h)},y=[h],e[4]=h,e[5]=C,e[6]=y):(C=e[5],y=e[6]),A0(C,y),h){let I=g&&`${Sr}--is-open`,w=m>1&&`${Sr}--nested`,A;e[7]!==r||e[8]!==I||e[9]!==w?(A=[r,Sr,I,w].filter(Boolean),e[7]=r,e[8]=I,e[9]=w,e[10]=A):A=e[10];let _=A.join(" "),D=Tp+m,T;if(e[11]!==i||e[12]!==n||e[13]!==d||e[14]!==m||e[15]!==c||e[16]!==l||e[17]!==o||e[18]!==u||e[19]!==D||e[20]!==_||e[21]!==a){let S;e[23]!==d||e[24]!==o?(S=()=>d(o),e[23]=d,e[24]=o,e[25]=S):S=e[25],T=dn(oF,{children:Ku(Xo,{className:_,slug:o,style:{zIndex:D},children:[(!m||m===1)&&dn("div",{className:`${Sr}__blur-bg`}),dn("button",{"aria-label":u("general:close"),className:`${Sr}__close`,id:`close-drawer__${o}`,onClick:S,type:"button"}),Ku("div",{className:`${Sr}__content`,style:{width:`calc(100% - (${m} * var(--gutter-h)))`},children:[dn("div",{className:`${Sr}__blur-bg-content`}),Ku(Bo,{className:`${Sr}__content-children`,left:c,right:c,children:[i,i===void 0&&Ku("div",{className:`${Sr}__header`,children:[dn("h2",{className:`${Sr}__header__title`,title:l?a:null,children:a}),dn("button",{"aria-label":u("general:close"),className:`${Sr}__header__close`,id:`close-drawer__${o}`,onClick:()=>d(o),type:"button",children:dn(pt,{})})]}),n]})]})]})}),e[11]=i,e[12]=n,e[13]=d,e[14]=m,e[15]=c,e[16]=l,e[17]=o,e[18]=u,e[19]=D,e[20]=_,e[21]=a,e[22]=T}else T=e[22];return T}return null},E0=eF(1),oF=t=>{let e=Dp(3),{children:o}=t,r=ki()+1,s;return e[0]!==o||e[1]!==r?(s=dn(E0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},ki=()=>tF(E0);var ed="confirmation-modal";function It(t){let e=rF(33),{body:o,cancelLabel:n,className:r,confirmingLabel:s,confirmLabel:i,heading:l,modalSlug:a,onCancel:c,onConfirm:u}=t,d=ki(),[f,m]=nF.useState(!1),{closeModal:h}=de(),{t:p}=$(),g;e[0]!==h||e[1]!==f||e[2]!==a||e[3]!==u?(g=async()=>{f||(m(!0),typeof u=="function"&&await u(),m(!1),h(a))},e[0]=h,e[1]=f,e[2]=a,e[3]=u,e[4]=g):g=e[4];let b=g,x;e[5]!==h||e[6]!==f||e[7]!==a||e[8]!==c?(x=()=>{f||(h(a),typeof c=="function"&&c())},e[5]=h,e[6]=f,e[7]=a,e[8]=c,e[9]=x):x=e[9];let v=x,C;e[10]!==r?(C=[ed,r].filter(Boolean),e[10]=r,e[11]=C):C=e[11];let y=C.join(" "),I=Tp+d,w;if(e[12]!==o||e[13]!==n||e[14]!==i||e[15]!==f||e[16]!==s||e[17]!==l||e[18]!==a||e[19]!==v||e[20]!==b||e[21]!==p||e[22]!==y||e[23]!==I){let A;e[25]!==n||e[26]!==p?(A=n||p("general:cancel"),e[25]=n,e[26]=p,e[27]=A):A=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=il(Xo,{className:y,slug:a,style:{zIndex:I},children:Ap("div",{className:`${ed}__wrapper`,children:[Ap("div",{className:`${ed}__content`,children:[il("h1",{children:l}),il("p",{children:o})]}),Ap("div",{className:`${ed}__controls`,children:[il(ae,{buttonStyle:"secondary",disabled:f,id:"confirm-cancel",onClick:v,size:"large",type:"button",children:A}),il(ae,{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]=l,e[18]=a,e[19]=v,e[20]=b,e[21]=p,e[22]=y,e[23]=I,e[24]=w}else w=e[24];return w}var Fp="stay-logged-in",P0=()=>{let t=sF(11),{refreshCookie:e}=Se(),o=aF(),{config:n}=W(),{admin:r,routes:s}=n,{routes:i}=r,{logout:l}=i,{admin:a}=s,{t:c}=$(),{startRouteTransition:u}=it(),d;t[0]!==a||t[1]!==l||t[2]!==o||t[3]!==u?(d=()=>u(()=>o.push(lF({adminRoute:a,path:l}))),t[0]=a,t[1]=l,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=iF(It,{body:c("authentication:youAreInactive"),cancelLabel:c("authentication:stayLoggedIn"),confirmLabel:c("authentication:logOut"),heading:c("authentication:stayLoggedIn"),modalSlug:Fp,onCancel:h,onConfirm:f}),t[7]=h,t[8]=f,t[9]=c,t[10]=p):p=t[10],p};import{c as cF}from"react/compiler-runtime";import{useEffect as uF,useState as dF}from"react";function Yo(t,e){let o=cF(4),[n,r]=dF(t),s,i;return o[0]!==e||o[1]!==t?(s=()=>{let l=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(l)}},i=[t,e],o[0]=e,o[1]=t,o[2]=s,o[3]=i):(s=o[2],i=o[3]),uF(s,i),n}import*as N0 from"qs-esm";var Ke={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=N0.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 j0=gF({}),k0=2147483647;function Ep({children:t,permissions:e,user:o}){let[n,r]=al(o),[s,i]=al(),[l,a]=al(),c=fF(),u=pF(),{config:d}=W(),{admin:{routes:{inactivity:f},user:m},routes:{admin:h,api:p},serverURL:g}=d,[b,x]=al(e),{i18n:v}=$(),{closeAllModals:C,openModal:y}=de(),[I,w]=al(0),A=Yo(I,1e4),_=L0.useRef(null),{startRouteTransition:D}=it(),T=n?.id,S=ks(()=>{D(()=>u.replace(hF({adminRoute:h,path:`${f}${window.location.pathname.startsWith(h)?`?redirect=${encodeURIComponent(window.location.pathname)}`:""}`}))),C()},[u,h,f,C,D]),R=ks(()=>{i(void 0),a(void 0),clearTimeout(_.current)},[]),E=ks(j=>{j?.user?(r(j.user),i(j.token),a(j.exp)):(r(null),R())},[R]),F=ks(j=>{let V=Math.round(new Date().getTime()/1e3),M=(typeof l=="number"?l:0)-V;return(j||l&&M<120)&&(_.current=setTimeout(()=>{async function O(){try{let B=await Ke.post(`${g}${p}/${m}/refresh-token?refresh`,{headers:{"Accept-Language":v.language}});if(B.status===200){let G=await B.json();E(G)}else E(null),S()}catch(B){fe.error(B.message)}}O()},1e3)),()=>{clearTimeout(_.current)}},[p,v.language,S,g,E,l,m]),L=ks(async j=>{try{let V=await Ke.post(`${g}${p}/${m}/refresh-token`,{headers:{"Accept-Language":v.language}});if(V.status===200){let M=await V.json();return j||E(M),M.user}return E(null),S(),null}catch(V){return fe.error(`Refreshing token failed: ${V.message}`),null}},[p,v.language,S,g,E,m]),k=ks(async()=>{try{return await Ke.post(`${g}${p}/${n.collection}/logout`),E(null),R(),!0}catch(j){return fe.error(`Logging out failed: ${j.message}`),!1}},[p,R,g,E,n]),N=ks(async({locale:j}={})=>{let V=$0.stringify({locale:j},{addQueryPrefix:!0});try{let M=await Ke.get(`${g}${p}/access${V}`,{headers:{"Accept-Language":v.language}});if(M.status===200){let O=await M.json();x(O)}else throw new Error(`Fetching permissions failed with status code ${M.status}`)}catch(M){fe.error(`Refreshing permissions failed: ${M.message}`)}},[g,p,v]),P=L0.useCallback(async()=>{try{let j=await Ke.get(`${g}${p}/${m}/me`,{credentials:"include",headers:{"Accept-Language":v.language}});if(j.status===200){let V=await j.json(),M=null;return E(V),M}}catch(j){fe.error(`Fetching user failed: ${j.message}`)}return null},[g,p,m,v.language,E]);return td(()=>{P()},[P]),td(()=>{T&&F()},[A,F,T]),td(()=>{w(Date.now())},[c]),td(()=>{let j,V,M=Math.round(new Date().getTime()/1e3),O=typeof l=="number"?l-M:0,B=Math.max(Math.min((O-60)*1e3,k0),0),G=Math.max(Math.min(O*1e3,k0),0);if(!n){clearTimeout(j),clearTimeout(V);return}return O>0&&(j=setTimeout(()=>{y(Fp)},B),V=setTimeout(()=>{E(null),S()},G)),()=>{j&&clearTimeout(j),V&&clearTimeout(V)}},[l,y,v,E,n,S]),mF(j0,{value:{fetchFullUser:P,logOut:k,permissions:b,refreshCookie:F,refreshCookieAsync:L,refreshPermissions:N,setPermissions:x,setUser:E,token:s,user:n},children:t})}var Se=()=>bF(j0);import{jsx as vF}from"react/jsx-runtime";import{dequal as O0}from"dequal/lite";import{createContext as xF,use as CF,useCallback as M0,useEffect as yF,useRef as Np}from"react";function Pp(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]=Pp(t[n],e[n]):o[n]=e[n]);return o}var V0=xF({}),B0=(t,e)=>({body:JSON.stringify({value:t}),headers:{"Accept-Language":e,"Content-Type":"application/json"}}),Lp=({children:t})=>{let e=Np({}),o=Np({}),n=Np({}),{config:r}=W(),{user:s}=Se(),{i18n:i}=$(),{routes:{api:l},serverURL:a}=r;yF(()=>{s||(o.current={})},[s]);let c=M0(async d=>{let f=o.current;if(typeof f[d]<"u")return f[d];let m=new Promise(h=>{(async()=>{let p=await Ke.get(`${a}${l}/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,l,o,a]),u=M0(async(d,f,m=!1)=>{if(m===!1){o.current[d]=f,await Ke.post(`${a}${l}/payload-preferences/${d}`,B0(f,i.language));return}let h=f,p=await c(d);if(typeof f=="object"&&typeof p=="object"&&typeof h=="object"){if(p&&(h=Pp(p,h)),O0(h,p))return;n.current[d]={...n.current[d],...h}}else{if(h===p)return;n.current[d]=h}let g=async()=>{O0(n.current[d],o.current[d])||(o.current[d]=n.current[d],await Ke.post(`${a}${l}/payload-preferences/${d}`,B0(o.current[d],i.language)),delete n.current[d])};setTimeout(()=>{g()})},[l,c,i.language,n,a]);return e.current.getPreference=c,e.current.setPreference=u,vF(V0,{value:e.current,children:t})},Do=()=>CF(V0);var X0=z0({}),U0=z0({localeIsLoading:!1,setLocaleIsLoading:t=>{}}),DF=async(t,e)=>await fetch(`${e}/payload-preferences/${t}`,{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"})?.then(o=>o.json()),kp=t=>{let e=wF(27),{children:o,locale:n}=t,{config:r}=W(),{localization:s,routes:i,serverURL:l}=r,a=s===void 0?!1:s,{api:c}=i,{user:u}=Se(),d=a?a.defaultLocale:"en",{getPreference:f}=Do(),m=IF(),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]!==a?(g=()=>!a||a&&!a.locales.length?{}:zn(a,p)||zn(a,n)||zn(a,d)||zn(a,a.locales[0].code),e[2]=d,e[3]=n,e[4]=p,e[5]=a,e[6]=g):g=e[6];let[b,x]=SF.useState(g),[v,C]=_F(!1),y=RF(b),I,w;e[7]!==b?(I=()=>{b.code!==y.current.code&&C(!1),y.current=b},w=[b],e[7]=b,e[8]=I,e[9]=w):(I=e[8],w=e[9]),W0(I,w);let A=`${l}${c}`,_;e[10]!==d||e[11]!==A||e[12]!==p||e[13]!==a||e[14]!==u?.id?(_=()=>{(async function(){if(a&&u?.id){let F=p||await DF("locale",A)?.then(TF),L=zn(a,F)||zn(a,d)||zn(a,a?.locales?.[0]?.code);L&&x(L)}})()},e[10]=d,e[11]=A,e[12]=p,e[13]=a,e[14]=u?.id,e[15]=_):_=e[15];let D=u?.id,T;e[16]!==d||e[17]!==A||e[18]!==f||e[19]!==p||e[20]!==a||e[21]!==D?(T=[d,f,a,A,p,D],e[16]=d,e[17]=A,e[18]=f,e[19]=p,e[20]=a,e[21]=D,e[22]=T):T=e[22],W0(_,T);let S;return e[23]!==o||e[24]!==v||e[25]!==b?(S=G0(X0,{value:b,children:G0(U0,{value:{localeIsLoading:v,setLocaleIsLoading:C},children:o})}),e[23]=o,e[24]=v,e[25]=b,e[26]=S):S=e[26],S},od=()=>H0(U0),Ee=()=>H0(X0);function TF(t){return t.value}var rd=(t,e,o)=>`field-${t?.replace(/\./g,"__")}${e>1?`-${e}`:""}${o?`-${o}`:""}`;var be=t=>{let e=AF(25),{as:o,hideLocale:n,htmlFor:r,label:s,localized:i,path:l,required:a,unstyled:c}=t,u=o===void 0?"label":o,d=n===void 0?!1:n,f=i===void 0?!1:i,m=a===void 0?!1:a,h=c===void 0?!1:c,{uuid:p}=Me(),g=ut(),b;e[0]!==g||e[1]!==r||e[2]!==l||e[3]!==p?(b=r||rd(l,g,p),e[0]=g,e[1]=r,e[2]=l,e[3]=p,e[4]=b):b=e[4];let x=b,{i18n:v}=$(),{code:C,label:y}=Ee();if(s){let I=`field-label ${h?"unstyled":""}`,w;if(e[5]!==u||e[6]!==C||e[7]!==d||e[8]!==x||e[9]!==v||e[10]!==s||e[11]!==y||e[12]!==f||e[13]!==m||e[14]!==I||e[15]!==h){let A;e[17]!==m||e[18]!==h?(A=m&&!h&&FF("span",{className:"required",children:"*"}),e[17]=m,e[18]=h,e[19]=A):A=e[19];let _;e[20]!==C||e[21]!==d||e[22]!==y||e[23]!==f?(_=f&&!d&&Y0("span",{className:"localized",children:["\u2014 ",typeof y=="string"?y:C]}),e[20]=C,e[21]=d,e[22]=y,e[23]=f,e[24]=_):_=e[24],w=Y0(u,{className:I,htmlFor:x,children:[EF(s,v),A,_]}),e[5]=u,e[6]=C,e[7]=d,e[8]=x,e[9]=v,e[10]=s,e[11]=y,e[12]=f,e[13]=m,e[14]=I,e[15]=h,e[16]=w}else w=e[16];return w}return null};var nd=({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:[]}),sd=({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 xE}from"react/compiler-runtime";import{jsx as Vx}from"react/jsx-runtime";import*as Gx from"react";import{jsx as hl,jsxs as gE}from"react/jsx-runtime";import{useCallback as Bx,useMemo as bE}from"react";import{c as fE}from"react/compiler-runtime";import{useRef as $x}from"react";import{c as PF}from"react/compiler-runtime";import{useEffect as NF,useRef as LF}from"react";var $s=(t,e,o)=>{let n=PF(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 l=LF(i),a;n[3]!==t||n[4]!==e?(a=()=>{let u=setTimeout(()=>{Date.now()-l.current>=e&&(t(),l.current=Date.now())},e-(Date.now()-l.current));return()=>{clearTimeout(u)}},n[3]=t,n[4]=e,n[5]=a):a=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],NF(a,c)};import{jsx as Xp}from"react/jsx-runtime";import*as Lx from"qs-esm";import Px,{createContext as sE,use as iE,useCallback as Bi,useEffect as Nx,useMemo as aE,useRef as lE,useState as Zo}from"react";import{getTranslation as tE}from"@payloadcms/translations";var kF={},ll={};function $i(t,e){try{let n=(kF[t]||=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format)(e).split("GMT")[1]||"";return n in ll?ll[n]:Z0(n,n.split(":"))}catch{if(t in ll)return ll[t];let o=t?.match($F);return o?Z0(t,o.slice(1)):NaN}}var $F=/([+-]\d\d):?(\d\d)?/;function Z0(t,e){let o=+e[0],n=+(e[1]||0);return ll[t]=o>0?o*60+n:o*60-n}var jt=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($i(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)),q0(this,NaN),$p(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-$i(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),$p(this),+this}[Symbol.for("constructDateFrom")](e){return new t(+new Date(e),this.timeZone)}},J0=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!J0.test(t))return;let e=t.replace(J0,"$1UTC");jt.prototype[e]&&(t.startsWith("get")?jt.prototype[t]=function(){return this.internal[e]()}:(jt.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),jF(this),+this},jt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),$p(this),+this}))});function $p(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function jF(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()),q0(t)}function q0(t){let e=$i(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 l=n-e;l&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+l);let a=$i(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-a,d=a!==e,f=u-l;if(d&&f){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+f);let m=$i(t.timeZone,t),h=a-m;h&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+h),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+h))}}var OF=Math.pow(10,8)*24*60*60*1e3,FZ=-OF,id=6048e5,Q0=864e5;var cl=43200,jp=1440;var MF=3600;var K0=MF*24,EZ=K0*7,BF=K0*365.2425,VF=BF/12,PZ=VF*3,Op=Symbol.for("constructDateFrom");function oo(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Op in t?t[Op](e):t instanceof Date?new t.constructor(e):new Date(e)}function et(t,e){return oo(e||t,t)}var GF={};function Hr(){return GF}function mn(t,e){let o=Hr(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,r=et(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 js(t,e){return mn(t,{...e,weekStartsOn:1})}function ad(t,e){let o=et(t,e?.in),n=o.getFullYear(),r=oo(o,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let s=js(r),i=oo(o,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let l=js(i);return o.getTime()>=s.getTime()?n+1:o.getTime()>=l.getTime()?n:n-1}function ji(t){let e=et(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 Xn(t,...e){let o=oo.bind(null,t||e.find(n=>typeof n=="object"));return e.map(o)}function Mp(t,e){let o=et(t,e?.in);return o.setHours(0,0,0,0),o}function ex(t,e,o){let[n,r]=Xn(o?.in,t,e),s=Mp(n),i=Mp(r),l=+s-ji(s),a=+i-ji(i);return Math.round((l-a)/Q0)}function tx(t,e){let o=ad(t,e),n=oo(e?.in||t,0);return n.setFullYear(o,0,4),n.setHours(0,0,0,0),js(n)}function Oi(t,e){let o=+et(t)-+et(e);return o<0?-1:o>0?1:o}function ox(t){return oo(t,Date.now())}function rx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function nx(t){return!(!rx(t)&&typeof t!="number"||isNaN(+et(t)))}function sx(t,e,o){let[n,r]=Xn(o?.in,t,e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function ix(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function ax(t,e){return+et(t)-+et(e)}function lx(t,e){let o=et(t,e?.in);return o.setHours(23,59,59,999),o}function cx(t,e){let o=et(t,e?.in),n=o.getMonth();return o.setFullYear(o.getFullYear(),n+1,0),o.setHours(23,59,59,999),o}function ux(t,e){let o=et(t,e?.in);return+lx(o,e)==+cx(o,e)}function dx(t,e,o){let[n,r,s]=Xn(o?.in,t,t,e),i=Oi(r,s),l=Math.abs(sx(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*l);let a=Oi(r,s)===-i;ux(n)&&l===1&&Oi(n,s)===1&&(a=!1);let c=i*(l-+a);return c===0?0:c}function mx(t,e,o){let n=ax(t,e)/1e3;return ix(o?.roundingMethod)(n)}function fx(t,e){let o=et(t,e?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}function px(t,e){let o=et(t,e?.in);return ex(o,fx(o))+1}function hx(t,e){let o=et(t,e?.in),n=+js(o)-+tx(o);return Math.round(n/id)+1}function ld(t,e){let o=et(t,e?.in),n=o.getFullYear(),r=Hr(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=oo(e?.in||t,0);i.setFullYear(n+1,0,s),i.setHours(0,0,0,0);let l=mn(i,e),a=oo(e?.in||t,0);a.setFullYear(n,0,s),a.setHours(0,0,0,0);let c=mn(a,e);return+o>=+l?n+1:+o>=+c?n:n-1}function gx(t,e){let o=Hr(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,r=ld(t,e),s=oo(e?.in||t,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),mn(s,e)}function bx(t,e){let o=et(t,e?.in),n=+mn(o,e)-+gx(o,e);return Math.round(n/id)+1}function at(t,e){let o=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return o+n}var fn={y(t,e){let o=t.getFullYear(),n=o>0?o:1-o;return at(e==="yy"?n%100:n,e.length)},M(t,e){let o=t.getMonth();return e==="M"?String(o+1):at(o+1,2)},d(t,e){return at(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 at(t.getHours()%12||12,e.length)},H(t,e){return at(t.getHours(),e.length)},m(t,e){return at(t.getMinutes(),e.length)},s(t,e){return at(t.getSeconds(),e.length)},S(t,e){let o=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,o-3));return at(r,e.length)}};var Mi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bp={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 fn.y(t,e)},Y:function(t,e,o,n){let r=ld(t,n),s=r>0?r:1-r;if(e==="YY"){let i=s%100;return at(i,2)}return e==="Yo"?o.ordinalNumber(s,{unit:"year"}):at(s,e.length)},R:function(t,e){let o=ad(t);return at(o,e.length)},u:function(t,e){let o=t.getFullYear();return at(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 at(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 at(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 fn.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 at(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=bx(t,n);return e==="wo"?o.ordinalNumber(r,{unit:"week"}):at(r,e.length)},I:function(t,e,o){let n=hx(t);return e==="Io"?o.ordinalNumber(n,{unit:"week"}):at(n,e.length)},d:function(t,e,o){return e==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):fn.d(t,e)},D:function(t,e,o){let n=px(t);return e==="Do"?o.ordinalNumber(n,{unit:"dayOfYear"}):at(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 at(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 at(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 at(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=Mi.noon:n===0?r=Mi.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=Mi.evening:n>=12?r=Mi.afternoon:n>=4?r=Mi.morning:r=Mi.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 fn.h(t,e)},H:function(t,e,o){return e==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):fn.H(t,e)},K:function(t,e,o){let n=t.getHours()%12;return e==="Ko"?o.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},k:function(t,e,o){let n=t.getHours();return n===0&&(n=24),e==="ko"?o.ordinalNumber(n,{unit:"hour"}):at(n,e.length)},m:function(t,e,o){return e==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):fn.m(t,e)},s:function(t,e,o){return e==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):fn.s(t,e)},S:function(t,e){return fn.S(t,e)},X:function(t,e,o){let n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return xx(n);case"XXXX":case"XX":return Os(n);case"XXXXX":case"XXX":default:return Os(n,":")}},x:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"x":return xx(n);case"xxxx":case"xx":return Os(n);case"xxxxx":case"xxx":default:return Os(n,":")}},O:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+vx(n,":");case"OOOO":default:return"GMT"+Os(n,":")}},z:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+vx(n,":");case"zzzz":default:return"GMT"+Os(n,":")}},t:function(t,e,o){let n=Math.trunc(+t/1e3);return at(n,e.length)},T:function(t,e,o){return at(+t,e.length)}};function vx(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+at(s,2)}function xx(t,e){return t%60===0?(t>0?"-":"+")+at(Math.abs(t)/60,2):Os(t,e)}function Os(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=at(Math.trunc(n/60),2),s=at(n%60,2);return o+r+e+s}var Cx=(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"})}},yx=(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"})}},WF=(t,e)=>{let o=t.match(/(P+)(p+)?/)||[],n=o[1],r=o[2];if(!r)return Cx(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}}",Cx(n,e)).replace("{{time}}",yx(r,e))},wx={p:yx,P:WF};var zF=/^D+$/,HF=/^Y+$/,XF=["D","DD","YY","YYYY"];function Ix(t){return zF.test(t)}function Sx(t){return HF.test(t)}function Rx(t,e,o){let n=UF(t,e,o);if(console.warn(n),XF.includes(t))throw new RangeError(n)}function UF(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 YF=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ZF=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,JF=/^'([^]*?)'?$/,qF=/''/g,QF=/[a-zA-Z]/;function Vp(t,e,o){let n=Hr(),r=o?.locale??n.locale??za,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,l=et(t,o?.in);if(!nx(l))throw new RangeError("Invalid time value");let a=e.match(ZF).map(u=>{let d=u[0];if(d==="p"||d==="P"){let f=wx[d];return f(u,r.formatLong)}return u}).join("").match(YF).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:KF(u)};if(Bp[d])return{isToken:!0,value:u};if(d.match(QF))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(a=r.localize.preprocessor(l,a));let c={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return a.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!o?.useAdditionalWeekYearTokens&&Sx(d)||!o?.useAdditionalDayOfYearTokens&&Ix(d))&&Rx(d,e,String(t));let f=Bp[d[0]];return f(l,d,r.localize,c)}).join("")}function KF(t){let e=t.match(JF);return e?e[1].replace(qF,"'"):t}function _x(t,e,o){let n=Hr(),r=o?.locale??n.locale??za,s=2520,i=Oi(t,e);if(isNaN(i))throw new RangeError("Invalid time value");let l=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:i}),[a,c]=Xn(o?.in,...i>0?[e,t]:[t,e]),u=mx(c,a),d=(ji(c)-ji(a))/1e3,f=Math.round((u-d)/60),m;if(f<2)return o?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,l):u<10?r.formatDistance("lessThanXSeconds",10,l):u<20?r.formatDistance("lessThanXSeconds",20,l):u<40?r.formatDistance("halfAMinute",0,l):u<60?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",1,l):f===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",f,l);if(f<45)return r.formatDistance("xMinutes",f,l);if(f<90)return r.formatDistance("aboutXHours",1,l);if(f<jp){let h=Math.round(f/60);return r.formatDistance("aboutXHours",h,l)}else{if(f<s)return r.formatDistance("xDays",1,l);if(f<cl){let h=Math.round(f/jp);return r.formatDistance("xDays",h,l)}else if(f<cl*2)return m=Math.round(f/cl),r.formatDistance("aboutXMonths",m,l)}if(m=dx(c,a),m<12){let h=Math.round(f/cl);return r.formatDistance("xMonths",h,l)}else{let h=m%12,p=Math.trunc(m/12);return h<3?r.formatDistance("aboutXYears",p,l):h<9?r.formatDistance("overXYears",p,l):r.formatDistance("almostXYears",p+1,l)}}function Dx(t,e){return _x(t,ox(t),e)}function Rr(t,e){let o=eE(e)?new e(0):oo(e,0);return o.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),o.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),o}function eE(t){return typeof t=="function"&&t.prototype?.constructor===t}var pn=({date:t,i18n:e,pattern:o,timezone:n})=>{let r=new jt(new Date(t));if(n){let s=jt.tz(n),i=r.withTimeZone(n),l=Rr(i,s);return e.dateFNS?Vp(l,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`}return e.dateFNS?Vp(r,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`},Tx=({date:t,i18n:e})=>{let o=new Date(t);return e?.dateFNS?Dx(o,{locale:e.dateFNS}):`${e.t("general:loading")}...`};function Gp(t){return typeof t=="object"&&"root"in t}function cd(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+=cd(o.children,e));return e}var lr=({collectionConfig:t,data:e,dateFormat:o,fallback:n,globalConfig:r,i18n:s})=>{let i;if(t){let l=t?.admin?.useAsTitle;if(l&&(i=e?.[l]||i,i)){let a=t.fields.find(u=>"name"in u&&u.name===l);if(a?.type==="date"){let u="date"in a.admin&&a?.admin?.date?.displayFormat||o;i=pn({date:i,i18n:s,pattern:u})||i}}}return r&&(i=tE(r?.label,s)||r?.slug),Gp(i)&&(i=cd(i.root.children?.[0]?.children||[],"")),!i&&Gp(n)&&(i=cd(n.root.children?.[0]?.children||[],"")),i||(i=typeof n=="string"?n:`[${s.t("general:untitled")}]`),i};import{c as oE}from"react/compiler-runtime";import{jsx as rE}from"react/jsx-runtime";import Wp from"react";var Ax=Wp.createContext({resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),zp=t=>{let e=oE(5),{children:o}=t,[n,r]=Wp.useState(void 0),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{r({})},e[0]=s):s=e[0];let i=s,l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=u=>{r(d=>({...d||{},...u||{}}))},e[1]=l):l=e[1];let a=l,c;return e[2]!==o||e[3]!==n?(c=rE(Ax,{value:{resetUploadEdits:i,updateUploadEdits:a,uploadEdits:n},children:o}),e[2]=o,e[3]=n,e[4]=c):c=e[4],c},hn=()=>Wp.use(Ax);import*as Hp from"qs-esm";import nE from"react";var ul=t=>{let{collectionSlug:e,docPermissions:o,globalSlug:n,isEditing:r}=t;return e?!!(r&&o?.update||!r&&o?.create):n?!!o?.update:!1};var Fx=({id:t,collectionSlug:e,globalSlug:o})=>!!(o||e&&t);var Ex=({id:t,api:e,collectionSlug:o,globalSlug:n,i18n:r,locale:s,permissions:i,serverURL:l,setDocPermissions:a,setHasPublishPermission:c,setHasSavePermission:u})=>nE.useCallback(async d=>{let f={locale:s||void 0},m=d?.id||t,h=Fx({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(`${l}${e}${p}?${Hp.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"post"})).json(),x=await fetch(`${l}${e}${p}?${Hp.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"POST"}).then(v=>v.json());a(b),u(ul({collectionSlug:o,docPermissions:b,globalSlug:n,isEditing:h})),c(x?.update)}}else{let p=o?i?.collections?.[o]:i?.globals?.[n];a(p),u(ul({collectionSlug:o,docPermissions:p,globalSlug:n,isEditing:h}))}},[l,e,t,i,r.language,s,o,n]);var kx=sE({}),Ae=()=>iE(kx),cE=({children:t,...e})=>{let{id:o,collectionSlug:n,currentEditor:r,docPermissions:s,globalSlug:i,hasPublishedDoc:l,hasPublishPermission:a,hasSavePermission:c,initialData:u,initialState:d,isLocked:f,lastUpdateTime:m,mostRecentVersionIsAutosaved:h,unpublishedVersionCount:p,versionCount:g}=e,[b,x]=Zo(s),[v,C]=Zo(c),[y,I]=Zo(a),{permissions:w}=Se(),{config:{admin:{dateFormat:A},routes:{api:_},serverURL:D},getEntityConfig:T}=W(),S=T({collectionSlug:n}),R=T({globalSlug:i}),E=lE(new AbortController),F=S||R,{i18n:L}=$(),{uploadEdits:k}=hn(),[N,P]=Zo(()=>lr({collectionConfig:S,data:{...u||{},id:o},dateFormat:A,fallback:o?.toString(),globalConfig:R,i18n:L})),[j,V]=Zo(h),[M,O]=Zo(g),[B,G]=Zo(l),[Y,X]=Zo(p),[ee,q]=Zo(f),[z,re]=Zo(r),[me,se]=Zo(m),[Z,Q]=Zo(u),[ge,Ie]=Zo("idle"),Fe=Bi(ze=>{Ie(ze)},[]),{getPreference:Le,setPreference:K}=Do(),{code:_e}=Ee(),{localeIsLoading:pe}=od(),ce=aE(()=>d===void 0||u===void 0||pe,[u,d,pe]),ne=`${D}${_}`,H,U,le;i&&(H=i,U="globals",le=`global-${H}`),n&&(H=n,U="collections",o&&(le=`collection-${H}-${o}`));let De=Bi(async(ze,rt)=>{try{let ve=rt===i?`where[globalSlug][equals]=${rt}`:`where[document.value][equals]=${ze}&where[document.relationTo][equals]=${rt}`,Ve=await Ke.get(`${D}${_}/payload-locked-documents?${ve}`),{docs:Ge}=await Ve.json();if(Ge.length>0){let $e=Ge[0].id;await Ke.delete(`${D}${_}/payload-locked-documents/${$e}`,{headers:{"Content-Type":"application/json"}}),q(!1)}}catch(ue){console.error("Failed to unlock the document",ue)}},[D,_,i]),Ne=Bi(async(ze,rt,ue)=>{try{let Ve=rt===i?`where[globalSlug][equals]=${rt}`:`where[document.value][equals]=${ze}&where[document.relationTo][equals]=${rt}`,Ge=await Ke.get(`${D}${_}/payload-locked-documents?${Ve}`),{docs:$e}=await Ge.json();if($e.length>0){let ie=$e[0].id,J=typeof ue=="object"?{relationTo:ue.collection,value:ue.id}:{relationTo:"users",value:ue};await Ke.patch(`${D}${_}/payload-locked-documents/${ie}`,{body:JSON.stringify({user:J}),headers:{"Content-Type":"application/json"}})}}catch(ve){console.error("Failed to update the document editor",ve)}},[D,_,i]),qe=Ex({id:o,api:_,collectionSlug:n,globalSlug:i,i18n:L,locale:_e,permissions:w,serverURL:D,setDocPermissions:x,setHasPublishPermission:I,setHasSavePermission:C}),Ue=Bi(()=>Le(le),[Le,le]),ke=Bi(async(ze,rt)=>{let ue=await Ue();if(le)try{await K(le,{...ue,fields:{...ue?.fields||{},[ze]:{...ue?.fields?.[ze],...rt}}})}catch(ve){console.error(ve)}},[K,le,Ue]),ot=Bi(()=>{let ze=M+1;S&&S.versions?S.versions.maxPerDoc>0?O(Math.min(ze,S.versions.maxPerDoc)):O(ze):R&&R.versions&&(R.versions.max>0?O(Math.min(ze,R.versions.max)):O(ze))},[S,R,M]),Ft=Px.useCallback(ze=>{Q(ze)},[]);Nx(()=>{P(lr({collectionConfig:S,data:{...Z,id:o},dateFormat:A,fallback:o?.toString(),globalConfig:R,i18n:L}))},[S,R,Z,A,L,o]),Nx(()=>{let ze=E.current;return()=>{if(ze)try{ze.abort()}catch{}}},[]);let Wt=Px.useMemo(()=>`${`${ne}${U==="globals"?"/globals":""}/${H}${o?`/${o}`:""}`}${Lx.stringify({depth:0,"fallback-locale":"null",locale:_e,uploadEdits:k||void 0},{addQueryPrefix:!0})}`,[ne,_e,U,o,H,k]),mt={...e,action:Wt,currentEditor:z,docConfig:F,docPermissions:b,documentIsLocked:ee,getDocPermissions:qe,getDocPreferences:Ue,hasPublishedDoc:B,hasPublishPermission:y,hasSavePermission:v,incrementVersionCount:ot,initialData:u,initialState:d,isInitializing:ce,lastUpdateTime:me,mostRecentVersionIsAutosaved:j,preferencesKey:le,savedDocumentData:Z,setCurrentEditor:re,setDocFieldPreferences:ke,setDocumentIsLocked:q,setDocumentTitle:P,setHasPublishedDoc:G,setLastUpdateTime:se,setMostRecentVersionIsAutosaved:V,setUnpublishedVersionCount:X,setUploadStatus:Fe,title:N,unlockDocument:De,unpublishedVersionCount:Y,updateDocumentEditor:Ne,updateSavedDocumentData:Ft,uploadStatus:ge,versionCount:M};return Xp(kx,{value:mt,children:t})},dl=t=>Xp(zp,{children:Xp(cE,{...t})});import{jsx as uE}from"react/jsx-runtime";import{createContext as dE,use as mE}from"react";var ud=dE(""),ml=({children:t,operation:e})=>uE(ud,{value:e,children:t}),Jo=()=>mE(ud);var Te=t=>{let e=fE(62),{disableFormData:o,hasRows:n,path:r,validate:s}=t,i=o===void 0?!1:o,l=zt(),a=$o(),c=_s(),{user:u}=Se(),{id:d,collectionSlug:f}=Ae(),m=Jo(),h=Et(pE),p;e[0]!==r?(p=me=>{let[se]=me;return se&&se?.[r]||null},e[0]=r,e[1]=p):p=e[1];let g=Et(p),{t:b}=$(),{config:x}=W(),{getData:v,getDataByPath:C,getSiblingData:y,setModified:I}=Me(),w=Di(),A=Ht(),_=g?.filterOptions,D=g?.value,T=g?.initialValue,S=typeof g?.valid=="boolean"?g.valid:!0,R=S===!1&&l,E=$x(S),F=$x(g?.errorMessage),L;e[2]!==r?(L=r?r.split("."):[],e[2]=r,e[3]=L):L=e[3];let k=L,N;e[4]!==i||e[5]!==h||e[6]!==n||e[7]!==A||e[8]!==r||e[9]!==I?(N=(me,se)=>{let Z=se===void 0?!1:se,Q=me&&me.target?me.target.value:me;h({type:"UPDATE",disableFormData:i||n&&Q>0,path:r,value:Q}),Z||typeof I=="function"&&A===!1&&setTimeout(()=>{I(!0)},10)},e[4]=i,e[5]=h,e[6]=n,e[7]=A,e[8]=r,e[9]=I,e[10]=N):N=e[10];let P=N,j,V=g?.customComponents,M=a||c,O=g?.errorMessage,B;e[11]!==g?.errorPaths?(B=g?.errorPaths||[],e[11]=g?.errorPaths,e[12]=B):B=e[12];let G=g?.rows,Y=g?.valid,X;e[13]!==_||e[14]!==T||e[15]!==c||e[16]!==r||e[17]!==a||e[18]!==P||e[19]!==R||e[20]!==l||e[21]!==Y||e[22]!==V||e[23]!==M||e[24]!==O||e[25]!==B||e[26]!==G||e[27]!==D?(X={customComponents:V,disabled:M,errorMessage:O,errorPaths:B,filterOptions:_,formInitializing:c,formProcessing:a,formSubmitted:l,initialValue:T,path:r,rows:G,setValue:P,showError:R,valid:Y,value:D},e[13]=_,e[14]=T,e[15]=c,e[16]=r,e[17]=a,e[18]=P,e[19]=R,e[20]=l,e[21]=Y,e[22]=V,e[23]=M,e[24]=O,e[25]=B,e[26]=G,e[27]=D,e[28]=X):X=e[28],j=X;let ee=j,q;e[29]!==f||e[30]!==x||e[31]!==i||e[32]!==h||e[33]!==w||e[34]!==g||e[35]!==v||e[36]!==C||e[37]!==y||e[38]!==n||e[39]!==d||e[40]!==m||e[41]!==r||e[42]!==k||e[43]!==b||e[44]!==u||e[45]!==s||e[46]!==D?(q=()=>{(async()=>{let se=D;g?.rows&&Array.isArray(g.rows)&&(se=C(r));let Z=F.current,Q=E.current,ge=v(),Ie=typeof s=="function"?await s(se,{id:d,blockData:void 0,collectionSlug:f,data:w?.getData?w.getData():ge,event:"onChange",operation:m,path:k,preferences:{},req:{payload:{config:x},t:b,user:u},siblingData:y(r)}):typeof F.current=="string"?F.current:E.current;if(typeof Ie=="string"?(Q=!1,Z=Ie):typeof Ie=="boolean"&&(Q=Ie,Z=void 0),Q!==E.current||Z!==F.current){E.current=Q,F.current=Z;let Fe={type:"UPDATE",errorMessage:Z,path:r,rows:g?.rows,valid:Q,validate:s,value:D};(i||n&&typeof D=="number"&&D>0)&&(Fe.disableFormData=!0),typeof h=="function"&&h(Fe)}})()},e[29]=f,e[30]=x,e[31]=i,e[32]=h,e[33]=w,e[34]=g,e[35]=v,e[36]=C,e[37]=y,e[38]=n,e[39]=d,e[40]=m,e[41]=r,e[42]=k,e[43]=b,e[44]=u,e[45]=s,e[46]=D,e[47]=q):q=e[47];let z=g?.rows,re;return e[48]!==f||e[49]!==i||e[50]!==h||e[51]!==v||e[52]!==C||e[53]!==y||e[54]!==d||e[55]!==m||e[56]!==r||e[57]!==z||e[58]!==u||e[59]!==s||e[60]!==D?(re=[D,i,h,v,y,C,d,m,r,u,s,z,f],e[48]=f,e[49]=i,e[50]=h,e[51]=v,e[52]=C,e[53]=y,e[54]=d,e[55]=m,e[56]=r,e[57]=z,e[58]=u,e[59]=s,e[60]=D,e[61]=re):re=e[61],$s(q,150,re),ee};function pE(t){let[,e]=t;return e}import{jsx as jx}from"react/jsx-runtime";import"react";import{c as hE}from"react/compiler-runtime";var Up=t=>{let e=hE(2),{children:o,path:n}=t,r;e[0]!==n?(r=l=>{let[a]=l;return a&&a?.[n]||null},e[0]=n,e[1]=r):r=e[1];let s=Et(r),{passesCondition:i}=s||{};return i===!1?null:o};var Oe=t=>o=>{let{path:n}=o;return jx(Up,{path:n,children:jx(t,{...o})})};var nt=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 Vi({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 fl,jsxs as Jp}from"react/jsx-runtime";import"react";import{jsx as Ox}from"react/jsx-runtime";import"react";var Yp=()=>Ox("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Ox("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})});import{jsx as Mx}from"react/jsx-runtime";import"react";var Zp=()=>Mx("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Mx("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})});var pl="checkbox-input",Ms=({id:t,name:e,AfterInput:o,BeforeInput:n,checked:r,className:s,inputRef:i,Label:l,label:a,localized:c,onToggle:u,partialChecked:d,readOnly:f,required:m})=>Jp("div",{className:[s,pl,r&&`${pl}--checked`,f&&`${pl}--read-only`].filter(Boolean).join(" "),children:[Jp("div",{className:`${pl}__input`,children:[n,fl("input",{"aria-label":"",defaultChecked:!!r,disabled:f,id:t,name:e,onInput:u,ref:i,required:m,type:"checkbox"}),Jp("span",{className:[`${pl}__icon`,!r&&d?"partial":"check"].filter(Boolean).join(" "),children:[r&&fl(Yp,{}),!r&&d&&fl(Zp,{})]}),o]}),fl(oe,{CustomComponent:l,Fallback:fl(be,{htmlFor:t,label:a,localized:c,required:m})})]});var qp="checkbox";var vE=t=>{let{id:e,checked:o,disableFormData:n,field:r,field:{admin:{className:s,description:i}={},label:l,required:a}={},onChange:c,partialChecked:u,path:d,readOnly:f,validate:m}=t,{uuid:h}=Me(),p=ut(),g=Bx((E,F)=>{if(typeof m=="function")return m(E,{...F,required:a})},[m,a]),{customComponents:{AfterInput:b,BeforeInput:x,Description:v,Error:C,Label:y}={},disabled:I,setValue:w,showError:A,value:_}=Te({disableFormData:n,path:d,validate:g}),D=Bx(()=>{f||(w(!_),typeof c=="function"&&c(!_))},[c,f,w,_]),T=o||!!_,S=e||rd(d,p,h),R=bE(()=>nt(r),[r]);return gE("div",{className:[Ce,qp,A&&"error",s,_&&`${qp}--checked`,(f||I)&&`${qp}--read-only`].filter(Boolean).join(" "),style:R,children:[hl(oe,{CustomComponent:C,Fallback:hl(Xe,{path:d,showError:A})}),hl(Ms,{AfterInput:b,BeforeInput:x,checked:T,id:S,inputRef:null,Label:y,label:l,name:d,onToggle:D,partialChecked:u,readOnly:f||I,required:a}),hl(oe,{CustomComponent:v,Fallback:hl(We,{description:i,path:d})})]})},cr=Oe(vE);var gl=t=>{let e=xE(4),{fieldValue:o,localized:n,path:r}=t,{code:s}=Ee(),{config:i}=W(),{localization:l}=i,[a,c]=Gx.useState(typeof o!="number"),{t:u}=$();if(!n||!l||l.defaultLocale===s||!l.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 a&&c(!1),null}let d;return e[0]!==a||e[1]!==r||e[2]!==u?(d=Vx(yr,{children:Vx(cr,{checked:a,field:{name:"",label:u("general:fallbackToDefaultLocale")},id:`field-${r.replace(/\./g,"__")}`,path:r,schemaPath:""})}),e[0]=a,e[1]=r,e[2]=u,e[3]=d):d=e[3],d};var Gi=t=>{let e=document.getElementById(t);if(e){let o=e.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:o.top-100})}};import{c as AO}from"react/compiler-runtime";import{jsx as bs,jsxs as FO}from"react/jsx-runtime";import{getTranslation as EO}from"@payloadcms/translations";import"react";import{c as yE}from"react/compiler-runtime";import{jsx as gn,jsxs as Bs}from"react/jsx-runtime";import wE from"react";import{jsx as Wx}from"react/jsx-runtime";import"react";var bl=()=>Wx("svg",{className:"icon icon--copy",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Wx("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 Qp,jsxs as CE}from"react/jsx-runtime";import"react";var Kp=({className:t})=>CE("svg",{className:["icon icon--more",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[Qp("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"}),Qp("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"}),Qp("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 qo="array-actions",dd=t=>{let e=yE(10),{addRow:o,duplicateRow:n,hasMaxRows:r,index:s,isSortable:i,moveRow:l,removeRow:a,rowCount:c}=t,{t:u}=$(),d;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==u?(d=gn(fo,{button:gn(Kp,{}),buttonClassName:`${qo}__button`,className:qo,horizontalAlign:"center",render:f=>{let{close:m}=f;return Bs(Be.ButtonGroup,{buttonSize:"small",children:[i&&s!==0&&Bs(Be.Button,{className:`${qo}__action ${qo}__move-up`,onClick:()=>{l(s,s-1),m()},children:[gn("div",{className:`${qo}__action-chevron`,children:gn(Je,{direction:"up"})}),u("general:moveUp")]}),i&&s<c-1&&Bs(Be.Button,{className:`${qo}__action`,onClick:()=>{l(s,s+1),m()},children:[gn("div",{className:`${qo}__action-chevron`,children:gn(Je,{})}),u("general:moveDown")]}),!r&&Bs(wE.Fragment,{children:[Bs(Be.Button,{className:`${qo}__action ${qo}__add`,onClick:()=>{o(s+1),m()},children:[gn(jo,{}),u("general:addBelow")]}),Bs(Be.Button,{className:`${qo}__action ${qo}__duplicate`,onClick:()=>{n(s),m()},children:[gn(bl,{}),u("general:duplicate")]})]}),Bs(Be.Button,{className:`${qo}__action ${qo}__remove`,onClick:()=>{a(s),m()},children:[gn(pt,{}),u("general:remove")]})]})},size:"medium"}),e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=l,e[6]=a,e[7]=c,e[8]=u,e[9]=d):d=e[9],d};import{c as PE}from"react/compiler-runtime";import{jsx as Dr,jsxs as oh}from"react/jsx-runtime";import{useState as Yx}from"react";import{jsx as Wi,jsxs as IE}from"react/jsx-runtime";import"react";var Vs=({className:t})=>IE("svg",{className:["icon icon--drag-handle",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[Wi("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"}),Wi("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"}),Wi("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"}),Wi("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"}),Wi("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"}),Wi("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 Hx}from"react/jsx-runtime";import md,{useEffect as DE,useRef as th}from"react";import{useEffect as SE,useMemo as RE,useRef as eh,useState as _E}from"react";var zx=({containerRef:t,contentRef:e,duration:o,open:n})=>{let r=RE(()=>typeof CSS<"u"&&CSS&&CSS.supports?CSS.supports("interpolate-size","allow-keywords"):!1,[]),s=eh(!1),i=eh(n),[l,a]=_E(!1),c=eh(null);return SE(()=>{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",a(!1))};return(()=>{if(!s.current&&n){f("auto"),a(!1);return}s.current=!0,i.current!==n&&f(n?"0px":`${d.scrollHeight}px`),u.offsetHeight,a(!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(()=>{l&&(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 _r=({id:t,children:e,className:o,duration:n=300,height:r})=>{let[s,i]=md.useState(()=>!!r),l=th(s),[a,c]=md.useState(()=>s?"":"none"),[u,d]=md.useState(()=>s?"":"hidden"),[f,m]=md.useState(!1),h=th(null),p=th(null);return DE(()=>{let g,b,x=!!r,v=l.current!==x;return l.current=x,v&&(m(!0),d("hidden"),x?c(""):g=window.setTimeout(()=>{c("none")},n),i(x),b=window.setTimeout(()=>{d(""),m(!1)},n)),()=>{g&&clearTimeout(g),b&&clearTimeout(b)}},[r,n]),zx({containerRef:h,contentRef:p,duration:n,open:s}),Hx("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:Hx("div",{ref:p,...a?{style:{display:a}}:{},children:e})})};import{jsx as TE}from"react/jsx-runtime";import AE,{createContext as FE,use as EE}from"react";var Xx=FE({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),Ux=({children:t,isCollapsed:e,isWithinCollapsible:o=!0,toggle:n})=>{let{isCollapsed:r,isVisible:s}=Un(),i=AE.useMemo(()=>({isCollapsed:e,isVisible:s&&!r,isWithinCollapsible:o,toggle:n}),[e,o,n,r,s]);return TE(Xx,{value:i,children:t})},Un=()=>EE(Xx);var Co="collapsible";var Gs=t=>{let e=PE(26),{actions:o,children:n,className:r,collapsibleStyle:s,dragHandleProps:i,header:l,initCollapsed:a,isCollapsed:c,onToggle:u}=t,d=s===void 0?"default":s,[f,m]=Yx(!!a),[h,p]=Yx(!1),{isWithinCollapsible:g}=Un(),{t:b}=$(),x=typeof c=="boolean"?c:f,v;e[0]!==x||e[1]!==u?(v=()=>{typeof u=="function"&&u(!x),m(!x)},e[0]=x,e[1]=u,e[2]=v):v=e[2];let C=v,y=i&&`${Co}--has-drag-handle`,I=x&&`${Co}--collapsed`,w=g&&`${Co}--nested`,A=h&&`${Co}--hovered`,_=`${Co}--style-${d}`,D;e[3]!==r||e[4]!==y||e[5]!==I||e[6]!==w||e[7]!==A||e[8]!==_?(D=[Co,r,y,I,w,A,_].filter(Boolean),e[3]=r,e[4]=y,e[5]=I,e[6]=w,e[7]=A,e[8]=_,e[9]=D):D=e[9];let T=D.join(" "),S,R;e[10]===Symbol.for("react.memo_cache_sentinel")?(S=()=>p(!0),R=()=>p(!1),e[10]=S,e[11]=R):(S=e[10],R=e[11]);let E=`${Co}__toggle--${x?"collapsed":"open"}`,F;e[12]!==E?(F=[`${Co}__toggle`,E].filter(Boolean),e[12]=E,e[13]=F):F=e[13];let L=F.join(" "),k;if(e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==l||e[18]!==x||e[19]!==b||e[20]!==L||e[21]!==T||e[22]!==C){let N;e[24]!==i?(N=i&&Dr("div",{className:`${Co}__drag`,...i.attributes,...i.listeners,children:Dr(Vs,{})}),e[24]=i,e[25]=N):N=e[25],k=Dr("div",{className:T,children:oh(Ux,{isCollapsed:x,toggle:C,children:[oh("div",{className:`${Co}__toggle-wrap`,onMouseEnter:S,onMouseLeave:R,children:[Dr("button",{className:L,onClick:C,type:"button",children:Dr("span",{children:b("fields:toggleBlock")})}),N,l?Dr("div",{className:[`${Co}__header-wrap`,i&&`${Co}__header-wrap--has-drag-handle`].filter(Boolean).join(" "),children:l}):null,oh("div",{className:`${Co}__actions-wrap`,children:[o?Dr("div",{className:`${Co}__actions`,children:o}):null,Dr("div",{className:`${Co}__indicator`,children:Dr(Je,{direction:x?void 0:"up"})})]})]}),Dr(_r,{height:x?0:"auto",children:Dr("div",{className:`${Co}__content`,children:n})})]})}),e[14]=o,e[15]=n,e[16]=i,e[17]=l,e[18]=x,e[19]=b,e[20]=L,e[21]=T,e[22]=C,e[23]=k}else k=e[23];return k};import{c as RO}from"react/compiler-runtime";import{jsx as TS}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as _O,getFieldPaths as DO,getFieldPermissions as TO}from"payload/shared";import"react";import{c as NE}from"react/compiler-runtime";import{jsx as LE}from"react/jsx-runtime";import Zx from"react";var Jx=t=>{let e=NE(9),{children:o,className:n,forceRender:r}=t,[s,i]=Zx.useState(!!r),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={rootMargin:"1000px"},e[0]=l):l=e[0];let[a,c]=an(l,!!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]),Zx.useEffect(m,h);let p=s?o:null,g;return e[5]!==n||e[6]!==a||e[7]!==p?(g=LE("div",{className:n,ref:a,children:p}),e[5]=n,e[6]=a,e[7]=p,e[8]=g):g=e[8],g};import{c as SO}from"react/compiler-runtime";import{jsx as Tt}from"react/jsx-runtime";import"react";import{c as oP}from"react/compiler-runtime";import{jsx as Xt,jsxs as Jn}from"react/jsx-runtime";import{getTranslation as ah}from"@payloadcms/translations";import rP,{Fragment as nP}from"react";import{c as KE}from"react/compiler-runtime";import{jsx as Tr,jsxs as pC,Fragment as eP}from"react/jsx-runtime";import{getTranslation as tP}from"@payloadcms/translations";import"react";import{c as kE}from"react/compiler-runtime";import{jsx as vl,jsxs as $E}from"react/jsx-runtime";import"react";var ur="pill",jE=t=>{let e=kE(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:l,setNodeRef:a,transform:c}=Fi(r),u=i&&`${ur}--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]!==l||e[7]!==t||e[8]!==a||e[9]!==f||e[10]!==c?(m=vl(qx,{...t,className:f,elementProps:{...l,...s,ref:a,style:{transform:c}}}),e[5]=s,e[6]=l,e[7]=t,e[8]=a,e[9]=f,e[10]=c,e[11]=m):m=e[11],m},qx=t=>{let{id:e,alignIcon:o="right","aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,children:l,className:a,draggable:c,elementProps:u,icon:d,onClick:f,pillStyle:m="light",rounded:h,size:p="medium",to:g}=t,b=[ur,`${ur}--style-${m}`,`${ur}--size-${p}`,a&&a,g&&`${ur}--has-link`,(g||f)&&`${ur}--has-action`,d&&`${ur}--has-icon`,d&&`${ur}--align-icon-${o}`,c&&`${ur}--draggable`,h&&`${ur}--rounded`].filter(Boolean).join(" "),x="div";return f&&!g&&(x="button"),g&&(x=Kt),$E(x,{...u,"aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,className:b,href:g||null,id:e,onClick:f,type:x==="button"?"button":void 0,children:[vl("span",{className:`${ur}__label`,children:l}),!!d&&vl("span",{className:`${ur}__icon`,children:d})]})},bt=t=>{let{draggable:e}=t;return e?vl(jE,{...t}):vl(qx,{...t})};import{useEffect as OE,useState as ME}from"react";function fd(t,e){let[o,n]=ME(t);return OE(()=>{let r=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(r)}},[t,e]),o}import{c as JE}from"react/compiler-runtime";import{jsx as cC,jsxs as qE}from"react/jsx-runtime";import uC from"react";import{jsx as Xr,jsxs as iC}from"react/jsx-runtime";import{getTranslation as gd}from"@payloadcms/translations";import{useEffect as aC,useMemo as YE,useState as lC}from"react";import{c as BE}from"react/compiler-runtime";import{jsx as Qx,jsxs as VE}from"react/jsx-runtime";import"react";var xl="thumbnail-card",Kx=t=>{let e=BE(15),{alignLabel:o,className:n,collection:r,doc:s,label:i,onClick:l,thumbnail:a}=t,{config:c}=W(),{i18n:u}=$(),d=typeof l=="function"&&`${xl}--has-on-click`,f=o&&`${xl}--align-label-${o}`,m;e[0]!==n||e[1]!==d||e[2]!==f?(m=[xl,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,x;e[4]!==r||e[5]!==c.admin.dateFormat||e[6]!==s||e[7]!==u||e[8]!==b?(x=lr({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]=x):x=e[9],p=x}let g;return e[10]!==h||e[11]!==l||e[12]!==a||e[13]!==p?(g=VE("button",{className:h,onClick:l,title:p,type:"button",children:[Qx("div",{className:`${xl}__thumbnail`,children:a}),Qx("div",{className:`${xl}__label`,children:p})]}),e[10]=h,e[11]=l,e[12]=a,e[13]=p,e[14]=g):g=e[14],g};import{jsx as vn,jsxs as tC}from"react/jsx-runtime";import{useState as HE}from"react";var ho=[];for(pd=0;pd<256;++pd)ho.push((pd+256).toString(16).slice(1));var pd;function eC(t,e=0){return(ho[t[e+0]]+ho[t[e+1]]+ho[t[e+2]]+ho[t[e+3]]+"-"+ho[t[e+4]]+ho[t[e+5]]+"-"+ho[t[e+6]]+ho[t[e+7]]+"-"+ho[t[e+8]]+ho[t[e+9]]+"-"+ho[t[e+10]]+ho[t[e+11]]+ho[t[e+12]]+ho[t[e+13]]+ho[t[e+14]]+ho[t[e+15]]).toLowerCase()}var hd,GE=new Uint8Array(16);function rh(){if(!hd&&(hd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!hd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hd(GE)}var WE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nh={randomUUID:WE};function zE(t,e,o){if(nh.randomUUID&&!e&&!t)return nh.randomUUID();t=t||{};var n=t.random||(t.rng||rh)();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 eC(n)}var bn=zE;var sh=()=>{let[t]=HE(()=>`pattern${bn()}`);return tC("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[tC("g",{clipPath:`url(#${t})`,children:[vn("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),vn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),vn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),vn("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),vn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),vn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),vn("defs",{children:vn("clipPath",{id:`${t}`,children:vn("rect",{fill:"white",height:"151",width:"231"})})})]})};import{c as XE}from"react/compiler-runtime";import{jsx as rC,jsxs as UE}from"react/jsx-runtime";import"react";import{jsx as oC}from"react/jsx-runtime";import"react";var Cl=()=>oC("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:oC("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 nC="block-search",sC=t=>{let e=XE(5),{setSearchTerm:o}=t,{t:n}=$(),r;e[0]!==o?(r=l=>{o(l.target.value)},e[0]=o,e[1]=r):r=e[1];let s=r,i;return e[2]!==s||e[3]!==n?(i=UE("div",{className:nC,children:[rC("input",{className:`${nC}__input`,onChange:s,placeholder:n("fields:searchForBlock")}),rC(Cl,{})]}),e[2]=s,e[3]=n,e[4]=i):i=e[4],i};var Yn="blocks-drawer",ZE=(t,e)=>typeof t.labels.singular=="string"?t.labels.singular.toLowerCase():typeof t.labels.singular=="object"?gd(t.labels.singular,e).toLowerCase():"",yl=t=>{let{addRow:e,addRowIndex:o,blocks:n,drawerSlug:r,labels:s}=t,[i,l]=lC(""),[a,c]=lC(n),{closeModal:u,isModalOpen:d}=de(),{i18n:f,t:m}=$(),{config:h}=W(),p=YE(()=>{let g={_none:[]};return a.forEach(b=>{if(typeof b=="object"&&b.admin?.group){let x=b.admin.group,v=typeof x=="string"?x:gd(x,f);Object.hasOwn(g,v)?g[v].push(b):g[v]=[b]}else g._none.push(b)}),g},[a,f]);return aC(()=>{d(r)||l("")},[d,r]),aC(()=>{let g=i.toLowerCase(),b=n?.reduce((x,v)=>{let C=typeof v=="string"?h.blocksMap[v]:v;return ZE(C,f).includes(g)&&x.push(C),x},[]);c(b)},[i,n,f,h.blocksMap]),iC(Pt,{slug:r,title:m("fields:addLabel",{label:gd(s.singular,f)}),children:[Xr(sC,{setSearchTerm:l}),Xr("div",{className:`${Yn}__blocks-wrapper`,children:Xr("ul",{className:`${Yn}__block-groups`,children:Object.entries(p).map(([g,b])=>b.length?iC("li",{className:[`${Yn}__block-group`,g==="_none"&&`${Yn}__block-group-none`].filter(Boolean).join(" "),children:[g!=="_none"&&Xr("h3",{className:`${Yn}__block-group-label`,children:g}),Xr("ul",{className:`${Yn}__blocks`,children:b.map((x,v)=>{let C=typeof x=="string"?h.blocksMap[x]:x,{slug:y,imageAltText:I,imageURL:w,labels:A}=C;return Xr("li",{className:`${Yn}__block`,children:Xr(Kx,{alignLabel:"center",label:gd(A?.singular,f),onClick:()=>{e(o,y),u(r)},thumbnail:Xr("div",{className:`${Yn}__default-image`,children:w?Xr("img",{alt:I,src:w}):Xr(sh,{})})})},v)})})]},g):null)})})]})};var dC=t=>{let e=JE(26),{addRow:o,blocks:n,blockType:r,duplicateRow:s,hasMaxRows:i,isSortable:l,labels:a,moveRow:c,removeRow:u,rowCount:d,rowIndex:f}=t,{closeModal:m,openModal:h}=de(),p=sl("blocks-drawer"),[g,b]=uC.useState(null),x;e[0]!==o||e[1]!==m||e[2]!==p||e[3]!==g?(x=(C,y)=>{typeof o=="function"&&o(g,y),m(p)},e[0]=o,e[1]=m,e[2]=p,e[3]=g,e[4]=x):x=e[4];let v;if(e[5]!==r||e[6]!==n||e[7]!==p||e[8]!==s||e[9]!==i||e[10]!==l||e[11]!==a||e[12]!==c||e[13]!==h||e[14]!==u||e[15]!==d||e[16]!==f||e[17]!==x){let C;e[19]!==p||e[20]!==h?(C=I=>{b(I),h(p)},e[19]=p,e[20]=h,e[21]=C):C=e[21];let y;e[22]!==r||e[23]!==s||e[24]!==f?(y=()=>s(f,r),e[22]=r,e[23]=s,e[24]=f,e[25]=y):y=e[25],v=qE(uC.Fragment,{children:[cC(yl,{addRow:x,addRowIndex:f,blocks:n,drawerSlug:p,labels:a}),cC(dd,{addRow:C,duplicateRow:y,hasMaxRows:i,index:f,isSortable:l,moveRow:c,removeRow:u,rowCount:d})]}),e[5]=r,e[6]=n,e[7]=p,e[8]=s,e[9]=i,e[10]=l,e[11]=a,e[12]=c,e[13]=h,e[14]=u,e[15]=d,e[16]=f,e[17]=x,e[18]=v}else v=e[18];return v};import{c as QE}from"react/compiler-runtime";import{jsx as mC}from"react/jsx-runtime";import"react";var fC="section-title",ih=t=>{let e=QE(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:l,value:a}=Te(i),{t:c}=$(),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=[fC].filter(Boolean),e[2]=u):u=e[2];let d=u.join(" "),f;e[3]!==o||e[4]!==l?(f=o||(g=>{g.stopPropagation(),g.preventDefault(),l(g.target.value)}),e[3]=o,e[4]=l,e[5]=f):f=e[5];let m=f,h=n||a,p;return e[6]!==n||e[7]!==m||e[8]!==r||e[9]!==s||e[10]!==c||e[11]!==h||e[12]!==a?(p=mC("div",{className:d,"data-value":h,children:mC("input",{className:`${fC}__input`,id:r,name:r,onChange:m,placeholder:c("general:untitled"),readOnly:s,type:"text",value:n||a||""})}),e[6]=n,e[7]=m,e[8]=r,e[9]=s,e[10]=c,e[11]=h,e[12]=a,e[13]=p):p=e[13],p};var Zn="blocks-field",hC=t=>{let e=KE(40),{addRow:o,attributes:n,block:r,blocks:s,duplicateRow:i,errorCount:l,fields:a,hasMaxRows:c,isLoading:u,isSortable:d,Label:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:x,readOnly:v,removeRow:C,row:y,rowCount:I,rowIndex:w,schemaPath:A,setCollapse:_,setNodeRef:D,transform:T}=t,S=fd(u,500),{i18n:R}=$(),F=zt()&&l>0,L=!r.admin?.disableBlockName,k=F?`${Zn}__row--has-errors`:`${Zn}__row--no-errors`,N;e[0]!==k?(N=[`${Zn}__row`,k].filter(Boolean),e[0]=k,e[1]=N):N=e[1];let P=N.join(" "),j;if(x===!0)j=!0;else{let O=x?.blocks?.[r.slug];O===!0?j=!0:j=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]!==j||e[8]!==s||e[9]!==P||e[10]!==i||e[11]!==l||e[12]!==F||e[13]!==a||e[14]!==c||e[15]!==R||e[16]!==S||e[17]!==d||e[18]!==m||e[19]!==h||e[20]!==p||e[21]!==g||e[22]!==b||e[23]!==v||e[24]!==C||e[25]!==y.blockType||e[26]!==y.collapsed||e[27]!==y.id||e[28]!==I||e[29]!==w||e[30]!==A||e[31]!==_||e[32]!==D||e[33]!==L||e[34]!==V||e[35]!==T){let O;e[37]!==y.id||e[38]!==_?(O=B=>_(y.id,B),e[37]=y.id,e[38]=_,e[39]=O):O=e[39],M=Tr("div",{id:V,ref:D,style:{transform:T},children:Tr(Gs,{actions:v?void 0:Tr(dC,{addRow:o,blocks:s,blockType:y.blockType,duplicateRow:i,fields:r.fields,hasMaxRows:c,isSortable:d,labels:m,moveRow:p,removeRow:C,rowCount:I,rowIndex:w}),className:P,collapsibleStyle:F?"error":"default",dragHandleProps:d?{id:y.id,attributes:n,listeners:h}:void 0,header:S?Tr(wt,{height:"1rem",width:"8rem"}):pC("div",{className:`${Zn}__block-header`,children:[Tr(sn,{CustomComponent:f,label:pC(eP,{children:[Tr("span",{className:`${Zn}__block-number`,children:String(w+1).padStart(2,"0")}),Tr(bt,{className:`${Zn}__block-pill ${Zn}__block-pill-${y.blockType}`,pillStyle:"white",children:tP(r.labels.singular,R)}),L&&Tr(ih,{path:`${b}.blockName`,readOnly:v})]}),path:b,rowNumber:w}),F&&Tr(to,{count:l,i18n:R,withMessage:!0})]}),isCollapsed:y.collapsed,onToggle:O,children:S?Tr(wt,{}):Tr(yo,{className:`${Zn}__fields`,fields:a,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:A,permissions:j,readOnly:v})},y.id)},`${g}-row-${w}`),e[2]=f,e[3]=o,e[4]=n,e[5]=r.fields,e[6]=r.labels,e[7]=j,e[8]=s,e[9]=P,e[10]=i,e[11]=l,e[12]=F,e[13]=a,e[14]=c,e[15]=R,e[16]=S,e[17]=d,e[18]=m,e[19]=h,e[20]=p,e[21]=g,e[22]=b,e[23]=v,e[24]=C,e[25]=y.blockType,e[26]=y.collapsed,e[27]=y.id,e[28]=I,e[29]=w,e[30]=A,e[31]=_,e[32]=D,e[33]=L,e[34]=V,e[35]=T,e[36]=M}else M=e[36];return M};var Ar="blocks-field",sP=t=>{let e=oP(52),{i18n:o,t:n}=$(),{field:r,path:s,permissions:i,readOnly:l,schemaPath:a,validate:c}=t,{name:u,admin:d,blockReferences:f,blocks:m,label:h,labels:p,localized:g,maxRows:b,minRows:x,required:v}=r,C;e[0]!==d?(C=d===void 0?{}:d,e[0]=d,e[1]=C):C=e[1];let{className:y,description:I,isSortable:w}=C,A=w===void 0?!0:w,_=a??u,D=x??v?1:0,{setDocFieldPreferences:T}=Ae(),{addFieldRow:S,dispatchFields:R,setModified:E}=Me(),{code:F}=Ee(),{config:L,config:k}=W(),{localization:N}=L,P=sl("blocks-drawer"),j=zt(),V={plural:n("fields:blocks"),singular:n("fields:block"),...p},M;e:{if(N&&N.fallback){let ie=N.defaultLocale;M=F===ie;break e}M=!0}let O=M,B;e[2]!==O||e[3]!==b||e[4]!==D||e[5]!==v||e[6]!==c?(B=(ie,J)=>{if(!O&&ie===null)return!0;if(typeof c=="function")return c(ie,{...J,maxRows:b,minRows:D,required:v})},e[2]=O,e[3]=b,e[4]=D,e[5]=v,e[6]=c,e[7]=B):B=e[7];let G=B,Y;e[8]!==G||e[9]!==s?(Y={hasRows:!0,path:s,validate:G},e[8]=G,e[9]=s,e[10]=Y):Y=e[10];let{customComponents:X,disabled:ee,errorPaths:q,rows:z,showError:re,valid:me,value:se}=Te(Y),Z;e[11]!==X?(Z=X===void 0?{}:X,e[11]=X,e[12]=Z):Z=e[12];let{AfterInput:Q,BeforeInput:ge,Description:Ie,Error:Fe,Label:Le,RowLabels:K}=Z,_e;e[13]!==z?(_e=z===void 0?[]:z,e[13]=z,e[14]=_e):_e=e[14];let pe=_e,ce;e[15]!==S||e[16]!==s||e[17]!==_?(ce=(ie,J)=>{S({blockType:J,path:s,rowIndex:ie,schemaPath:_}),setTimeout(()=>{Gi(`${s}-row-${ie+1}`)},0)},e[15]=S,e[16]=s,e[17]=_,e[18]=ce):ce=e[18];let ne=ce,H;e[19]!==R||e[20]!==s||e[21]!==E?(H=ie=>{R({type:"DUPLICATE_ROW",path:s,rowIndex:ie}),E(!0),setTimeout(()=>{Gi(`${s}-row-${ie+1}`)},0)},e[19]=R,e[20]=s,e[21]=E,e[22]=H):H=e[22];let U=H,le;e[23]!==R||e[24]!==s||e[25]!==E?(le=ie=>{R({type:"REMOVE_ROW",path:s,rowIndex:ie}),E(!0)},e[23]=R,e[24]=s,e[25]=E,e[26]=le):le=e[26];let De=le,Ne;e[27]!==R||e[28]!==s||e[29]!==E?(Ne=(ie,J)=>{R({type:"MOVE_ROW",moveFromIndex:ie,moveToIndex:J,path:s}),E(!0)},e[27]=R,e[28]=s,e[29]=E,e[30]=Ne):Ne=e[30];let qe=Ne,Ue;e[31]!==R||e[32]!==s||e[33]!==pe||e[34]!==T?(Ue=ie=>{let{collapsedIDs:J,updatedRows:te}=sd({collapsed:ie,rows:pe});R({type:"SET_ALL_ROWS_COLLAPSED",path:s,updatedRows:te}),T(s,{collapsed:J})},e[31]=R,e[32]=s,e[33]=pe,e[34]=T,e[35]=Ue):Ue=e[35];let ke=Ue,ot;e[36]!==R||e[37]!==s||e[38]!==pe||e[39]!==T?(ot=(ie,J)=>{let{collapsedIDs:te,updatedRows:he}=nd({collapsed:J,rowID:ie,rows:pe});R({type:"SET_ROW_COLLAPSED",path:s,updatedRows:he}),T(s,{collapsed:te})},e[36]=R,e[37]=s,e[38]=pe,e[39]=T,e[40]=ot):ot=e[40];let Ft=ot,Wt=b&&pe.length>=b,mt=q.length,ze=j&&mt+(me?0:1)>0,rt=pe.length<D||v&&pe.length===0,ue=l&&pe.length===0,ve=ze?`${Ar}--has-error`:`${Ar}--has-no-error`,Ve;e[41]!==y||e[42]!==ve?(Ve=[Ce,Ar,y,ve].filter(Boolean),e[41]=y,e[42]=ve,e[43]=Ve):Ve=e[43];let Ge;e[44]!==Fe||e[45]!==s||e[46]!==re?(Ge=re&&Xt(oe,{CustomComponent:Fe,Fallback:Xt(Xe,{path:s,showError:re})}),e[44]=Fe,e[45]=s,e[46]=re,e[47]=Ge):Ge=e[47];let $e;return e[48]!==mt||e[49]!==ze||e[50]!==o?($e=ze&&mt>0&&Xt(to,{count:mt,i18n:o,withMessage:!0}),e[48]=mt,e[49]=ze,e[50]=o,e[51]=$e):$e=e[51],Jn("div",{className:Ve.join(" "),id:`field-${s?.replace(/\./g,"__")}`,children:[Ge,Jn("header",{className:`${Ar}__header`,children:[Jn("div",{className:`${Ar}__header-wrap`,children:[Jn("div",{className:`${Ar}__heading-with-error`,children:[Xt("h3",{children:Xt(oe,{CustomComponent:Le,Fallback:Xt(be,{label:h,localized:g,path:s,required:v})})}),$e]}),pe.length>0&&Jn("ul",{className:`${Ar}__header-actions`,children:[Xt("li",{children:Xt("button",{className:`${Ar}__header-action`,onClick:()=>ke(!0),type:"button",children:n("fields:collapseAll")})}),Xt("li",{children:Xt("button",{className:`${Ar}__header-action`,onClick:()=>ke(!1),type:"button",children:n("fields:showAll")})})]})]}),Xt(oe,{CustomComponent:Ie,Fallback:Xt(We,{description:I,path:s})})]}),ge,Xt(gl,{fieldValue:se,localized:g,path:s}),(pe.length>0||!me&&(ue||rt))&&Jn(zr,{className:`${Ar}__rows`,ids:pe.map(iP),onDragEnd:ie=>{let{moveFromIndex:J,moveToIndex:te}=ie;return qe(J,te)},children:[pe.map((ie,J)=>{let{blockType:te,isLoading:he}=ie,Pe=k.blocksMap[te]??(f??m).find(je=>typeof je!="string"&&je.slug===te);if(Pe){let je=`${s}.${J}`,Ye=q.filter(Qe=>Qe.startsWith(je+".")).length;return Xt(Wn,{disabled:l||ee||!A,id:ie.id,children:Qe=>Xt(hC,{...Qe,addRow:ne,block:Pe,blocks:f??m,duplicateRow:U,errorCount:Ye,fields:Pe.fields,hasMaxRows:Wt,isLoading:he,isSortable:A,Label:K?.[J],labels:V,moveRow:qe,parentPath:s,path:je,permissions:i,readOnly:l||ee,removeRow:De,row:ie,rowCount:pe.length,rowIndex:J,schemaPath:_+Pe.slug,setCollapse:Ft})},ie.id)}return null}),!O&&Jn(rP.Fragment,{children:[rt&&Xt(yr,{type:"error",children:n("validation:requiresAtLeast",{count:D,label:ah(D>1?V.plural:V.singular,o)||n(D>1?"general:row":"general:rows")})}),ue&&Xt(yr,{children:n("validation:fieldHasNo",{label:ah(V.plural,o)})})]})]}),!Wt&&Jn(nP,{children:[Xt(ar,{className:`${Ar}__drawer-toggler`,disabled:l||ee,slug:P,children:Xt(ae,{buttonStyle:"icon-label",disabled:l||ee,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:n("fields:addLabel",{label:ah(V.singular,o)})})}),Xt(yl,{addRow:ne,addRowIndex:pe?.length||0,blocks:f??m,drawerSlug:P,labels:V})]}),Q]})},wl=Oe(sP);function iP(t){return t.id}import{jsx as Ws,jsxs as gC}from"react/jsx-runtime";import{useCallback as uP,useMemo as dP}from"react";import{jsx as lh}from"react/jsx-runtime";import{lazy as aP,Suspense as lP}from"react";var cP=aP(()=>import("./CodeEditor-J4IKAVAK.js")),Il=t=>lh(lP,{fallback:lh(wt,{}),children:lh(cP,{...t})});var mP={js:"javascript",ts:"typescript"},fP="code-field",pP=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r={},language:s="javascript"}={},label:i,localized:l,required:a},onMount:c,path:u,readOnly:d,validate:f}=t,m=uP((A,_)=>{if(typeof f=="function")return f(A,{..._,required:a})},[f,a]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:x}={},disabled:v,setValue:C,showError:y,value:I}=Te({path:u,validate:m}),w=dP(()=>nt(e),[e]);return gC("div",{className:[Ce,fP,o,y&&"error",(d||v)&&"read-only"].filter(Boolean).join(" "),style:w,children:[Ws(oe,{CustomComponent:x,Fallback:Ws(be,{label:i,localized:l,path:u,required:a})}),gC("div",{className:`${Ce}__wrap`,children:[Ws(oe,{CustomComponent:b,Fallback:Ws(Xe,{path:u,showError:y})}),p,Ws(Il,{defaultLanguage:mP[s]||s,onChange:d||v?()=>null:A=>C(A),onMount:c,options:r,readOnly:d||v,value:I||""}),h]}),Ws(oe,{CustomComponent:g,Fallback:Ws(We,{description:n,path:u})})]})},Sl=Oe(pP);import{jsx as Hs,jsxs as ch}from"react/jsx-runtime";import{getTranslation as gP}from"@payloadcms/translations";import{Fragment as bP,useCallback as vP,useEffect as xP,useMemo as CP,useState as vC}from"react";import{c as hP}from"react/compiler-runtime";import{fieldAffectsData as bC}from"payload/shared";var bd=t=>t.reduce((e,o)=>{let n="fields"in o?o.fields:void 0;return n?bC(o)?e.push(`${o.name}.`):e.push(...bd(n)):o.type==="tabs"?"tabs"in o&&o.tabs?.forEach(r=>{"name"in r?e.push(`${r.name}.`):e.push(...bd(r.fields))}):bC(o)&&e.push(o.name),e},[]);var zs=t=>{let e=hP(12),{fields:o,path:n,setErrorCount:r}=t,[s]=Ti(),i=zt(),l;e[0]!==o?(l=bd(o),e[0]=o,e[1]=l):l=e[1];let a=l,c;e[2]!==s||e[3]!==i||e[4]!==n||e[5]!==a||e[6]!==r?(c=()=>{if(i){let d;d=0,Object.entries(s).forEach(f=>{let[m]=f;if(a?.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]=a,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],$s(c,250,u),null};var Rl="collapsible-field",yP=t=>{let{field:e,field:{admin:{className:o,description:n,initCollapsed:r=!1}={},fields:s,label:i}={},indexPath:l,parentPath:a,parentSchemaPath:c,path:u,permissions:d,readOnly:f}=t,{i18n:m}=$(),{getPreference:h,setPreference:p}=Do(),{preferencesKey:g}=Ae(),[b,x]=vC(),v=`collapsible-${u?.replace(/\./g,"__")}`,[C,y]=vC(0),I=C>0,{customComponents:{AfterInput:w,BeforeInput:A,Description:_,Label:D}={},disabled:T}=Te({path:u}),S=vP(async E=>{let F=await h(g);g&&p(g,{...F,...u?{fields:{...F?.fields||{},[u]:{...F?.fields?.[u],collapsed:E}}}:{fields:{...F?.fields||{},[v]:{...F?.fields?.[v],collapsed:E}}}})},[g,v,h,p,u]);xP(()=>{(async()=>{if(g){let F=await h(g),L=u?F?.fields?.[u]?.collapsed:F?.fields?.[v]?.collapsed;x(L!==void 0?!!L:typeof r=="boolean"?r:!1)}else x(typeof r=="boolean"?r:!1)})()},[h,g,v,r,u]);let R=CP(()=>nt(e),[e]);return typeof b!="boolean"?null:ch(bP,{children:[Hs(zs,{fields:s,path:u.split(".").slice(0,-1),setErrorCount:y}),ch("div",{className:[Ce,Rl,o,I?`${Rl}--has-error`:`${Rl}--has-no-error`].filter(Boolean).join(" "),id:`field-${v}`,style:R,children:[A,Hs(Gs,{className:`${Rl}__collapsible`,collapsibleStyle:I?"error":"default",header:ch("div",{className:`${Rl}__row-label-wrap`,children:[Hs(sn,{CustomComponent:D,label:gP(i,m),path:u}),I&&Hs(to,{count:C,i18n:m,withMessage:!0})]}),initCollapsed:b,onToggle:S,children:Hs(yo,{fields:s,margins:"small",parentIndexPath:l,parentPath:a,parentSchemaPath:c,permissions:d,readOnly:f||T})}),w,Hs(oe,{CustomComponent:_,Fallback:Hs(We,{description:n,path:u})})]})]})},_l=Oe(yP);import{jsx as es,jsxs as l2}from"react/jsx-runtime";import{getTranslation as xN}from"@payloadcms/translations";import{useCallback as Qh,useMemo as c2}from"react";import{jsx as uh}from"react/jsx-runtime";import{lazy as wP,Suspense as IP}from"react";var SP=wP(()=>import("./DatePicker-DMHV2M2L.js")),zi=t=>uh(IP,{fallback:uh(wt,{height:50}),children:uh(SP,{...t})});import{jsx as a2,jsxs as bN}from"react/jsx-runtime";import{useMemo as vN}from"react";import{jsx as Js}from"react/jsx-runtime";import{getTranslation as n2}from"@payloadcms/translations";import s2,{useEffect as fN,useId as pN}from"react";function Fr(t){"@babel/helpers - typeof";return Fr=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},Fr(t)}function xC(t,e){if(Fr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(Fr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vd(t){var e=xC(t,"string");return Fr(e)=="symbol"?e:e+""}function Xs(t,e,o){return(e=vd(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function CC(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 we(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?CC(Object(o),!0).forEach(function(n){Xs(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):CC(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function yC(t){if(Array.isArray(t))return t}function wC(t,e){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n,r,s,i,l=[],a=!0,c=!1;try{if(s=(o=o.call(t)).next,e===0){if(Object(o)!==o)return;a=!1}else for(;!(a=(n=s.call(o)).done)&&(l.push(n.value),l.length!==e);a=!0);}catch(u){c=!0,r=u}finally{try{if(!a&&o.return!=null&&(i=o.return(),Object(i)!==i))return}finally{if(c)throw r}}return l}}function Dl(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 xd(t,e){if(t){if(typeof t=="string")return Dl(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)?Dl(t,e):void 0}}function IC(){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 Er(t,e){return yC(t)||wC(t,e)||xd(t,e)||IC()}function Vo(t,e){if(t==null)return{};var o,n,r=Ei(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 dh,useCallback as Cd}from"react";var RP=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function yd(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,l=t.inputValue,a=t.menuIsOpen,c=t.onChange,u=t.onInputChange,d=t.onMenuClose,f=t.onMenuOpen,m=t.value,h=Vo(t,RP),p=dh(l!==void 0?l:o),g=Er(p,2),b=g[0],x=g[1],v=dh(a!==void 0?a:r),C=Er(v,2),y=C[0],I=C[1],w=dh(m!==void 0?m:i),A=Er(w,2),_=A[0],D=A[1],T=Cd(function(N,P){typeof c=="function"&&c(N,P),D(N)},[c]),S=Cd(function(N,P){var j;typeof u=="function"&&(j=u(N,P)),x(j!==void 0?j:N)},[u]),R=Cd(function(){typeof f=="function"&&f(),I(!0)},[f]),E=Cd(function(){typeof d=="function"&&d(),I(!1)},[d]),F=l!==void 0?l:b,L=a!==void 0?a:y,k=m!==void 0?m:_;return we(we({},h),{},{inputValue:F,menuIsOpen:L,onChange:T,onInputChange:S,onMenuClose:E,onMenuOpen:R,value:k})}import*as Ow from"react";import{forwardRef as Z6,useMemo as aie}from"react";function SC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function RC(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,vd(n.key),n)}}function _C(t,e,o){return e&&RC(t.prototype,e),o&&RC(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function DC(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&&Pi(t,e)}function Tl(t){return Tl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Tl(t)}function mh(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mh=function(){return!!t})()}function TC(t,e){if(e&&(Fr(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s0(t)}function AC(t){var e=mh();return function(){var o,n=Tl(t);if(e){var r=Tl(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return TC(this,o)}}function FC(t){if(Array.isArray(t))return Dl(t)}function EC(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function PC(){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 qn(t){return FC(t)||EC(t)||xd(t)||PC()}import*as dt from"react";import{useMemo as jl,Fragment as kh,useRef as na,useCallback as Kn,useEffect as Dw,Component as d6}from"react";import*as mr from"react";import{useContext as r5,forwardRef as n5}from"react";var _P=!1;function DP(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 TP(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 NC=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?!_P: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(TP(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=DP(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 go="-ms-",Al="-moz-",st="-webkit-",wd="comm",Hi="rule",Xi="decl";var LC="@import";var Id="@keyframes";var kC="@layer";var $C=Math.abs,Us=String.fromCharCode,jC=Object.assign;function OC(t,e){return Ot(t,0)^45?(((e<<2^Ot(t,0))<<2^Ot(t,1))<<2^Ot(t,2))<<2^Ot(t,3):0}function Sd(t){return t.trim()}function fh(t,e){return(t=e.exec(t))?t[0]:t}function tt(t,e,o){return t.replace(e,o)}function Fl(t,e){return t.indexOf(e)}function Ot(t,e){return t.charCodeAt(e)|0}function Qn(t,e,o){return t.slice(e,o)}function To(t){return t.length}function Ui(t){return t.length}function Yi(t,e){return e.push(t),t}function ph(t,e){return t.map(e).join("")}var Rd=1,Zi=1,MC=0,Ao=0,Ut=0,qi="";function El(t,e,o,n,r,s,i){return{value:t,root:e,parent:o,type:n,props:r,children:s,line:Rd,column:Zi,length:i,return:""}}function Qi(t,e){return jC(El("",null,null,"",null,null,0),t,{length:-t.length},e)}function BC(){return Ut}function VC(){return Ut=Ao>0?Ot(qi,--Ao):0,Zi--,Ut===10&&(Zi=1,Rd--),Ut}function Fo(){return Ut=Ao<MC?Ot(qi,Ao++):0,Zi++,Ut===10&&(Zi=1,Rd++),Ut}function dr(){return Ot(qi,Ao)}function Pl(){return Ao}function Ki(t,e){return Qn(qi,t,e)}function Ji(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 _d(t){return Rd=Zi=1,MC=To(qi=t),Ao=0,[]}function Dd(t){return qi="",t}function ea(t){return Sd(Ki(Ao-1,hh(t===91?t+2:t===40?t+1:t)))}function GC(t){for(;(Ut=dr())&&Ut<33;)Fo();return Ji(t)>2||Ji(Ut)>3?"":" "}function WC(t,e){for(;--e&&Fo()&&!(Ut<48||Ut>102||Ut>57&&Ut<65||Ut>70&&Ut<97););return Ki(t,Pl()+(e<6&&dr()==32&&Fo()==32))}function hh(t){for(;Fo();)switch(Ut){case t:return Ao;case 34:case 39:t!==34&&t!==39&&hh(Ut);break;case 40:t===41&&hh(t);break;case 92:Fo();break}return Ao}function zC(t,e){for(;Fo()&&t+Ut!==57;)if(t+Ut===84&&dr()===47)break;return"/*"+Ki(e,Ao-1)+"*"+Us(t===47?t:Fo())}function HC(t){for(;!Ji(dr());)Fo();return Ki(t,Ao)}function YC(t){return Dd(Td("",null,null,null,[""],t=_d(t),0,[0],t))}function Td(t,e,o,n,r,s,i,l,a){for(var c=0,u=0,d=i,f=0,m=0,h=0,p=1,g=1,b=1,x=0,v="",C=r,y=s,I=n,w=v;g;)switch(h=x,x=Fo()){case 40:if(h!=108&&Ot(w,d-1)==58){Fl(w+=tt(ea(x),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:w+=ea(x);break;case 9:case 10:case 13:case 32:w+=GC(h);break;case 92:w+=WC(Pl()-1,7);continue;case 47:switch(dr()){case 42:case 47:Yi(AP(zC(Fo(),Pl()),e,o),a);break;default:w+="/"}break;case 123*p:l[c++]=To(w)*b;case 125*p:case 59:case 0:switch(x){case 0:case 125:g=0;case 59+u:b==-1&&(w=tt(w,/\f/g,"")),m>0&&To(w)-d&&Yi(m>32?UC(w+";",n,o,d-1):UC(tt(w," ","")+";",n,o,d-2),a);break;case 59:w+=";";default:if(Yi(I=XC(w,e,o,c,u,r,l,v,C=[],y=[],d),s),x===123)if(u===0)Td(w,e,I,I,C,s,d,l,y);else switch(f===99&&Ot(w,3)===110?100:f){case 100:case 108:case 109:case 115:Td(t,I,I,n&&Yi(XC(t,I,I,0,0,r,l,v,r,C=[],d),y),r,y,d,l,n?C:y);break;default:Td(w,I,I,I,[""],y,0,l,y)}}c=u=m=0,p=b=1,v=w="",d=i;break;case 58:d=1+To(w),m=h;default:if(p<1){if(x==123)--p;else if(x==125&&p++==0&&VC()==125)continue}switch(w+=Us(x),x*p){case 38:b=u>0?1:(w+="\f",-1);break;case 44:l[c++]=(To(w)-1)*b,b=1;break;case 64:dr()===45&&(w+=ea(Fo())),f=dr(),u=d=To(v=w+=HC(Pl())),x++;break;case 45:h===45&&To(w)==2&&(p=0)}}return s}function XC(t,e,o,n,r,s,i,l,a,c,u){for(var d=r-1,f=r===0?s:[""],m=Ui(f),h=0,p=0,g=0;h<n;++h)for(var b=0,x=Qn(t,d+1,d=$C(p=i[h])),v=t;b<m;++b)(v=Sd(p>0?f[b]+" "+x:tt(x,/&\f/g,f[b])))&&(a[g++]=v);return El(t,e,o,r===0?Hi:l,a,c,u)}function AP(t,e,o){return El(t,e,o,wd,Us(BC()),Qn(t,2,-2),0)}function UC(t,e,o,n){return El(t,e,o,Xi,Qn(t,0,n),Qn(t,n+1,-1),n)}function Ys(t,e){for(var o="",n=Ui(t),r=0;r<n;r++)o+=e(t[r],r,t,e)||"";return o}function ZC(t,e,o,n){switch(t.type){case kC:if(t.children.length)break;case LC:case Xi:return t.return=t.return||t.value;case wd:return"";case Id:return t.return=t.value+"{"+Ys(t.children,n)+"}";case Hi:t.value=t.props.join(",")}return To(o=Ys(t.children,n))?t.return=t.value+"{"+o+"}":""}function JC(t){var e=Ui(t);return function(o,n,r,s){for(var i="",l=0;l<e;l++)i+=t[l](o,n,r,s)||"";return i}}function qC(t){return function(e){e.root||(e=e.return)&&t(e)}}function QC(t){var e=Object.create(null);return function(o){return e[o]===void 0&&(e[o]=t(o)),e[o]}}var FP=function(e,o,n){for(var r=0,s=0;r=s,s=dr(),r===38&&s===12&&(o[n]=1),!Ji(s);)Fo();return Ki(e,Ao)},EP=function(e,o){var n=-1,r=44;do switch(Ji(r)){case 0:r===38&&dr()===12&&(o[n]=1),e[n]+=FP(Ao-1,o,n);break;case 2:e[n]+=ea(r);break;case 4:if(r===44){e[++n]=dr()===58?"&\f":"",o[n]=e[n].length;break}default:e[n]+=Us(r)}while(r=Fo());return e},PP=function(e,o){return Dd(EP(_d(e),o))},KC=new WeakMap,NP=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&&!KC.get(n))&&!r){KC.set(e,!0);for(var s=[],i=PP(o,s),l=n.props,a=0,c=0;a<i.length;a++)for(var u=0;u<l.length;u++,c++)e.props[c]=s[a]?i[a].replace(/&\f/g,l[u]):l[u]+" "+i[a]}}},LP=function(e){if(e.type==="decl"){var o=e.value;o.charCodeAt(0)===108&&o.charCodeAt(2)===98&&(e.return="",e.value="")}};function ey(t,e){switch(OC(t,e)){case 5103:return st+"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 st+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return st+t+Al+t+go+t+t;case 6828:case 4268:return st+t+go+t+t;case 6165:return st+t+go+"flex-"+t+t;case 5187:return st+t+tt(t,/(\w+).+(:[^]+)/,st+"box-$1$2"+go+"flex-$1$2")+t;case 5443:return st+t+go+"flex-item-"+tt(t,/flex-|-self/,"")+t;case 4675:return st+t+go+"flex-line-pack"+tt(t,/align-content|flex-|-self/,"")+t;case 5548:return st+t+go+tt(t,"shrink","negative")+t;case 5292:return st+t+go+tt(t,"basis","preferred-size")+t;case 6060:return st+"box-"+tt(t,"-grow","")+st+t+go+tt(t,"grow","positive")+t;case 4554:return st+tt(t,/([^-])(transform)/g,"$1"+st+"$2")+t;case 6187:return tt(tt(tt(t,/(zoom-|grab)/,st+"$1"),/(image-set)/,st+"$1"),t,"")+t;case 5495:case 3959:return tt(t,/(image-set\([^]*)/,st+"$1$`$1");case 4968:return tt(tt(t,/(.+:)(flex-)?(.*)/,st+"box-pack:$3"+go+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+st+t+t;case 4095:case 3583:case 4068:case 2532:return tt(t,/(.+)-inline(.+)/,st+"$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(To(t)-1-e>6)switch(Ot(t,e+1)){case 109:if(Ot(t,e+4)!==45)break;case 102:return tt(t,/(.+:)(.+)-([^]+)/,"$1"+st+"$2-$3$1"+Al+(Ot(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Fl(t,"stretch")?ey(tt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Ot(t,e+1)!==115)break;case 6444:switch(Ot(t,To(t)-3-(~Fl(t,"!important")&&10))){case 107:return tt(t,":",":"+st)+t;case 101:return tt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+st+(Ot(t,14)===45?"inline-":"")+"box$3$1"+st+"$2$3$1"+go+"$2box$3")+t}break;case 5936:switch(Ot(t,e+11)){case 114:return st+t+go+tt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return st+t+go+tt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return st+t+go+tt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return st+t+go+t+t}return t}var kP=function(e,o,n,r){if(e.length>-1&&!e.return)switch(e.type){case Xi:e.return=ey(e.value,e.length);break;case Id:return Ys([Qi(e,{value:tt(e.value,"@","@"+st)})],r);case Hi:if(e.length)return ph(e.props,function(s){switch(fh(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ys([Qi(e,{props:[tt(s,/:(read-\w+)/,":"+Al+"$1")]})],r);case"::placeholder":return Ys([Qi(e,{props:[tt(s,/:(plac\w+)/,":"+st+"input-$1")]}),Qi(e,{props:[tt(s,/:(plac\w+)/,":"+Al+"$1")]}),Qi(e,{props:[tt(s,/:(plac\w+)/,go+"input-$1")]})],r)}return""})}},$P=[kP],gh=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||$P,s={},i,l=[];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;l.push(p)});var a,c=[NP,LP];{var u,d=[ZC,qC(function(p){u.insert(p)})],f=JC(c.concat(r,d)),m=function(g){return Ys(YC(g),f)};a=function(g,b,x,v){u=x,m(g?g+"{"+b.styles+"}":b.styles),v&&(h.inserted[b.name]=!0)}}var h={key:o,sheet:new NC({key:o,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:a};return h.sheet.hydrate(l),h};var ZP=!0;function wh(t,e,o){var n="";return o.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):r&&(n+=r+" ")}),n}var Md=function(e,o,n){var r=e.key+"-"+o.name;(n===!1||ZP===!1)&&e.registered[r]===void 0&&(e.registered[r]=o.styles)},Ih=function(e,o,n){Md(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 my(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 fy={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 JP=!1,qP=/[A-Z]|^ms/g,QP=/_EMO_([^_]+?)_([^]*?)_EMO_/g,by=function(e){return e.charCodeAt(1)===45},py=function(e){return e!=null&&typeof e!="boolean"},Sh=QC(function(t){return by(t)?t:t.replace(qP,"-$&").toLowerCase()}),hy=function(e,o){switch(e){case"animation":case"animationName":if(typeof o=="string")return o.replace(QP,function(n,r,s){return Ur={name:r,styles:s,next:Ur},r})}return fy[e]!==1&&!by(e)&&typeof o=="number"&&o!==0?o+"px":o},KP="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function Nl(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 Ur={name:r.name,styles:r.styles,next:Ur},r.name;var s=o;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)Ur={name:i.name,styles:i.styles,next:Ur},i=i.next;var l=s.styles+";";return l}return e5(t,e,o)}case"function":{if(t!==void 0){var a=Ur,c=o(t);return Ur=a,Nl(t,e,c)}break}}var u=o;if(e==null)return u;var d=e[u];return d!==void 0?d:u}function e5(t,e,o){var n="";if(Array.isArray(o))for(var r=0;r<o.length;r++)n+=Nl(t,e,o[r])+";";else for(var s in o){var i=o[s];if(typeof i!="object"){var l=i;e!=null&&e[l]!==void 0?n+=s+"{"+e[l]+"}":py(l)&&(n+=Sh(s)+":"+hy(s,l)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&JP)throw new Error(KP);if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var a=0;a<i.length;a++)py(i[a])&&(n+=Sh(s)+":"+hy(s,i[a])+";");else{var c=Nl(t,e,i);switch(s){case"animation":case"animationName":{n+=Sh(s)+":"+c+";";break}default:n+=s+"{"+c+"}"}}}}return n}var gy=/label:\s*([^\s;{]+)\s*(;|$)/g,Ur;function Bd(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="";Ur=void 0;var s=t[0];if(s==null||s.raw===void 0)n=!1,r+=Nl(o,e,s);else{var i=s;r+=i[0]}for(var l=1;l<t.length;l++)if(r+=Nl(o,e,t[l]),n){var a=s;r+=a[l]}gy.lastIndex=0;for(var c="",u;(u=gy.exec(r))!==null;)c+="-"+u[1];var d=my(r)+c;return{name:d,styles:r,next:Ur}}import*as Vd from"react";var t5=function(e){return e()},o5=Vd.useInsertionEffect?Vd.useInsertionEffect:!1,Rh=o5||t5;var vy=!1,xy=mr.createContext(typeof HTMLElement<"u"?gh({key:"css"}):null),pse=xy.Provider;var Cy=function(e){return n5(function(o,n){var r=r5(xy);return e(o,r,n)})},yy=mr.createContext({});var Gd={}.hasOwnProperty,_h="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",wy=function(e,o){var n={};for(var r in o)Gd.call(o,r)&&(n[r]=o[r]);return n[_h]=e,n},s5=function(e){var o=e.cache,n=e.serialized,r=e.isStringTag;return Md(o,n,r),Rh(function(){return Ih(o,n,r)}),null},i5=Cy(function(t,e,o){var n=t.css;typeof n=="string"&&e.registered[n]!==void 0&&(n=e.registered[n]);var r=t[_h],s=[n],i="";typeof t.className=="string"?i=wh(e.registered,s,t.className):t.className!=null&&(i=t.className+" ");var l=Bd(s,void 0,mr.useContext(yy));i+=e.key+"-"+l.name;var a={};for(var c in t)Gd.call(t,c)&&c!=="css"&&c!==_h&&!vy&&(a[c]=t[c]);return a.className=i,o&&(a.ref=o),mr.createElement(mr.Fragment,null,mr.createElement(s5,{cache:e,serialized:l,isStringTag:typeof r=="string"}),mr.createElement(r,a))}),Iy=i5;import*as ta from"react";var Sse=Is(dy()),Re=function(e,o){var n=arguments;if(o==null||!Gd.call(o,"css"))return ta.createElement.apply(void 0,n);var r=n.length,s=new Array(r);s[0]=Iy,s[1]=wy(e,o);for(var i=2;i<r;i++)s[i]=n[i];return ta.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(Re||(Re={}));function Ll(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return Bd(e)}function Sy(){var t=Ll.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 Ry(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}K_();import{useContext as l5,useRef as Ah,useState as Xd,useMemo as c5,useCallback as Dh,createContext as u5}from"react";import{createPortal as d5}from"react-dom";import{useLayoutEffect as a5}from"react";var Wd=a5;var m5=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],kl=function(){};function f5(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function Dy(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(f5(t,i)));return s.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var oa=function(e){return x5(e)?e.filter(Boolean):Fr(e)==="object"&&e!==null?[e]:[]},Ty=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,m5);return we({},o)},Nt=function(e,o,n){var r=e.cx,s=e.getStyles,i=e.getClassNames,l=e.className;return{css:s(o,e),className:r(n??{},i(o,e),l)}};function $l(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function p5(t){return $l(t)?window.innerHeight:t.clientHeight}function Ay(t){return $l(t)?window.pageYOffset:t.scrollTop}function Ud(t,e){if($l(t)){window.scrollTo(0,e);return}t.scrollTop=e}function h5(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 g5(t,e,o,n){return o*((t=t/n-1)*t*t+1)+e}function zd(t,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:kl,r=Ay(t),s=e-r,i=10,l=0;function a(){l+=i;var c=g5(l,r,s,o);Ud(t,c),l<o?window.requestAnimationFrame(a):n(t)}a()}function Fh(t,e){var o=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=e.offsetHeight/3;n.bottom+r>o.bottom?Ud(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):n.top-r<o.top&&Ud(t,Math.max(e.offsetTop-r,0))}function b5(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 Eh(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Fy(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Ey=!1,v5={get passive(){return Ey=!0}},Hd=typeof window<"u"?window:{};Hd.addEventListener&&Hd.removeEventListener&&(Hd.addEventListener("p",kl,v5),Hd.removeEventListener("p",kl,!1));var Py=Ey;function Ny(t){return t!=null}function x5(t){return Array.isArray(t)}function Zs(t,e,o){return t?e:o}var Ly=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 l=Er(i,1),a=l[0];return!n.includes(a)});return s.reduce(function(i,l){var a=Er(l,2),c=a[0],u=a[1];return i[c]=u,i},{})},C5=["children","innerProps"],y5=["children","innerProps"];function w5(t){var e=t.maxHeight,o=t.menuEl,n=t.minHeight,r=t.placement,s=t.shouldScroll,i=t.isFixedPosition,l=t.controlHeight,a=h5(o),c={placement:"bottom",maxHeight:e};if(!o||!o.offsetParent)return c;var u=a.getBoundingClientRect(),d=u.height,f=o.getBoundingClientRect(),m=f.bottom,h=f.height,p=f.top,g=o.offsetParent.getBoundingClientRect(),b=g.top,x=i?window.innerHeight:p5(a),v=Ay(a),C=parseInt(getComputedStyle(o).marginBottom,10),y=parseInt(getComputedStyle(o).marginTop,10),I=b-y,w=x-p,A=I+v,_=d-v-p,D=m-x+v+C,T=v+p-y,S=160;switch(r){case"auto":case"bottom":if(w>=h)return{placement:"bottom",maxHeight:e};if(_>=h&&!i)return s&&zd(a,D,S),{placement:"bottom",maxHeight:e};if(!i&&_>=n||i&&w>=n){s&&zd(a,D,S);var R=i?w-C:_-C;return{placement:"bottom",maxHeight:R}}if(r==="auto"||i){var E=e,F=i?I:A;return F>=n&&(E=Math.min(F-C-l,e)),{placement:"top",maxHeight:E}}if(r==="bottom")return s&&Ud(a,D),{placement:"bottom",maxHeight:e};break;case"top":if(I>=h)return{placement:"top",maxHeight:e};if(A>=h&&!i)return s&&zd(a,T,S),{placement:"top",maxHeight:e};if(!i&&A>=n||i&&I>=n){var L=e;return(!i&&A>=n||i&&I>=n)&&(L=i?I-y:A-y),s&&zd(a,T,S),{placement:"top",maxHeight:L}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function I5(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var ky=function(e){return e==="auto"?"bottom":e},$y=function(e,o){var n,r=e.placement,s=e.theme,i=s.borderRadius,l=s.spacing,a=s.colors;return we((n={label:"menu"},Xs(n,I5(r),"100%"),Xs(n,"position","absolute"),Xs(n,"width","100%"),Xs(n,"zIndex",1),n),o?{}:{backgroundColor:a.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},jy=u5(null),Oy=function(e){var o=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,i=e.menuPosition,l=e.menuShouldScrollIntoView,a=e.theme,c=l5(jy)||{},u=c.setPortalPlacement,d=Ah(null),f=Xd(r),m=Er(f,2),h=m[0],p=m[1],g=Xd(null),b=Er(g,2),x=b[0],v=b[1],C=a.spacing.controlHeight;return Wd(function(){var y=d.current;if(y){var I=i==="fixed",w=l&&!I,A=w5({maxHeight:r,menuEl:y,minHeight:n,placement:s,shouldScroll:w,isFixedPosition:I,controlHeight:C});p(A.maxHeight),v(A.placement),u?.(A.placement)}},[r,s,i,l,n,u,C]),o({ref:d,placerProps:we(we({},e),{},{placement:x||ky(s),maxHeight:h})})},S5=function(e){var o=e.children,n=e.innerRef,r=e.innerProps;return Re("div",ye({},Nt(e,"menu",{menu:!0}),{ref:n},r),o)},R5=S5,My=function(e,o){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return we({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},o?{}:{paddingBottom:r,paddingTop:r})},_5=function(e){var o=e.children,n=e.innerProps,r=e.innerRef,s=e.isMulti;return Re("div",ye({},Nt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},n),o)},By=function(e,o){var n=e.theme,r=n.spacing.baseUnit,s=n.colors;return we({textAlign:"center"},o?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Vy=By,Gy=By,D5=function(e){var o=e.children,n=o===void 0?"No options":o,r=e.innerProps,s=Vo(e,C5);return Re("div",ye({},Nt(we(we({},s),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},T5=function(e){var o=e.children,n=o===void 0?"Loading...":o,r=e.innerProps,s=Vo(e,y5);return Re("div",ye({},Nt(we(we({},s),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},Wy=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}},A5=function(e){var o=e.appendTo,n=e.children,r=e.controlElement,s=e.innerProps,i=e.menuPlacement,l=e.menuPosition,a=Ah(null),c=Ah(null),u=Xd(ky(i)),d=Er(u,2),f=d[0],m=d[1],h=c5(function(){return{setPortalPlacement:m}},[]),p=Xd(null),g=Er(p,2),b=g[0],x=g[1],v=Dh(function(){if(r){var w=b5(r),A=l==="fixed"?0:window.pageYOffset,_=w[f]+A;(_!==b?.offset||w.left!==b?.rect.left||w.width!==b?.rect.width)&&x({offset:_,rect:w})}},[r,l,f,b?.offset,b?.rect.left,b?.rect.width]);Wd(function(){v()},[v]);var C=Dh(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&a.current&&(c.current=q1(r,a.current,v,{elementResize:"ResizeObserver"in window}))},[r,v]);Wd(function(){C()},[C]);var y=Dh(function(w){a.current=w,C()},[C]);if(!o&&l!=="fixed"||!b)return null;var I=Re("div",ye({ref:y},Nt(we(we({},e),{},{offset:b.offset,position:l,rect:b.rect}),"menuPortal",{"menu-portal":!0}),s),n);return Re(jy.Provider,{value:h},o?d5(I,o):I)},zy=function(e){var o=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:o?"none":void 0,position:"relative"}},F5=function(e){var o=e.children,n=e.innerProps,r=e.isDisabled,s=e.isRtl;return Re("div",ye({},Nt(e,"container",{"--is-disabled":r,"--is-rtl":s}),n),o)},Hy=function(e,o){var n=e.theme.spacing,r=e.isMulti,s=e.hasValue,i=e.selectProps.controlShouldRenderValue;return we({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")})},E5=function(e){var o=e.children,n=e.innerProps,r=e.isMulti,s=e.hasValue;return Re("div",ye({},Nt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),n),o)},Xy=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},P5=function(e){var o=e.children,n=e.innerProps;return Re("div",ye({},Nt(e,"indicatorsContainer",{indicators:!0}),n),o)},_y,N5=["size"],L5=["innerProps","isRtl","size"];var k5={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Uy=function(e){var o=e.size,n=Vo(e,N5);return Re("svg",ye({height:o,width:o,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:k5},n))},Ph=function(e){return Re(Uy,ye({size:20},e),Re("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"}))},Yy=function(e){return Re(Uy,ye({size:20},e),Re("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"}))},Zy=function(e,o){var n=e.isFocused,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return we({label:"indicatorContainer",display:"flex",transition:"color 150ms"},o?{}:{color:n?i.neutral60:i.neutral20,padding:s*2,":hover":{color:n?i.neutral80:i.neutral40}})},Jy=Zy,$5=function(e){var o=e.children,n=e.innerProps;return Re("div",ye({},Nt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),o||Re(Yy,null))},qy=Zy,j5=function(e){var o=e.children,n=e.innerProps;return Re("div",ye({},Nt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),o||Re(Ph,null))},Qy=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return we({label:"indicatorSeparator",alignSelf:"stretch",width:1},o?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:s*2,marginTop:s*2})},O5=function(e){var o=e.innerProps;return Re("span",ye({},o,Nt(e,"indicatorSeparator",{"indicator-separator":!0})))},M5=Sy(_y||(_y=Ry([`
51
51
  0%, 80%, 100% { opacity: 0; }
52
52
  40% { opacity: 1; }
53
- `]))),Ky=function(e,o){var n=e.isFocused,r=e.size,s=e.theme,i=s.colors,l=s.spacing.baseUnit;return we({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:l*2})},Th=function(e){var o=e.delay,n=e.offset;return Re("span",{css:Ll({animation:"".concat(M5," 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"},"","")})},B5=function(e){var o=e.innerProps,n=e.isRtl,r=e.size,s=r===void 0?4:r,i=Vo(e,L5);return Re("div",ye({},Nt(we(we({},i),{},{innerProps:o,isRtl:n,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),o),Re(Th,{delay:0,offset:n}),Re(Th,{delay:160,offset:!0}),Re(Th,{delay:320,offset:!n}))},ew=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.theme,i=s.colors,l=s.borderRadius,a=s.spacing;return we({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.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:l,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},V5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.innerRef,i=e.innerProps,l=e.menuIsOpen;return Re("div",ye({ref:s},Nt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":l}),i,{"aria-disabled":n||void 0}),o)},G5=V5,W5=["data"],tw=function(e,o){var n=e.theme.spacing;return o?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},z5=function(e){var o=e.children,n=e.cx,r=e.getStyles,s=e.getClassNames,i=e.Heading,l=e.headingProps,a=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return Re("div",ye({},Nt(e,"group",{group:!0}),a),Re(i,ye({},l,{selectProps:d,theme:u,getStyles:r,getClassNames:s,cx:n}),c),Re("div",null,o))},ow=function(e,o){var n=e.theme,r=n.colors,s=n.spacing;return we({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"})},H5=function(e){var o=Ty(e);o.data;var n=Vo(o,W5);return Re("div",ye({},Nt(e,"groupHeading",{"group-heading":!0}),n))},X5=z5,U5=["innerRef","isDisabled","isHidden","inputClassName"],rw=function(e,o){var n=e.isDisabled,r=e.value,s=e.theme,i=s.spacing,l=s.colors;return we(we({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},Y5),o?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:l.neutral80})},nw={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Y5={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":we({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},nw)},Z5=function(e){return we({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},nw)},J5=function(e){var o=e.cx,n=e.value,r=Ty(e),s=r.innerRef,i=r.isDisabled,l=r.isHidden,a=r.inputClassName,c=Vo(r,U5);return Re("div",ye({},Nt(e,"input",{"input-container":!0}),{"data-value":n||""}),Re("input",ye({className:o({input:!0},a),ref:s,style:Z5(l),disabled:i},c)))},q5=J5,sw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors;return we({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 we({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})},aw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors,l=e.isFocused;return we({alignItems:"center",display:"flex"},o?{}:{borderRadius:s/2,backgroundColor:l?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},lw=function(e){var o=e.children,n=e.innerProps;return Re("div",n,o)},Q5=lw,K5=lw;function e6(t){var e=t.children,o=t.innerProps;return Re("div",ye({role:"button"},o),e||Re(Ph,{size:14}))}var t6=function(e){var o=e.children,n=e.components,r=e.data,s=e.innerProps,i=e.isDisabled,l=e.removeProps,a=e.selectProps,c=n.Container,u=n.Label,d=n.Remove;return Re(c,{data:r,innerProps:we(we({},Nt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),s),selectProps:a},Re(u,{data:r,innerProps:we({},Nt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},o),Re(d,{data:r,innerProps:we(we({},Nt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(o||"option")},l),selectProps:a}))},o6=t6,cw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.theme,l=i.spacing,a=i.colors;return we({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},o?{}:{backgroundColor:s?a.primary:r?a.primary25:"transparent",color:n?a.neutral20:s?a.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:s?a.primary:a.primary50}})},r6=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.innerRef,l=e.innerProps;return Re("div",ye({},Nt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":s}),{ref:i,"aria-disabled":n},l),o)},n6=r6,uw=function(e,o){var n=e.theme,r=n.spacing,s=n.colors;return we({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},o?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},s6=function(e){var o=e.children,n=e.innerProps;return Re("div",ye({},Nt(e,"placeholder",{placeholder:!0}),n),o)},i6=s6,dw=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing,i=r.colors;return we({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})},a6=function(e){var o=e.children,n=e.isDisabled,r=e.innerProps;return Re("div",ye({},Nt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),o)},l6=a6,no={ClearIndicator:j5,Control:G5,DropdownIndicator:$5,DownChevron:Yy,CrossIcon:Ph,Group:X5,GroupHeading:H5,IndicatorsContainer:P5,IndicatorSeparator:O5,Input:q5,LoadingIndicator:B5,Menu:R5,MenuList:_5,MenuPortal:A5,LoadingMessage:T5,NoOptionsMessage:D5,MultiValue:o6,MultiValueContainer:Q5,MultiValueLabel:K5,MultiValueRemove:e6,Option:n6,Placeholder:i6,SelectContainer:F5,SingleValue:l6,ValueContainer:E5},mw=function(e){return we(we({},no),e.components)};var fw=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function c6(t,e){return!!(t===e||fw(t)&&fw(e))}function u6(t,e){if(t.length!==e.length)return!1;for(var o=0;o<t.length;o++)if(!c6(t[o],e[o]))return!1;return!0}function pw(t,e){e===void 0&&(e=u6);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 m6={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"},f6=function(e){return Re("span",ye({css:m6},e))},hw=f6,p6={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,l=e.selectValue,a=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"&&l)return"value ".concat(i," focused, ").concat(d(l,n),".");if(o==="menu"&&u){var f=a?" 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:"",".")}},h6=function(e){var o=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,i=e.isFocused,l=e.selectValue,a=e.selectProps,c=e.id,u=e.isAppleDevice,d=a.ariaLiveMessages,f=a.getOptionLabel,m=a.inputValue,h=a.isMulti,p=a.isOptionDisabled,g=a.isSearchable,b=a.menuIsOpen,x=a.options,v=a.screenReaderStatus,C=a.tabSelectsValue,y=a.isLoading,I=a["aria-label"],w=a["aria-live"],A=jl(function(){return we(we({},p6),d||{})},[d]),_=jl(function(){var F="";if(o&&A.onChange){var L=o.option,k=o.options,N=o.removedValue,P=o.removedValues,j=o.value,V=function(ee){return Array.isArray(ee)?null:ee},M=N||L||V(j),O=M?f(M):"",B=k||P||void 0,G=B?B.map(f):[],Y=we({isDisabled:M&&p(M,l),label:O,labels:G},o);F=A.onChange(Y)}return F},[o,A,p,l,f]),D=jl(function(){var F="",L=n||r,k=!!(n&&l&&l.includes(n));if(L&&A.onFocus){var N={focused:L,label:f(L),isDisabled:p(L,l),isSelected:k,options:s,context:L===n?"menu":"value",selectValue:l,isAppleDevice:u};F=A.onFocus(N)}return F},[n,r,f,p,A,s,l,u]),T=jl(function(){var F="";if(b&&x.length&&!y&&A.onFilter){var L=v({count:s.length});F=A.onFilter({inputValue:m,resultsMessage:L})}return F},[s,m,b,A,x,v,y]),S=o?.action==="initial-input-focus",R=jl(function(){var F="";if(A.guidance){var L=r?"value":b?"menu":"input";F=A.guidance({"aria-label":I,context:L,isDisabled:n&&p(n,l),isMulti:h,isSearchable:g,tabSelectsValue:C,isInitialFocus:S})}return F},[I,n,r,h,p,g,b,A,l,C,S]),E=Re(kh,null,Re("span",{id:"aria-selection"},_),Re("span",{id:"aria-focused"},D),Re("span",{id:"aria-results"},T),Re("span",{id:"aria-guidance"},R));return Re(kh,null,Re(hw,{id:c},S&&E),Re(hw,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!S&&E))},g6=h6,$h=[{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"}],b6=new RegExp("["+$h.map(function(t){return t.letters}).join("")+"]","g"),Tw={};for(Yd=0;Yd<$h.length;Yd++)for(Zd=$h[Yd],Jd=0;Jd<Zd.letters.length;Jd++)Tw[Zd.letters[Jd]]=Zd.base;var Zd,Jd,Yd,Aw=function(e){return e.replace(b6,function(o){return Tw[o]})},v6=pw(Aw),gw=function(e){return e.replace(/^\s+|\s+$/g,"")},x6=function(e){return"".concat(e.label," ").concat(e.value)},C6=function(e){return function(o,n){if(o.data.__isNew__)return!0;var r=we({ignoreCase:!0,ignoreAccents:!0,stringify:x6,trim:!0,matchFrom:"any"},e),s=r.ignoreCase,i=r.ignoreAccents,l=r.stringify,a=r.trim,c=r.matchFrom,u=a?gw(n):n,d=a?gw(l(o)):l(o);return s&&(u=u.toLowerCase(),d=d.toLowerCase()),i&&(u=v6(u),d=Aw(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},y6=["innerRef"];function w6(t){var e=t.innerRef,o=Vo(t,y6),n=Ly(o,"onExited","in","enter","exit","appear");return Re("input",ye({ref:e},n,{css:Ll({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 I6=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function S6(t){var e=t.isEnabled,o=t.onBottomArrive,n=t.onBottomLeave,r=t.onTopArrive,s=t.onTopLeave,i=na(!1),l=na(!1),a=na(0),c=na(null),u=Qn(function(g,b){if(c.current!==null){var x=c.current,v=x.scrollTop,C=x.scrollHeight,y=x.clientHeight,I=c.current,w=b>0,A=C-y-v,_=!1;A>b&&i.current&&(n&&n(g),i.current=!1),w&&l.current&&(s&&s(g),l.current=!1),w&&b>A?(o&&!i.current&&o(g),I.scrollTop=C,_=!0,i.current=!0):!w&&-b>v&&(r&&!l.current&&r(g),I.scrollTop=0,_=!0,l.current=!0),_&&I6(g)}},[o,n,r,s]),d=Qn(function(g){u(g,g.deltaY)},[u]),f=Qn(function(g){a.current=g.changedTouches[0].clientY},[]),m=Qn(function(g){var b=a.current-g.changedTouches[0].clientY;u(g,b)},[u]),h=Qn(function(g){if(g){var b=Py?{passive:!1}:!1;g.addEventListener("wheel",d,b),g.addEventListener("touchstart",f,b),g.addEventListener("touchmove",m,b)}},[m,f,d]),p=Qn(function(g){g&&(g.removeEventListener("wheel",d,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",m,!1))},[m,f,d]);return Dw(function(){if(e){var g=c.current;return h(g),function(){p(g)}}},[e,h,p]),function(g){c.current=g}}var bw=["boxSizing","height","overflow","paddingRight","position"],vw={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function xw(t){t.cancelable&&t.preventDefault()}function Cw(t){t.stopPropagation()}function yw(){var t=this.scrollTop,e=this.scrollHeight,o=t+this.offsetHeight;t===0?this.scrollTop=1:o===e&&(this.scrollTop=t-1)}function ww(){return"ontouchstart"in window||navigator.maxTouchPoints}var Iw=!!(typeof window<"u"&&window.document&&window.document.createElement),Ol=0,ra={capture:!1,passive:!1};function R6(t){var e=t.isEnabled,o=t.accountForScrollbars,n=o===void 0?!0:o,r=na({}),s=na(null),i=Qn(function(a){if(Iw){var c=document.body,u=c&&c.style;if(n&&bw.forEach(function(h){var p=u&&u[h];r.current[h]=p}),n&&Ol<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,m=window.innerWidth-f+d||0;Object.keys(vw).forEach(function(h){var p=vw[h];u&&(u[h]=p)}),u&&(u.paddingRight="".concat(m,"px"))}c&&ww()&&(c.addEventListener("touchmove",xw,ra),a&&(a.addEventListener("touchstart",yw,ra),a.addEventListener("touchmove",Cw,ra))),Ol+=1}},[n]),l=Qn(function(a){if(Iw){var c=document.body,u=c&&c.style;Ol=Math.max(Ol-1,0),n&&Ol<1&&bw.forEach(function(d){var f=r.current[d];u&&(u[d]=f)}),c&&ww()&&(c.removeEventListener("touchmove",xw,ra),a&&(a.removeEventListener("touchstart",yw,ra),a.removeEventListener("touchmove",Cw,ra)))}},[n]);return Dw(function(){if(e){var a=s.current;return i(a),function(){l(a)}}},[e,i,l]),function(a){s.current=a}}var _6=function(e){var o=e.target;return o.ownerDocument.activeElement&&o.ownerDocument.activeElement.blur()},D6={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function T6(t){var e=t.children,o=t.lockEnabled,n=t.captureEnabled,r=n===void 0?!0:n,s=t.onBottomArrive,i=t.onBottomLeave,l=t.onTopArrive,a=t.onTopLeave,c=S6({isEnabled:r,onBottomArrive:s,onBottomLeave:i,onTopArrive:l,onTopLeave:a}),u=R6({isEnabled:o}),d=function(m){c(m),u(m)};return Re(kh,null,o&&Re("div",{onClick:_6,css:D6}),e(d))}var A6={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},F6=function(e){var o=e.name,n=e.onFocus;return Re("input",{required:!0,name:o,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:A6,value:"",onChange:function(){}})},E6=F6;function jh(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 P6(){return jh(/^iPhone/i)}function Fw(){return jh(/^Mac/i)}function N6(){return jh(/^iPad/i)||Fw()&&navigator.maxTouchPoints>1}function L6(){return P6()||N6()}function k6(){return Fw()||L6()}var $6=function(e){return e.label},Oh=function(e){return e.label},Mh=function(e){return e.value},j6=function(e){return!!e.isDisabled},O6={clearIndicator:qy,container:zy,control:ew,dropdownIndicator:Jy,group:tw,groupHeading:ow,indicatorsContainer:Xy,indicatorSeparator:Qy,input:rw,loadingIndicator:Ky,loadingMessage:Gy,menu:$y,menuList:My,menuPortal:Wy,multiValue:sw,multiValueLabel:iw,multiValueRemove:aw,noOptionsMessage:Vy,option:cw,placeholder:uw,singleValue:dw,valueContainer:Hy};var M6={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%)"},B6=4,Ew=4,V6=38,G6=Ew*2,W6={baseUnit:Ew,controlHeight:V6,menuGutter:G6},Nh={borderRadius:B6,colors:M6,spacing:W6},z6={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Eh(),captureMenuScroll:!Eh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:C6(),formatGroupLabel:$6,getOptionLabel:Oh,getOptionValue:Mh,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:j6,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Fy(),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 Sw(t,e,o,n){var r=Lw(t,e,o),s=kw(t,e,o),i=Nw(t,e),l=Qd(t,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:i,value:l,index:n}}function qd(t,e){return t.options.map(function(o,n){if("options"in o){var r=o.options.map(function(i,l){return Sw(t,i,e,l)}).filter(function(i){return _w(t,i)});return r.length>0?{type:"group",data:o,options:r,index:n}:void 0}var s=Sw(t,o,e,n);return _w(t,s)?s:void 0}).filter(Ny)}function Pw(t){return t.reduce(function(e,o){return o.type==="group"?e.push.apply(e,Jn(o.options.map(function(n){return n.data}))):e.push(o.data),e},[])}function Rw(t,e){return t.reduce(function(o,n){return n.type==="group"?o.push.apply(o,Jn(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 H6(t,e){return Pw(qd(t,e))}function _w(t,e){var o=t.inputValue,n=o===void 0?"":o,r=e.data,s=e.isSelected,i=e.label,l=e.value;return(!jw(t)||!s)&&$w(t,{label:i,value:l,data:r},n)}function X6(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 U6(t,e){var o=t.focusedOption;return o&&e.indexOf(o)>-1?o:e[0]}var Lh=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},Nw=function(e,o){return e.getOptionLabel(o)},Qd=function(e,o){return e.getOptionValue(o)};function Lw(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=Qd(t,e);return o.some(function(r){return Qd(t,r)===n})}function $w(t,e,o){return t.filterOption?t.filterOption(e,o):!0}var jw=function(e){var o=e.hideSelectedOptions,n=e.isMulti;return o===void 0?n:o},Y6=1,Ml=function(t){DC(o,t);var e=AC(o);function o(n){var r;if(SC(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=k6(),r.controlRef=null,r.getControlRef=function(a){r.controlRef=a},r.focusedOptionRef=null,r.getFocusedOptionRef=function(a){r.focusedOptionRef=a},r.menuListRef=null,r.getMenuListRef=function(a){r.menuListRef=a},r.inputRef=null,r.getInputRef=function(a){r.inputRef=a},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(a,c){var u=r.props,d=u.onChange,f=u.name;c.name=f,r.ariaOnChange(a,c),d(a,c)},r.setValue=function(a,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(a,{action:c,option:u})},r.selectOption=function(a){var c=r.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,m=r.state.selectValue,h=d&&r.isOptionSelected(a,m),p=r.isOptionDisabled(a,m);if(h){var g=r.getOptionValue(a);r.setValue(m.filter(function(b){return r.getOptionValue(b)!==g}),"deselect-option",a)}else if(!p)d?r.setValue([].concat(Jn(m),[a]),"select-option",a):r.setValue(a,"select-option");else{r.ariaOnChange(a,{action:"select-option",option:a,name:f});return}u&&r.blurInput()},r.removeValue=function(a){var c=r.props.isMulti,u=r.state.selectValue,d=r.getOptionValue(a),f=u.filter(function(h){return r.getOptionValue(h)!==d}),m=Ys(c,f,f[0]||null);r.onChange(m,{action:"remove-value",removedValue:a}),r.focusInput()},r.clearValue=function(){var a=r.state.selectValue;r.onChange(Ys(r.props.isMulti,[],null),{action:"clear",removedValues:a})},r.popValue=function(){var a=r.props.isMulti,c=r.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=Ys(a,d,d[0]||null);u&&r.onChange(f,{action:"pop-value",removedValue:u})},r.getFocusedOptionId=function(a){return Lh(r.state.focusableOptionsWithIds,a)},r.getFocusableOptionsWithIds=function(){return Rw(qd(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return Dy.apply(void 0,[r.props.classNamePrefix].concat(c))},r.getOptionLabel=function(a){return Nw(r.props,a)},r.getOptionValue=function(a){return Qd(r.props,a)},r.getStyles=function(a,c){var u=r.props.unstyled,d=O6[a](c,u);d.boxSizing="border-box";var f=r.props.styles[a];return f?f(d,c):d},r.getClassNames=function(a,c){var u,d;return(u=(d=r.props.classNames)[a])===null||u===void 0?void 0:u.call(d,c)},r.getElementId=function(a){return"".concat(r.state.instancePrefix,"-").concat(a)},r.getComponents=function(){return mw(r.props)},r.buildCategorizedOptions=function(){return qd(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Pw(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(a,c){r.setState({ariaSelection:we({value:a},c)})},r.onMenuMouseDown=function(a){a.button===0&&(a.stopPropagation(),a.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(a){r.blockOptionHover=!1},r.onControlMouseDown=function(a){if(!a.defaultPrevented){var c=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&r.onMenuClose():c&&r.openMenu("first"):(c&&(r.openAfterFocus=!0),r.focusInput()),a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.preventDefault()}},r.onDropdownIndicatorMouseDown=function(a){if(!(a&&a.type==="mousedown"&&a.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"),a.preventDefault()}},r.onClearIndicatorMouseDown=function(a){a&&a.type==="mousedown"&&a.button!==0||(r.clearValue(),a.preventDefault(),r.openAfterFocus=!1,a.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(a){typeof r.props.closeMenuOnScroll=="boolean"?a.target instanceof HTMLElement&&$l(a.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(a)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(a){var c=a.touches,u=c&&c.item(0);u&&(r.initialTouchX=u.clientX,r.initialTouchY=u.clientY,r.userIsDragging=!1)},r.onTouchMove=function(a){var c=a.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(a){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(a.target)&&r.menuListRef&&!r.menuListRef.contains(a.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(a){r.userIsDragging||r.onControlMouseDown(a)},r.onClearIndicatorTouchEnd=function(a){r.userIsDragging||r.onClearIndicatorMouseDown(a)},r.onDropdownIndicatorTouchEnd=function(a){r.userIsDragging||r.onDropdownIndicatorMouseDown(a)},r.handleInputChange=function(a){var c=r.props.inputValue,u=a.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(u,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(a){r.props.onFocus&&r.props.onFocus(a),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(a){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(a),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(a){if(!(r.blockOptionHover||r.state.focusedOption===a)){var c=r.getFocusableOptions(),u=c.indexOf(a);r.setState({focusedOption:a,focusedOptionId:u>-1?r.getFocusedOptionId(a):null})}},r.shouldHideSelectedOptions=function(){return jw(r.props)},r.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),r.focus()},r.onKeyDown=function(a){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,x=c.tabSelectsValue,v=c.openMenuOnFocus,C=r.state,y=C.focusedOption,I=C.focusedValue,w=C.selectValue;if(!p&&!(typeof b=="function"&&(b(a),a.defaultPrevented))){switch(r.blockOptionHover=!0,a.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(I)r.removeValue(I);else{if(!d)return;u?r.popValue():h&&r.clearValue()}break;case"Tab":if(r.isComposing||a.shiftKey||!g||!x||!y||v&&r.isOptionSelected(y,w))return;r.selectOption(y);break;case"Enter":if(a.keyCode===229)break;if(g){if(!y||r.isComposing)return;r.selectOption(y);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(!y)return;r.selectOption(y);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}a.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++Y6),r.state.selectValue=oa(n.value),n.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),l=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=i[l],r.state.focusedOptionId=Lh(s,i[l])}return r}return _C(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&&Fh(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var s=this.props,i=s.isDisabled,l=s.menuIsOpen,a=this.state.isFocused;(a&&!i&&r.isDisabled||a&&l&&!r.menuIsOpen)&&this.focusInput(),a&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!a&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Fh(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,l=i.selectValue,a=i.isFocused,c=this.buildFocusableOptions(),u=r==="first"?0:c.length-1;if(!this.props.isMulti){var d=c.indexOf(l[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(a&&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,l=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=i.indexOf(l);l||(a=-1);var c=i.length-1,u=-1;if(i.length){switch(r){case"previous":a===0?u=0:a===-1?u=c:u=a-1;break;case"next":a>-1&&a<c&&(u=a+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,l=this.getFocusableOptions();if(l.length){var a=0,c=l.indexOf(i);i||(c=-1),r==="up"?a=c>0?c-1:l.length-1:r==="down"?a=(c+1)%l.length:r==="pageup"?(a=c-s,a<0&&(a=0)):r==="pagedown"?(a=c+s,a>l.length-1&&(a=l.length-1)):r==="last"&&(a=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[a])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Nh):we(we({},Nh),this.props.theme):Nh}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,i=this.getStyles,l=this.getClassNames,a=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:l,getValue:a,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 Lw(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return kw(this.props,r,s)}},{key:"filterOption",value:function(r,s){return $w(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:i,selectValue:l})}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,l=r.inputId,a=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,x=this.commonProps,v=l||this.getElementId("input"),C=we(we(we({"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?dt.createElement(h,ye({},x,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,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:a},C)):dt.createElement(w6,ye({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:kl,onFocus:this.onInputFocus,disabled:s,tabIndex:c,inputMode:"none",form:u,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),i=s.MultiValue,l=s.MultiValueContainer,a=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,x=m.placeholder,v=this.state,C=v.selectValue,y=v.focusedValue,I=v.isFocused;if(!this.hasValue()||!h)return b?null:dt.createElement(d,ye({},f,{key:"placeholder",isDisabled:p,isFocused:I,innerProps:{id:this.getElementId("placeholder")}}),x);if(g)return C.map(function(A,_){var D=A===y,T="".concat(r.getOptionLabel(A),"-").concat(r.getOptionValue(A));return dt.createElement(i,ye({},f,{components:{Container:l,Label:a,Remove:c},isFocused:D,isDisabled:p,key:T,index:_,removeProps:{onClick:function(){return r.removeValue(A)},onTouchEnd:function(){return r.removeValue(A)},onMouseDown:function(R){R.preventDefault()}},data:A}),r.formatOptionLabel(A,"value"))});if(b)return null;var w=C[0];return dt.createElement(u,ye({},f,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,i=this.commonProps,l=this.props,a=l.isDisabled,c=l.isLoading,u=this.state.isFocused;if(!this.isClearable()||!s||a||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return dt.createElement(s,ye({},i,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,i=this.commonProps,l=this.props,a=l.isDisabled,c=l.isLoading,u=this.state.isFocused;if(!s||!c)return null;var d={"aria-hidden":"true"};return dt.createElement(s,ye({},i,{innerProps:d,isDisabled:a,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,i=r.IndicatorSeparator;if(!s||!i)return null;var l=this.commonProps,a=this.props.isDisabled,c=this.state.isFocused;return dt.createElement(i,ye({},l,{isDisabled:a,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var i=this.commonProps,l=this.props.isDisabled,a=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return dt.createElement(s,ye({},i,{innerProps:c,isDisabled:l,isFocused:a}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),i=s.Group,l=s.GroupHeading,a=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,x=g.inputValue,v=g.isLoading,C=g.loadingMessage,y=g.minMenuHeight,I=g.maxMenuHeight,w=g.menuIsOpen,A=g.menuPlacement,_=g.menuPosition,D=g.menuPortalTarget,T=g.menuShouldBlockScroll,S=g.menuShouldScrollIntoView,R=g.noOptionsMessage,E=g.onMenuScrollToTop,F=g.onMenuScrollToBottom;if(!w)return null;var L=function(O,B){var G=O.type,Y=O.data,X=O.isDisabled,ee=O.isSelected,q=O.label,z=O.value,re=p===Y,me=X?void 0:function(){return r.onOptionHover(Y)},se=X?void 0:function(){return r.selectOption(Y)},Z="".concat(r.getElementId("option"),"-").concat(B),Q={id:Z,onClick:se,onMouseMove:me,onMouseOver:me,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:ee};return dt.createElement(m,ye({},h,{innerProps:Q,data:Y,isDisabled:X,isSelected:ee,key:Z,label:q,type:G,value:z,isFocused:re,innerRef:re?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(O.data,"menu"))},k;if(this.hasOptions())k=this.getCategorizedOptions().map(function(M){if(M.type==="group"){var O=M.data,B=M.options,G=M.index,Y="".concat(r.getElementId("group"),"-").concat(G),X="".concat(Y,"-heading");return dt.createElement(i,ye({},h,{key:Y,data:O,options:B,Heading:l,headingProps:{id:X,data:M.data},label:r.formatGroupLabel(M.data)}),M.options.map(function(ee){return L(ee,"".concat(G,"-").concat(ee.index))}))}else if(M.type==="option")return L(M,"".concat(M.index))});else if(v){var N=C({inputValue:x});if(N===null)return null;k=dt.createElement(d,h,N)}else{var P=R({inputValue:x});if(P===null)return null;k=dt.createElement(f,h,P)}var j={minMenuHeight:y,maxMenuHeight:I,menuPlacement:A,menuPosition:_,menuShouldScrollIntoView:S},V=dt.createElement(Oy,ye({},h,j),function(M){var O=M.ref,B=M.placerProps,G=B.placement,Y=B.maxHeight;return dt.createElement(a,ye({},h,j,{innerRef:O,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:v,placement:G}),dt.createElement(T6,{captureEnabled:b,onTopArrive:E,onBottomArrive:F,lockEnabled:T},function(X){return dt.createElement(c,ye({},h,{innerRef:function(q){r.getMenuListRef(q),X(q)},innerProps:{role:"listbox","aria-multiselectable":h.isMulti,id:r.getElementId("listbox")},isLoading:v,maxHeight:Y,focusedOption:p}),k)}))});return D||_==="fixed"?dt.createElement(u,ye({},h,{appendTo:D,controlElement:this.controlRef,menuPlacement:A,menuPosition:_}),V):V}},{key:"renderFormField",value:function(){var r=this,s=this.props,i=s.delimiter,l=s.isDisabled,a=s.isMulti,c=s.name,u=s.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!l)return dt.createElement(E6,{name:c,onFocus:this.onValueInputFocus});if(!(!c||l))if(a)if(i){var f=d.map(function(p){return r.getOptionValue(p)}).join(i);return dt.createElement("input",{name:c,type:"hidden",value:f})}else{var m=d.length>0?d.map(function(p,g){return dt.createElement("input",{key:"i-".concat(g),name:c,type:"hidden",value:r.getOptionValue(p)})}):dt.createElement("input",{name:c,type:"hidden",value:""});return dt.createElement("div",null,m)}else{var h=d[0]?this.getOptionValue(d[0]):"";return dt.createElement("input",{name:c,type:"hidden",value:h})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,i=s.ariaSelection,l=s.focusedOption,a=s.focusedValue,c=s.isFocused,u=s.selectValue,d=this.getFocusableOptions();return dt.createElement(g6,ye({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:l,focusedValue:a,isFocused:c,selectValue:u,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,i=r.IndicatorsContainer,l=r.SelectContainer,a=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 dt.createElement(l,ye({},p,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:h}),this.renderLiveRegion(),dt.createElement(s,ye({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:h,menuIsOpen:m}),dt.createElement(a,ye({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),dt.createElement(i,ye({},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,l=s.clearFocusValueOnUpdate,a=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,x=oa(h),v={};if(i&&(h!==i.value||m!==i.options||p!==i.menuIsOpen||g!==i.inputValue)){var C=p?H6(r,x):[],y=p?Rw(qd(r,x),"".concat(f,"-option")):[],I=l?X6(s,x):null,w=U6(s,C),A=Lh(y,w);v={selectValue:x,focusedOption:w,focusedOptionId:A,focusableOptionsWithIds:y,focusedValue:I,clearFocusValueOnUpdate:!1}}var _=a!=null&&r!==i?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},D=c,T=u&&d;return u&&!T&&(D={value:Ys(b,x,x[0]||null),options:x,action:"initial-input-focus"},T=!d),c?.action==="initial-input-focus"&&(D=null),we(we(we({},v),_),{},{prevProps:r,ariaSelection:D,prevWasFocused:T})}}]),o}(d6);Ml.defaultProps=z6;import"react-dom";var J6=Z6(function(t,e){var o=yd(t);return Ow.createElement(Ml,ye({ref:e},o))}),Mw=J6;import*as Ww from"react";import{forwardRef as K6}from"react";import{useMemo as Bw,useCallback as q6}from"react";var Q6=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Vw=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},Bh={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,o,n,r){return!(!e||o.some(function(s){return Vw(e,s,r)})||n.some(function(s){return Vw(e,s,r)}))},getNewOptionData:function(e,o){return{label:o,value:e,__isNew__:!0}}};function Gw(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?Bh.formatCreateLabel:s,l=t.isValidNewOption,a=l===void 0?Bh.isValidNewOption:l,c=t.getNewOptionData,u=c===void 0?Bh.getNewOptionData:c,d=t.onCreateOption,f=t.options,m=f===void 0?[]:f,h=t.onChange,p=Vo(t,Q6),g=p.getOptionValue,b=g===void 0?Mh:g,x=p.getOptionLabel,v=x===void 0?Oh:x,C=p.inputValue,y=p.isLoading,I=p.isMulti,w=p.value,A=p.name,_=Bw(function(){return a(C,oa(w),m,{getOptionValue:b,getOptionLabel:v})?u(C,i(C)):void 0},[i,u,v,b,C,a,m,w]),D=Bw(function(){return(o||!y)&&_?r==="first"?[_].concat(Jn(m)):[].concat(Jn(m),[_]):m},[o,r,y,_,m]),T=q6(function(S,R){if(R.action!=="select-option")return h(S,R);var E=Array.isArray(S)?S:[S];if(E[E.length-1]===_){if(d)d(C);else{var F=u(C,C),L={action:"create-option",name:A,option:F};h(Ys(I,[].concat(Jn(oa(w)),[F]),F),L)}return}h(S,R)},[u,C,I,A,_,d,h,w]);return we(we({},p),{},{options:D,onChange:T})}import"react-dom";var eN=K6(function(t,e){var o=yd(t),n=Gw(o);return Ww.createElement(Ml,ye({ref:e},n))}),zw=eN;import{jsx as Hw}from"react/jsx-runtime";import"react";var Xw="clear-indicator",Vh=t=>{let{clearValue:e,innerProps:{ref:o,...n}}=t;return Hw("div",{className:Xw,ref:typeof o=="string"?null:o,...n,onKeyDown:r=>{r.key==="Enter"&&(e(),r.stopPropagation())},role:"button",tabIndex:0,children:Hw(pt,{className:`${Xw}__icon`})})};import{jsx as Uw}from"react/jsx-runtime";import tN from"react";var Gh=t=>{let{children:e,innerProps:o,selectProps:{customProps:{disableKeyDown:n,disableMouseDown:r}={}}={}}=t;return Uw(tN.Fragment,{children:Uw(no.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 Yw}from"react/jsx-runtime";import"react";var Zw="dropdown-indicator",Wh=t=>{let{innerProps:{ref:e,...o}}=t;return Yw("button",{className:Zw,ref:e,...o,onKeyDown:n=>{n.key==="Enter"&&(n.key=" ")},type:"button",children:Yw(Je,{className:`${Zw}__icon`})})};import{jsx as Jw}from"react/jsx-runtime";import oN from"react";var zh=t=>Jw(oN.Fragment,{children:Jw(no.Input,{...t,"aria-activedescendant":void 0})});import{c as rN}from"react/compiler-runtime";import{jsx as qw}from"react/jsx-runtime";import nN from"react";var Qw="multi-value";function Hh(t,e){return typeof e=="function"?e(t):t.value}var Xh=t=>{let e=rN(26),{className:o,data:n,innerProps:r,isDisabled:s,selectProps:i}=t,l;e[0]!==i?(l=i===void 0?{}:i,e[0]=i,e[1]=l):l=e[1];let{customProps:a,getOptionValue:c,isSortable:u}=l,d;e[2]!==a?(d=a===void 0?{}:a,e[2]=a,e[3]=d):d=e[3];let{disableMouseDown:f}=d,m;e[4]!==n||e[5]!==c?(m=Hh(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:x,setNodeRef:v,transform:C}=Ai(p),y=!s&&u&&"draggable",I=b&&`${Qw}--is-dragging`,w;e[10]!==o||e[11]!==y||e[12]!==I?(w=[Qw,o,y,I].filter(Boolean),e[10]=o,e[11]=y,e[12]=I,e[13]=w):w=e[13];let A=w.join(" "),_;if(e[14]!==g||e[15]!==A||e[16]!==f||e[17]!==r||e[18]!==u||e[19]!==x||e[20]!==t||e[21]!==v||e[22]!==C){let D;e[24]!==f?(D=T=>{f||T.stopPropagation()},e[24]=f,e[25]=D):D=e[25],_=qw(nN.Fragment,{children:qw(no.MultiValue,{...t,className:A,innerProps:{...u?{...g,...x}:{},...r,onMouseDown:D,ref:v,style:u?{transform:C,...g?.style}:{}}})}),e[14]=g,e[15]=A,e[16]=f,e[17]=r,e[18]=u,e[19]=x,e[20]=t,e[21]=v,e[22]=C,e[23]=_}else _=e[23];return _};import{jsx as Kw}from"react/jsx-runtime";import"react";var e2="multi-value-label",Uh=t=>{let{data:e,selectProps:{customProps:{draggableProps:o,editableProps:n}={}}={}}=t,r=`${e2}__text`;return Kw("div",{className:e2,children:Kw(no.MultiValueLabel,{...t,innerProps:{className:r,...n&&n(e,r,t.selectProps)||{},...o||{}}})})};import{c as sN}from"react/compiler-runtime";import{jsx as t2,jsxs as iN}from"react/jsx-runtime";import aN from"react";var Yh="multi-value-remove",Zh=t=>{let e=sN(12),{innerProps:o}=t,{className:n,onClick:r,onTouchEnd:s}=o,[i,l]=aN.useState(!1),{t:a}=$(),c;if(e[0]!==n||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==a){let u=a("general:remove"),d;e[6]!==n?(d=[Yh,n].filter(Boolean),e[6]=n,e[7]=d):d=e[7];let f;e[8]!==r?(f=p=>{l(!1),r(p)},e[8]=r,e[9]=f):f=e[9];let m,h;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),h=()=>l(!1),e[10]=m,e[11]=h):(m=e[10],h=e[11]),c=iN("button",{"aria-label":u,className:d.join(" "),onClick:f,onKeyDown:lN,onMouseDown:cN,onMouseEnter:m,onMouseLeave:h,onTouchEnd:s,type:"button",children:[t2(po,{className:`${Yh}__tooltip`,show:i,children:a("general:remove")}),t2(pt,{className:`${Yh}__icon`})]}),e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=a,e[5]=c}else c=e[5];return c};function lN(t){t.key==="Enter"&&t.stopPropagation()}function cN(t){return t.stopPropagation()}import{jsx as o2}from"react/jsx-runtime";import uN from"react";var dN="react-select--single-value",Jh=t=>{let{children:e,className:o}=t;return o2(uN.Fragment,{children:o2(no.SingleValue,{...t,className:[dN,o].filter(Boolean).join(" "),children:e})})};import{jsx as r2}from"react/jsx-runtime";import"react";var mN="value-container",qh=t=>{let{selectProps:{customProps:e}={}}=t;return r2("div",{className:mN,ref:e?.droppableRef,children:r2(no.ValueContainer,{...t})})};var hN=t=>({label:t,value:t}),i2=t=>{let{i18n:e,t:o}=$(),[n,r]=s2.useState(""),s=pN(),[i,l]=s2.useState(!1);fN(()=>{l(!0)},[]);let{className:a,components:c,customProps:u,disabled:d=!1,filterOption:f=void 0,getOptionValue:m,isClearable:h=!0,isCreatable:p,isLoading:g,isSearchable:b=!0,noOptionsMessage:x=()=>o("general:noOptions"),numberOnly:v=!1,onChange:C,onMenuClose:y,onMenuOpen:I,options:w,placeholder:A=o("general:selectValue"),showError:_,value:D}=t,T=()=>o("general:loading")+"...",S=[a,"react-select",_&&"react-select--error"].filter(Boolean).join(" "),R={menu:F=>({...F,zIndex:void 0})};if(!i)return Zs(wt,{height:"calc(var(--base) * 2 + 2px)"});if(!p)return Zs(Mw,{captureMenuScroll:!0,customProps:u,isLoading:g,placeholder:n2(A,e),...t,className:S,classNamePrefix:"rs",components:{ClearIndicator:Vh,Control:Gh,DropdownIndicator:Wh,Input:zh,MultiValue:Xh,MultiValueLabel:Uh,MultiValueRemove:Zh,SingleValue:Jh,ValueContainer:qh,...c},filterOption:f,getOptionValue:m,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:T,menuPlacement:"auto",noOptionsMessage:x,onChange:C,onMenuClose:y,onMenuOpen:I,options:w,styles:R,unstyled:!0,value:D});let E=F=>{if(v===!0){let L=["Tab","Escape","Backspace","Enter","ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],k=!/\D/.test(F.key),N=L.includes(F.key);if(!k&&!N){F.preventDefault();return}}if(!(!D||!n||n.trim()==="")&&!(f&&!f(null,n)))switch(F.key){case"Enter":case"Tab":C([...D,hN(n)]),r(""),F.preventDefault();break;default:break}};return Zs(zw,{captureMenuScroll:!0,isLoading:g,placeholder:n2(A,e),...t,className:S,classNamePrefix:"rs",components:{ClearIndicator:Vh,Control:Gh,DropdownIndicator:Wh,Input:zh,MultiValue:Xh,MultiValueLabel:Uh,MultiValueRemove:Zh,SingleValue:Jh,ValueContainer:qh,...c},filterOption:f,inputValue:n,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:T,menuPlacement:"auto",noOptionsMessage:x,onChange:C,onInputChange:F=>r(F),onKeyDown:E,onMenuClose:y,onMenuOpen:I,options:w,styles:R,unstyled:!0,value:D})},gN=t=>{let{getOptionValue:e,onChange:o,value:n}=t,r=[];return n&&(r=(Array.isArray(n)?n:[n]).map(s=>Hh(s,e))),Zs(zr,{className:"react-select-container",ids:r,onDragEnd:({moveFromIndex:s,moveToIndex:i})=>{let l=n;n&&Array.isArray(n)&&(l=ju(n,s,i)),o(l)},children:Zs(i2,{...t})})},yt=t=>{let{isMulti:e,isSortable:o}=t;return e&&o?Zs(gN,{...t}):Zs(i2,{...t})};var Bl=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e});var Vl=t=>{let{id:e,onChange:o,options:n,required:r,selectedTimezone:s}=t,{t:i}=$(),l=Bl(n),a=vN(()=>l.find(c=>(typeof c=="string"?c:c.value)===(s||"UTC")),[l,s]);return bN("div",{className:"timezone-picker-wrapper",children:[a2(be,{htmlFor:e,label:`${i("general:timezone")} ${r?"*":""}`,required:r,unstyled:!0}),a2(yt,{className:"timezone-picker",inputId:e,isClearable:!0,isCreatable:!1,onChange:c=>{o&&o(c?.value||"")},options:l,value:a})]})};var u2="date-time-field",CN=t=>{let{field:e,field:{admin:{className:o,date:n,description:r,placeholder:s}={},label:i,localized:l,required:a,timezone:c},path:u,readOnly:d,validate:f}=t,m=n?.pickerAppearance||"default",h=Intl.DateTimeFormat().resolvedOptions().timeZone,{config:p}=W(),{i18n:g}=$(),{dispatchFields:b,setModified:x}=Me(),v=Qh((M,O)=>{if(typeof f=="function")return f(M,{...O,required:a})},[f,a]),{customComponents:{AfterInput:C,BeforeInput:y,Description:I,Error:w,Label:A}={},disabled:_,setValue:D,showError:T,value:S}=Te({path:u,validate:v}),R=u+"_tz",E=Et(([M,O])=>M?.[R]),F=p.admin.timezones.supportedTimezones,L=["dayOnly","default","monthOnly"].includes(m),k=E?.value,N=c2(()=>{if(c&&k&&h&&S){let M=jt.tz(k),O=jt.tz(h),B=new jt(S).withTimeZone(k),G=Rr(B,M);return Rr(G,O).toISOString()}return S},[c,k,S,h]),P=c2(()=>nt(e),[e]),j=Qh(M=>{if(!(d||_))if(c&&k&&M){let O=jt.tz(k);if(L){let B=M.getTimezoneOffset()/60,G=M.getHours()+B;M.setHours(G);let Y=Rr(M,O);D(Y.toISOString()||null)}else{let B=new jt(M),G=Rr(B,O);D(G.toISOString()||null)}}else D(M?.toISOString()||null)},[d,_,c,k,L,D]),V=Qh(M=>{R&&(b({type:"UPDATE",path:R,value:M}),x(!0))},[b,x,R]);return l2("div",{className:[Ce,u2,o,T&&`${u2}--has-error`,(d||_)&&"read-only"].filter(Boolean).join(" "),style:P,children:[Kn(oe,{CustomComponent:A,Fallback:Kn(be,{label:i,localized:l,required:a})}),l2("div",{className:`${Ce}__wrap`,id:`field-${u.replace(/\./g,"__")}`,children:[Kn(oe,{CustomComponent:w,Fallback:Kn(Xe,{path:u,showError:T})}),y,Kn(zi,{...n,onChange:j,overrides:{...n?.overrides},placeholder:xN(s,g),readOnly:d||_,value:N}),c&&F.length>0&&Kn(Vl,{id:`${u}-timezone-picker`,onChange:V,options:F,required:a,selectedTimezone:k}),C]}),Kn(oe,{CustomComponent:I,Fallback:Kn(We,{description:r,path:u})})]})},Gl=Oe(CN);import{jsx as Js,jsxs as d2}from"react/jsx-runtime";import{getTranslation as yN}from"@payloadcms/translations";import{useCallback as wN,useMemo as IN}from"react";var SN=t=>{let{field:e,field:{admin:{autoComplete:o,className:n,description:r,placeholder:s}={},label:i,localized:l,required:a}={},path:c,readOnly:u,validate:d}=t,{i18n:f}=$(),m=wN((A,_)=>{if(typeof d=="function")return d(A,{..._,required:a})},[d,a]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:x}={},disabled:v,setValue:C,showError:y,value:I}=Te({path:c,validate:m}),w=IN(()=>nt(e),[e]);return d2("div",{className:[Ce,"email",n,y&&"error",(u||v)&&"read-only"].filter(Boolean).join(" "),style:w,children:[Js(oe,{CustomComponent:x,Fallback:Js(be,{label:i,localized:l,path:c,required:a})}),d2("div",{className:`${Ce}__wrap`,children:[Js(oe,{CustomComponent:b,Fallback:Js(Xe,{path:c,showError:y})}),p,Js("input",{autoComplete:o,disabled:u||v,id:`field-${c.replace(/\./g,"__")}`,name:c,onChange:C,placeholder:yN(s,f),required:a,type:"email",value:I||""}),h]}),Js(oe,{CustomComponent:g,Fallback:Js(We,{description:r,path:c})})]})},qs=Oe(SN);import{jsx as es,jsxs as Kd}from"react/jsx-runtime";import{getTranslation as LN}from"@payloadcms/translations";import{useMemo as kN}from"react";import{jsx as RN}from"react/jsx-runtime";import{createContext as _N,use as DN}from"react";var m2=_N(!1),f2=({children:t,withinRow:e=!0})=>RN(m2,{value:e,children:t}),p2=()=>DN(m2);import{jsx as TN}from"react/jsx-runtime";import{createContext as AN,use as FN}from"react";var h2=AN(!1),Kh=({children:t,withinTab:e=!0})=>TN(h2,{value:e,children:t}),g2=()=>FN(h2);import{jsx as EN}from"react/jsx-runtime";import{createContext as PN,use as NN}from"react";var b2=PN(!1),v2=({children:t,withinGroup:e=!0})=>EN(b2,{value:e,children:t}),x2=()=>NN(b2);var Pr="group-field",$N=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,hideGutter:s}={},fields:i,label:l},path:a,permissions:c,readOnly:u,schemaPath:d}=t,f=d??o,{i18n:m}=$(),{isWithinCollapsible:h}=Xn(),p=x2(),g=p2(),b=g2(),{customComponents:{AfterInput:x,BeforeInput:v,Description:C,Label:y}={},errorPaths:I}=Te({path:a}),w=zt(),A=I.length,_=w&&A>0,D=!(h||p||g),T=kN(()=>nt(e),[e]);return Kd("div",{className:[Ce,Pr,D&&`${Pr}--top-level`,h&&`${Pr}--within-collapsible`,p&&`${Pr}--within-group`,g&&`${Pr}--within-row`,b&&`${Pr}--within-tab`,!s&&p&&`${Pr}--gutter`,_&&`${Pr}--has-error`,n].filter(Boolean).join(" "),id:`field-${a?.replace(/\./g,"__")}`,style:T,children:[es(v2,{children:Kd("div",{className:`${Pr}__wrap`,children:[!!(y||C||l||_)&&Kd("div",{className:`${Pr}__header`,children:[!!(y||C||l)&&Kd("header",{children:[es(oe,{CustomComponent:y,Fallback:es("h3",{className:`${Pr}__title`,children:es(be,{as:"span",label:LN(l,m),localized:!1,path:a,required:!1})})}),es(oe,{CustomComponent:C,Fallback:es(We,{description:r,path:a})})]}),_&&es(to,{count:A,i18n:m,withMessage:!0})]}),v,es(yo,{fields:i,margins:"small",parentIndexPath:"",parentPath:a,parentSchemaPath:f,permissions:c===!0?c:c?.fields,readOnly:u})]})}),x]})};var Wl=Oe($N);import{c as jN}from"react/compiler-runtime";import{jsx as ON}from"react/jsx-runtime";import{useEffect as MN}from"react";var BN=t=>{let e=jN(12),{disableModifyingForm:o,path:n,value:r}=t,s=o===void 0?!0:o,i;e[0]!==n?(i={path:n},e[0]=n,e[1]=i):i=e[1];let{setValue:l,value:a}=Te(i),c,u;e[2]!==s||e[3]!==l||e[4]!==r?(c=()=>{r!==void 0&&l(r,s)},u=[r,l,s],e[2]=s,e[3]=l,e[4]=r,e[5]=c,e[6]=u):(c=e[5],u=e[6]),MN(c,u);let d=`field-${n?.replace(/\./g,"__")}`,f=a||"",m;return e[7]!==n||e[8]!==l||e[9]!==d||e[10]!==f?(m=ON("input",{id:d,name:n,onChange:l,type:"hidden",value:f}),e[7]=n,e[8]=l,e[9]=d,e[10]=f,e[11]=m):m=e[11],m},zl=Oe(BN);var Tg=ws(tg(),1);import{jsx as ei,jsxs as NL}from"react/jsx-runtime";import{flattenTopLevelFields as LL}from"payload/shared";import{useMemo as _3}from"react";import{jsx as qt,jsxs as Ks}from"react/jsx-runtime";import{getTranslation as Rg}from"@payloadcms/translations";import{hoistQueryParamsToAnd as PL,transformColumnsToPreferences as S3}from"payload/shared";import{Fragment as R3,useCallback as gm,useEffect as _g,useState as xn}from"react";import{c as zN}from"react/compiler-runtime";import{useInsertionEffect as HN,useRef as XN}from"react";function Jt(t){let e=zN(4),o=XN(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]),HN(n,r);let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(...i)=>{let l=i,a=o.current;return a(...l)},e[3]=s):s=e[3],s}import{jsx as F2}from"react/jsx-runtime";import{useRouter as qN,useSearchParams as QN}from"next/navigation.js";import{isNumber as KN,transformColumnsToSearchParams as e9}from"payload/shared";import*as ng from"qs-esm";import t9,{useCallback as Xl,useEffect as o9,useMemo as r9,useRef as n9,useState as E2}from"react";import{jsx as UN}from"react/jsx-runtime";import{createContext as YN,use as ZN}from"react";var _2=YN({}),og=({children:t,...e})=>UN(_2,{value:{isInDrawer:!!e.drawerSlug,...e},children:t}),Yr=()=>{let t=ZN(_2);if(!t)throw new Error("useListDrawerContext must be used within a ListDrawerContextProvider");return t};import*as D2 from"qs-esm";function Nr(t){let e=t.toString();return D2.parse(e,{depth:10,ignoreQueryPrefix:!0})}import{createContext as T2,use as JN}from"react";var rg=T2({}),so=()=>JN(rg),A2=T2(!1);var sg=({children:t,collectionSlug:e,columns:o,data:n,defaultLimit:r,defaultSort:s,listPreferences:i,modifySearchParams:l,onQueryChange:a})=>{"use no memo";let c=qN(),u=QN(),{startRouteTransition:d}=it(),[f,m]=E2(!1),h=r9(()=>Nr(u),[u]),p=n9({});p.current.modified=f;let{onQueryChange:g}=Yr(),[b,x]=E2(()=>l?h:{}),v=Xl(async(D,T)=>{m(T!==void 0?T:!0);let S="page"in D?D.page:b?.page;("where"in D||"search"in D)&&(S="1");let R={columns:"columns"in D?D.columns:b.columns,limit:"limit"in D?D.limit:b?.limit??String(r),page:S,preset:"preset"in D?D.preset:b?.preset,search:"search"in D?D.search:b?.search,sort:"sort"in D?D.sort:b?.sort??s,where:"where"in D?D.where:b?.where};l?d(()=>c.replace(`${ng.stringify({...R,columns:JSON.stringify(R.columns)},{addQueryPrefix:!0})}`)):(typeof g=="function"||typeof a=="function")&&(g||a)(R),x(R)},[b?.columns,b?.limit,b?.page,b?.search,b?.sort,b?.where,b?.preset,d,r,s,l,g,a,c]),C=Xl(async D=>{await v({page:String(D)})},[v]),y=t9.useCallback(async D=>{await v({limit:String(D),page:"1"})},[v]),I=Xl(async D=>{await v({search:D===""?void 0:D})},[v]),w=Xl(async D=>{await v({sort:D})},[v]),A=Xl(async D=>{await v({where:D})},[v]),_=Jt(()=>{let D=!1,T={...b||{}};KN(r)&&!("limit"in b)&&(T.limit=String(r),D=!0),s&&!("sort"in b)&&(T.sort=s,D=!0),o&&i?.columns&&!("columns"in b)&&(T.columns=e9(o),D=!0),D&&(x(T),window.history.replaceState(null,"",`?${ng.stringify({...T,columns:JSON.stringify(T.columns)})}`))});return o9(()=>{l&&_()},[s,r,l,o]),F2(rg,{value:{collectionSlug:e,data:n,handlePageChange:C,handlePerPageChange:y,handleSearchChange:I,handleSortChange:w,handleWhereChange:A,query:b,refineListData:v,setModified:m,...p.current},children:F2(A2,{value:f,children:t})})};import{jsx as s9}from"react/jsx-runtime";import i9,{createContext as a9,useCallback as sa}from"react";var P2=a9(void 0),Dt=()=>{let t=i9.use(P2);if(t===void 0)throw new Error("useServerFunctions must be used within a ServerFunctionsProvider");return t},ig=({children:t,serverFunction:e})=>{if(!e)throw new Error("ServerFunctionsProvider requires a serverFunction prop");let o=sa(async a=>await e({name:"render-document-slots",args:a}),[e]),n=sa(async a=>{let{signal:c,...u}=a;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=sa(async a=>{let{signal:c,...u}=a||{};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=sa(async a=>{let{signal:c,...u}=a||{};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=sa(async a=>{let{signal:c,...u}=a||{};try{return await e({name:"render-document",args:{fallbackLocale:!1,...u}})}catch(d){console.error(d)}},[e]),l=sa(async a=>{let{signal:c,...u}=a||{};try{let d=await e({name:"copy-data-from-locale",args:u});if(!c?.aborted)return d}catch(d){console.error(d)}},[e]);return s9(P2,{value:{copyDataFromLocale:l,getDocumentSlots:o,getFormState:r,getTableState:s,renderDocument:i,schedulePublish:n,serverFunction:e},children:t})};import{jsx as u9}from"react/jsx-runtime";import{transformColumnsToSearchParams as N2}from"payload/shared";import L2,{startTransition as k2,useCallback as lg,useRef as d9}from"react";import{createContext as l9,use as c9}from"react";var ag=l9({}),ia=()=>c9(ag);var Ul=({children:t,collectionSlug:e,columnState:o,LinkedCellOverride:n})=>{let{getEntityConfig:r}=W(),{query:s,refineListData:i}=so(),{admin:{defaultColumns:l}={}}=r({collectionSlug:e}),[a,c]=L2.useOptimistic(o,(p,g)=>g),u=d9({}),d=lg(async p=>{let g=(a||[]).map(b=>b.accessor===p?{...b,active:!b.active}:b);k2(()=>{c(g)}),await i({columns:N2(g)})},[i,a,c]),f=lg(async p=>{let{fromIndex:g,toIndex:b}=p,x=[...a||[]],[v]=x.splice(g,1);x.splice(b,0,v),k2(()=>{c(x)}),await i({columns:N2(x)})},[a,i,c]),m=lg(async p=>{let g=s.columns;p.forEach(b=>{let x=g.findIndex(v=>b===v);x!==void 0&&g[x][0]==="-"&&(g[x]=b.slice(1))}),await i({columns:g})},[s,i]),h=L2.useCallback(async()=>{await m(l)},[l,m]);return u9(ag,{value:{columns:a,LinkedCellOverride:n,moveColumn:f,resetColumnsState:h,setActiveColumns:m,toggleColumn:d,...u.current},children:t})};import{jsx as Yl}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as m9,fieldIsID as f9}from"payload/shared";import{useId as p9,useMemo as h9}from"react";var cg="column-selector",tm=({collectionSlug:t})=>{let{columns:e,moveColumn:o,toggleColumn:n}=ia(),r=p9(),s=ut(),i=h9(()=>e.filter(l=>!(m9(l.field)&&!f9(l.field))&&!l?.field?.admin?.disableListColumn),[e]);return e?Yl(zr,{className:cg,ids:i.map(l=>l?.accessor),onDragEnd:({moveFromIndex:l,moveToIndex:a})=>{o({fromIndex:l,toIndex:a})},children:i.map((l,a)=>{let{accessor:c,active:u,field:d}=l;return Yl(bt,{alignIcon:"left","aria-checked":u,className:[`${cg}__column`,u&&`${cg}__column--active`].filter(Boolean).join(" "),draggable:!0,icon:u?Yl(pt,{}):Yl(jo,{}),id:c,onClick:()=>{n(c)},children:l.CustomLabel??Yl(be,{label:d&&"label"in d&&d.label,unstyled:!0})},`${t}-${d&&"name"in d?d?.name:a}${s?`-${s}-`:""}${r}`)})}):null};import{c as Y2}from"react/compiler-runtime";import{jsx as nm}from"react/jsx-runtime";import{createElement as E9}from"react";import{useEffect as P9,useId as N9,useState as L9}from"react";import{c as g9}from"react/compiler-runtime";import{useState as b9}from"react";var om=t=>{let e=g9(3),{getEntityConfig:o}=W(),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]=b9(n);return r};import{jsx as H2}from"react/jsx-runtime";import A9,{useCallback as Jl,useEffect as X2,useRef as F9,useState as fg}from"react";import{c as mg}from"react/compiler-runtime";import{jsx as Qs,jsxs as V2}from"react/jsx-runtime";import{getTranslation as I9}from"@payloadcms/translations";import S9 from"react";import{c as x9}from"react/compiler-runtime";import{jsx as C9,jsxs as y9}from"react/jsx-runtime";import O2,{createContext as w9}from"react";import{c as v9}from"react/compiler-runtime";import*as ts from"react";var ug=t=>{let e=v9(13),{delayBeforeShow:o,inTimeout:n,minShowTime:r,outTimeout:s,show:i}=t,l=n+r+s,[a,c]=Nf(o),[u,d]=ts.useState(!1),[f,m]=ts.useState(!1),h=ts.useRef(0),p=ts.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,x,v;e[2]!==a||e[3]!==u||e[4]!==i||e[5]!==l||e[6]!==b?(x=()=>{let y=a&&!u&&i,I=u&&!i;if(y)h.current=Date.now(),d(!0);else if(I){let w=Date.now()-h.current,A=l-w;clearTimeout(p.current),p.current=setTimeout(b,Math.max(0,A))}},v=[u,i,b,l,a],e[2]=a,e[3]=u,e[4]=i,e[5]=l,e[6]=b,e[7]=x,e[8]=v):(x=e[7],v=e[8]),ts.useEffect(x,v);let C;return e[9]!==u||e[10]!==f||e[11]!==c?(C={isMounted:u,isUnmounting:f,triggerDelayedRender:c},e[9]=u,e[10]=f,e[11]=c,e[12]=C):C=e[12],C};var $2={isLoading:!1,loaders:[],loadingText:"",overlayType:null},j2=(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 l=o.findIndex(a=>a.key===r&&a.type===n);o.splice(l,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 dg=250,M2=w9({isOnScreen:!1,toggleLoadingOverlay:void 0}),B2=t=>{let e=x9(21),{children:o}=t,{t:n}=$(),r;e[0]!==n?(r=n("general:loading"),e[0]=n,e[1]=r):r=e[1];let s=r,[i,l]=O2.useReducer(j2,$2),a;e[2]!==i.isLoading?(a={delayBeforeShow:1e3,inTimeout:dg,minShowTime:500,outTimeout:dg,show:i.isLoading},e[2]=i.isLoading,e[3]=a):a=e[3];let{isMounted:c,isUnmounting:u,triggerDelayedRender:d}=ug(a),f;e[4]!==s||e[5]!==d?(f=p=>{let{type:g,isLoading:b,key:x,loadingText:v}=p,C=v===void 0?s:v;b?(d(),l({type:"add",payload:{type:g,key:x,loadingText:C}})):l({type:"remove",payload:{type:g,key:x}})},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&&C9(vn,{animationDuration:`${dg}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=y9(M2,{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},rm=()=>{let t=O2.use(M2);if(t===void 0)throw new Error("useLoadingOverlay must be used within a LoadingOverlayProvider");return t};var Lr="loading-overlay",vn=t=>{let e=mg(11),{animationDuration:o,loadingText:n,overlayType:r,show:s}=t,i=s===void 0?!0:s,{t:l}=$(),a=i?`${Lr}--entering`:`${Lr}--exiting`,c=r?`${Lr}--${r}`:"",u;e[0]!==a||e[1]!==c?(u=[Lr,a,c].filter(Boolean),e[0]=a,e[1]=c,e[2]=u):u=e[2];let d=u.join(" "),f=o||"500ms",m;if(e[3]!==n||e[4]!==l||e[5]!==d||e[6]!==f){let h;e[8]!==n||e[9]!==l?(h=n||l("general:loading"),e[8]=n,e[9]=l,e[10]=h):h=e[10],m=V2("div",{className:d,style:{animationDuration:f},children:[V2("div",{className:`${Lr}__bars`,children:[Qs("div",{className:`${Lr}__bar`}),Qs("div",{className:`${Lr}__bar`}),Qs("div",{className:`${Lr}__bar`}),Qs("div",{className:`${Lr}__bar`}),Qs("div",{className:`${Lr}__bar`})]}),Qs("span",{className:`${Lr}__text`,children:h})]}),e[3]=n,e[4]=l,e[5]=d,e[6]=f,e[7]=m}else m=e[7];return m},G2=t=>{let e=mg(7),{name:o,type:n,loadingText:r,show:s}=t,i=n===void 0?"fullscreen":n,{toggleLoadingOverlay:l}=rm(),a,c;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==l||e[4]!==i?(a=()=>(l({type:i,isLoading:s,key:o,loadingText:r||void 0}),()=>{l({type:i,isLoading:!1,key:o})}),c=[s,l,o,i,r],e[0]=o,e[1]=r,e[2]=s,e[3]=l,e[4]=i,e[5]=a,e[6]=c):(a=e[5],c=e[6]),S9.useEffect(a,c),null},R9=t=>{let e=mg(6),{name:o,type:n,action:r,formIsLoading:s,loadingSuffix:i}=t,l=n===void 0?"fullscreen":n,a=s===void 0?!1:s,c=$o(),{i18n:u,t:d}=$(),m=`${{create:d("general:creating"),loading:d("general:loading"),update:d("general:updating")}[r]} ${i?I9(i,u):""}`,h;return e[0]!==a||e[1]!==c||e[2]!==o||e[3]!==m||e[4]!==l?(h=Qs(G2,{loadingText:m.trim(),name:o,show:a||c,type:l}),e[0]=a,e[1]=c,e[2]=o,e[3]=m,e[4]=l,e[5]=h):h=e[5],h};function Ko(t){if(t)try{t.abort()}catch{}}function er(t){let e=new AbortController;if(t.current)try{t.current.abort()}catch{}return t.current=e,e}import{jsx as _9}from"react/jsx-runtime";import{createContext as D9,use as T9}from"react";var W2=D9({}),z2=({children:t,...e})=>_9(W2,{value:e,children:t}),Zl=()=>{let t=T9(W2);if(!t)throw new Error("useDocumentDrawerContext must be used within a DocumentDrawerProvider");return t};var U2=({id:t,AfterFields:e,collectionSlug:o,disableActions:n,drawerSlug:r,Header:s,initialData:i,onDelete:l,onDuplicate:a,onSave:c,overrideEntityVisibility:u=!0,redirectAfterCreate:d,redirectAfterDelete:f,redirectAfterDuplicate:m})=>{let{getEntityConfig:h}=W(),p=Ee(),[g]=fg(()=>h({collectionSlug:o})),b=A9.useRef(null),{closeModal:x}=de(),{t:v}=$(),{renderDocument:C}=Dt(),[y,I]=fg(void 0),[w,A]=fg(!0),_=F9(!1),D=Jl(F=>{let L=er(b);(async()=>{A(!0);try{let N=await C({collectionSlug:o,disableActions:n,docID:F,drawerSlug:r,initialData:i,locale:p,overrideEntityVisibility:u,redirectAfterCreate:d,redirectAfterDelete:f!==void 0?f:!1,redirectAfterDuplicate:m!==void 0?m:!1,signal:L.signal});N?.Document&&(I(N.Document),A(!1))}catch(N){fe.error(N?.message||v("error:unspecific")),x(r)}b.current=null})()},[o,n,r,i,f,m,C,x,u,v,p]),T=Jl(F=>{D(F.doc.id),typeof c=="function"&&c({...F,collectionConfig:g})},[c,g,D]),S=Jl(F=>{D(F.doc.id),typeof a=="function"&&a({...F,collectionConfig:g})},[a,g,D]),R=Jl(F=>{typeof l=="function"&&l({...F,collectionConfig:g}),x(r)},[l,x,r,g]),E=Jl(()=>{D()},[D]);return X2(()=>{!y&&!_.current&&(D(t),_.current=!0)},[y,D,t]),X2(()=>{let F=b.current;return()=>{Ko(F)}},[]),w?H2(vn,{}):H2(z2,{clearDoc:E,drawerSlug:r,onDelete:R,onDuplicate:S,onSave:T,children:y})};var os="doc-drawer",k9=({id:t,collectionSlug:e,depth:o,uuid:n})=>`doc-drawer_${e}_${o}${t?`_${t}`:""}_${n}`,$9=t=>{let e=Y2(21),o,n,r,s,i,l,a,c;e[0]!==t?({id:l,children:o,className:n,collectionSlug:r,disabled:s,drawerSlug:i,onClick:a,...c}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=l,e[7]=a,e[8]=c):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],l=e[6],a=e[7],c=e[8]);let{t:u}=$(),[d]=om(r),f=l?"general:editLabel":"fields:addNewLabel",m=d?.labels.singular,h;if(e[9]!==o||e[10]!==n||e[11]!==s||e[12]!==i||e[13]!==a||e[14]!==c||e[15]!==u||e[16]!==f||e[17]!==m){let p=u(f,{label:m}),g;e[19]!==n?(g=[n,`${os}__toggler`].filter(Boolean),e[19]=n,e[20]=g):g=e[20],h=nm(ar,{"aria-label":p,className:g.join(" "),disabled:s,onClick:a,slug:i,...c,children:o}),e[9]=o,e[10]=n,e[11]=s,e[12]=i,e[13]=a,e[14]=c,e[15]=u,e[16]=f,e[17]=m,e[18]=h}else h=e[18];return h},j9=t=>{let{drawerSlug:e}=t;return nm(Pt,{className:os,gutter:!1,Header:null,slug:e,children:nm(U2,{...t})})},Yt=t=>{let e=Y2(38),{id:o,collectionSlug:n,overrideEntityVisibility:r}=t,s=ut(),i=N9(),{closeModal:l,modalState:a,openModal:c,toggleModal:u}=de(),[d,f]=L9(!1),m;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==i?(m=k9({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]!==a?(p=()=>{f(!!a[h]?.isOpen)},g=[a,h],e[5]=h,e[6]=a,e[7]=p,e[8]=g):(p=e[7],g=e[8]),P9(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 x=b,v;e[12]!==l||e[13]!==h?(v=()=>{l(h)},e[12]=l,e[13]=h,e[14]=v):v=e[14];let C=v,y;e[15]!==h||e[16]!==c?(y=()=>{c(h)},e[15]=h,e[16]=c,e[17]=y):y=e[17];let I=y,w,A;e[18]!==n||e[19]!==h||e[20]!==o||e[21]!==r?(A=k=>E9(j9,{...k,collectionSlug:n,drawerSlug:h,id:o,key:h,overrideEntityVisibility:r}),e[18]=n,e[19]=h,e[20]=o,e[21]=r,e[22]=A):A=e[22],w=A;let _=w,D,T;e[23]!==n||e[24]!==h||e[25]!==o?(T=k=>nm($9,{...k,collectionSlug:n,drawerSlug:h,id:o}),e[23]=n,e[24]=h,e[25]=o,e[26]=T):T=e[26],D=T;let S=D,R,E;e[27]!==C||e[28]!==h||e[29]!==s||e[30]!==d||e[31]!==I||e[32]!==x?(E={closeDrawer:C,drawerDepth:s,drawerSlug:h,isDrawerOpen:d,openDrawer:I,toggleDrawer:x},e[27]=C,e[28]=h,e[29]=s,e[30]=d,e[31]=I,e[32]=x,e[33]=E):E=e[33],R=E;let F=R,L;return e[34]!==_||e[35]!==F||e[36]!==S?(L=[_,S,F],e[34]=_,e[35]=F,e[36]=S,e[37]=L):L=e[37],L};import{c as O9}from"react/compiler-runtime";import{jsx as M9}from"react/jsx-runtime";import{createContext as B9,use as V9,useEffect as G9,useReducer as W9,useRef as z9}from"react";function Z2(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 J2=B9({}),ql=t=>{let e=O9(15),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=W9(Z2,n),i=Yo(r,100),{config:l}=W(),{routes:a,serverURL:c}=l,{api:u}=a,{i18n:d}=$(),{code:f}=Ee(),m=z9(f),h;e[1]!==u||e[2]!==i||e[3]!==d||e[4]!==f||e[5]!==c?(h=y=>{let I=y===void 0?!1:y;Object.entries(i).forEach(async w=>{let[A,_]=w,D=[];if(Object.entries(_).forEach(T=>{let[S,R]=T;(R===null||I)&&D.push(S)}),D.length>0){let T=`${c}${u}/${A}`,S=new URLSearchParams;if(S.append("depth","0"),S.append("limit","250"),f&&S.append("locale",f),D&&D.length>0){let F=D.map(H9);S.append("where[id][in]",F.join(","))}let R=`?${S.toString()}`,E=await fetch(`${T}${R}`,{credentials:"include",headers:{"Accept-Language":d.language}});if(E.ok){let F=await E.json();F.docs&&s({type:"ADD_LOADED",docs:F.docs,idsToLoad:D,relationTo:A})}else s({type:"ADD_LOADED",docs:[],idsToLoad:D,relationTo:A})}})},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]),G9(g,b);let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=y=>{s({type:"REQUEST",docs:y})},e[11]=x):x=e[11];let v=x,C;return e[12]!==o||e[13]!==r?(C=M9(J2,{value:{documents:r,getRelationships:v},children:o}),e[12]=o,e[13]=r,e[14]=C):C=e[14],C},pg=()=>V9(J2);function H9(t){return String(t)}import{c as SL}from"react/compiler-runtime";import{jsx as pm,jsxs as RL}from"react/jsx-runtime";import"react";import{c as yL}from"react/compiler-runtime";import{jsx as g3}from"react/jsx-runtime";import b3 from"react";import{c as hL}from"react/compiler-runtime";import{jsx as Ql,jsxs as gL}from"react/jsx-runtime";import{getTranslation as bL}from"@payloadcms/translations";import{fieldAffectsData as vL,fieldIsID as xL}from"payload/shared";import CL from"react";import{formatAdminURL as q2}from"payload/shared";import{getTranslation as X9}from"@payloadcms/translations";import U9 from"react";var Q2=(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?U9.isValidElement(n.label)?n.label:X9(n.label,o)||n.value:n}return t};import{jsx as K2}from"react/jsx-runtime";import"react";var sm=({cellData:t,nowrap:e})=>{let o=t?.length>100?`${t.substring(0,100)}\u2026`:t;return K2("code",{className:"code-cell",style:e?{whiteSpace:"nowrap"}:{},children:K2("span",{children:o})})};import{c as Y9}from"react/compiler-runtime";import{jsx as Z9}from"react/jsx-runtime";import{getTranslation as e3}from"@payloadcms/translations";import"react";var t3=t=>{let e=Y9(2),{cellData:o,field:n}=t,{labels:r}=n,{i18n:s}=$(),i=o??[],l=i.length===1?`${i.length} ${e3(r?.singular||s.t("general:rows"),s)}`:`${i.length} ${e3(r?.plural||s.t("general:rows"),s)}`,a;return e[0]!==l?(a=Z9("span",{children:l}),e[0]=l,e[1]=a):a=e[1],a};import{c as J9}from"react/compiler-runtime";import{jsx as q9}from"react/jsx-runtime";import{getTranslation as im}from"@payloadcms/translations";import"react";var o3=t=>{let e=J9(2),{cellData:o,field:n}=t,{blockReferences:r,blocks:s,labels:i}=n,{i18n:l}=$(),{config:a}=W(),c=Array.isArray(o)?o.map(Q9):[],u=(r??s)?.map(h=>{let p=typeof h=="string"?a.blocksMap[h]:h;return{slug:p.slug,label:im(p.labels.singular,l)}}),d=`0 ${im(i?.plural,l)}`,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} ${im(i?.plural,l)} - ${l.t("fields:itemsAndMore",{count:h,items:f(c.slice(0,5))})}`}else c.length>0&&(d=`${c.length} ${im(c.length===1?i?.singular:i?.plural,l)} - ${f(c)}`);let m;return e[0]!==d?(m=q9("span",{children:d}),e[0]=d,e[1]=m):m=e[1],m};function Q9(t){let{blockType:e}=t;return e}import{c as K9}from"react/compiler-runtime";import{jsx as r3}from"react/jsx-runtime";import"react";var n3=t=>{let e=K9(3),{cellData:o}=t,{t:n}=$(),r=`general:${o}`,s;return e[0]!==n||e[1]!==r?(s=r3("code",{className:"bool-cell",children:r3("span",{children:n(r).toLowerCase()})}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};import{c as eL}from"react/compiler-runtime";import{jsx as tL}from"react/jsx-runtime";import"react";var s3=t=>{let e=eL(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:l}=W(),{admin:a}=l,{dateFormat:c}=a,u=i?.displayFormat||c,{i18n:d}=$(),f;e[2]!==o||e[3]!==u||e[4]!==d?(f=o&&pn({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=tL("span",{children:f}),e[6]=f,e[7]=m):m=e[7],m};import{jsx as gg,jsxs as rL,Fragment as nL}from"react/jsx-runtime";import"react";import{c as i3}from"react/compiler-runtime";import{jsx as aa,jsxs as a3}from"react/jsx-runtime";import lm from"react";import{jsx as hg,jsxs as oL}from"react/jsx-runtime";import"react";var am=()=>oL("svg",{height:"150",viewBox:"0 0 150 150",width:"150",xmlns:"http://www.w3.org/2000/svg",children:[hg("rect",{fill:"#333333",height:"150",transform:"translate(0 0.5)",width:"150"}),hg("path",{d:"M82.8876 50.5H55.5555V100.5H94.4444V61.9818H82.8876V50.5Z",fill:"white"}),hg("path",{d:"M82.8876 61.9818H94.4444L82.8876 50.5V61.9818Z",fill:"#9A9A9A"})]});var cm="thumbnail",kr=t=>{let e=i3(18),{className:o,doc:n,fileSrc:r,imageCacheTag:s,size:i}=t,l=o===void 0?"":o,a;e[0]!==n?(a=n===void 0?{}:n,e[0]=n,e[1]=a):a=e[1];let{filename:c,mimeType:u}=a,[d,f]=lm.useState(void 0),m=`${cm}--size-${i||"medium"}`,h;e[2]!==l||e[3]!==m?(h=[cm,m,l],e[2]=l,e[3]=m,e[4]=h):h=e[4];let p=h.join(" "),g,b;e[5]!==r||e[6]!==u?(g=()=>{if(!r||typeof u=="string"&&!u.startsWith("image")){f(!1);return}f(void 0);let C=new Image;C.src=r,C.onload=()=>{f(!0)},C.onerror=()=>{f(!1)}},b=[r,u],e[5]=r,e[6]=u,e[7]=g,e[8]=b):(g=e[7],b=e[8]),lm.useEffect(g,b);let x=null;if(r){let C=r?.includes("?")?"&":"?";x=s?`${r}${C}${encodeURIComponent(s)}`:r}let v;if(e[9]!==p||e[10]!==d||e[11]!==c||e[12]!==x){let C;e[14]!==d||e[15]!==c||e[16]!==x?(C=d&&aa("img",{alt:c,src:x}),e[14]=d,e[15]=c,e[16]=x,e[17]=C):C=e[17],v=a3("div",{className:p,children:[d===void 0&&aa(wt,{height:"100%"}),C,d===!1&&aa(am,{})]}),e[9]=p,e[10]=d,e[11]=c,e[12]=x,e[13]=v}else v=e[13];return v};function l3(t){let e=i3(17),{alt:o,className:n,filename:r,fileSrc:s,imageCacheTag:i,size:l}=t,a=n===void 0?"":n,[c,u]=lm.useState(void 0),d=`${cm}--size-${l||"medium"}`,f;e[0]!==a||e[1]!==d?(f=[cm,d,a],e[0]=a,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 x=new Image;x.src=s,x.onload=()=>{u(!0)},x.onerror=()=>{u(!1)}},p=[s],e[3]=s,e[4]=h,e[5]=p):(h=e[4],p=e[5]),lm.useEffect(h,p);let g="";if(s){let x=s?.includes("?")?"&":"?";g=i?`${s}${x}${encodeURIComponent(i)}`:s}let b;if(e[6]!==o||e[7]!==m||e[8]!==c||e[9]!==r||e[10]!==g){let x;e[12]!==o||e[13]!==c||e[14]!==r||e[15]!==g?(x=c&&aa("img",{alt:o||r,src:g}),e[12]=o,e[13]=c,e[14]=r,e[15]=g,e[16]=x):x=e[16],b=a3("div",{className:m,children:[c===void 0&&aa(wt,{height:"100%"}),x,c===!1&&aa(am,{})]}),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 bg="file",um=40,vg=180,dm=({cellData:t,collectionConfig:e,field:o,rowData:n})=>{if(("displayPreview"in o?o.displayPreview:void 0)??e.upload?.displayPreview??!0){let i=n?.thumbnailURL??n?.url;return n?.url&&!n?.thumbnailURL&&typeof n?.mimeType=="string"&&n?.mimeType.startsWith("image")&&n?.sizes&&(i=Object.values(n.sizes).reduce((c,u)=>!u.width||u.width<um?c:u.width>=um&&u.width<=vg?!c.width||u.width<c.width||c.width<um||c.width>vg?u:c:!c.width||!c.original&&c.width<um&&u.width>c.width||c.width>vg&&u.width<c.width?u:c,{original:!0,url:n?.url,width:n?.width}).url||i),rL("div",{className:bg,children:[gg(kr,{className:`${bg}__thumbnail`,collectionSlug:e?.slug,doc:{...n,filename:t},fileSrc:i,size:"small",uploadConfig:e?.upload}),gg("span",{className:`${bg}__filename`,children:String(t)})]})}else return gg(nL,{children:String(t)})};import{jsx as c3}from"react/jsx-runtime";import"react";var u3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return c3("code",{className:"json-cell",children:c3("span",{children:JSON.stringify(e)})})};import{c as sL}from"react/compiler-runtime";import{jsx as iL,jsxs as m3}from"react/jsx-runtime";import{getTranslation as aL}from"@payloadcms/translations";import lL,{useEffect as f3,useState as p3}from"react";var d3=!!(typeof window<"u"&&window.document&&window.document.createElement);var cL="relationship-cell",mm=3,fm=t=>{let e=sL(40),{cellData:o,customCellProps:n,field:r,field:s}=t,{label:i}=s,l="relationTo"in r&&r.relationTo||"collection"in r&&r.collection,a;a="collection"in r?o?.docs:o;let c=a,{config:u,getEntityConfig:d}=W(),{collections:f,routes:m}=u,[h,p]=an(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];let[b,x]=p3(g),{documents:v,getRelationships:C}=pg(),[y,I]=p3(!1),{i18n:w,t:A}=$(),_=d3?p?.boundingClientRect?.top<window.innerHeight:!1,D;e[1]!==c||e[2]!==C||e[3]!==y||e[4]!==_||e[5]!==l?(D=()=>{if((c||typeof c=="number")&&_&&!y){let F=[],L=Array.isArray(c)?c:[c];L.slice(0,L.length<mm?L.length:mm).forEach(k=>{typeof k=="object"&&"relationTo"in k&&"value"in k&&F.push(k),(typeof k=="number"||typeof k=="string")&&typeof l=="string"&&F.push({relationTo:l,value:k})}),C(F),I(!0),x(F)}},e[1]=c,e[2]=C,e[3]=y,e[4]=_,e[5]=l,e[6]=D):D=e[6];let T;e[7]!==c||e[8]!==f||e[9]!==C||e[10]!==y||e[11]!==_||e[12]!==l||e[13]!==m.api?(T=[c,l,f,_,m.api,y,C],e[7]=c,e[8]=f,e[9]=C,e[10]=y,e[11]=_,e[12]=l,e[13]=m.api,e[14]=T):T=e[14],f3(D,T);let S;e[15]!==y?(S=()=>{y&&I(!1)},e[15]=y,e[16]=S):S=e[16];let R;e[17]!==c?(R=[c],e[17]=c,e[18]=R):R=e[18],f3(S,R);let E;if(e[19]!==c||e[20]!==u.admin.dateFormat||e[21]!==n||e[22]!==v||e[23]!==r||e[24]!==d||e[25]!==w||e[26]!==h||e[27]!==i||e[28]!==A||e[29]!==b){let F;e[31]!==u.admin.dateFormat||e[32]!==n||e[33]!==v||e[34]!==r||e[35]!==d||e[36]!==w||e[37]!==A||e[38]!==b.length?(F=(L,k)=>{let{relationTo:N,value:P}=L,j=v[N][P],V=d({collectionSlug:N}),M=lr({collectionConfig:V,data:j||null,dateFormat:u.admin.dateFormat,fallback:`${A("general:untitled")} - ID: ${P}`,i18n:w}),O=null;return r.type==="upload"&&(("displayPreview"in r?r.displayPreview:void 0)??V.upload?.displayPreview??!0)&&j&&(O=iL(dm,{cellData:M,collectionConfig:V,collectionSlug:V.slug,customCellProps:n,field:r,rowData:j})),m3(lL.Fragment,{children:[j===!1&&`${A("general:untitled")} - ID: ${P}`,j===null&&`${A("general:loading")}...`,j?O||M:null,b.length>k+1&&", "]},k)},e[31]=u.admin.dateFormat,e[32]=n,e[33]=v,e[34]=r,e[35]=d,e[36]=w,e[37]=A,e[38]=b.length,e[39]=F):F=e[39],E=m3("div",{className:cL,ref:h,children:[b.map(F),Array.isArray(c)&&c.length>mm&&A("fields:itemsAndMore",{count:c.length-mm,items:""}),b.length===0&&A("general:noLabel",{label:aL(i||"",w)})]}),e[19]=c,e[20]=u.admin.dateFormat,e[21]=n,e[22]=v,e[23]=r,e[24]=d,e[25]=w,e[26]=h,e[27]=i,e[28]=A,e[29]=b,e[30]=E}else E=e[30];return E};import{c as uL}from"react/compiler-runtime";import{jsx as dL}from"react/jsx-runtime";import{getTranslation as mL}from"@payloadcms/translations";import{optionsAreObjects as fL}from"payload/shared";import"react";var xg=t=>{let e=uL(10),{cellData:o,field:n}=t,{options:r}=n,{i18n:s}=$(),i;e[0]!==s||e[1]!==r?(i=u=>u.map(d=>{let f=r.filter(m=>m.value===d)?.[0]?.label;return mL(f,s)}).join(", "),e[0]=s,e[1]=r,e[2]=i):i=e[2];let l=i,a;if(fL(r)){let u;e[3]!==o||e[4]!==l?(u=Array.isArray(o)?l(o):l([o]),e[3]=o,e[4]=l,e[5]=u):u=e[5],a=u}else{let u;e[6]!==o?(u=Array.isArray(o)?o.join(", "):o,e[6]=o,e[7]=u):u=e[7],a=u}let c;return e[8]!==a?(c=dL("span",{children:a}),e[8]=a,e[9]=c):c=e[9],c};import{jsx as pL}from"react/jsx-runtime";import"react";var h3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return pL("span",{children:e})};var Cg={array:t3,blocks:o3,checkbox:n3,code:sm,date:s3,File:dm,join:fm,json:u3,radio:xg,relationship:fm,select:xg,textarea:h3,upload:fm};var Kl=t=>{let e=hL(14),{cellData:o,className:n,collectionSlug:r,field:s,field:i,link:l,onClick:a,rowData:c}=t,{admin:u}=i,{i18n:d}=$(),{config:f,getEntityConfig:m}=W(),{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]!==l||e[9]!==a||e[10]!==t||e[11]!==c){b=Symbol.for("react.early_return_sentinel");e:{let x=m({collectionSlug:r}),v=u&&"className"in u?u.className:void 0,C=n||(s.admin&&"className"in s.admin?s.admin.className:null)||v,y=a,I="span",w={className:C};if(l&&(w.prefetch=!1,I=Kt,w.href=x?.slug?q2({adminRoute:p,path:`/collections/${x?.slug}/${encodeURIComponent(c.id)}`}):""),typeof y=="function"&&(I="button",w.type="button",w.onClick=()=>{y({cellData:o,collectionSlug:x?.slug,rowData:c})}),xL(s)){b=Ql(I,{...w,children:Ql(sm,{cellData:`ID: ${o}`,collectionConfig:x,collectionSlug:r,field:{...s,type:"code"},nowrap:!0,rowData:c})});break e}let A=Q2(o,s,d),_=typeof o<"u"&&Cg[s.type],D=null;if(CL.isValidElement(A))D=A;else if(_)D=Ql(_,{cellData:o,rowData:c,...t});else if(!_)if(x?.upload&&vL(s)&&s.name==="filename"&&s.type==="text"){let T=Cg.File;D=Ql(T,{cellData:o,rowData:c,...t,collectionConfig:x,field:s})}else{b=gL(I,{...w,children:[(A===""||typeof A>"u"||A===null)&&d.t("general:noLabel",{label:bL(("label"in s?s.label:null)||"data",d)}),typeof A=="string"&&A,typeof A=="number"&&A,typeof A=="object"&&A!==null&&JSON.stringify(A)]});break e}g=Ql(I,{...w,children:D})}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]=l,e[9]=a,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};var wL="default-cell",v3=b3.createContext(null),yg=()=>b3.use(v3),IL=t=>{let e=yL(9),{clientProps:o,columnIndex:n,isLinkedColumn:r}=t,{drawerSlug:s,onSelect:i}=Yr(),{LinkedCellOverride:l}=ia(),a;if(e[0]!==l||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=`${wL}__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}a=g3(v3,{value:c,children:r&&l?l:g3(Kl,{...c})}),e[0]=l,e[1]=o,e[2]=n,e[3]=s,e[4]=r,e[5]=i,e[6]=a}else a=e[6];return a};var x3=t=>{let e=SL(15),{onDrawerDelete:o,onDrawerSave:n}=t,r=yg(),s=r?.rowData.id,i=r?.collectionSlug,l;e[0]!==s||e[1]!==i?(l={id:s,collectionSlug:i},e[0]=s,e[1]=i,e[2]=l):l=e[2];let[a,c,u]=Yt(l),{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]!==a||e[10]!==c||e[11]!==r||e[12]!==p||e[13]!==m?(g=RL("div",{className:"drawer-link",children:[pm(Kl,{...r,className:"drawer-link__cell",link:!1,onClick:null}),pm(c,{children:pm(wr,{})}),pm(a,{onDelete:p,onSave:m})]}),e[9]=a,e[10]=c,e[11]=r,e[12]=p,e[13]=m,e[14]=g):g=e[14],g};import{c as FL}from"react/compiler-runtime";import{jsx as EL}from"react/jsx-runtime";import"react";import{jsx as Sg}from"react/jsx-runtime";import"react";import{jsx as C3}from"react/jsx-runtime";import"react";var wg="clickable-arrow",y3=t=>{let{direction:e="right",isDisabled:o=!1,updatePage:n}=t,r=[wg,o&&`${wg}--is-disabled`,e&&`${wg}--${e}`].filter(Boolean).join(" ");return C3("button",{className:r,disabled:o,onClick:o?void 0:n,type:"button",children:C3(Je,{})})};import{jsx as _L}from"react/jsx-runtime";import"react";var hm="paginator__page",Ig=({isCurrent:t,isFirstPage:e=!1,isLastPage:o=!1,page:n=1,updatePage:r})=>{let s=[hm,t&&`${hm}--is-current`,e&&`${hm}--is-first-page`,o&&`${hm}--is-last-page`].filter(Boolean).join(" ");return _L("button",{className:s,onClick:()=>r(n),type:"button",children:n})};import{jsx as DL}from"react/jsx-runtime";import"react";var w3=()=>DL("span",{className:"paginator__separator",children:"\u2014"});var TL={ClickableArrow:y3,Page:Ig,Separator:w3},AL="paginator",ec=t=>{let{hasNextPage:e=!1,hasPrevPage:o=!1,nextPage:n=null,numberOfNeighbors:r=1,onChange:s,page:i,prevPage:l=null,totalPages:a=null}=t;if(!e&&!o)return null;let c=h=>{typeof s=="function"&&s(h)},u=Array.from({length:a},(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<a&&m.push({type:"Separator"}),f<a&&m.push({type:"Page",props:{isLastPage:!0,page:a,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(l)}}),Sg("div",{className:AL,children:m.map((h,p)=>{if(typeof h=="number")return Sg(Ig,{isCurrent:i===h,page:h,updatePage:c},p);let g=TL[h.type];return Sg(g,{...h.props},p)})})};var I3=()=>{let t=FL(11),{data:e,handlePageChange:o}=so(),n=e.nextPage||2,r;t[0]!==o?(r=a=>{o(a)},t[0]=o,t[1]=r):r=t[1];let s=e.page||1,i=e.prevPage||void 0,l;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?(l=EL(ec,{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]=l):l=t[10],l};var tr="relationship-table",Dg=t=>{let{AfterInput:e,allowCreate:o=!0,BeforeInput:n,disableTable:r=!1,field:s,filterOptions:i,initialData:l,initialDrawerData:a,Label:c,parent:u,relationTo:d}=t,[f,m]=xn(null),{config:h,getEntityConfig:p}=W(),{permissions:g}=Se(),[b]=xn(()=>{if(l)return{...l,docs:Array.isArray(l.docs)?l.docs.reduce((q,z)=>typeof z=="string"?[...q,{id:z}]:[...q,z],[]):[]}}),{i18n:x,t:v}=$(),[C,y]=xn(),[I,w]=xn(!1),[A]=xn(()=>p({collectionSlug:d})),[_,D]=xn(Array.isArray(d)?void 0:d),[T,S]=xn(!r),[R,E]=xn(b),[F,L]=xn(),{getTableState:k}=Dt(),N=gm(async q=>{let z={limit:String(s?.defaultLimit||A?.admin?.pagination?.defaultLimit),sort:s.defaultSort||A?.defaultSort,...C||{},where:{...C?.where||{}}};i&&(z.where=PL(z.where,i));let re=s.admin.defaultColumns?s.admin.defaultColumns.map(Q=>({accessor:Q,active:!0})):void 0,{data:me,state:se,Table:Z}=await k({collectionSlug:d,columns:S3(C?.columns)||re,docs:q,enableRowSelections:!1,parent:u,query:z,renderRowTypes:!0,tableAppearance:"condensed"});E(me),m(Z),L(se),S(!1)},[s.defaultLimit,s.defaultSort,A?.admin?.pagination?.defaultLimit,A?.defaultSort,C,i,k,d,u]),P=Jt((q,z)=>{!z&&(!f||q)&&N()});_g(()=>{P(C,r)},[C,r]);let[j,V,{closeDrawer:M,isDrawerOpen:O,openDrawer:B}]=Yt({collectionSlug:_}),G=gm(q=>{let z=R?.docs?.findIndex(me=>me.id===q.doc.id),re;if(z!==-1){let me=[...R.docs];me[z]=q.doc,re=me}else re=[q.doc,...R.docs];N(re)},[R?.docs,N]),Y=gm(q=>{M(),G(q)},[M,G]),X=gm(q=>{let z=R.docs.filter(re=>re.id!==q.id);N(z)},[R?.docs,N]),ee=o!==!1&&g?.collections?.[Array.isArray(d)?d[0]:d]?.create;return _g(()=>{Array.isArray(d)&&_&&B()},[_,B,d]),_g(()=>{Array.isArray(d)&&!O&&_&&D(void 0)},[O]),Ks("div",{className:tr,children:[Ks("div",{className:`${tr}__header`,children:[c,Ks("div",{className:`${tr}__actions`,children:[!Array.isArray(d)&&ee&&qt(V,{className:`${tr}__add-new`,children:x.t("fields:addNew")}),Array.isArray(d)&&qt(R3,{children:qt(fo,{button:Ks(ae,{buttonStyle:"none",className:`${tr}__add-new-polymorphic`,children:[x.t("fields:addNew"),qt(jo,{})]}),buttonType:"custom",horizontalAlign:"center",render:({close:q})=>qt(Be.ButtonGroup,{children:d.map(z=>g.collections[z].create?qt(Be.Button,{className:`${tr}__relation-button--${z}`,onClick:()=>{q(),D(z)},children:Rg(h.collections.find(re=>re.slug===z).labels.singular,x)},z):null)}),size:"medium"})}),qt(bt,{"aria-controls":`${tr}-columns`,"aria-expanded":I,className:`${tr}__toggle-columns ${I?`${tr}__buttons-active`:""}`,icon:qt(Je,{direction:I?"up":"down"}),onClick:()=>w(!I),pillStyle:"light",children:v("general:columns")})]})]}),n,T?qt("p",{children:v("general:loading")}):Ks(R3,{children:[R?.docs&&R.docs.length===0&&Ks("div",{className:`${tr}__no-results`,children:[qt("p",{children:x.t("general:noResults",{label:Array.isArray(d)?x.t("general:documents"):Rg(A?.labels?.plural,x)})}),ee&&qt(ae,{onClick:B,children:x.t("general:createNewLabel",{label:Rg(A?.labels?.singular,x)})})]}),R?.docs&&R.docs.length>0&&qt(ql,{children:qt(sg,{columns:S3(F),data:R,defaultLimit:s.defaultLimit??A?.admin?.pagination?.defaultLimit,modifySearchParams:!1,onQueryChange:y,children:Ks(Ul,{collectionSlug:Array.isArray(d)?d[0]:d,columnState:F,LinkedCellOverride:qt(x3,{onDrawerDelete:X,onDrawerSave:G}),children:[qt(_r,{className:`${tr}__columns`,height:I?"auto":0,id:`${tr}-columns`,children:qt("div",{className:`${tr}__columns-inner`,children:A&&qt(tm,{collectionSlug:A.slug})})}),f,qt(I3,{})]})})})]}),e,qt(j,{initialData:a,onSave:Y})]})};var D3=Tg.default.default||Tg.default,bm=({collectionSlug:t,config:e,docID:o,fields:n,segments:r})=>{let s=LL(n),i=r[0],l=s.find(c=>c.name===i);if(!l)return null;if(l.type==="relationship"||l.type==="upload"){let c=o;return Array.isArray(l.relationTo)&&(c={relationTo:t,value:o}),{[l.name]:l.hasMany?[c]:c}}let a=r.slice(1,r.length);if(l.type==="tab"||l.type==="group")return{[l.name]:bm({collectionSlug:t,config:e,docID:o,fields:l.fields,segments:a})};if(l.type==="array"){let c=bm({collectionSlug:t,config:e,docID:o,fields:l.fields,segments:a});return c.id=D3().toHexString(),{[l.name]:[c]}}if(l.type==="blocks")for(let c of l.blockReferences??l.blocks){let u=typeof c=="string"?e.blocksMap[c]:c,d=bm({collectionSlug:t,config:e,docID:o,fields:u.fields,segments:a});if(d)return d.id=D3().toHexString(),d.blockType=u.slug,{[l.name]:[d]}}},kL=t=>{let{field:e,field:{admin:{allowCreate:o,description:n},collection:r,label:s,localized:i,on:l,required:a},path:c}=t,{id:u,docConfig:d}=Ae(),{config:f,getEntityConfig:m}=W(),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:x}={},showError:v,value:C}=Te({path:c}),y=_3(()=>{if(!u)return null;let w=u;Array.isArray(e.targetField.relationTo)&&(w={relationTo:d.slug,value:w});let A=Array.isArray(r)?{}:{[l]:{equals:w}};return e.where?{and:[A,e.where]}:A},[u,r,e.targetField.relationTo,e.where,l,d?.slug]),I=_3(()=>{let w=m({collectionSlug:Array.isArray(e.collection)?e.collection[0]:e.collection});return bm({collectionSlug:d?.slug,config:f,docID:u,fields:w.fields,segments:e.on.split(".")})},[m,e.collection,e.on,d?.slug,u,f]);return d?NL("div",{className:[Ce,v&&"error","join"].filter(Boolean).join(" "),id:`field-${c?.replace(/\./g,"__")}`,children:[ei(oe,{CustomComponent:b,Fallback:ei(Xe,{path:c,showError:v})}),ei(Dg,{AfterInput:h,allowCreate:typeof u<"u"&&o,BeforeInput:p,disableTable:y===null,field:e,filterOptions:y,initialData:u&&C?C:{docs:[]},initialDrawerData:I,Label:ei("h4",{style:{margin:0},children:x||ei(be,{label:s,localized:i,path:c,required:a})}),parent:Array.isArray(r)?{id:u,collectionSlug:d.slug,joinPath:c}:void 0,relationTo:r}),ei(oe,{CustomComponent:g,Fallback:ei(We,{description:n,path:c})})]}):null},tc=Oe(kL);import{jsx as ti,jsxs as T3}from"react/jsx-runtime";import $L,{useCallback as Ag,useEffect as jL,useMemo as OL,useState as Fg}from"react";var ML="json-field",BL=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r,maxHeight:s}={},jsonSchema:i,label:l,localized:a,required:c},path:u,readOnly:d,validate:f}=t,[m,h]=Fg(),p=$L.useRef("system"),[g,b]=Fg(""),x=Ag((N,P)=>{if(typeof f=="function")return f(N,{...P,jsonError:m,required:c})},[f,c,m]),{customComponents:{AfterInput:v,BeforeInput:C,Description:y,Error:I,Label:w}={},disabled:A,initialValue:_,setValue:D,showError:T,value:S}=Te({path:u,validate:x}),[R,E]=Fg(()=>(S||_)!==void 0?JSON.stringify(S??_,null,2):void 0),F=Ag((N,P)=>{if(!i)return;P.languages.json.jsonDefaults.setDiagnosticsOptions({enableSchemaRequest:!0,schemas:[...P.languages.json.jsonDefaults.diagnosticsOptions.schemas||[],i],validate:!0});let j=i.uri,V=j.includes("?")?`${j}&${crypto.randomUUID()}`:`${j}?${crypto.randomUUID()}`;N.setModel(P.editor.createModel(JSON.stringify(S,null,2),"json",P.Uri.parse(V)))},[i,S]),L=Ag(N=>{if(!(d||A)){p.current="user";try{D(N?JSON.parse(N):null),h(void 0)}catch(P){D(N||null),h(P)}}},[d,A,D]);jL(()=>{p.current==="system"&&(E((S||_)!==void 0?JSON.stringify(S??_,null,2):void 0),b(new Date().toString())),p.current="system"},[_,S]);let k=OL(()=>nt(e),[e]);return T3("div",{className:[Ce,ML,o,T&&"error",(d||A)&&"read-only"].filter(Boolean).join(" "),style:k,children:[ti(oe,{CustomComponent:w,Fallback:ti(be,{label:l,localized:a,path:u,required:c})}),T3("div",{className:`${Ce}__wrap`,children:[ti(oe,{CustomComponent:I,Fallback:ti(Xe,{message:m,path:u,showError:T})}),C,ti(Il,{defaultLanguage:"json",maxHeight:s,onChange:L,onMount:F,options:r,readOnly:d||A,value:R,wrapperProps:{id:`field-${u?.replace(/\./g,"__")}`}},g),v]}),ti(oe,{CustomComponent:y,Fallback:ti(We,{description:n,path:u})})]})},oc=Oe(BL);import{jsx as Cn,jsxs as A3}from"react/jsx-runtime";import{getTranslation as VL}from"@payloadcms/translations";import{isNumber as GL}from"payload/shared";import{useCallback as Eg,useEffect as WL,useMemo as zL,useState as HL}from"react";var XL=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s=1}={},hasMany:i=!1,label:l,localized:a,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:x}=$(),v=Eg((N,P)=>{if(typeof g=="function")return g(N,{...P,max:c,min:d,required:f})},[g,d,c,f]),{customComponents:{AfterInput:C,BeforeInput:y,Description:I,Error:w,Label:A}={},disabled:_,setValue:D,showError:T,value:S}=Te({path:h,validate:v}),R=Eg(N=>{let P=parseFloat(N.target.value),j=P;Number.isNaN(P)&&(j=null),typeof m=="function"&&m(j),D(j)},[m,D]),[E,F]=HL([]),L=Eg(N=>{if(!(p||_)){let P;N?Array.isArray(N)?P=N.map(j=>Number(j.value?.value||j.value)):P=[Number(N.value?.value||N.value)]:P=[],D(P)}},[p,_,D]);WL(()=>{i&&Array.isArray(S)&&F(S.map((N,P)=>({id:`${N}${P}`,label:`${N}`,value:{toString:()=>`${N}${P}`,value:N?.value||N}})))},[S,i]);let k=zL(()=>nt(e),[e]);return A3("div",{className:[Ce,"number",o,T&&"error",(p||_)&&"read-only",i&&"has-many"].filter(Boolean).join(" "),style:k,children:[Cn(oe,{CustomComponent:A,Fallback:Cn(be,{label:l,localized:a,path:h,required:f})}),A3("div",{className:`${Ce}__wrap`,children:[Cn(oe,{CustomComponent:w,Fallback:Cn(Xe,{path:h,showError:T})}),y,i?Cn(yt,{className:`field-${h.replace(/\./g,"__")}`,disabled:p||_,filterOption:(N,P)=>{let j=Array.isArray(S)&&S.length>=u;return GL(P)&&!j},isClearable:!0,isCreatable:!0,isMulti:!0,isSortable:!0,noOptionsMessage:()=>Array.isArray(S)&&S.length>=u?x("validation:limitReached",{max:u,value:S.length+1}):null,onChange:L,options:[],placeholder:x("general:enterAValue"),showError:T,value:E}):Cn("div",{children:Cn("input",{disabled:p||_,id:`field-${h.replace(/\./g,"__")}`,max:c,min:d,name:h,onChange:R,onWheel:N=>{N.target.blur()},placeholder:VL(r,b),step:s,type:"number",value:typeof S=="number"?S:""})}),C,Cn(oe,{CustomComponent:I,Fallback:Cn(We,{description:n,path:h})})]})]})},rc=Oe(XL);import{jsx as Zr,jsxs as la}from"react/jsx-runtime";import{getTranslation as Pg}from"@payloadcms/translations";import{useCallback as F3,useMemo as UL}from"react";var E3="point",YL=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s}={},label:i,localized:l,required:a},path:c,readOnly:u,validate:d}=t,{i18n:f,t:m}=$(),h=F3((T,S)=>{if(typeof d=="function")return d(T,{...S,required:a})},[d,a]),{customComponents:{AfterInput:p,BeforeInput:g,Description:b,Error:x,Label:v}={},disabled:C,setValue:y,showError:I,value:w=[null,null]}=Te({path:c,validate:h}),A=F3((T,S)=>{let R=parseFloat(T.target.value);Number.isNaN(R)&&(R=T.target.value);let E=[...w];E[S]=R,y(E)},[y,w]),_=T=>{let S=m(T==="longitude"?"fields:longitude":"fields:latitude"),R=i?Pg(i,f):"";return`${R}${R?" - ":""}${S}`},D=UL(()=>nt(e),[e]);return la("div",{className:[Ce,E3,o,I&&"error",(u||C)&&"read-only"].filter(Boolean).join(" "),style:D,children:[la("ul",{className:`${E3}__wrap`,children:[la("li",{children:[Zr(oe,{CustomComponent:v,Fallback:Zr(be,{label:_("longitude"),localized:l,path:c,required:a})}),la("div",{className:"input-wrapper",children:[g,Zr("input",{disabled:u||C,id:`field-longitude-${c?.replace(/\./g,"__")}`,name:`${c}.longitude`,onChange:T=>A(T,0),placeholder:Pg(r,f),step:s,type:"number",value:w&&typeof w[0]=="number"?w[0]:""}),p]})]}),la("li",{children:[Zr(oe,{CustomComponent:v,Fallback:Zr(be,{label:_("latitude"),localized:l,path:c,required:a})}),la("div",{className:"input-wrapper",children:[Zr(oe,{CustomComponent:x,Fallback:Zr(Xe,{path:c,showError:I})}),g,Zr("input",{disabled:u||C,id:`field-latitude-${c?.replace(/\./g,"__")}`,name:`${c}.latitude`,onChange:T=>A(T,1),placeholder:Pg(r,f),step:s,type:"number",value:w&&typeof w[1]=="number"?w[1]:""}),p]})]})]}),Zr(oe,{CustomComponent:b,Fallback:Zr(We,{description:n,path:c})})]})},nc=Oe(YL);import{jsx as yn,jsxs as P3}from"react/jsx-runtime";import{optionIsObject as N3}from"payload/shared";import{useCallback as QL,useMemo as KL}from"react";import{c as ZL}from"react/compiler-runtime";import{jsx as vm,jsxs as JL}from"react/jsx-runtime";import{getTranslation as qL}from"@payloadcms/translations";import"react";var sc="radio-input",ic=t=>{let e=ZL(16),{isSelected:o,onChange:n,option:r,path:s,readOnly:i,uuid:l}=t,{i18n:a}=$(),c=ut(),u=`field-${s}-${r.value}${c>1?`-${c}`:""}${l?`-${l}`:""}`,d=o&&`${sc}--is-selected`,f;e[0]!==d?(f=[sc,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]!==a||e[6]!==u||e[7]!==o||e[8]!==r.label||e[9]!==s||e[10]!==i||e[11]!==m||e[12]!==h){let g=vm("input",{checked:o,disabled:i,id:u,name:s,onChange:h,type:"radio"}),b=i&&`${sc}__styled-radio--disabled`,x;e[14]!==b?(x=[`${sc}__styled-radio`,b].filter(Boolean),e[14]=b,e[15]=x):x=e[15],p=vm("label",{htmlFor:u,children:JL("div",{className:m,children:[g,vm("span",{className:x.join(" ")}),vm("span",{className:`${sc}__label`,children:qL(r.label,a)})]})}),e[5]=a,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 xm="radio-group",ek=t=>{let{disableModifyingForm:e,field:o,field:{admin:{className:n,description:r,layout:s="horizontal"}={},label:i,localized:l,options:a=[],required:c}={},onChange:u,path:d,readOnly:f,validate:m,value:h}=t,{uuid:p}=Me(),g=QL((S,R)=>{if(typeof m=="function")return m(S,{...R,options:a,required:c})},[m,a,c]),{customComponents:{AfterInput:b,BeforeInput:x,Description:v,Error:C,Label:y}={},disabled:I,setValue:w,showError:A,value:_}=Te({path:d,validate:g}),D=_||h,T=KL(()=>nt(o),[o]);return P3("div",{className:[Ce,xm,n,`${xm}--layout-${s}`,A&&"error",(f||I)&&`${xm}--read-only`].filter(Boolean).join(" "),style:T,children:[yn(oe,{CustomComponent:C,Fallback:yn(Xe,{path:d,showError:A})}),yn(oe,{CustomComponent:y,Fallback:yn(be,{label:i,localized:l,path:d,required:c})}),P3("div",{className:`${Ce}__wrap`,children:[x,yn("ul",{className:`${xm}--group`,id:`field-${d.replace(/\./g,"__")}`,children:a.map(S=>{let R="";N3(S)?R=S.value:R=S;let E=String(R)===String(D),F=`field-${d}-${R}${p?`-${p}`:""}`;return yn("li",{children:yn(ic,{id:F,isSelected:E,onChange:()=>{typeof u=="function"&&u(R),f||I||w(R,!!e)},option:N3(S)?S:{label:S,value:S},path:d,readOnly:f||I,uuid:p})},`${d} - ${R}`)})}),b,yn(oe,{CustomComponent:v,Fallback:yn(We,{description:r,path:d})})]})]})},ac=Oe(ek);import{jsx as qr,jsxs as $g}from"react/jsx-runtime";import{dequal as bk}from"dequal/lite";import{wordBoundariesRegex as vk}from"payload/shared";import*as jg from"qs-esm";import{useCallback as rs,useEffect as wm,useMemo as xk,useReducer as Ck,useRef as uc,useState as ns}from"react";import{c as tk}from"react/compiler-runtime";import{jsx as Jr,jsxs as Cm}from"react/jsx-runtime";import{getTranslation as L3}from"@payloadcms/translations";import{Fragment as Ng,useEffect as ym,useState as lc}from"react";var ca="relationship-add-new",k3=t=>{let e=tk(46),{Button:o,hasMany:n,path:r,relationTo:s,setValue:i,unstyled:l,value:a}=t,c=om(s),{permissions:u}=Se(),[d,f]=lc(!1),[m,h]=lc(),p=c.length>1,g;e[0]!==c||e[1]!==p?(g=()=>p?void 0:c[0],e[0]=c,e[1]=p,e[2]=g):g=e[2];let[b,x]=lc(g),[v,C]=lc(!1),{i18n:y,t:I}=$(),[w,A]=lc(!1),_=b?.slug,D;e[3]!==_?(D={collectionSlug:_},e[3]=_,e[4]=D):D=e[4];let[T,S,R]=Yt(D),{isDrawerOpen:E,toggleDrawer:F}=R,L;e[5]!==b?.slug||e[6]!==n||e[7]!==s||e[8]!==i||e[9]!==a?(L=re=>{let{doc:me,operation:se}=re;if(se==="create"){let Z=Array.isArray(s)?{relationTo:b?.slug,value:me.id}:me.id;(Array.isArray(s)&&Array.isArray(a)?!a.some(ge=>ge&&typeof ge=="object"&&ge.value===me.id):a!==me.id)&&i(n?[...Array.isArray(a)?a:[],Z]:Z),h(void 0)}},e[5]=b?.slug,e[6]=n,e[7]=s,e[8]=i,e[9]=a,e[10]=L):L=e[10];let k=L,N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=re=>{C(re)},e[11]=N):N=e[11];let P=N,j,V;e[12]!==u||e[13]!==c?(j=()=>{u&&(c.length===1?f(u.collections[c[0]?.slug]?.create):f(c.some(re=>u.collections[re?.slug]?.create)))},V=[u,c],e[12]=u,e[13]=c,e[14]=j,e[15]=V):(j=e[14],V=e[15]),ym(j,V);let M,O;e[16]!==c||e[17]!==p||e[18]!==m?(O=()=>{p&&m&&x(c.find(re=>re?.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]),ym(O,M);let B,G;e[21]!==b||e[22]!==p||e[23]!==F?(B=()=>{p&&b&&(F(),h(void 0))},G=[F,p,b],e[21]=b,e[22]=p,e[23]=F,e[24]=B,e[25]=G):(B=e[24],G=e[25]),ym(B,G);let Y,X;e[26]!==E||e[27]!==p?(Y=()=>{p&&!E&&x(void 0)},X=[E,p],e[26]=E,e[27]=p,e[28]=Y,e[29]=X):(Y=e[28],X=e[29]),ym(Y,X);let ee=c[0],q=ee.labels.singular,z;if(e[30]!==o||e[31]!==T||e[32]!==S||e[33]!==b||e[34]!==y||e[35]!==k||e[36]!==r||e[37]!==u||e[38]!==v||e[39]!==c||e[40]!==d||e[41]!==w||e[42]!==I||e[43]!==ee.labels.singular||e[44]!==l){z=Symbol.for("react.early_return_sentinel");e:{let re=I("fields:addNewLabel",{label:L3(q,y)});if(d){z=Cm("div",{className:ca,id:`${r}-add-new`,children:[c.length===1&&Cm(Ng,{children:[Jr(S,{className:[`${ca}__add-button`,l&&`${ca}__add-button--unstyled`].filter(Boolean).join(" "),onClick:()=>A(!1),onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:o||Cm(Ng,{children:[Jr(po,{className:`${ca}__tooltip`,show:w,children:re}),Jr(jo,{})]})}),Jr(T,{onSave:k})]}),c.length>1&&Cm(Ng,{children:[Jr(fo,{button:o||Jr(ae,{buttonStyle:"none",className:`${ca}__add-button`,tooltip:v?void 0:I("fields:addNew"),children:Jr(jo,{})}),buttonType:"custom",horizontalAlign:"center",onToggleOpen:P,render:me=>{let{close:se}=me;return Jr(ep,{children:c.map(Z=>u.collections[Z?.slug].create?Jr(tp,{className:`${ca}__relation-button--${Z?.slug}`,onClick:()=>{se(),h(Z?.slug)},children:L3(Z?.labels?.singular,y)},Z?.slug):null)})},size:"medium"}),b&&u.collections[b?.slug]?.create&&Jr(T,{onSave:k})]})]});break e}}e[30]=o,e[31]=T,e[32]=S,e[33]=b,e[34]=y,e[35]=k,e[36]=r,e[37]=u,e[38]=v,e[39]=c,e[40]=d,e[41]=w,e[42]=I,e[43]=ee.labels.singular,e[44]=l,e[45]=z}else z=e[45];return z!==Symbol.for("react.early_return_sentinel")?z:null};import{c as ok}from"react/compiler-runtime";import{useRef as rk}from"react";var Lg=(t,e)=>{let o=ok(3),n=rk(void 0),r;return o[0]!==t||o[1]!==e?(r=(...s)=>{let i=s,l=()=>{clearTimeout(n.current),t(...i)};clearTimeout(n.current),n.current=setTimeout(l,e)},o[0]=t,o[1]=e,o[2]=r):r=o[2],r};var kg=({hasMany:t,relationTo:e,value:o})=>{let n=Array.isArray(e),r;if(Array.isArray(e)?r=e.reduce((i,l)=>({...i,[l]:[]}),{}):r={[e]:[]},o===null)return r;let s=(i,l)=>{(typeof l=="string"||typeof l=="number")&&typeof i=="string"&&(r[i]?r[i].push(l):r[i]=[l])};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 $3=({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(l=>typeof r=="object"?l.value===r.value&&l.relationTo===r.relationTo:r===l.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 nk}from"@payloadcms/translations";var O3=t=>t.reduce((e,o)=>o.options?[...e,...O3(o.options)]:[...e,{id:o.value,relationTo:o.relationTo}],[]),j3=t=>t.sort((e,o)=>typeof e?.label?.localeCompare=="function"&&typeof o?.label?.localeCompare=="function"?e.label.localeCompare(o.label):0),M3=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,config:n,docs:r,i18n:s,ids:i=[],sort:l}=e,a=o.slug,c=O3(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===a).length===0){c.push({id:h.id,relationTo:a});let p=lr({collectionConfig:o,data:h,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${h.id}`,i18n:s});return[...m,{label:p,relationTo:a,value:h.id}]}return m},[]);if(i.forEach(m=>{c.filter(h=>h.id===m&&h.relationTo===a).length===0&&(c.push({id:m,relationTo:a}),f.push({allowEdit:!1,label:`${s.t("general:untitled")} - ID: ${m}`,relationTo:a,value:m}))}),d){let m=[...d.options,...f];d.options=l?j3(m):m}else u.push({label:nk(o.labels.plural,s),options:l?j3(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(l=>l&&i.value===(typeof l=="object"?l.value:l)):!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,l=[...t],a=lr({collectionConfig:o,data:r,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${r.id}`,i18n:s}),u=l.find(d=>d.label===o.labels.plural)?.options?.find(d=>d.value===r.id);return u&&(u.label=a,u.relationTo=i),l}default:return t}};import{c as sk}from"react/compiler-runtime";import{jsx as cc,jsxs as B3}from"react/jsx-runtime";import{Fragment as ik,useState as ak}from"react";var ua="relationship--multi-value-label",V3=t=>{let e=sk(26),{data:o,selectProps:n}=t,{allowEdit:r,label:s,relationTo:i,value:l}=o,a;e[0]!==n?(a=n===void 0?{}:n,e[0]=n,e[1]=a):a=e[1];let{customProps:c}=a,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}=Se(),[h,p]=ak(!1),{t:g}=$(),b=!!m?.collections?.[i]?.read,x;e[4]!==d?(x=d||{},e[4]=d,e[5]=x):x=e[5];let v;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]!==x||e[15]!==l){let C;e[17]!==r||e[18]!==b||e[19]!==s||e[20]!==f||e[21]!==i||e[22]!==h||e[23]!==g||e[24]!==l?(C=i&&b&&r!==!1&&cc(ik,{children:B3("button",{"aria-label":`Edit ${s}`,className:`${ua}__drawer-toggler`,onClick:()=>{p(!1),f({id:l,collectionSlug:i,hasReadPermission:b})},onKeyDown:lk,onMouseDown:ck,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onTouchEnd:uk,type:"button",children:[cc(po,{className:`${ua}__tooltip`,show:h,children:g("general:editLabel",{label:""})}),cc(wr,{className:`${ua}__icon`})]})}),e[17]=r,e[18]=b,e[19]=s,e[20]=f,e[21]=i,e[22]=h,e[23]=g,e[24]=l,e[25]=C):C=e[25],v=B3("div",{className:ua,children:[cc("div",{className:`${ua}__content`,children:cc(no.MultiValueLabel,{...t,innerProps:{className:`${ua}__text`,...x}})}),C]}),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]=x,e[15]=l,e[16]=v}else v=e[16];return v};function lk(t){t.key==="Enter"&&t.stopPropagation()}function ck(t){return t.stopPropagation()}function uk(t){return t.stopPropagation()}import{c as dk}from"react/compiler-runtime";import{jsx as da,jsxs as G3}from"react/jsx-runtime";import{Fragment as mk,useState as fk}from"react";var ma="relationship--single-value",W3=t=>{let e=dk(24),{children:o,data:n,selectProps:r}=t,{allowEdit:s,label:i,relationTo:l,value:a}=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]=fk(!1),{t:p}=$(),{permissions:g}=Se(),b=!!g?.collections?.[l]?.read,x;if(e[4]!==s||e[5]!==o||e[6]!==b||e[7]!==i||e[8]!==f||e[9]!==t||e[10]!==l||e[11]!==m||e[12]!==p||e[13]!==a){let v;e[15]!==s||e[16]!==b||e[17]!==i||e[18]!==f||e[19]!==l||e[20]!==m||e[21]!==p||e[22]!==a?(v=l&&b&&s!==!1&&da(mk,{children:G3("button",{"aria-label":p("general:editLabel",{label:i}),className:`${ma}__drawer-toggler`,onClick:()=>{h(!1),f({id:a,collectionSlug:l,hasReadPermission:b})},onKeyDown:pk,onMouseDown:hk,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onTouchEnd:gk,type:"button",children:[da(po,{className:`${ma}__tooltip`,show:m,children:p("general:edit")}),da(wr,{})]})}),e[15]=s,e[16]=b,e[17]=i,e[18]=f,e[19]=l,e[20]=m,e[21]=p,e[22]=a,e[23]=v):v=e[23],x=da(no.SingleValue,{...t,className:ma,children:da("div",{className:`${ma}__label`,children:G3("div",{className:`${ma}__label-text`,children:[da("div",{className:`${ma}__text`,children:o}),v]})})}),e[4]=s,e[5]=o,e[6]=b,e[7]=i,e[8]=f,e[9]=t,e[10]=l,e[11]=m,e[12]=p,e[13]=a,e[14]=x}else x=e[14];return x};function pk(t){t.key==="Enter"&&t.stopPropagation()}function hk(t){return t.stopPropagation()}function gk(t){return t.stopPropagation()}var yk=10,dc="relationship",wk=t=>{let{field:e,field:{admin:{allowCreate:o=!0,allowEdit:n=!0,className:r,description:s,isSortable:i=!0,sortOptions:l}={},hasMany:a,label:c,localized:u,relationTo:d,required:f},path:m,readOnly:h,validate:p}=t,{config:g,getEntityConfig:b}=W(),{routes:{api:x},serverURL:v}=g,{i18n:C,t:y}=$(),{permissions:I}=Se(),{code:w}=Ee(),A=Array.isArray(d),[_,D]=ns({id:void 0,collectionSlug:void 0,hasReadPermission:!1}),[T,S]=ns(-1),[R,E]=ns({}),[F,L]=ns(""),[k,N]=ns(""),[P,j]=ns(!1),[V,M]=ns(!1),[O,B]=ns(!1),G=uc(!1),Y=rs((ue,ve)=>{if(typeof p=="function")return p(ue,{...ve,required:f})},[p,f]),{customComponents:{AfterInput:X,BeforeInput:ee,Description:q,Error:z,Label:re}={},disabled:me,filterOptions:se,initialValue:Z,setValue:Q,showError:ge,value:Ie}=Te({path:m,validate:Y}),[Fe,Le]=Ck(M3,[]),K=uc(Ie);K.current=Ie;let[_e,,{isDrawerOpen:pe,openDrawer:ce}]=Yt({id:_.id,collectionSlug:_.collectionSlug}),ne=uc(!1),H=rs(async({filterOptions:ue,lastFullyLoadedRelation:ve,lastLoadedPage:Ve,onSuccess:Ge,search:$e,sort:ie,value:J})=>{if(!I)return;let te=typeof ve<"u"?ve:-1,he=Array.isArray(d)?d:[d],Pe=te===-1?he:he.slice(te+1),je=0,Ye=kg({hasMany:a,relationTo:d,value:J});F||(await Pe.reduce(async(Qe,Ze)=>{let _t=ue?.[Ze],_o;if(k!==$e?_o=1:_o=Ve[Ze]+1,await Qe,_t===!1)return S(he.indexOf(Ze)),Promise.resolve();if(je<10){let Ct=b({collectionSlug:Ze}),lo=Ct?.admin?.useAsTitle||"id",co=Ct?.defaultSort||"id";typeof l=="string"?co=l:l?.[Ze]&&(co=l[Ze]);let He={depth:0,draft:!0,limit:yk,locale:w,page:_o,sort:co,where:{and:[{id:{not_in:Ye[Ze]}}]}};$e&&He.where.and.push({[lo]:{like:$e}}),_t&&typeof _t!="boolean"&&He.where.and.push(_t);let uo=await fetch(`${v}${x}/${Ze}`,{body:jg.stringify(He),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(uo.ok){let ko=await uo.json();E(mo=>({...mo,[Ze]:_o})),ko.nextPage||S(he.indexOf(Ze)),ko.docs.length>0&&(je+=ko.docs.length,Le({type:"ADD",collection:Ct,config:g,docs:ko.docs,i18n:C,sort:ie}))}else uo.status===403?(S(he.indexOf(Ze)),Le({type:"ADD",collection:Ct,config:g,docs:[],i18n:C,ids:Ye[Ze],sort:ie})):L(y("error:unspecific"))}},Promise.resolve()),typeof Ge=="function"&&Ge())},[I,d,a,F,k,b,w,v,l,x,C,g,y]),U=Lg((ue,ve)=>{H({filterOptions:se,lastLoadedPage:{},search:ue,sort:!0,value:ve}),N(ue)},300),le=rs((ue,ve)=>{k!==ue&&(E({}),U(ue,ve,ue!==""))},[k,U]),De=Jt(ue=>{let ve=kg({hasMany:a,relationTo:d,value:ue});Object.entries(ve).reduce(async(Ve,[Ge,$e])=>{await Ve;let ie=$e.filter(J=>!Fe.find(te=>te?.options?.find(he=>he.value===J&&he.relationTo===Ge)));if(ie.length>0){let J={depth:0,draft:!0,limit:ie.length,locale:w,where:{id:{in:ie}}};if(!F){let te=await fetch(`${v}${x}/${Ge}`,{body:jg.stringify(J),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"}),he=b({collectionSlug:Ge}),Pe=[];te.ok&&(Pe=(await te.json()).docs),Le({type:"ADD",collection:he,config:g,docs:Pe,i18n:C,ids:ie,sort:!0})}}},Promise.resolve())}),Ne=uc(Ie),qe=uc(!0);wm(()=>{(qe.current||!bk(Ie,Ne.current))&&De(Ie),qe.current=!1,Ne.current=Ie},[Ie]),wm(()=>{let ve=(Array.isArray(d)?d:[d]).reduce((Ve,Ge)=>(b({collectionSlug:Ge})?.admin?.useAsTitle||"id")==="id"&&Ve,!0);M(!ve)},[d,b]);let Ue=Jt(async ue=>await H(ue));wm(()=>{G.current&&O&&(j(!0),Ue({filterOptions:se,lastLoadedPage:{},onSuccess:()=>{G.current=!0,j(!1)},value:K.current})),Le({type:"CLEAR",exemptValues:K.current}),S(-1),E({})},[d,se,w,m,O]);let ke=rs(ue=>{Le({type:"UPDATE",collection:ue.collectionConfig,config:g,doc:ue.doc,i18n:C});let ve=K.current,Ve=ue.doc.id;if(a){let Ge=ve.some(ie=>typeof ie=="string"?ie===Ve:ie.value===Ve),$e=ve.map(ie=>ie.value===Ve?{relationTo:ue.collectionConfig.slug,value:Ve}:ie);Q($e,Ge)}else{let Ge=ve===Ve;Q({relationTo:ue.collectionConfig.slug,value:Ve},Ge)}},[C,g,a,Q]),ot=rs(ue=>{Le({type:"ADD",collection:ue.collectionConfig,config:g,docs:[ue.doc],i18n:C,sort:!0}),Q(a?K.current?K.current.concat({relationTo:ue.collectionConfig.slug,value:ue.doc.id}):null:{relationTo:ue.collectionConfig.slug,value:ue.doc.id})},[C,g,a,Q]),Ft=rs(ue=>{Le({id:ue.id,type:"REMOVE",collection:ue.collectionConfig,config:g,i18n:C}),Q(a&&K.current?K.current.filter(ve=>ve.value!==ue.id):null)},[C,g,a,Q]),Wt=rs((ue,ve)=>{if(!ve)return!0;let Ve=vk(ve||""),Ge=250,$e=String(ue.label);for(;$e.length>Ge;){let ie=$e.indexOf(" ",ve.length);if(Ve.test($e.slice(0,ie===-1?ve.length:ie+1)))return!0;$e=$e.slice(ie===-1?ve.length:ie+1)}return Ve.test($e.slice(-Ge))},[]),mt=rs(({id:ue,collectionSlug:ve,hasReadPermission:Ve})=>{ne.current=!0,D({id:ue,collectionSlug:ve,hasReadPermission:Ve})},[]);wm(()=>{ne.current&&(ce(),ne.current=!1)},[ce,_]);let ze=$3({allowEdit:n,options:Fe,value:Ie});!Array.isArray(ze)&&ze?.value==="null"&&(ze.value=null);let rt=xk(()=>nt(e),[e]);return $g("div",{className:[Ce,dc,r,ge&&"error",F&&"error-loading",(h||me)&&`${dc}--read-only`,!(h||me)&&o&&`${dc}--allow-create`].filter(Boolean).join(" "),id:`field-${m.replace(/\./g,"__")}`,style:rt,children:[qr(oe,{CustomComponent:re,Fallback:qr(be,{label:c,localized:u,path:m,required:f})}),$g("div",{className:`${Ce}__wrap`,children:[qr(oe,{CustomComponent:z,Fallback:qr(Xe,{path:m,showError:ge})}),ee,!F&&$g("div",{className:`${dc}__wrap`,children:[qr(yt,{backspaceRemovesValue:!pe,components:{MultiValueLabel:V3,SingleValue:W3},customProps:{disableKeyDown:pe,disableMouseDown:pe,onDocumentDrawerOpen:mt,onSave:ke},disabled:h||me||pe,filterOption:V?Wt:void 0,getOptionValue:ue=>{if(ue)return a&&Array.isArray(d)?`${ue.relationTo}_${ue.value}`:ue.value},isLoading:P,isMulti:a,isSortable:i,onChange:h||me?void 0:ue=>{ue===null?Q(a?[]:null):a&&Array.isArray(ue)?Q(ue?ue.map(ve=>A?{relationTo:ve.relationTo,value:ve.value}:ve.value):null):A&&!Array.isArray(ue)?Q({relationTo:ue.relationTo,value:ue.value}):Array.isArray(ue)||Q(ue.value)},onInputChange:ue=>le(ue,Ie),onMenuClose:()=>{B(!1)},onMenuOpen:()=>{B(!0),G.current||(j(!0),H({filterOptions:se,lastLoadedPage:{},onSuccess:()=>{G.current=!0,j(!1)},value:Z}))},onMenuScrollToBottom:()=>{H({filterOptions:se,lastFullyLoadedRelation:T,lastLoadedPage:R,search:k,sort:!1,value:Z})},options:Fe,showError:ge,value:ze??null}),!(h||me)&&o&&qr(k3,{hasMany:a,path:m,relationTo:d,setValue:Q,value:Ie})]}),F&&qr("div",{className:`${dc}__error-loading`,children:F}),X,qr(oe,{CustomComponent:q,Fallback:qr(We,{description:s,path:m})})]}),_.collectionSlug&&_.hasReadPermission&&qr(_e,{onDelete:Ft,onDuplicate:ot,onSave:ke})]})},mc=Oe(wk);var fc=()=>null;import{jsx as Og}from"react/jsx-runtime";import"react";var z3="row",Ik=t=>{let{field:{admin:{className:e,style:o}={},fields:n},forceRender:r=!1,indexPath:s="",parentPath:i="",parentSchemaPath:l="",permissions:a,readOnly:c}=t;return Og(f2,{children:Og("div",{className:[Ce,z3,e].filter(Boolean).join(" "),style:o||void 0,children:Og(yo,{className:`${z3}__fields`,fields:n,forceRender:r,margins:!1,parentIndexPath:s,parentPath:i,parentSchemaPath:l,permissions:a,readOnly:c})})})},pc=Oe(Ik);import{jsx as Rk}from"react/jsx-runtime";import _k,{useCallback as X3,useMemo as Dk}from"react";import{c as Sk}from"react/compiler-runtime";import{jsx as oi,jsxs as H3}from"react/jsx-runtime";import{getTranslation as Mg}from"@payloadcms/translations";import"react";var fa=t=>{let e=Sk(39),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:l,hasMany:a,isClearable:c,isSortable:u,label:d,Label:f,localized:m,onChange:h,onInputChange:p,options:g,path:b,readOnly:x,required:v,showError:C,style:y,value:I}=t,w=a===void 0?!1:a,A=c===void 0?!0:c,_=u===void 0?!0:u,{i18n:D}=$(),T;if(e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==l||e[4]!==f||e[5]!==r||e[6]!==i||e[7]!==w||e[8]!==D||e[9]!==A||e[10]!==_||e[11]!==d||e[12]!==m||e[13]!==h||e[14]!==p||e[15]!==g||e[16]!==b||e[17]!==x||e[18]!==v||e[19]!==C||e[20]!==y||e[21]!==I){let S;if(w&&Array.isArray(I)){let k;e[23]!==D||e[24]!==g?(k=N=>{let P=g.find(j=>j.value===N);return{label:P?Mg(P.label,D):N,value:P?.value??N}},e[23]=D,e[24]=g,e[25]=k):k=e[25],S=I.map(k)}else if(I){let k,N;if(e[26]!==D||e[27]!==g||e[28]!==I){let P;e[31]!==I?(P=j=>j.value===I,e[31]=I,e[32]=P):P=e[32],k=g.find(P),N=k?Mg(k.label,D):I,e[26]=D,e[27]=g,e[28]=I,e[29]=k,e[30]=N}else k=e[29],N=e[30];S={label:N,value:k?.value??I}}else S=null;let R=C&&"error",E=x&&"read-only",F;e[33]!==r||e[34]!==R||e[35]!==E?(F=[Ce,"select",r,R,E].filter(Boolean),e[33]=r,e[34]=R,e[35]=E,e[36]=F):F=e[36];let L;e[37]!==D?(L=k=>({...k,label:Mg(k.label,D)}),e[37]=D,e[38]=L):L=e[38],T=H3("div",{className:F.join(" "),id:`field-${b.replace(/\./g,"__")}`,style:y,children:[oi(oe,{CustomComponent:f,Fallback:oi(be,{label:d,localized:m,path:b,required:v})}),H3("div",{className:`${Ce}__wrap`,children:[oi(oe,{CustomComponent:l,Fallback:oi(Xe,{path:b,showError:C})}),n,oi(yt,{disabled:x,isClearable:A,isMulti:w,isSortable:_,onChange:h,onInputChange:p,options:g.map(L),showError:C,value:S}),o]}),oi(oe,{CustomComponent:s,Fallback:oi(We,{description:i,path:b})})]}),e[0]=o,e[1]=n,e[2]=s,e[3]=l,e[4]=f,e[5]=r,e[6]=i,e[7]=w,e[8]=D,e[9]=A,e[10]=_,e[11]=d,e[12]=m,e[13]=h,e[14]=p,e[15]=g,e[16]=b,e[17]=x,e[18]=v,e[19]=C,e[20]=y,e[21]=I,e[22]=T}else T=e[22];return T};var Tk=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e}),Ak=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,isClearable:s=!0,isSortable:i=!0}={},hasMany:l=!1,label:a,localized:c,options:u=[],required:d},onChange:f,path:m,readOnly:h,validate:p}=t,g=_k.useMemo(()=>Tk(u),[u]),b=X3((R,E)=>{if(typeof p=="function")return p(R,{...E,hasMany:l,options:g,required:d})},[p,d,l,g]),{customComponents:{AfterInput:x,BeforeInput:v,Description:C,Error:y,Label:I}={},disabled:w,setValue:A,showError:_,value:D}=Te({path:m,validate:b}),T=X3(R=>{if(!h||w){let E=null;R&&l?Array.isArray(R)?E=R.map(F=>F.value):E=[]:R&&!Array.isArray(R)&&(E=R.value),typeof f=="function"&&f(E),A(E)}},[h,w,l,A,f]),S=Dk(()=>nt(e),[e]);return Rk(fa,{AfterInput:x,BeforeInput:v,className:n,Description:C,description:r,Error:y,hasMany:l,isClearable:s,isSortable:i,Label:I,label:a,localized:c,name:o,onChange:T,options:g,path:m,readOnly:h||w,required:d,showError:_,style:S,value:D})},hc=Oe(Ak);import{c as mI}from"react/compiler-runtime";import{jsx as In,jsxs as fI}from"react/jsx-runtime";import{getTranslation as b$}from"@payloadcms/translations";import{tabHasName as _m,toKebabCase as v$}from"payload/shared";import{useEffect as dI,useState as qg}from"react";var aI=ws(Gg(),1);import{jsx as $r}from"react/jsx-runtime";import{dequal as iI}from"dequal/lite";import{useRouter as i$}from"next/navigation.js";import{deepCopyObjectSimpleWithoutReactComponents as Yg,getDataByPath as a$,getSiblingData as l$,reduceFieldsToValues as Zg,wait as c$}from"payload/shared";import u$,{useCallback as or,useEffect as ni,useReducer as d$,useRef as vc,useState as is}from"react";import{c as Lk}from"react/compiler-runtime";import{jsx as J3,jsxs as kk}from"react/jsx-runtime";import $k from"react";function jk(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 Ok(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:jk(n),message:`${e} (${n.length}):`}}function q3(t){let e=Lk(5),{errorMessage:o}=t,n;e[0]!==o?(n=()=>Ok(o),e[0]=o,e[1]=n):n=e[1];let[r]=$k.useState(n),{errors:s,message:i}=r,l;return e[2]!==s||e[3]!==i?(l=kk("div",{children:[i,Array.isArray(s)&&s.length>0?J3("ul",{"data-testid":"field-errors",children:s.map(Mk)}):null]}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function Mk(t,e){return J3("li",{children:t},e)}import{c as Bk}from"react/compiler-runtime";import{useEffect as Q3,useState as Vk}from"react";function Wg(t,e,o){let n=Bk(11),r;n[0]!==t?(r=()=>t,n[0]=t,n[1]=r):r=n[1];let[s,i]=Vk(r),l;n[2]!==o||n[3]!==t?(l=()=>{let d=setTimeout(()=>{i(()=>t)},o);return()=>{clearTimeout(d)}},n[2]=o,n[3]=t,n[4]=l):l=n[4];let a;n[5]!==o||n[6]!==e?(a=[...e,o],n[5]=o,n[6]=e,n[7]=a):a=n[7],Q3(l,a);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]),Q3(c,u)}import{useCallback as Gk,useRef as zg}from"react";function K3(){let t=zg(null),e=zg(null),o=zg(null);return{queueTask:Gk(r=>{if(e.current=r,t.current!==null){o.current&&o.current.abort();return}(async()=>{for(;e.current;){let i=e.current;e.current=null;let l=new AbortController;o.current=l;try{t.current=i(l.signal),await t.current}catch(a){a.name!=="AbortError"&&console.error("Error in queued function:",a)}finally{t.current=null}}})()},[])}}import{c as Wk}from"react/compiler-runtime";import{jsx as zk}from"react/jsx-runtime";import eI,{useState as Hk}from"react";var tI=eI.createContext(null),Hg=t=>{let e=Wk(6),{children:o}=t,[n,r]=Hk(Xk),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,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=u=>{let{collectionSlug:d,handler:f}=u;r(m=>{let h=new Map(m);return h.set(d,f),h})},e[2]=l):l=e[2];let a=l,c;return e[3]!==o||e[4]!==i?(c=zk(tI,{value:{getUploadHandler:i,setUploadHandler:a},children:o}),e[3]=o,e[4]=i,e[5]=c):c=e[5],c},gc=()=>{let t=eI.use(tI);if(t===null)throw new Error("useUploadHandlers must be used within UploadHandlersProvider");return t};function Xk(){return new Map}var oI={413:"Your request was too large to submit successfully."};var Xg=ws(tg(),1);import{dequal as Uk}from"dequal/lite";import{deepCopyObjectSimple as Yk,deepCopyObjectSimpleWithoutReactComponents as Zk}from"payload/shared";var pa=(t,e)=>{let o={},n=Object.entries(e).reduce((r,[s,i])=>{let l=r;if(s.indexOf(`${t}.`)===0){let[a]=s.replace(`${t}.`,"").split(".");l[a]||(l[a]={}),l[a][s.replace(`${t}.${String(a)}.`,"")]={...i}}else o[s]=i;return l},[]);return{remainingFields:o,rows:n}},ha=(t,e)=>e.reduce((o,n,r)=>({...o,...Object.entries(n).reduce((s,[i,l])=>({...s,[`${t}.${r}.${i}`]:{...l}}),{})}),{});var ss=Xg.default.default||Xg.default;function bc(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,l=[...t[n]?.rows||[]],a={id:s?.id?.value||new ss().toHexString(),blockType:o||void 0,collapsed:!1,isLoading:!0};l.splice(i,0,a),o&&(s.blockType={initialValue:o,valid:!0,value:o});let{remainingFields:c,rows:u}=pa(n,t);return u.splice(i,0,s),{...c,...ha(n,u),[`${n}.${i}.id`]:{initialValue:a.id,passesCondition:!0,requiresRender:!0,valid:!0,value:a.id},[n]:{...t[n],disableFormData:!0,requiresRender:!0,rows:l,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 l=n.reduce((c,{fieldErrorPath:u,parentPath:d})=>(d.startsWith(s)&&c.push(u),c),[]),a=!1;if(l.length>0){let c=Array.isArray(i.errorPaths)?i.errorPaths:[];l.forEach(u=>{c.includes(u)||(c.push(u),a=!0)}),a&&(r[s]={...i,errorPaths:c})}return a||(r[s]=i),r},{}),o}case"DUPLICATE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=pa(o,t),i=[...t[o].rows||[]],l=Yk(i[n]);l.id&&(l.id=new ss().toHexString());let a=Zk(s[n]);a.id&&(a.id.value=new ss().toHexString(),a.id.initialValue=new ss().toHexString());for(let u of Object.keys(a).filter(d=>d.endsWith(".id"))){let d=a[u];d&&typeof d.value=="string"&&ss.isValid(d.value)&&(a[u].value=new ss().toHexString(),a[u].initialValue=new ss().toHexString())}return Object.keys(a).length>0&&(s.splice(n+1,0,a),i.splice(n+1,0,l)),{...r,...ha(o,s),[o]:{...t[o],disableFormData:!0,requiresRender:!0,rows:i,value:s.length}}}case"MOVE_ROW":{let{moveFromIndex:o,moveToIndex:n,path:r}=e,{remainingFields:s,rows:i}=pa(r,t),l=i[o];i.splice(o,1),i.splice(n,0,l);let a=[...t[r]?.rows||[]],c={...a[o]};a.splice(o,1),a.splice(n,0,c);let u={...s,...ha(r,i),[r]:{...t[r],requiresRender:!0,rows:a}};if(u[r]?.customComponents?.RowLabels){let d={...u[r].customComponents,RowLabels:[...u[r].customComponents.RowLabels]};n>=d.RowLabels.length&&(d.RowLabels.length=n+1);let f=d.RowLabels[o];d.RowLabels.splice(o,1),d.RowLabels.splice(n,0,f),u[r].customComponents=d}return u}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}=pa(o,t),i=[...t[o]?.rows||[]];return s.splice(n,1),i.splice(n,1),{...r,[o]:{...t[o],disableFormData:s.length>0,requiresRender:!0,rows:i,value:s.length},...ha(o,s)}}case"REPLACE_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,{remainingFields:i,rows:l}=pa(n,t),a=Math.max(0,Math.min(r,l?.length-1||0)),c=[...t[n]?.rows||[]];return c[a]={id:new ss().toHexString(),blockType:o||void 0,collapsed:!1},o&&(s.blockType={initialValue:o,valid:!0,value:o}),l[a]=s,{...i,...ha(n,l),[n]:{...t[n],disableFormData:!0,rows:c,value:l.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),Uk(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 Jk=()=>{},qk=()=>{},Qk=()=>{},Kk=()=>{},e$=()=>{},t$=()=>{},o$=()=>{},r$=()=>{},n$=()=>{},s$=()=>{},Sm={addFieldRow:()=>{},buildRowErrors:()=>{},createFormData:e$,disabled:!1,dispatchFields:Qk,fields:{},formRef:null,getData:()=>{},getDataByPath:()=>{},getField:()=>{},getFields:()=>({}),getSiblingData:qk,initializing:void 0,isValid:!0,removeFieldRow:()=>{},replaceFieldRow:()=>{},replaceState:()=>{},reset:s$,setBackgroundProcessing:r$,setDisabled:()=>{},setIsValid:()=>{},setModified:t$,setProcessing:o$,setSubmitted:n$,submit:Jk,validateForm:Kk};import{dequal as sI}from"dequal/lite";function rI(t,e){if(t.length!==e.length)return!1;let o=t.slice().sort(),n=e.slice().sort();for(let r=0;r<o.length;r++)if(o[r]!==n[r])return!1;return!0}var nI=(t,e)=>{if(!t)return{changed:!1,result:void 0};let o=[],n=[];return Array.isArray(e)&&e?.length&&e.forEach(r=>n.push(r)),Array.isArray(t)&&t?.length&&t.forEach(r=>o.push(r)),rI(o,n)?{changed:!1,result:t}:{changed:!0,result:n}};var Ug=({acceptValues:t,existingState:e,incomingState:o})=>{let n=!1,r={};if(e){let s=["passesCondition","valid","errorMessage","errorPaths","rows","customComponents","requiresRender"];t&&(s.push("value"),s.push("initialValue"));for(let[i,l]of Object.entries(e)){if(!o[i])continue;let a=!1,c=nI(l.errorPaths,o[i].errorPaths);c.result&&(c.changed&&(n=c.changed),l.errorPaths=c.result),(o[i]?.filterOptions||l.filterOptions)&&(sI(o[i]?.filterOptions,l.filterOptions)||(n=!0,a=!0,l.filterOptions=o[i].filterOptions)),s.forEach(u=>{sI(o[i]?.[u],l[u])||(n=!0,a=!0,u in o[i]?l[u]=o[i][u]:u!=="customComponents"&&delete l[u])}),l.valid!==!1&&(l.valid=!0),l.passesCondition!==!1&&(l.passesCondition=!0),r[i]=a?{...l}:l}for(let[i,l]of Object.entries(o))e[i]||(n=!0,r[i]=l)}return{changed:n,newState:r}};var m$="form",wn=t=>{let{id:e,collectionSlug:o,docPermissions:n,getDocPreferences:r,globalSlug:s}=Ae(),{action:i,beforeSubmit:l,children:a,className:c,disabled:u,disableSuccessStatus:d,disableValidationOnSubmit:f,el:m,handleResponse:h,initialState:p,isDocumentForm:g,isInitializing:b,onChange:x,onSubmit:v,onSuccess:C,redirect:y,submitted:I,uuid:w,waitForAutocomplete:A}=t,_="method"in t?t?.method:void 0,D=i$(),T=_i(),{code:S}=Ee(),{i18n:R,t:E}=$(),{refreshCookie:F,user:L}=Se(),k=Jo(),{queueTask:N}=K3(),{getFormState:P}=Dt(),{startRouteTransition:j}=it(),{getUploadHandler:V}=gc(),{config:M}=W(),[O,B]=is(u||!1),[G,Y]=is(!1),[X,ee]=is(!1),[q,z]=is(!0),[re,me]=is(b),[se,Z]=is(!1),[Q,ge]=is(!1),[Ie,Fe]=is(!1),Le=vc(null),K=vc({}),_e=vc(null),pe=vc(!0),ce=d$(bc,{},()=>p),[ne,H]=ce;K.current.fields=ne;let U=vc(ne),le=or(async()=>{let J={},te=!0,he=K.current.getData(),Pe=Object.entries(K.current.fields).map(async([je,Ye])=>{let Qe=Ye,Ze=je?je.split("."):[];if(Ye.passesCondition!==!1){let _t=Qe.valid;if("validate"in Ye&&typeof Ye.validate=="function"){let _o=Ye.value;Ye?.rows&&Array.isArray(Ye.rows)&&(_o=K.current.getDataByPath(je)),_t=await Ye.validate(_o,{...Ye,id:e,collectionSlug:o,blockData:void 0,data:T?.getData?T.getData():he,event:"submit",operation:k,path:Ze,preferences:{},req:{payload:{config:M},t:E,user:L},siblingData:K.current.getSiblingData(je)}),typeof _t=="string"?(Qe.errorMessage=_t,Qe.valid=!1):(Qe.valid=!0,Qe.errorMessage=void 0)}Qe.valid===!1&&(te=!1)}J[je]=Qe});return await Promise.all(Pe),iI(K.current.fields,J)||H({type:"REPLACE_STATE",state:J}),z(te),te},[o,M,H,e,k,E,L,T]),De=or(async(J={},te)=>{let{action:he=i,method:Pe=_,overrides:je={},skipValidation:Ye}=J;if(O){te&&te.preventDefault();return}let Qe,Ze,_t=new Promise((He,uo)=>{Ze=He,Qe=uo}),_o=he||typeof i=="string"||typeof i=="function";if(y||d||!_o?(Ze=He=>fe.success(He),Qe=He=>fe.error(He)):fe.promise(_t,{error:He=>He,loading:E("general:submitting"),success:He=>He}),te&&(te.stopPropagation(),te.preventDefault()),Z(!0),B(!0),A&&await c$(100),Array.isArray(l)){let He,uo=Yg(K.current.fields);await l.reduce(async(mo,$n)=>{await mo,He=await $n({formState:uo})},Promise.resolve());let ko=Object.entries(He).every(([,mo])=>mo.valid!==!1);if(z(ko),!ko)return Z(!1),Fe(!0),B(!1),H({type:"REPLACE_STATE",state:He})}let Ct=Ye||f?!0:await K.current.validateForm();if(z(Ct),!Ct){Qe(E("error:correctInvalidFields")),Z(!1),Fe(!0),B(!1);return}let lo={};if(typeof je=="function"?lo=je(K.current.fields):typeof je=="object"&&(lo=je),v){let He=Yg(K.current.fields),uo=Zg(He,!0);for(let[ko,mo]of Object.entries(lo))uo[ko]=mo;v(He,uo)}if(!_o){Z(!1),Fe(!0),B(!1);return}let co=await K.current.createFormData(lo,{mergeOverrideData:typeof je!="function"});try{let He;if(typeof he=="string"?He=await Ke[Pe.toLowerCase()](he,{body:co,headers:{"Accept-Language":R.language}}):typeof i=="function"&&(He=await i(co)),ee(!1),B(!1),typeof h=="function"){h(He,Ze,Qe);return}let uo=He.headers.get("content-type"),ko=uo&&uo.indexOf("application/json")!==-1,mo={};if(ko&&(mo=await He.json()),He.status<400){if(typeof C=="function"){let $n=await C(mo);if($n){let{newState:Si}=Ug({acceptValues:!0,existingState:K.current.fields||{},incomingState:$n});H({type:"REPLACE_STATE",optimize:!1,state:Si})}}Fe(!1),Z(!1),y?j(()=>D.push(y)):d||Ze(mo.message||E("general:submissionSuccessful"))}else{if(Z(!1),Fe(!0),K.current={...K.current},mo.message){Qe(mo.message);return}if(Array.isArray(mo.errors)){let[Si,X_]=mo.errors.reduce(([Tf,U_],mu)=>{let U1=[],Af=[];return mu?.message&&Af.push(mu),Array.isArray(mu?.data?.errors)&&mu.data?.errors.forEach(Ff=>{Ff?.path?U1.push(Ff):Af.push(Ff)}),[[...Tf,...U1],[...U_,...Af]]},[[],[]]);z(!1),H({type:"ADD_SERVER_ERRORS",errors:Si}),X_.forEach(Tf=>{Qe($r(q3,{errorMessage:Tf.message||E("error:unknown")}))});return}let $n=oI?.[He.status]||He?.statusText||E("error:unknown");Qe($n)}}catch(He){console.error("Error submitting form",He),Z(!1),Fe(!0),B(!1),Qe(He.message)}},[l,j,i,d,f,O,H,h,_,v,C,y,D,E,R,A]),Ne=or(()=>K.current.fields,[]),qe=or(J=>K.current.fields[J],[]),Ue=or(()=>Zg(K.current.fields,!0),[]),ke=or(J=>l$(K.current.fields,J),[]),ot=or(J=>a$(K.current.fields,J),[]),Ft=or(async(J,{mergeOverrideData:te=!0})=>{let he=Zg(K.current.fields,!0),Pe=he?.file;Pe&&delete he.file,te?he={...he,...J}:he=J;let je=V({collectionSlug:o});if(Pe&&typeof je=="function"){let Ze=Pe.name,_t=await je({file:Pe,updateFilename:_o=>{Ze=_o}});Pe=JSON.stringify({clientUploadContext:_t,collectionSlug:o,filename:Ze,mimeType:Pe.type,size:Pe.size})}let Ye={_payload:JSON.stringify(he),file:Pe};return(0,aI.serialize)(Ye,{indices:!0,nullsAsUndefineds:!1})},[o,V]),Wt=or(async J=>{let te=er(_e),he=await r(),{state:Pe}=await P({id:e,collectionSlug:o,data:J,docPermissions:n,docPreferences:he,globalSlug:s,locale:S,operation:k,renderAllFields:!0,schemaPath:o||s,signal:te.signal,skipValidation:!0});K.current={...Sm},ee(!1),H({type:"REPLACE_STATE",state:Pe}),_e.current=null},[o,H,s,e,k,P,n,r,S]),mt=or(J=>{K.current={...Sm},ee(!1),H({type:"REPLACE_STATE",state:J})},[H]),ze=or(({blockType:J,path:te,rowIndex:he,subFieldState:Pe})=>{let je=ot(te)||[],Ye=he===void 0?je.length:he;H({type:"ADD_ROW",blockType:J,path:te,rowIndex:Ye,subFieldState:Pe}),ee(!0)},[H,ot]),rt=or(({path:J,rowIndex:te})=>{H({type:"REMOVE_ROW",path:J,rowIndex:te})},[H]),ue=or(({blockType:J,path:te,rowIndex:he,subFieldState:Pe})=>{let je=ot(te),Ye=he===void 0?je.length:he;H({type:"REPLACE_ROW",blockType:J,path:te,rowIndex:Ye,subFieldState:Pe}),ee(!0)},[H,ot]);ni(()=>{let J=_e.current;return()=>{Ko(J)}},[]),ni(()=>{b!==void 0&&me(b)},[b]),K.current.submit=De,K.current.getFields=Ne,K.current.getField=qe,K.current.getData=Ue,K.current.getSiblingData=ke,K.current.getDataByPath=ot,K.current.validateForm=le,K.current.createFormData=Ft,K.current.setModified=ee,K.current.setProcessing=Z,K.current.setBackgroundProcessing=ge,K.current.setSubmitted=Fe,K.current.setIsValid=z,K.current.disabled=O,K.current.setDisabled=B,K.current.formRef=Le,K.current.reset=Wt,K.current.replaceState=mt,K.current.dispatchFields=H,K.current.addFieldRow=ze,K.current.removeFieldRow=rt,K.current.replaceFieldRow=ue,K.current.uuid=w,K.current.initializing=re,K.current.isValid=q,ni(()=>{Y(!0)},[]),ni(()=>{typeof u=="boolean"&&B(u)},[u]),ni(()=>{typeof I=="boolean"&&Fe(I)},[I]),ni(()=>{p&&(K.current={...Sm},H({type:"REPLACE_STATE",optimize:!1,sanitize:!0,state:p}))},[p,H]),ks(()=>{F()},15e3,[ne]),ni(()=>{K.current={...K.current},ee(!1)},[S]);let ve=[c,m$].filter(Boolean).join(" "),Ve=Jt(async(J,te)=>{if(Array.isArray(x)){let he=K.current.fields;for(let Ye of x){if(te.aborted)return;he=await Ye({formState:Yg(K.current.fields),submitted:J})}if(!he)return;let{changed:Pe,newState:je}=Ug({existingState:K.current.fields||{},incomingState:he});Pe&&!te.aborted&&(U.current=je,H({type:"REPLACE_STATE",optimize:!1,state:je}))}});Wg(()=>{(pe.current||!iI(ne,U.current))&&X&&N(async J=>Ve(Ie,J)),U.current=ne,pe.current=!1},[X,Ie,ne,N],250);let Ge=g?yu:u$.Fragment,$e=g?{value:K.current}:{};return $r(m||"form",{action:typeof i=="function"?void 0:i,className:ve,method:_,noValidate:!0,onSubmit:J=>void K.current.submit({},J),ref:Le,children:$r(Ge,{...$e,children:$r(Cu,{value:K.current,children:$r(wu,{value:{fields:ne,...K.current},children:$r(Iu,{value:Ie,children:$r(Hf,{value:!G||G&&re,children:$r(Su,{value:se,children:$r(zf,{value:Q,children:$r(Ru,{value:X,children:$r(Za.Provider,{value:ce,children:a})})})})})})})})})})};import{c as f$}from"react/compiler-runtime";import{jsx as lI,jsxs as cI}from"react/jsx-runtime";import{getTranslation as p$}from"@payloadcms/translations";import{tabHasName as uI}from"payload/shared";import h$,{useState as g$}from"react";var Rm="tabs-field__tab-button",Jg=t=>{let e=f$(15),{hidden:o,isActive:n,parentPath:r,setIsActive:s,tab:i}=t,{i18n:l}=$(),[a,c]=g$(void 0),u;if(e[0]!==a||e[1]!==o||e[2]!==l||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i){let d=[...r?r.split(".").slice(0,-1):[],...uI(i)?[i.name]:[]],f=a>0,m=lI(Ws,{fields:i.fields,path:d,setErrorCount:c}),h=f&&`${Rm}--has-error`,p=n&&`${Rm}--active`,g=o&&`${Rm}--hidden`,b;e[8]!==h||e[9]!==p||e[10]!==g?(b=[Rm,h,p,g].filter(Boolean),e[8]=h,e[9]=p,e[10]=g,e[11]=b):b=e[11];let x;e[12]!==l||e[13]!==i?(x=i.label?p$(i.label,l):uI(i)?i.name:"",e[12]=l,e[13]=i,e[14]=x):x=e[14],u=cI(h$.Fragment,{children:[m,cI("button",{className:b.join(" "),onClick:s,type:"button",children:[x,f&&lI(to,{count:a,i18n:l})]})]}),e[0]=a,e[1]=o,e[2]=l,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=u}else u=e[7];return u};var Sn="tabs-field";function ga({activeTabConfig:t,path:e}){let o=e;return _m(t)&&t.name&&(e?o=`${e}.${t.name}`:o=t.name),o}var x$=t=>{let e=mI(89),{field:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:l,permissions:a,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,x=s===void 0?"":s,v=i===void 0?"":i,C=l===void 0?"":l,{getPreference:y,setPreference:I}=Do(),{preferencesKey:w}=Ae(),{i18n:A}=$(),{isWithinCollapsible:_}=Xn(),D;e[4]!==p?(D=ce=>{let[ne]=ce;return p.map((H,U)=>{let le=H?.id;return{index:U,passesCondition:ne?.[le]?.passesCondition??!0,tab:H}})},e[4]=p,e[5]=D):D=e[5];let T=Et(D),S;e[6]!==T?(S=()=>T.filter(y$)?.[0]?.index??0,e[6]=T,e[7]=S):S=e[7];let[R,E]=qg(S),F=`tabs-${b}`,L;e[8]!==R||e[9]!==x||e[10]!==p?(L=()=>ga({activeTabConfig:p[R],path:x}),e[8]=R,e[9]=x,e[10]=p,e[11]=L):L=e[11];let[k,N]=qg(L),P;e[12]!==v||e[13]!==p?(P=()=>ga({activeTabConfig:p[0],path:v}),e[12]=v,e[13]=p,e[14]=P):P=e[14];let[j,V]=qg(P),M;e[15]!==R||e[16]!==k||e[17]!==x||e[18]!==p?(M=_m(p[R])?k:x,e[15]=R,e[16]=k,e[17]=x,e[18]=p,e[19]=M):M=e[19];let O=M,B=T[R],G=B?.tab,Y;e[20]!==R||e[21]!==j||e[22]!==v||e[23]!==p?(Y=_m(p[R])?j:v,e[20]=R,e[21]=j,e[22]=v,e[23]=p,e[24]=Y):Y=e[24];let X=Y,ee=G.admin?.description??G.description,q;e[25]!==ee||e[26]!==A?(q=typeof ee=="function"?ee({i18n:A,t:A.t}):ee,e[25]=ee,e[26]=A,e[27]=q):q=e[27];let z=q,re=T.some(w$),me;e[28]!==y||e[29]!==x||e[30]!==v||e[31]!==C||e[32]!==w||e[33]!==I||e[34]!==p||e[35]!==F?(me=async ce=>{E(ce),N(ga({activeTabConfig:p[ce],path:x})),V(ga({activeTabConfig:p[ce],path:v}));let ne=await y(w);w&&I(w,{...ne,...C?{fields:{...ne?.fields||{},[C]:{...ne?.fields?.[C],tabIndex:ce}}}:{fields:{...ne?.fields,[F]:{...ne?.fields?.[F],tabIndex:ce}}}})},e[28]=y,e[29]=x,e[30]=v,e[31]=C,e[32]=w,e[33]=I,e[34]=p,e[35]=F,e[36]=me):me=e[36];let se=me,Z,Q;e[37]!==y||e[38]!==x||e[39]!==v||e[40]!==C||e[41]!==w||e[42]!==p||e[43]!==F?(Z=()=>{w&&(async()=>{let ne=await y(w),U=(C?ne?.fields?.[C]?.tabIndex:ne?.fields?.[F]?.tabIndex)||0;E(U),N(ga({activeTabConfig:p[U],path:x})),V(ga({activeTabConfig:p[U],path:v}))})()},Q=[C,y,w,F,p,x,v],e[37]=y,e[38]=x,e[39]=v,e[40]=C,e[41]=w,e[42]=p,e[43]=F,e[44]=Z,e[45]=Q):(Z=e[44],Q=e[45]),dI(Z,Q);let ge;e[46]!==B?.passesCondition||e[47]!==se||e[48]!==T?(ge=()=>{if(B?.passesCondition===!1){let ce=T.find(I$);ce&&se(ce.index)}},e[46]=B?.passesCondition,e[47]=se,e[48]=T,e[49]=ge):ge=e[49];let Ie;e[50]!==B||e[51]!==se||e[52]!==T?(Ie=[B,T,se],e[50]=B,e[51]=se,e[52]=T,e[53]=Ie):Ie=e[53],dI(ge,Ie);let Fe=_&&`${Sn}--within-collapsible`,Le=!re&&`${Sn}--hidden`,K;e[54]!==m||e[55]!==Fe||e[56]!==Le?(K=[Ce,m,Sn,Fe,Le].filter(Boolean),e[54]=m,e[55]=Fe,e[56]=Le,e[57]=K):K=e[57];let _e=K.join(" "),pe;if(e[58]!==O||e[59]!==X||e[60]!==G||e[61]!==R||e[62]!==B||e[63]!==k||e[64]!==z||e[65]!==g||e[66]!==se||e[67]!==b||e[68]!==C||e[69]!==a||e[70]!==c||e[71]!==_e||e[72]!==T){let ce;e[74]!==R||e[75]!==se||e[76]!==C?(ce=H=>{let{index:U,passesCondition:le,tab:De}=H;return In(Jg,{hidden:!le,isActive:R===U,parentPath:C,setIsActive:()=>{se(U)},tab:De},U)},e[74]=R,e[75]=se,e[76]=C,e[77]=ce):ce=e[77];let ne;e[78]!==O||e[79]!==X||e[80]!==G||e[81]!==B||e[82]!==k||e[83]!==z||e[84]!==g||e[85]!==b||e[86]!==a||e[87]!==c?(ne=G&&In(C$,{description:z,fields:G.fields,forceRender:g,hidden:!1,parentIndexPath:_m(G)?"":`${b?b+"-":""}`+String(B.index),parentPath:O,parentSchemaPath:X,path:k,permissions:a&&typeof a=="object"&&"name"in G?a[G.name]&&typeof a[G.name]=="object"&&"fields"in a[G.name]?a[G.name].fields:a[G.name]:a,readOnly:c}),e[78]=O,e[79]=X,e[80]=G,e[81]=B,e[82]=k,e[83]=z,e[84]=g,e[85]=b,e[86]=a,e[87]=c,e[88]=ne):ne=e[88],pe=In("div",{className:_e,children:fI(Kh,{children:[In("div",{className:`${Sn}__tabs-wrap`,children:In("div",{className:`${Sn}__tabs`,children:T.map(ce)})}),In("div",{className:`${Sn}__content-wrap`,children:ne})]})}),e[58]=O,e[59]=X,e[60]=G,e[61]=R,e[62]=B,e[63]=k,e[64]=z,e[65]=g,e[66]=se,e[67]=b,e[68]=C,e[69]=a,e[70]=c,e[71]=_e,e[72]=T,e[73]=pe}else pe=e[73];return pe},xc=Oe(x$);function C$(t){let e=mI(21),{description:o,fields:n,forceRender:r,hidden:s,label:i,parentIndexPath:l,parentPath:a,parentSchemaPath:c,path:u,permissions:d,readOnly:f}=t,{i18n:m}=$(),h;e[0]!==u?(h={path:u},e[0]=u,e[1]=h):h=e[1];let{customComponents:p}=Te(h),g;e[2]!==p?(g=p===void 0?{}:p,e[2]=p,e[3]=g):g=e[3];let{AfterInput:b,BeforeInput:x,Description:v,Field:C}=g;if(C)return C;let y=s&&`${Sn}__tab--hidden`,I=i&&`${Sn}__tabConfigLabel-${v$(b$(i,m))}`,w;e[4]!==y||e[5]!==I?(w=[y,`${Sn}__tab`,I].filter(Boolean),e[4]=y,e[5]=I,e[6]=w):w=e[6];let A=w.join(" "),_;return e[7]!==b||e[8]!==x||e[9]!==v||e[10]!==o||e[11]!==n||e[12]!==r||e[13]!==l||e[14]!==a||e[15]!==c||e[16]!==u||e[17]!==d||e[18]!==f||e[19]!==A?(_=fI("div",{className:A,children:[In(oe,{CustomComponent:v,Fallback:In(We,{description:o,marginPlacement:"bottom",path:u})}),x,In(yo,{fields:n,forceRender:r,parentIndexPath:l,parentPath:a,parentSchemaPath:c,permissions:d,readOnly:f}),b]}),e[7]=b,e[8]=x,e[9]=v,e[10]=o,e[11]=n,e[12]=r,e[13]=l,e[14]=a,e[15]=c,e[16]=u,e[17]=d,e[18]=f,e[19]=A,e[20]=_):_=e[20],_}function y$(t){let{passesCondition:e}=t;return e}function w$(t){let{passesCondition:e}=t;return e}function I$(t){let{passesCondition:e}=t;return e}import{jsx as T$}from"react/jsx-runtime";import{useCallback as hI,useEffect as A$,useMemo as F$,useState as E$}from"react";import{c as S$}from"react/compiler-runtime";import{jsx as as,jsxs as pI}from"react/jsx-runtime";import{getTranslation as R$}from"@payloadcms/translations";import"react";var Qg=t=>{let e=S$(31),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:l,hasMany:a,inputRef:c,Label:u,label:d,localized:f,maxRows:m,onChange:h,onKeyDown:p,path:g,placeholder:b,readOnly:x,required:v,rtl:C,showError:y,style:I,value:w,valueToRender:A}=t,{i18n:_,t:D}=$(),T=D$,S=y&&"error",R=x&&"read-only",E=a&&"has-many",F;e[0]!==r||e[1]!==S||e[2]!==R||e[3]!==E?(F=[Ce,"text",r,S,R,E].filter(Boolean),e[0]=r,e[1]=S,e[2]=R,e[3]=E,e[4]=F):F=e[4];let L=F.join(" "),k;return e[5]!==o||e[6]!==n||e[7]!==s||e[8]!==l||e[9]!==u||e[10]!==i||e[11]!==a||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]!==x||e[22]!==v||e[23]!==C||e[24]!==y||e[25]!==I||e[26]!==D||e[27]!==L||e[28]!==w||e[29]!==A?(k=pI("div",{className:L,style:I,children:[as(oe,{CustomComponent:u,Fallback:as(be,{label:d,localized:f,path:g,required:v})}),pI("div",{className:`${Ce}__wrap`,children:[as(oe,{CustomComponent:l,Fallback:as(Xe,{path:g,showError:y})}),n,a?as(yt,{className:`field-${g.replace(/\./g,"__")}`,components:{DropdownIndicator:null},customProps:{editableProps:T},disabled:x,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?D("validation:limitReached",{max:m,value:w.length+1}):null,onChange:h,options:[],placeholder:D("general:enterAValue"),showError:y,value:A}):as("input",{"data-rtl":C,disabled:x,id:`field-${g?.replace(/\./g,"__")}`,name:g,onChange:h,onKeyDown:p,placeholder:R$(b,_),ref:c,type:"text",value:w||""}),o,as(oe,{CustomComponent:s,Fallback:as(We,{description:i,path:g})})]})]}),e[5]=o,e[6]=n,e[7]=s,e[8]=l,e[9]=u,e[10]=i,e[11]=a,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]=x,e[22]=v,e[23]=C,e[24]=y,e[25]=I,e[26]=D,e[27]=L,e[28]=w,e[29]=A,e[30]=k):k=e[30],k};function _$(t){t.currentTarget.contentEditable="false"}function D$(t,e,o){let n=`${e}--editable`;return{onBlur:_$,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 P$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rtl:s}={},hasMany:i,label:l,localized:a,maxLength:c,maxRows:u,minLength:d,minRows:f,required:m},inputRef:h,path:p,readOnly:g,validate:b}=t,x=Ee(),{config:{localization:v}}=W(),C=hI((P,j)=>{if(typeof b=="function")return b(P,{...j,maxLength:c,minLength:d,required:m})},[b,d,c,m]),{customComponents:{AfterInput:y,BeforeInput:I,Description:w,Error:A,Label:_}={},disabled:D,setValue:T,showError:S,value:R}=Te({path:p,validate:C}),E=Bi({fieldLocalized:a,fieldRTL:s,locale:x,localizationConfig:v||void 0}),[F,L]=E$([]),k=hI(P=>{if(!(g||D)){let j;P?Array.isArray(P)?j=P.map(V=>V.value?.value||V.value):j=[P.value?.value||P.value]:j=[],T(j)}},[g,T,D]);A$(()=>{i&&Array.isArray(R)&&L(R.map((P,j)=>({id:`${P}${j}`,label:`${P}`,value:{toString:()=>`${P}${j}`,value:P?.value||P}})))},[R,i]);let N=F$(()=>nt(e),[e]);return T$(Qg,{AfterInput:y,BeforeInput:I,className:o,Description:w,description:n,Error:A,hasMany:i,inputRef:h,Label:_,label:l,localized:a,maxRows:u,minRows:f,onChange:i?k:P=>{T(P.target.value)},path:p,placeholder:r,readOnly:g||D,required:m,rtl:E,showError:S,style:N,value:R||"",valueToRender:F})},si=Oe(P$);import{jsx as k$}from"react/jsx-runtime";import{getTranslation as $$}from"@payloadcms/translations";import{useCallback as j$,useMemo as O$}from"react";import{c as N$}from"react/compiler-runtime";import{jsx as ls,jsxs as gI}from"react/jsx-runtime";import{getTranslation as L$}from"@payloadcms/translations";import"react";var Kg=t=>{let e=N$(25),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:l,Label:a,label:c,localized:u,onChange:d,path:f,placeholder:m,readOnly:h,required:p,rows:g,rtl:b,showError:x,style:v,value:C}=t,{i18n:y}=$(),I=x&&"error",w=h&&"read-only",A;e[0]!==r||e[1]!==I||e[2]!==w?(A=[Ce,"textarea",r,I,w].filter(Boolean),e[0]=r,e[1]=I,e[2]=w,e[3]=A):A=e[3];let _=A.join(" "),D;return e[4]!==o||e[5]!==n||e[6]!==s||e[7]!==l||e[8]!==a||e[9]!==i||e[10]!==y||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]!==x||e[21]!==v||e[22]!==_||e[23]!==C?(D=gI("div",{className:_,style:v,children:[ls(oe,{CustomComponent:a,Fallback:ls(be,{label:c,localized:u,path:f,required:p})}),gI("div",{className:`${Ce}__wrap`,children:[ls(oe,{CustomComponent:l,Fallback:ls(Xe,{path:f,showError:x})}),n,ls("label",{className:"textarea-outer",htmlFor:`field-${f.replace(/\./g,"__")}`,children:ls("textarea",{"data-rtl":b,disabled:h,id:`field-${f.replace(/\./g,"__")}`,name:f,onChange:d,placeholder:L$(m,y),rows:g,value:C||""})}),o,ls(oe,{CustomComponent:s,Fallback:ls(We,{description:i,path:f})})]})]}),e[4]=o,e[5]=n,e[6]=s,e[7]=l,e[8]=a,e[9]=i,e[10]=y,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]=x,e[21]=v,e[22]=_,e[23]=C,e[24]=D):D=e[24],D};var M$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rows:s,rtl:i}={},label:l,localized:a,maxLength:c,minLength:u,required:d},path:f,readOnly:m,validate:h}=t,{i18n:p}=$(),{config:{localization:g}}=W(),b=Ee(),x=Bi({fieldLocalized:a,fieldRTL:i,locale:b,localizationConfig:g||void 0}),v=j$((E,F)=>{if(typeof h=="function")return h(E,{...F,maxLength:c,minLength:u,required:d})},[h,d,c,u]),{customComponents:{AfterInput:C,BeforeInput:y,Description:I,Error:w,Label:A}={},disabled:_,setValue:D,showError:T,value:S}=Te({path:f,validate:v}),R=O$(()=>nt(e),[e]);return k$(Kg,{AfterInput:C,BeforeInput:y,className:o,Description:I,description:n,Error:w,Label:A,label:l,localized:a,onChange:E=>{D(E.target.value)},path:f,placeholder:$$(r,p),readOnly:m||_,required:d,rows:s,rtl:x,showError:T,style:R,value:S})},Cc=Oe(M$);var yc=()=>null;import{jsx as CO}from"react/jsx-runtime";import yO,{useMemo as wO}from"react";import{jsx as kt,jsxs as di,Fragment as jc}from"react/jsx-runtime";import*as DS from"qs-esm";import Vr,{useCallback as SS,useEffect as RS,useMemo as _S}from"react";import{c as uS}from"react/compiler-runtime";import{jsx as li,jsxs as eO}from"react/jsx-runtime";import{validateMimeType as tO}from"payload/shared";import Kr from"react";import{jsx as Tm,jsxs as eb}from"react/jsx-runtime";import X$ from"react";import{jsx as B$}from"react/jsx-runtime";import cs from"react";var bI=t=>{t.preventDefault(),t.stopPropagation()},V$="dropzone";function ii({children:t,className:e,disabled:o=!1,dropzoneStyle:n="default",multipleFiles:r,onChange:s}){let i=cs.useRef(null),[l,a]=cs.useState(!1),c=cs.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=cs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),p.clipboardData.files&&p.clipboardData.files.length>0&&c(p.clipboardData.files)},[c]),d=cs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),a(!0)},[]),f=cs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),a(!1)},[]),m=cs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),a(!1),p.dataTransfer.files&&p.dataTransfer.files.length>0&&(c(p.dataTransfer.files),a(!1),p.dataTransfer.clearData())},[c]);cs.useEffect(()=>{let p=i.current;return p&&!o?(p.addEventListener("dragenter",d),p.addEventListener("dragleave",f),p.addEventListener("dragover",bI),p.addEventListener("drop",m),p.addEventListener("paste",u),()=>{p.removeEventListener("dragenter",d),p.removeEventListener("dragleave",f),p.removeEventListener("dragover",bI),p.removeEventListener("drop",m),p.removeEventListener("paste",u)}):()=>null},[o,d,f,m,u]);let h=[V$,e,l?"dragging":"",`dropzoneStyle--${n}`].filter(Boolean).join(" ");return B$("div",{className:h,ref:i,children:t})}import{jsx as xI,jsxs as z$}from"react/jsx-runtime";import"react";import{c as G$}from"react/compiler-runtime";import{jsx as vI}from"react/jsx-runtime";import"react";var W$="drawer-close-button";function Dm(t){let e=G$(3),{onClick:o}=t,{t:n}=$(),r;return e[0]!==o||e[1]!==n?(r=vI("button",{"aria-label":n("general:close"),className:W$,onClick:o,type:"button",children:vI(pt,{})}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r}var H$="bulk-upload--drawer-header";function ba({onClose:t,title:e}){return z$("div",{className:H$,children:[xI("h2",{title:e,children:e}),xI(Dm,{onClick:t})]})}var Am="bulk-upload--add-files";function Fm({acceptMimeTypes:t,onCancel:e,onDrop:o}){let{t:n}=$(),r=X$.useRef(null);return eb("div",{className:Am,children:[Tm(ba,{onClose:e,title:n("upload:addFiles")}),Tm("div",{className:`${Am}__dropArea`,children:eb(ii,{multipleFiles:!0,onChange:o,children:[Tm(ae,{buttonStyle:"pill",iconPosition:"left",onClick:()=>{r.current&&r.current.click()},size:"small",children:n("upload:selectFile")}),Tm("input",{accept:t,"aria-hidden":"true",className:`${Am}__hidden-input`,hidden:!0,multiple:!0,onChange:s=>{s.target.files&&s.target.files.length>0&&o(s.target.files)},ref:r,type:"file"}),eb("p",{className:`${Am}__dragAndDropText`,children:[n("general:or")," ",n("upload:dragAndDrop")]})]})})]})}import{c as qj}from"react/compiler-runtime";import{jsx as Lc,jsxs as pb}from"react/jsx-runtime";import{getTranslation as Qj}from"@payloadcms/translations";import{reduceFieldsToValues as Kj}from"payload/shared";import"react";import{c as kI}from"react/compiler-runtime";import{jsx as Or,jsxs as Ic}from"react/jsx-runtime";import"react";import{c as dj}from"react/compiler-runtime";import{jsx as Lm,jsxs as mj}from"react/jsx-runtime";import"react";import{jsx as Y$,jsxs as Z$}from"react/jsx-runtime";import{isImage as J$}from"payload/shared";import*as tb from"qs-esm";import lt from"react";var CI=t=>new Promise((e,o)=>{let n=new Image;n.src=URL.createObjectURL(t),n.onload=()=>{let s,i,l=n.width/n.height;l>1?(i=280,s=280/l):(i=280*l,s=280);let a=new OffscreenCanvas(i,s);a.getContext("2d").drawImage(n,0,0,i,s),a.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 yI=ws(Gg(),1);import{reduceFieldsToValues as U$}from"payload/shared";async function wI(t={},e={},o,n){let r=U$(t,!0),s=r?.file;if(s&&delete r.file,s&&typeof n=="function"){let a=s.name,c=await n({file:s,updateFilename:u=>{a=u}});s=JSON.stringify({clientUploadContext:c,collectionSlug:o,filename:a,mimeType:s.type,size:s.size})}let i={...r,...e},l={_payload:JSON.stringify(i),file:s};return(0,yI.serialize)(l,{indices:!0,nullsAsUndefineds:!1})}function II(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]}}};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}},{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}default:return t}}var SI=lt.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}),q$={activeIndex:0,forms:[],totalErrorCount:0};function RI({children:t}){let{config:e}=W(),{routes:{api:o},serverURL:n}=e,{code:r}=Ee(),{i18n:s,t:i}=$(),{getDocumentSlots:l,getFormState:a}=Dt(),{getUploadHandler:c}=gc(),[u,d]=lt.useState({}),[f,m]=lt.useState(!1),[h,p]=lt.useState(),[g,b]=lt.useState(!1),[x,v]=lt.useState(!1),[C,y]=lt.useState(!1),[I,w]=lt.useState(!1),[A,_]=lt.useState(!1),[D,T]=lt.useReducer(II,q$),{activeIndex:S,forms:R,totalErrorCount:E}=D,F=lt.useRef(R);F.current=R;let L=R.length,k=lt.useRef([]),N=lt.useRef(new Set),[P,j]=lt.useState([]);lt.useEffect(()=>{(async()=>{let ne=[...k.current];for(let H=0;H<L;H++){let U=F.current[H].formState.file.value;if(N.current.has(U)||!U||!J$(U.type))continue;N.current.add(U);let le=await CI(U);ne[H]=le,k.current=ne,j([...ne]),await new Promise(De=>setTimeout(De,100))}})()},[L]);let{toggleLoadingOverlay:V}=rm(),{closeModal:M}=de(),{collectionSlug:O,drawerSlug:B,initialFiles:G,onSuccess:Y}=Wo(),[X,ee]=lt.useState(!1),[q,z]=lt.useState(""),re=lt.useRef(!1),me=lt.useRef(null),se=lt.useRef(()=>({})),Z=`${o}/${O}`,Q=lt.useCallback(async()=>{let ne={locale:r||void 0},H=`/${O}/access`,le=await(await fetch(`${n}${o}${H}?${tb.stringify(ne)}`,{credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"post"})).json(),De=await fetch(`${n}${o}${H}?${tb.stringify(ne)}`,{body:JSON.stringify({_status:"published"}),credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"POST"}).then(Ne=>Ne.json());p(le),b(ul({collectionSlug:O,docPermissions:le,isEditing:!1})),v(De?.update),w(!0)},[o,r,O,s.language,n]),ge=lt.useCallback(async ne=>{ne?.signal&&ne.abort("aborting previous fetch for initial form state without files");let H=await l({collectionSlug:O});d(H);try{let{state:U}=await a({collectionSlug:O,docPermissions:h,docPreferences:{fields:{}},locale:r,operation:"create",renderAllFields:!0,schemaPath:O,skipValidation:!0});me.current=U,y(!0)}catch{}},[l,O,a,h,r]),Ie=lt.useCallback(ne=>{let H=se.current();T({type:"REPLACE",state:{activeIndex:ne,forms:R.map((U,le)=>le===S?{errorCount:U.errorCount,formState:H}:U)}})},[R,S]),Fe=lt.useCallback(async ne=>{V({isLoading:!0,key:"addingDocs"}),C||await ge(),T({type:"ADD_FORMS",files:ne,initialState:me.current}),V({isLoading:!1,key:"addingDocs"})},[ge,C,V]),Le=lt.useCallback(ne=>{k.current=k.current.filter((H,U)=>!ne.includes(U)),j([...k.current])},[]),K=lt.useCallback(ne=>{T({type:"REMOVE_FORM",index:ne}),Le([ne])},[Le]),_e=lt.useCallback(({errorCount:ne,index:H})=>{T({type:"UPDATE_ERROR_COUNT",count:ne,index:H})},[]),pe=lt.useCallback(async({overrides:ne}={})=>{let H=se.current(),U=[...R];U[S]={errorCount:U[S].errorCount,formState:H};let le=[];ee(!0);for(let ke=0;ke<U.length;ke++)try{let ot=U[ke];z(i("general:uploadingBulk",{current:ke+1,total:U.length}));let Ft=await fetch(Z,{body:await wI(ot.formState,ne,O,c({collectionSlug:O})),method:"POST"}),Wt=await Ft.json();Ft.status===201&&Wt?.doc&&le.push(Wt.doc);let[mt,ze]=(Wt?.errors||[]).reduce(([rt,ue],ve)=>{let Ve=[],Ge=[];return ve?.message&&Ge.push(ve),Array.isArray(ve?.data?.errors)&&ve.data?.errors.forEach($e=>{$e?.path?Ve.push($e):Ge.push($e)}),[[...rt,...Ve],[...ue,...Ge]]},[[],[]]);U[ke]={errorCount:mt.length,formState:bc(U[ke].formState,{type:"ADD_SERVER_ERRORS",errors:mt})},(Ft.status===413||Ft.status===400)&&(U[ke]={...U[ke],errorCount:U[ke].errorCount+1},fe.error(ze[0]?.message))}catch{}m(!0),z(""),ee(!1);let De=[],Ne=[];U.forEach(({errorCount:ke},ot)=>{ke?De.push(U[ot]):Ne.push(ot)});let qe=Math.max(0,U.length-De.length),Ue=U.length-qe;qe&&(fe.success(`Successfully saved ${qe} files`),typeof Y=="function"&&Y(le,Ue),De.length&&Ne.length&&Le(Ne)),Ue?fe.error(`Failed to save ${Ue} files`):M(B),T({type:"REPLACE",state:{activeIndex:0,forms:De,totalErrorCount:De.reduce((ke,{errorCount:ot})=>ke+ot,0)}})},[Z,S,R,Le,Y,O,c,i,M,B]),ce=lt.useCallback(async(ne,H)=>{for(let U=0;U<R.length;U++)if(Object.entries(ne).forEach(([le,De])=>{R[U].formState[le]&&(R[U].formState[le].value=De,T({type:"UPDATE_FORM",errorCount:R[U].errorCount,formState:R[U].formState,index:U}))}),typeof H=="function"&&H(),f){let{state:le}=await a({collectionSlug:O,docPermissions:h,docPreferences:null,formState:R[U].formState,operation:"create",schemaPath:O}),De=Object.values(le).reduce((Ne,qe)=>qe?.valid===!1?Ne+1:Ne,0);T({type:"UPDATE_FORM",errorCount:De,formState:le,index:U})}},[O,h,R,a,f]);return lt.useEffect(()=>{O&&(C||ge(),I||Q(),G&&_(!C||!I),C&&G&&!re.current&&(Fe(G),re.current=!0))},[Fe,G,ge,Q,O,C,I]),Z$(SI,{value:{activeIndex:D.activeIndex,addFiles:Fe,bulkUpdateForm:ce,collectionSlug:O,docPermissions:h,documentSlots:u,forms:R,getFormDataRef:se,hasPublishPermission:x,hasSavePermission:g,hasSubmitted:f,isInitializing:A,removeFile:K,saveAllDocs:pe,setActiveIndex:Ie,setFormTotalErrorCount:_e,thumbnailUrls:P,totalErrorCount:E},children:[X&&Y$(vn,{animationDuration:"250ms",loadingText:q,overlayType:"fullscreen",show:!0}),t]})}function wo(){return lt.use(SI)}import{jsx as jr,jsxs as ob}from"react/jsx-runtime";import{getTranslation as aj}from"@payloadcms/translations";import{unflatten as EI}from"payload/shared";import lj,{useCallback as rb,useEffect as cj,useMemo as uj,useState as PI}from"react";import{c as oj}from"react/compiler-runtime";import{jsx as FI,jsxs as rj}from"react/jsx-runtime";import{useState as nj}from"react";var _I=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 Q$,fieldHasSubFields as K$,fieldIsHiddenOrDisabled as ej,getFieldPermissions as tj}from"payload/shared";import{fieldAffectsData as DI}from"payload/shared";var va=(t,e)=>t?DI(e)?`${t}.${e.name}`:t:DI(e)?e.name:"";import{jsx as Em,jsxs as TI}from"react/jsx-runtime";import{Fragment as AI}from"react";var wc=({CustomLabel:t,field:e,prefix:o})=>TI(AI,{children:[o?TI(AI,{children:[Em("span",{style:{display:"inline-block"},children:o})," > "]}):null,Em("span",{style:{display:"inline-block"},children:Em(oe,{CustomComponent:t,Fallback:Em(be,{label:"label"in e&&e.label})})})]});var Pm=({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((l,a)=>{let{operation:c,permissions:u,read:d}=tj({field:a,operation:"update",parentName:n?.includes(".")?n.split(".")[n.split(".").length-1]:n,permissions:s});if((Q$(a)||a.type==="ui")&&(a.admin?.disableBulkEdit||a.unique||ej(a)||"readOnly"in a&&a.readOnly||!c||!d))return l;if(!(a.type==="array"||a.type==="blocks")&&K$(a))return[...l,...Pm({fields:a.fields,labelPrefix:wc({CustomLabel:i,field:a,prefix:o}),parentPath:r,path:va(r,a),permissions:u})];if(a.type==="tabs"&&"tabs"in a)return[...l,...a.tabs.reduce((m,h)=>{if("fields"in h){let p="name"in h&&h.name;return[...m,...Pm({fields:h.fields,labelPrefix:o,parentPath:r,path:p?va(r,a):r,permissions:u})]}},[])];let f={label:wc({CustomLabel:i,field:a,prefix:o}),value:{field:a,fieldPermissions:u,path:va(r,a)}};return[...l,f]},[])};var sj="field-select",Nm=t=>{let e=oj(14),{fields:o,onChange:n,permissions:r}=t,{t:s}=$(),{dispatchFields:i,getFields:l}=Me(),a;e[0]!==o||e[1]!==l||e[2]!==r?(a=()=>Pm({fields:_I(o),formState:l(),permissions:r}),e[0]=o,e[1]=l,e[2]=r,e[3]=a):a=e[3];let[c]=nj(a),u;if(e[4]!==i||e[5]!==l||e[6]!==n||e[7]!==c||e[8]!==s){let d;e[10]!==i||e[11]!==l||e[12]!==n?(d=f=>n({dispatchFields:i,formState:l(),selected:f}),e[10]=i,e[11]=l,e[12]=n,e[13]=d):d=e[13],u=rj("div",{className:sj,children:[FI(be,{label:s("fields:selectFieldsToEdit")}),FI(yt,{getOptionValue:ij,isMulti:!0,onChange:d,options:c})]}),e[4]=i,e[5]=l,e[6]=n,e[7]=c,e[8]=s,e[9]=u}else u=e[9];return u};function ij(t){return typeof t.value=="object"&&"path"in t.value?String(t.value.path):String(t.value)}var NI=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,forms:i}=t,[l,a]=PI(!1),{permissions:c}=Se(),{i18n:u,t:d}=$(),{closeModal:f}=de(),{bulkUpdateForm:m}=wo(),{getFormState:h}=Dt(),p=lj.useRef(null),[g,b]=PI([]),x=c?.collections?.[r.slug],v=uj(()=>EI(g.reduce((w,A)=>(w[A.value.path]=!0,w),{})),[g]),C=rb(async({formState:w,submitted:A})=>{let _=er(p),{state:D}=await h({collectionSlug:r.slug,docPermissions:x,docPreferences:null,formState:w,operation:"update",schemaPath:r.slug,select:v,signal:_.signal,skipValidation:!A});return p.current=null,D},[h,r,x,v]);cj(()=>{let w=p.current;return()=>{Ko(w)}},[]);let y=rb(w=>{let A=g.reduce((_,D)=>(w[D.value.path]&&(_[D.value.path]=w[D.value.path].value),_),{});m(A,()=>f(s))},[f,s,m,g]),I=rb(async({dispatchFields:w,formState:A,selected:_})=>{a(!0),b(_||[]);let{state:D}=await h({collectionSlug:r.slug,docPermissions:x,docPreferences:null,formState:A,operation:"update",schemaPath:r.slug,select:EI(_.reduce((T,S)=>(T[S.value.path]=!0,T),{})),skipValidation:!0});w({type:"UPDATE_MANY",formState:D}),a(!1)},[h,r,x]);return ob("div",{className:`${fr}__main`,children:[ob("div",{className:`${fr}__header`,children:[jr("h2",{className:`${fr}__header__title`,children:d("general:editingLabel",{count:i.length,label:aj(i.length>1?o:n,u)})}),jr("button",{"aria-label":d("general:close"),className:`${fr}__header__close`,id:`close-drawer__${s}`,onClick:()=>f(s),type:"button",children:jr(pt,{})})]}),ob(wn,{className:`${fr}__form`,isInitializing:l,onChange:[C],onSubmit:y,children:[jr(Nm,{fields:e,onChange:I,permissions:x.fields}),g.length===0?null:jr("div",{className:"render-fields",children:g.map((w,A)=>{let{value:{field:_,fieldPermissions:D,path:T}}=w;return jr(xa,{clientFieldConfig:_,indexPath:"",parentPath:"",parentSchemaPath:"",path:T,permissions:D},`${T}-${A}`)})}),jr("div",{className:`${fr}__sidebar-wrap`,children:jr("div",{className:`${fr}__sidebar`,children:jr("div",{className:`${fr}__sidebar-sticky-wrap`,children:jr("div",{className:`${fr}__document-actions`,children:jr(ae,{type:"submit",children:d("general:applyChanges")})})})})})]})]})};var fr="edit-many-bulk-uploads",LI=t=>{let e=dj(5),{collection:o,collection:n}=t,{slug:r}=o===void 0?{}:o,{permissions:s}=Se(),{t:i}=$(),{forms:l}=wo(),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]!==l||e[3]!==i?(d=mj("div",{className:fr,children:[Lm(ar,{"aria-label":i("general:editAll"),className:`${fr}__toggle`,slug:u,children:i("general:editAll")}),Lm(Ts,{children:Lm(Pt,{Header:null,slug:u,children:Lm(NI,{collection:n,drawerSlug:u,forms:l})})})]}),e[0]=n,e[1]=u,e[2]=l,e[3]=i,e[4]=d):d=e[4],d};var Ca="bulk-upload--actions-bar";function $I(t){let e=kI(15),{collectionConfig:o}=t,{activeIndex:n,forms:r,setActiveIndex:s}=wo(),{t:i}=$(),l=n+1,a;if(e[0]!==n||e[1]!==o||e[2]!==r.length||e[3]!==s||e[4]!==i||e[5]!==l){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],a=Ic("div",{className:Ca,children:[Ic("div",{className:`${Ca}__navigation`,children:[Ic("p",{className:`${Ca}__locationText`,children:[Or("strong",{children:l})," of ",Or("strong",{children:r.length})]}),Ic("div",{className:`${Ca}__controls`,children:[Or(ae,{"aria-label":i("general:previous"),buttonStyle:"none",onClick:c,type:"button",children:Or(Je,{direction:"left"})}),Or(ae,{"aria-label":i("general:next"),buttonStyle:"none",onClick:u,type:"button",children:Or(Je,{direction:"right"})})]}),Or(LI,{collection:o})]}),Or(nb,{className:`${Ca}__saveButtons`})]}),e[0]=n,e[1]=o,e[2]=r.length,e[3]=s,e[4]=i,e[5]=l,e[6]=a}else a=e[6];return a}function nb(t){let e=kI(12),{className:o}=t,{getEntityConfig:n}=W(),{t:r}=$(),{collectionSlug:s,hasPublishPermission:i,hasSavePermission:l,saveAllDocs:a}=wo(),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=[`${Ca}__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]!==l||e[8]!==a||e[9]!==r||e[10]!==f?(m=Ic("div",{className:f,children:[u?.versions?.drafts&&l?Or(ae,{buttonStyle:"secondary",onClick:()=>void a({overrides:{_status:"draft"}}),children:r("version:saveDraft")}):null,u?.versions?.drafts&&i?Or(ae,{onClick:()=>void a({overrides:{_status:"published"}}),children:r("version:publish")}):null,!u?.versions?.drafts&&l?Or(ae,{onClick:()=>void a(),children:r("general:save")}):null]}),e[5]=u?.versions?.drafts,e[6]=i,e[7]=l,e[8]=a,e[9]=r,e[10]=f,e[11]=m):m=e[11],m}import{c as fj}from"react/compiler-runtime";import{jsx as pj}from"react/jsx-runtime";import"react";var Sc="bulk-upload--discard-without-saving";function jI(){let t=fj(9),{t:e}=$(),{closeModal:o}=de(),{drawerSlug:n}=Wo(),r;t[0]!==o?(r=()=>{o(Sc)},t[0]=o,t[1]=r):r=t[1];let s=r,i;t[2]!==o||t[3]!==n?(i=()=>{o(n),o(Sc)},t[2]=o,t[3]=n,t[4]=i):i=t[4];let l=i,a;return t[5]!==s||t[6]!==l||t[7]!==e?(a=pj(It,{body:e("general:changesNotSaved"),cancelLabel:e("general:stayOnThisPage"),confirmLabel:e("general:leaveAnyway"),heading:e("general:leaveWithoutSaving"),modalSlug:Sc,onCancel:s,onConfirm:l}),t[5]=s,t[6]=l,t[7]=e,t[8]=a):a=t[8],a}import{jsx as hs,jsxs as jj}from"react/jsx-runtime";import{useRouter as Oj,useSearchParams as Mj}from"next/navigation.js";import{formatAdminURL as Bj}from"payload/shared";import _a,{useCallback as sS,useEffect as Vj}from"react";import{c as hj}from"react/compiler-runtime";import{jsx as gj}from"react/jsx-runtime";import{createContext as bj,use as vj,useState as xj}from"react";var OI=bj({mostRecentUpdate:null,reportUpdate:t=>null}),sb=t=>{let e=hj(3),{children:o}=t,[n,r]=xj(null),s;return e[0]!==o||e[1]!==n?(s=gj(OI,{value:{mostRecentUpdate:n,reportUpdate:r},children:o}),e[0]=o,e[1]=n,e[2]=s):s=e[2],s},ai=()=>vj(OI);import{jsx as us,jsxs as MI}from"react/jsx-runtime";import{fieldIsSidebar as Cj}from"payload/shared";import{useMemo as yj}from"react";var pr="document-fields",Rc=({AfterFields:t,BeforeFields:e,Description:o,docPermissions:n,fields:r,forceSidebarWrap:s,readOnly:i,schemaPathSegments:l})=>{let{hasSidebarFields:a,mainFields:c,sidebarFields:u}=yj(()=>r.reduce((d,f)=>(Cj(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 MI("div",{className:[pr,a?`${pr}--has-sidebar`:`${pr}--no-sidebar`,s&&`${pr}--force-sidebar-wrap`].filter(Boolean).join(" "),children:[us("div",{className:`${pr}__main`,children:MI(Bo,{className:`${pr}__edit`,children:[o?us("header",{className:`${pr}__header`,children:us("div",{className:`${pr}__sub-header`,children:o})}):null,e,us(yo,{className:`${pr}__fields`,fields:c,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:l.join("."),permissions:n?.fields,readOnly:i}),t]})}),a?us("div",{className:`${pr}__sidebar-wrap`,children:us("div",{className:`${pr}__sidebar`,children:us("div",{className:`${pr}__sidebar-fields`,children:us(yo,{fields:u,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:l.join("."),permissions:n?.fields,readOnly:i})})})}):null]})};import{c as Nj}from"react/compiler-runtime";import{jsx as Rt,jsxs as gr}from"react/jsx-runtime";import{isImage as rS}from"payload/shared";import Pc,{Fragment as Lj,useCallback as Mm,useEffect as mb,useRef as oS,useState as Ec}from"react";import{jsx as St,jsxs as Eo}from"react/jsx-runtime";import jm,{useRef as Sa,useState as fs}from"react";import Mt,{PureComponent as wj,createRef as BI}from"react";var km={x:0,y:0,width:0,height:0,unit:"px"},ya=(t,e,o)=>Math.min(Math.max(t,e),o),Ij=(...t)=>t.filter(e=>e&&typeof e=="string").join(" "),VI=(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 wa(t,e,o){return t.unit==="%"?{...km,...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 ds(t,e,o){return t.unit?t.unit==="px"?{...km,...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}:{...km,...t,unit:"px"}}function GI(t,e,o,n,r,s=0,i=0,l=n,a=r){let c={...t},u=Math.min(s,n),d=Math.min(i,r),f=Math.min(l,n),m=Math.min(a,r);e&&(e>1?(u=i?i*e:u,d=u/e,f=l*e):(d=s?s/e:d,u=d*e,m=a/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 Sj(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 Ia={capture:!0,passive:!1},ms=class Mr extends wj{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=BI(),this.mediaRef=BI(),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=ds(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,l=!!i,a=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),a=u+r.x+h,c=d+r.y+p}this.evData={startClientX:a,startClientY:c,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:l,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,l=this.getBox();if(n||r||s&&o)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.clientX-l.x,c=e.clientY-l.y,u={unit:"px",x:a,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:a,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,i(ds(u,l.width,l.height),wa(u,l.width,l.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:l}=this;l.clientX=e.clientX,l.clientY=e.clientY;let a;l.isResize?a=this.resizeCrop():a=this.dragCrop(),VI(o,a)||r(ds(a,i.width,i.height),wa(a,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,l=!1;if(!o)return;let a=this.getBox(),c=this.makePixelCrop(a),u=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Mr.nudgeStepLarge:e.shiftKey?Mr.nudgeStepMedium:Mr.nudgeStep;if(i==="ArrowLeft"?(c.x-=u,l=!0):i==="ArrowRight"?(c.x+=u,l=!0):i==="ArrowUp"?(c.y-=u,l=!0):i==="ArrowDown"&&(c.y+=u,l=!0),l){e.cancelable&&e.preventDefault(),c.x=ya(c.x,0,a.width-c.width),c.y=ya(c.y,0,a.height-c.height);let d=ds(c,a.width,a.height),f=wa(c,a.width,a.height);r(d,f),s&&s(d,f)}},this.onHandlerKeyDown=(e,o)=>{let{aspect:n=0,crop:r,disabled:s,minWidth:i=0,minHeight:l=0,maxWidth:a,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)?Mr.nudgeStepLarge:e.shiftKey?Mr.nudgeStepMedium:Mr.nudgeStep,h=ds(r,f.width,f.height),p=Sj(h,e.key,m,o),g=GI(p,n,o,f.width,f.height,i,l,a,c);if(!VI(r,g)){let b=wa(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(ds(o,i.width,i.height),wa(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(ds(o,r,s),wa(o,r,s))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Ia),this.document.addEventListener("pointerup",this.onDocPointerDone,Ia),this.document.addEventListener("pointercancel",this.onDocPointerDone,Ia),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Ia),this.document.removeEventListener("pointerup",this.onDocPointerDone,Ia),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Ia),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=ya(e.startCropX+r,0,o.width-n.width),n.y=ya(e.startCropY+s,0,o.height-n.height),n}getPointRegion(e,o,n,r){let{evData:s}=this,i=s.clientX-e.x,l=s.clientY-e.y,a;r&&o?a=o==="nw"||o==="n"||o==="ne":a=l<s.startCropY;let c;return n&&o?c=o==="nw"||o==="w"||o==="sw":c=i<s.startCropX,c?a?"nw":"sw":a?"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,l]=this.resolveMinDimensions(s,o,this.props.minWidth,this.props.minHeight),a=this.makePixelCrop(s),c=this.getPointRegion(s,e.ord,i,l),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)),(l&&u==="nw"||u==="n"||u==="ne")&&(f=Math.min(f,-l));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=GI(m,o,c,s.width,s.height,i,l,n,r);return o||Mr.xyOrds.indexOf(u)>-1?a=h:Mr.xOrds.indexOf(u)>-1?(a.x=h.x,a.width=h.width):Mr.yOrds.indexOf(u)>-1&&(a.y=h.y,a.height=h.height),a.x=ya(a.x,0,s.width-a.width),a.y=ya(a.y,0,s.height-a.height),a}createCropSelection(){let{ariaLabels:e=Mr.defaultProps.ariaLabels,disabled:o,locked:n,renderSelectionAddon:r,ruleOfThirds:s,crop:i}=this.props,l=this.getCropStyle();if(i)return Mt.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!o&&!n&&Mt.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},Mt.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),Mt.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),Mt.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),Mt.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"nw"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"n"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"ne"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"e"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"se"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"s"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"sw"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"w"),role:"button"})),r&&Mt.createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:a=>a.stopPropagation()},r(this.state)),s&&Mt.createElement(Mt.Fragment,null,Mt.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),Mt.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){let o={...km,...this.props.crop||{}};return ds(o,e.width,e.height)}render(){let{aspect:e,children:o,circularCrop:n,className:r,crop:s,disabled:i,locked:l,style:a,ruleOfThirds:c}=this.props,{cropIsActive:u,newCropIsBeingDrawn:d}=this.state,f=s?this.createCropSelection():null,m=Ij("ReactCrop",r,u&&"ReactCrop--active",i&&"ReactCrop--disabled",l&&"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 Mt.createElement("div",{ref:this.componentRef,className:m,style:a},Mt.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},o),f)}};ms.xOrds=["e","w"];ms.yOrds=["n","s"];ms.xyOrds=["nw","ne","se","sw"];ms.nudgeStep=1;ms.nudgeStepMedium=10;ms.nudgeStepLarge=100;ms.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 WI=ms;import"react-image-crop/dist/ReactCrop.css";var vt="edit-upload",$m=t=>{let{name:e,onChange:o,ref:n,value:r}=t;return Eo("div",{className:`${vt}__input`,children:[e,St("input",{name:e,onChange:s=>o(s.target.value),ref:n,type:"number",value:r})]})},Rj={height:100,unit:"%",width:100,x:0,y:0},ib=({fileName:t,fileSrc:e,imageCacheTag:o,initialCrop:n,initialFocalPoint:r,onSave:s,showCrop:i,showFocalPoint:l})=>{let{closeModal:a}=de(),{t:c}=$(),[u,d]=fs(()=>({...Rj,...n||{}})),f={x:50,y:50},[m,h]=fs(()=>({...f,...r})),[p,g]=fs(!1),[b,x]=fs(0),[v,C]=fs(0),y=Sa(void 0),I=Sa(void 0),w=Sa(void 0),A=Sa(null),_=Sa(null),[D,T]=fs(!1),S=P=>{x(P.currentTarget.naturalHeight),C(P.currentTarget.naturalWidth),T(!0)},R=({dimension:P,value:j})=>{let V=parseInt(j);if(P==="width"&&V>=v||P==="height"&&V>=b)return null;let M=100*(V/(P==="width"?v:b));if(M===100||M===0)return null;d({...u,[P]:M})},E=({coordinate:P,value:j})=>{let V=parseInt(j);V>=0&&V<=100&&h(M=>({...M,[P]:V}))},F=()=>{typeof s=="function"&&s({crop:u||void 0,focalPoint:m,heightInPixels:Number(A?.current?.value??b),widthInPixels:Number(_?.current?.value??v)}),a(_c)},L=jm.useCallback(({x:P,y:j})=>{h({x:P,y:j}),g(!1)},[]),k=()=>{let P=y.current.getBoundingClientRect(),j=i?w.current.getBoundingClientRect():I.current.getBoundingClientRect(),V=(j.left-P.left+j.width/2)/P.width*100,M=(j.top-P.top+j.height/2)/P.height*100;h({x:V,y:M})},N=o?`${e}?${encodeURIComponent(o)}`:e;return Eo("div",{className:vt,children:[Eo("div",{className:`${vt}__header`,children:[Eo("h2",{title:`${c("general:editing")} ${t}`,children:[c("general:editing")," ",t]}),Eo("div",{className:`${vt}__actions`,children:[St(ae,{"aria-label":c("general:cancel"),buttonStyle:"secondary",className:`${vt}__cancel`,onClick:()=>a(_c),children:c("general:cancel")}),St(ae,{"aria-label":c("general:applyChanges"),buttonStyle:"primary",className:`${vt}__save`,disabled:!D,onClick:F,children:c("general:applyChanges")})]})]}),Eo("div",{className:`${vt}__toolWrap`,children:[St("div",{className:`${vt}__crop`,children:Eo("div",{className:`${vt}__focal-wrapper`,ref:y,style:{aspectRatio:`${v/b}`},children:[i?St(WI,{className:`${vt}__reactCrop`,crop:u,onChange:(P,j)=>d(j),onComplete:()=>g(!0),renderSelectionAddon:()=>St("div",{className:`${vt}__crop-window`,ref:w}),children:St("img",{alt:c("upload:setCropArea"),onLoad:S,ref:I,src:N})}):St("img",{alt:c("upload:setFocalPoint"),onLoad:S,ref:I,src:N}),l&&St(_j,{boundsRef:i?w:I,checkBounds:i?p:!1,className:`${vt}__focalPoint`,containerRef:y,initialPosition:m,onDragEnd:L,setCheckBounds:i?g:!1,children:St(jo,{})})]})}),(i||l)&&Eo("div",{className:`${vt}__sidebar`,children:[i&&Eo("div",{className:`${vt}__groupWrap`,children:[St("div",{children:Eo("div",{className:`${vt}__titleWrap`,children:[St("h3",{children:c("upload:crop")}),St(ae,{buttonStyle:"none",className:`${vt}__reset`,onClick:()=>d({height:100,unit:"%",width:100,x:0,y:0}),children:c("general:reset")})]})}),St("span",{className:`${vt}__description`,children:c("upload:cropToolDescription")}),Eo("div",{className:`${vt}__inputsWrap`,children:[St($m,{name:`${c("upload:width")} (px)`,onChange:P=>R({dimension:"width",value:P}),ref:_,value:(u.width/100*v).toFixed(0)}),St($m,{name:`${c("upload:height")} (px)`,onChange:P=>R({dimension:"height",value:P}),ref:A,value:(u.height/100*b).toFixed(0)})]})]}),l&&Eo("div",{className:`${vt}__groupWrap`,children:[St("div",{children:Eo("div",{className:`${vt}__titleWrap`,children:[St("h3",{children:c("upload:focalPoint")}),St(ae,{buttonStyle:"none",className:`${vt}__reset`,onClick:k,children:c("general:reset")})]})}),St("span",{className:`${vt}__description`,children:c("upload:focalPointDescription")}),Eo("div",{className:`${vt}__inputsWrap`,children:[St($m,{name:"X %",onChange:P=>E({coordinate:"x",value:P}),value:m.x.toFixed(0)}),St($m,{name:"Y %",onChange:P=>E({coordinate:"y",value:P}),value:m.y.toFixed(0)})]})]})]})]})]})},_j=({boundsRef:t,checkBounds:e,children:o,className:n,containerRef:r,initialPosition:s={x:50,y:50},onDragEnd:i,setCheckBounds:l})=>{let[a,c]=fs({x:s.x,y:s.y}),[u,d]=fs(!1),f=Sa(void 0),m=jm.useCallback((b,x,v)=>{let C=r.current.getBoundingClientRect(),y=t.current.getBoundingClientRect(),I=b??y.left,w=x??y.top,A=I<y.left||I>y.right,_=w<y.top||w>y.bottom,D=(I-C.left)/C.width*100,T=(w-C.top)/C.height*100,S=(y.left-C.left+y.width/2)/C.width*100,R=(y.top-C.top+y.height/2)/C.height*100;return(A||_)&&(d(!1),I<y.left?D=(y.left-C.left)/C.width*100:I>y.right&&(D=(C.width-(C.right-y.right))/C.width*100),w<y.top?T=(y.top-C.top)/C.height*100:w>y.bottom&&(T=(C.height-(C.bottom-y.bottom))/C.height*100),v&&(D=A?S:D,T=_?R:T)),{x:D,y:T}},[t,r]),h=b=>{b.preventDefault(),d(!0)},p=b=>{if(!u)return null;let{x,y:v}=m(b.clientX,b.clientY);c({x,y:v})},g=()=>{d(!1),i(a)};return jm.useEffect(()=>{if(!(u||!f.current)&&e){let{height:b,left:x,top:v,width:C}=f.current.getBoundingClientRect(),{x:y,y:I}=m(x+C/2,v+b/2,!0);i({x:y,y:I}),c({x:y,y:I}),l(!1);return}},[m,u,e,l,a.x,a.y,i]),jm.useEffect(()=>{c({x:s.x,y:s.y})},[s.x,s.y]),Eo("div",{className:[`${vt}__draggable-container`,u&&`${vt}__draggable-container--dragging`].filter(Boolean).join(" "),onMouseMove:p,children:[St("button",{className:[`${vt}__draggable`,n].filter(Boolean).join(" "),onMouseDown:h,onMouseUp:g,ref:f,style:{left:`${a.x}%`,top:`${a.y}%`},type:"button",children:o}),St("div",{})]})};import{jsx as QI}from"react/jsx-runtime";import"react";import{c as Dj}from"react/compiler-runtime";import{jsx as Rn,jsxs as ab}from"react/jsx-runtime";import"react";var ps="file-details-draggable",zI=t=>{let e=Dj(20),{collectionSlug:o,doc:n,hideRemoveFile:r,imageCacheTag:s,isSortable:i,removeItem:l,rowIndex:a,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]=Yt(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]!==l||e[12]!==a||e[13]!==f||e[14]!==c||e[15]!==m?(b=v=>ab("div",{className:[ps,v&&i&&`${ps}--has-drag-handle`].filter(Boolean).join(" "),ref:v.setNodeRef,style:{transform:v.transform,transition:v.transition,zIndex:v.isDragging?1:void 0},children:[ab("div",{className:`${ps}--drag-wrapper`,children:[i&&v&&Rn("div",{className:`${ps}__drag`,...v.attributes,...v.listeners,children:Rn(Bs,{})}),Rn(kr,{className:`${ps}__thumbnail`,collectionSlug:o,doc:n,fileSrc:f||m,imageCacheTag:s,uploadConfig:c})]}),Rn("div",{className:`${ps}__main-detail`,children:d}),ab("div",{className:`${ps}__actions`,children:[Rn(p,{}),Rn(g,{children:Rn(wr,{})}),!r&&l&&Rn(ae,{buttonStyle:"icon-label",className:`${ps}__remove`,icon:"x",iconStyle:"none",onClick:()=>l(a),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]=l,e[12]=a,e[13]=f,e[14]=c,e[15]=m,e[16]=b):b=e[16];let x;return e[17]!==u||e[18]!==b?(x=Rn(Gn,{id:u,children:b},u),e[17]=u,e[18]=b,e[19]=x):x=e[19],x};import{jsx as Fc,jsxs as JI}from"react/jsx-runtime";import"react";import{jsx as YI,jsxs as Tc}from"react/jsx-runtime";import{formatFilesize as Fj}from"payload/shared";import ZI from"react";import{jsx as HI,jsxs as XI}from"react/jsx-runtime";import{useRef as Tj,useState as UI}from"react";var Aj="copy-to-clipboard",Dc=({defaultMessage:t,successMessage:e,value:o})=>{let n=Tj(null),[r,s]=UI(!1),[i,l]=UI(!1),{t:a}=$();return o?XI("button",{className:Aj,onClick:()=>{n&&n.current&&(n.current.select(),n.current.setSelectionRange(0,o.length+1),document.execCommand("copy"),s(!0))},onMouseEnter:()=>{l(!0),s(!1)},onMouseLeave:()=>{l(!1),s(!1)},type:"button",children:[HI(bl,{}),XI(po,{delay:r?0:void 0,show:i||r,children:[r&&(e??a("general:copied")),!r&&(t??a("general:copy"))]}),HI("textarea",{readOnly:!0,ref:n,tabIndex:-1,value:o})]}):null};var lb="file-meta",Ac=t=>{let{filename:e,filesize:o,height:n,mimeType:r,url:s,width:i}=t;return Tc("div",{className:lb,children:[Tc("div",{className:`${lb}__url`,children:[YI("a",{href:s,rel:"noopener noreferrer",target:"_blank",children:e}),YI(Dc,{defaultMessage:"Copy URL",value:s})]}),Tc("div",{className:`${lb}__size-type`,children:[Fj(o),typeof i=="number"&&typeof n=="number"&&Tc(ZI.Fragment,{children:["\xA0-\xA0",i,"x",n]}),r&&Tc(ZI.Fragment,{children:["\xA0-\xA0",r]})]})]})};var Om="file-details",qI=t=>{let{customUploadActions:e,doc:o,enableAdjustments:n,handleRemove:r,hasImageSizes:s,hideRemoveFile:i,imageCacheTag:l,uploadConfig:a}=t,{filename:c,filesize:u,height:d,mimeType:f,thumbnailURL:m,url:h,width:p}=o,g=a.displayPreview??!0;return Fc("div",{className:Om,children:JI("header",{children:[g&&Fc(kr,{className:`${Om}__thumbnail`,doc:o,fileSrc:m||h,imageCacheTag:l,uploadConfig:a}),JI("div",{className:`${Om}__main-detail`,children:[Fc(Ac,{filename:c,filesize:u,height:d,mimeType:f,url:h,width:p}),(n||e)&&Fc(cb,{customActions:e,enableAdjustments:!!n,enablePreviewSizes:s&&o.filename,mimeType:f})]}),!i&&r&&Fc(ae,{buttonStyle:"icon-label",className:`${Om}__remove`,icon:"x",iconStyle:"with-border",onClick:r,round:!0})]})})};var ub=t=>{let{hasMany:e}=t;return e?QI(zI,{...t}):QI(qI,{...t})};import{jsx as Qr,jsxs as Ra}from"react/jsx-runtime";import{useEffect as Ej,useMemo as Pj,useState as KI}from"react";var hr="preview-sizes",eS=(t,e)=>{if(!e||e.length===0)return t;let o={};return e.forEach(({name:n})=>{t[n]&&(o[n]=t[n])}),o},tS=({name:t,active:e,meta:o,onClick:n,previewSrc:r})=>Ra("div",{className:[`${hr}__sizeOption`,e&&`${hr}--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:[Qr("div",{className:`${hr}__image`,children:Qr("img",{alt:o.filename,src:r})}),Ra("div",{className:`${hr}__sizeMeta`,children:[Qr("div",{className:`${hr}__sizeName`,children:t}),Qr(Ac,{...o})]})]}),db=({doc:t,imageCacheTag:e,uploadConfig:o})=>{let{imageSizes:n}=o,{sizes:r}=t,[s,i]=KI(()=>eS(r,n)),[l,a]=KI(null),c=m=>{if(!m.filename)return null;if(m.url)return`${m.url}${e?`?${encodeURIComponent(e)}`:""}`};Ej(()=>{i(eS(r,n))},[r,n,e]);let u=c(l?t.sizes[l]:t),d=Pj(()=>({filename:t.filename,filesize:t.filesize,height:t.height,mimeType:t.mimeType,url:t.url,width:t.width}),[t]),f="Original";return Ra("div",{className:hr,children:[Ra("div",{className:`${hr}__imageWrap`,children:[Ra("div",{className:`${hr}__meta`,children:[Qr("div",{className:`${hr}__sizeName`,children:l||f}),Qr(Ac,{...l?s[l]:d})]}),Qr("img",{alt:t.filename,className:`${hr}__preview`,src:u})]}),Qr("div",{className:`${hr}__listWrap`,children:Ra("div",{className:`${hr}__list`,children:[Qr(tS,{active:!l,meta:d,name:f,onClick:()=>a(null),previewSrc:c(t)}),Object.entries(s).map(([m,h])=>{let p=l===m,g=c(h);return g?Qr(tS,{active:p,meta:h,name:m,onClick:()=>a(m),previewSrc:g},m):null})]})})]})};var Zt="file-field",_c="edit-upload",nS="preview-sizes",kj=t=>!t&&t!==void 0?"A file is required.":!0,cb=t=>{let e=Nj(9),{customActions:o,enableAdjustments:n,enablePreviewSizes:r,mimeType:s}=t,{t:i}=$(),l,a;if(e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i){a=Symbol.for("react.early_return_sentinel");e:{let c=rS(s)&&s!=="image/svg+xml"&&s!=="image/jxl";if(!c&&(!o||o.length===0)){a=null;break e}let u;e[7]!==o?(u=o&&o.map($j),e[7]=o,e[8]=u):u=e[8],l=gr("div",{className:`${Zt}__upload-actions`,children:[c&&gr(Pc.Fragment,{children:[r&&Rt(ar,{className:`${Zt}__previewSizes`,slug:nS,children:i("upload:previewSizes")}),n&&Rt(ar,{className:`${Zt}__edit`,slug:_c,children:i("upload:editImage")})]}),u]})}e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=l,e[6]=a}else l=e[5],a=e[6];return a!==Symbol.for("react.early_return_sentinel")?a:l},Nc=t=>{let{collectionSlug:e,customActions:o,initialState:n,onChange:r,uploadConfig:s}=t,{config:{routes:{api:i},serverURL:l}}=W(),{t:a}=$(),{setModified:c}=Me(),{resetUploadEdits:u,updateUploadEdits:d,uploadEdits:f}=hn(),{id:m,docPermissions:h,savedDocumentData:p,setUploadStatus:g}=Ae(),b=$o(),{errorMessage:x,setValue:v,showError:C,value:y}=Te({path:"file",validate:kj}),[I,w]=Ec(null),[A,_]=Ec(!1),[D,T]=Ec(y?.name||""),[S,R]=Ec(!1),[E,F]=Ec(""),L=oS(null),k=oS(null),N=typeof s?.pasteURL=="object"&&s.pasteURL.allowList?.length>0,P=Mm(Q=>{Q instanceof File&&w(URL.createObjectURL(Q)),v(Q),R(!1),typeof r=="function"&&r(Q)},[r,v]),j=(Q,ge)=>new File([Q],ge,{type:Q.type,lastModified:Q.lastModified}),V=Pc.useCallback(Q=>{let ge=Q.target.value;y&&(P(j(y,ge)),T(ge))},[P,y]),M=Mm(Q=>{let ge=Q?.[0];P(ge)},[P]),O=Mm(()=>{_(!0),P(null),w(""),F(""),u(),R(!1)},[P,u]),B=Mm(Q=>{c(!0),d(Q)},[c,d]),G=async()=>{if(!(!E||s?.pasteURL===!1)){g("uploading");try{let Q=await fetch(E);if(!Q.ok)throw new Error(`Fetch failed with status: ${Q.status}`);let ge=await Q.blob(),Ie=decodeURIComponent(E.split("/").pop()||""),Fe=new File([ge],Ie,{type:ge.type});P(Fe),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)}`,ge=await fetch(`${l}${i}${Q}`);if(!ge.ok)throw new Error(`Fetch failed with status: ${ge.status}`);let Ie=await ge.blob(),Fe=decodeURIComponent(E.split("/").pop()||""),Le=new File([Ie],Fe,{type:Ie.type});P(Le),g("idle")}catch{fe.error("The provided URL is not allowed."),g("failed")}}};mb(()=>{n?.file?.value instanceof File&&(w(URL.createObjectURL(n.file.value)),_(!1))},[n]),mb(()=>{S&&L.current},[S]),mb(()=>{b&&_(!1)},[b]);let Y=h?.update&&"delete"in h&&h?.delete,X=s?.imageSizes?.length>0,ee=!!s?.resizeOptions,q=s?.focalPoint===!0,{crop:z=!0,focalPoint:re=!0}=s,me=re&&(X||ee||q),se=s.mimeTypes?.join(", "),Z=s?.cacheTags&&p?.updatedAt;return s.hideFileInputOnCreate&&!p?.filename?null:gr("div",{className:[Ce,Zt].filter(Boolean).join(" "),children:[Rt(Xe,{message:x,showError:C}),p&&p.filename&&!A&&Rt(ub,{collectionSlug:e,customUploadActions:o,doc:p,enableAdjustments:z||me,handleRemove:Y?O:void 0,hasImageSizes:X,hideRemoveFile:s.hideRemoveFile,imageCacheTag:Z,uploadConfig:s}),(!s.hideFileInputOnCreate&&!p?.filename||A)&&gr("div",{className:`${Zt}__upload`,children:[!y&&!S&&Rt(ii,{onChange:M,children:gr("div",{className:`${Zt}__dropzoneContent`,children:[gr("div",{className:`${Zt}__dropzoneButtons`,children:[Rt(ae,{buttonStyle:"pill",onClick:()=>{k.current&&k.current.click()},size:"small",children:a("upload:selectFile")}),Rt("input",{accept:se,"aria-hidden":"true",className:`${Zt}__hidden-input`,hidden:!0,onChange:Q=>{Q.target.files&&Q.target.files.length>0&&M(Q.target.files)},ref:k,type:"file"}),s?.pasteURL!==!1&&gr(Lj,{children:[Rt("span",{className:`${Zt}__orText`,children:a("general:or")}),Rt(ae,{buttonStyle:"pill",onClick:()=>{R(!0)},size:"small",children:a("upload:pasteURL")})]})]}),gr("p",{className:`${Zt}__dragAndDropText`,children:[a("general:or")," ",a("upload:dragAndDrop")]})]})}),S&&gr(Pc.Fragment,{children:[gr("div",{className:`${Zt}__remote-file-wrap`,children:[Rt("input",{className:`${Zt}__remote-file`,onChange:Q=>{F(Q.target.value)},ref:L,type:"text",value:E}),Rt("div",{className:`${Zt}__add-file-wrap`,children:Rt("button",{className:`${Zt}__add-file`,onClick:()=>{G()},type:"button",children:a("upload:addFile")})})]}),Rt(ae,{buttonStyle:"icon-label",className:`${Zt}__remove`,icon:"x",iconStyle:"with-border",onClick:()=>{R(!1)},round:!0,tooltip:a("general:cancel")})]}),y&&I&&gr(Pc.Fragment,{children:[Rt("div",{className:`${Zt}__thumbnail-wrap`,children:Rt(kr,{collectionSlug:e,fileSrc:rS(y.type)?I:null})}),gr("div",{className:`${Zt}__file-adjustments`,children:[Rt("input",{className:`${Zt}__filename`,onChange:V,type:"text",value:D||y.name}),Rt(cb,{customActions:o,enableAdjustments:z||me,enablePreviewSizes:X&&p?.filename&&!A,mimeType:y.type})]}),Rt(ae,{buttonStyle:"icon-label",className:`${Zt}__remove`,icon:"x",iconStyle:"with-border",onClick:O,round:!0,tooltip:a("general:cancel")})]})]}),(y||p?.filename)&&Rt(Ts,{children:Rt(Pt,{Header:null,slug:_c,children:Rt(ib,{fileName:y?.name||p?.filename,fileSrc:p?.url||I,imageCacheTag:Z,initialCrop:f?.crop??void 0,initialFocalPoint:{x:f?.focalPoint?.x||p?.focalX||50,y:f?.focalPoint?.y||p?.focalY||50},onSave:B,showCrop:z,showFocalPoint:me})})}),p&&X&&Rt(Pt,{className:`${Zt}__previewDrawer`,hoverTitle:!0,slug:nS,title:a("upload:sizesFor",{label:p.filename}),children:Rt(db,{doc:p,imageCacheTag:Z,uploadConfig:s})})]})};function $j(t,e){return Rt(Pc.Fragment,{children:t},e)}var Gj="collection-edit";function iS({submitted:t}){let{action:e,collectionSlug:o,docPermissions:n,getDocPreferences:r,hasSavePermission:s,initialState:i,isEditing:l,isInitializing:a,Upload:c}=Ae(),{onSave:u}=Zl(),{getFormState:d}=Dt(),{config:{routes:{admin:f}},getEntityConfig:m}=W(),h=_a.useRef(null),p=m({collectionSlug:o}),g=Oj(),b=ut(),x=Mj(),{reportUpdate:v}=ai(),{resetUploadEdits:C}=hn(),{startRouteTransition:y}=it(),I=x.get("locale"),w=p.slug,[A]=_a.useState(w),_=sS(T=>{if(v({entitySlug:w,updatedAt:T?.result?.updatedAt||new Date().toISOString()}),typeof u=="function"&&u({...T,operation:"create"}),!l&&b<2){let S=Bj({adminRoute:f,path:`/collections/${w}/${T?.doc?.id}${I?`?locale=${I}`:""}`});y(()=>g.push(S))}else C()},[f,w,b,l,I,u,v,C,g,y]),D=sS(async({formState:T,submitted:S})=>{let R=er(h),E=await r(),{state:F}=await d({collectionSlug:w,docPermissions:n,docPreferences:E,formState:T,operation:"create",schemaPath:A,signal:R.signal,skipValidation:!S});return h.current=null,F},[w,A,r,d,n]);return Vj(()=>{let T=h.current;return()=>{Ko(T)}},[]),hs(ml,{operation:"create",children:hs(fb,{children:jj(wn,{action:e,className:`${Gj}__form`,disabled:a||!s,initialState:a?void 0:i,isInitializing:a,method:"POST",onChange:[D],onSuccess:_,submitted:t,children:[hs(Rc,{BeforeFields:hs(_a.Fragment,{children:c||hs(Nc,{collectionSlug:p.slug,initialState:i,uploadConfig:p.upload})}),docPermissions:n,fields:p.fields,schemaPathSegments:[p.slug]}),hs(zj,{}),hs(Wj,{})]})})})}function Wj(){let{getFields:t}=Me(),{getFormDataRef:e}=wo();return _a.useEffect(()=>{e.current=t},[t,e]),null}function zj(){let{docConfig:t}=Ae(),{activeIndex:e,setFormTotalErrorCount:o}=wo(),n=_a.useRef(0),r=_a.useCallback(s=>{s!==n.current&&(o({errorCount:s,index:e}),n.current=s)},[e,o]);return t?hs(Ws,{fields:t.fields,path:[],setErrorCount:r}):null}import{c as Hj}from"react/compiler-runtime";import{jsx as Lt,jsxs as Br}from"react/jsx-runtime";import{isImage as Xj}from"payload/shared";import Uj from"react";var Bm="bulk-upload-drawer--add-more-files",xt="file-selections";function aS(){let t=Hj(36),{activeIndex:e,addFiles:o,forms:n,isInitializing:r,removeFile:s,setActiveIndex:i,thumbnailUrls:l,totalErrorCount:a}=wo(),{initialFiles:c,maxFiles:u}=Wo(),{i18n:d,t:f}=$(),{closeModal:m,openModal:h}=de(),[p,g]=Uj.useState(!1),{breakpoints:b}=xo(),x;t[0]!==s?(x=S=>{s(S)},t[0]=s,t[1]=x):x=t[1];let v=x,C;t[2]!==o||t[3]!==m?(C=S=>{o(S),m(Bm)},t[2]=o,t[3]=m,t[4]=C):C=t[4];let y=C,I=Jj,w=r?c.length:n.length,A=p&&`${xt}__showingFiles`,_;t[5]!==A?(_=[xt,A].filter(Boolean),t[5]=A,t[6]=_):_=t[6];let D=_.join(" "),T;if(t[7]!==e||t[8]!==b.m||t[9]!==m||t[10]!==n||t[11]!==y||t[12]!==v||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]!==D||t[22]!==l||t[23]!==a||t[24]!==w){let S;t[26]===Symbol.for("react.memo_cache_sentinel")?(S=()=>g(Zj),t[26]=S):S=t[26];let R;t[27]!==m?(R=()=>m(Bm),t[27]=m,t[28]=R):R=t[28];let E;t[29]!==e||t[30]!==v||t[31]!==d||t[32]!==i||t[33]!==f||t[34]!==l?(E=(F,L)=>{let{errorCount:k,formState:N}=F,P=N?.file?.value||{};return Br("div",{className:[`${xt}__fileRowContainer`,L===e&&`${xt}__fileRowContainer--active`,k&&k>0&&`${xt}__fileRowContainer--error`].filter(Boolean).join(" "),children:[Br("button",{className:`${xt}__fileRow`,onClick:()=>i(L),type:"button",children:[Lt(kr,{className:`${xt}__thumbnail`,fileSrc:Xj(P.type)?l[L]:null}),Lt("div",{className:`${xt}__fileDetails`,children:Lt("p",{className:`${xt}__fileName`,title:P.name,children:P.name||f("upload:noFile")})}),P instanceof File?Lt("p",{className:`${xt}__fileSize`,children:I(P)}):null,Lt("div",{className:`${xt}__remove ${xt}__remove--underlay`,children:Lt(pt,{})}),k?Lt(to,{className:`${xt}__errorCount`,count:k,i18n:d}):null]}),Lt("button",{"aria-label":f("general:remove"),className:`${xt}__remove ${xt}__remove--overlay`,onClick:()=>v(L),type:"button",children:Lt(pt,{})})]},L)},t[29]=e,t[30]=v,t[31]=d,t[32]=i,t[33]=f,t[34]=l,t[35]=E):E=t[35],T=Br("div",{className:D,children:[b.m&&p?Lt("div",{className:`${xt}__mobileBlur`}):null,Br("div",{className:`${xt}__header`,children:[Br("div",{className:`${xt}__headerTopRow`,children:[Br("div",{className:`${xt}__header__text`,children:[Lt(to,{count:a,i18n:d,withMessage:!0}),Lt("p",{children:Br("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})})]}),Br("div",{className:`${xt}__header__actions`,children:[typeof u!="number"||w<u?Lt(bt,{className:`${xt}__header__addFile`,onClick:()=>h(Bm),children:f("upload:addFile")}):null,Br(ae,{buttonStyle:"transparent",className:`${xt}__toggler`,onClick:S,children:[Lt("span",{className:`${xt}__toggler__label`,children:Br("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})}),Lt(Je,{direction:p?"down":"up"})]}),Lt(Pt,{gutter:!1,Header:null,slug:Bm,children:Lt(Fm,{onCancel:R,onDrop:y})})]})]}),Lt("div",{className:`${xt}__header__mobileDocActions`,children:Lt(nb,{})})]}),Lt("div",{className:`${xt}__animateWrapper`,children:Lt(_r,{height:!b.m||p?"auto":0,children:Br("div",{className:`${xt}__filesContainer`,children:[r&&n.length===0&&c.length>0?Array.from(c).map(Yj):null,n.map(E)]})})})]}),t[7]=e,t[8]=b.m,t[9]=m,t[10]=n,t[11]=y,t[12]=v,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]=D,t[22]=l,t[23]=a,t[24]=w,t[25]=T}else T=t[25];return T}function Yj(t,e){return Lt(wt,{animationDelay:`calc(${e} * 60ms)`,height:"35px"},e)}function Zj(t){return!t}function Jj(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 lS="bulk-upload--file-manager";function cS(){let t=qj(16),{activeIndex:e,collectionSlug:o,docPermissions:n,documentSlots:r,forms:s,hasPublishPermission:i,hasSavePermission:l,hasSubmitted:a}=wo(),c=s[e],{getEntityConfig:u}=W(),{i18n:d}=$(),{user:f}=Se(),{openModal:m}=de(),h;if(t[0]!==c||t[1]!==e||t[2]!==o||t[3]!==n||t[4]!==r||t[5]!==s.length||t[6]!==u||t[7]!==i||t[8]!==l||t[9]!==a||t[10]!==d||t[11]!==m||t[12]!==f){let p=u({collectionSlug:o}),g;t[14]!==m?(g=()=>m(Sc),t[14]=m,t[15]=g):g=t[15],h=pb("div",{className:lS,children:[Lc(aS,{}),pb("div",{className:`${lS}__editView`,children:[Lc(ba,{onClose:g,title:Qj(p.labels.singular,d)}),c?pb(dl,{collectionSlug:o,currentEditor:f,docPermissions:n,hasPublishedDoc:!1,hasPublishPermission:i,hasSavePermission:l,id:null,initialData:Kj(c.formState,!0),initialState:c.formState,isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,Upload:r.Upload,versionCount:0,children:[Lc($I,{collectionConfig:p}),Lc(iS,{submitted:a})]},`${e}-${s.length}`):null]}),Lc(jI,{})]}),t[0]=c,t[1]=e,t[2]=o,t[3]=n,t[4]=r,t[5]=s.length,t[6]=u,t[7]=i,t[8]=l,t[9]=a,t[10]=d,t[11]=m,t[12]=f,t[13]=h}else h=t[13];return h}var oO="bulk-upload-drawer-slug";function rO(){let{addFiles:t,forms:e,isInitializing:o}=wo(),{closeModal:n}=de(),{collectionSlug:r,drawerSlug:s}=Wo(),{getEntityConfig:i}=W(),{t:l}=$(),u=i({collectionSlug:r})?.upload?.mimeTypes,d=Kr.useCallback(f=>{let m=new DataTransfer;for(let h of f)(u===void 0||u.length===0||tO(h.type,u))&&m.items.add(h);m.files.length===0?fe.error(l("error:invalidFileType")):t(m.files)},[t,l,u]);return r?!e.length&&!o?li(Fm,{acceptMimeTypes:u?.join(", "),onCancel:()=>n(s),onDrop:d}):li(cS,{}):null}function dS(){let t=uS(2),{drawerSlug:e}=Wo(),o;return t[0]!==e?(o=li(Pt,{gutter:!1,Header:null,slug:e,children:li(RI,{children:li(rO,{})})}),t[0]=e,t[1]=o):o=t[1],o}var mS=Kr.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 fb(t){let e=uS(16),{children:o}=t,[n,r]=Kr.useState(),[s,i]=Kr.useState(),[l,a]=Kr.useState(),[c,u]=Kr.useState(void 0),[d,f]=Kr.useState(void 0),[m,h]=Kr.useState(void 0),p=fS(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=w=>{r(w)},e[0]=g):g=e[0];let b=g,x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=(w,A)=>{i(_=>({..._,[w]:A}))},e[1]=x):x=e[1];let v=x,C;e[2]!==l?(C=()=>{typeof l=="function"&&l()},e[2]=l,e[3]=C):C=e[3];let y;e[4]!==m||e[5]!==s?(y=(w,A)=>{if(s&&Object.hasOwn(s,m)){let _=s[m];_(w,A)}},e[4]=m,e[5]=s,e[6]=y):y=e[6];let I;return e[7]!==o||e[8]!==n||e[9]!==m||e[10]!==p||e[11]!==c||e[12]!==d||e[13]!==C||e[14]!==y?(I=li(mS,{value:{collectionSlug:n,currentActivePath:m,drawerSlug:p,initialFiles:c,maxFiles:d,onCancel:C,onSuccess:y,setCollectionSlug:b,setCurrentActivePath:h,setInitialFiles:u,setMaxFiles:f,setOnCancel:a,setOnSuccess:v},children:eO(Kr.Fragment,{children:[o,li(dS,{})]})}),e[7]=o,e[8]=n,e[9]=m,e[10]=p,e[11]=c,e[12]=d,e[13]=C,e[14]=y,e[15]=I):I=e[15],I}var Wo=()=>Kr.use(mS);function fS(){let t=Li();return`${oO}-${t||1}`}import{c as iO}from"react/compiler-runtime";import{jsx as Gm}from"react/jsx-runtime";import{createElement as aO}from"react";import{useEffect as bS,useId as lO,useState as vS}from"react";import{jsx as pS,jsxs as nO}from"react/jsx-runtime";import{hoistQueryParamsToAnd as sO}from"payload/shared";import{useCallback as Vm,useEffect as hS,useState as hb}from"react";var gS=({allowCreate:t=!0,collectionSlugs:e,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,filterOptions:s,onBulkSelect:i,onSelect:l,overrideEntityVisibility:a=!0,selectedCollection:c})=>{let{closeModal:u,isModalOpen:d}=de(),{serverFunction:f}=Dt(),[m,h]=hb(void 0),[p,g]=hb(!0),{config:{collections:b},getEntityConfig:x}=W(),v=d(n),C=b.filter(({slug:F})=>e.includes(F)),[y,I]=hb(()=>{let F=c||C[0]?.slug,L=x({collectionSlug:F});return L?{label:L.labels,value:L.slug}:void 0}),[w,A,{drawerSlug:_}]=Yt({collectionSlug:y.value}),D=Jt(F=>{F&&F!==y?.value&&I({label:x({collectionSlug:F})?.labels,value:F})});hS(()=>{D(c)},[c]);let T=Vm(async(F,L)=>{try{let k={...L||{},where:{...L?.where||{}}},N=s?.[F];s&&typeof N!="boolean"&&(k.where=sO(k.where,N));let{List:P}=await f({name:"render-list",args:{allowCreate:t,collectionSlug:F,disableBulkDelete:!0,disableBulkEdit:!0,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,overrideEntityVisibility:a,query:k}});h(P),g(!1)}catch(k){console.error("Error rendering List View: ",k),v&&u(n)}},[f,u,t,n,v,r,s,a,o]);hS(()=>{m||T(y.value)},[T,m,y.value]);let S=Vm(({doc:F})=>{typeof l=="function"&&l({collectionSlug:y.value,doc:F,docID:F.id}),u(_),u(n)},[u,_,n,l,y.value]),R=Vm(F=>{T(y.value,F)},[T,y.value]),E=Vm(F=>{I(F),T(F.value)},[T]);return p?pS(vn,{}):nO(og,{allowCreate:t,createNewDrawerSlug:_,DocumentDrawerToggler:A,drawerSlug:n,enabledCollections:e,onBulkSelect:i,onQueryChange:R,onSelect:l,selectedOption:y,setSelectedOption:E,children:[m,pS(w,{onSave:S})]})};var xS="list-drawer",cO=({depth:t,uuid:e})=>`list-drawer_${t}_${e}`,uO=({children:t,className:e,disabled:o,drawerSlug:n,onClick:r,...s})=>Gm(ar,{className:[e,`${xS}__toggler`].filter(Boolean).join(" "),disabled:o,onClick:r,slug:n,...s,children:t}),dO=t=>{let{drawerSlug:e}=t;return Gm(Pt,{className:xS,gutter:!1,Header:null,slug:e,children:Gm(gS,{...t})})},kc=t=>{let e=iO(42),{collectionSlugs:o,filterOptions:n,selectedCollection:r,uploads:s}=t,{config:i}=W(),{collections:l}=i,a=ut(),c=lO(),{closeModal:u,modalState:d,openModal:f,toggleModal:m}=de(),[h,p]=vS(!1),[g,b]=vS(o),x;e[0]!==a||e[1]!==c?(x=cO({depth:a,uuid:c}),e[0]=a,e[1]=c,e[2]=x):x=e[2];let v=x,C,y;e[3]!==v||e[4]!==d?(C=()=>{p(!!d[v]?.isOpen)},y=[d,v],e[3]=v,e[4]=d,e[5]=C,e[6]=y):(C=e[5],y=e[6]),bS(C,y);let I,w;e[7]!==g||e[8]!==l||e[9]!==s?(I=()=>{if(!g||g.length===0){let B=l.filter(G=>{let{upload:Y}=G;return s?!!Y:!0});b(B.map(mO))}},w=[g,s,l],e[7]=g,e[8]=l,e[9]=s,e[10]=I,e[11]=w):(I=e[10],w=e[11]),bS(I,w);let A;e[12]!==v||e[13]!==m?(A=()=>{m(v)},e[12]=v,e[13]=m,e[14]=A):A=e[14];let _=A,D;e[15]!==u||e[16]!==v?(D=()=>{u(v)},e[15]=u,e[16]=v,e[17]=D):D=e[17];let T=D,S;e[18]!==v||e[19]!==f?(S=()=>{f(v)},e[18]=v,e[19]=f,e[20]=S):S=e[20];let R=S,E,F;e[21]!==T||e[22]!==g||e[23]!==v||e[24]!==n||e[25]!==r||e[26]!==s?(F=B=>aO(dO,{...B,closeDrawer:T,collectionSlugs:g,drawerSlug:v,filterOptions:n,key:v,selectedCollection:r,uploads:s}),e[21]=T,e[22]=g,e[23]=v,e[24]=n,e[25]=r,e[26]=s,e[27]=F):F=e[27],E=F;let L=E,k,N;e[28]!==v?(N=B=>Gm(uO,{...B,drawerSlug:v}),e[28]=v,e[29]=N):N=e[29],k=N;let P=k,j,V;e[30]!==T||e[31]!==g||e[32]!==a||e[33]!==v||e[34]!==h||e[35]!==R||e[36]!==_?(V={closeDrawer:T,collectionSlugs:g,drawerDepth:a,drawerSlug:v,isDrawerOpen:h,openDrawer:R,setCollectionSlugs:b,toggleDrawer:_},e[30]=T,e[31]=g,e[32]=a,e[33]=v,e[34]=h,e[35]=R,e[36]=_,e[37]=V):V=e[37],j=V;let M=j,O;return e[38]!==L||e[39]!==M||e[40]!==P?(O=[L,P,M],e[38]=L,e[39]=M,e[40]=P,e[41]=O):O=e[41],O};function mO(t){let{slug:e}=t;return e}import{c as gO}from"react/compiler-runtime";import{jsx as ui,jsxs as bO}from"react/jsx-runtime";import"react";import{c as fO}from"react/compiler-runtime";import{jsx as ci,jsxs as Wm}from"react/jsx-runtime";import{formatFilesize as pO}from"payload/shared";import"react";var _n="upload-relationship-details";function zm(t){let e=fO(34),{id:o,allowEdit:n,allowRemove:r,alt:s,byteSize:i,className:l,collectionSlug:a,displayPreview:c,filename:u,mimeType:d,onRemove:f,reloadDoc:m,src:h,thumbnailSrc:p,withMeta:g,x:b,y:x}=t,v=g===void 0?!0:g,{config:C}=W(),y;e[0]!==a||e[1]!==C?(y="collections"in C?C.collections.find(O=>O.slug===a):void 0,e[0]=a,e[1]=C,e[2]=y):y=e[2];let I=y,w=h?o:void 0,A;e[3]!==a||e[4]!==w?(A={id:w,collectionSlug:a},e[3]=a,e[4]=w,e[5]=A):A=e[5];let[_,,D]=Yt(A),{openDrawer:T}=D,S;e[6]!==a||e[7]!==m?(S=async O=>{let{doc:B}=O;return m(B.id,a)},e[6]=a,e[7]=m,e[8]=S):S=e[8];let R=S,E;e[9]!==b||e[10]!==x?(E=function(B,G){let Y=[];return G&&Y.push(pO(G)),b&&x&&Y.push(`${b}x${x}`),B&&Y.push(B),Y.join(" \u2014 ")},e[9]=b,e[10]=x,e[11]=E):E=e[11];let L=v?E(d,i):"",k=c??I.upload?.displayPreview??!0,N;e[12]!==l?(N=[_n,l].filter(Boolean),e[12]=l,e[13]=N):N=e[13];let P=N.join(" "),j;e[14]!==s||e[15]!==u||e[16]!==k||e[17]!==p?(j=k&&ci(l3,{alt:s,className:`${_n}__thumbnail`,filename:u,fileSrc:p,size:"small"}),e[14]=s,e[15]=u,e[16]=k,e[17]=p,e[18]=j):j=e[18];let V;e[19]!==u||e[20]!==h?(V=h?ci("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]!==L||e[26]!==f||e[27]!==R||e[28]!==T||e[29]!==V||e[30]!==P||e[31]!==j||e[32]!==v?(M=Wm("div",{className:P,children:[Wm("div",{className:`${_n}__imageAndDetails`,children:[j,Wm("div",{className:`${_n}__details`,children:[ci("p",{className:`${_n}__filename`,children:V}),v?ci("p",{className:`${_n}__meta`,children:L}):null]})]}),n!==!1||r!==!1?Wm("div",{className:`${_n}__actions`,children:[n!==!1?ci(ae,{buttonStyle:"icon-label",className:`${_n}__edit`,icon:"edit",iconStyle:"none",onClick:T}):null,r!==!1?ci(ae,{buttonStyle:"icon-label",className:`${_n}__remove`,icon:"x",iconStyle:"none",onClick:()=>f()}):null,ci(_,{onSave:R})]}):null]}),e[22]=_,e[23]=n,e[24]=r,e[25]=L,e[26]=f,e[27]=R,e[28]=T,e[29]=V,e[30]=P,e[31]=j,e[32]=v,e[33]=M):M=e[33],M}import{jsx as hO}from"react/jsx-runtime";import"react";var CS="upload-field-card";function Hm({children:t,className:e,size:o="medium"}){return hO("div",{className:[CS,e,`${CS}--size-${o}`].filter(Boolean).join(" "),children:t})}var $c="upload upload--has-many";function yS(t){let e=gO(27),{className:o,displayPreview:n,fileDocs:r,isSortable:s,onRemove:i,onReorder:l,readonly:a,reloadDoc:c,serverURL:u}=t,d;e[0]!==r||e[1]!==l?(d=(x,v)=>{if(x===v)return;let C=[...r],[y]=C.splice(x,1);C.splice(v,0,y),l(C)},e[0]=r,e[1]=l,e[2]=d):d=e[2];let f=d,m;e[3]!==r||e[4]!==i?(m=x=>{let v=[...r||[]];v.splice(x,1),i(v.length===0?[]:v)},e[3]=r,e[4]=i,e[5]=m):m=e[5];let h=m,p;e[6]!==o?(p=[$c,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]!==a||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==g){let x;e[18]!==f?(x=C=>{let{moveFromIndex:y,moveToIndex:I}=C;return f(y,I)},e[18]=f,e[19]=x):x=e[19];let v;e[20]!==n||e[21]!==s||e[22]!==a||e[23]!==c||e[24]!==h||e[25]!==u?(v=(C,y)=>{let{relationTo:I,value:w}=C,A=String(w.id),_,D;if(w.url)try{_=new URL(w.url,u).toString()}catch{_=`${u}${w.url}`}if(w.thumbnailURL)try{D=new URL(w.thumbnailURL,u).toString()}catch{D=`${u}${w.thumbnailURL}`}return ui(Gn,{disabled:!s||a,id:A,children:T=>ui("div",{className:[`${$c}__dragItem`,T&&s&&`${$c}--has-drag-handle`].filter(Boolean).join(" "),ref:T.setNodeRef,style:{transform:T.transform,transition:T.transition,zIndex:T.isDragging?1:void 0},children:bO(Hm,{size:"small",children:[T&&ui("div",{className:`${$c}__drag`,...T.attributes,...T.listeners,children:ui(Bs,{})}),ui(zm,{allowEdit:!a,allowRemove:!a,alt:w?.alt||w?.filename,byteSize:w.filesize,collectionSlug:I,displayPreview:n,filename:w.filename,id:A,mimeType:w?.mimeType,onRemove:()=>h(y),reloadDoc:c,src:_,thumbnailSrc:D||_,withMeta:!1,x:w?.width,y:w?.height})]})})},A)},e[20]=n,e[21]=s,e[22]=a,e[23]=c,e[24]=h,e[25]=u,e[26]=v):v=e[26],b=ui("div",{className:g,children:ui(zr,{className:`${$c}__draggable-rows`,ids:r?.map(vO),onDragEnd:x,children:r.map(v)})}),e[8]=n,e[9]=r,e[10]=s,e[11]=f,e[12]=a,e[13]=c,e[14]=h,e[15]=u,e[16]=g,e[17]=b}else b=e[17];return b}function vO(t){let{value:e}=t;return String(e.id)}import{jsx as wS}from"react/jsx-runtime";import"react";var xO="upload upload--has-one";function IS(t){let{className:e,displayPreview:o,fileDoc:n,onRemove:r,readonly:s,reloadDoc:i,serverURL:l}=t,{relationTo:a,value:c}=n,u=String(c?.id),d,f;if(c.url)try{d=new URL(c.url,l).toString()}catch{d=`${l}${c.url}`}if(c.thumbnailURL)try{f=new URL(c.thumbnailURL,l).toString()}catch{f=`${l}${c.thumbnailURL}`}return wS(Hm,{className:[xO,e].filter(Boolean).join(" "),children:wS(zm,{allowEdit:!s,allowRemove:!s,alt:c?.alt||c?.filename,byteSize:c.filesize,collectionSlug:a,displayPreview:o,filename:c.filename,id:u,mimeType:c?.mimeType,onRemove:r,reloadDoc:i,src:d,thumbnailSrc:f||d,x:c?.width,y:c?.height})})}var en="upload";function Xm(t){let{AfterInput:e,allowCreate:o,api:n,BeforeInput:r,className:s,Description:i,description:l,displayPreview:a,Error:c,filterOptions:u,hasMany:d,isSortable:f,Label:m,label:h,localized:p,maxRows:g,onChange:b,path:x,readOnly:v,relationTo:C,required:y,serverURL:I,showError:w,style:A,value:_}=t,[D,T]=Vr.useState(),[S,R]=Vr.useState(Array.isArray(C)?C[0]:C),{openModal:E}=de(),{drawerSlug:F,setCollectionSlug:L,setCurrentActivePath:k,setInitialFiles:N,setMaxFiles:P,setOnSuccess:j}=Wo(),{permissions:V}=Se(),{code:M}=Ee(),{i18n:O,t:B}=$(),G=_S(()=>({...u,[S]:{...u?.[S]||{},id:{...u?.[S]?.id||{},not_in:(u?.[S]?.id?.not_in||[]).concat(...Array.isArray(_)||_?[_]:[])}}}),[_,S,u]),[Y,,{closeDrawer:X,openDrawer:ee}]=kc({collectionSlugs:typeof C=="string"?[C]:C,filterOptions:G}),[q,,{closeDrawer:z,openDrawer:re}]=Yt({collectionSlug:S}),me=Vr.useRef(!1),se=_S(()=>o?!!(typeof S=="string"&&V?.collections&&V.collections?.[S]?.create):!1,[S,V,o]),Z=Vr.useCallback(H=>{typeof b=="function"&&b(H)},[b]),Q=Vr.useCallback(async(H,U)=>{if(!H.length)return;let le={depth:0,draft:!0,limit:H.length,locale:M,where:{and:[{id:{in:H}}]}},De=await fetch(`${I}${n}/${U}`,{body:DS.stringify(le),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 Ne=await De.json(),qe=H.map(Ue=>Ne.docs.find(ke=>String(ke.id)===String(Ue)));return qe.includes(void 0)&&d&&(qe=qe.map((Ue,ke)=>Ue||{id:H[ke],filename:`${B("general:untitled")} - ID: ${H[ke]}`,isPlaceholder:!0})),{...Ne,docs:qe}}return null},[M,I,n,O.language,B,d]),ge=SS(H=>{if(d){let U=[...Array.isArray(_)?_:[],...H.map(le=>le.id)];Z(U),T(le=>[...le||[],...H.map(De=>({relationTo:S,value:De}))])}else{let U=H[0];Z(U.id),T([{relationTo:S,value:U}])}},[_,Z,S,d]),Ie=Vr.useCallback(H=>{let U=H;if(!d&&H&&H.length>1){let le=new DataTransfer;le.items.add(H[0]),U=le.files}U&&N(U),L(C),typeof g=="number"&&P(g),k(x),E(F)},[F,d,E,C,L,N,g,P,x,k]),Fe=Vr.useCallback(async H=>{let U=[];for(let[De,Ne]of H)Ne&&U.push(De);let le=await Q(U,S);le&&T(De=>[...De||[],...le.docs.map(Ne=>({relationTo:S,value:Ne}))]),Z([...Array.isArray(_)?_:[],...U]),X()},[S,X,Z,Q,_]),Le=Vr.useCallback(H=>{H.doc&&(T(U=>[...U||[],{relationTo:S,value:H.doc}]),Z(H.doc.id)),z()},[z,S,Z]),K=SS(async({collectionSlug:H,doc:U})=>{let le=await Q([U.id],H),De=le?le.docs?.[0]:null;T(Ne=>De?d?[...Ne||[],{relationTo:S,value:De}]:[{relationTo:S,value:De}]:Ne),Z(d?[...Array.isArray(_)?_:[],U.id]:U.id),X()},[X,d,Q,Z,_,S]),_e=Vr.useCallback(async(H,U)=>{let{docs:le}=await Q([H],U);if(le[0]){let De=[];T(Ne=>{let qe=Ne?.findIndex(Ue=>(Ue.value?.id===le[0].id||Ue.value?.isPlaceholder)&&Ue.relationTo===U);if(qe>-1){let Ue=[...Ne];return Ue[qe]={relationTo:U,value:le[0]},De=Ue,Ue}}),De.length&&d&&Z(De.map(Ne=>Ne.value?.id))}},[Q,Z,d]),pe=Vr.useCallback(H=>{let U=H.map(({value:le})=>le.id);Z(U),T(H)},[Z]),ce=Vr.useCallback(H=>{let U=H?H.map(({value:le})=>le.id):null;Z(d?U:U?U[0]:null),T(H||[])},[Z,d]);RS(()=>{async function H(){if(_){me.current=!0;let U=await Q(Array.isArray(_)?_:[_],S);U&&T(U.docs.map(le=>({relationTo:S,value:le})))}}me.current||H()},[Q,S,_]),RS(()=>{j(x,ge)},[_,x,ge,j]);let ne=!_||d&&Array.isArray(_)&&(typeof g!="number"||_.length<g)||!d&&D?.[0]&&typeof D[0].value>"u";return di("div",{className:[Ce,en,s,w&&"error",v&&"read-only"].filter(Boolean).join(" "),id:`field-${x?.replace(/\./g,"__")}`,style:A,children:[kt(oe,{CustomComponent:m,Fallback:kt(be,{label:h,localized:p,path:x,required:y})}),kt("div",{className:`${en}__wrap`,children:kt(oe,{CustomComponent:c,Fallback:kt(Xe,{path:x,showError:w})})}),r,di("div",{className:`${en}__dropzoneAndUpload`,children:[d&&Array.isArray(_)&&_.length>0?kt(jc,{children:D&&D?.length>0?kt(yS,{displayPreview:a,fileDocs:D,isSortable:f&&!v,onRemove:ce,onReorder:pe,readonly:v,reloadDoc:_e,serverURL:I}):kt("div",{className:`${en}__loadingRows`,children:_.map(H=>kt(wt,{height:"40px"},H))})}):null,!d&&_?kt(jc,{children:D&&D?.length>0&&D[0].value?kt(IS,{displayPreview:a,fileDoc:D[0],onRemove:ce,readonly:v,reloadDoc:_e,serverURL:I}):D&&_&&!D?.[0]?.value?di(jc,{children:[B("general:untitled")," - ID: ",_]}):kt(wt,{height:"62px"})}):null,ne?kt(ii,{disabled:v||!se,multipleFiles:d,onChange:Ie,children:di("div",{className:`${en}__dropzoneContent`,children:[di("div",{className:`${en}__dropzoneContent__buttons`,children:[se&&di(jc,{children:[kt(ae,{buttonStyle:"pill",className:`${en}__createNewToggler`,disabled:v||!se,onClick:()=>{v||(d?Ie():re())},size:"small",children:B("general:createNew")}),kt("span",{className:`${en}__dropzoneContent__orText`,children:B("general:or")})]}),kt(ae,{buttonStyle:"pill",className:`${en}__listToggler`,disabled:v,onClick:ee,size:"small",children:B("fields:chooseFromExisting")}),kt(q,{onSave:Le}),kt(Y,{allowCreate:se,enableRowSelections:d,onBulkSelect:Fe,onSelect:K})]}),se&&!v&&di("p",{className:`${en}__dragAndDropText`,children:[B("general:or")," ",B("upload:dragAndDrop")]})]})}):kt(jc,{children:!v&&!D&&(!_||typeof g!="number"||Array.isArray(_)&&_.length<g)?kt(wt,{height:"40px"}):null})]}),e,kt(oe,{CustomComponent:i,Fallback:kt(We,{description:l,path:x})})]})}function IO(t){let{field:e,field:{admin:{allowCreate:o,className:n,description:r,isSortable:s}={},hasMany:i,label:l,localized:a,maxRows:c,relationTo:u,required:d},path:f,readOnly:m,validate:h}=t,{config:p}=W(),g=e.displayPreview,b=yO.useCallback((R,E)=>{if(typeof h=="function")return h(R,{...E,required:d})},[h,d]),{customComponents:{AfterInput:x,BeforeInput:v,Description:C,Error:y,Label:I}={},disabled:w,filterOptions:A,setValue:_,showError:D,value:T}=Te({path:f,validate:b}),S=wO(()=>nt(e),[e]);return CO(Xm,{AfterInput:x,allowCreate:o!==!1,api:p.routes.api,BeforeInput:v,className:n,Description:C,description:r,displayPreview:g,Error:y,filterOptions:A,hasMany:i,isSortable:s,label:l,Label:I,localized:a,maxRows:c,onChange:_,path:f,readOnly:m||w,relationTo:u,required:d,serverURL:p.serverURL,showError:D,style:S,value:T})}var Oc=Oe(IO);function xa(t){let e=SO(13),{clientFieldConfig:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:l,permissions:a,readOnly:c,schemaPath:u}=t,d;e[0]!==l?(d=h=>{let[p]=h;return p&&p?.[l]?.customComponents?.Field},e[0]=l,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]!==l||e[8]!==a||e[9]!==c||e[10]!==u){m=Symbol.for("react.early_return_sentinel");e:{let h={forceRender:n,permissions:a,readOnly:c,schemaPath:u},p={...h,indexPath:r,parentPath:s,parentSchemaPath:i};if(o.admin?.hidden){m=Tt(zl,{...h,path:l});break e}switch(o.type){case"array":{m=Tt(Mc,{...p,field:o,path:l});break e}case"blocks":{m=Tt(wl,{...p,field:o,path:l});break e}case"checkbox":{m=Tt(cr,{...h,field:o,path:l});break e}case"code":{m=Tt(Sl,{...h,field:o,path:l});break e}case"collapsible":{m=Tt(_l,{...p,field:o,path:l});break e}case"date":{m=Tt(Gl,{...h,field:o,path:l});break e}case"email":{m=Tt(qs,{...h,field:o,path:l});break e}case"group":{m=Tt(Wl,{...p,field:o,path:l});break e}case"join":{m=Tt(tc,{...h,field:o,path:l});break e}case"json":{m=Tt(oc,{...h,field:o,path:l});break e}case"number":{m=Tt(rc,{...h,field:o,path:l});break e}case"point":{m=Tt(nc,{...h,field:o,path:l});break e}case"radio":{m=Tt(ac,{...h,field:o,path:l});break e}case"relationship":{m=Tt(mc,{...h,field:o,path:l});break e}case"richText":{m=Tt(fc,{...h,field:o,path:l});break e}case"row":{m=Tt(pc,{...p,field:o});break e}case"select":{m=Tt(hc,{...h,field:o,path:l});break e}case"tabs":{m=Tt(xc,{...p,field:o,path:l});break e}case"text":{m=Tt(si,{...h,field:o,path:l});break e}case"textarea":{m=Tt(Cc,{...h,field:o,path:l});break e}case"ui":{let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=Tt(yc,{}),e[12]=g):g=e[12],m=g;break e}case"upload":{m=Tt(Oc,{...h,field:o,path:l});break e}}}e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=l,e[8]=a,e[9]=c,e[10]=u,e[11]=m}else m=e[11];if(m!==Symbol.for("react.early_return_sentinel"))return m}var gb="render-fields",yo=t=>{let e=RO(22),{className:o,fields:n,forceRender:r,margins:s,parentIndexPath:i,parentPath:l,parentSchemaPath:a,permissions:c,readOnly:u}=t,d=Jo();if(n&&n.length>0){let f=s&&`${gb}--margins-${s}`,m=s===!1&&`${gb}--margins-none`,h;e[0]!==o||e[1]!==f||e[2]!==m?(h=[gb,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]!==l||e[9]!==a||e[10]!==c||e[11]!==u||e[12]!==p){let b;e[14]!==r||e[15]!==d||e[16]!==i||e[17]!==l||e[18]!==a||e[19]!==c||e[20]!==u?(b=(x,v)=>{if(!x||_O(x))return null;let{operation:C,permissions:y,read:I}=TO({field:x,operation:d,parentName:l?.includes(".")?l.split(".")[l.split(".").length-1]:l,permissions:c});if("name"in x&&!I)return null;let w=u||x?.admin?.readOnly;w&&x.admin?.readOnly===!1&&(w=!1),"name"in x&&!C&&(w=!0);let{indexPath:A,path:_,schemaPath:D}=DO({field:x,index:v,parentIndexPath:i,parentPath:l,parentSchemaPath:a});return TS(xa,{clientFieldConfig:x,forceRender:r,indexPath:A,parentPath:l,parentSchemaPath:a,path:_,permissions:y,readOnly:w,schemaPath:D},`${_}-${v}`)},e[14]=r,e[15]=d,e[16]=i,e[17]=l,e[18]=a,e[19]=c,e[20]=u,e[21]=b):b=e[21],g=TS(Jx,{className:p,forceRender:r,children:n.map(b)}),e[4]=n,e[5]=r,e[6]=d,e[7]=i,e[8]=l,e[9]=a,e[10]=c,e[11]=u,e[12]=p,e[13]=g}else g=e[13];return g}return null};var Bc="array-field",AS=t=>{let e=AO(42),{addRow:o,attributes:n,CustomRowLabel:r,duplicateRow:s,errorCount:i,fields:l,forceRender:a,hasMaxRows:c,isDragging:u,isLoading:d,isSortable:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:x,readOnly:v,removeRow:C,row:y,rowCount:I,rowIndex:w,schemaPath:A,setCollapse:_,setNodeRef:D,transform:T,transition:S}=t,R=a===void 0?!1:a,E=fd(d,500),{i18n:F}=$(),L=zt(),k=`${EO(m.singular,F)} ${String(w+1).padStart(2,"0")}`,N=i>0&&L,P=N?`${Bc}__row--has-errors`:`${Bc}__row--no-errors`,j;e[0]!==P?(j=[`${Bc}__row`,P].filter(Boolean),e[0]=P,e[1]=j):j=e[1];let V=j.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]!==k||e[9]!==N||e[10]!==l||e[11]!==R||e[12]!==c||e[13]!==F||e[14]!==E||e[15]!==f||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==x||e[21]!==v||e[22]!==C||e[23]!==y.collapsed||e[24]!==y.id||e[25]!==I||e[26]!==w||e[27]!==A||e[28]!==_||e[29]!==D||e[30]!==M||e[31]!==O||e[32]!==T||e[33]!==S){let G;e[35]!==i||e[36]!==N||e[37]!==F?(G=N&&gs(to,{count:i,i18n:F,withMessage:!0}),e[35]=i,e[36]=N,e[37]=F,e[38]=G):G=e[38];let Y;e[39]!==y.id||e[40]!==_?(Y=X=>_(y.id,X),e[39]=y.id,e[40]=_,e[41]=Y):Y=e[41],B=gs("div",{id:M,ref:D,style:{transform:T,transition:S,zIndex:O},children:gs(Vs,{actions:v?void 0:gs(dd,{addRow:o,duplicateRow:s,hasMaxRows:c,index:w,isSortable:f,moveRow:p,removeRow:C,rowCount:I}),className:V,collapsibleStyle:N?"error":"default",dragHandleProps:f?{id:y.id,attributes:n,listeners:h}:void 0,header:FO("div",{className:`${Bc}__row-header`,children:[E?gs(wt,{height:"1rem",width:"8rem"}):gs(sn,{CustomComponent:r,label:k,path:b,rowNumber:w}),G]}),isCollapsed:y.collapsed,onToggle:Y,children:E?gs(wt,{}):gs(yo,{className:`${Bc}__fields`,fields:l,forceRender:R,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:A,permissions:x===!0?x:x?.fields,readOnly:v})})},`${g}-row-${y.id}`),e[2]=r,e[3]=o,e[4]=n,e[5]=V,e[6]=s,e[7]=i,e[8]=k,e[9]=N,e[10]=l,e[11]=R,e[12]=c,e[13]=F,e[14]=E,e[15]=f,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=x,e[21]=v,e[22]=C,e[23]=y.collapsed,e[24]=y.id,e[25]=I,e[26]=w,e[27]=A,e[28]=_,e[29]=D,e[30]=M,e[31]=O,e[32]=T,e[33]=S,e[34]=B}else B=e[34];return B};var br="array-field",LO=t=>{let e=PO(54),{field:o,forceRender:n,path:r,permissions:s,readOnly:i,schemaPath:l,validate:a}=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:x,description:v,isSortable:C}=b,y=C===void 0?!0:C,I=n===void 0?!1:n,w=l??c,A=p??g?1:0,{setDocFieldPreferences:_}=Ae(),{addFieldRow:D,dispatchFields:T,setModified:S}=Me(),R=zt(),{code:E}=Ee(),{i18n:F,t:L}=$(),{config:k}=W(),{localization:N}=k,P;e:{if(N&&N.fallback){let ie=N.defaultLocale;P=E===ie;break e}P=!0}let j=P,V;e[2]!==L?(V=ie=>"labels"in ie&&ie?.labels?ie.labels:"labels"in ie.field&&ie.field.labels?{plural:ie.field.labels?.plural,singular:ie.field.labels?.singular}:"label"in ie.field&&ie.field.label?{plural:void 0,singular:ie.field.label}:{plural:L("general:rows"),singular:L("general:row")},e[2]=L,e[3]=V):V=e[3];let O=V(t),B;e[4]!==j||e[5]!==h||e[6]!==A||e[7]!==g||e[8]!==a?(B=(ie,J)=>{if(!j&&ie===null)return!0;if(typeof a=="function")return a(ie,{...J,maxRows:h,minRows:A,required:g})},e[4]=j,e[5]=h,e[6]=A,e[7]=g,e[8]=a,e[9]=B):B=e[9];let G=B,Y;e[10]!==G||e[11]!==r?(Y={hasRows:!0,path:r,validate:G},e[10]=G,e[11]=r,e[12]=Y):Y=e[12];let{customComponents:X,disabled:ee,errorPaths:q,rows:z,showError:re,valid:me,value:se}=Te(Y),Z;e[13]!==X?(Z=X===void 0?{}:X,e[13]=X,e[14]=Z):Z=e[14];let{AfterInput:Q,BeforeInput:ge,Description:Ie,Error:Fe,Label:Le,RowLabels:K}=Z,_e;e[15]!==z?(_e=z===void 0?[]:z,e[15]=z,e[16]=_e):_e=e[16];let pe=_e,ce;e[17]!==D||e[18]!==r||e[19]!==w?(ce=ie=>{D({path:r,rowIndex:ie,schemaPath:w}),setTimeout(()=>{Vi(`${r}-row-${ie}`)},0)},e[17]=D,e[18]=r,e[19]=w,e[20]=ce):ce=e[20];let ne=ce,H;e[21]!==T||e[22]!==r||e[23]!==S?(H=ie=>{T({type:"DUPLICATE_ROW",path:r,rowIndex:ie}),S(!0),setTimeout(()=>{Vi(`${r}-row-${ie}`)},0)},e[21]=T,e[22]=r,e[23]=S,e[24]=H):H=e[24];let U=H,le;e[25]!==T||e[26]!==r||e[27]!==S?(le=ie=>{T({type:"REMOVE_ROW",path:r,rowIndex:ie}),S(!0)},e[25]=T,e[26]=r,e[27]=S,e[28]=le):le=e[28];let De=le,Ne;e[29]!==T||e[30]!==r||e[31]!==S?(Ne=(ie,J)=>{T({type:"MOVE_ROW",moveFromIndex:ie,moveToIndex:J,path:r}),S(!0)},e[29]=T,e[30]=r,e[31]=S,e[32]=Ne):Ne=e[32];let qe=Ne,Ue;e[33]!==T||e[34]!==r||e[35]!==pe||e[36]!==_?(Ue=ie=>{let{collapsedIDs:J,updatedRows:te}=sd({collapsed:ie,rows:pe});_(r,{collapsed:J}),T({type:"SET_ALL_ROWS_COLLAPSED",path:r,updatedRows:te})},e[33]=T,e[34]=r,e[35]=pe,e[36]=_,e[37]=Ue):Ue=e[37];let ke=Ue,ot;e[38]!==T||e[39]!==r||e[40]!==pe||e[41]!==_?(ot=(ie,J)=>{let{collapsedIDs:te,updatedRows:he}=nd({collapsed:J,rowID:ie,rows:pe});T({type:"SET_ROW_COLLAPSED",path:r,updatedRows:he}),_(r,{collapsed:te})},e[38]=T,e[39]=r,e[40]=pe,e[41]=_,e[42]=ot):ot=e[42];let Ft=ot,Wt=h&&pe.length>=h,mt=q.length,ze=R&&q.length>0,rt=(i||ee)&&pe.length===0,ue=pe.length<A||g&&pe.length===0,ve=ze?`${br}--has-error`:`${br}--has-no-error`,Ve;e[43]!==x||e[44]!==ve?(Ve=[Ce,br,x,ve].filter(Boolean),e[43]=x,e[44]=ve,e[45]=Ve):Ve=e[45];let Ge;e[46]!==Fe||e[47]!==r||e[48]!==re?(Ge=re&&io(oe,{CustomComponent:Fe,Fallback:io(Xe,{path:r,showError:re})}),e[46]=Fe,e[47]=r,e[48]=re,e[49]=Ge):Ge=e[49];let $e;return e[50]!==mt||e[51]!==ze||e[52]!==F?($e=ze&&mt>0&&io(to,{count:mt,i18n:F,withMessage:!0}),e[50]=mt,e[51]=ze,e[52]=F,e[53]=$e):$e=e[53],mi("div",{className:Ve.join(" "),id:`field-${r.replace(/\./g,"__")}`,children:[Ge,mi("header",{className:`${br}__header`,children:[mi("div",{className:`${br}__header-wrap`,children:[mi("div",{className:`${br}__header-content`,children:[io("h3",{className:`${br}__title`,children:io(oe,{CustomComponent:Le,Fallback:io(be,{as:"span",label:f,localized:m,path:r,required:g})})}),$e]}),pe?.length>0&&mi("ul",{className:`${br}__header-actions`,children:[io("li",{children:io("button",{className:`${br}__header-action`,onClick:()=>ke(!0),type:"button",children:L("fields:collapseAll")})}),io("li",{children:io("button",{className:`${br}__header-action`,onClick:()=>ke(!1),type:"button",children:L("fields:showAll")})})]})]}),io(oe,{CustomComponent:Ie,Fallback:io(We,{description:v,path:r})})]}),io(gl,{fieldValue:se,localized:m,path:r}),ge,(pe?.length>0||!me&&(rt||ue))&&mi(zr,{className:`${br}__draggable-rows`,ids:pe.map(kO),onDragEnd:ie=>{let{moveFromIndex:J,moveToIndex:te}=ie;return qe(J,te)},children:[pe.map((ie,J)=>{let{id:te,isLoading:he}=ie,Pe=`${r}.${J}`,je=q?.filter(Ye=>Ye.startsWith(Pe+".")).length;return io(Gn,{disabled:i||ee||!y,id:te,children:Ye=>io(AS,{...Ye,addRow:ne,CustomRowLabel:K?.[J],duplicateRow:U,errorCount:je,fields:d,forceRender:I,hasMaxRows:Wt,isLoading:he,isSortable:y,labels:O,moveRow:qe,parentPath:r,path:Pe,permissions:s,readOnly:i||ee,removeRow:De,row:ie,rowCount:pe?.length,rowIndex:J,schemaPath:w,setCollapse:Ft})},te)}),!me&&mi(NO.Fragment,{children:[rt&&io(yr,{children:L("validation:fieldHasNo",{label:bb(O.plural,F)})}),ue&&io(yr,{type:"error",children:L("validation:requiresAtLeast",{count:A,label:bb(A>1?O.plural:O.singular,F)||L(A>1?"general:rows":"general:row")})})]})]}),!Wt&&!i&&io(ae,{buttonStyle:"icon-label",className:`${br}__add-row`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:()=>{ne(se||0)},children:L("fields:addLabel",{label:bb(O.singular,F)})}),Q]})},Mc=Oe(LO);function kO(t){return t.id}import{c as $O}from"react/compiler-runtime";import{jsx as vb,jsxs as FS}from"react/jsx-runtime";import{confirmPassword as jO}from"payload/shared";import"react";var Vc=t=>{let e=$O(12),{disabled:o,path:n}=t,r=n===void 0?"confirm-password":n,{t:s}=$(),i;e[0]!==r?(i={path:r,validate:OO},e[0]=r,e[1]=i):i=e[1];let{disabled:l,setValue:a,showError:c,value:u}=Te(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]!==l||e[5]!==o||e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==m||e[10]!==u?(h=FS("div",{className:m,children:[vb(be,{htmlFor:"field-confirm-password",label:s("authentication:confirmPassword"),required:!0}),FS("div",{className:`${Ce}__wrap`,children:[vb(Xe,{path:r}),vb("input",{"aria-label":s("authentication:confirmPassword"),autoComplete:"off",disabled:!!(l||o),id:"field-confirm-password",name:"confirm-password",onChange:a,type:"password",value:u||""})]})]}),e[4]=l,e[5]=o,e[6]=r,e[7]=a,e[8]=s,e[9]=m,e[10]=u,e[11]=h):h=e[11],h};function OO(t,e){return jO(t,{name:"confirm-password",type:"text",required:!0,...e})}import{jsx as BO}from"react/jsx-runtime";import{password as VO}from"payload/shared";import{useCallback as GO,useMemo as WO}from"react";import{c as MO}from"react/compiler-runtime";import{jsx as fi,jsxs as xb}from"react/jsx-runtime";import{getTranslation as ES}from"@payloadcms/translations";import"react";var PS=t=>{let e=MO(28),{AfterInput:o,autoComplete:n,BeforeInput:r,className:s,description:i,Description:l,Error:a,inputRef:c,Label:u,label:d,localized:f,onChange:m,onKeyDown:h,path:p,placeholder:g,readOnly:b,required:x,rtl:v,showError:C,style:y,value:I,width:w}=t,A=n===void 0?"off":n,{i18n:_}=$(),D=C&&"error",T=b&&"read-only",S;e[0]!==s||e[1]!==D||e[2]!==T?(S=[Ce,"password",s,D,T].filter(Boolean),e[0]=s,e[1]=D,e[2]=T,e[3]=S):S=e[3];let R=S.join(" "),E;return e[4]!==o||e[5]!==r||e[6]!==l||e[7]!==a||e[8]!==u||e[9]!==A||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]!==x||e[21]!==v||e[22]!==C||e[23]!==y||e[24]!==R||e[25]!==I||e[26]!==w?(E=xb("div",{className:R,style:{...y,width:w},children:[fi(oe,{CustomComponent:u,Fallback:fi(be,{label:d,localized:f,path:p,required:x})}),xb("div",{className:`${Ce}__wrap`,children:[fi(oe,{CustomComponent:a,Fallback:fi(Xe,{path:p,showError:C})}),xb("div",{children:[r,fi("input",{"aria-label":ES(d,_),autoComplete:A,"data-rtl":v,disabled:b,id:`field-${p.replace(/\./g,"__")}`,name:p,onChange:m,onKeyDown:h,placeholder:ES(g,_),ref:c,type:"password",value:I||""}),o]}),fi(oe,{CustomComponent:l,Fallback:fi(We,{description:i,path:p})})]})]}),e[4]=o,e[5]=r,e[6]=l,e[7]=a,e[8]=u,e[9]=A,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]=x,e[21]=v,e[22]=C,e[23]=y,e[24]=R,e[25]=I,e[26]=w,e[27]=E):E=e[27],E};var zO=t=>{let{autoComplete:e,field:o,field:{admin:{className:n,disabled:r,placeholder:s,rtl:i}={},label:l,localized:a,required:c}={},inputRef:u,path:d,validate:f}=t,{t:m}=$(),h=Ee(),{config:p}=W(),g=GO((S,R)=>{let E=d?d.split("."):[];return typeof f=="function"?f(S,{...R,required:c}):VO(S,{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:x,Description:v,Error:C,Label:y}={},disabled:I,setValue:w,showError:A,value:_}=Te({path:d,validate:g}),D=Bi({fieldLocalized:!1,fieldRTL:i,locale:h,localizationConfig:p.localization||void 0}),T=WO(()=>nt(o),[o]);return BO(PS,{AfterInput:b,autoComplete:e,BeforeInput:x,className:n,Description:v,Error:C,inputRef:u,Label:y,label:l,localized:a,onChange:S=>{w(S.target.value)},path:d,placeholder:s,readOnly:I||r,required:c,rtl:D,showError:A,style:T,value:_||""})},Gc=Oe(zO);var NS={array:Mc,blocks:wl,checkbox:cr,code:Sl,collapsible:_l,confirmPassword:Vc,date:Gl,email:qs,group:Wl,hidden:zl,join:tc,json:oc,number:rc,password:Gc,point:nc,radio:ac,relationship:mc,richText:fc,row:pc,select:hc,tabs:xc,text:si,textarea:Cc,ui:yc,upload:Oc},HO={...NS,Description:We,Error:Xe,Label:be,RowLabel:sn};import{c as XO}from"react/compiler-runtime";import{setsAreEqual as UO}from"payload/shared";import{useEffect as YO}from"react";var Dn=new Map([]),ZO={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"},LS=t=>(ZO[t.toLowerCase()]||t).trim().toLowerCase().replace("key",""),JO=t=>{let e=LS(t);e==="meta"&&Dn.forEach((o,n)=>n!=="meta"&&Dn.delete(n)),Dn.set(e,Date.now())},qO=t=>{let e=LS(t);e==="meta"&&Dn.clear(),Dn.delete(e)},pi=(t,e)=>{let o=XO(9),{cmdCtrlKey:n,editDepth:r,keyCodes:s}=t,{modalState:i}=de(),l;o[0]!==n||o[1]!==r||o[2]!==e||o[3]!==s||o[4]!==i?(l=f=>{let m=f.detail?.key?f.detail:f;if(m.key===void 0)return;Dn.forEach(QO),m.code&&JO(m.code);let h=window.navigator.userAgent.includes("Mac OS X"),p=[...Dn.keys()].filter(KO);if(UO(new Set(p),new Set(s))&&(!n||h&&Dn.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]=l):l=o[5];let a=l,c=eM,u,d;o[6]!==a?(u=()=>(document.addEventListener("keydown",a,!1),document.addEventListener("bypassKeyDown",a,!1),document.addEventListener("keyup",c,!1),()=>{document.removeEventListener("keydown",a),document.removeEventListener("bypassKeyDown",a),document.removeEventListener("keyup",c)}),d=[a,c],o[6]=a,o[7]=u,o[8]=d):(u=o[7],d=o[8]),YO(u,d)};function QO(t,e){Date.now()-t>3e3&&Dn.delete(e)}function KO(t){return!["alt","ctrl","meta","shift"].includes(t)}function eM(t){t.code&&qO(t.code)}import{c as tM}from"react/compiler-runtime";import*as $S from"qs-esm";import{useEffect as kS,useRef as oM,useState as Um}from"react";var rM=(t,e)=>{let o=tM(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,l;o[2]!==i?(l=i===void 0?{}:i,o[2]=i,o[3]=l):l=o[3];let a=l,{i18n:c}=$(),u;o[4]!==s?(u=s||{},o[4]=s,o[5]=u):u=o[5];let[d,f]=Um(u),[m,h]=Um(a),[p,g]=Um(!s),[b,x]=Um(!1),{code:v}=Ee(),C=oM(!1),y;if(o[6]!==v||o[7]!==m){let E;o[9]!==m?(E=typeof m=="object"?m:{},o[9]=m,o[10]=E):E=o[10],y=$S.stringify({locale:v,...E},{addQueryPrefix:!0}),o[6]=v,o[7]=m,o[8]=y}else y=o[8];let I=y,w;o[11]!==c.language||o[12]!==s||o[13]!==I||o[14]!==t?(w=()=>{if(s&&!C.current){C.current=!0;return}let E=new AbortController;return t?(async()=>{x(!1),g(!0);try{let L=await Ke.get(`${t}${I}`,{headers:{"Accept-Language":c.language},signal:E.signal});L.status>201&&x(!0);let k=await L.json();f(k),g(!1)}catch{E.signal.aborted||(x(!0),g(!1))}})():(x(!1),g(!1)),()=>{try{E.abort()}catch(L){let k=L}}},o[11]=c.language,o[12]=s,o[13]=I,o[14]=t,o[15]=w):w=o[15];let A;o[16]!==c.language||o[17]!==s||o[18]!==v||o[19]!==I||o[20]!==t?(A=[t,v,I,c.language,s],o[16]=c.language,o[17]=s,o[18]=v,o[19]=I,o[20]=t,o[21]=A):A=o[21],kS(w,A);let _,D;o[22]!==s?(_=()=>{s&&C.current&&f(s)},D=[s],o[22]=s,o[23]=_,o[24]=D):(_=o[23],D=o[24]),kS(_,D);let T;o[25]!==d||o[26]!==b||o[27]!==p?(T={data:d,isError:b,isLoading:p},o[25]=d,o[26]=b,o[27]=p,o[28]=T):T=o[28];let S;o[29]===Symbol.for("react.memo_cache_sentinel")?(S={setParams:h},o[29]=S):S=o[29];let R;return o[30]!==T?(R=[T,S],o[30]=T,o[31]=R):R=o[31],R};import{c as nM}from"react/compiler-runtime";import{useEffect as sM,useState as iM}from"react";var aM=t=>{let e=nM(5),[o,n]=iM(),r,s;e[0]!==t?(r=()=>{let l;return t&&(l=new ResizeObserver(a=>{a.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})})}),l.observe(t)),()=>{l&&l.unobserve(t)}},s=[t],e[0]=t,e[1]=r,e[2]=s):(r=e[1],s=e[2]),sM(r,s);let i;return e[3]!==o?(i={size:o},e[3]=o,e[4]=i):i=e[4],i};import{flattenTopLevelFields as lM}from"payload/shared";var Cb=t=>{let{admin:{useAsTitle:e},fields:o}=t;return lM(o)?.find(r=>"name"in r&&r.name===e)};import{jsx as jS}from"react/jsx-runtime";import{toWords as cM,transformColumnsToSearchParams as uM}from"payload/shared";import"react";var dM="query-preset-columns-cell",mM=({cellData:t})=>jS("div",{className:dM,children:t?uM(t).map((e,o)=>{let n=!e.startsWith("-");return n?jS(bt,{pillStyle:n?"always-white":"light",children:cM(e)},o):null}):"No columns selected"});import{jsx as fM}from"react/jsx-runtime";import{toWords as OS}from"payload/shared";import"react";var pM=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`${OS(n)} ${r} ${OS(s)}`}return""},hM=({cellData:t})=>fM("div",{children:t?pM(t):"No where query"});import{jsx as MS,jsxs as BS}from"react/jsx-runtime";import{toWords as VS}from"payload/shared";import{Fragment as gM}from"react";var bM=({cellData:t})=>{let e=["read","update","delete"];return MS("p",{children:e.reduce((o,n,r)=>{let s=t?.[n];return s&&s.constraint&&o.push(BS(gM,{children:[BS("span",{children:[MS("strong",{children:VS(n)}),": ",VS(s.constraint)]}),r!==e.length-1&&", "]},n)),o},[])})};import{c as vM}from"react/compiler-runtime";import{jsx as yb,jsxs as xM}from"react/jsx-runtime";import{toWords as CM,transformColumnsToSearchParams as yM}from"payload/shared";import"react";var wM=t=>{let e=vM(7),{field:o,path:n}=t,{label:r,required:s}=o,i;e[0]!==n?(i={path:n},e[0]=n,e[1]=i):i=e[1];let{value:l}=Te(i),a;return e[2]!==r||e[3]!==n||e[4]!==s||e[5]!==l?(a=xM("div",{className:"field-type query-preset-columns-field",children:[yb(be,{as:"h3",label:r,path:n,required:s}),yb("div",{className:"value-wrapper",children:l?yM(l).map(IM):"No columns selected"})]}),e[2]=r,e[3]=n,e[4]=s,e[5]=l,e[6]=a):a=e[6],a};function IM(t,e){let o=!t.startsWith("-");return yb(bt,{pillStyle:o?"always-white":"light-gray",children:CM(t)},e)}import{c as SM}from"react/compiler-runtime";import{jsx as Tn,jsxs as Ym}from"react/jsx-runtime";import{getTranslation as RM}from"@payloadcms/translations";import{toWords as GS}from"payload/shared";import WS from"react";var _M=(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],l=r[s][i];if(typeof l=="object")try{l=new Date(l).toLocaleDateString()}catch{l="Unknown error has occurred"}return Ym(bt,{pillStyle:"always-white",children:[Tn("b",{children:GS(s)})," ",i," ",Tn("b",{children:GS(l)})]})};return((r,s)=>r.or&&r.or.length>0?Tn("div",{className:"or-condition",children:r.or.map((i,l)=>Tn(WS.Fragment,{children:i.and&&i.and.length>0?Ym("div",{className:"and-condition",children:[l===0&&Tn("span",{className:"label",children:`Filter ${s} where `}),l>0&&Tn("span",{className:"label",children:" or "}),i.and.map((a,c)=>Ym(WS.Fragment,{children:[o(a),c<i.and.length-1&&Tn("span",{className:"label",children:" and "})]},c))]}):o(i)},l))}):o(r))(t,e)},DM=t=>{let e=SM(2),{field:o,path:n}=t,{label:r,required:s}=o,i;e[0]!==n?(i={path:n},e[0]=n,e[1]=i):i=e[1];let{value:l}=Te(i),{collectionSlug:a}=so(),{getEntityConfig:c}=W(),u=c({collectionSlug:a}),{i18n:d}=$();return Ym("div",{className:"field-type query-preset-where-field",children:[Tn(be,{as:"h3",label:r,path:n,required:s}),Tn("div",{className:"value-wrapper",children:l?_M(l,RM(u.labels.plural,d)):"No where query"})]})};import{c as LM}from"react/compiler-runtime";import{jsx as kM}from"react/jsx-runtime";import $M from"react";import{c as TM}from"react/compiler-runtime";import{useRouter as AM}from"next/navigation.js";import{useEffect as wb,useRef as FM}from"react";function EM(t,...e){t&&t.addEventListener&&t.addEventListener(...e)}function PM(t,...e){t&&t.removeEventListener&&t.removeEventListener(...e)}var NM=(t,e)=>{let o=TM(7),n=t===void 0?!0:t,r;o[0]!==n||o[1]!==e?(r=a=>{if(typeof n!="function"||n())return a.preventDefault(),e&&(a.returnValue=e),e},o[0]=n,o[1]=e,o[2]=r):r=o[2];let s=r,i,l;o[3]!==n||o[4]!==s?(i=()=>{if(n)return EM(window,"beforeunload",s),()=>PM(window,"beforeunload",s)},l=[n,s],o[3]=n,o[4]=s,o[5]=i,o[6]=l):(i=o[5],l=o[6]),wb(i,l)},zS=({hasAccepted:t=!1,message:e="Are you sure want to leave this page?",onAccept:o,onPrevent:n,prevent:r=!0})=>{NM(r,e);let{startRouteTransition:s}=it(),i=AM(),l=FM("");wb(()=>{function a(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=a(h,p),b=m.download!=="",x=m.target==="_blank"||d.metaKey||d.ctrlKey;!(p===h||g||b||x)&&r&&(n||!window.confirm(e))&&(l.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]),wb(()=>{t&&l.current&&(o&&o(),s(()=>i.push(l.current)))},[t,o,i,s])};var Zm="leave-without-saving",Wc=()=>{let t=LM(15),{closeModal:e,openModal:o}=de(),n=Ht(),{isValid:r}=Me(),{user:s}=Se(),[i,l]=$M.useState(!1),{t:a}=$(),c=!!((n||!r)&&s),u;t[0]!==o?(u=()=>{o(Zm)},t[0]=o,t[1]=u):u=t[1];let d=u,f;t[2]!==e?(f=()=>{e(Zm)},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],zS(h);let p;t[9]!==e?(p=()=>{e(Zm)},t[9]=e,t[10]=p):p=t[10];let g=p,b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{l(!0)},t[11]=b):b=t[11];let x=b,v;return t[12]!==g||t[13]!==a?(v=kM(It,{body:a("general:changesNotSaved"),cancelLabel:a("general:stayOnThisPage"),confirmLabel:a("general:leaveAnyway"),heading:a("general:leaveWithoutSaving"),modalSlug:Zm,onCancel:g,onConfirm:x}),t[12]=g,t[13]=a,t[14]=v):v=t[14],v};import{c as jM}from"react/compiler-runtime";import{jsx as zc,jsxs as Ib}from"react/jsx-runtime";import{useEffect as OM}from"react";var Da="document-take-over",Jm="document-take-over",Sb=t=>{let e=jM(17),{handleBackToDashboard:o,isActive:n,onReadOnly:r}=t,{closeModal:s,openModal:i}=de(),{t:l}=$(),{startRouteTransition:a}=it(),c,u;e[0]!==s||e[1]!==n||e[2]!==i?(c=()=>{n?i(Da):s(Da)},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]),OM(c,u);let d;if(e[5]!==s||e[6]!==o||e[7]!==r||e[8]!==a||e[9]!==l){let f;e[11]!==o||e[12]!==a?(f=()=>{a(()=>o())},e[11]=o,e[12]=a,e[13]=f):f=e[13];let m;e[14]!==s||e[15]!==r?(m=()=>{r(),s(Da)},e[14]=s,e[15]=r,e[16]=m):m=e[16],d=zc(Xo,{className:Jm,slug:Da,children:Ib("div",{className:`${Jm}__wrapper`,children:[Ib("div",{className:`${Jm}__content`,children:[zc("h1",{children:l("general:editingTakenOver")}),zc("p",{children:l("general:anotherUserTakenOver")})]}),Ib("div",{className:`${Jm}__controls`,children:[zc(ae,{buttonStyle:"primary",id:`${Da}-back-to-dashboard`,onClick:f,size:"large",children:l("general:backToDashboard")}),zc(ae,{buttonStyle:"secondary",id:`${Da}-view-read-only`,onClick:m,size:"large",children:l("general:viewReadOnly")})]})]})}),e[5]=s,e[6]=o,e[7]=r,e[8]=a,e[9]=l,e[10]=d}else d=e[10];return d};import{c as MM}from"react/compiler-runtime";import{jsx as hi,jsxs as Hc}from"react/jsx-runtime";import{useEffect as BM}from"react";var qm=t=>t&&typeof t=="object";var bs="document-locked",Qm="document-locked",VM=t=>t?new Intl.DateTimeFormat("en-US",{day:"numeric",hour:"numeric",hour12:!0,minute:"numeric",month:"short",year:"numeric"}).format(t):"",Rb=t=>{let e=MM(30),{handleGoBack:o,isActive:n,onReadOnly:r,onTakeOver:s,updatedAt:i,user:l}=t,{closeModal:a,openModal:c}=de(),{t:u}=$(),{startRouteTransition:d}=it(),f,m;e[0]!==a||e[1]!==n||e[2]!==c?(f=()=>{n?c(bs):a(bs)},m=[n,c,a],e[0]=a,e[1]=n,e[2]=c,e[3]=f,e[4]=m):(f=e[3],m=e[4]),BM(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]!==a||e[9]!==o||e[10]!==r||e[11]!==s||e[12]!==d||e[13]!==u||e[14]!==h||e[15]!==i||e[16]!==l){let g;e[18]!==u||e[19]!==l?(g=qm(l)?l.email??l.id:`${u("general:user")}: ${l}`,e[18]=u,e[19]=l,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 x;e[24]!==a||e[25]!==r?(x=()=>{r(),a(bs)},e[24]=a,e[25]=r,e[26]=x):x=e[26];let v;e[27]!==a||e[28]!==s?(v=()=>{s(),a(bs)},e[27]=a,e[28]=s,e[29]=v):v=e[29],p=hi(Xo,{className:Qm,onClose:h,slug:bs,children:Hc("div",{className:`${Qm}__wrapper`,children:[Hc("div",{className:`${Qm}__content`,children:[hi("h1",{children:u("general:documentLocked")}),Hc("p",{children:[hi("strong",{children:g})," ",u("general:currentlyEditing")]}),Hc("p",{children:[u("general:editedSince")," ",hi("strong",{children:VM(i)})]})]}),Hc("div",{className:`${Qm}__controls`,children:[hi(ae,{buttonStyle:"secondary",id:`${bs}-go-back`,onClick:b,size:"large",children:u("general:goBack")}),hi(ae,{buttonStyle:"secondary",id:`${bs}-view-read-only`,onClick:x,size:"large",children:u("general:viewReadOnly")}),hi(ae,{buttonStyle:"primary",id:`${bs}-take-over`,onClick:v,size:"large",children:u("general:takeOver")})]})]})}),e[8]=a,e[9]=o,e[10]=r,e[11]=s,e[12]=d,e[13]=u,e[14]=h,e[15]=i,e[16]=l,e[17]=p}else p=e[17];return p};import{jsx as Km}from"react/jsx-runtime";import"react";var HS=({elements:t,translationString:e})=>{let o=/(<[^>]+>.*?<\/[^>]+>)/g,n=e.split(o);return Km("span",{children:n.map((r,s)=>{if(t&&r.startsWith("<")&&r.endsWith(">")){let i=r[1],l=t[i];if(l){let a=new RegExp(`<${i}>(.*?)</${i}>`,"g"),c=r.replace(a,(u,d)=>d);return Km(l,{children:Km(HS,{translationString:c})},s)}}return r})})},gi=({elements:t,i18nKey:e,t:o,variables:n})=>{let r=o(e,n||{});return t?Km(HS,{elements:t,translationString:r}):r};import{c as GM}from"react/compiler-runtime";import{jsx as WM}from"react/jsx-runtime";import{getTranslation as zM}from"@payloadcms/translations";import sDe from"react";function _b(t){let e=GM(3),{i18n:o}=$(),{description:n}=t;if(n){let r;return e[0]!==n||e[1]!==o?(r=WM("div",{className:"custom-view-description",children:zM(n,o)}),e[0]=n,e[1]=o,e[2]=r):r=e[2],r}return null}import{jsx as zo,jsxs as nf}from"react/jsx-runtime";import{formatAdminURL as AB}from"payload/shared";import{useEffect as FB,useRef as EB,useState as PB}from"react";import{c as ZM}from"react/compiler-runtime";import{jsx as r4}from"react/jsx-runtime";import{usePathname as JM}from"next/navigation.js";import{formatAdminURL as qM}from"payload/shared";import"react";import{jsx as Db,jsxs as HM}from"react/jsx-runtime";import"react";var Xc="graphic-account",XS=t=>HM("svg",{className:[Xc,t?.active&&`${Xc}--active`].filter(Boolean).join(" "),height:"25",viewBox:"0 0 25 25",width:"25",xmlns:"http://www.w3.org/2000/svg",children:[Db("circle",{className:`${Xc}__bg`,cx:"12.5",cy:"12.5",r:"11.5"}),Db("circle",{className:`${Xc}__head`,cx:"12.5",cy:"10.73",r:"3.98"}),Db("path",{className:`${Xc}__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 t4=ws(e4(),1);import{c as UM}from"react/compiler-runtime";import{jsx as YM}from"react/jsx-runtime";import"react";var o4=()=>{let t=UM(2),{user:e}=Se(),o=(0,t4.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=YM("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 Fb=()=>{let t=ZM(3),{config:e}=W(),{admin:o,routes:n}=e,{avatar:r,routes:s}=o,{account:i}=s,{admin:l}=n,{user:a}=Se(),u=JM()===qM({adminRoute:l,path:i});if(!a?.email||r==="default"){let d;return t[0]!==u?(d=r4(XS,{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=r4(o4,{}),t[2]=d):d=t[2],d}};import{c as QM}from"react/compiler-runtime";import{jsx as KM}from"react/jsx-runtime";import{createContext as eB,use as tB,useState as oB}from"react";var n4=eB({Actions:{},setViewActions:()=>{}}),Eb=()=>tB(n4),rB=t=>{let e=QM(4),{Actions:o,children:n}=t,[r,s]=oB(o),i;return e[0]!==o||e[1]!==n||e[2]!==r?(i=KM(n4,{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 nB}from"react/compiler-runtime";import{jsx as ef,jsxs as a4}from"react/jsx-runtime";import"react";import{jsx as s4}from"react/jsx-runtime";import"react";var Pb=()=>s4("svg",{className:"icon icon--close-menu",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:s4("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})});import{jsx as i4}from"react/jsx-runtime";import"react";var Nb=()=>i4("svg",{className:"icon icon--menu",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:i4("path",{className:"stroke",d:"M4.66667 10H15.3333M4.66667 6H15.3333M4.66667 14H15.3333",strokeLinecap:"square"})});var Lb="hamburger",kb=t=>{let e=nB(4),{t:o}=$(),{closeIcon:n,isActive:r}=t,s=n===void 0?"x":n,i=r===void 0?!1:r,l;return e[0]!==s||e[1]!==i||e[2]!==o?(l=a4("div",{className:Lb,children:[!i&&ef("div",{"aria-label":o("general:open"),className:`${Lb}__open-icon`,title:o("general:open"),children:ef(Nb,{})}),i&&a4("div",{"aria-label":o(s==="collapse"?"general:collapse":"general:close"),className:`${Lb}__close-icon`,title:o(s==="collapse"?"general:collapse":"general:close"),children:[s==="x"&&ef(Pb,{}),s==="collapse"&&ef(Je,{direction:"left"})]})]}),e[0]=s,e[1]=i,e[2]=o,e[3]=l):l=e[3],l};import{c as aB}from"react/compiler-runtime";import{jsx as bi,jsxs as lB}from"react/jsx-runtime";import{getTranslation as cB}from"@payloadcms/translations";import{useRouter as uB}from"next/navigation.js";import*as of from"qs-esm";import{Fragment as dB}from"react";import{c as sB}from"react/compiler-runtime";import{jsx as l4,jsxs as $b}from"react/jsx-runtime";import{getTranslation as iB}from"@payloadcms/translations";import"react";var Uc="localizer-button",tf=t=>{let e=sB(12),{ariaLabel:o,className:n}=t,r=Ee(),{i18n:s,t:i}=$(),l;e[0]!==o||e[1]!==i?(l=o||i("general:locale"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let a;e[3]!==n?(a=[Uc,n].filter(Boolean),e[3]=n,e[4]=a):a=e[4];let c=a.join(" "),u=r?r.code:void 0,d=`${i("general:locale")}:`,f;return e[5]!==s||e[6]!==r.label||e[7]!==l||e[8]!==c||e[9]!==u||e[10]!==d?(f=$b("div",{"aria-label":l,className:c,"data-locale":u,children:[$b("div",{className:`${Uc}__label`,children:[d,"\xA0"]}),$b("div",{className:`${Uc}__current`,children:[l4("span",{className:`${Uc}__current-label`,children:`${iB(r.label,s)}`}),l4(Je,{className:`${Uc}__chevron`,size:"small"})]})]}),e[5]=s,e[6]=r.label,e[7]=l,e[8]=c,e[9]=u,e[10]=d,e[11]=f):f=e[11],f};var jb="localizer",c4=t=>{let e=aB(17),{className:o}=t,{config:n}=W(),{localization:r}=n,s=uB(),{startRouteTransition:i}=it(),{setLocaleIsLoading:l}=od(),{i18n:a}=$(),c=Ee();if(r){let{locales:u}=r,d;e[0]!==o?(d=[jb,o].filter(Boolean),e[0]=o,e[1]=d):d=e[1];let f=d.join(" "),m;if(e[2]!==a||e[3]!==c.code||e[4]!==u||e[5]!==s||e[6]!==l||e[7]!==i||e[8]!==f){let h;e[10]!==a||e[11]!==c.code||e[12]!==u||e[13]!==s||e[14]!==l||e[15]!==i?(h=p=>{let{close:g}=p;return bi(Be.ButtonGroup,{children:u.map(b=>{let x=cB(b.label,a);return bi(Be.Button,{active:c.code===b.code,disabled:c.code===b.code,onClick:()=>{l(!0),g();let v=new URLSearchParams(window.location.search),C=of.stringify({...of.parse(v.toString(),{depth:10,ignoreQueryPrefix:!0}),locale:b.code},{addQueryPrefix:!0});i(()=>{s.push(C)})},children:x!==b.code?lB(dB,{children:[x,"\xA0",bi("span",{className:`${jb}__locale-code`,"data-locale":b.code,children:`(${b.code})`})]}):bi("span",{className:`${jb}__locale-code`,"data-locale":b.code,children:x})},b.code)})})},e[10]=a,e[11]=c.code,e[12]=u,e[13]=s,e[14]=l,e[15]=i,e[16]=h):h=e[16],m=bi("div",{className:f,children:bi(fo,{button:bi(tf,{}),horizontalAlign:"right",render:h,showScrollbar:!0,size:"large"})}),e[2]=a,e[3]=c.code,e[4]=u,e[5]=s,e[6]=l,e[7]=i,e[8]=f,e[9]=m}else m=e[9];return m}return null};import{jsx as mB}from"react/jsx-runtime";import{usePathname as fB}from"next/navigation.js";import Zc,{useEffect as Yc,useRef as pB}from"react";var u4=Zc.createContext({hydrated:!1,navOpen:!0,navRef:null,setNavOpen:()=>{},shouldAnimate:!1}),vi=()=>Zc.use(u4),hB=async t=>{let o=(await t("nav"))?.open;return typeof o=="boolean"?o:!0},d4=({children:t,initialIsOpen:e})=>{let{breakpoints:{l:o,m:n,s:r}}=xo(),s=fB(),{getPreference:i}=Do(),l=pB(null),[a,c]=Zc.useState(e),[u,d]=Zc.useState(!1),[f,m]=Zc.useState(!1);return Yc(()=>{o===!1&&(async()=>{let p=await hB(i);c(p)})()},[o,i,c]),Yc(()=>{r===!0&&c(!1)},[s]),Yc(()=>{l.current&&(a&&n?l.current.style.overscrollBehavior="contain":l.current.style.overscrollBehavior="auto")},[a,n]),Yc(()=>{(o===!0||n===!0||r===!0)&&c(!1),m(!0),setTimeout(()=>{d(!0)},100)},[o,n,r]),Yc(()=>()=>{l.current&&(l.current.style.overscrollBehavior="auto")},[]),mB(u4,{value:{hydrated:f,navOpen:a,navRef:l,setNavOpen:c,shouldAnimate:u},children:t})};import{c as gB}from"react/compiler-runtime";import{jsx as bB}from"react/jsx-runtime";import"react";var m4="nav-toggler",Ob=t=>{let e=gB(15),{id:o,children:n,className:r,tabIndex:s}=t,i=s===void 0?0:s,{t:l}=$(),{setPreference:a}=Do(),{navOpen:c,setNavOpen:u}=vi(),{breakpoints:d}=xo(),{l:f}=d,m=`${l(c?"general:close":"general:open")} ${l("general:menu")}`,h=c&&`${m4}--is-open`,p;e[0]!==r||e[1]!==h?(p=[m4,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]!==a?(b=async()=>{u(!c),f||await a("nav",{open:!c},!0)},e[3]=f,e[4]=c,e[5]=u,e[6]=a,e[7]=b):b=e[7];let x;return e[8]!==n||e[9]!==o||e[10]!==m||e[11]!==g||e[12]!==b||e[13]!==i?(x=bB("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]=x):x=e[14],x};import{c as DB}from"react/compiler-runtime";import{jsx as Io,jsxs as h4}from"react/jsx-runtime";import{getTranslation as TB}from"@payloadcms/translations";import{Fragment as g4}from"react";import{jsx as f4,jsxs as vB}from"react/jsx-runtime";import"react";var rf=({fill:t})=>{let e=t||"var(--theme-elevation-1000)";return vB("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:[f4("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}),f4("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 xB}from"react/compiler-runtime";import{jsx as CB}from"react/jsx-runtime";import{createContext as yB,use as wB,useState as IB}from"react";var An=()=>wB(p4),p4=yB({}),Mb=t=>{let e=xB(4),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];let[r,s]=IB(n),i;return e[1]!==o||e[2]!==r?(i=CB(p4,{value:{setStepNav:s,stepNav:r},children:o}),e[1]=o,e[2]=r,e[3]=i):i=e[3],i};import{c as SB}from"react/compiler-runtime";import{useEffect as RB}from"react";var _B=t=>{let e=SB(4),{nav:o}=t,{setStepNav:n}=An(),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]),RB(r,s),null};var Jc="step-nav",b4=t=>{let e=DB(7),{className:o,CustomIcon:n}=t,{i18n:r}=$(),{stepNav:s}=An(),{config:i}=W(),{routes:l}=i,{admin:a}=l,{t:c}=$(),u;return e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==r||e[4]!==s||e[5]!==c?(u=Io(g4,{children:s.length>0?h4("nav",{className:[Jc,o].filter(Boolean).join(" "),children:[Io(Kt,{className:`${Jc}__home`,href:a,prefetch:!1,tabIndex:0,children:Io("span",{title:c("general:dashboard"),children:Io(oe,{CustomComponent:n,Fallback:Io(rf,{})})})}),Io("span",{children:"/"}),s.map((d,f)=>{let m=TB(d.label,r);return s.length===f+1?Io("span",{className:`${Jc}__last`,children:m},f):h4(g4,{children:[d.url?Io(Kt,{href:d.url,prefetch:!1,children:Io("span",{children:m},f)}):Io("span",{children:m},f),Io("span",{children:"/"})]},f)})]}):Io("div",{className:[Jc,o].filter(Boolean).join(" "),children:Io("div",{className:`${Jc}__home`,children:Io("span",{title:c("general:dashboard"),children:Io(oe,{CustomComponent:n,Fallback:Io(rf,{})})})})})}),e[0]=n,e[1]=a,e[2]=o,e[3]=r,e[4]=s,e[5]=c,e[6]=u):u=e[6],u};var So="app-header";function NB({CustomAvatar:t,CustomIcon:e}){let{t:o}=$(),{Actions:n}=Eb(),{config:{admin:{routes:{account:r}},localization:s,routes:{admin:i}}}=W(),{navOpen:l}=vi(),a=EB(null),[c,u]=PB(!1);FB(()=>{let f=()=>{let m=a.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 nf("header",{className:[So,l&&`${So}--nav-open`].filter(Boolean).join(" "),children:[zo("div",{className:`${So}__bg`}),zo("div",{className:`${So}__content`,children:nf("div",{className:`${So}__wrapper`,children:[zo(Ob,{className:`${So}__mobile-nav-toggler`,tabIndex:-1,children:zo(kb,{})}),nf("div",{className:`${So}__controls-wrapper`,children:[zo("div",{className:`${So}__step-nav-wrapper`,children:zo(b4,{className:`${So}__step-nav`,CustomIcon:e})}),nf("div",{className:`${So}__actions-wrapper`,children:[zo("div",{className:`${So}__actions`,ref:a,children:d.map((f,m)=>zo("div",{className:c&&m===d.length-1?`${So}__last-action`:"",children:f},m))}),c&&zo("div",{className:`${So}__gradient-placeholder`})]}),s&&zo(tf,{ariaLabel:"invisible",className:`${So}__localizer-spacing`}),zo(Kt,{"aria-label":o("authentication:account"),className:`${So}__account`,href:AB({adminRoute:i,path:r}),prefetch:!1,tabIndex:0,children:zo(oe,{CustomComponent:t,Fallback:zo(Fb,{})})})]})]})}),zo(c4,{className:`${So}__localizer`})]})}import{jsx as Bb,jsxs as LB}from"react/jsx-runtime";import"react";var qc="card",kB=t=>{let{id:e,actions:o,buttonAriaLabel:n,href:r,onClick:s,title:i,titleAs:l}=t,a=[qc,e,(s||r)&&`${qc}--has-onclick`].filter(Boolean).join(" ");return LB("div",{className:a,id:e,children:[Bb(l??"div",{className:`${qc}__title`,children:i}),o&&Bb("div",{className:`${qc}__actions`,children:o}),(s||r)&&Bb(ae,{"aria-label":n,buttonStyle:"none",className:`${qc}__click`,el:"link",onClick:s,to:r})]})};import{c as $B}from"react/compiler-runtime";import{jsx as vs,jsxs as sf}from"react/jsx-runtime";import{getTranslation as jB}from"@payloadcms/translations";import{useRouter as OB}from"next/navigation.js";import Ta from"react";var af="copy-locale-data",lf="copy-locale",Vb=()=>{let t=$B(38),{config:e}=W(),{localization:o,routes:n,serverURL:r}=e,{admin:s}=n,{code:i}=Ee(),{id:l,collectionSlug:a,globalSlug:c}=Ae(),{i18n:u,t:d}=$(),f=Ht(),{toggleModal:m}=de(),{copyDataFromLocale:h}=Dt(),p=OB(),{startRouteTransition:g}=it(),b;t[0]!==o?(b=o&&o.locales.map(MB)||[],t[0]=o,t[1]=b):b=t[1];let x=b,v;t[2]!==i?(v=G=>G.value!==i,t[2]=i,t[3]=v):v=t[3];let C=x.filter(v),y;t[4]!==u||t[5]!==o?(y=G=>{let Y=o&&o.locales.find(X=>X.code===G);return Y&&Y.label?jB(Y.label,u):G},t[4]=u,t[5]=o,t[6]=y):y=t[6];let I=y,[w,A]=Ta.useState(!1),[_,D]=Ta.useState(null),[T,S]=Ta.useState(i),[R,E]=Ta.useState(!1),F,L;t[7]!==i||t[8]!==T?(F=()=>{T!==i&&S(i)},L=[i,T],t[7]=i,t[8]=T,t[9]=F,t[10]=L):(F=t[9],L=t[10]),Ta.useEffect(F,L);let k;t[11]!==s||t[12]!==a||t[13]!==h||t[14]!==c||t[15]!==l||t[16]!==R||t[17]!==p||t[18]!==r||t[19]!==g||t[20]!==m?(k=async G=>{let{from:Y,to:X}=G;A(!0);try{await h({collectionSlug:a,docID:l,fromLocale:Y,globalSlug:c,overrideData:R,toLocale:X}),A(!1),g(()=>p.push(`${r}${s}/${a?`collections/${a}/${l}`:`globals/${c}`}?locale=${X}`)),m(lf)}catch(ee){let q=ee;fe.error(q.message)}},t[11]=s,t[12]=a,t[13]=h,t[14]=c,t[15]=l,t[16]=R,t[17]=p,t[18]=r,t[19]=g,t[20]=m,t[21]=k):k=t[21];let N=k;if(!l&&!c)return null;let P;t[22]!==f||t[23]!==d||t[24]!==m?(P=()=>{f?fe.info(d("general:unsavedChanges")):m(lf)},t[22]=f,t[23]=d,t[24]=m,t[25]=P):P=t[25];let j;t[26]!==m?(j=()=>{m(lf)},t[26]=m,t[27]=j):j=t[27];let V;t[28]!==N||t[29]!==w||t[30]!==T||t[31]!==d||t[32]!==_?(V=async()=>{if(T===_){fe.error(d("localization:cannotCopySameLocale"));return}w||await N({from:T,to:_})},t[28]=N,t[29]=w,t[30]=T,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&&S(G.value)},t[34]=M):M=t[34];let O;t[35]===Symbol.for("react.memo_cache_sentinel")?(O=G=>{G?.value&&D(G.value)},t[35]=O):O=t[35];let B;return t[36]!==R?(B=()=>E(!R),t[36]=R,t[37]=B):B=t[37],sf(Ta.Fragment,{children:[vs(Be.Button,{id:`${af}__button`,onClick:P,children:d("localization:copyToLocale")}),sf(Pt,{className:af,gutter:!1,Header:vs(ba,{onClose:j,title:d("localization:copyToLocale")}),slug:lf,children:[sf("div",{className:`${af}__sub-header`,children:[vs("span",{children:T&&_?vs("div",{children:d("localization:copyFromTo",{from:I(T),to:I(_)})}):d("localization:selectLocaleToCopy")}),vs(ae,{buttonStyle:"primary",disabled:!T||!_,iconPosition:"left",onClick:V,size:"medium",children:w?d("general:copying")+"...":d("general:copy")})]}),sf("div",{className:`${af}__content`,children:[vs(fa,{label:d("localization:copyFrom"),name:"fromLocale",onChange:M,options:x,path:"fromLocale",readOnly:!0,value:T}),vs(fa,{label:d("localization:copyTo"),name:"toLocale",onChange:O,options:C,path:"toLocale",value:_}),vs(cr,{checked:R,field:{name:"overwriteExisting",label:d("general:overwriteExistingData")},onChange:B,path:"overwriteExisting"})]})]})]})};function MB(t){return{label:t.label,value:t.code}}import{jsx as w4,jsxs as QB}from"react/jsx-runtime";import{getTranslation as I4}from"@payloadcms/translations";import{useRouter as KB,useSearchParams as e7}from"next/navigation.js";import{mergeListSearchAndWhere as t7}from"payload/shared";import*as R4 from"qs-esm";import o7,{useCallback as S4}from"react";import{c as BB}from"react/compiler-runtime";import{jsx as VB}from"react/jsx-runtime";import{usePathname as GB,useRouter as WB}from"next/navigation.js";import{createContext as zB,use as HB,useEffect as XB}from"react";var v4=zB({clearRouteCache:()=>{}}),Gb=t=>{let e=BB(10),{children:o}=t,n=GB(),r=WB(),s;e[0]!==r?(s=()=>{r.refresh()},e[0]=r,e[1]=s):s=e[1];let i=s,l;e[2]!==i?(l=()=>{i()},e[2]=i,e[3]=l):l=e[3];let a;e[4]!==i||e[5]!==n?(a=[n,i],e[4]=i,e[5]=n,e[6]=a):a=e[6],XB(l,a);let c;return e[7]!==o||e[8]!==i?(c=VB(v4,{value:{clearRouteCache:i},children:o}),e[7]=o,e[8]=i,e[9]=c):c=e[9],c},Fn=()=>HB(v4);import{jsx as UB}from"react/jsx-runtime";import{useSearchParams as YB}from"next/navigation.js";import*as C4 from"qs-esm";import{createContext as ZB,use as JB,useCallback as Wb,useEffect as x4,useRef as qB,useState as zb}from"react";var bo=function(t){return t.AllAvailable="allAvailable",t.AllInPage="allInPage",t.None="none",t.Some="some",t}({}),y4=ZB({}),Hb=({children:t,docs:e=[],totalDocs:o,user:n})=>{let r=qB({}),{code:s}=Ee(),[i,l]=zb(()=>{let g=new Map;return e.forEach(({id:b})=>{g.set(b,!1)}),g}),[a,c]=zb("none"),[u,d]=zb(0),f=YB(),m=Wb((g=!1)=>{let b=new Map;g?(c("allAvailable"),e.forEach(({id:x,_isLocked:v,_userEditing:C})=>{(!v||C?.id===n?.id)&&b.set(x,!0)})):a==="allAvailable"||a==="allInPage"?c("none"):e.forEach(({id:x,_isLocked:v,_userEditing:C})=>{(!v||C?.id===n?.id)&&b.set(x,a!=="some")}),l(b)},[e,a,n?.id]),h=Wb(g=>{let b=e.find(y=>y.id===g);if(b?._isLocked&&n?.id!==b?._userEditing.id)return;let x=i.get(g),v=typeof x=="boolean"?!x:!0,C=new Map(i.set(g,v));a==="allAvailable"&&!v&&c("some"),l(C)},[i,e,a,n?.id]),p=Wb(g=>{let b;if(a==="allAvailable")b=Nr(f)?.where||{id:{not_equals:""}};else{let x=[];for(let[v,C]of i)C&&x.push(v);b={id:{in:x}}}return g&&(b={and:[{...g},b]}),C4.stringify({locale:s,where:b},{addQueryPrefix:!0})},[a,i,s,f]);return x4(()=>{if(a==="allAvailable")return;let g=!1,b=!0;if(!i.size)b=!1,g=!1;else for(let[x,v]of i)b=b&&v,g=g||v;b&&i.size===e.length?c("allInPage"):c(g?"some":"none")},[a,i,o,e]),x4(()=>{let g=0;if(a==="allAvailable")g=o;else for(let[b,x]of i)x&&g++;d(g)},[a,i,o]),r.current={count:u,getQueryParams:p,selectAll:a,selected:i,setSelection:h,toggleAll:m,totalDocs:o},UB(y4,{value:r.current,children:t})},Qt=()=>JB(y4);var r7="delete-documents",Xb=t=>{let{collection:e,collection:{slug:o,labels:{plural:n,singular:r}}={}}=t,{permissions:s}=Se(),{config:{routes:{api:i},serverURL:l}}=W(),{openModal:a}=de(),{count:c,getQueryParams:u,selectAll:d,toggleAll:f}=Qt(),{i18n:m,t:h}=$(),p=KB(),g=e7(),{clearRouteCache:b}=Fn(),v=s?.collections?.[o]?.delete,C=`delete-${o}`,y=S4(()=>{fe.error(h("error:unknown"))},[h]),I=S4(async()=>{let w=t7({collectionConfig:e,search:g.get("search")}),A=u(w);await Ke.delete(`${l}${i}/${o}${A}`,{headers:{"Accept-Language":m.language,"Content-Type":"application/json"}}).then(async _=>{try{let D=await _.json(),T=D?.docs.length||0,S=T>1?n:r;if(_.status<400||T>0)return fe.success(h("general:deletedCountSuccessfully",{count:T,label:I4(S,m)})),D?.errors.length>0&&fe.error(D.message,{description:D.errors.map(R=>R.message).join(`
53
+ `]))),Ky=function(e,o){var n=e.isFocused,r=e.size,s=e.theme,i=s.colors,l=s.spacing.baseUnit;return we({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:l*2})},Th=function(e){var o=e.delay,n=e.offset;return Re("span",{css:Ll({animation:"".concat(M5," 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"},"","")})},B5=function(e){var o=e.innerProps,n=e.isRtl,r=e.size,s=r===void 0?4:r,i=Vo(e,L5);return Re("div",ye({},Nt(we(we({},i),{},{innerProps:o,isRtl:n,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),o),Re(Th,{delay:0,offset:n}),Re(Th,{delay:160,offset:!0}),Re(Th,{delay:320,offset:!n}))},ew=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.theme,i=s.colors,l=s.borderRadius,a=s.spacing;return we({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.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:l,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},V5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.innerRef,i=e.innerProps,l=e.menuIsOpen;return Re("div",ye({ref:s},Nt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":l}),i,{"aria-disabled":n||void 0}),o)},G5=V5,W5=["data"],tw=function(e,o){var n=e.theme.spacing;return o?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},z5=function(e){var o=e.children,n=e.cx,r=e.getStyles,s=e.getClassNames,i=e.Heading,l=e.headingProps,a=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return Re("div",ye({},Nt(e,"group",{group:!0}),a),Re(i,ye({},l,{selectProps:d,theme:u,getStyles:r,getClassNames:s,cx:n}),c),Re("div",null,o))},ow=function(e,o){var n=e.theme,r=n.colors,s=n.spacing;return we({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"})},H5=function(e){var o=Ty(e);o.data;var n=Vo(o,W5);return Re("div",ye({},Nt(e,"groupHeading",{"group-heading":!0}),n))},X5=z5,U5=["innerRef","isDisabled","isHidden","inputClassName"],rw=function(e,o){var n=e.isDisabled,r=e.value,s=e.theme,i=s.spacing,l=s.colors;return we(we({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},Y5),o?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:l.neutral80})},nw={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Y5={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":we({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},nw)},Z5=function(e){return we({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},nw)},J5=function(e){var o=e.cx,n=e.value,r=Ty(e),s=r.innerRef,i=r.isDisabled,l=r.isHidden,a=r.inputClassName,c=Vo(r,U5);return Re("div",ye({},Nt(e,"input",{"input-container":!0}),{"data-value":n||""}),Re("input",ye({className:o({input:!0},a),ref:s,style:Z5(l),disabled:i},c)))},q5=J5,sw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors;return we({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 we({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})},aw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors,l=e.isFocused;return we({alignItems:"center",display:"flex"},o?{}:{borderRadius:s/2,backgroundColor:l?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},lw=function(e){var o=e.children,n=e.innerProps;return Re("div",n,o)},Q5=lw,K5=lw;function e6(t){var e=t.children,o=t.innerProps;return Re("div",ye({role:"button"},o),e||Re(Ph,{size:14}))}var t6=function(e){var o=e.children,n=e.components,r=e.data,s=e.innerProps,i=e.isDisabled,l=e.removeProps,a=e.selectProps,c=n.Container,u=n.Label,d=n.Remove;return Re(c,{data:r,innerProps:we(we({},Nt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),s),selectProps:a},Re(u,{data:r,innerProps:we({},Nt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},o),Re(d,{data:r,innerProps:we(we({},Nt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(o||"option")},l),selectProps:a}))},o6=t6,cw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.theme,l=i.spacing,a=i.colors;return we({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},o?{}:{backgroundColor:s?a.primary:r?a.primary25:"transparent",color:n?a.neutral20:s?a.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:s?a.primary:a.primary50}})},r6=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.innerRef,l=e.innerProps;return Re("div",ye({},Nt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":s}),{ref:i,"aria-disabled":n},l),o)},n6=r6,uw=function(e,o){var n=e.theme,r=n.spacing,s=n.colors;return we({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},o?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},s6=function(e){var o=e.children,n=e.innerProps;return Re("div",ye({},Nt(e,"placeholder",{placeholder:!0}),n),o)},i6=s6,dw=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing,i=r.colors;return we({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})},a6=function(e){var o=e.children,n=e.isDisabled,r=e.innerProps;return Re("div",ye({},Nt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),o)},l6=a6,no={ClearIndicator:j5,Control:G5,DropdownIndicator:$5,DownChevron:Yy,CrossIcon:Ph,Group:X5,GroupHeading:H5,IndicatorsContainer:P5,IndicatorSeparator:O5,Input:q5,LoadingIndicator:B5,Menu:R5,MenuList:_5,MenuPortal:A5,LoadingMessage:T5,NoOptionsMessage:D5,MultiValue:o6,MultiValueContainer:Q5,MultiValueLabel:K5,MultiValueRemove:e6,Option:n6,Placeholder:i6,SelectContainer:F5,SingleValue:l6,ValueContainer:E5},mw=function(e){return we(we({},no),e.components)};var fw=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function c6(t,e){return!!(t===e||fw(t)&&fw(e))}function u6(t,e){if(t.length!==e.length)return!1;for(var o=0;o<t.length;o++)if(!c6(t[o],e[o]))return!1;return!0}function pw(t,e){e===void 0&&(e=u6);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 m6={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"},f6=function(e){return Re("span",ye({css:m6},e))},hw=f6,p6={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,l=e.selectValue,a=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"&&l)return"value ".concat(i," focused, ").concat(d(l,n),".");if(o==="menu"&&u){var f=a?" 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:"",".")}},h6=function(e){var o=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,i=e.isFocused,l=e.selectValue,a=e.selectProps,c=e.id,u=e.isAppleDevice,d=a.ariaLiveMessages,f=a.getOptionLabel,m=a.inputValue,h=a.isMulti,p=a.isOptionDisabled,g=a.isSearchable,b=a.menuIsOpen,x=a.options,v=a.screenReaderStatus,C=a.tabSelectsValue,y=a.isLoading,I=a["aria-label"],w=a["aria-live"],A=jl(function(){return we(we({},p6),d||{})},[d]),_=jl(function(){var F="";if(o&&A.onChange){var L=o.option,k=o.options,N=o.removedValue,P=o.removedValues,j=o.value,V=function(ee){return Array.isArray(ee)?null:ee},M=N||L||V(j),O=M?f(M):"",B=k||P||void 0,G=B?B.map(f):[],Y=we({isDisabled:M&&p(M,l),label:O,labels:G},o);F=A.onChange(Y)}return F},[o,A,p,l,f]),D=jl(function(){var F="",L=n||r,k=!!(n&&l&&l.includes(n));if(L&&A.onFocus){var N={focused:L,label:f(L),isDisabled:p(L,l),isSelected:k,options:s,context:L===n?"menu":"value",selectValue:l,isAppleDevice:u};F=A.onFocus(N)}return F},[n,r,f,p,A,s,l,u]),T=jl(function(){var F="";if(b&&x.length&&!y&&A.onFilter){var L=v({count:s.length});F=A.onFilter({inputValue:m,resultsMessage:L})}return F},[s,m,b,A,x,v,y]),S=o?.action==="initial-input-focus",R=jl(function(){var F="";if(A.guidance){var L=r?"value":b?"menu":"input";F=A.guidance({"aria-label":I,context:L,isDisabled:n&&p(n,l),isMulti:h,isSearchable:g,tabSelectsValue:C,isInitialFocus:S})}return F},[I,n,r,h,p,g,b,A,l,C,S]),E=Re(kh,null,Re("span",{id:"aria-selection"},_),Re("span",{id:"aria-focused"},D),Re("span",{id:"aria-results"},T),Re("span",{id:"aria-guidance"},R));return Re(kh,null,Re(hw,{id:c},S&&E),Re(hw,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!S&&E))},g6=h6,$h=[{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"}],b6=new RegExp("["+$h.map(function(t){return t.letters}).join("")+"]","g"),Tw={};for(Yd=0;Yd<$h.length;Yd++)for(Zd=$h[Yd],Jd=0;Jd<Zd.letters.length;Jd++)Tw[Zd.letters[Jd]]=Zd.base;var Zd,Jd,Yd,Aw=function(e){return e.replace(b6,function(o){return Tw[o]})},v6=pw(Aw),gw=function(e){return e.replace(/^\s+|\s+$/g,"")},x6=function(e){return"".concat(e.label," ").concat(e.value)},C6=function(e){return function(o,n){if(o.data.__isNew__)return!0;var r=we({ignoreCase:!0,ignoreAccents:!0,stringify:x6,trim:!0,matchFrom:"any"},e),s=r.ignoreCase,i=r.ignoreAccents,l=r.stringify,a=r.trim,c=r.matchFrom,u=a?gw(n):n,d=a?gw(l(o)):l(o);return s&&(u=u.toLowerCase(),d=d.toLowerCase()),i&&(u=v6(u),d=Aw(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},y6=["innerRef"];function w6(t){var e=t.innerRef,o=Vo(t,y6),n=Ly(o,"onExited","in","enter","exit","appear");return Re("input",ye({ref:e},n,{css:Ll({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 I6=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function S6(t){var e=t.isEnabled,o=t.onBottomArrive,n=t.onBottomLeave,r=t.onTopArrive,s=t.onTopLeave,i=na(!1),l=na(!1),a=na(0),c=na(null),u=Kn(function(g,b){if(c.current!==null){var x=c.current,v=x.scrollTop,C=x.scrollHeight,y=x.clientHeight,I=c.current,w=b>0,A=C-y-v,_=!1;A>b&&i.current&&(n&&n(g),i.current=!1),w&&l.current&&(s&&s(g),l.current=!1),w&&b>A?(o&&!i.current&&o(g),I.scrollTop=C,_=!0,i.current=!0):!w&&-b>v&&(r&&!l.current&&r(g),I.scrollTop=0,_=!0,l.current=!0),_&&I6(g)}},[o,n,r,s]),d=Kn(function(g){u(g,g.deltaY)},[u]),f=Kn(function(g){a.current=g.changedTouches[0].clientY},[]),m=Kn(function(g){var b=a.current-g.changedTouches[0].clientY;u(g,b)},[u]),h=Kn(function(g){if(g){var b=Py?{passive:!1}:!1;g.addEventListener("wheel",d,b),g.addEventListener("touchstart",f,b),g.addEventListener("touchmove",m,b)}},[m,f,d]),p=Kn(function(g){g&&(g.removeEventListener("wheel",d,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",m,!1))},[m,f,d]);return Dw(function(){if(e){var g=c.current;return h(g),function(){p(g)}}},[e,h,p]),function(g){c.current=g}}var bw=["boxSizing","height","overflow","paddingRight","position"],vw={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function xw(t){t.cancelable&&t.preventDefault()}function Cw(t){t.stopPropagation()}function yw(){var t=this.scrollTop,e=this.scrollHeight,o=t+this.offsetHeight;t===0?this.scrollTop=1:o===e&&(this.scrollTop=t-1)}function ww(){return"ontouchstart"in window||navigator.maxTouchPoints}var Iw=!!(typeof window<"u"&&window.document&&window.document.createElement),Ol=0,ra={capture:!1,passive:!1};function R6(t){var e=t.isEnabled,o=t.accountForScrollbars,n=o===void 0?!0:o,r=na({}),s=na(null),i=Kn(function(a){if(Iw){var c=document.body,u=c&&c.style;if(n&&bw.forEach(function(h){var p=u&&u[h];r.current[h]=p}),n&&Ol<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,m=window.innerWidth-f+d||0;Object.keys(vw).forEach(function(h){var p=vw[h];u&&(u[h]=p)}),u&&(u.paddingRight="".concat(m,"px"))}c&&ww()&&(c.addEventListener("touchmove",xw,ra),a&&(a.addEventListener("touchstart",yw,ra),a.addEventListener("touchmove",Cw,ra))),Ol+=1}},[n]),l=Kn(function(a){if(Iw){var c=document.body,u=c&&c.style;Ol=Math.max(Ol-1,0),n&&Ol<1&&bw.forEach(function(d){var f=r.current[d];u&&(u[d]=f)}),c&&ww()&&(c.removeEventListener("touchmove",xw,ra),a&&(a.removeEventListener("touchstart",yw,ra),a.removeEventListener("touchmove",Cw,ra)))}},[n]);return Dw(function(){if(e){var a=s.current;return i(a),function(){l(a)}}},[e,i,l]),function(a){s.current=a}}var _6=function(e){var o=e.target;return o.ownerDocument.activeElement&&o.ownerDocument.activeElement.blur()},D6={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function T6(t){var e=t.children,o=t.lockEnabled,n=t.captureEnabled,r=n===void 0?!0:n,s=t.onBottomArrive,i=t.onBottomLeave,l=t.onTopArrive,a=t.onTopLeave,c=S6({isEnabled:r,onBottomArrive:s,onBottomLeave:i,onTopArrive:l,onTopLeave:a}),u=R6({isEnabled:o}),d=function(m){c(m),u(m)};return Re(kh,null,o&&Re("div",{onClick:_6,css:D6}),e(d))}var A6={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},F6=function(e){var o=e.name,n=e.onFocus;return Re("input",{required:!0,name:o,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:A6,value:"",onChange:function(){}})},E6=F6;function jh(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 P6(){return jh(/^iPhone/i)}function Fw(){return jh(/^Mac/i)}function N6(){return jh(/^iPad/i)||Fw()&&navigator.maxTouchPoints>1}function L6(){return P6()||N6()}function k6(){return Fw()||L6()}var $6=function(e){return e.label},Oh=function(e){return e.label},Mh=function(e){return e.value},j6=function(e){return!!e.isDisabled},O6={clearIndicator:qy,container:zy,control:ew,dropdownIndicator:Jy,group:tw,groupHeading:ow,indicatorsContainer:Xy,indicatorSeparator:Qy,input:rw,loadingIndicator:Ky,loadingMessage:Gy,menu:$y,menuList:My,menuPortal:Wy,multiValue:sw,multiValueLabel:iw,multiValueRemove:aw,noOptionsMessage:Vy,option:cw,placeholder:uw,singleValue:dw,valueContainer:Hy};var M6={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%)"},B6=4,Ew=4,V6=38,G6=Ew*2,W6={baseUnit:Ew,controlHeight:V6,menuGutter:G6},Nh={borderRadius:B6,colors:M6,spacing:W6},z6={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Eh(),captureMenuScroll:!Eh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:C6(),formatGroupLabel:$6,getOptionLabel:Oh,getOptionValue:Mh,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:j6,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Fy(),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 Sw(t,e,o,n){var r=Lw(t,e,o),s=kw(t,e,o),i=Nw(t,e),l=Qd(t,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:i,value:l,index:n}}function qd(t,e){return t.options.map(function(o,n){if("options"in o){var r=o.options.map(function(i,l){return Sw(t,i,e,l)}).filter(function(i){return _w(t,i)});return r.length>0?{type:"group",data:o,options:r,index:n}:void 0}var s=Sw(t,o,e,n);return _w(t,s)?s:void 0}).filter(Ny)}function Pw(t){return t.reduce(function(e,o){return o.type==="group"?e.push.apply(e,qn(o.options.map(function(n){return n.data}))):e.push(o.data),e},[])}function Rw(t,e){return t.reduce(function(o,n){return n.type==="group"?o.push.apply(o,qn(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 H6(t,e){return Pw(qd(t,e))}function _w(t,e){var o=t.inputValue,n=o===void 0?"":o,r=e.data,s=e.isSelected,i=e.label,l=e.value;return(!jw(t)||!s)&&$w(t,{label:i,value:l,data:r},n)}function X6(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 U6(t,e){var o=t.focusedOption;return o&&e.indexOf(o)>-1?o:e[0]}var Lh=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},Nw=function(e,o){return e.getOptionLabel(o)},Qd=function(e,o){return e.getOptionValue(o)};function Lw(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=Qd(t,e);return o.some(function(r){return Qd(t,r)===n})}function $w(t,e,o){return t.filterOption?t.filterOption(e,o):!0}var jw=function(e){var o=e.hideSelectedOptions,n=e.isMulti;return o===void 0?n:o},Y6=1,Ml=function(t){DC(o,t);var e=AC(o);function o(n){var r;if(SC(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=k6(),r.controlRef=null,r.getControlRef=function(a){r.controlRef=a},r.focusedOptionRef=null,r.getFocusedOptionRef=function(a){r.focusedOptionRef=a},r.menuListRef=null,r.getMenuListRef=function(a){r.menuListRef=a},r.inputRef=null,r.getInputRef=function(a){r.inputRef=a},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(a,c){var u=r.props,d=u.onChange,f=u.name;c.name=f,r.ariaOnChange(a,c),d(a,c)},r.setValue=function(a,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(a,{action:c,option:u})},r.selectOption=function(a){var c=r.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,m=r.state.selectValue,h=d&&r.isOptionSelected(a,m),p=r.isOptionDisabled(a,m);if(h){var g=r.getOptionValue(a);r.setValue(m.filter(function(b){return r.getOptionValue(b)!==g}),"deselect-option",a)}else if(!p)d?r.setValue([].concat(qn(m),[a]),"select-option",a):r.setValue(a,"select-option");else{r.ariaOnChange(a,{action:"select-option",option:a,name:f});return}u&&r.blurInput()},r.removeValue=function(a){var c=r.props.isMulti,u=r.state.selectValue,d=r.getOptionValue(a),f=u.filter(function(h){return r.getOptionValue(h)!==d}),m=Zs(c,f,f[0]||null);r.onChange(m,{action:"remove-value",removedValue:a}),r.focusInput()},r.clearValue=function(){var a=r.state.selectValue;r.onChange(Zs(r.props.isMulti,[],null),{action:"clear",removedValues:a})},r.popValue=function(){var a=r.props.isMulti,c=r.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=Zs(a,d,d[0]||null);u&&r.onChange(f,{action:"pop-value",removedValue:u})},r.getFocusedOptionId=function(a){return Lh(r.state.focusableOptionsWithIds,a)},r.getFocusableOptionsWithIds=function(){return Rw(qd(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return Dy.apply(void 0,[r.props.classNamePrefix].concat(c))},r.getOptionLabel=function(a){return Nw(r.props,a)},r.getOptionValue=function(a){return Qd(r.props,a)},r.getStyles=function(a,c){var u=r.props.unstyled,d=O6[a](c,u);d.boxSizing="border-box";var f=r.props.styles[a];return f?f(d,c):d},r.getClassNames=function(a,c){var u,d;return(u=(d=r.props.classNames)[a])===null||u===void 0?void 0:u.call(d,c)},r.getElementId=function(a){return"".concat(r.state.instancePrefix,"-").concat(a)},r.getComponents=function(){return mw(r.props)},r.buildCategorizedOptions=function(){return qd(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Pw(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(a,c){r.setState({ariaSelection:we({value:a},c)})},r.onMenuMouseDown=function(a){a.button===0&&(a.stopPropagation(),a.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(a){r.blockOptionHover=!1},r.onControlMouseDown=function(a){if(!a.defaultPrevented){var c=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&r.onMenuClose():c&&r.openMenu("first"):(c&&(r.openAfterFocus=!0),r.focusInput()),a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.preventDefault()}},r.onDropdownIndicatorMouseDown=function(a){if(!(a&&a.type==="mousedown"&&a.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"),a.preventDefault()}},r.onClearIndicatorMouseDown=function(a){a&&a.type==="mousedown"&&a.button!==0||(r.clearValue(),a.preventDefault(),r.openAfterFocus=!1,a.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(a){typeof r.props.closeMenuOnScroll=="boolean"?a.target instanceof HTMLElement&&$l(a.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(a)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(a){var c=a.touches,u=c&&c.item(0);u&&(r.initialTouchX=u.clientX,r.initialTouchY=u.clientY,r.userIsDragging=!1)},r.onTouchMove=function(a){var c=a.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(a){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(a.target)&&r.menuListRef&&!r.menuListRef.contains(a.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(a){r.userIsDragging||r.onControlMouseDown(a)},r.onClearIndicatorTouchEnd=function(a){r.userIsDragging||r.onClearIndicatorMouseDown(a)},r.onDropdownIndicatorTouchEnd=function(a){r.userIsDragging||r.onDropdownIndicatorMouseDown(a)},r.handleInputChange=function(a){var c=r.props.inputValue,u=a.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(u,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(a){r.props.onFocus&&r.props.onFocus(a),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(a){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(a),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(a){if(!(r.blockOptionHover||r.state.focusedOption===a)){var c=r.getFocusableOptions(),u=c.indexOf(a);r.setState({focusedOption:a,focusedOptionId:u>-1?r.getFocusedOptionId(a):null})}},r.shouldHideSelectedOptions=function(){return jw(r.props)},r.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),r.focus()},r.onKeyDown=function(a){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,x=c.tabSelectsValue,v=c.openMenuOnFocus,C=r.state,y=C.focusedOption,I=C.focusedValue,w=C.selectValue;if(!p&&!(typeof b=="function"&&(b(a),a.defaultPrevented))){switch(r.blockOptionHover=!0,a.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(I)r.removeValue(I);else{if(!d)return;u?r.popValue():h&&r.clearValue()}break;case"Tab":if(r.isComposing||a.shiftKey||!g||!x||!y||v&&r.isOptionSelected(y,w))return;r.selectOption(y);break;case"Enter":if(a.keyCode===229)break;if(g){if(!y||r.isComposing)return;r.selectOption(y);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(!y)return;r.selectOption(y);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}a.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++Y6),r.state.selectValue=oa(n.value),n.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),l=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=i[l],r.state.focusedOptionId=Lh(s,i[l])}return r}return _C(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&&Fh(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var s=this.props,i=s.isDisabled,l=s.menuIsOpen,a=this.state.isFocused;(a&&!i&&r.isDisabled||a&&l&&!r.menuIsOpen)&&this.focusInput(),a&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!a&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Fh(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,l=i.selectValue,a=i.isFocused,c=this.buildFocusableOptions(),u=r==="first"?0:c.length-1;if(!this.props.isMulti){var d=c.indexOf(l[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(a&&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,l=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=i.indexOf(l);l||(a=-1);var c=i.length-1,u=-1;if(i.length){switch(r){case"previous":a===0?u=0:a===-1?u=c:u=a-1;break;case"next":a>-1&&a<c&&(u=a+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,l=this.getFocusableOptions();if(l.length){var a=0,c=l.indexOf(i);i||(c=-1),r==="up"?a=c>0?c-1:l.length-1:r==="down"?a=(c+1)%l.length:r==="pageup"?(a=c-s,a<0&&(a=0)):r==="pagedown"?(a=c+s,a>l.length-1&&(a=l.length-1)):r==="last"&&(a=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[a])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Nh):we(we({},Nh),this.props.theme):Nh}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,i=this.getStyles,l=this.getClassNames,a=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:l,getValue:a,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 Lw(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return kw(this.props,r,s)}},{key:"filterOption",value:function(r,s){return $w(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:i,selectValue:l})}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,l=r.inputId,a=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,x=this.commonProps,v=l||this.getElementId("input"),C=we(we(we({"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?dt.createElement(h,ye({},x,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:v,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:a},C)):dt.createElement(w6,ye({id:v,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:kl,onFocus:this.onInputFocus,disabled:s,tabIndex:c,inputMode:"none",form:u,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),i=s.MultiValue,l=s.MultiValueContainer,a=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,x=m.placeholder,v=this.state,C=v.selectValue,y=v.focusedValue,I=v.isFocused;if(!this.hasValue()||!h)return b?null:dt.createElement(d,ye({},f,{key:"placeholder",isDisabled:p,isFocused:I,innerProps:{id:this.getElementId("placeholder")}}),x);if(g)return C.map(function(A,_){var D=A===y,T="".concat(r.getOptionLabel(A),"-").concat(r.getOptionValue(A));return dt.createElement(i,ye({},f,{components:{Container:l,Label:a,Remove:c},isFocused:D,isDisabled:p,key:T,index:_,removeProps:{onClick:function(){return r.removeValue(A)},onTouchEnd:function(){return r.removeValue(A)},onMouseDown:function(R){R.preventDefault()}},data:A}),r.formatOptionLabel(A,"value"))});if(b)return null;var w=C[0];return dt.createElement(u,ye({},f,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,i=this.commonProps,l=this.props,a=l.isDisabled,c=l.isLoading,u=this.state.isFocused;if(!this.isClearable()||!s||a||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return dt.createElement(s,ye({},i,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,i=this.commonProps,l=this.props,a=l.isDisabled,c=l.isLoading,u=this.state.isFocused;if(!s||!c)return null;var d={"aria-hidden":"true"};return dt.createElement(s,ye({},i,{innerProps:d,isDisabled:a,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,i=r.IndicatorSeparator;if(!s||!i)return null;var l=this.commonProps,a=this.props.isDisabled,c=this.state.isFocused;return dt.createElement(i,ye({},l,{isDisabled:a,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var i=this.commonProps,l=this.props.isDisabled,a=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return dt.createElement(s,ye({},i,{innerProps:c,isDisabled:l,isFocused:a}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),i=s.Group,l=s.GroupHeading,a=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,x=g.inputValue,v=g.isLoading,C=g.loadingMessage,y=g.minMenuHeight,I=g.maxMenuHeight,w=g.menuIsOpen,A=g.menuPlacement,_=g.menuPosition,D=g.menuPortalTarget,T=g.menuShouldBlockScroll,S=g.menuShouldScrollIntoView,R=g.noOptionsMessage,E=g.onMenuScrollToTop,F=g.onMenuScrollToBottom;if(!w)return null;var L=function(O,B){var G=O.type,Y=O.data,X=O.isDisabled,ee=O.isSelected,q=O.label,z=O.value,re=p===Y,me=X?void 0:function(){return r.onOptionHover(Y)},se=X?void 0:function(){return r.selectOption(Y)},Z="".concat(r.getElementId("option"),"-").concat(B),Q={id:Z,onClick:se,onMouseMove:me,onMouseOver:me,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:ee};return dt.createElement(m,ye({},h,{innerProps:Q,data:Y,isDisabled:X,isSelected:ee,key:Z,label:q,type:G,value:z,isFocused:re,innerRef:re?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(O.data,"menu"))},k;if(this.hasOptions())k=this.getCategorizedOptions().map(function(M){if(M.type==="group"){var O=M.data,B=M.options,G=M.index,Y="".concat(r.getElementId("group"),"-").concat(G),X="".concat(Y,"-heading");return dt.createElement(i,ye({},h,{key:Y,data:O,options:B,Heading:l,headingProps:{id:X,data:M.data},label:r.formatGroupLabel(M.data)}),M.options.map(function(ee){return L(ee,"".concat(G,"-").concat(ee.index))}))}else if(M.type==="option")return L(M,"".concat(M.index))});else if(v){var N=C({inputValue:x});if(N===null)return null;k=dt.createElement(d,h,N)}else{var P=R({inputValue:x});if(P===null)return null;k=dt.createElement(f,h,P)}var j={minMenuHeight:y,maxMenuHeight:I,menuPlacement:A,menuPosition:_,menuShouldScrollIntoView:S},V=dt.createElement(Oy,ye({},h,j),function(M){var O=M.ref,B=M.placerProps,G=B.placement,Y=B.maxHeight;return dt.createElement(a,ye({},h,j,{innerRef:O,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:v,placement:G}),dt.createElement(T6,{captureEnabled:b,onTopArrive:E,onBottomArrive:F,lockEnabled:T},function(X){return dt.createElement(c,ye({},h,{innerRef:function(q){r.getMenuListRef(q),X(q)},innerProps:{role:"listbox","aria-multiselectable":h.isMulti,id:r.getElementId("listbox")},isLoading:v,maxHeight:Y,focusedOption:p}),k)}))});return D||_==="fixed"?dt.createElement(u,ye({},h,{appendTo:D,controlElement:this.controlRef,menuPlacement:A,menuPosition:_}),V):V}},{key:"renderFormField",value:function(){var r=this,s=this.props,i=s.delimiter,l=s.isDisabled,a=s.isMulti,c=s.name,u=s.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!l)return dt.createElement(E6,{name:c,onFocus:this.onValueInputFocus});if(!(!c||l))if(a)if(i){var f=d.map(function(p){return r.getOptionValue(p)}).join(i);return dt.createElement("input",{name:c,type:"hidden",value:f})}else{var m=d.length>0?d.map(function(p,g){return dt.createElement("input",{key:"i-".concat(g),name:c,type:"hidden",value:r.getOptionValue(p)})}):dt.createElement("input",{name:c,type:"hidden",value:""});return dt.createElement("div",null,m)}else{var h=d[0]?this.getOptionValue(d[0]):"";return dt.createElement("input",{name:c,type:"hidden",value:h})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,i=s.ariaSelection,l=s.focusedOption,a=s.focusedValue,c=s.isFocused,u=s.selectValue,d=this.getFocusableOptions();return dt.createElement(g6,ye({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:l,focusedValue:a,isFocused:c,selectValue:u,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,i=r.IndicatorsContainer,l=r.SelectContainer,a=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 dt.createElement(l,ye({},p,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:h}),this.renderLiveRegion(),dt.createElement(s,ye({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:h,menuIsOpen:m}),dt.createElement(a,ye({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),dt.createElement(i,ye({},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,l=s.clearFocusValueOnUpdate,a=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,x=oa(h),v={};if(i&&(h!==i.value||m!==i.options||p!==i.menuIsOpen||g!==i.inputValue)){var C=p?H6(r,x):[],y=p?Rw(qd(r,x),"".concat(f,"-option")):[],I=l?X6(s,x):null,w=U6(s,C),A=Lh(y,w);v={selectValue:x,focusedOption:w,focusedOptionId:A,focusableOptionsWithIds:y,focusedValue:I,clearFocusValueOnUpdate:!1}}var _=a!=null&&r!==i?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},D=c,T=u&&d;return u&&!T&&(D={value:Zs(b,x,x[0]||null),options:x,action:"initial-input-focus"},T=!d),c?.action==="initial-input-focus"&&(D=null),we(we(we({},v),_),{},{prevProps:r,ariaSelection:D,prevWasFocused:T})}}]),o}(d6);Ml.defaultProps=z6;import"react-dom";var J6=Z6(function(t,e){var o=yd(t);return Ow.createElement(Ml,ye({ref:e},o))}),Mw=J6;import*as Ww from"react";import{forwardRef as K6}from"react";import{useMemo as Bw,useCallback as q6}from"react";var Q6=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Vw=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},Bh={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,o,n,r){return!(!e||o.some(function(s){return Vw(e,s,r)})||n.some(function(s){return Vw(e,s,r)}))},getNewOptionData:function(e,o){return{label:o,value:e,__isNew__:!0}}};function Gw(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?Bh.formatCreateLabel:s,l=t.isValidNewOption,a=l===void 0?Bh.isValidNewOption:l,c=t.getNewOptionData,u=c===void 0?Bh.getNewOptionData:c,d=t.onCreateOption,f=t.options,m=f===void 0?[]:f,h=t.onChange,p=Vo(t,Q6),g=p.getOptionValue,b=g===void 0?Mh:g,x=p.getOptionLabel,v=x===void 0?Oh:x,C=p.inputValue,y=p.isLoading,I=p.isMulti,w=p.value,A=p.name,_=Bw(function(){return a(C,oa(w),m,{getOptionValue:b,getOptionLabel:v})?u(C,i(C)):void 0},[i,u,v,b,C,a,m,w]),D=Bw(function(){return(o||!y)&&_?r==="first"?[_].concat(qn(m)):[].concat(qn(m),[_]):m},[o,r,y,_,m]),T=q6(function(S,R){if(R.action!=="select-option")return h(S,R);var E=Array.isArray(S)?S:[S];if(E[E.length-1]===_){if(d)d(C);else{var F=u(C,C),L={action:"create-option",name:A,option:F};h(Zs(I,[].concat(qn(oa(w)),[F]),F),L)}return}h(S,R)},[u,C,I,A,_,d,h,w]);return we(we({},p),{},{options:D,onChange:T})}import"react-dom";var eN=K6(function(t,e){var o=yd(t),n=Gw(o);return Ww.createElement(Ml,ye({ref:e},n))}),zw=eN;import{jsx as Hw}from"react/jsx-runtime";import"react";var Xw="clear-indicator",Vh=t=>{let{clearValue:e,innerProps:{ref:o,...n}}=t;return Hw("div",{className:Xw,ref:typeof o=="string"?null:o,...n,onKeyDown:r=>{r.key==="Enter"&&(e(),r.stopPropagation())},role:"button",tabIndex:0,children:Hw(pt,{className:`${Xw}__icon`})})};import{jsx as Uw}from"react/jsx-runtime";import tN from"react";var Gh=t=>{let{children:e,innerProps:o,selectProps:{customProps:{disableKeyDown:n,disableMouseDown:r}={}}={}}=t;return Uw(tN.Fragment,{children:Uw(no.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 Yw}from"react/jsx-runtime";import"react";var Zw="dropdown-indicator",Wh=t=>{let{innerProps:{ref:e,...o}}=t;return Yw("button",{className:Zw,ref:e,...o,onKeyDown:n=>{n.key==="Enter"&&(n.key=" ")},type:"button",children:Yw(Je,{className:`${Zw}__icon`})})};import{jsx as Jw}from"react/jsx-runtime";import oN from"react";var zh=t=>Jw(oN.Fragment,{children:Jw(no.Input,{...t,"aria-activedescendant":void 0})});import{c as rN}from"react/compiler-runtime";import{jsx as qw}from"react/jsx-runtime";import nN from"react";var Qw="multi-value";function Hh(t,e){return typeof e=="function"?e(t):t.value}var Xh=t=>{let e=rN(26),{className:o,data:n,innerProps:r,isDisabled:s,selectProps:i}=t,l;e[0]!==i?(l=i===void 0?{}:i,e[0]=i,e[1]=l):l=e[1];let{customProps:a,getOptionValue:c,isSortable:u}=l,d;e[2]!==a?(d=a===void 0?{}:a,e[2]=a,e[3]=d):d=e[3];let{disableMouseDown:f}=d,m;e[4]!==n||e[5]!==c?(m=Hh(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:x,setNodeRef:v,transform:C}=Fi(p),y=!s&&u&&"draggable",I=b&&`${Qw}--is-dragging`,w;e[10]!==o||e[11]!==y||e[12]!==I?(w=[Qw,o,y,I].filter(Boolean),e[10]=o,e[11]=y,e[12]=I,e[13]=w):w=e[13];let A=w.join(" "),_;if(e[14]!==g||e[15]!==A||e[16]!==f||e[17]!==r||e[18]!==u||e[19]!==x||e[20]!==t||e[21]!==v||e[22]!==C){let D;e[24]!==f?(D=T=>{f||T.stopPropagation()},e[24]=f,e[25]=D):D=e[25],_=qw(nN.Fragment,{children:qw(no.MultiValue,{...t,className:A,innerProps:{...u?{...g,...x}:{},...r,onMouseDown:D,ref:v,style:u?{transform:C,...g?.style}:{}}})}),e[14]=g,e[15]=A,e[16]=f,e[17]=r,e[18]=u,e[19]=x,e[20]=t,e[21]=v,e[22]=C,e[23]=_}else _=e[23];return _};import{jsx as Kw}from"react/jsx-runtime";import"react";var e2="multi-value-label",Uh=t=>{let{data:e,selectProps:{customProps:{draggableProps:o,editableProps:n}={}}={}}=t,r=`${e2}__text`;return Kw("div",{className:e2,children:Kw(no.MultiValueLabel,{...t,innerProps:{className:r,...n&&n(e,r,t.selectProps)||{},...o||{}}})})};import{c as sN}from"react/compiler-runtime";import{jsx as t2,jsxs as iN}from"react/jsx-runtime";import aN from"react";var Yh="multi-value-remove",Zh=t=>{let e=sN(12),{innerProps:o}=t,{className:n,onClick:r,onTouchEnd:s}=o,[i,l]=aN.useState(!1),{t:a}=$(),c;if(e[0]!==n||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==a){let u=a("general:remove"),d;e[6]!==n?(d=[Yh,n].filter(Boolean),e[6]=n,e[7]=d):d=e[7];let f;e[8]!==r?(f=p=>{l(!1),r(p)},e[8]=r,e[9]=f):f=e[9];let m,h;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),h=()=>l(!1),e[10]=m,e[11]=h):(m=e[10],h=e[11]),c=iN("button",{"aria-label":u,className:d.join(" "),onClick:f,onKeyDown:lN,onMouseDown:cN,onMouseEnter:m,onMouseLeave:h,onTouchEnd:s,type:"button",children:[t2(po,{className:`${Yh}__tooltip`,show:i,children:a("general:remove")}),t2(pt,{className:`${Yh}__icon`})]}),e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=a,e[5]=c}else c=e[5];return c};function lN(t){t.key==="Enter"&&t.stopPropagation()}function cN(t){return t.stopPropagation()}import{jsx as o2}from"react/jsx-runtime";import uN from"react";var dN="react-select--single-value",Jh=t=>{let{children:e,className:o}=t;return o2(uN.Fragment,{children:o2(no.SingleValue,{...t,className:[dN,o].filter(Boolean).join(" "),children:e})})};import{jsx as r2}from"react/jsx-runtime";import"react";var mN="value-container",qh=t=>{let{selectProps:{customProps:e}={}}=t;return r2("div",{className:mN,ref:e?.droppableRef,children:r2(no.ValueContainer,{...t})})};var hN=t=>({label:t,value:t}),i2=t=>{let{i18n:e,t:o}=$(),[n,r]=s2.useState(""),s=pN(),[i,l]=s2.useState(!1);fN(()=>{l(!0)},[]);let{className:a,components:c,customProps:u,disabled:d=!1,filterOption:f=void 0,getOptionValue:m,isClearable:h=!0,isCreatable:p,isLoading:g,isSearchable:b=!0,noOptionsMessage:x=()=>o("general:noOptions"),numberOnly:v=!1,onChange:C,onMenuClose:y,onMenuOpen:I,options:w,placeholder:A=o("general:selectValue"),showError:_,value:D}=t,T=()=>o("general:loading")+"...",S=[a,"react-select",_&&"react-select--error"].filter(Boolean).join(" "),R={menu:F=>({...F,zIndex:void 0})};if(!i)return Js(wt,{height:"calc(var(--base) * 2 + 2px)"});if(!p)return Js(Mw,{captureMenuScroll:!0,customProps:u,isLoading:g,placeholder:n2(A,e),...t,className:S,classNamePrefix:"rs",components:{ClearIndicator:Vh,Control:Gh,DropdownIndicator:Wh,Input:zh,MultiValue:Xh,MultiValueLabel:Uh,MultiValueRemove:Zh,SingleValue:Jh,ValueContainer:qh,...c},filterOption:f,getOptionValue:m,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:T,menuPlacement:"auto",noOptionsMessage:x,onChange:C,onMenuClose:y,onMenuOpen:I,options:w,styles:R,unstyled:!0,value:D});let E=F=>{if(v===!0){let L=["Tab","Escape","Backspace","Enter","ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],k=!/\D/.test(F.key),N=L.includes(F.key);if(!k&&!N){F.preventDefault();return}}if(!(!D||!n||n.trim()==="")&&!(f&&!f(null,n)))switch(F.key){case"Enter":case"Tab":C([...D,hN(n)]),r(""),F.preventDefault();break;default:break}};return Js(zw,{captureMenuScroll:!0,isLoading:g,placeholder:n2(A,e),...t,className:S,classNamePrefix:"rs",components:{ClearIndicator:Vh,Control:Gh,DropdownIndicator:Wh,Input:zh,MultiValue:Xh,MultiValueLabel:Uh,MultiValueRemove:Zh,SingleValue:Jh,ValueContainer:qh,...c},filterOption:f,inputValue:n,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:T,menuPlacement:"auto",noOptionsMessage:x,onChange:C,onInputChange:F=>r(F),onKeyDown:E,onMenuClose:y,onMenuOpen:I,options:w,styles:R,unstyled:!0,value:D})},gN=t=>{let{getOptionValue:e,onChange:o,value:n}=t,r=[];return n&&(r=(Array.isArray(n)?n:[n]).map(s=>Hh(s,e))),Js(zr,{className:"react-select-container",ids:r,onDragEnd:({moveFromIndex:s,moveToIndex:i})=>{let l=n;n&&Array.isArray(n)&&(l=ju(n,s,i)),o(l)},children:Js(i2,{...t})})},yt=t=>{let{isMulti:e,isSortable:o}=t;return e&&o?Js(gN,{...t}):Js(i2,{...t})};var Bl=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e});var Vl=t=>{let{id:e,onChange:o,options:n,required:r,selectedTimezone:s}=t,{t:i}=$(),l=Bl(n),a=vN(()=>l.find(c=>(typeof c=="string"?c:c.value)===(s||"UTC")),[l,s]);return bN("div",{className:"timezone-picker-wrapper",children:[a2(be,{htmlFor:e,label:`${i("general:timezone")} ${r?"*":""}`,required:r,unstyled:!0}),a2(yt,{className:"timezone-picker",inputId:e,isClearable:!0,isCreatable:!1,onChange:c=>{o&&o(c?.value||"")},options:l,value:a})]})};var u2="date-time-field",CN=t=>{let{field:e,field:{admin:{className:o,date:n,description:r,placeholder:s}={},label:i,localized:l,required:a,timezone:c},path:u,readOnly:d,validate:f}=t,m=n?.pickerAppearance||"default",h=Intl.DateTimeFormat().resolvedOptions().timeZone,{config:p}=W(),{i18n:g}=$(),{dispatchFields:b,setModified:x}=Me(),v=Qh((M,O)=>{if(typeof f=="function")return f(M,{...O,required:a})},[f,a]),{customComponents:{AfterInput:C,BeforeInput:y,Description:I,Error:w,Label:A}={},disabled:_,setValue:D,showError:T,value:S}=Te({path:u,validate:v}),R=u+"_tz",E=Et(([M,O])=>M?.[R]),F=p.admin.timezones.supportedTimezones,L=["dayOnly","default","monthOnly"].includes(m),k=E?.value,N=c2(()=>{if(c&&k&&h&&S){let M=jt.tz(k),O=jt.tz(h),B=new jt(S).withTimeZone(k),G=Rr(B,M);return Rr(G,O).toISOString()}return S},[c,k,S,h]),P=c2(()=>nt(e),[e]),j=Qh(M=>{if(!(d||_))if(c&&k&&M){let O=jt.tz(k);if(L){let B=M.getTimezoneOffset()/60,G=M.getHours()+B;M.setHours(G);let Y=Rr(M,O);D(Y.toISOString()||null)}else{let B=new jt(M),G=Rr(B,O);D(G.toISOString()||null)}}else D(M?.toISOString()||null)},[d,_,c,k,L,D]),V=Qh(M=>{R&&(b({type:"UPDATE",path:R,value:M}),x(!0))},[b,x,R]);return l2("div",{className:[Ce,u2,o,T&&`${u2}--has-error`,(d||_)&&"read-only"].filter(Boolean).join(" "),style:P,children:[es(oe,{CustomComponent:A,Fallback:es(be,{label:i,localized:l,required:a})}),l2("div",{className:`${Ce}__wrap`,id:`field-${u.replace(/\./g,"__")}`,children:[es(oe,{CustomComponent:w,Fallback:es(Xe,{path:u,showError:T})}),y,es(zi,{...n,onChange:j,overrides:{...n?.overrides},placeholder:xN(s,g),readOnly:d||_,value:N}),c&&F.length>0&&es(Vl,{id:`${u}-timezone-picker`,onChange:V,options:F,required:a,selectedTimezone:k}),C]}),es(oe,{CustomComponent:I,Fallback:es(We,{description:r,path:u})})]})},Gl=Oe(CN);import{jsx as qs,jsxs as d2}from"react/jsx-runtime";import{getTranslation as yN}from"@payloadcms/translations";import{useCallback as wN,useMemo as IN}from"react";var SN=t=>{let{field:e,field:{admin:{autoComplete:o,className:n,description:r,placeholder:s}={},label:i,localized:l,required:a}={},path:c,readOnly:u,validate:d}=t,{i18n:f}=$(),m=wN((A,_)=>{if(typeof d=="function")return d(A,{..._,required:a})},[d,a]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:x}={},disabled:v,setValue:C,showError:y,value:I}=Te({path:c,validate:m}),w=IN(()=>nt(e),[e]);return d2("div",{className:[Ce,"email",n,y&&"error",(u||v)&&"read-only"].filter(Boolean).join(" "),style:w,children:[qs(oe,{CustomComponent:x,Fallback:qs(be,{label:i,localized:l,path:c,required:a})}),d2("div",{className:`${Ce}__wrap`,children:[qs(oe,{CustomComponent:b,Fallback:qs(Xe,{path:c,showError:y})}),p,qs("input",{autoComplete:o,disabled:u||v,id:`field-${c.replace(/\./g,"__")}`,name:c,onChange:C,placeholder:yN(s,f),required:a,type:"email",value:I||""}),h]}),qs(oe,{CustomComponent:g,Fallback:qs(We,{description:r,path:c})})]})},Qs=Oe(SN);import{jsx as ts,jsxs as Kd}from"react/jsx-runtime";import{getTranslation as LN}from"@payloadcms/translations";import{useMemo as kN}from"react";import{jsx as RN}from"react/jsx-runtime";import{createContext as _N,use as DN}from"react";var m2=_N(!1),f2=({children:t,withinRow:e=!0})=>RN(m2,{value:e,children:t}),p2=()=>DN(m2);import{jsx as TN}from"react/jsx-runtime";import{createContext as AN,use as FN}from"react";var h2=AN(!1),Kh=({children:t,withinTab:e=!0})=>TN(h2,{value:e,children:t}),g2=()=>FN(h2);import{jsx as EN}from"react/jsx-runtime";import{createContext as PN,use as NN}from"react";var b2=PN(!1),v2=({children:t,withinGroup:e=!0})=>EN(b2,{value:e,children:t}),x2=()=>NN(b2);var Pr="group-field",$N=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,hideGutter:s}={},fields:i,label:l},path:a,permissions:c,readOnly:u,schemaPath:d}=t,f=d??o,{i18n:m}=$(),{isWithinCollapsible:h}=Un(),p=x2(),g=p2(),b=g2(),{customComponents:{AfterInput:x,BeforeInput:v,Description:C,Label:y}={},errorPaths:I}=Te({path:a}),w=zt(),A=I.length,_=w&&A>0,D=!(h||p||g),T=kN(()=>nt(e),[e]);return Kd("div",{className:[Ce,Pr,D&&`${Pr}--top-level`,h&&`${Pr}--within-collapsible`,p&&`${Pr}--within-group`,g&&`${Pr}--within-row`,b&&`${Pr}--within-tab`,!s&&p&&`${Pr}--gutter`,_&&`${Pr}--has-error`,n].filter(Boolean).join(" "),id:`field-${a?.replace(/\./g,"__")}`,style:T,children:[ts(v2,{children:Kd("div",{className:`${Pr}__wrap`,children:[!!(y||C||l||_)&&Kd("div",{className:`${Pr}__header`,children:[!!(y||C||l)&&Kd("header",{children:[ts(oe,{CustomComponent:y,Fallback:ts("h3",{className:`${Pr}__title`,children:ts(be,{as:"span",label:LN(l,m),localized:!1,path:a,required:!1})})}),ts(oe,{CustomComponent:C,Fallback:ts(We,{description:r,path:a})})]}),_&&ts(to,{count:A,i18n:m,withMessage:!0})]}),v,ts(yo,{fields:i,margins:"small",parentIndexPath:"",parentPath:a,parentSchemaPath:f,permissions:c===!0?c:c?.fields,readOnly:u})]})}),x]})};var Wl=Oe($N);import{c as jN}from"react/compiler-runtime";import{jsx as ON}from"react/jsx-runtime";import{useEffect as MN}from"react";var BN=t=>{let e=jN(12),{disableModifyingForm:o,path:n,value:r}=t,s=o===void 0?!0:o,i;e[0]!==n?(i={path:n},e[0]=n,e[1]=i):i=e[1];let{setValue:l,value:a}=Te(i),c,u;e[2]!==s||e[3]!==l||e[4]!==r?(c=()=>{r!==void 0&&l(r,s)},u=[r,l,s],e[2]=s,e[3]=l,e[4]=r,e[5]=c,e[6]=u):(c=e[5],u=e[6]),MN(c,u);let d=`field-${n?.replace(/\./g,"__")}`,f=a||"",m;return e[7]!==n||e[8]!==l||e[9]!==d||e[10]!==f?(m=ON("input",{id:d,name:n,onChange:l,type:"hidden",value:f}),e[7]=n,e[8]=l,e[9]=d,e[10]=f,e[11]=m):m=e[11],m},zl=Oe(BN);var Tg=Is(tg(),1);import{jsx as ti,jsxs as NL}from"react/jsx-runtime";import{flattenTopLevelFields as LL}from"payload/shared";import{useMemo as _3}from"react";import{jsx as qt,jsxs as ei}from"react/jsx-runtime";import{getTranslation as Rg}from"@payloadcms/translations";import{hoistQueryParamsToAnd as PL,transformColumnsToPreferences as S3}from"payload/shared";import{Fragment as R3,useCallback as gm,useEffect as _g,useState as Cn}from"react";import{c as zN}from"react/compiler-runtime";import{useInsertionEffect as HN,useRef as XN}from"react";function Jt(t){let e=zN(4),o=XN(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]),HN(n,r);let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(...i)=>{let l=i,a=o.current;return a(...l)},e[3]=s):s=e[3],s}import{jsx as F2}from"react/jsx-runtime";import{useRouter as qN,useSearchParams as QN}from"next/navigation.js";import{isNumber as KN,transformColumnsToSearchParams as e9}from"payload/shared";import*as ng from"qs-esm";import t9,{useCallback as Xl,useEffect as o9,useMemo as r9,useRef as n9,useState as E2}from"react";import{jsx as UN}from"react/jsx-runtime";import{createContext as YN,use as ZN}from"react";var _2=YN({}),og=({children:t,...e})=>UN(_2,{value:{isInDrawer:!!e.drawerSlug,...e},children:t}),Yr=()=>{let t=ZN(_2);if(!t)throw new Error("useListDrawerContext must be used within a ListDrawerContextProvider");return t};import*as D2 from"qs-esm";function Nr(t){let e=t.toString();return D2.parse(e,{depth:10,ignoreQueryPrefix:!0})}import{createContext as T2,use as JN}from"react";var rg=T2({}),so=()=>JN(rg),A2=T2(!1);var sg=({children:t,collectionSlug:e,columns:o,data:n,defaultLimit:r,defaultSort:s,listPreferences:i,modifySearchParams:l,onQueryChange:a})=>{"use no memo";let c=qN(),u=QN(),{startRouteTransition:d}=it(),[f,m]=E2(!1),h=r9(()=>Nr(u),[u]),p=n9({});p.current.modified=f;let{onQueryChange:g}=Yr(),[b,x]=E2(()=>l?h:{}),v=Xl(async(D,T)=>{m(T!==void 0?T:!0);let S="page"in D?D.page:b?.page;("where"in D||"search"in D)&&(S="1");let R={columns:"columns"in D?D.columns:b.columns,limit:"limit"in D?D.limit:b?.limit??String(r),page:S,preset:"preset"in D?D.preset:b?.preset,search:"search"in D?D.search:b?.search,sort:"sort"in D?D.sort:b?.sort??s,where:"where"in D?D.where:b?.where};l?d(()=>c.replace(`${ng.stringify({...R,columns:JSON.stringify(R.columns)},{addQueryPrefix:!0})}`)):(typeof g=="function"||typeof a=="function")&&(g||a)(R),x(R)},[b?.columns,b?.limit,b?.page,b?.search,b?.sort,b?.where,b?.preset,d,r,s,l,g,a,c]),C=Xl(async D=>{await v({page:String(D)})},[v]),y=t9.useCallback(async D=>{await v({limit:String(D),page:"1"})},[v]),I=Xl(async D=>{await v({search:D===""?void 0:D})},[v]),w=Xl(async D=>{await v({sort:D})},[v]),A=Xl(async D=>{await v({where:D})},[v]),_=Jt(()=>{let D=!1,T={...b||{}};KN(r)&&!("limit"in b)&&(T.limit=String(r),D=!0),s&&!("sort"in b)&&(T.sort=s,D=!0),o&&i?.columns&&!("columns"in b)&&(T.columns=e9(o),D=!0),D&&(x(T),window.history.replaceState(null,"",`?${ng.stringify({...T,columns:JSON.stringify(T.columns)})}`))});return o9(()=>{l&&_()},[s,r,l,o]),F2(rg,{value:{collectionSlug:e,data:n,handlePageChange:C,handlePerPageChange:y,handleSearchChange:I,handleSortChange:w,handleWhereChange:A,query:b,refineListData:v,setModified:m,...p.current},children:F2(A2,{value:f,children:t})})};import{jsx as s9}from"react/jsx-runtime";import i9,{createContext as a9,useCallback as sa}from"react";var P2=a9(void 0),Dt=()=>{let t=i9.use(P2);if(t===void 0)throw new Error("useServerFunctions must be used within a ServerFunctionsProvider");return t},ig=({children:t,serverFunction:e})=>{if(!e)throw new Error("ServerFunctionsProvider requires a serverFunction prop");let o=sa(async a=>await e({name:"render-document-slots",args:a}),[e]),n=sa(async a=>{let{signal:c,...u}=a;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=sa(async a=>{let{signal:c,...u}=a||{};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=sa(async a=>{let{signal:c,...u}=a||{};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=sa(async a=>{let{signal:c,...u}=a||{};try{return await e({name:"render-document",args:{fallbackLocale:!1,...u}})}catch(d){console.error(d)}},[e]),l=sa(async a=>{let{signal:c,...u}=a||{};try{let d=await e({name:"copy-data-from-locale",args:u});if(!c?.aborted)return d}catch(d){console.error(d)}},[e]);return s9(P2,{value:{copyDataFromLocale:l,getDocumentSlots:o,getFormState:r,getTableState:s,renderDocument:i,schedulePublish:n,serverFunction:e},children:t})};import{jsx as u9}from"react/jsx-runtime";import{transformColumnsToSearchParams as N2}from"payload/shared";import L2,{startTransition as k2,useCallback as lg,useRef as d9}from"react";import{createContext as l9,use as c9}from"react";var ag=l9({}),ia=()=>c9(ag);var Ul=({children:t,collectionSlug:e,columnState:o,LinkedCellOverride:n})=>{let{getEntityConfig:r}=W(),{query:s,refineListData:i}=so(),{admin:{defaultColumns:l}={}}=r({collectionSlug:e}),[a,c]=L2.useOptimistic(o,(p,g)=>g),u=d9({}),d=lg(async p=>{let g=(a||[]).map(b=>b.accessor===p?{...b,active:!b.active}:b);k2(()=>{c(g)}),await i({columns:N2(g)})},[i,a,c]),f=lg(async p=>{let{fromIndex:g,toIndex:b}=p,x=[...a||[]],[v]=x.splice(g,1);x.splice(b,0,v),k2(()=>{c(x)}),await i({columns:N2(x)})},[a,i,c]),m=lg(async p=>{let g=s.columns;p.forEach(b=>{let x=g.findIndex(v=>b===v);x!==void 0&&g[x][0]==="-"&&(g[x]=b.slice(1))}),await i({columns:g})},[s,i]),h=L2.useCallback(async()=>{await m(l)},[l,m]);return u9(ag,{value:{columns:a,LinkedCellOverride:n,moveColumn:f,resetColumnsState:h,setActiveColumns:m,toggleColumn:d,...u.current},children:t})};import{jsx as Yl}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as m9,fieldIsID as f9}from"payload/shared";import{useId as p9,useMemo as h9}from"react";var cg="column-selector",tm=({collectionSlug:t})=>{let{columns:e,moveColumn:o,toggleColumn:n}=ia(),r=p9(),s=ut(),i=h9(()=>e.filter(l=>!(m9(l.field)&&!f9(l.field))&&!l?.field?.admin?.disableListColumn),[e]);return e?Yl(zr,{className:cg,ids:i.map(l=>l?.accessor),onDragEnd:({moveFromIndex:l,moveToIndex:a})=>{o({fromIndex:l,toIndex:a})},children:i.map((l,a)=>{let{accessor:c,active:u,field:d}=l;return Yl(bt,{alignIcon:"left","aria-checked":u,className:[`${cg}__column`,u&&`${cg}__column--active`].filter(Boolean).join(" "),draggable:!0,icon:u?Yl(pt,{}):Yl(jo,{}),id:c,onClick:()=>{n(c)},children:l.CustomLabel??Yl(be,{label:d&&"label"in d&&d.label,unstyled:!0})},`${t}-${d&&"name"in d?d?.name:a}${s?`-${s}-`:""}${r}`)})}):null};import{c as Y2}from"react/compiler-runtime";import{jsx as nm}from"react/jsx-runtime";import{createElement as E9}from"react";import{useEffect as P9,useId as N9,useState as L9}from"react";import{c as g9}from"react/compiler-runtime";import{useState as b9}from"react";var om=t=>{let e=g9(3),{getEntityConfig:o}=W(),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]=b9(n);return r};import{jsx as H2}from"react/jsx-runtime";import A9,{useCallback as Jl,useEffect as X2,useRef as F9,useState as fg}from"react";import{c as mg}from"react/compiler-runtime";import{jsx as Ks,jsxs as V2}from"react/jsx-runtime";import{getTranslation as I9}from"@payloadcms/translations";import S9 from"react";import{c as x9}from"react/compiler-runtime";import{jsx as C9,jsxs as y9}from"react/jsx-runtime";import O2,{createContext as w9}from"react";import{c as v9}from"react/compiler-runtime";import*as os from"react";var ug=t=>{let e=v9(13),{delayBeforeShow:o,inTimeout:n,minShowTime:r,outTimeout:s,show:i}=t,l=n+r+s,[a,c]=Nf(o),[u,d]=os.useState(!1),[f,m]=os.useState(!1),h=os.useRef(0),p=os.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,x,v;e[2]!==a||e[3]!==u||e[4]!==i||e[5]!==l||e[6]!==b?(x=()=>{let y=a&&!u&&i,I=u&&!i;if(y)h.current=Date.now(),d(!0);else if(I){let w=Date.now()-h.current,A=l-w;clearTimeout(p.current),p.current=setTimeout(b,Math.max(0,A))}},v=[u,i,b,l,a],e[2]=a,e[3]=u,e[4]=i,e[5]=l,e[6]=b,e[7]=x,e[8]=v):(x=e[7],v=e[8]),os.useEffect(x,v);let C;return e[9]!==u||e[10]!==f||e[11]!==c?(C={isMounted:u,isUnmounting:f,triggerDelayedRender:c},e[9]=u,e[10]=f,e[11]=c,e[12]=C):C=e[12],C};var $2={isLoading:!1,loaders:[],loadingText:"",overlayType:null},j2=(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 l=o.findIndex(a=>a.key===r&&a.type===n);o.splice(l,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 dg=250,M2=w9({isOnScreen:!1,toggleLoadingOverlay:void 0}),B2=t=>{let e=x9(21),{children:o}=t,{t:n}=$(),r;e[0]!==n?(r=n("general:loading"),e[0]=n,e[1]=r):r=e[1];let s=r,[i,l]=O2.useReducer(j2,$2),a;e[2]!==i.isLoading?(a={delayBeforeShow:1e3,inTimeout:dg,minShowTime:500,outTimeout:dg,show:i.isLoading},e[2]=i.isLoading,e[3]=a):a=e[3];let{isMounted:c,isUnmounting:u,triggerDelayedRender:d}=ug(a),f;e[4]!==s||e[5]!==d?(f=p=>{let{type:g,isLoading:b,key:x,loadingText:v}=p,C=v===void 0?s:v;b?(d(),l({type:"add",payload:{type:g,key:x,loadingText:C}})):l({type:"remove",payload:{type:g,key:x}})},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&&C9(xn,{animationDuration:`${dg}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=y9(M2,{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},rm=()=>{let t=O2.use(M2);if(t===void 0)throw new Error("useLoadingOverlay must be used within a LoadingOverlayProvider");return t};var Lr="loading-overlay",xn=t=>{let e=mg(11),{animationDuration:o,loadingText:n,overlayType:r,show:s}=t,i=s===void 0?!0:s,{t:l}=$(),a=i?`${Lr}--entering`:`${Lr}--exiting`,c=r?`${Lr}--${r}`:"",u;e[0]!==a||e[1]!==c?(u=[Lr,a,c].filter(Boolean),e[0]=a,e[1]=c,e[2]=u):u=e[2];let d=u.join(" "),f=o||"500ms",m;if(e[3]!==n||e[4]!==l||e[5]!==d||e[6]!==f){let h;e[8]!==n||e[9]!==l?(h=n||l("general:loading"),e[8]=n,e[9]=l,e[10]=h):h=e[10],m=V2("div",{className:d,style:{animationDuration:f},children:[V2("div",{className:`${Lr}__bars`,children:[Ks("div",{className:`${Lr}__bar`}),Ks("div",{className:`${Lr}__bar`}),Ks("div",{className:`${Lr}__bar`}),Ks("div",{className:`${Lr}__bar`}),Ks("div",{className:`${Lr}__bar`})]}),Ks("span",{className:`${Lr}__text`,children:h})]}),e[3]=n,e[4]=l,e[5]=d,e[6]=f,e[7]=m}else m=e[7];return m},G2=t=>{let e=mg(7),{name:o,type:n,loadingText:r,show:s}=t,i=n===void 0?"fullscreen":n,{toggleLoadingOverlay:l}=rm(),a,c;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==l||e[4]!==i?(a=()=>(l({type:i,isLoading:s,key:o,loadingText:r||void 0}),()=>{l({type:i,isLoading:!1,key:o})}),c=[s,l,o,i,r],e[0]=o,e[1]=r,e[2]=s,e[3]=l,e[4]=i,e[5]=a,e[6]=c):(a=e[5],c=e[6]),S9.useEffect(a,c),null},R9=t=>{let e=mg(6),{name:o,type:n,action:r,formIsLoading:s,loadingSuffix:i}=t,l=n===void 0?"fullscreen":n,a=s===void 0?!1:s,c=$o(),{i18n:u,t:d}=$(),m=`${{create:d("general:creating"),loading:d("general:loading"),update:d("general:updating")}[r]} ${i?I9(i,u):""}`,h;return e[0]!==a||e[1]!==c||e[2]!==o||e[3]!==m||e[4]!==l?(h=Ks(G2,{loadingText:m.trim(),name:o,show:a||c,type:l}),e[0]=a,e[1]=c,e[2]=o,e[3]=m,e[4]=l,e[5]=h):h=e[5],h};function Ko(t){if(t)try{t.abort()}catch{}}function er(t){let e=new AbortController;if(t.current)try{t.current.abort()}catch{}return t.current=e,e}import{jsx as _9}from"react/jsx-runtime";import{createContext as D9,use as T9}from"react";var W2=D9({}),z2=({children:t,...e})=>_9(W2,{value:e,children:t}),Zl=()=>{let t=T9(W2);if(!t)throw new Error("useDocumentDrawerContext must be used within a DocumentDrawerProvider");return t};var U2=({id:t,AfterFields:e,collectionSlug:o,disableActions:n,drawerSlug:r,Header:s,initialData:i,onDelete:l,onDuplicate:a,onSave:c,overrideEntityVisibility:u=!0,redirectAfterCreate:d,redirectAfterDelete:f,redirectAfterDuplicate:m})=>{let{getEntityConfig:h}=W(),p=Ee(),[g]=fg(()=>h({collectionSlug:o})),b=A9.useRef(null),{closeModal:x}=de(),{t:v}=$(),{renderDocument:C}=Dt(),[y,I]=fg(void 0),[w,A]=fg(!0),_=F9(!1),D=Jl(F=>{let L=er(b);(async()=>{A(!0);try{let N=await C({collectionSlug:o,disableActions:n,docID:F,drawerSlug:r,initialData:i,locale:p,overrideEntityVisibility:u,redirectAfterCreate:d,redirectAfterDelete:f!==void 0?f:!1,redirectAfterDuplicate:m!==void 0?m:!1,signal:L.signal});N?.Document&&(I(N.Document),A(!1))}catch(N){fe.error(N?.message||v("error:unspecific")),x(r)}b.current=null})()},[o,n,r,i,f,m,C,x,u,v,p]),T=Jl(F=>{D(F.doc.id),typeof c=="function"&&c({...F,collectionConfig:g})},[c,g,D]),S=Jl(F=>{D(F.doc.id),typeof a=="function"&&a({...F,collectionConfig:g})},[a,g,D]),R=Jl(F=>{typeof l=="function"&&l({...F,collectionConfig:g}),x(r)},[l,x,r,g]),E=Jl(()=>{D()},[D]);return X2(()=>{!y&&!_.current&&(D(t),_.current=!0)},[y,D,t]),X2(()=>{let F=b.current;return()=>{Ko(F)}},[]),w?H2(xn,{}):H2(z2,{clearDoc:E,drawerSlug:r,onDelete:R,onDuplicate:S,onSave:T,children:y})};var rs="doc-drawer",k9=({id:t,collectionSlug:e,depth:o,uuid:n})=>`doc-drawer_${e}_${o}${t?`_${t}`:""}_${n}`,$9=t=>{let e=Y2(21),o,n,r,s,i,l,a,c;e[0]!==t?({id:l,children:o,className:n,collectionSlug:r,disabled:s,drawerSlug:i,onClick:a,...c}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=l,e[7]=a,e[8]=c):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],l=e[6],a=e[7],c=e[8]);let{t:u}=$(),[d]=om(r),f=l?"general:editLabel":"fields:addNewLabel",m=d?.labels.singular,h;if(e[9]!==o||e[10]!==n||e[11]!==s||e[12]!==i||e[13]!==a||e[14]!==c||e[15]!==u||e[16]!==f||e[17]!==m){let p=u(f,{label:m}),g;e[19]!==n?(g=[n,`${rs}__toggler`].filter(Boolean),e[19]=n,e[20]=g):g=e[20],h=nm(ar,{"aria-label":p,className:g.join(" "),disabled:s,onClick:a,slug:i,...c,children:o}),e[9]=o,e[10]=n,e[11]=s,e[12]=i,e[13]=a,e[14]=c,e[15]=u,e[16]=f,e[17]=m,e[18]=h}else h=e[18];return h},j9=t=>{let{drawerSlug:e}=t;return nm(Pt,{className:rs,gutter:!1,Header:null,slug:e,children:nm(U2,{...t})})},Yt=t=>{let e=Y2(38),{id:o,collectionSlug:n,overrideEntityVisibility:r}=t,s=ut(),i=N9(),{closeModal:l,modalState:a,openModal:c,toggleModal:u}=de(),[d,f]=L9(!1),m;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==i?(m=k9({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]!==a?(p=()=>{f(!!a[h]?.isOpen)},g=[a,h],e[5]=h,e[6]=a,e[7]=p,e[8]=g):(p=e[7],g=e[8]),P9(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 x=b,v;e[12]!==l||e[13]!==h?(v=()=>{l(h)},e[12]=l,e[13]=h,e[14]=v):v=e[14];let C=v,y;e[15]!==h||e[16]!==c?(y=()=>{c(h)},e[15]=h,e[16]=c,e[17]=y):y=e[17];let I=y,w,A;e[18]!==n||e[19]!==h||e[20]!==o||e[21]!==r?(A=k=>E9(j9,{...k,collectionSlug:n,drawerSlug:h,id:o,key:h,overrideEntityVisibility:r}),e[18]=n,e[19]=h,e[20]=o,e[21]=r,e[22]=A):A=e[22],w=A;let _=w,D,T;e[23]!==n||e[24]!==h||e[25]!==o?(T=k=>nm($9,{...k,collectionSlug:n,drawerSlug:h,id:o}),e[23]=n,e[24]=h,e[25]=o,e[26]=T):T=e[26],D=T;let S=D,R,E;e[27]!==C||e[28]!==h||e[29]!==s||e[30]!==d||e[31]!==I||e[32]!==x?(E={closeDrawer:C,drawerDepth:s,drawerSlug:h,isDrawerOpen:d,openDrawer:I,toggleDrawer:x},e[27]=C,e[28]=h,e[29]=s,e[30]=d,e[31]=I,e[32]=x,e[33]=E):E=e[33],R=E;let F=R,L;return e[34]!==_||e[35]!==F||e[36]!==S?(L=[_,S,F],e[34]=_,e[35]=F,e[36]=S,e[37]=L):L=e[37],L};import{c as O9}from"react/compiler-runtime";import{jsx as M9}from"react/jsx-runtime";import{createContext as B9,use as V9,useEffect as G9,useReducer as W9,useRef as z9}from"react";function Z2(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 J2=B9({}),ql=t=>{let e=O9(15),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=W9(Z2,n),i=Yo(r,100),{config:l}=W(),{routes:a,serverURL:c}=l,{api:u}=a,{i18n:d}=$(),{code:f}=Ee(),m=z9(f),h;e[1]!==u||e[2]!==i||e[3]!==d||e[4]!==f||e[5]!==c?(h=y=>{let I=y===void 0?!1:y;Object.entries(i).forEach(async w=>{let[A,_]=w,D=[];if(Object.entries(_).forEach(T=>{let[S,R]=T;(R===null||I)&&D.push(S)}),D.length>0){let T=`${c}${u}/${A}`,S=new URLSearchParams;if(S.append("depth","0"),S.append("limit","250"),f&&S.append("locale",f),D&&D.length>0){let F=D.map(H9);S.append("where[id][in]",F.join(","))}let R=`?${S.toString()}`,E=await fetch(`${T}${R}`,{credentials:"include",headers:{"Accept-Language":d.language}});if(E.ok){let F=await E.json();F.docs&&s({type:"ADD_LOADED",docs:F.docs,idsToLoad:D,relationTo:A})}else s({type:"ADD_LOADED",docs:[],idsToLoad:D,relationTo:A})}})},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]),G9(g,b);let x;e[11]===Symbol.for("react.memo_cache_sentinel")?(x=y=>{s({type:"REQUEST",docs:y})},e[11]=x):x=e[11];let v=x,C;return e[12]!==o||e[13]!==r?(C=M9(J2,{value:{documents:r,getRelationships:v},children:o}),e[12]=o,e[13]=r,e[14]=C):C=e[14],C},pg=()=>V9(J2);function H9(t){return String(t)}import{c as SL}from"react/compiler-runtime";import{jsx as pm,jsxs as RL}from"react/jsx-runtime";import"react";import{c as yL}from"react/compiler-runtime";import{jsx as g3}from"react/jsx-runtime";import b3 from"react";import{c as hL}from"react/compiler-runtime";import{jsx as Ql,jsxs as gL}from"react/jsx-runtime";import{getTranslation as bL}from"@payloadcms/translations";import{fieldAffectsData as vL,fieldIsID as xL}from"payload/shared";import CL from"react";import{formatAdminURL as q2}from"payload/shared";import{getTranslation as X9}from"@payloadcms/translations";import U9 from"react";var Q2=(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?U9.isValidElement(n.label)?n.label:X9(n.label,o)||n.value:n}return t};import{jsx as K2}from"react/jsx-runtime";import"react";var sm=({cellData:t,nowrap:e})=>{let o=t?.length>100?`${t.substring(0,100)}\u2026`:t;return K2("code",{className:"code-cell",style:e?{whiteSpace:"nowrap"}:{},children:K2("span",{children:o})})};import{c as Y9}from"react/compiler-runtime";import{jsx as Z9}from"react/jsx-runtime";import{getTranslation as e3}from"@payloadcms/translations";import"react";var t3=t=>{let e=Y9(2),{cellData:o,field:n}=t,{labels:r}=n,{i18n:s}=$(),i=o??[],l=i.length===1?`${i.length} ${e3(r?.singular||s.t("general:rows"),s)}`:`${i.length} ${e3(r?.plural||s.t("general:rows"),s)}`,a;return e[0]!==l?(a=Z9("span",{children:l}),e[0]=l,e[1]=a):a=e[1],a};import{c as J9}from"react/compiler-runtime";import{jsx as q9}from"react/jsx-runtime";import{getTranslation as im}from"@payloadcms/translations";import"react";var o3=t=>{let e=J9(2),{cellData:o,field:n}=t,{blockReferences:r,blocks:s,labels:i}=n,{i18n:l}=$(),{config:a}=W(),c=Array.isArray(o)?o.map(Q9):[],u=(r??s)?.map(h=>{let p=typeof h=="string"?a.blocksMap[h]:h;return{slug:p.slug,label:im(p.labels.singular,l)}}),d=`0 ${im(i?.plural,l)}`,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} ${im(i?.plural,l)} - ${l.t("fields:itemsAndMore",{count:h,items:f(c.slice(0,5))})}`}else c.length>0&&(d=`${c.length} ${im(c.length===1?i?.singular:i?.plural,l)} - ${f(c)}`);let m;return e[0]!==d?(m=q9("span",{children:d}),e[0]=d,e[1]=m):m=e[1],m};function Q9(t){let{blockType:e}=t;return e}import{c as K9}from"react/compiler-runtime";import{jsx as r3}from"react/jsx-runtime";import"react";var n3=t=>{let e=K9(3),{cellData:o}=t,{t:n}=$(),r=`general:${o}`,s;return e[0]!==n||e[1]!==r?(s=r3("code",{className:"bool-cell",children:r3("span",{children:n(r).toLowerCase()})}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};import{c as eL}from"react/compiler-runtime";import{jsx as tL}from"react/jsx-runtime";import"react";var s3=t=>{let e=eL(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:l}=W(),{admin:a}=l,{dateFormat:c}=a,u=i?.displayFormat||c,{i18n:d}=$(),f;e[2]!==o||e[3]!==u||e[4]!==d?(f=o&&pn({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=tL("span",{children:f}),e[6]=f,e[7]=m):m=e[7],m};import{jsx as gg,jsxs as rL,Fragment as nL}from"react/jsx-runtime";import"react";import{c as i3}from"react/compiler-runtime";import{jsx as aa,jsxs as a3}from"react/jsx-runtime";import lm from"react";import{jsx as hg,jsxs as oL}from"react/jsx-runtime";import"react";var am=()=>oL("svg",{height:"150",viewBox:"0 0 150 150",width:"150",xmlns:"http://www.w3.org/2000/svg",children:[hg("rect",{fill:"#333333",height:"150",transform:"translate(0 0.5)",width:"150"}),hg("path",{d:"M82.8876 50.5H55.5555V100.5H94.4444V61.9818H82.8876V50.5Z",fill:"white"}),hg("path",{d:"M82.8876 61.9818H94.4444L82.8876 50.5V61.9818Z",fill:"#9A9A9A"})]});var cm="thumbnail",kr=t=>{let e=i3(18),{className:o,doc:n,fileSrc:r,imageCacheTag:s,size:i}=t,l=o===void 0?"":o,a;e[0]!==n?(a=n===void 0?{}:n,e[0]=n,e[1]=a):a=e[1];let{filename:c,mimeType:u}=a,[d,f]=lm.useState(void 0),m=`${cm}--size-${i||"medium"}`,h;e[2]!==l||e[3]!==m?(h=[cm,m,l],e[2]=l,e[3]=m,e[4]=h):h=e[4];let p=h.join(" "),g,b;e[5]!==r||e[6]!==u?(g=()=>{if(!r||typeof u=="string"&&!u.startsWith("image")){f(!1);return}f(void 0);let C=new Image;C.src=r,C.onload=()=>{f(!0)},C.onerror=()=>{f(!1)}},b=[r,u],e[5]=r,e[6]=u,e[7]=g,e[8]=b):(g=e[7],b=e[8]),lm.useEffect(g,b);let x=null;if(r){let C=r?.includes("?")?"&":"?";x=s?`${r}${C}${encodeURIComponent(s)}`:r}let v;if(e[9]!==p||e[10]!==d||e[11]!==c||e[12]!==x){let C;e[14]!==d||e[15]!==c||e[16]!==x?(C=d&&aa("img",{alt:c,src:x}),e[14]=d,e[15]=c,e[16]=x,e[17]=C):C=e[17],v=a3("div",{className:p,children:[d===void 0&&aa(wt,{height:"100%"}),C,d===!1&&aa(am,{})]}),e[9]=p,e[10]=d,e[11]=c,e[12]=x,e[13]=v}else v=e[13];return v};function l3(t){let e=i3(17),{alt:o,className:n,filename:r,fileSrc:s,imageCacheTag:i,size:l}=t,a=n===void 0?"":n,[c,u]=lm.useState(void 0),d=`${cm}--size-${l||"medium"}`,f;e[0]!==a||e[1]!==d?(f=[cm,d,a],e[0]=a,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 x=new Image;x.src=s,x.onload=()=>{u(!0)},x.onerror=()=>{u(!1)}},p=[s],e[3]=s,e[4]=h,e[5]=p):(h=e[4],p=e[5]),lm.useEffect(h,p);let g="";if(s){let x=s?.includes("?")?"&":"?";g=i?`${s}${x}${encodeURIComponent(i)}`:s}let b;if(e[6]!==o||e[7]!==m||e[8]!==c||e[9]!==r||e[10]!==g){let x;e[12]!==o||e[13]!==c||e[14]!==r||e[15]!==g?(x=c&&aa("img",{alt:o||r,src:g}),e[12]=o,e[13]=c,e[14]=r,e[15]=g,e[16]=x):x=e[16],b=a3("div",{className:m,children:[c===void 0&&aa(wt,{height:"100%"}),x,c===!1&&aa(am,{})]}),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 bg="file",um=40,vg=180,dm=({cellData:t,collectionConfig:e,field:o,rowData:n})=>{if(("displayPreview"in o?o.displayPreview:void 0)??e.upload?.displayPreview??!0){let i=n?.thumbnailURL??n?.url;return n?.url&&!n?.thumbnailURL&&typeof n?.mimeType=="string"&&n?.mimeType.startsWith("image")&&n?.sizes&&(i=Object.values(n.sizes).reduce((c,u)=>!u.width||u.width<um?c:u.width>=um&&u.width<=vg?!c.width||u.width<c.width||c.width<um||c.width>vg?u:c:!c.width||!c.original&&c.width<um&&u.width>c.width||c.width>vg&&u.width<c.width?u:c,{original:!0,url:n?.url,width:n?.width}).url||i),rL("div",{className:bg,children:[gg(kr,{className:`${bg}__thumbnail`,collectionSlug:e?.slug,doc:{...n,filename:t},fileSrc:i,size:"small",uploadConfig:e?.upload}),gg("span",{className:`${bg}__filename`,children:String(t)})]})}else return gg(nL,{children:String(t)})};import{jsx as c3}from"react/jsx-runtime";import"react";var u3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return c3("code",{className:"json-cell",children:c3("span",{children:JSON.stringify(e)})})};import{c as sL}from"react/compiler-runtime";import{jsx as iL,jsxs as m3}from"react/jsx-runtime";import{getTranslation as aL}from"@payloadcms/translations";import lL,{useEffect as f3,useState as p3}from"react";var d3=!!(typeof window<"u"&&window.document&&window.document.createElement);var cL="relationship-cell",mm=3,fm=t=>{let e=sL(40),{cellData:o,customCellProps:n,field:r,field:s}=t,{label:i}=s,l="relationTo"in r&&r.relationTo||"collection"in r&&r.collection,a;a="collection"in r?o?.docs:o;let c=a,{config:u,getEntityConfig:d}=W(),{collections:f,routes:m}=u,[h,p]=an(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];let[b,x]=p3(g),{documents:v,getRelationships:C}=pg(),[y,I]=p3(!1),{i18n:w,t:A}=$(),_=d3?p?.boundingClientRect?.top<window.innerHeight:!1,D;e[1]!==c||e[2]!==C||e[3]!==y||e[4]!==_||e[5]!==l?(D=()=>{if((c||typeof c=="number")&&_&&!y){let F=[],L=Array.isArray(c)?c:[c];L.slice(0,L.length<mm?L.length:mm).forEach(k=>{typeof k=="object"&&"relationTo"in k&&"value"in k&&F.push(k),(typeof k=="number"||typeof k=="string")&&typeof l=="string"&&F.push({relationTo:l,value:k})}),C(F),I(!0),x(F)}},e[1]=c,e[2]=C,e[3]=y,e[4]=_,e[5]=l,e[6]=D):D=e[6];let T;e[7]!==c||e[8]!==f||e[9]!==C||e[10]!==y||e[11]!==_||e[12]!==l||e[13]!==m.api?(T=[c,l,f,_,m.api,y,C],e[7]=c,e[8]=f,e[9]=C,e[10]=y,e[11]=_,e[12]=l,e[13]=m.api,e[14]=T):T=e[14],f3(D,T);let S;e[15]!==y?(S=()=>{y&&I(!1)},e[15]=y,e[16]=S):S=e[16];let R;e[17]!==c?(R=[c],e[17]=c,e[18]=R):R=e[18],f3(S,R);let E;if(e[19]!==c||e[20]!==u.admin.dateFormat||e[21]!==n||e[22]!==v||e[23]!==r||e[24]!==d||e[25]!==w||e[26]!==h||e[27]!==i||e[28]!==A||e[29]!==b){let F;e[31]!==u.admin.dateFormat||e[32]!==n||e[33]!==v||e[34]!==r||e[35]!==d||e[36]!==w||e[37]!==A||e[38]!==b.length?(F=(L,k)=>{let{relationTo:N,value:P}=L,j=v[N][P],V=d({collectionSlug:N}),M=lr({collectionConfig:V,data:j||null,dateFormat:u.admin.dateFormat,fallback:`${A("general:untitled")} - ID: ${P}`,i18n:w}),O=null;return r.type==="upload"&&(("displayPreview"in r?r.displayPreview:void 0)??V.upload?.displayPreview??!0)&&j&&(O=iL(dm,{cellData:M,collectionConfig:V,collectionSlug:V.slug,customCellProps:n,field:r,rowData:j})),m3(lL.Fragment,{children:[j===!1&&`${A("general:untitled")} - ID: ${P}`,j===null&&`${A("general:loading")}...`,j?O||M:null,b.length>k+1&&", "]},k)},e[31]=u.admin.dateFormat,e[32]=n,e[33]=v,e[34]=r,e[35]=d,e[36]=w,e[37]=A,e[38]=b.length,e[39]=F):F=e[39],E=m3("div",{className:cL,ref:h,children:[b.map(F),Array.isArray(c)&&c.length>mm&&A("fields:itemsAndMore",{count:c.length-mm,items:""}),b.length===0&&A("general:noLabel",{label:aL(i||"",w)})]}),e[19]=c,e[20]=u.admin.dateFormat,e[21]=n,e[22]=v,e[23]=r,e[24]=d,e[25]=w,e[26]=h,e[27]=i,e[28]=A,e[29]=b,e[30]=E}else E=e[30];return E};import{c as uL}from"react/compiler-runtime";import{jsx as dL}from"react/jsx-runtime";import{getTranslation as mL}from"@payloadcms/translations";import{optionsAreObjects as fL}from"payload/shared";import"react";var xg=t=>{let e=uL(10),{cellData:o,field:n}=t,{options:r}=n,{i18n:s}=$(),i;e[0]!==s||e[1]!==r?(i=u=>u.map(d=>{let f=r.filter(m=>m.value===d)?.[0]?.label;return mL(f,s)}).join(", "),e[0]=s,e[1]=r,e[2]=i):i=e[2];let l=i,a;if(fL(r)){let u;e[3]!==o||e[4]!==l?(u=Array.isArray(o)?l(o):l([o]),e[3]=o,e[4]=l,e[5]=u):u=e[5],a=u}else{let u;e[6]!==o?(u=Array.isArray(o)?o.join(", "):o,e[6]=o,e[7]=u):u=e[7],a=u}let c;return e[8]!==a?(c=dL("span",{children:a}),e[8]=a,e[9]=c):c=e[9],c};import{jsx as pL}from"react/jsx-runtime";import"react";var h3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return pL("span",{children:e})};var Cg={array:t3,blocks:o3,checkbox:n3,code:sm,date:s3,File:dm,join:fm,json:u3,radio:xg,relationship:fm,select:xg,textarea:h3,upload:fm};var Kl=t=>{let e=hL(14),{cellData:o,className:n,collectionSlug:r,field:s,field:i,link:l,onClick:a,rowData:c}=t,{admin:u}=i,{i18n:d}=$(),{config:f,getEntityConfig:m}=W(),{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]!==l||e[9]!==a||e[10]!==t||e[11]!==c){b=Symbol.for("react.early_return_sentinel");e:{let x=m({collectionSlug:r}),v=u&&"className"in u?u.className:void 0,C=n||(s.admin&&"className"in s.admin?s.admin.className:null)||v,y=a,I="span",w={className:C};if(l&&(w.prefetch=!1,I=Kt,w.href=x?.slug?q2({adminRoute:p,path:`/collections/${x?.slug}/${encodeURIComponent(c.id)}`}):""),typeof y=="function"&&(I="button",w.type="button",w.onClick=()=>{y({cellData:o,collectionSlug:x?.slug,rowData:c})}),xL(s)){b=Ql(I,{...w,children:Ql(sm,{cellData:`ID: ${o}`,collectionConfig:x,collectionSlug:r,field:{...s,type:"code"},nowrap:!0,rowData:c})});break e}let A=Q2(o,s,d),_=typeof o<"u"&&Cg[s.type],D=null;if(CL.isValidElement(A))D=A;else if(_)D=Ql(_,{cellData:o,rowData:c,...t});else if(!_)if(x?.upload&&vL(s)&&s.name==="filename"&&s.type==="text"){let T=Cg.File;D=Ql(T,{cellData:o,rowData:c,...t,collectionConfig:x,field:s})}else{b=gL(I,{...w,children:[(A===""||typeof A>"u"||A===null)&&d.t("general:noLabel",{label:bL(("label"in s?s.label:null)||"data",d)}),typeof A=="string"&&A,typeof A=="number"&&A,typeof A=="object"&&A!==null&&JSON.stringify(A)]});break e}g=Ql(I,{...w,children:D})}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]=l,e[9]=a,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};var wL="default-cell",v3=b3.createContext(null),yg=()=>b3.use(v3),IL=t=>{let e=yL(9),{clientProps:o,columnIndex:n,isLinkedColumn:r}=t,{drawerSlug:s,onSelect:i}=Yr(),{LinkedCellOverride:l}=ia(),a;if(e[0]!==l||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=`${wL}__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}a=g3(v3,{value:c,children:r&&l?l:g3(Kl,{...c})}),e[0]=l,e[1]=o,e[2]=n,e[3]=s,e[4]=r,e[5]=i,e[6]=a}else a=e[6];return a};var x3=t=>{let e=SL(15),{onDrawerDelete:o,onDrawerSave:n}=t,r=yg(),s=r?.rowData.id,i=r?.collectionSlug,l;e[0]!==s||e[1]!==i?(l={id:s,collectionSlug:i},e[0]=s,e[1]=i,e[2]=l):l=e[2];let[a,c,u]=Yt(l),{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]!==a||e[10]!==c||e[11]!==r||e[12]!==p||e[13]!==m?(g=RL("div",{className:"drawer-link",children:[pm(Kl,{...r,className:"drawer-link__cell",link:!1,onClick:null}),pm(c,{children:pm(wr,{})}),pm(a,{onDelete:p,onSave:m})]}),e[9]=a,e[10]=c,e[11]=r,e[12]=p,e[13]=m,e[14]=g):g=e[14],g};import{c as FL}from"react/compiler-runtime";import{jsx as EL}from"react/jsx-runtime";import"react";import{jsx as Sg}from"react/jsx-runtime";import"react";import{jsx as C3}from"react/jsx-runtime";import"react";var wg="clickable-arrow",y3=t=>{let{direction:e="right",isDisabled:o=!1,updatePage:n}=t,r=[wg,o&&`${wg}--is-disabled`,e&&`${wg}--${e}`].filter(Boolean).join(" ");return C3("button",{className:r,disabled:o,onClick:o?void 0:n,type:"button",children:C3(Je,{})})};import{jsx as _L}from"react/jsx-runtime";import"react";var hm="paginator__page",Ig=({isCurrent:t,isFirstPage:e=!1,isLastPage:o=!1,page:n=1,updatePage:r})=>{let s=[hm,t&&`${hm}--is-current`,e&&`${hm}--is-first-page`,o&&`${hm}--is-last-page`].filter(Boolean).join(" ");return _L("button",{className:s,onClick:()=>r(n),type:"button",children:n})};import{jsx as DL}from"react/jsx-runtime";import"react";var w3=()=>DL("span",{className:"paginator__separator",children:"\u2014"});var TL={ClickableArrow:y3,Page:Ig,Separator:w3},AL="paginator",ec=t=>{let{hasNextPage:e=!1,hasPrevPage:o=!1,nextPage:n=null,numberOfNeighbors:r=1,onChange:s,page:i,prevPage:l=null,totalPages:a=null}=t;if(!e&&!o)return null;let c=h=>{typeof s=="function"&&s(h)},u=Array.from({length:a},(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<a&&m.push({type:"Separator"}),f<a&&m.push({type:"Page",props:{isLastPage:!0,page:a,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(l)}}),Sg("div",{className:AL,children:m.map((h,p)=>{if(typeof h=="number")return Sg(Ig,{isCurrent:i===h,page:h,updatePage:c},p);let g=TL[h.type];return Sg(g,{...h.props},p)})})};var I3=()=>{let t=FL(11),{data:e,handlePageChange:o}=so(),n=e.nextPage||2,r;t[0]!==o?(r=a=>{o(a)},t[0]=o,t[1]=r):r=t[1];let s=e.page||1,i=e.prevPage||void 0,l;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?(l=EL(ec,{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]=l):l=t[10],l};var tr="relationship-table",Dg=t=>{let{AfterInput:e,allowCreate:o=!0,BeforeInput:n,disableTable:r=!1,field:s,filterOptions:i,initialData:l,initialDrawerData:a,Label:c,parent:u,relationTo:d}=t,[f,m]=Cn(null),{config:h,getEntityConfig:p}=W(),{permissions:g}=Se(),[b]=Cn(()=>{if(l)return{...l,docs:Array.isArray(l.docs)?l.docs.reduce((q,z)=>typeof z=="string"?[...q,{id:z}]:[...q,z],[]):[]}}),{i18n:x,t:v}=$(),[C,y]=Cn(),[I,w]=Cn(!1),[A]=Cn(()=>p({collectionSlug:d})),[_,D]=Cn(Array.isArray(d)?void 0:d),[T,S]=Cn(!r),[R,E]=Cn(b),[F,L]=Cn(),{getTableState:k}=Dt(),N=gm(async q=>{let z={limit:String(s?.defaultLimit||A?.admin?.pagination?.defaultLimit),sort:s.defaultSort||A?.defaultSort,...C||{},where:{...C?.where||{}}};i&&(z.where=PL(z.where,i));let re=s.admin.defaultColumns?s.admin.defaultColumns.map(Q=>({accessor:Q,active:!0})):void 0,{data:me,state:se,Table:Z}=await k({collectionSlug:d,columns:S3(C?.columns)||re,docs:q,enableRowSelections:!1,parent:u,query:z,renderRowTypes:!0,tableAppearance:"condensed"});E(me),m(Z),L(se),S(!1)},[s.defaultLimit,s.defaultSort,A?.admin?.pagination?.defaultLimit,A?.defaultSort,C,i,k,d,u]),P=Jt((q,z)=>{!z&&(!f||q)&&N()});_g(()=>{P(C,r)},[C,r]);let[j,V,{closeDrawer:M,isDrawerOpen:O,openDrawer:B}]=Yt({collectionSlug:_}),G=gm(q=>{let z=R?.docs?.findIndex(me=>me.id===q.doc.id),re;if(z!==-1){let me=[...R.docs];me[z]=q.doc,re=me}else re=[q.doc,...R.docs];N(re)},[R?.docs,N]),Y=gm(q=>{M(),G(q)},[M,G]),X=gm(q=>{let z=R.docs.filter(re=>re.id!==q.id);N(z)},[R?.docs,N]),ee=o!==!1&&g?.collections?.[Array.isArray(d)?d[0]:d]?.create;return _g(()=>{Array.isArray(d)&&_&&B()},[_,B,d]),_g(()=>{Array.isArray(d)&&!O&&_&&D(void 0)},[O]),ei("div",{className:tr,children:[ei("div",{className:`${tr}__header`,children:[c,ei("div",{className:`${tr}__actions`,children:[!Array.isArray(d)&&ee&&qt(V,{className:`${tr}__add-new`,children:x.t("fields:addNew")}),Array.isArray(d)&&qt(R3,{children:qt(fo,{button:ei(ae,{buttonStyle:"none",className:`${tr}__add-new-polymorphic`,children:[x.t("fields:addNew"),qt(jo,{})]}),buttonType:"custom",horizontalAlign:"center",render:({close:q})=>qt(Be.ButtonGroup,{children:d.map(z=>g.collections[z].create?qt(Be.Button,{className:`${tr}__relation-button--${z}`,onClick:()=>{q(),D(z)},children:Rg(h.collections.find(re=>re.slug===z).labels.singular,x)},z):null)}),size:"medium"})}),qt(bt,{"aria-controls":`${tr}-columns`,"aria-expanded":I,className:`${tr}__toggle-columns ${I?`${tr}__buttons-active`:""}`,icon:qt(Je,{direction:I?"up":"down"}),onClick:()=>w(!I),pillStyle:"light",children:v("general:columns")})]})]}),n,T?qt("p",{children:v("general:loading")}):ei(R3,{children:[R?.docs&&R.docs.length===0&&ei("div",{className:`${tr}__no-results`,children:[qt("p",{children:x.t("general:noResults",{label:Array.isArray(d)?x.t("general:documents"):Rg(A?.labels?.plural,x)})}),ee&&qt(ae,{onClick:B,children:x.t("general:createNewLabel",{label:Rg(A?.labels?.singular,x)})})]}),R?.docs&&R.docs.length>0&&qt(ql,{children:qt(sg,{columns:S3(F),data:R,defaultLimit:s.defaultLimit??A?.admin?.pagination?.defaultLimit,modifySearchParams:!1,onQueryChange:y,children:ei(Ul,{collectionSlug:Array.isArray(d)?d[0]:d,columnState:F,LinkedCellOverride:qt(x3,{onDrawerDelete:X,onDrawerSave:G}),children:[qt(_r,{className:`${tr}__columns`,height:I?"auto":0,id:`${tr}-columns`,children:qt("div",{className:`${tr}__columns-inner`,children:A&&qt(tm,{collectionSlug:A.slug})})}),f,qt(I3,{})]})})})]}),e,qt(j,{initialData:a,onSave:Y})]})};var D3=Tg.default.default||Tg.default,bm=({collectionSlug:t,config:e,docID:o,fields:n,segments:r})=>{let s=LL(n),i=r[0],l=s.find(c=>c.name===i);if(!l)return null;if(l.type==="relationship"||l.type==="upload"){let c=o;return Array.isArray(l.relationTo)&&(c={relationTo:t,value:o}),{[l.name]:l.hasMany?[c]:c}}let a=r.slice(1,r.length);if(l.type==="tab"||l.type==="group")return{[l.name]:bm({collectionSlug:t,config:e,docID:o,fields:l.fields,segments:a})};if(l.type==="array"){let c=bm({collectionSlug:t,config:e,docID:o,fields:l.fields,segments:a});return c.id=D3().toHexString(),{[l.name]:[c]}}if(l.type==="blocks")for(let c of l.blockReferences??l.blocks){let u=typeof c=="string"?e.blocksMap[c]:c,d=bm({collectionSlug:t,config:e,docID:o,fields:u.fields,segments:a});if(d)return d.id=D3().toHexString(),d.blockType=u.slug,{[l.name]:[d]}}},kL=t=>{let{field:e,field:{admin:{allowCreate:o,description:n},collection:r,label:s,localized:i,on:l,required:a},path:c}=t,{id:u,docConfig:d}=Ae(),{config:f,getEntityConfig:m}=W(),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:x}={},showError:v,value:C}=Te({path:c}),y=_3(()=>{if(!u)return null;let w=u;Array.isArray(e.targetField.relationTo)&&(w={relationTo:d.slug,value:w});let A=Array.isArray(r)?{}:{[l]:{equals:w}};return e.where?{and:[A,e.where]}:A},[u,r,e.targetField.relationTo,e.where,l,d?.slug]),I=_3(()=>{let w=m({collectionSlug:Array.isArray(e.collection)?e.collection[0]:e.collection});return bm({collectionSlug:d?.slug,config:f,docID:u,fields:w.fields,segments:e.on.split(".")})},[m,e.collection,e.on,d?.slug,u,f]);return d?NL("div",{className:[Ce,v&&"error","join"].filter(Boolean).join(" "),id:`field-${c?.replace(/\./g,"__")}`,children:[ti(oe,{CustomComponent:b,Fallback:ti(Xe,{path:c,showError:v})}),ti(Dg,{AfterInput:h,allowCreate:typeof u<"u"&&o,BeforeInput:p,disableTable:y===null,field:e,filterOptions:y,initialData:u&&C?C:{docs:[]},initialDrawerData:I,Label:ti("h4",{style:{margin:0},children:x||ti(be,{label:s,localized:i,path:c,required:a})}),parent:Array.isArray(r)?{id:u,collectionSlug:d.slug,joinPath:c}:void 0,relationTo:r}),ti(oe,{CustomComponent:g,Fallback:ti(We,{description:n,path:c})})]}):null},tc=Oe(kL);import{jsx as oi,jsxs as T3}from"react/jsx-runtime";import $L,{useCallback as Ag,useEffect as jL,useMemo as OL,useState as Fg}from"react";var ML="json-field",BL=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r,maxHeight:s}={},jsonSchema:i,label:l,localized:a,required:c},path:u,readOnly:d,validate:f}=t,[m,h]=Fg(),p=$L.useRef("system"),[g,b]=Fg(""),x=Ag((N,P)=>{if(typeof f=="function")return f(N,{...P,jsonError:m,required:c})},[f,c,m]),{customComponents:{AfterInput:v,BeforeInput:C,Description:y,Error:I,Label:w}={},disabled:A,initialValue:_,setValue:D,showError:T,value:S}=Te({path:u,validate:x}),[R,E]=Fg(()=>(S||_)!==void 0?JSON.stringify(S??_,null,2):void 0),F=Ag((N,P)=>{if(!i)return;P.languages.json.jsonDefaults.setDiagnosticsOptions({enableSchemaRequest:!0,schemas:[...P.languages.json.jsonDefaults.diagnosticsOptions.schemas||[],i],validate:!0});let j=i.uri,V=j.includes("?")?`${j}&${crypto.randomUUID?crypto.randomUUID():bn()}`:`${j}?${crypto.randomUUID?crypto.randomUUID():bn()}`;N.setModel(P.editor.createModel(JSON.stringify(S,null,2),"json",P.Uri.parse(V)))},[i,S]),L=Ag(N=>{if(!(d||A)){p.current="user";try{D(N?JSON.parse(N):null),h(void 0)}catch(P){D(N||null),h(P)}}},[d,A,D]);jL(()=>{p.current==="system"&&(E((S||_)!==void 0?JSON.stringify(S??_,null,2):void 0),b(new Date().toString())),p.current="system"},[_,S]);let k=OL(()=>nt(e),[e]);return T3("div",{className:[Ce,ML,o,T&&"error",(d||A)&&"read-only"].filter(Boolean).join(" "),style:k,children:[oi(oe,{CustomComponent:w,Fallback:oi(be,{label:l,localized:a,path:u,required:c})}),T3("div",{className:`${Ce}__wrap`,children:[oi(oe,{CustomComponent:I,Fallback:oi(Xe,{message:m,path:u,showError:T})}),C,oi(Il,{defaultLanguage:"json",maxHeight:s,onChange:L,onMount:F,options:r,readOnly:d||A,value:R,wrapperProps:{id:`field-${u?.replace(/\./g,"__")}`}},g),v]}),oi(oe,{CustomComponent:y,Fallback:oi(We,{description:n,path:u})})]})},oc=Oe(BL);import{jsx as yn,jsxs as A3}from"react/jsx-runtime";import{getTranslation as VL}from"@payloadcms/translations";import{isNumber as GL}from"payload/shared";import{useCallback as Eg,useEffect as WL,useMemo as zL,useState as HL}from"react";var XL=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s=1}={},hasMany:i=!1,label:l,localized:a,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:x}=$(),v=Eg((N,P)=>{if(typeof g=="function")return g(N,{...P,max:c,min:d,required:f})},[g,d,c,f]),{customComponents:{AfterInput:C,BeforeInput:y,Description:I,Error:w,Label:A}={},disabled:_,setValue:D,showError:T,value:S}=Te({path:h,validate:v}),R=Eg(N=>{let P=parseFloat(N.target.value),j=P;Number.isNaN(P)&&(j=null),typeof m=="function"&&m(j),D(j)},[m,D]),[E,F]=HL([]),L=Eg(N=>{if(!(p||_)){let P;N?Array.isArray(N)?P=N.map(j=>Number(j.value?.value||j.value)):P=[Number(N.value?.value||N.value)]:P=[],D(P)}},[p,_,D]);WL(()=>{i&&Array.isArray(S)&&F(S.map((N,P)=>({id:`${N}${P}`,label:`${N}`,value:{toString:()=>`${N}${P}`,value:N?.value||N}})))},[S,i]);let k=zL(()=>nt(e),[e]);return A3("div",{className:[Ce,"number",o,T&&"error",(p||_)&&"read-only",i&&"has-many"].filter(Boolean).join(" "),style:k,children:[yn(oe,{CustomComponent:A,Fallback:yn(be,{label:l,localized:a,path:h,required:f})}),A3("div",{className:`${Ce}__wrap`,children:[yn(oe,{CustomComponent:w,Fallback:yn(Xe,{path:h,showError:T})}),y,i?yn(yt,{className:`field-${h.replace(/\./g,"__")}`,disabled:p||_,filterOption:(N,P)=>{let j=Array.isArray(S)&&S.length>=u;return GL(P)&&!j},isClearable:!0,isCreatable:!0,isMulti:!0,isSortable:!0,noOptionsMessage:()=>Array.isArray(S)&&S.length>=u?x("validation:limitReached",{max:u,value:S.length+1}):null,onChange:L,options:[],placeholder:x("general:enterAValue"),showError:T,value:E}):yn("div",{children:yn("input",{disabled:p||_,id:`field-${h.replace(/\./g,"__")}`,max:c,min:d,name:h,onChange:R,onWheel:N=>{N.target.blur()},placeholder:VL(r,b),step:s,type:"number",value:typeof S=="number"?S:""})}),C,yn(oe,{CustomComponent:I,Fallback:yn(We,{description:n,path:h})})]})]})},rc=Oe(XL);import{jsx as Zr,jsxs as la}from"react/jsx-runtime";import{getTranslation as Pg}from"@payloadcms/translations";import{useCallback as F3,useMemo as UL}from"react";var E3="point",YL=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s}={},label:i,localized:l,required:a},path:c,readOnly:u,validate:d}=t,{i18n:f,t:m}=$(),h=F3((T,S)=>{if(typeof d=="function")return d(T,{...S,required:a})},[d,a]),{customComponents:{AfterInput:p,BeforeInput:g,Description:b,Error:x,Label:v}={},disabled:C,setValue:y,showError:I,value:w=[null,null]}=Te({path:c,validate:h}),A=F3((T,S)=>{let R=parseFloat(T.target.value);Number.isNaN(R)&&(R=T.target.value);let E=[...w];E[S]=R,y(E)},[y,w]),_=T=>{let S=m(T==="longitude"?"fields:longitude":"fields:latitude"),R=i?Pg(i,f):"";return`${R}${R?" - ":""}${S}`},D=UL(()=>nt(e),[e]);return la("div",{className:[Ce,E3,o,I&&"error",(u||C)&&"read-only"].filter(Boolean).join(" "),style:D,children:[la("ul",{className:`${E3}__wrap`,children:[la("li",{children:[Zr(oe,{CustomComponent:v,Fallback:Zr(be,{label:_("longitude"),localized:l,path:c,required:a})}),la("div",{className:"input-wrapper",children:[g,Zr("input",{disabled:u||C,id:`field-longitude-${c?.replace(/\./g,"__")}`,name:`${c}.longitude`,onChange:T=>A(T,0),placeholder:Pg(r,f),step:s,type:"number",value:w&&typeof w[0]=="number"?w[0]:""}),p]})]}),la("li",{children:[Zr(oe,{CustomComponent:v,Fallback:Zr(be,{label:_("latitude"),localized:l,path:c,required:a})}),la("div",{className:"input-wrapper",children:[Zr(oe,{CustomComponent:x,Fallback:Zr(Xe,{path:c,showError:I})}),g,Zr("input",{disabled:u||C,id:`field-latitude-${c?.replace(/\./g,"__")}`,name:`${c}.latitude`,onChange:T=>A(T,1),placeholder:Pg(r,f),step:s,type:"number",value:w&&typeof w[1]=="number"?w[1]:""}),p]})]})]}),Zr(oe,{CustomComponent:b,Fallback:Zr(We,{description:n,path:c})})]})},nc=Oe(YL);import{jsx as wn,jsxs as P3}from"react/jsx-runtime";import{optionIsObject as N3}from"payload/shared";import{useCallback as QL,useMemo as KL}from"react";import{c as ZL}from"react/compiler-runtime";import{jsx as vm,jsxs as JL}from"react/jsx-runtime";import{getTranslation as qL}from"@payloadcms/translations";import"react";var sc="radio-input",ic=t=>{let e=ZL(16),{isSelected:o,onChange:n,option:r,path:s,readOnly:i,uuid:l}=t,{i18n:a}=$(),c=ut(),u=`field-${s}-${r.value}${c>1?`-${c}`:""}${l?`-${l}`:""}`,d=o&&`${sc}--is-selected`,f;e[0]!==d?(f=[sc,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]!==a||e[6]!==u||e[7]!==o||e[8]!==r.label||e[9]!==s||e[10]!==i||e[11]!==m||e[12]!==h){let g=vm("input",{checked:o,disabled:i,id:u,name:s,onChange:h,type:"radio"}),b=i&&`${sc}__styled-radio--disabled`,x;e[14]!==b?(x=[`${sc}__styled-radio`,b].filter(Boolean),e[14]=b,e[15]=x):x=e[15],p=vm("label",{htmlFor:u,children:JL("div",{className:m,children:[g,vm("span",{className:x.join(" ")}),vm("span",{className:`${sc}__label`,children:qL(r.label,a)})]})}),e[5]=a,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 xm="radio-group",ek=t=>{let{disableModifyingForm:e,field:o,field:{admin:{className:n,description:r,layout:s="horizontal"}={},label:i,localized:l,options:a=[],required:c}={},onChange:u,path:d,readOnly:f,validate:m,value:h}=t,{uuid:p}=Me(),g=QL((S,R)=>{if(typeof m=="function")return m(S,{...R,options:a,required:c})},[m,a,c]),{customComponents:{AfterInput:b,BeforeInput:x,Description:v,Error:C,Label:y}={},disabled:I,setValue:w,showError:A,value:_}=Te({path:d,validate:g}),D=_||h,T=KL(()=>nt(o),[o]);return P3("div",{className:[Ce,xm,n,`${xm}--layout-${s}`,A&&"error",(f||I)&&`${xm}--read-only`].filter(Boolean).join(" "),style:T,children:[wn(oe,{CustomComponent:C,Fallback:wn(Xe,{path:d,showError:A})}),wn(oe,{CustomComponent:y,Fallback:wn(be,{label:i,localized:l,path:d,required:c})}),P3("div",{className:`${Ce}__wrap`,children:[x,wn("ul",{className:`${xm}--group`,id:`field-${d.replace(/\./g,"__")}`,children:a.map(S=>{let R="";N3(S)?R=S.value:R=S;let E=String(R)===String(D),F=`field-${d}-${R}${p?`-${p}`:""}`;return wn("li",{children:wn(ic,{id:F,isSelected:E,onChange:()=>{typeof u=="function"&&u(R),f||I||w(R,!!e)},option:N3(S)?S:{label:S,value:S},path:d,readOnly:f||I,uuid:p})},`${d} - ${R}`)})}),b,wn(oe,{CustomComponent:v,Fallback:wn(We,{description:r,path:d})})]})]})},ac=Oe(ek);import{jsx as qr,jsxs as $g}from"react/jsx-runtime";import{dequal as bk}from"dequal/lite";import{wordBoundariesRegex as vk}from"payload/shared";import*as jg from"qs-esm";import{useCallback as ns,useEffect as wm,useMemo as xk,useReducer as Ck,useRef as uc,useState as ss}from"react";import{c as tk}from"react/compiler-runtime";import{jsx as Jr,jsxs as Cm}from"react/jsx-runtime";import{getTranslation as L3}from"@payloadcms/translations";import{Fragment as Ng,useEffect as ym,useState as lc}from"react";var ca="relationship-add-new",k3=t=>{let e=tk(46),{Button:o,hasMany:n,path:r,relationTo:s,setValue:i,unstyled:l,value:a}=t,c=om(s),{permissions:u}=Se(),[d,f]=lc(!1),[m,h]=lc(),p=c.length>1,g;e[0]!==c||e[1]!==p?(g=()=>p?void 0:c[0],e[0]=c,e[1]=p,e[2]=g):g=e[2];let[b,x]=lc(g),[v,C]=lc(!1),{i18n:y,t:I}=$(),[w,A]=lc(!1),_=b?.slug,D;e[3]!==_?(D={collectionSlug:_},e[3]=_,e[4]=D):D=e[4];let[T,S,R]=Yt(D),{isDrawerOpen:E,toggleDrawer:F}=R,L;e[5]!==b?.slug||e[6]!==n||e[7]!==s||e[8]!==i||e[9]!==a?(L=re=>{let{doc:me,operation:se}=re;if(se==="create"){let Z=Array.isArray(s)?{relationTo:b?.slug,value:me.id}:me.id;(Array.isArray(s)&&Array.isArray(a)?!a.some(ge=>ge&&typeof ge=="object"&&ge.value===me.id):a!==me.id)&&i(n?[...Array.isArray(a)?a:[],Z]:Z),h(void 0)}},e[5]=b?.slug,e[6]=n,e[7]=s,e[8]=i,e[9]=a,e[10]=L):L=e[10];let k=L,N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=re=>{C(re)},e[11]=N):N=e[11];let P=N,j,V;e[12]!==u||e[13]!==c?(j=()=>{u&&(c.length===1?f(u.collections[c[0]?.slug]?.create):f(c.some(re=>u.collections[re?.slug]?.create)))},V=[u,c],e[12]=u,e[13]=c,e[14]=j,e[15]=V):(j=e[14],V=e[15]),ym(j,V);let M,O;e[16]!==c||e[17]!==p||e[18]!==m?(O=()=>{p&&m&&x(c.find(re=>re?.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]),ym(O,M);let B,G;e[21]!==b||e[22]!==p||e[23]!==F?(B=()=>{p&&b&&(F(),h(void 0))},G=[F,p,b],e[21]=b,e[22]=p,e[23]=F,e[24]=B,e[25]=G):(B=e[24],G=e[25]),ym(B,G);let Y,X;e[26]!==E||e[27]!==p?(Y=()=>{p&&!E&&x(void 0)},X=[E,p],e[26]=E,e[27]=p,e[28]=Y,e[29]=X):(Y=e[28],X=e[29]),ym(Y,X);let ee=c[0],q=ee.labels.singular,z;if(e[30]!==o||e[31]!==T||e[32]!==S||e[33]!==b||e[34]!==y||e[35]!==k||e[36]!==r||e[37]!==u||e[38]!==v||e[39]!==c||e[40]!==d||e[41]!==w||e[42]!==I||e[43]!==ee.labels.singular||e[44]!==l){z=Symbol.for("react.early_return_sentinel");e:{let re=I("fields:addNewLabel",{label:L3(q,y)});if(d){z=Cm("div",{className:ca,id:`${r}-add-new`,children:[c.length===1&&Cm(Ng,{children:[Jr(S,{className:[`${ca}__add-button`,l&&`${ca}__add-button--unstyled`].filter(Boolean).join(" "),onClick:()=>A(!1),onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:o||Cm(Ng,{children:[Jr(po,{className:`${ca}__tooltip`,show:w,children:re}),Jr(jo,{})]})}),Jr(T,{onSave:k})]}),c.length>1&&Cm(Ng,{children:[Jr(fo,{button:o||Jr(ae,{buttonStyle:"none",className:`${ca}__add-button`,tooltip:v?void 0:I("fields:addNew"),children:Jr(jo,{})}),buttonType:"custom",horizontalAlign:"center",onToggleOpen:P,render:me=>{let{close:se}=me;return Jr(ep,{children:c.map(Z=>u.collections[Z?.slug].create?Jr(tp,{className:`${ca}__relation-button--${Z?.slug}`,onClick:()=>{se(),h(Z?.slug)},children:L3(Z?.labels?.singular,y)},Z?.slug):null)})},size:"medium"}),b&&u.collections[b?.slug]?.create&&Jr(T,{onSave:k})]})]});break e}}e[30]=o,e[31]=T,e[32]=S,e[33]=b,e[34]=y,e[35]=k,e[36]=r,e[37]=u,e[38]=v,e[39]=c,e[40]=d,e[41]=w,e[42]=I,e[43]=ee.labels.singular,e[44]=l,e[45]=z}else z=e[45];return z!==Symbol.for("react.early_return_sentinel")?z:null};import{c as ok}from"react/compiler-runtime";import{useRef as rk}from"react";var Lg=(t,e)=>{let o=ok(3),n=rk(void 0),r;return o[0]!==t||o[1]!==e?(r=(...s)=>{let i=s,l=()=>{clearTimeout(n.current),t(...i)};clearTimeout(n.current),n.current=setTimeout(l,e)},o[0]=t,o[1]=e,o[2]=r):r=o[2],r};var kg=({hasMany:t,relationTo:e,value:o})=>{let n=Array.isArray(e),r;if(Array.isArray(e)?r=e.reduce((i,l)=>({...i,[l]:[]}),{}):r={[e]:[]},o===null)return r;let s=(i,l)=>{(typeof l=="string"||typeof l=="number")&&typeof i=="string"&&(r[i]?r[i].push(l):r[i]=[l])};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 $3=({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(l=>typeof r=="object"?l.value===r.value&&l.relationTo===r.relationTo:r===l.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 nk}from"@payloadcms/translations";var O3=t=>t.reduce((e,o)=>o.options?[...e,...O3(o.options)]:[...e,{id:o.value,relationTo:o.relationTo}],[]),j3=t=>t.sort((e,o)=>typeof e?.label?.localeCompare=="function"&&typeof o?.label?.localeCompare=="function"?e.label.localeCompare(o.label):0),M3=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,config:n,docs:r,i18n:s,ids:i=[],sort:l}=e,a=o.slug,c=O3(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===a).length===0){c.push({id:h.id,relationTo:a});let p=lr({collectionConfig:o,data:h,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${h.id}`,i18n:s});return[...m,{label:p,relationTo:a,value:h.id}]}return m},[]);if(i.forEach(m=>{c.filter(h=>h.id===m&&h.relationTo===a).length===0&&(c.push({id:m,relationTo:a}),f.push({allowEdit:!1,label:`${s.t("general:untitled")} - ID: ${m}`,relationTo:a,value:m}))}),d){let m=[...d.options,...f];d.options=l?j3(m):m}else u.push({label:nk(o.labels.plural,s),options:l?j3(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(l=>l&&i.value===(typeof l=="object"?l.value:l)):!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,l=[...t],a=lr({collectionConfig:o,data:r,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${r.id}`,i18n:s}),u=l.find(d=>d.label===o.labels.plural)?.options?.find(d=>d.value===r.id);return u&&(u.label=a,u.relationTo=i),l}default:return t}};import{c as sk}from"react/compiler-runtime";import{jsx as cc,jsxs as B3}from"react/jsx-runtime";import{Fragment as ik,useState as ak}from"react";var ua="relationship--multi-value-label",V3=t=>{let e=sk(26),{data:o,selectProps:n}=t,{allowEdit:r,label:s,relationTo:i,value:l}=o,a;e[0]!==n?(a=n===void 0?{}:n,e[0]=n,e[1]=a):a=e[1];let{customProps:c}=a,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}=Se(),[h,p]=ak(!1),{t:g}=$(),b=!!m?.collections?.[i]?.read,x;e[4]!==d?(x=d||{},e[4]=d,e[5]=x):x=e[5];let v;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]!==x||e[15]!==l){let C;e[17]!==r||e[18]!==b||e[19]!==s||e[20]!==f||e[21]!==i||e[22]!==h||e[23]!==g||e[24]!==l?(C=i&&b&&r!==!1&&cc(ik,{children:B3("button",{"aria-label":`Edit ${s}`,className:`${ua}__drawer-toggler`,onClick:()=>{p(!1),f({id:l,collectionSlug:i,hasReadPermission:b})},onKeyDown:lk,onMouseDown:ck,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onTouchEnd:uk,type:"button",children:[cc(po,{className:`${ua}__tooltip`,show:h,children:g("general:editLabel",{label:""})}),cc(wr,{className:`${ua}__icon`})]})}),e[17]=r,e[18]=b,e[19]=s,e[20]=f,e[21]=i,e[22]=h,e[23]=g,e[24]=l,e[25]=C):C=e[25],v=B3("div",{className:ua,children:[cc("div",{className:`${ua}__content`,children:cc(no.MultiValueLabel,{...t,innerProps:{className:`${ua}__text`,...x}})}),C]}),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]=x,e[15]=l,e[16]=v}else v=e[16];return v};function lk(t){t.key==="Enter"&&t.stopPropagation()}function ck(t){return t.stopPropagation()}function uk(t){return t.stopPropagation()}import{c as dk}from"react/compiler-runtime";import{jsx as da,jsxs as G3}from"react/jsx-runtime";import{Fragment as mk,useState as fk}from"react";var ma="relationship--single-value",W3=t=>{let e=dk(24),{children:o,data:n,selectProps:r}=t,{allowEdit:s,label:i,relationTo:l,value:a}=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]=fk(!1),{t:p}=$(),{permissions:g}=Se(),b=!!g?.collections?.[l]?.read,x;if(e[4]!==s||e[5]!==o||e[6]!==b||e[7]!==i||e[8]!==f||e[9]!==t||e[10]!==l||e[11]!==m||e[12]!==p||e[13]!==a){let v;e[15]!==s||e[16]!==b||e[17]!==i||e[18]!==f||e[19]!==l||e[20]!==m||e[21]!==p||e[22]!==a?(v=l&&b&&s!==!1&&da(mk,{children:G3("button",{"aria-label":p("general:editLabel",{label:i}),className:`${ma}__drawer-toggler`,onClick:()=>{h(!1),f({id:a,collectionSlug:l,hasReadPermission:b})},onKeyDown:pk,onMouseDown:hk,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onTouchEnd:gk,type:"button",children:[da(po,{className:`${ma}__tooltip`,show:m,children:p("general:edit")}),da(wr,{})]})}),e[15]=s,e[16]=b,e[17]=i,e[18]=f,e[19]=l,e[20]=m,e[21]=p,e[22]=a,e[23]=v):v=e[23],x=da(no.SingleValue,{...t,className:ma,children:da("div",{className:`${ma}__label`,children:G3("div",{className:`${ma}__label-text`,children:[da("div",{className:`${ma}__text`,children:o}),v]})})}),e[4]=s,e[5]=o,e[6]=b,e[7]=i,e[8]=f,e[9]=t,e[10]=l,e[11]=m,e[12]=p,e[13]=a,e[14]=x}else x=e[14];return x};function pk(t){t.key==="Enter"&&t.stopPropagation()}function hk(t){return t.stopPropagation()}function gk(t){return t.stopPropagation()}var yk=10,dc="relationship",wk=t=>{let{field:e,field:{admin:{allowCreate:o=!0,allowEdit:n=!0,className:r,description:s,isSortable:i=!0,sortOptions:l}={},hasMany:a,label:c,localized:u,relationTo:d,required:f},path:m,readOnly:h,validate:p}=t,{config:g,getEntityConfig:b}=W(),{routes:{api:x},serverURL:v}=g,{i18n:C,t:y}=$(),{permissions:I}=Se(),{code:w}=Ee(),A=Array.isArray(d),[_,D]=ss({id:void 0,collectionSlug:void 0,hasReadPermission:!1}),[T,S]=ss(-1),[R,E]=ss({}),[F,L]=ss(""),[k,N]=ss(""),[P,j]=ss(!1),[V,M]=ss(!1),[O,B]=ss(!1),G=uc(!1),Y=ns((ue,ve)=>{if(typeof p=="function")return p(ue,{...ve,required:f})},[p,f]),{customComponents:{AfterInput:X,BeforeInput:ee,Description:q,Error:z,Label:re}={},disabled:me,filterOptions:se,initialValue:Z,setValue:Q,showError:ge,value:Ie}=Te({path:m,validate:Y}),[Fe,Le]=Ck(M3,[]),K=uc(Ie);K.current=Ie;let[_e,,{isDrawerOpen:pe,openDrawer:ce}]=Yt({id:_.id,collectionSlug:_.collectionSlug}),ne=uc(!1),H=ns(async({filterOptions:ue,lastFullyLoadedRelation:ve,lastLoadedPage:Ve,onSuccess:Ge,search:$e,sort:ie,value:J})=>{if(!I)return;let te=typeof ve<"u"?ve:-1,he=Array.isArray(d)?d:[d],Pe=te===-1?he:he.slice(te+1),je=0,Ye=kg({hasMany:a,relationTo:d,value:J});F||(await Pe.reduce(async(Qe,Ze)=>{let _t=ue?.[Ze],_o;if(k!==$e?_o=1:_o=Ve[Ze]+1,await Qe,_t===!1)return S(he.indexOf(Ze)),Promise.resolve();if(je<10){let Ct=b({collectionSlug:Ze}),lo=Ct?.admin?.useAsTitle||"id",co=Ct?.defaultSort||"id";typeof l=="string"?co=l:l?.[Ze]&&(co=l[Ze]);let He={depth:0,draft:!0,limit:yk,locale:w,page:_o,sort:co,where:{and:[{id:{not_in:Ye[Ze]}}]}};$e&&He.where.and.push({[lo]:{like:$e}}),_t&&typeof _t!="boolean"&&He.where.and.push(_t);let uo=await fetch(`${v}${x}/${Ze}`,{body:jg.stringify(He),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(uo.ok){let ko=await uo.json();E(mo=>({...mo,[Ze]:_o})),ko.nextPage||S(he.indexOf(Ze)),ko.docs.length>0&&(je+=ko.docs.length,Le({type:"ADD",collection:Ct,config:g,docs:ko.docs,i18n:C,sort:ie}))}else uo.status===403?(S(he.indexOf(Ze)),Le({type:"ADD",collection:Ct,config:g,docs:[],i18n:C,ids:Ye[Ze],sort:ie})):L(y("error:unspecific"))}},Promise.resolve()),typeof Ge=="function"&&Ge())},[I,d,a,F,k,b,w,v,l,x,C,g,y]),U=Lg((ue,ve)=>{H({filterOptions:se,lastLoadedPage:{},search:ue,sort:!0,value:ve}),N(ue)},300),le=ns((ue,ve)=>{k!==ue&&(E({}),U(ue,ve,ue!==""))},[k,U]),De=Jt(ue=>{let ve=kg({hasMany:a,relationTo:d,value:ue});Object.entries(ve).reduce(async(Ve,[Ge,$e])=>{await Ve;let ie=$e.filter(J=>!Fe.find(te=>te?.options?.find(he=>he.value===J&&he.relationTo===Ge)));if(ie.length>0){let J={depth:0,draft:!0,limit:ie.length,locale:w,where:{id:{in:ie}}};if(!F){let te=await fetch(`${v}${x}/${Ge}`,{body:jg.stringify(J),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"}),he=b({collectionSlug:Ge}),Pe=[];te.ok&&(Pe=(await te.json()).docs),Le({type:"ADD",collection:he,config:g,docs:Pe,i18n:C,ids:ie,sort:!0})}}},Promise.resolve())}),Ne=uc(Ie),qe=uc(!0);wm(()=>{(qe.current||!bk(Ie,Ne.current))&&De(Ie),qe.current=!1,Ne.current=Ie},[Ie]),wm(()=>{let ve=(Array.isArray(d)?d:[d]).reduce((Ve,Ge)=>(b({collectionSlug:Ge})?.admin?.useAsTitle||"id")==="id"&&Ve,!0);M(!ve)},[d,b]);let Ue=Jt(async ue=>await H(ue));wm(()=>{G.current&&O&&(j(!0),Ue({filterOptions:se,lastLoadedPage:{},onSuccess:()=>{G.current=!0,j(!1)},value:K.current})),Le({type:"CLEAR",exemptValues:K.current}),S(-1),E({})},[d,se,w,m,O]);let ke=ns(ue=>{Le({type:"UPDATE",collection:ue.collectionConfig,config:g,doc:ue.doc,i18n:C});let ve=K.current,Ve=ue.doc.id;if(a){let Ge=ve.some(ie=>typeof ie=="string"?ie===Ve:ie.value===Ve),$e=ve.map(ie=>ie.value===Ve?{relationTo:ue.collectionConfig.slug,value:Ve}:ie);Q($e,Ge)}else{let Ge=ve===Ve;Q({relationTo:ue.collectionConfig.slug,value:Ve},Ge)}},[C,g,a,Q]),ot=ns(ue=>{Le({type:"ADD",collection:ue.collectionConfig,config:g,docs:[ue.doc],i18n:C,sort:!0}),Q(a?K.current?K.current.concat({relationTo:ue.collectionConfig.slug,value:ue.doc.id}):null:{relationTo:ue.collectionConfig.slug,value:ue.doc.id})},[C,g,a,Q]),Ft=ns(ue=>{Le({id:ue.id,type:"REMOVE",collection:ue.collectionConfig,config:g,i18n:C}),Q(a&&K.current?K.current.filter(ve=>ve.value!==ue.id):null)},[C,g,a,Q]),Wt=ns((ue,ve)=>{if(!ve)return!0;let Ve=vk(ve||""),Ge=250,$e=String(ue.label);for(;$e.length>Ge;){let ie=$e.indexOf(" ",ve.length);if(Ve.test($e.slice(0,ie===-1?ve.length:ie+1)))return!0;$e=$e.slice(ie===-1?ve.length:ie+1)}return Ve.test($e.slice(-Ge))},[]),mt=ns(({id:ue,collectionSlug:ve,hasReadPermission:Ve})=>{ne.current=!0,D({id:ue,collectionSlug:ve,hasReadPermission:Ve})},[]);wm(()=>{ne.current&&(ce(),ne.current=!1)},[ce,_]);let ze=$3({allowEdit:n,options:Fe,value:Ie});!Array.isArray(ze)&&ze?.value==="null"&&(ze.value=null);let rt=xk(()=>nt(e),[e]);return $g("div",{className:[Ce,dc,r,ge&&"error",F&&"error-loading",(h||me)&&`${dc}--read-only`,!(h||me)&&o&&`${dc}--allow-create`].filter(Boolean).join(" "),id:`field-${m.replace(/\./g,"__")}`,style:rt,children:[qr(oe,{CustomComponent:re,Fallback:qr(be,{label:c,localized:u,path:m,required:f})}),$g("div",{className:`${Ce}__wrap`,children:[qr(oe,{CustomComponent:z,Fallback:qr(Xe,{path:m,showError:ge})}),ee,!F&&$g("div",{className:`${dc}__wrap`,children:[qr(yt,{backspaceRemovesValue:!pe,components:{MultiValueLabel:V3,SingleValue:W3},customProps:{disableKeyDown:pe,disableMouseDown:pe,onDocumentDrawerOpen:mt,onSave:ke},disabled:h||me||pe,filterOption:V?Wt:void 0,getOptionValue:ue=>{if(ue)return a&&Array.isArray(d)?`${ue.relationTo}_${ue.value}`:ue.value},isLoading:P,isMulti:a,isSortable:i,onChange:h||me?void 0:ue=>{ue===null?Q(a?[]:null):a&&Array.isArray(ue)?Q(ue?ue.map(ve=>A?{relationTo:ve.relationTo,value:ve.value}:ve.value):null):A&&!Array.isArray(ue)?Q({relationTo:ue.relationTo,value:ue.value}):Array.isArray(ue)||Q(ue.value)},onInputChange:ue=>le(ue,Ie),onMenuClose:()=>{B(!1)},onMenuOpen:()=>{B(!0),G.current||(j(!0),H({filterOptions:se,lastLoadedPage:{},onSuccess:()=>{G.current=!0,j(!1)},value:Z}))},onMenuScrollToBottom:()=>{H({filterOptions:se,lastFullyLoadedRelation:T,lastLoadedPage:R,search:k,sort:!1,value:Z})},options:Fe,showError:ge,value:ze??null}),!(h||me)&&o&&qr(k3,{hasMany:a,path:m,relationTo:d,setValue:Q,value:Ie})]}),F&&qr("div",{className:`${dc}__error-loading`,children:F}),X,qr(oe,{CustomComponent:q,Fallback:qr(We,{description:s,path:m})})]}),_.collectionSlug&&_.hasReadPermission&&qr(_e,{onDelete:Ft,onDuplicate:ot,onSave:ke})]})},mc=Oe(wk);var fc=()=>null;import{jsx as Og}from"react/jsx-runtime";import"react";var z3="row",Ik=t=>{let{field:{admin:{className:e,style:o}={},fields:n},forceRender:r=!1,indexPath:s="",parentPath:i="",parentSchemaPath:l="",permissions:a,readOnly:c}=t;return Og(f2,{children:Og("div",{className:[Ce,z3,e].filter(Boolean).join(" "),style:o||void 0,children:Og(yo,{className:`${z3}__fields`,fields:n,forceRender:r,margins:!1,parentIndexPath:s,parentPath:i,parentSchemaPath:l,permissions:a,readOnly:c})})})},pc=Oe(Ik);import{jsx as Rk}from"react/jsx-runtime";import _k,{useCallback as X3,useMemo as Dk}from"react";import{c as Sk}from"react/compiler-runtime";import{jsx as ri,jsxs as H3}from"react/jsx-runtime";import{getTranslation as Mg}from"@payloadcms/translations";import"react";var fa=t=>{let e=Sk(39),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:l,hasMany:a,isClearable:c,isSortable:u,label:d,Label:f,localized:m,onChange:h,onInputChange:p,options:g,path:b,readOnly:x,required:v,showError:C,style:y,value:I}=t,w=a===void 0?!1:a,A=c===void 0?!0:c,_=u===void 0?!0:u,{i18n:D}=$(),T;if(e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==l||e[4]!==f||e[5]!==r||e[6]!==i||e[7]!==w||e[8]!==D||e[9]!==A||e[10]!==_||e[11]!==d||e[12]!==m||e[13]!==h||e[14]!==p||e[15]!==g||e[16]!==b||e[17]!==x||e[18]!==v||e[19]!==C||e[20]!==y||e[21]!==I){let S;if(w&&Array.isArray(I)){let k;e[23]!==D||e[24]!==g?(k=N=>{let P=g.find(j=>j.value===N);return{label:P?Mg(P.label,D):N,value:P?.value??N}},e[23]=D,e[24]=g,e[25]=k):k=e[25],S=I.map(k)}else if(I){let k,N;if(e[26]!==D||e[27]!==g||e[28]!==I){let P;e[31]!==I?(P=j=>j.value===I,e[31]=I,e[32]=P):P=e[32],k=g.find(P),N=k?Mg(k.label,D):I,e[26]=D,e[27]=g,e[28]=I,e[29]=k,e[30]=N}else k=e[29],N=e[30];S={label:N,value:k?.value??I}}else S=null;let R=C&&"error",E=x&&"read-only",F;e[33]!==r||e[34]!==R||e[35]!==E?(F=[Ce,"select",r,R,E].filter(Boolean),e[33]=r,e[34]=R,e[35]=E,e[36]=F):F=e[36];let L;e[37]!==D?(L=k=>({...k,label:Mg(k.label,D)}),e[37]=D,e[38]=L):L=e[38],T=H3("div",{className:F.join(" "),id:`field-${b.replace(/\./g,"__")}`,style:y,children:[ri(oe,{CustomComponent:f,Fallback:ri(be,{label:d,localized:m,path:b,required:v})}),H3("div",{className:`${Ce}__wrap`,children:[ri(oe,{CustomComponent:l,Fallback:ri(Xe,{path:b,showError:C})}),n,ri(yt,{disabled:x,isClearable:A,isMulti:w,isSortable:_,onChange:h,onInputChange:p,options:g.map(L),showError:C,value:S}),o]}),ri(oe,{CustomComponent:s,Fallback:ri(We,{description:i,path:b})})]}),e[0]=o,e[1]=n,e[2]=s,e[3]=l,e[4]=f,e[5]=r,e[6]=i,e[7]=w,e[8]=D,e[9]=A,e[10]=_,e[11]=d,e[12]=m,e[13]=h,e[14]=p,e[15]=g,e[16]=b,e[17]=x,e[18]=v,e[19]=C,e[20]=y,e[21]=I,e[22]=T}else T=e[22];return T};var Tk=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e}),Ak=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,isClearable:s=!0,isSortable:i=!0}={},hasMany:l=!1,label:a,localized:c,options:u=[],required:d},onChange:f,path:m,readOnly:h,validate:p}=t,g=_k.useMemo(()=>Tk(u),[u]),b=X3((R,E)=>{if(typeof p=="function")return p(R,{...E,hasMany:l,options:g,required:d})},[p,d,l,g]),{customComponents:{AfterInput:x,BeforeInput:v,Description:C,Error:y,Label:I}={},disabled:w,setValue:A,showError:_,value:D}=Te({path:m,validate:b}),T=X3(R=>{if(!h||w){let E=null;R&&l?Array.isArray(R)?E=R.map(F=>F.value):E=[]:R&&!Array.isArray(R)&&(E=R.value),typeof f=="function"&&f(E),A(E)}},[h,w,l,A,f]),S=Dk(()=>nt(e),[e]);return Rk(fa,{AfterInput:x,BeforeInput:v,className:n,Description:C,description:r,Error:y,hasMany:l,isClearable:s,isSortable:i,Label:I,label:a,localized:c,name:o,onChange:T,options:g,path:m,readOnly:h||w,required:d,showError:_,style:S,value:D})},hc=Oe(Ak);import{c as mI}from"react/compiler-runtime";import{jsx as Sn,jsxs as fI}from"react/jsx-runtime";import{getTranslation as b$}from"@payloadcms/translations";import{tabHasName as _m,toKebabCase as v$}from"payload/shared";import{useEffect as dI,useState as qg}from"react";var aI=Is(Gg(),1);import{jsx as $r}from"react/jsx-runtime";import{dequal as iI}from"dequal/lite";import{useRouter as i$}from"next/navigation.js";import{deepCopyObjectSimpleWithoutReactComponents as Yg,getDataByPath as a$,getSiblingData as l$,reduceFieldsToValues as Zg,wait as c$}from"payload/shared";import u$,{useCallback as or,useEffect as si,useReducer as d$,useRef as vc,useState as as}from"react";import{c as Lk}from"react/compiler-runtime";import{jsx as J3,jsxs as kk}from"react/jsx-runtime";import $k from"react";function jk(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 Ok(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:jk(n),message:`${e} (${n.length}):`}}function q3(t){let e=Lk(5),{errorMessage:o}=t,n;e[0]!==o?(n=()=>Ok(o),e[0]=o,e[1]=n):n=e[1];let[r]=$k.useState(n),{errors:s,message:i}=r,l;return e[2]!==s||e[3]!==i?(l=kk("div",{children:[i,Array.isArray(s)&&s.length>0?J3("ul",{"data-testid":"field-errors",children:s.map(Mk)}):null]}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function Mk(t,e){return J3("li",{children:t},e)}import{c as Bk}from"react/compiler-runtime";import{useEffect as Q3,useState as Vk}from"react";function Wg(t,e,o){let n=Bk(11),r;n[0]!==t?(r=()=>t,n[0]=t,n[1]=r):r=n[1];let[s,i]=Vk(r),l;n[2]!==o||n[3]!==t?(l=()=>{let d=setTimeout(()=>{i(()=>t)},o);return()=>{clearTimeout(d)}},n[2]=o,n[3]=t,n[4]=l):l=n[4];let a;n[5]!==o||n[6]!==e?(a=[...e,o],n[5]=o,n[6]=e,n[7]=a):a=n[7],Q3(l,a);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]),Q3(c,u)}import{useCallback as Gk,useRef as zg}from"react";function K3(){let t=zg(null),e=zg(null),o=zg(null);return{queueTask:Gk(r=>{if(e.current=r,t.current!==null){o.current&&o.current.abort();return}(async()=>{for(;e.current;){let i=e.current;e.current=null;let l=new AbortController;o.current=l;try{t.current=i(l.signal),await t.current}catch(a){a.name!=="AbortError"&&console.error("Error in queued function:",a)}finally{t.current=null}}})()},[])}}import{c as Wk}from"react/compiler-runtime";import{jsx as zk}from"react/jsx-runtime";import eI,{useState as Hk}from"react";var tI=eI.createContext(null),Hg=t=>{let e=Wk(6),{children:o}=t,[n,r]=Hk(Xk),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,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=u=>{let{collectionSlug:d,handler:f}=u;r(m=>{let h=new Map(m);return h.set(d,f),h})},e[2]=l):l=e[2];let a=l,c;return e[3]!==o||e[4]!==i?(c=zk(tI,{value:{getUploadHandler:i,setUploadHandler:a},children:o}),e[3]=o,e[4]=i,e[5]=c):c=e[5],c},gc=()=>{let t=eI.use(tI);if(t===null)throw new Error("useUploadHandlers must be used within UploadHandlersProvider");return t};function Xk(){return new Map}var oI={413:"Your request was too large to submit successfully."};var Xg=Is(tg(),1);import{dequal as Uk}from"dequal/lite";import{deepCopyObjectSimple as Yk,deepCopyObjectSimpleWithoutReactComponents as Zk}from"payload/shared";var pa=(t,e)=>{let o={},n=Object.entries(e).reduce((r,[s,i])=>{let l=r;if(s.indexOf(`${t}.`)===0){let[a]=s.replace(`${t}.`,"").split(".");l[a]||(l[a]={}),l[a][s.replace(`${t}.${String(a)}.`,"")]={...i}}else o[s]=i;return l},[]);return{remainingFields:o,rows:n}},ha=(t,e)=>e.reduce((o,n,r)=>({...o,...Object.entries(n).reduce((s,[i,l])=>({...s,[`${t}.${r}.${i}`]:{...l}}),{})}),{});var is=Xg.default.default||Xg.default;function bc(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,l=[...t[n]?.rows||[]],a={id:s?.id?.value||new is().toHexString(),blockType:o||void 0,collapsed:!1,isLoading:!0};l.splice(i,0,a),o&&(s.blockType={initialValue:o,valid:!0,value:o});let{remainingFields:c,rows:u}=pa(n,t);return u.splice(i,0,s),{...c,...ha(n,u),[`${n}.${i}.id`]:{initialValue:a.id,passesCondition:!0,requiresRender:!0,valid:!0,value:a.id},[n]:{...t[n],disableFormData:!0,requiresRender:!0,rows:l,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 l=n.reduce((c,{fieldErrorPath:u,parentPath:d})=>(d.startsWith(s)&&c.push(u),c),[]),a=!1;if(l.length>0){let c=Array.isArray(i.errorPaths)?i.errorPaths:[];l.forEach(u=>{c.includes(u)||(c.push(u),a=!0)}),a&&(r[s]={...i,errorPaths:c})}return a||(r[s]=i),r},{}),o}case"DUPLICATE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=pa(o,t),i=[...t[o].rows||[]],l=Yk(i[n]);l.id&&(l.id=new is().toHexString());let a=Zk(s[n]);a.id&&(a.id.value=new is().toHexString(),a.id.initialValue=new is().toHexString());for(let u of Object.keys(a).filter(d=>d.endsWith(".id"))){let d=a[u];d&&typeof d.value=="string"&&is.isValid(d.value)&&(a[u].value=new is().toHexString(),a[u].initialValue=new is().toHexString())}return Object.keys(a).length>0&&(s.splice(n+1,0,a),i.splice(n+1,0,l)),{...r,...ha(o,s),[o]:{...t[o],disableFormData:!0,requiresRender:!0,rows:i,value:s.length}}}case"MOVE_ROW":{let{moveFromIndex:o,moveToIndex:n,path:r}=e,{remainingFields:s,rows:i}=pa(r,t),l=i[o];i.splice(o,1),i.splice(n,0,l);let a=[...t[r]?.rows||[]],c={...a[o]};a.splice(o,1),a.splice(n,0,c);let u={...s,...ha(r,i),[r]:{...t[r],requiresRender:!0,rows:a}};if(u[r]?.customComponents?.RowLabels){let d={...u[r].customComponents,RowLabels:[...u[r].customComponents.RowLabels]};n>=d.RowLabels.length&&(d.RowLabels.length=n+1);let f=d.RowLabels[o];d.RowLabels.splice(o,1),d.RowLabels.splice(n,0,f),u[r].customComponents=d}return u}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}=pa(o,t),i=[...t[o]?.rows||[]];return s.splice(n,1),i.splice(n,1),{...r,[o]:{...t[o],disableFormData:s.length>0,requiresRender:!0,rows:i,value:s.length},...ha(o,s)}}case"REPLACE_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,{remainingFields:i,rows:l}=pa(n,t),a=Math.max(0,Math.min(r,l?.length-1||0)),c=[...t[n]?.rows||[]];return c[a]={id:new is().toHexString(),blockType:o||void 0,collapsed:!1},o&&(s.blockType={initialValue:o,valid:!0,value:o}),l[a]=s,{...i,...ha(n,l),[n]:{...t[n],disableFormData:!0,rows:c,value:l.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),Uk(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 Jk=()=>{},qk=()=>{},Qk=()=>{},Kk=()=>{},e$=()=>{},t$=()=>{},o$=()=>{},r$=()=>{},n$=()=>{},s$=()=>{},Sm={addFieldRow:()=>{},buildRowErrors:()=>{},createFormData:e$,disabled:!1,dispatchFields:Qk,fields:{},formRef:null,getData:()=>{},getDataByPath:()=>{},getField:()=>{},getFields:()=>({}),getSiblingData:qk,initializing:void 0,isValid:!0,removeFieldRow:()=>{},replaceFieldRow:()=>{},replaceState:()=>{},reset:s$,setBackgroundProcessing:r$,setDisabled:()=>{},setIsValid:()=>{},setModified:t$,setProcessing:o$,setSubmitted:n$,submit:Jk,validateForm:Kk};import{dequal as sI}from"dequal/lite";function rI(t,e){if(t.length!==e.length)return!1;let o=t.slice().sort(),n=e.slice().sort();for(let r=0;r<o.length;r++)if(o[r]!==n[r])return!1;return!0}var nI=(t,e)=>{if(!t)return{changed:!1,result:void 0};let o=[],n=[];return Array.isArray(e)&&e?.length&&e.forEach(r=>n.push(r)),Array.isArray(t)&&t?.length&&t.forEach(r=>o.push(r)),rI(o,n)?{changed:!1,result:t}:{changed:!0,result:n}};var Ug=({acceptValues:t,existingState:e,incomingState:o})=>{let n=!1,r={};if(e){let s=["passesCondition","valid","errorMessage","errorPaths","rows","customComponents","requiresRender"];t&&(s.push("value"),s.push("initialValue"));for(let[i,l]of Object.entries(e)){if(!o[i])continue;let a=!1,c=nI(l.errorPaths,o[i].errorPaths);c.result&&(c.changed&&(n=c.changed),l.errorPaths=c.result),(o[i]?.filterOptions||l.filterOptions)&&(sI(o[i]?.filterOptions,l.filterOptions)||(n=!0,a=!0,l.filterOptions=o[i].filterOptions)),s.forEach(u=>{sI(o[i]?.[u],l[u])||(n=!0,a=!0,u in o[i]?l[u]=o[i][u]:u!=="customComponents"&&delete l[u])}),l.valid!==!1&&(l.valid=!0),l.passesCondition!==!1&&(l.passesCondition=!0),r[i]=a?{...l}:l}for(let[i,l]of Object.entries(o))e[i]||(n=!0,r[i]=l)}return{changed:n,newState:r}};var m$="form",In=t=>{let{id:e,collectionSlug:o,docPermissions:n,getDocPreferences:r,globalSlug:s}=Ae(),{action:i,beforeSubmit:l,children:a,className:c,disabled:u,disableSuccessStatus:d,disableValidationOnSubmit:f,el:m,handleResponse:h,initialState:p,isDocumentForm:g,isInitializing:b,onChange:x,onSubmit:v,onSuccess:C,redirect:y,submitted:I,uuid:w,waitForAutocomplete:A}=t,_="method"in t?t?.method:void 0,D=i$(),T=Di(),{code:S}=Ee(),{i18n:R,t:E}=$(),{refreshCookie:F,user:L}=Se(),k=Jo(),{queueTask:N}=K3(),{getFormState:P}=Dt(),{startRouteTransition:j}=it(),{getUploadHandler:V}=gc(),{config:M}=W(),[O,B]=as(u||!1),[G,Y]=as(!1),[X,ee]=as(!1),[q,z]=as(!0),[re,me]=as(b),[se,Z]=as(!1),[Q,ge]=as(!1),[Ie,Fe]=as(!1),Le=vc(null),K=vc({}),_e=vc(null),pe=vc(!0),ce=d$(bc,{},()=>p),[ne,H]=ce;K.current.fields=ne;let U=vc(ne),le=or(async()=>{let J={},te=!0,he=K.current.getData(),Pe=Object.entries(K.current.fields).map(async([je,Ye])=>{let Qe=Ye,Ze=je?je.split("."):[];if(Ye.passesCondition!==!1){let _t=Qe.valid;if("validate"in Ye&&typeof Ye.validate=="function"){let _o=Ye.value;Ye?.rows&&Array.isArray(Ye.rows)&&(_o=K.current.getDataByPath(je)),_t=await Ye.validate(_o,{...Ye,id:e,collectionSlug:o,blockData:void 0,data:T?.getData?T.getData():he,event:"submit",operation:k,path:Ze,preferences:{},req:{payload:{config:M},t:E,user:L},siblingData:K.current.getSiblingData(je)}),typeof _t=="string"?(Qe.errorMessage=_t,Qe.valid=!1):(Qe.valid=!0,Qe.errorMessage=void 0)}Qe.valid===!1&&(te=!1)}J[je]=Qe});return await Promise.all(Pe),iI(K.current.fields,J)||H({type:"REPLACE_STATE",state:J}),z(te),te},[o,M,H,e,k,E,L,T]),De=or(async(J={},te)=>{let{action:he=i,method:Pe=_,overrides:je={},skipValidation:Ye}=J;if(O){te&&te.preventDefault();return}let Qe,Ze,_t=new Promise((He,uo)=>{Ze=He,Qe=uo}),_o=he||typeof i=="string"||typeof i=="function";if(y||d||!_o?(Ze=He=>fe.success(He),Qe=He=>fe.error(He)):fe.promise(_t,{error:He=>He,loading:E("general:submitting"),success:He=>He}),te&&(te.stopPropagation(),te.preventDefault()),Z(!0),B(!0),A&&await c$(100),Array.isArray(l)){let He,uo=Yg(K.current.fields);await l.reduce(async(mo,jn)=>{await mo,He=await jn({formState:uo})},Promise.resolve());let ko=Object.entries(He).every(([,mo])=>mo.valid!==!1);if(z(ko),!ko)return Z(!1),Fe(!0),B(!1),H({type:"REPLACE_STATE",state:He})}let Ct=Ye||f?!0:await K.current.validateForm();if(z(Ct),!Ct){Qe(E("error:correctInvalidFields")),Z(!1),Fe(!0),B(!1);return}let lo={};if(typeof je=="function"?lo=je(K.current.fields):typeof je=="object"&&(lo=je),v){let He=Yg(K.current.fields),uo=Zg(He,!0);for(let[ko,mo]of Object.entries(lo))uo[ko]=mo;v(He,uo)}if(!_o){Z(!1),Fe(!0),B(!1);return}let co=await K.current.createFormData(lo,{mergeOverrideData:typeof je!="function"});try{let He;if(typeof he=="string"?He=await Ke[Pe.toLowerCase()](he,{body:co,headers:{"Accept-Language":R.language}}):typeof i=="function"&&(He=await i(co)),ee(!1),B(!1),typeof h=="function"){h(He,Ze,Qe);return}let uo=He.headers.get("content-type"),ko=uo&&uo.indexOf("application/json")!==-1,mo={};if(ko&&(mo=await He.json()),He.status<400){if(typeof C=="function"){let jn=await C(mo);if(jn){let{newState:Ri}=Ug({acceptValues:!0,existingState:K.current.fields||{},incomingState:jn});H({type:"REPLACE_STATE",optimize:!1,state:Ri})}}Fe(!1),Z(!1),y?j(()=>D.push(y)):d||Ze(mo.message||E("general:submissionSuccessful"))}else{if(Z(!1),Fe(!0),K.current={...K.current},mo.message){Qe(mo.message);return}if(Array.isArray(mo.errors)){let[Ri,X_]=mo.errors.reduce(([Tf,U_],mu)=>{let U1=[],Af=[];return mu?.message&&Af.push(mu),Array.isArray(mu?.data?.errors)&&mu.data?.errors.forEach(Ff=>{Ff?.path?U1.push(Ff):Af.push(Ff)}),[[...Tf,...U1],[...U_,...Af]]},[[],[]]);z(!1),H({type:"ADD_SERVER_ERRORS",errors:Ri}),X_.forEach(Tf=>{Qe($r(q3,{errorMessage:Tf.message||E("error:unknown")}))});return}let jn=oI?.[He.status]||He?.statusText||E("error:unknown");Qe(jn)}}catch(He){console.error("Error submitting form",He),Z(!1),Fe(!0),B(!1),Qe(He.message)}},[l,j,i,d,f,O,H,h,_,v,C,y,D,E,R,A]),Ne=or(()=>K.current.fields,[]),qe=or(J=>K.current.fields[J],[]),Ue=or(()=>Zg(K.current.fields,!0),[]),ke=or(J=>l$(K.current.fields,J),[]),ot=or(J=>a$(K.current.fields,J),[]),Ft=or(async(J,{mergeOverrideData:te=!0})=>{let he=Zg(K.current.fields,!0),Pe=he?.file;Pe&&delete he.file,te?he={...he,...J}:he=J;let je=V({collectionSlug:o});if(Pe&&typeof je=="function"){let Ze=Pe.name,_t=await je({file:Pe,updateFilename:_o=>{Ze=_o}});Pe=JSON.stringify({clientUploadContext:_t,collectionSlug:o,filename:Ze,mimeType:Pe.type,size:Pe.size})}let Ye={_payload:JSON.stringify(he),file:Pe};return(0,aI.serialize)(Ye,{indices:!0,nullsAsUndefineds:!1})},[o,V]),Wt=or(async J=>{let te=er(_e),he=await r(),{state:Pe}=await P({id:e,collectionSlug:o,data:J,docPermissions:n,docPreferences:he,globalSlug:s,locale:S,operation:k,renderAllFields:!0,schemaPath:o||s,signal:te.signal,skipValidation:!0});K.current={...Sm},ee(!1),H({type:"REPLACE_STATE",state:Pe}),_e.current=null},[o,H,s,e,k,P,n,r,S]),mt=or(J=>{K.current={...Sm},ee(!1),H({type:"REPLACE_STATE",state:J})},[H]),ze=or(({blockType:J,path:te,rowIndex:he,subFieldState:Pe})=>{let je=ot(te)||[],Ye=he===void 0?je.length:he;H({type:"ADD_ROW",blockType:J,path:te,rowIndex:Ye,subFieldState:Pe}),ee(!0)},[H,ot]),rt=or(({path:J,rowIndex:te})=>{H({type:"REMOVE_ROW",path:J,rowIndex:te})},[H]),ue=or(({blockType:J,path:te,rowIndex:he,subFieldState:Pe})=>{let je=ot(te),Ye=he===void 0?je.length:he;H({type:"REPLACE_ROW",blockType:J,path:te,rowIndex:Ye,subFieldState:Pe}),ee(!0)},[H,ot]);si(()=>{let J=_e.current;return()=>{Ko(J)}},[]),si(()=>{b!==void 0&&me(b)},[b]),K.current.submit=De,K.current.getFields=Ne,K.current.getField=qe,K.current.getData=Ue,K.current.getSiblingData=ke,K.current.getDataByPath=ot,K.current.validateForm=le,K.current.createFormData=Ft,K.current.setModified=ee,K.current.setProcessing=Z,K.current.setBackgroundProcessing=ge,K.current.setSubmitted=Fe,K.current.setIsValid=z,K.current.disabled=O,K.current.setDisabled=B,K.current.formRef=Le,K.current.reset=Wt,K.current.replaceState=mt,K.current.dispatchFields=H,K.current.addFieldRow=ze,K.current.removeFieldRow=rt,K.current.replaceFieldRow=ue,K.current.uuid=w,K.current.initializing=re,K.current.isValid=q,si(()=>{Y(!0)},[]),si(()=>{typeof u=="boolean"&&B(u)},[u]),si(()=>{typeof I=="boolean"&&Fe(I)},[I]),si(()=>{p&&(K.current={...Sm},H({type:"REPLACE_STATE",optimize:!1,sanitize:!0,state:p}))},[p,H]),$s(()=>{F()},15e3,[ne]),si(()=>{K.current={...K.current},ee(!1)},[S]);let ve=[c,m$].filter(Boolean).join(" "),Ve=Jt(async(J,te)=>{if(Array.isArray(x)){let he=K.current.fields;for(let Ye of x){if(te.aborted)return;he=await Ye({formState:Yg(K.current.fields),submitted:J})}if(!he)return;let{changed:Pe,newState:je}=Ug({existingState:K.current.fields||{},incomingState:he});Pe&&!te.aborted&&(U.current=je,H({type:"REPLACE_STATE",optimize:!1,state:je}))}});Wg(()=>{(pe.current||!iI(ne,U.current))&&X&&N(async J=>Ve(Ie,J)),U.current=ne,pe.current=!1},[X,Ie,ne,N],250);let Ge=g?yu:u$.Fragment,$e=g?{value:K.current}:{};return $r(m||"form",{action:typeof i=="function"?void 0:i,className:ve,method:_,noValidate:!0,onSubmit:J=>void K.current.submit({},J),ref:Le,children:$r(Ge,{...$e,children:$r(Cu,{value:K.current,children:$r(wu,{value:{fields:ne,...K.current},children:$r(Iu,{value:Ie,children:$r(Hf,{value:!G||G&&re,children:$r(Su,{value:se,children:$r(zf,{value:Q,children:$r(Ru,{value:X,children:$r(Za.Provider,{value:ce,children:a})})})})})})})})})})};import{c as f$}from"react/compiler-runtime";import{jsx as lI,jsxs as cI}from"react/jsx-runtime";import{getTranslation as p$}from"@payloadcms/translations";import{tabHasName as uI}from"payload/shared";import h$,{useState as g$}from"react";var Rm="tabs-field__tab-button",Jg=t=>{let e=f$(15),{hidden:o,isActive:n,parentPath:r,setIsActive:s,tab:i}=t,{i18n:l}=$(),[a,c]=g$(void 0),u;if(e[0]!==a||e[1]!==o||e[2]!==l||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i){let d=[...r?r.split(".").slice(0,-1):[],...uI(i)?[i.name]:[]],f=a>0,m=lI(zs,{fields:i.fields,path:d,setErrorCount:c}),h=f&&`${Rm}--has-error`,p=n&&`${Rm}--active`,g=o&&`${Rm}--hidden`,b;e[8]!==h||e[9]!==p||e[10]!==g?(b=[Rm,h,p,g].filter(Boolean),e[8]=h,e[9]=p,e[10]=g,e[11]=b):b=e[11];let x;e[12]!==l||e[13]!==i?(x=i.label?p$(i.label,l):uI(i)?i.name:"",e[12]=l,e[13]=i,e[14]=x):x=e[14],u=cI(h$.Fragment,{children:[m,cI("button",{className:b.join(" "),onClick:s,type:"button",children:[x,f&&lI(to,{count:a,i18n:l})]})]}),e[0]=a,e[1]=o,e[2]=l,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=u}else u=e[7];return u};var Rn="tabs-field";function ga({activeTabConfig:t,path:e}){let o=e;return _m(t)&&t.name&&(e?o=`${e}.${t.name}`:o=t.name),o}var x$=t=>{let e=mI(89),{field:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:l,permissions:a,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,x=s===void 0?"":s,v=i===void 0?"":i,C=l===void 0?"":l,{getPreference:y,setPreference:I}=Do(),{preferencesKey:w}=Ae(),{i18n:A}=$(),{isWithinCollapsible:_}=Un(),D;e[4]!==p?(D=ce=>{let[ne]=ce;return p.map((H,U)=>{let le=H?.id;return{index:U,passesCondition:ne?.[le]?.passesCondition??!0,tab:H}})},e[4]=p,e[5]=D):D=e[5];let T=Et(D),S;e[6]!==T?(S=()=>T.filter(y$)?.[0]?.index??0,e[6]=T,e[7]=S):S=e[7];let[R,E]=qg(S),F=`tabs-${b}`,L;e[8]!==R||e[9]!==x||e[10]!==p?(L=()=>ga({activeTabConfig:p[R],path:x}),e[8]=R,e[9]=x,e[10]=p,e[11]=L):L=e[11];let[k,N]=qg(L),P;e[12]!==v||e[13]!==p?(P=()=>ga({activeTabConfig:p[0],path:v}),e[12]=v,e[13]=p,e[14]=P):P=e[14];let[j,V]=qg(P),M;e[15]!==R||e[16]!==k||e[17]!==x||e[18]!==p?(M=_m(p[R])?k:x,e[15]=R,e[16]=k,e[17]=x,e[18]=p,e[19]=M):M=e[19];let O=M,B=T[R],G=B?.tab,Y;e[20]!==R||e[21]!==j||e[22]!==v||e[23]!==p?(Y=_m(p[R])?j:v,e[20]=R,e[21]=j,e[22]=v,e[23]=p,e[24]=Y):Y=e[24];let X=Y,ee=G.admin?.description??G.description,q;e[25]!==ee||e[26]!==A?(q=typeof ee=="function"?ee({i18n:A,t:A.t}):ee,e[25]=ee,e[26]=A,e[27]=q):q=e[27];let z=q,re=T.some(w$),me;e[28]!==y||e[29]!==x||e[30]!==v||e[31]!==C||e[32]!==w||e[33]!==I||e[34]!==p||e[35]!==F?(me=async ce=>{E(ce),N(ga({activeTabConfig:p[ce],path:x})),V(ga({activeTabConfig:p[ce],path:v}));let ne=await y(w);w&&I(w,{...ne,...C?{fields:{...ne?.fields||{},[C]:{...ne?.fields?.[C],tabIndex:ce}}}:{fields:{...ne?.fields,[F]:{...ne?.fields?.[F],tabIndex:ce}}}})},e[28]=y,e[29]=x,e[30]=v,e[31]=C,e[32]=w,e[33]=I,e[34]=p,e[35]=F,e[36]=me):me=e[36];let se=me,Z,Q;e[37]!==y||e[38]!==x||e[39]!==v||e[40]!==C||e[41]!==w||e[42]!==p||e[43]!==F?(Z=()=>{w&&(async()=>{let ne=await y(w),U=(C?ne?.fields?.[C]?.tabIndex:ne?.fields?.[F]?.tabIndex)||0;E(U),N(ga({activeTabConfig:p[U],path:x})),V(ga({activeTabConfig:p[U],path:v}))})()},Q=[C,y,w,F,p,x,v],e[37]=y,e[38]=x,e[39]=v,e[40]=C,e[41]=w,e[42]=p,e[43]=F,e[44]=Z,e[45]=Q):(Z=e[44],Q=e[45]),dI(Z,Q);let ge;e[46]!==B?.passesCondition||e[47]!==se||e[48]!==T?(ge=()=>{if(B?.passesCondition===!1){let ce=T.find(I$);ce&&se(ce.index)}},e[46]=B?.passesCondition,e[47]=se,e[48]=T,e[49]=ge):ge=e[49];let Ie;e[50]!==B||e[51]!==se||e[52]!==T?(Ie=[B,T,se],e[50]=B,e[51]=se,e[52]=T,e[53]=Ie):Ie=e[53],dI(ge,Ie);let Fe=_&&`${Rn}--within-collapsible`,Le=!re&&`${Rn}--hidden`,K;e[54]!==m||e[55]!==Fe||e[56]!==Le?(K=[Ce,m,Rn,Fe,Le].filter(Boolean),e[54]=m,e[55]=Fe,e[56]=Le,e[57]=K):K=e[57];let _e=K.join(" "),pe;if(e[58]!==O||e[59]!==X||e[60]!==G||e[61]!==R||e[62]!==B||e[63]!==k||e[64]!==z||e[65]!==g||e[66]!==se||e[67]!==b||e[68]!==C||e[69]!==a||e[70]!==c||e[71]!==_e||e[72]!==T){let ce;e[74]!==R||e[75]!==se||e[76]!==C?(ce=H=>{let{index:U,passesCondition:le,tab:De}=H;return Sn(Jg,{hidden:!le,isActive:R===U,parentPath:C,setIsActive:()=>{se(U)},tab:De},U)},e[74]=R,e[75]=se,e[76]=C,e[77]=ce):ce=e[77];let ne;e[78]!==O||e[79]!==X||e[80]!==G||e[81]!==B||e[82]!==k||e[83]!==z||e[84]!==g||e[85]!==b||e[86]!==a||e[87]!==c?(ne=G&&Sn(C$,{description:z,fields:G.fields,forceRender:g,hidden:!1,parentIndexPath:_m(G)?"":`${b?b+"-":""}`+String(B.index),parentPath:O,parentSchemaPath:X,path:k,permissions:a&&typeof a=="object"&&"name"in G?a[G.name]&&typeof a[G.name]=="object"&&"fields"in a[G.name]?a[G.name].fields:a[G.name]:a,readOnly:c}),e[78]=O,e[79]=X,e[80]=G,e[81]=B,e[82]=k,e[83]=z,e[84]=g,e[85]=b,e[86]=a,e[87]=c,e[88]=ne):ne=e[88],pe=Sn("div",{className:_e,children:fI(Kh,{children:[Sn("div",{className:`${Rn}__tabs-wrap`,children:Sn("div",{className:`${Rn}__tabs`,children:T.map(ce)})}),Sn("div",{className:`${Rn}__content-wrap`,children:ne})]})}),e[58]=O,e[59]=X,e[60]=G,e[61]=R,e[62]=B,e[63]=k,e[64]=z,e[65]=g,e[66]=se,e[67]=b,e[68]=C,e[69]=a,e[70]=c,e[71]=_e,e[72]=T,e[73]=pe}else pe=e[73];return pe},xc=Oe(x$);function C$(t){let e=mI(21),{description:o,fields:n,forceRender:r,hidden:s,label:i,parentIndexPath:l,parentPath:a,parentSchemaPath:c,path:u,permissions:d,readOnly:f}=t,{i18n:m}=$(),h;e[0]!==u?(h={path:u},e[0]=u,e[1]=h):h=e[1];let{customComponents:p}=Te(h),g;e[2]!==p?(g=p===void 0?{}:p,e[2]=p,e[3]=g):g=e[3];let{AfterInput:b,BeforeInput:x,Description:v,Field:C}=g;if(C)return C;let y=s&&`${Rn}__tab--hidden`,I=i&&`${Rn}__tabConfigLabel-${v$(b$(i,m))}`,w;e[4]!==y||e[5]!==I?(w=[y,`${Rn}__tab`,I].filter(Boolean),e[4]=y,e[5]=I,e[6]=w):w=e[6];let A=w.join(" "),_;return e[7]!==b||e[8]!==x||e[9]!==v||e[10]!==o||e[11]!==n||e[12]!==r||e[13]!==l||e[14]!==a||e[15]!==c||e[16]!==u||e[17]!==d||e[18]!==f||e[19]!==A?(_=fI("div",{className:A,children:[Sn(oe,{CustomComponent:v,Fallback:Sn(We,{description:o,marginPlacement:"bottom",path:u})}),x,Sn(yo,{fields:n,forceRender:r,parentIndexPath:l,parentPath:a,parentSchemaPath:c,permissions:d,readOnly:f}),b]}),e[7]=b,e[8]=x,e[9]=v,e[10]=o,e[11]=n,e[12]=r,e[13]=l,e[14]=a,e[15]=c,e[16]=u,e[17]=d,e[18]=f,e[19]=A,e[20]=_):_=e[20],_}function y$(t){let{passesCondition:e}=t;return e}function w$(t){let{passesCondition:e}=t;return e}function I$(t){let{passesCondition:e}=t;return e}import{jsx as T$}from"react/jsx-runtime";import{useCallback as hI,useEffect as A$,useMemo as F$,useState as E$}from"react";import{c as S$}from"react/compiler-runtime";import{jsx as ls,jsxs as pI}from"react/jsx-runtime";import{getTranslation as R$}from"@payloadcms/translations";import"react";var Qg=t=>{let e=S$(31),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:l,hasMany:a,inputRef:c,Label:u,label:d,localized:f,maxRows:m,onChange:h,onKeyDown:p,path:g,placeholder:b,readOnly:x,required:v,rtl:C,showError:y,style:I,value:w,valueToRender:A}=t,{i18n:_,t:D}=$(),T=D$,S=y&&"error",R=x&&"read-only",E=a&&"has-many",F;e[0]!==r||e[1]!==S||e[2]!==R||e[3]!==E?(F=[Ce,"text",r,S,R,E].filter(Boolean),e[0]=r,e[1]=S,e[2]=R,e[3]=E,e[4]=F):F=e[4];let L=F.join(" "),k;return e[5]!==o||e[6]!==n||e[7]!==s||e[8]!==l||e[9]!==u||e[10]!==i||e[11]!==a||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]!==x||e[22]!==v||e[23]!==C||e[24]!==y||e[25]!==I||e[26]!==D||e[27]!==L||e[28]!==w||e[29]!==A?(k=pI("div",{className:L,style:I,children:[ls(oe,{CustomComponent:u,Fallback:ls(be,{label:d,localized:f,path:g,required:v})}),pI("div",{className:`${Ce}__wrap`,children:[ls(oe,{CustomComponent:l,Fallback:ls(Xe,{path:g,showError:y})}),n,a?ls(yt,{className:`field-${g.replace(/\./g,"__")}`,components:{DropdownIndicator:null},customProps:{editableProps:T},disabled:x,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?D("validation:limitReached",{max:m,value:w.length+1}):null,onChange:h,options:[],placeholder:D("general:enterAValue"),showError:y,value:A}):ls("input",{"data-rtl":C,disabled:x,id:`field-${g?.replace(/\./g,"__")}`,name:g,onChange:h,onKeyDown:p,placeholder:R$(b,_),ref:c,type:"text",value:w||""}),o,ls(oe,{CustomComponent:s,Fallback:ls(We,{description:i,path:g})})]})]}),e[5]=o,e[6]=n,e[7]=s,e[8]=l,e[9]=u,e[10]=i,e[11]=a,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]=x,e[22]=v,e[23]=C,e[24]=y,e[25]=I,e[26]=D,e[27]=L,e[28]=w,e[29]=A,e[30]=k):k=e[30],k};function _$(t){t.currentTarget.contentEditable="false"}function D$(t,e,o){let n=`${e}--editable`;return{onBlur:_$,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 P$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rtl:s}={},hasMany:i,label:l,localized:a,maxLength:c,maxRows:u,minLength:d,minRows:f,required:m},inputRef:h,path:p,readOnly:g,validate:b}=t,x=Ee(),{config:{localization:v}}=W(),C=hI((P,j)=>{if(typeof b=="function")return b(P,{...j,maxLength:c,minLength:d,required:m})},[b,d,c,m]),{customComponents:{AfterInput:y,BeforeInput:I,Description:w,Error:A,Label:_}={},disabled:D,setValue:T,showError:S,value:R}=Te({path:p,validate:C}),E=Vi({fieldLocalized:a,fieldRTL:s,locale:x,localizationConfig:v||void 0}),[F,L]=E$([]),k=hI(P=>{if(!(g||D)){let j;P?Array.isArray(P)?j=P.map(V=>V.value?.value||V.value):j=[P.value?.value||P.value]:j=[],T(j)}},[g,T,D]);A$(()=>{i&&Array.isArray(R)&&L(R.map((P,j)=>({id:`${P}${j}`,label:`${P}`,value:{toString:()=>`${P}${j}`,value:P?.value||P}})))},[R,i]);let N=F$(()=>nt(e),[e]);return T$(Qg,{AfterInput:y,BeforeInput:I,className:o,Description:w,description:n,Error:A,hasMany:i,inputRef:h,Label:_,label:l,localized:a,maxRows:u,minRows:f,onChange:i?k:P=>{T(P.target.value)},path:p,placeholder:r,readOnly:g||D,required:m,rtl:E,showError:S,style:N,value:R||"",valueToRender:F})},ii=Oe(P$);import{jsx as k$}from"react/jsx-runtime";import{getTranslation as $$}from"@payloadcms/translations";import{useCallback as j$,useMemo as O$}from"react";import{c as N$}from"react/compiler-runtime";import{jsx as cs,jsxs as gI}from"react/jsx-runtime";import{getTranslation as L$}from"@payloadcms/translations";import"react";var Kg=t=>{let e=N$(25),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:l,Label:a,label:c,localized:u,onChange:d,path:f,placeholder:m,readOnly:h,required:p,rows:g,rtl:b,showError:x,style:v,value:C}=t,{i18n:y}=$(),I=x&&"error",w=h&&"read-only",A;e[0]!==r||e[1]!==I||e[2]!==w?(A=[Ce,"textarea",r,I,w].filter(Boolean),e[0]=r,e[1]=I,e[2]=w,e[3]=A):A=e[3];let _=A.join(" "),D;return e[4]!==o||e[5]!==n||e[6]!==s||e[7]!==l||e[8]!==a||e[9]!==i||e[10]!==y||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]!==x||e[21]!==v||e[22]!==_||e[23]!==C?(D=gI("div",{className:_,style:v,children:[cs(oe,{CustomComponent:a,Fallback:cs(be,{label:c,localized:u,path:f,required:p})}),gI("div",{className:`${Ce}__wrap`,children:[cs(oe,{CustomComponent:l,Fallback:cs(Xe,{path:f,showError:x})}),n,cs("label",{className:"textarea-outer",htmlFor:`field-${f.replace(/\./g,"__")}`,children:cs("textarea",{"data-rtl":b,disabled:h,id:`field-${f.replace(/\./g,"__")}`,name:f,onChange:d,placeholder:L$(m,y),rows:g,value:C||""})}),o,cs(oe,{CustomComponent:s,Fallback:cs(We,{description:i,path:f})})]})]}),e[4]=o,e[5]=n,e[6]=s,e[7]=l,e[8]=a,e[9]=i,e[10]=y,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]=x,e[21]=v,e[22]=_,e[23]=C,e[24]=D):D=e[24],D};var M$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rows:s,rtl:i}={},label:l,localized:a,maxLength:c,minLength:u,required:d},path:f,readOnly:m,validate:h}=t,{i18n:p}=$(),{config:{localization:g}}=W(),b=Ee(),x=Vi({fieldLocalized:a,fieldRTL:i,locale:b,localizationConfig:g||void 0}),v=j$((E,F)=>{if(typeof h=="function")return h(E,{...F,maxLength:c,minLength:u,required:d})},[h,d,c,u]),{customComponents:{AfterInput:C,BeforeInput:y,Description:I,Error:w,Label:A}={},disabled:_,setValue:D,showError:T,value:S}=Te({path:f,validate:v}),R=O$(()=>nt(e),[e]);return k$(Kg,{AfterInput:C,BeforeInput:y,className:o,Description:I,description:n,Error:w,Label:A,label:l,localized:a,onChange:E=>{D(E.target.value)},path:f,placeholder:$$(r,p),readOnly:m||_,required:d,rows:s,rtl:x,showError:T,style:R,value:S})},Cc=Oe(M$);var yc=()=>null;import{jsx as CO}from"react/jsx-runtime";import yO,{useMemo as wO}from"react";import{jsx as kt,jsxs as mi,Fragment as jc}from"react/jsx-runtime";import*as DS from"qs-esm";import Vr,{useCallback as SS,useEffect as RS,useMemo as _S}from"react";import{c as uS}from"react/compiler-runtime";import{jsx as ci,jsxs as eO}from"react/jsx-runtime";import{validateMimeType as tO}from"payload/shared";import Kr from"react";import{jsx as Tm,jsxs as eb}from"react/jsx-runtime";import X$ from"react";import{jsx as B$}from"react/jsx-runtime";import us from"react";var bI=t=>{t.preventDefault(),t.stopPropagation()},V$="dropzone";function ai({children:t,className:e,disabled:o=!1,dropzoneStyle:n="default",multipleFiles:r,onChange:s}){let i=us.useRef(null),[l,a]=us.useState(!1),c=us.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=us.useCallback(p=>{p.preventDefault(),p.stopPropagation(),p.clipboardData.files&&p.clipboardData.files.length>0&&c(p.clipboardData.files)},[c]),d=us.useCallback(p=>{p.preventDefault(),p.stopPropagation(),a(!0)},[]),f=us.useCallback(p=>{p.preventDefault(),p.stopPropagation(),a(!1)},[]),m=us.useCallback(p=>{p.preventDefault(),p.stopPropagation(),a(!1),p.dataTransfer.files&&p.dataTransfer.files.length>0&&(c(p.dataTransfer.files),a(!1),p.dataTransfer.clearData())},[c]);us.useEffect(()=>{let p=i.current;return p&&!o?(p.addEventListener("dragenter",d),p.addEventListener("dragleave",f),p.addEventListener("dragover",bI),p.addEventListener("drop",m),p.addEventListener("paste",u),()=>{p.removeEventListener("dragenter",d),p.removeEventListener("dragleave",f),p.removeEventListener("dragover",bI),p.removeEventListener("drop",m),p.removeEventListener("paste",u)}):()=>null},[o,d,f,m,u]);let h=[V$,e,l?"dragging":"",`dropzoneStyle--${n}`].filter(Boolean).join(" ");return B$("div",{className:h,ref:i,children:t})}import{jsx as xI,jsxs as z$}from"react/jsx-runtime";import"react";import{c as G$}from"react/compiler-runtime";import{jsx as vI}from"react/jsx-runtime";import"react";var W$="drawer-close-button";function Dm(t){let e=G$(3),{onClick:o}=t,{t:n}=$(),r;return e[0]!==o||e[1]!==n?(r=vI("button",{"aria-label":n("general:close"),className:W$,onClick:o,type:"button",children:vI(pt,{})}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r}var H$="bulk-upload--drawer-header";function ba({onClose:t,title:e}){return z$("div",{className:H$,children:[xI("h2",{title:e,children:e}),xI(Dm,{onClick:t})]})}var Am="bulk-upload--add-files";function Fm({acceptMimeTypes:t,onCancel:e,onDrop:o}){let{t:n}=$(),r=X$.useRef(null);return eb("div",{className:Am,children:[Tm(ba,{onClose:e,title:n("upload:addFiles")}),Tm("div",{className:`${Am}__dropArea`,children:eb(ai,{multipleFiles:!0,onChange:o,children:[Tm(ae,{buttonStyle:"pill",iconPosition:"left",onClick:()=>{r.current&&r.current.click()},size:"small",children:n("upload:selectFile")}),Tm("input",{accept:t,"aria-hidden":"true",className:`${Am}__hidden-input`,hidden:!0,multiple:!0,onChange:s=>{s.target.files&&s.target.files.length>0&&o(s.target.files)},ref:r,type:"file"}),eb("p",{className:`${Am}__dragAndDropText`,children:[n("general:or")," ",n("upload:dragAndDrop")]})]})})]})}import{c as qj}from"react/compiler-runtime";import{jsx as Lc,jsxs as pb}from"react/jsx-runtime";import{getTranslation as Qj}from"@payloadcms/translations";import{reduceFieldsToValues as Kj}from"payload/shared";import"react";import{c as kI}from"react/compiler-runtime";import{jsx as Or,jsxs as Ic}from"react/jsx-runtime";import"react";import{c as dj}from"react/compiler-runtime";import{jsx as Lm,jsxs as mj}from"react/jsx-runtime";import"react";import{jsx as Y$,jsxs as Z$}from"react/jsx-runtime";import{isImage as J$}from"payload/shared";import*as tb from"qs-esm";import lt from"react";var CI=t=>new Promise((e,o)=>{let n=new Image;n.src=URL.createObjectURL(t),n.onload=()=>{let s,i,l=n.width/n.height;l>1?(i=280,s=280/l):(i=280*l,s=280);let a=new OffscreenCanvas(i,s);a.getContext("2d").drawImage(n,0,0,i,s),a.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 yI=Is(Gg(),1);import{reduceFieldsToValues as U$}from"payload/shared";async function wI(t={},e={},o,n){let r=U$(t,!0),s=r?.file;if(s&&delete r.file,s&&typeof n=="function"){let a=s.name,c=await n({file:s,updateFilename:u=>{a=u}});s=JSON.stringify({clientUploadContext:c,collectionSlug:o,filename:a,mimeType:s.type,size:s.size})}let i={...r,...e},l={_payload:JSON.stringify(i),file:s};return(0,yI.serialize)(l,{indices:!0,nullsAsUndefineds:!1})}function II(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]}}};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}},{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}default:return t}}var SI=lt.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}),q$={activeIndex:0,forms:[],totalErrorCount:0};function RI({children:t}){let{config:e}=W(),{routes:{api:o},serverURL:n}=e,{code:r}=Ee(),{i18n:s,t:i}=$(),{getDocumentSlots:l,getFormState:a}=Dt(),{getUploadHandler:c}=gc(),[u,d]=lt.useState({}),[f,m]=lt.useState(!1),[h,p]=lt.useState(),[g,b]=lt.useState(!1),[x,v]=lt.useState(!1),[C,y]=lt.useState(!1),[I,w]=lt.useState(!1),[A,_]=lt.useState(!1),[D,T]=lt.useReducer(II,q$),{activeIndex:S,forms:R,totalErrorCount:E}=D,F=lt.useRef(R);F.current=R;let L=R.length,k=lt.useRef([]),N=lt.useRef(new Set),[P,j]=lt.useState([]);lt.useEffect(()=>{(async()=>{let ne=[...k.current];for(let H=0;H<L;H++){let U=F.current[H].formState.file.value;if(N.current.has(U)||!U||!J$(U.type))continue;N.current.add(U);let le=await CI(U);ne[H]=le,k.current=ne,j([...ne]),await new Promise(De=>setTimeout(De,100))}})()},[L]);let{toggleLoadingOverlay:V}=rm(),{closeModal:M}=de(),{collectionSlug:O,drawerSlug:B,initialFiles:G,onSuccess:Y}=Wo(),[X,ee]=lt.useState(!1),[q,z]=lt.useState(""),re=lt.useRef(!1),me=lt.useRef(null),se=lt.useRef(()=>({})),Z=`${o}/${O}`,Q=lt.useCallback(async()=>{let ne={locale:r||void 0},H=`/${O}/access`,le=await(await fetch(`${n}${o}${H}?${tb.stringify(ne)}`,{credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"post"})).json(),De=await fetch(`${n}${o}${H}?${tb.stringify(ne)}`,{body:JSON.stringify({_status:"published"}),credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"POST"}).then(Ne=>Ne.json());p(le),b(ul({collectionSlug:O,docPermissions:le,isEditing:!1})),v(De?.update),w(!0)},[o,r,O,s.language,n]),ge=lt.useCallback(async ne=>{ne?.signal&&ne.abort("aborting previous fetch for initial form state without files");let H=await l({collectionSlug:O});d(H);try{let{state:U}=await a({collectionSlug:O,docPermissions:h,docPreferences:{fields:{}},locale:r,operation:"create",renderAllFields:!0,schemaPath:O,skipValidation:!0});me.current=U,y(!0)}catch{}},[l,O,a,h,r]),Ie=lt.useCallback(ne=>{let H=se.current();T({type:"REPLACE",state:{activeIndex:ne,forms:R.map((U,le)=>le===S?{errorCount:U.errorCount,formState:H}:U)}})},[R,S]),Fe=lt.useCallback(async ne=>{V({isLoading:!0,key:"addingDocs"}),C||await ge(),T({type:"ADD_FORMS",files:ne,initialState:me.current}),V({isLoading:!1,key:"addingDocs"})},[ge,C,V]),Le=lt.useCallback(ne=>{k.current=k.current.filter((H,U)=>!ne.includes(U)),j([...k.current])},[]),K=lt.useCallback(ne=>{T({type:"REMOVE_FORM",index:ne}),Le([ne])},[Le]),_e=lt.useCallback(({errorCount:ne,index:H})=>{T({type:"UPDATE_ERROR_COUNT",count:ne,index:H})},[]),pe=lt.useCallback(async({overrides:ne}={})=>{let H=se.current(),U=[...R];U[S]={errorCount:U[S].errorCount,formState:H};let le=[];ee(!0);for(let ke=0;ke<U.length;ke++)try{let ot=U[ke];z(i("general:uploadingBulk",{current:ke+1,total:U.length}));let Ft=await fetch(Z,{body:await wI(ot.formState,ne,O,c({collectionSlug:O})),method:"POST"}),Wt=await Ft.json();Ft.status===201&&Wt?.doc&&le.push(Wt.doc);let[mt,ze]=(Wt?.errors||[]).reduce(([rt,ue],ve)=>{let Ve=[],Ge=[];return ve?.message&&Ge.push(ve),Array.isArray(ve?.data?.errors)&&ve.data?.errors.forEach($e=>{$e?.path?Ve.push($e):Ge.push($e)}),[[...rt,...Ve],[...ue,...Ge]]},[[],[]]);U[ke]={errorCount:mt.length,formState:bc(U[ke].formState,{type:"ADD_SERVER_ERRORS",errors:mt})},(Ft.status===413||Ft.status===400)&&(U[ke]={...U[ke],errorCount:U[ke].errorCount+1},fe.error(ze[0]?.message))}catch{}m(!0),z(""),ee(!1);let De=[],Ne=[];U.forEach(({errorCount:ke},ot)=>{ke?De.push(U[ot]):Ne.push(ot)});let qe=Math.max(0,U.length-De.length),Ue=U.length-qe;qe&&(fe.success(`Successfully saved ${qe} files`),typeof Y=="function"&&Y(le,Ue),De.length&&Ne.length&&Le(Ne)),Ue?fe.error(`Failed to save ${Ue} files`):M(B),T({type:"REPLACE",state:{activeIndex:0,forms:De,totalErrorCount:De.reduce((ke,{errorCount:ot})=>ke+ot,0)}})},[Z,S,R,Le,Y,O,c,i,M,B]),ce=lt.useCallback(async(ne,H)=>{for(let U=0;U<R.length;U++)if(Object.entries(ne).forEach(([le,De])=>{R[U].formState[le]&&(R[U].formState[le].value=De,T({type:"UPDATE_FORM",errorCount:R[U].errorCount,formState:R[U].formState,index:U}))}),typeof H=="function"&&H(),f){let{state:le}=await a({collectionSlug:O,docPermissions:h,docPreferences:null,formState:R[U].formState,operation:"create",schemaPath:O}),De=Object.values(le).reduce((Ne,qe)=>qe?.valid===!1?Ne+1:Ne,0);T({type:"UPDATE_FORM",errorCount:De,formState:le,index:U})}},[O,h,R,a,f]);return lt.useEffect(()=>{O&&(C||ge(),I||Q(),G&&_(!C||!I),C&&G&&!re.current&&(Fe(G),re.current=!0))},[Fe,G,ge,Q,O,C,I]),Z$(SI,{value:{activeIndex:D.activeIndex,addFiles:Fe,bulkUpdateForm:ce,collectionSlug:O,docPermissions:h,documentSlots:u,forms:R,getFormDataRef:se,hasPublishPermission:x,hasSavePermission:g,hasSubmitted:f,isInitializing:A,removeFile:K,saveAllDocs:pe,setActiveIndex:Ie,setFormTotalErrorCount:_e,thumbnailUrls:P,totalErrorCount:E},children:[X&&Y$(xn,{animationDuration:"250ms",loadingText:q,overlayType:"fullscreen",show:!0}),t]})}function wo(){return lt.use(SI)}import{jsx as jr,jsxs as ob}from"react/jsx-runtime";import{getTranslation as aj}from"@payloadcms/translations";import{unflatten as EI}from"payload/shared";import lj,{useCallback as rb,useEffect as cj,useMemo as uj,useState as PI}from"react";import{c as oj}from"react/compiler-runtime";import{jsx as FI,jsxs as rj}from"react/jsx-runtime";import{useState as nj}from"react";var _I=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 Q$,fieldHasSubFields as K$,fieldIsHiddenOrDisabled as ej,getFieldPermissions as tj}from"payload/shared";import{fieldAffectsData as DI}from"payload/shared";var va=(t,e)=>t?DI(e)?`${t}.${e.name}`:t:DI(e)?e.name:"";import{jsx as Em,jsxs as TI}from"react/jsx-runtime";import{Fragment as AI}from"react";var wc=({CustomLabel:t,field:e,prefix:o})=>TI(AI,{children:[o?TI(AI,{children:[Em("span",{style:{display:"inline-block"},children:o})," > "]}):null,Em("span",{style:{display:"inline-block"},children:Em(oe,{CustomComponent:t,Fallback:Em(be,{label:"label"in e&&e.label})})})]});var Pm=({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((l,a)=>{let{operation:c,permissions:u,read:d}=tj({field:a,operation:"update",parentName:n?.includes(".")?n.split(".")[n.split(".").length-1]:n,permissions:s});if((Q$(a)||a.type==="ui")&&(a.admin?.disableBulkEdit||a.unique||ej(a)||"readOnly"in a&&a.readOnly||!c||!d))return l;if(!(a.type==="array"||a.type==="blocks")&&K$(a))return[...l,...Pm({fields:a.fields,labelPrefix:wc({CustomLabel:i,field:a,prefix:o}),parentPath:r,path:va(r,a),permissions:u})];if(a.type==="tabs"&&"tabs"in a)return[...l,...a.tabs.reduce((m,h)=>{if("fields"in h){let p="name"in h&&h.name;return[...m,...Pm({fields:h.fields,labelPrefix:o,parentPath:r,path:p?va(r,a):r,permissions:u})]}},[])];let f={label:wc({CustomLabel:i,field:a,prefix:o}),value:{field:a,fieldPermissions:u,path:va(r,a)}};return[...l,f]},[])};var sj="field-select",Nm=t=>{let e=oj(14),{fields:o,onChange:n,permissions:r}=t,{t:s}=$(),{dispatchFields:i,getFields:l}=Me(),a;e[0]!==o||e[1]!==l||e[2]!==r?(a=()=>Pm({fields:_I(o),formState:l(),permissions:r}),e[0]=o,e[1]=l,e[2]=r,e[3]=a):a=e[3];let[c]=nj(a),u;if(e[4]!==i||e[5]!==l||e[6]!==n||e[7]!==c||e[8]!==s){let d;e[10]!==i||e[11]!==l||e[12]!==n?(d=f=>n({dispatchFields:i,formState:l(),selected:f}),e[10]=i,e[11]=l,e[12]=n,e[13]=d):d=e[13],u=rj("div",{className:sj,children:[FI(be,{label:s("fields:selectFieldsToEdit")}),FI(yt,{getOptionValue:ij,isMulti:!0,onChange:d,options:c})]}),e[4]=i,e[5]=l,e[6]=n,e[7]=c,e[8]=s,e[9]=u}else u=e[9];return u};function ij(t){return typeof t.value=="object"&&"path"in t.value?String(t.value.path):String(t.value)}var NI=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,forms:i}=t,[l,a]=PI(!1),{permissions:c}=Se(),{i18n:u,t:d}=$(),{closeModal:f}=de(),{bulkUpdateForm:m}=wo(),{getFormState:h}=Dt(),p=lj.useRef(null),[g,b]=PI([]),x=c?.collections?.[r.slug],v=uj(()=>EI(g.reduce((w,A)=>(w[A.value.path]=!0,w),{})),[g]),C=rb(async({formState:w,submitted:A})=>{let _=er(p),{state:D}=await h({collectionSlug:r.slug,docPermissions:x,docPreferences:null,formState:w,operation:"update",schemaPath:r.slug,select:v,signal:_.signal,skipValidation:!A});return p.current=null,D},[h,r,x,v]);cj(()=>{let w=p.current;return()=>{Ko(w)}},[]);let y=rb(w=>{let A=g.reduce((_,D)=>(w[D.value.path]&&(_[D.value.path]=w[D.value.path].value),_),{});m(A,()=>f(s))},[f,s,m,g]),I=rb(async({dispatchFields:w,formState:A,selected:_})=>{a(!0),b(_||[]);let{state:D}=await h({collectionSlug:r.slug,docPermissions:x,docPreferences:null,formState:A,operation:"update",schemaPath:r.slug,select:EI(_.reduce((T,S)=>(T[S.value.path]=!0,T),{})),skipValidation:!0});w({type:"UPDATE_MANY",formState:D}),a(!1)},[h,r,x]);return ob("div",{className:`${fr}__main`,children:[ob("div",{className:`${fr}__header`,children:[jr("h2",{className:`${fr}__header__title`,children:d("general:editingLabel",{count:i.length,label:aj(i.length>1?o:n,u)})}),jr("button",{"aria-label":d("general:close"),className:`${fr}__header__close`,id:`close-drawer__${s}`,onClick:()=>f(s),type:"button",children:jr(pt,{})})]}),ob(In,{className:`${fr}__form`,isInitializing:l,onChange:[C],onSubmit:y,children:[jr(Nm,{fields:e,onChange:I,permissions:x.fields}),g.length===0?null:jr("div",{className:"render-fields",children:g.map((w,A)=>{let{value:{field:_,fieldPermissions:D,path:T}}=w;return jr(xa,{clientFieldConfig:_,indexPath:"",parentPath:"",parentSchemaPath:"",path:T,permissions:D},`${T}-${A}`)})}),jr("div",{className:`${fr}__sidebar-wrap`,children:jr("div",{className:`${fr}__sidebar`,children:jr("div",{className:`${fr}__sidebar-sticky-wrap`,children:jr("div",{className:`${fr}__document-actions`,children:jr(ae,{type:"submit",children:d("general:applyChanges")})})})})})]})]})};var fr="edit-many-bulk-uploads",LI=t=>{let e=dj(5),{collection:o,collection:n}=t,{slug:r}=o===void 0?{}:o,{permissions:s}=Se(),{t:i}=$(),{forms:l}=wo(),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]!==l||e[3]!==i?(d=mj("div",{className:fr,children:[Lm(ar,{"aria-label":i("general:editAll"),className:`${fr}__toggle`,slug:u,children:i("general:editAll")}),Lm(As,{children:Lm(Pt,{Header:null,slug:u,children:Lm(NI,{collection:n,drawerSlug:u,forms:l})})})]}),e[0]=n,e[1]=u,e[2]=l,e[3]=i,e[4]=d):d=e[4],d};var Ca="bulk-upload--actions-bar";function $I(t){let e=kI(15),{collectionConfig:o}=t,{activeIndex:n,forms:r,setActiveIndex:s}=wo(),{t:i}=$(),l=n+1,a;if(e[0]!==n||e[1]!==o||e[2]!==r.length||e[3]!==s||e[4]!==i||e[5]!==l){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],a=Ic("div",{className:Ca,children:[Ic("div",{className:`${Ca}__navigation`,children:[Ic("p",{className:`${Ca}__locationText`,children:[Or("strong",{children:l})," of ",Or("strong",{children:r.length})]}),Ic("div",{className:`${Ca}__controls`,children:[Or(ae,{"aria-label":i("general:previous"),buttonStyle:"none",onClick:c,type:"button",children:Or(Je,{direction:"left"})}),Or(ae,{"aria-label":i("general:next"),buttonStyle:"none",onClick:u,type:"button",children:Or(Je,{direction:"right"})})]}),Or(LI,{collection:o})]}),Or(nb,{className:`${Ca}__saveButtons`})]}),e[0]=n,e[1]=o,e[2]=r.length,e[3]=s,e[4]=i,e[5]=l,e[6]=a}else a=e[6];return a}function nb(t){let e=kI(12),{className:o}=t,{getEntityConfig:n}=W(),{t:r}=$(),{collectionSlug:s,hasPublishPermission:i,hasSavePermission:l,saveAllDocs:a}=wo(),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=[`${Ca}__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]!==l||e[8]!==a||e[9]!==r||e[10]!==f?(m=Ic("div",{className:f,children:[u?.versions?.drafts&&l?Or(ae,{buttonStyle:"secondary",onClick:()=>void a({overrides:{_status:"draft"}}),children:r("version:saveDraft")}):null,u?.versions?.drafts&&i?Or(ae,{onClick:()=>void a({overrides:{_status:"published"}}),children:r("version:publish")}):null,!u?.versions?.drafts&&l?Or(ae,{onClick:()=>void a(),children:r("general:save")}):null]}),e[5]=u?.versions?.drafts,e[6]=i,e[7]=l,e[8]=a,e[9]=r,e[10]=f,e[11]=m):m=e[11],m}import{c as fj}from"react/compiler-runtime";import{jsx as pj}from"react/jsx-runtime";import"react";var Sc="bulk-upload--discard-without-saving";function jI(){let t=fj(9),{t:e}=$(),{closeModal:o}=de(),{drawerSlug:n}=Wo(),r;t[0]!==o?(r=()=>{o(Sc)},t[0]=o,t[1]=r):r=t[1];let s=r,i;t[2]!==o||t[3]!==n?(i=()=>{o(n),o(Sc)},t[2]=o,t[3]=n,t[4]=i):i=t[4];let l=i,a;return t[5]!==s||t[6]!==l||t[7]!==e?(a=pj(It,{body:e("general:changesNotSaved"),cancelLabel:e("general:stayOnThisPage"),confirmLabel:e("general:leaveAnyway"),heading:e("general:leaveWithoutSaving"),modalSlug:Sc,onCancel:s,onConfirm:l}),t[5]=s,t[6]=l,t[7]=e,t[8]=a):a=t[8],a}import{jsx as gs,jsxs as jj}from"react/jsx-runtime";import{useRouter as Oj,useSearchParams as Mj}from"next/navigation.js";import{formatAdminURL as Bj}from"payload/shared";import _a,{useCallback as sS,useEffect as Vj}from"react";import{c as hj}from"react/compiler-runtime";import{jsx as gj}from"react/jsx-runtime";import{createContext as bj,use as vj,useState as xj}from"react";var OI=bj({mostRecentUpdate:null,reportUpdate:t=>null}),sb=t=>{let e=hj(3),{children:o}=t,[n,r]=xj(null),s;return e[0]!==o||e[1]!==n?(s=gj(OI,{value:{mostRecentUpdate:n,reportUpdate:r},children:o}),e[0]=o,e[1]=n,e[2]=s):s=e[2],s},li=()=>vj(OI);import{jsx as ds,jsxs as MI}from"react/jsx-runtime";import{fieldIsSidebar as Cj}from"payload/shared";import{useMemo as yj}from"react";var pr="document-fields",Rc=({AfterFields:t,BeforeFields:e,Description:o,docPermissions:n,fields:r,forceSidebarWrap:s,readOnly:i,schemaPathSegments:l})=>{let{hasSidebarFields:a,mainFields:c,sidebarFields:u}=yj(()=>r.reduce((d,f)=>(Cj(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 MI("div",{className:[pr,a?`${pr}--has-sidebar`:`${pr}--no-sidebar`,s&&`${pr}--force-sidebar-wrap`].filter(Boolean).join(" "),children:[ds("div",{className:`${pr}__main`,children:MI(Bo,{className:`${pr}__edit`,children:[o?ds("header",{className:`${pr}__header`,children:ds("div",{className:`${pr}__sub-header`,children:o})}):null,e,ds(yo,{className:`${pr}__fields`,fields:c,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:l.join("."),permissions:n?.fields,readOnly:i}),t]})}),a?ds("div",{className:`${pr}__sidebar-wrap`,children:ds("div",{className:`${pr}__sidebar`,children:ds("div",{className:`${pr}__sidebar-fields`,children:ds(yo,{fields:u,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:l.join("."),permissions:n?.fields,readOnly:i})})})}):null]})};import{c as Nj}from"react/compiler-runtime";import{jsx as Rt,jsxs as gr}from"react/jsx-runtime";import{isImage as rS}from"payload/shared";import Pc,{Fragment as Lj,useCallback as Mm,useEffect as mb,useRef as oS,useState as Ec}from"react";import{jsx as St,jsxs as Eo}from"react/jsx-runtime";import jm,{useRef as Sa,useState as ps}from"react";import Mt,{PureComponent as wj,createRef as BI}from"react";var km={x:0,y:0,width:0,height:0,unit:"px"},ya=(t,e,o)=>Math.min(Math.max(t,e),o),Ij=(...t)=>t.filter(e=>e&&typeof e=="string").join(" "),VI=(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 wa(t,e,o){return t.unit==="%"?{...km,...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 ms(t,e,o){return t.unit?t.unit==="px"?{...km,...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}:{...km,...t,unit:"px"}}function GI(t,e,o,n,r,s=0,i=0,l=n,a=r){let c={...t},u=Math.min(s,n),d=Math.min(i,r),f=Math.min(l,n),m=Math.min(a,r);e&&(e>1?(u=i?i*e:u,d=u/e,f=l*e):(d=s?s/e:d,u=d*e,m=a/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 Sj(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 Ia={capture:!0,passive:!1},fs=class Mr extends wj{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=BI(),this.mediaRef=BI(),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=ms(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,l=!!i,a=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),a=u+r.x+h,c=d+r.y+p}this.evData={startClientX:a,startClientY:c,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:l,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,l=this.getBox();if(n||r||s&&o)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.clientX-l.x,c=e.clientY-l.y,u={unit:"px",x:a,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:a,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,i(ms(u,l.width,l.height),wa(u,l.width,l.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:l}=this;l.clientX=e.clientX,l.clientY=e.clientY;let a;l.isResize?a=this.resizeCrop():a=this.dragCrop(),VI(o,a)||r(ms(a,i.width,i.height),wa(a,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,l=!1;if(!o)return;let a=this.getBox(),c=this.makePixelCrop(a),u=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Mr.nudgeStepLarge:e.shiftKey?Mr.nudgeStepMedium:Mr.nudgeStep;if(i==="ArrowLeft"?(c.x-=u,l=!0):i==="ArrowRight"?(c.x+=u,l=!0):i==="ArrowUp"?(c.y-=u,l=!0):i==="ArrowDown"&&(c.y+=u,l=!0),l){e.cancelable&&e.preventDefault(),c.x=ya(c.x,0,a.width-c.width),c.y=ya(c.y,0,a.height-c.height);let d=ms(c,a.width,a.height),f=wa(c,a.width,a.height);r(d,f),s&&s(d,f)}},this.onHandlerKeyDown=(e,o)=>{let{aspect:n=0,crop:r,disabled:s,minWidth:i=0,minHeight:l=0,maxWidth:a,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)?Mr.nudgeStepLarge:e.shiftKey?Mr.nudgeStepMedium:Mr.nudgeStep,h=ms(r,f.width,f.height),p=Sj(h,e.key,m,o),g=GI(p,n,o,f.width,f.height,i,l,a,c);if(!VI(r,g)){let b=wa(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(ms(o,i.width,i.height),wa(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(ms(o,r,s),wa(o,r,s))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Ia),this.document.addEventListener("pointerup",this.onDocPointerDone,Ia),this.document.addEventListener("pointercancel",this.onDocPointerDone,Ia),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Ia),this.document.removeEventListener("pointerup",this.onDocPointerDone,Ia),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Ia),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=ya(e.startCropX+r,0,o.width-n.width),n.y=ya(e.startCropY+s,0,o.height-n.height),n}getPointRegion(e,o,n,r){let{evData:s}=this,i=s.clientX-e.x,l=s.clientY-e.y,a;r&&o?a=o==="nw"||o==="n"||o==="ne":a=l<s.startCropY;let c;return n&&o?c=o==="nw"||o==="w"||o==="sw":c=i<s.startCropX,c?a?"nw":"sw":a?"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,l]=this.resolveMinDimensions(s,o,this.props.minWidth,this.props.minHeight),a=this.makePixelCrop(s),c=this.getPointRegion(s,e.ord,i,l),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)),(l&&u==="nw"||u==="n"||u==="ne")&&(f=Math.min(f,-l));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=GI(m,o,c,s.width,s.height,i,l,n,r);return o||Mr.xyOrds.indexOf(u)>-1?a=h:Mr.xOrds.indexOf(u)>-1?(a.x=h.x,a.width=h.width):Mr.yOrds.indexOf(u)>-1&&(a.y=h.y,a.height=h.height),a.x=ya(a.x,0,s.width-a.width),a.y=ya(a.y,0,s.height-a.height),a}createCropSelection(){let{ariaLabels:e=Mr.defaultProps.ariaLabels,disabled:o,locked:n,renderSelectionAddon:r,ruleOfThirds:s,crop:i}=this.props,l=this.getCropStyle();if(i)return Mt.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!o&&!n&&Mt.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},Mt.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),Mt.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),Mt.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),Mt.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"nw"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"n"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"ne"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"e"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"se"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"s"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"sw"),role:"button"}),Mt.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"w"),role:"button"})),r&&Mt.createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:a=>a.stopPropagation()},r(this.state)),s&&Mt.createElement(Mt.Fragment,null,Mt.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),Mt.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){let o={...km,...this.props.crop||{}};return ms(o,e.width,e.height)}render(){let{aspect:e,children:o,circularCrop:n,className:r,crop:s,disabled:i,locked:l,style:a,ruleOfThirds:c}=this.props,{cropIsActive:u,newCropIsBeingDrawn:d}=this.state,f=s?this.createCropSelection():null,m=Ij("ReactCrop",r,u&&"ReactCrop--active",i&&"ReactCrop--disabled",l&&"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 Mt.createElement("div",{ref:this.componentRef,className:m,style:a},Mt.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},o),f)}};fs.xOrds=["e","w"];fs.yOrds=["n","s"];fs.xyOrds=["nw","ne","se","sw"];fs.nudgeStep=1;fs.nudgeStepMedium=10;fs.nudgeStepLarge=100;fs.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 WI=fs;import"react-image-crop/dist/ReactCrop.css";var vt="edit-upload",$m=t=>{let{name:e,onChange:o,ref:n,value:r}=t;return Eo("div",{className:`${vt}__input`,children:[e,St("input",{name:e,onChange:s=>o(s.target.value),ref:n,type:"number",value:r})]})},Rj={height:100,unit:"%",width:100,x:0,y:0},ib=({fileName:t,fileSrc:e,imageCacheTag:o,initialCrop:n,initialFocalPoint:r,onSave:s,showCrop:i,showFocalPoint:l})=>{let{closeModal:a}=de(),{t:c}=$(),[u,d]=ps(()=>({...Rj,...n||{}})),f={x:50,y:50},[m,h]=ps(()=>({...f,...r})),[p,g]=ps(!1),[b,x]=ps(0),[v,C]=ps(0),y=Sa(void 0),I=Sa(void 0),w=Sa(void 0),A=Sa(null),_=Sa(null),[D,T]=ps(!1),S=P=>{x(P.currentTarget.naturalHeight),C(P.currentTarget.naturalWidth),T(!0)},R=({dimension:P,value:j})=>{let V=parseInt(j);if(P==="width"&&V>=v||P==="height"&&V>=b)return null;let M=100*(V/(P==="width"?v:b));if(M===100||M===0)return null;d({...u,[P]:M})},E=({coordinate:P,value:j})=>{let V=parseInt(j);V>=0&&V<=100&&h(M=>({...M,[P]:V}))},F=()=>{typeof s=="function"&&s({crop:u||void 0,focalPoint:m,heightInPixels:Number(A?.current?.value??b),widthInPixels:Number(_?.current?.value??v)}),a(_c)},L=jm.useCallback(({x:P,y:j})=>{h({x:P,y:j}),g(!1)},[]),k=()=>{let P=y.current.getBoundingClientRect(),j=i?w.current.getBoundingClientRect():I.current.getBoundingClientRect(),V=(j.left-P.left+j.width/2)/P.width*100,M=(j.top-P.top+j.height/2)/P.height*100;h({x:V,y:M})},N=o?`${e}?${encodeURIComponent(o)}`:e;return Eo("div",{className:vt,children:[Eo("div",{className:`${vt}__header`,children:[Eo("h2",{title:`${c("general:editing")} ${t}`,children:[c("general:editing")," ",t]}),Eo("div",{className:`${vt}__actions`,children:[St(ae,{"aria-label":c("general:cancel"),buttonStyle:"secondary",className:`${vt}__cancel`,onClick:()=>a(_c),children:c("general:cancel")}),St(ae,{"aria-label":c("general:applyChanges"),buttonStyle:"primary",className:`${vt}__save`,disabled:!D,onClick:F,children:c("general:applyChanges")})]})]}),Eo("div",{className:`${vt}__toolWrap`,children:[St("div",{className:`${vt}__crop`,children:Eo("div",{className:`${vt}__focal-wrapper`,ref:y,style:{aspectRatio:`${v/b}`},children:[i?St(WI,{className:`${vt}__reactCrop`,crop:u,onChange:(P,j)=>d(j),onComplete:()=>g(!0),renderSelectionAddon:()=>St("div",{className:`${vt}__crop-window`,ref:w}),children:St("img",{alt:c("upload:setCropArea"),onLoad:S,ref:I,src:N})}):St("img",{alt:c("upload:setFocalPoint"),onLoad:S,ref:I,src:N}),l&&St(_j,{boundsRef:i?w:I,checkBounds:i?p:!1,className:`${vt}__focalPoint`,containerRef:y,initialPosition:m,onDragEnd:L,setCheckBounds:i?g:!1,children:St(jo,{})})]})}),(i||l)&&Eo("div",{className:`${vt}__sidebar`,children:[i&&Eo("div",{className:`${vt}__groupWrap`,children:[St("div",{children:Eo("div",{className:`${vt}__titleWrap`,children:[St("h3",{children:c("upload:crop")}),St(ae,{buttonStyle:"none",className:`${vt}__reset`,onClick:()=>d({height:100,unit:"%",width:100,x:0,y:0}),children:c("general:reset")})]})}),St("span",{className:`${vt}__description`,children:c("upload:cropToolDescription")}),Eo("div",{className:`${vt}__inputsWrap`,children:[St($m,{name:`${c("upload:width")} (px)`,onChange:P=>R({dimension:"width",value:P}),ref:_,value:(u.width/100*v).toFixed(0)}),St($m,{name:`${c("upload:height")} (px)`,onChange:P=>R({dimension:"height",value:P}),ref:A,value:(u.height/100*b).toFixed(0)})]})]}),l&&Eo("div",{className:`${vt}__groupWrap`,children:[St("div",{children:Eo("div",{className:`${vt}__titleWrap`,children:[St("h3",{children:c("upload:focalPoint")}),St(ae,{buttonStyle:"none",className:`${vt}__reset`,onClick:k,children:c("general:reset")})]})}),St("span",{className:`${vt}__description`,children:c("upload:focalPointDescription")}),Eo("div",{className:`${vt}__inputsWrap`,children:[St($m,{name:"X %",onChange:P=>E({coordinate:"x",value:P}),value:m.x.toFixed(0)}),St($m,{name:"Y %",onChange:P=>E({coordinate:"y",value:P}),value:m.y.toFixed(0)})]})]})]})]})]})},_j=({boundsRef:t,checkBounds:e,children:o,className:n,containerRef:r,initialPosition:s={x:50,y:50},onDragEnd:i,setCheckBounds:l})=>{let[a,c]=ps({x:s.x,y:s.y}),[u,d]=ps(!1),f=Sa(void 0),m=jm.useCallback((b,x,v)=>{let C=r.current.getBoundingClientRect(),y=t.current.getBoundingClientRect(),I=b??y.left,w=x??y.top,A=I<y.left||I>y.right,_=w<y.top||w>y.bottom,D=(I-C.left)/C.width*100,T=(w-C.top)/C.height*100,S=(y.left-C.left+y.width/2)/C.width*100,R=(y.top-C.top+y.height/2)/C.height*100;return(A||_)&&(d(!1),I<y.left?D=(y.left-C.left)/C.width*100:I>y.right&&(D=(C.width-(C.right-y.right))/C.width*100),w<y.top?T=(y.top-C.top)/C.height*100:w>y.bottom&&(T=(C.height-(C.bottom-y.bottom))/C.height*100),v&&(D=A?S:D,T=_?R:T)),{x:D,y:T}},[t,r]),h=b=>{b.preventDefault(),d(!0)},p=b=>{if(!u)return null;let{x,y:v}=m(b.clientX,b.clientY);c({x,y:v})},g=()=>{d(!1),i(a)};return jm.useEffect(()=>{if(!(u||!f.current)&&e){let{height:b,left:x,top:v,width:C}=f.current.getBoundingClientRect(),{x:y,y:I}=m(x+C/2,v+b/2,!0);i({x:y,y:I}),c({x:y,y:I}),l(!1);return}},[m,u,e,l,a.x,a.y,i]),jm.useEffect(()=>{c({x:s.x,y:s.y})},[s.x,s.y]),Eo("div",{className:[`${vt}__draggable-container`,u&&`${vt}__draggable-container--dragging`].filter(Boolean).join(" "),onMouseMove:p,children:[St("button",{className:[`${vt}__draggable`,n].filter(Boolean).join(" "),onMouseDown:h,onMouseUp:g,ref:f,style:{left:`${a.x}%`,top:`${a.y}%`},type:"button",children:o}),St("div",{})]})};import{jsx as QI}from"react/jsx-runtime";import"react";import{c as Dj}from"react/compiler-runtime";import{jsx as _n,jsxs as ab}from"react/jsx-runtime";import"react";var hs="file-details-draggable",zI=t=>{let e=Dj(20),{collectionSlug:o,doc:n,hideRemoveFile:r,imageCacheTag:s,isSortable:i,removeItem:l,rowIndex:a,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]=Yt(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]!==l||e[12]!==a||e[13]!==f||e[14]!==c||e[15]!==m?(b=v=>ab("div",{className:[hs,v&&i&&`${hs}--has-drag-handle`].filter(Boolean).join(" "),ref:v.setNodeRef,style:{transform:v.transform,transition:v.transition,zIndex:v.isDragging?1:void 0},children:[ab("div",{className:`${hs}--drag-wrapper`,children:[i&&v&&_n("div",{className:`${hs}__drag`,...v.attributes,...v.listeners,children:_n(Vs,{})}),_n(kr,{className:`${hs}__thumbnail`,collectionSlug:o,doc:n,fileSrc:f||m,imageCacheTag:s,uploadConfig:c})]}),_n("div",{className:`${hs}__main-detail`,children:d}),ab("div",{className:`${hs}__actions`,children:[_n(p,{}),_n(g,{children:_n(wr,{})}),!r&&l&&_n(ae,{buttonStyle:"icon-label",className:`${hs}__remove`,icon:"x",iconStyle:"none",onClick:()=>l(a),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]=l,e[12]=a,e[13]=f,e[14]=c,e[15]=m,e[16]=b):b=e[16];let x;return e[17]!==u||e[18]!==b?(x=_n(Wn,{id:u,children:b},u),e[17]=u,e[18]=b,e[19]=x):x=e[19],x};import{jsx as Fc,jsxs as JI}from"react/jsx-runtime";import"react";import{jsx as YI,jsxs as Tc}from"react/jsx-runtime";import{formatFilesize as Fj}from"payload/shared";import ZI from"react";import{jsx as HI,jsxs as XI}from"react/jsx-runtime";import{useRef as Tj,useState as UI}from"react";var Aj="copy-to-clipboard",Dc=({defaultMessage:t,successMessage:e,value:o})=>{let n=Tj(null),[r,s]=UI(!1),[i,l]=UI(!1),{t:a}=$();return o?XI("button",{className:Aj,onClick:()=>{n&&n.current&&(n.current.select(),n.current.setSelectionRange(0,o.length+1),document.execCommand("copy"),s(!0))},onMouseEnter:()=>{l(!0),s(!1)},onMouseLeave:()=>{l(!1),s(!1)},type:"button",children:[HI(bl,{}),XI(po,{delay:r?0:void 0,show:i||r,children:[r&&(e??a("general:copied")),!r&&(t??a("general:copy"))]}),HI("textarea",{readOnly:!0,ref:n,tabIndex:-1,value:o})]}):null};var lb="file-meta",Ac=t=>{let{filename:e,filesize:o,height:n,mimeType:r,url:s,width:i}=t;return Tc("div",{className:lb,children:[Tc("div",{className:`${lb}__url`,children:[YI("a",{href:s,rel:"noopener noreferrer",target:"_blank",children:e}),YI(Dc,{defaultMessage:"Copy URL",value:s})]}),Tc("div",{className:`${lb}__size-type`,children:[Fj(o),typeof i=="number"&&typeof n=="number"&&Tc(ZI.Fragment,{children:["\xA0-\xA0",i,"x",n]}),r&&Tc(ZI.Fragment,{children:["\xA0-\xA0",r]})]})]})};var Om="file-details",qI=t=>{let{customUploadActions:e,doc:o,enableAdjustments:n,handleRemove:r,hasImageSizes:s,hideRemoveFile:i,imageCacheTag:l,uploadConfig:a}=t,{filename:c,filesize:u,height:d,mimeType:f,thumbnailURL:m,url:h,width:p}=o,g=a.displayPreview??!0;return Fc("div",{className:Om,children:JI("header",{children:[g&&Fc(kr,{className:`${Om}__thumbnail`,doc:o,fileSrc:m||h,imageCacheTag:l,uploadConfig:a}),JI("div",{className:`${Om}__main-detail`,children:[Fc(Ac,{filename:c,filesize:u,height:d,mimeType:f,url:h,width:p}),(n||e)&&Fc(cb,{customActions:e,enableAdjustments:!!n,enablePreviewSizes:s&&o.filename,mimeType:f})]}),!i&&r&&Fc(ae,{buttonStyle:"icon-label",className:`${Om}__remove`,icon:"x",iconStyle:"with-border",onClick:r,round:!0})]})})};var ub=t=>{let{hasMany:e}=t;return e?QI(zI,{...t}):QI(qI,{...t})};import{jsx as Qr,jsxs as Ra}from"react/jsx-runtime";import{useEffect as Ej,useMemo as Pj,useState as KI}from"react";var hr="preview-sizes",eS=(t,e)=>{if(!e||e.length===0)return t;let o={};return e.forEach(({name:n})=>{t[n]&&(o[n]=t[n])}),o},tS=({name:t,active:e,meta:o,onClick:n,previewSrc:r})=>Ra("div",{className:[`${hr}__sizeOption`,e&&`${hr}--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:[Qr("div",{className:`${hr}__image`,children:Qr("img",{alt:o.filename,src:r})}),Ra("div",{className:`${hr}__sizeMeta`,children:[Qr("div",{className:`${hr}__sizeName`,children:t}),Qr(Ac,{...o})]})]}),db=({doc:t,imageCacheTag:e,uploadConfig:o})=>{let{imageSizes:n}=o,{sizes:r}=t,[s,i]=KI(()=>eS(r,n)),[l,a]=KI(null),c=m=>{if(!m.filename)return null;if(m.url)return`${m.url}${e?`?${encodeURIComponent(e)}`:""}`};Ej(()=>{i(eS(r,n))},[r,n,e]);let u=c(l?t.sizes[l]:t),d=Pj(()=>({filename:t.filename,filesize:t.filesize,height:t.height,mimeType:t.mimeType,url:t.url,width:t.width}),[t]),f="Original";return Ra("div",{className:hr,children:[Ra("div",{className:`${hr}__imageWrap`,children:[Ra("div",{className:`${hr}__meta`,children:[Qr("div",{className:`${hr}__sizeName`,children:l||f}),Qr(Ac,{...l?s[l]:d})]}),Qr("img",{alt:t.filename,className:`${hr}__preview`,src:u})]}),Qr("div",{className:`${hr}__listWrap`,children:Ra("div",{className:`${hr}__list`,children:[Qr(tS,{active:!l,meta:d,name:f,onClick:()=>a(null),previewSrc:c(t)}),Object.entries(s).map(([m,h])=>{let p=l===m,g=c(h);return g?Qr(tS,{active:p,meta:h,name:m,onClick:()=>a(m),previewSrc:g},m):null})]})})]})};var Zt="file-field",_c="edit-upload",nS="preview-sizes",kj=t=>!t&&t!==void 0?"A file is required.":!0,cb=t=>{let e=Nj(9),{customActions:o,enableAdjustments:n,enablePreviewSizes:r,mimeType:s}=t,{t:i}=$(),l,a;if(e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i){a=Symbol.for("react.early_return_sentinel");e:{let c=rS(s)&&s!=="image/svg+xml"&&s!=="image/jxl";if(!c&&(!o||o.length===0)){a=null;break e}let u;e[7]!==o?(u=o&&o.map($j),e[7]=o,e[8]=u):u=e[8],l=gr("div",{className:`${Zt}__upload-actions`,children:[c&&gr(Pc.Fragment,{children:[r&&Rt(ar,{className:`${Zt}__previewSizes`,slug:nS,children:i("upload:previewSizes")}),n&&Rt(ar,{className:`${Zt}__edit`,slug:_c,children:i("upload:editImage")})]}),u]})}e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=l,e[6]=a}else l=e[5],a=e[6];return a!==Symbol.for("react.early_return_sentinel")?a:l},Nc=t=>{let{collectionSlug:e,customActions:o,initialState:n,onChange:r,uploadConfig:s}=t,{config:{routes:{api:i},serverURL:l}}=W(),{t:a}=$(),{setModified:c}=Me(),{resetUploadEdits:u,updateUploadEdits:d,uploadEdits:f}=hn(),{id:m,docPermissions:h,savedDocumentData:p,setUploadStatus:g}=Ae(),b=$o(),{errorMessage:x,setValue:v,showError:C,value:y}=Te({path:"file",validate:kj}),[I,w]=Ec(null),[A,_]=Ec(!1),[D,T]=Ec(y?.name||""),[S,R]=Ec(!1),[E,F]=Ec(""),L=oS(null),k=oS(null),N=typeof s?.pasteURL=="object"&&s.pasteURL.allowList?.length>0,P=Mm(Q=>{Q instanceof File&&w(URL.createObjectURL(Q)),v(Q),R(!1),typeof r=="function"&&r(Q)},[r,v]),j=(Q,ge)=>new File([Q],ge,{type:Q.type,lastModified:Q.lastModified}),V=Pc.useCallback(Q=>{let ge=Q.target.value;y&&(P(j(y,ge)),T(ge))},[P,y]),M=Mm(Q=>{let ge=Q?.[0];P(ge)},[P]),O=Mm(()=>{_(!0),P(null),w(""),F(""),u(),R(!1)},[P,u]),B=Mm(Q=>{c(!0),d(Q)},[c,d]),G=async()=>{if(!(!E||s?.pasteURL===!1)){g("uploading");try{let Q=await fetch(E);if(!Q.ok)throw new Error(`Fetch failed with status: ${Q.status}`);let ge=await Q.blob(),Ie=decodeURIComponent(E.split("/").pop()||""),Fe=new File([ge],Ie,{type:ge.type});P(Fe),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)}`,ge=await fetch(`${l}${i}${Q}`);if(!ge.ok)throw new Error(`Fetch failed with status: ${ge.status}`);let Ie=await ge.blob(),Fe=decodeURIComponent(E.split("/").pop()||""),Le=new File([Ie],Fe,{type:Ie.type});P(Le),g("idle")}catch{fe.error("The provided URL is not allowed."),g("failed")}}};mb(()=>{n?.file?.value instanceof File&&(w(URL.createObjectURL(n.file.value)),_(!1))},[n]),mb(()=>{S&&L.current},[S]),mb(()=>{b&&_(!1)},[b]);let Y=h?.update&&"delete"in h&&h?.delete,X=s?.imageSizes?.length>0,ee=!!s?.resizeOptions,q=s?.focalPoint===!0,{crop:z=!0,focalPoint:re=!0}=s,me=re&&(X||ee||q),se=s.mimeTypes?.join(", "),Z=s?.cacheTags&&p?.updatedAt;return s.hideFileInputOnCreate&&!p?.filename?null:gr("div",{className:[Ce,Zt].filter(Boolean).join(" "),children:[Rt(Xe,{message:x,showError:C}),p&&p.filename&&!A&&Rt(ub,{collectionSlug:e,customUploadActions:o,doc:p,enableAdjustments:z||me,handleRemove:Y?O:void 0,hasImageSizes:X,hideRemoveFile:s.hideRemoveFile,imageCacheTag:Z,uploadConfig:s}),(!s.hideFileInputOnCreate&&!p?.filename||A)&&gr("div",{className:`${Zt}__upload`,children:[!y&&!S&&Rt(ai,{onChange:M,children:gr("div",{className:`${Zt}__dropzoneContent`,children:[gr("div",{className:`${Zt}__dropzoneButtons`,children:[Rt(ae,{buttonStyle:"pill",onClick:()=>{k.current&&k.current.click()},size:"small",children:a("upload:selectFile")}),Rt("input",{accept:se,"aria-hidden":"true",className:`${Zt}__hidden-input`,hidden:!0,onChange:Q=>{Q.target.files&&Q.target.files.length>0&&M(Q.target.files)},ref:k,type:"file"}),s?.pasteURL!==!1&&gr(Lj,{children:[Rt("span",{className:`${Zt}__orText`,children:a("general:or")}),Rt(ae,{buttonStyle:"pill",onClick:()=>{R(!0)},size:"small",children:a("upload:pasteURL")})]})]}),gr("p",{className:`${Zt}__dragAndDropText`,children:[a("general:or")," ",a("upload:dragAndDrop")]})]})}),S&&gr(Pc.Fragment,{children:[gr("div",{className:`${Zt}__remote-file-wrap`,children:[Rt("input",{className:`${Zt}__remote-file`,onChange:Q=>{F(Q.target.value)},ref:L,type:"text",value:E}),Rt("div",{className:`${Zt}__add-file-wrap`,children:Rt("button",{className:`${Zt}__add-file`,onClick:()=>{G()},type:"button",children:a("upload:addFile")})})]}),Rt(ae,{buttonStyle:"icon-label",className:`${Zt}__remove`,icon:"x",iconStyle:"with-border",onClick:()=>{R(!1)},round:!0,tooltip:a("general:cancel")})]}),y&&I&&gr(Pc.Fragment,{children:[Rt("div",{className:`${Zt}__thumbnail-wrap`,children:Rt(kr,{collectionSlug:e,fileSrc:rS(y.type)?I:null})}),gr("div",{className:`${Zt}__file-adjustments`,children:[Rt("input",{className:`${Zt}__filename`,onChange:V,type:"text",value:D||y.name}),Rt(cb,{customActions:o,enableAdjustments:z||me,enablePreviewSizes:X&&p?.filename&&!A,mimeType:y.type})]}),Rt(ae,{buttonStyle:"icon-label",className:`${Zt}__remove`,icon:"x",iconStyle:"with-border",onClick:O,round:!0,tooltip:a("general:cancel")})]})]}),(y||p?.filename)&&Rt(As,{children:Rt(Pt,{Header:null,slug:_c,children:Rt(ib,{fileName:y?.name||p?.filename,fileSrc:p?.url||I,imageCacheTag:Z,initialCrop:f?.crop??void 0,initialFocalPoint:{x:f?.focalPoint?.x||p?.focalX||50,y:f?.focalPoint?.y||p?.focalY||50},onSave:B,showCrop:z,showFocalPoint:me})})}),p&&X&&Rt(Pt,{className:`${Zt}__previewDrawer`,hoverTitle:!0,slug:nS,title:a("upload:sizesFor",{label:p.filename}),children:Rt(db,{doc:p,imageCacheTag:Z,uploadConfig:s})})]})};function $j(t,e){return Rt(Pc.Fragment,{children:t},e)}var Gj="collection-edit";function iS({submitted:t}){let{action:e,collectionSlug:o,docPermissions:n,getDocPreferences:r,hasSavePermission:s,initialState:i,isEditing:l,isInitializing:a,Upload:c}=Ae(),{onSave:u}=Zl(),{getFormState:d}=Dt(),{config:{routes:{admin:f}},getEntityConfig:m}=W(),h=_a.useRef(null),p=m({collectionSlug:o}),g=Oj(),b=ut(),x=Mj(),{reportUpdate:v}=li(),{resetUploadEdits:C}=hn(),{startRouteTransition:y}=it(),I=x.get("locale"),w=p.slug,[A]=_a.useState(w),_=sS(T=>{if(v({entitySlug:w,updatedAt:T?.result?.updatedAt||new Date().toISOString()}),typeof u=="function"&&u({...T,operation:"create"}),!l&&b<2){let S=Bj({adminRoute:f,path:`/collections/${w}/${T?.doc?.id}${I?`?locale=${I}`:""}`});y(()=>g.push(S))}else C()},[f,w,b,l,I,u,v,C,g,y]),D=sS(async({formState:T,submitted:S})=>{let R=er(h),E=await r(),{state:F}=await d({collectionSlug:w,docPermissions:n,docPreferences:E,formState:T,operation:"create",schemaPath:A,signal:R.signal,skipValidation:!S});return h.current=null,F},[w,A,r,d,n]);return Vj(()=>{let T=h.current;return()=>{Ko(T)}},[]),gs(ml,{operation:"create",children:gs(fb,{children:jj(In,{action:e,className:`${Gj}__form`,disabled:a||!s,initialState:a?void 0:i,isInitializing:a,method:"POST",onChange:[D],onSuccess:_,submitted:t,children:[gs(Rc,{BeforeFields:gs(_a.Fragment,{children:c||gs(Nc,{collectionSlug:p.slug,initialState:i,uploadConfig:p.upload})}),docPermissions:n,fields:p.fields,schemaPathSegments:[p.slug]}),gs(zj,{}),gs(Wj,{})]})})})}function Wj(){let{getFields:t}=Me(),{getFormDataRef:e}=wo();return _a.useEffect(()=>{e.current=t},[t,e]),null}function zj(){let{docConfig:t}=Ae(),{activeIndex:e,setFormTotalErrorCount:o}=wo(),n=_a.useRef(0),r=_a.useCallback(s=>{s!==n.current&&(o({errorCount:s,index:e}),n.current=s)},[e,o]);return t?gs(zs,{fields:t.fields,path:[],setErrorCount:r}):null}import{c as Hj}from"react/compiler-runtime";import{jsx as Lt,jsxs as Br}from"react/jsx-runtime";import{isImage as Xj}from"payload/shared";import Uj from"react";var Bm="bulk-upload-drawer--add-more-files",xt="file-selections";function aS(){let t=Hj(36),{activeIndex:e,addFiles:o,forms:n,isInitializing:r,removeFile:s,setActiveIndex:i,thumbnailUrls:l,totalErrorCount:a}=wo(),{initialFiles:c,maxFiles:u}=Wo(),{i18n:d,t:f}=$(),{closeModal:m,openModal:h}=de(),[p,g]=Uj.useState(!1),{breakpoints:b}=xo(),x;t[0]!==s?(x=S=>{s(S)},t[0]=s,t[1]=x):x=t[1];let v=x,C;t[2]!==o||t[3]!==m?(C=S=>{o(S),m(Bm)},t[2]=o,t[3]=m,t[4]=C):C=t[4];let y=C,I=Jj,w=r?c.length:n.length,A=p&&`${xt}__showingFiles`,_;t[5]!==A?(_=[xt,A].filter(Boolean),t[5]=A,t[6]=_):_=t[6];let D=_.join(" "),T;if(t[7]!==e||t[8]!==b.m||t[9]!==m||t[10]!==n||t[11]!==y||t[12]!==v||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]!==D||t[22]!==l||t[23]!==a||t[24]!==w){let S;t[26]===Symbol.for("react.memo_cache_sentinel")?(S=()=>g(Zj),t[26]=S):S=t[26];let R;t[27]!==m?(R=()=>m(Bm),t[27]=m,t[28]=R):R=t[28];let E;t[29]!==e||t[30]!==v||t[31]!==d||t[32]!==i||t[33]!==f||t[34]!==l?(E=(F,L)=>{let{errorCount:k,formState:N}=F,P=N?.file?.value||{};return Br("div",{className:[`${xt}__fileRowContainer`,L===e&&`${xt}__fileRowContainer--active`,k&&k>0&&`${xt}__fileRowContainer--error`].filter(Boolean).join(" "),children:[Br("button",{className:`${xt}__fileRow`,onClick:()=>i(L),type:"button",children:[Lt(kr,{className:`${xt}__thumbnail`,fileSrc:Xj(P.type)?l[L]:null}),Lt("div",{className:`${xt}__fileDetails`,children:Lt("p",{className:`${xt}__fileName`,title:P.name,children:P.name||f("upload:noFile")})}),P instanceof File?Lt("p",{className:`${xt}__fileSize`,children:I(P)}):null,Lt("div",{className:`${xt}__remove ${xt}__remove--underlay`,children:Lt(pt,{})}),k?Lt(to,{className:`${xt}__errorCount`,count:k,i18n:d}):null]}),Lt("button",{"aria-label":f("general:remove"),className:`${xt}__remove ${xt}__remove--overlay`,onClick:()=>v(L),type:"button",children:Lt(pt,{})})]},L)},t[29]=e,t[30]=v,t[31]=d,t[32]=i,t[33]=f,t[34]=l,t[35]=E):E=t[35],T=Br("div",{className:D,children:[b.m&&p?Lt("div",{className:`${xt}__mobileBlur`}):null,Br("div",{className:`${xt}__header`,children:[Br("div",{className:`${xt}__headerTopRow`,children:[Br("div",{className:`${xt}__header__text`,children:[Lt(to,{count:a,i18n:d,withMessage:!0}),Lt("p",{children:Br("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})})]}),Br("div",{className:`${xt}__header__actions`,children:[typeof u!="number"||w<u?Lt(bt,{className:`${xt}__header__addFile`,onClick:()=>h(Bm),children:f("upload:addFile")}):null,Br(ae,{buttonStyle:"transparent",className:`${xt}__toggler`,onClick:S,children:[Lt("span",{className:`${xt}__toggler__label`,children:Br("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})}),Lt(Je,{direction:p?"down":"up"})]}),Lt(Pt,{gutter:!1,Header:null,slug:Bm,children:Lt(Fm,{onCancel:R,onDrop:y})})]})]}),Lt("div",{className:`${xt}__header__mobileDocActions`,children:Lt(nb,{})})]}),Lt("div",{className:`${xt}__animateWrapper`,children:Lt(_r,{height:!b.m||p?"auto":0,children:Br("div",{className:`${xt}__filesContainer`,children:[r&&n.length===0&&c.length>0?Array.from(c).map(Yj):null,n.map(E)]})})})]}),t[7]=e,t[8]=b.m,t[9]=m,t[10]=n,t[11]=y,t[12]=v,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]=D,t[22]=l,t[23]=a,t[24]=w,t[25]=T}else T=t[25];return T}function Yj(t,e){return Lt(wt,{animationDelay:`calc(${e} * 60ms)`,height:"35px"},e)}function Zj(t){return!t}function Jj(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 lS="bulk-upload--file-manager";function cS(){let t=qj(16),{activeIndex:e,collectionSlug:o,docPermissions:n,documentSlots:r,forms:s,hasPublishPermission:i,hasSavePermission:l,hasSubmitted:a}=wo(),c=s[e],{getEntityConfig:u}=W(),{i18n:d}=$(),{user:f}=Se(),{openModal:m}=de(),h;if(t[0]!==c||t[1]!==e||t[2]!==o||t[3]!==n||t[4]!==r||t[5]!==s.length||t[6]!==u||t[7]!==i||t[8]!==l||t[9]!==a||t[10]!==d||t[11]!==m||t[12]!==f){let p=u({collectionSlug:o}),g;t[14]!==m?(g=()=>m(Sc),t[14]=m,t[15]=g):g=t[15],h=pb("div",{className:lS,children:[Lc(aS,{}),pb("div",{className:`${lS}__editView`,children:[Lc(ba,{onClose:g,title:Qj(p.labels.singular,d)}),c?pb(dl,{collectionSlug:o,currentEditor:f,docPermissions:n,hasPublishedDoc:!1,hasPublishPermission:i,hasSavePermission:l,id:null,initialData:Kj(c.formState,!0),initialState:c.formState,isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,Upload:r.Upload,versionCount:0,children:[Lc($I,{collectionConfig:p}),Lc(iS,{submitted:a})]},`${e}-${s.length}`):null]}),Lc(jI,{})]}),t[0]=c,t[1]=e,t[2]=o,t[3]=n,t[4]=r,t[5]=s.length,t[6]=u,t[7]=i,t[8]=l,t[9]=a,t[10]=d,t[11]=m,t[12]=f,t[13]=h}else h=t[13];return h}var oO="bulk-upload-drawer-slug";function rO(){let{addFiles:t,forms:e,isInitializing:o}=wo(),{closeModal:n}=de(),{collectionSlug:r,drawerSlug:s}=Wo(),{getEntityConfig:i}=W(),{t:l}=$(),u=i({collectionSlug:r})?.upload?.mimeTypes,d=Kr.useCallback(f=>{let m=new DataTransfer;for(let h of f)(u===void 0||u.length===0||tO(h.type,u))&&m.items.add(h);m.files.length===0?fe.error(l("error:invalidFileType")):t(m.files)},[t,l,u]);return r?!e.length&&!o?ci(Fm,{acceptMimeTypes:u?.join(", "),onCancel:()=>n(s),onDrop:d}):ci(cS,{}):null}function dS(){let t=uS(2),{drawerSlug:e}=Wo(),o;return t[0]!==e?(o=ci(Pt,{gutter:!1,Header:null,slug:e,children:ci(RI,{children:ci(rO,{})})}),t[0]=e,t[1]=o):o=t[1],o}var mS=Kr.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 fb(t){let e=uS(16),{children:o}=t,[n,r]=Kr.useState(),[s,i]=Kr.useState(),[l,a]=Kr.useState(),[c,u]=Kr.useState(void 0),[d,f]=Kr.useState(void 0),[m,h]=Kr.useState(void 0),p=fS(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=w=>{r(w)},e[0]=g):g=e[0];let b=g,x;e[1]===Symbol.for("react.memo_cache_sentinel")?(x=(w,A)=>{i(_=>({..._,[w]:A}))},e[1]=x):x=e[1];let v=x,C;e[2]!==l?(C=()=>{typeof l=="function"&&l()},e[2]=l,e[3]=C):C=e[3];let y;e[4]!==m||e[5]!==s?(y=(w,A)=>{if(s&&Object.hasOwn(s,m)){let _=s[m];_(w,A)}},e[4]=m,e[5]=s,e[6]=y):y=e[6];let I;return e[7]!==o||e[8]!==n||e[9]!==m||e[10]!==p||e[11]!==c||e[12]!==d||e[13]!==C||e[14]!==y?(I=ci(mS,{value:{collectionSlug:n,currentActivePath:m,drawerSlug:p,initialFiles:c,maxFiles:d,onCancel:C,onSuccess:y,setCollectionSlug:b,setCurrentActivePath:h,setInitialFiles:u,setMaxFiles:f,setOnCancel:a,setOnSuccess:v},children:eO(Kr.Fragment,{children:[o,ci(dS,{})]})}),e[7]=o,e[8]=n,e[9]=m,e[10]=p,e[11]=c,e[12]=d,e[13]=C,e[14]=y,e[15]=I):I=e[15],I}var Wo=()=>Kr.use(mS);function fS(){let t=ki();return`${oO}-${t||1}`}import{c as iO}from"react/compiler-runtime";import{jsx as Gm}from"react/jsx-runtime";import{createElement as aO}from"react";import{useEffect as bS,useId as lO,useState as vS}from"react";import{jsx as pS,jsxs as nO}from"react/jsx-runtime";import{hoistQueryParamsToAnd as sO}from"payload/shared";import{useCallback as Vm,useEffect as hS,useState as hb}from"react";var gS=({allowCreate:t=!0,collectionSlugs:e,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,filterOptions:s,onBulkSelect:i,onSelect:l,overrideEntityVisibility:a=!0,selectedCollection:c})=>{let{closeModal:u,isModalOpen:d}=de(),{serverFunction:f}=Dt(),[m,h]=hb(void 0),[p,g]=hb(!0),{config:{collections:b},getEntityConfig:x}=W(),v=d(n),C=b.filter(({slug:F})=>e.includes(F)),[y,I]=hb(()=>{let F=c||C[0]?.slug,L=x({collectionSlug:F});return L?{label:L.labels,value:L.slug}:void 0}),[w,A,{drawerSlug:_}]=Yt({collectionSlug:y.value}),D=Jt(F=>{F&&F!==y?.value&&I({label:x({collectionSlug:F})?.labels,value:F})});hS(()=>{D(c)},[c]);let T=Vm(async(F,L)=>{try{let k={...L||{},where:{...L?.where||{}}},N=s?.[F];s&&typeof N!="boolean"&&(k.where=sO(k.where,N));let{List:P}=await f({name:"render-list",args:{allowCreate:t,collectionSlug:F,disableBulkDelete:!0,disableBulkEdit:!0,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,overrideEntityVisibility:a,query:k}});h(P),g(!1)}catch(k){console.error("Error rendering List View: ",k),v&&u(n)}},[f,u,t,n,v,r,s,a,o]);hS(()=>{m||T(y.value)},[T,m,y.value]);let S=Vm(({doc:F})=>{typeof l=="function"&&l({collectionSlug:y.value,doc:F,docID:F.id}),u(_),u(n)},[u,_,n,l,y.value]),R=Vm(F=>{T(y.value,F)},[T,y.value]),E=Vm(F=>{I(F),T(F.value)},[T]);return p?pS(xn,{}):nO(og,{allowCreate:t,createNewDrawerSlug:_,DocumentDrawerToggler:A,drawerSlug:n,enabledCollections:e,onBulkSelect:i,onQueryChange:R,onSelect:l,selectedOption:y,setSelectedOption:E,children:[m,pS(w,{onSave:S})]})};var xS="list-drawer",cO=({depth:t,uuid:e})=>`list-drawer_${t}_${e}`,uO=({children:t,className:e,disabled:o,drawerSlug:n,onClick:r,...s})=>Gm(ar,{className:[e,`${xS}__toggler`].filter(Boolean).join(" "),disabled:o,onClick:r,slug:n,...s,children:t}),dO=t=>{let{drawerSlug:e}=t;return Gm(Pt,{className:xS,gutter:!1,Header:null,slug:e,children:Gm(gS,{...t})})},kc=t=>{let e=iO(42),{collectionSlugs:o,filterOptions:n,selectedCollection:r,uploads:s}=t,{config:i}=W(),{collections:l}=i,a=ut(),c=lO(),{closeModal:u,modalState:d,openModal:f,toggleModal:m}=de(),[h,p]=vS(!1),[g,b]=vS(o),x;e[0]!==a||e[1]!==c?(x=cO({depth:a,uuid:c}),e[0]=a,e[1]=c,e[2]=x):x=e[2];let v=x,C,y;e[3]!==v||e[4]!==d?(C=()=>{p(!!d[v]?.isOpen)},y=[d,v],e[3]=v,e[4]=d,e[5]=C,e[6]=y):(C=e[5],y=e[6]),bS(C,y);let I,w;e[7]!==g||e[8]!==l||e[9]!==s?(I=()=>{if(!g||g.length===0){let B=l.filter(G=>{let{upload:Y}=G;return s?!!Y:!0});b(B.map(mO))}},w=[g,s,l],e[7]=g,e[8]=l,e[9]=s,e[10]=I,e[11]=w):(I=e[10],w=e[11]),bS(I,w);let A;e[12]!==v||e[13]!==m?(A=()=>{m(v)},e[12]=v,e[13]=m,e[14]=A):A=e[14];let _=A,D;e[15]!==u||e[16]!==v?(D=()=>{u(v)},e[15]=u,e[16]=v,e[17]=D):D=e[17];let T=D,S;e[18]!==v||e[19]!==f?(S=()=>{f(v)},e[18]=v,e[19]=f,e[20]=S):S=e[20];let R=S,E,F;e[21]!==T||e[22]!==g||e[23]!==v||e[24]!==n||e[25]!==r||e[26]!==s?(F=B=>aO(dO,{...B,closeDrawer:T,collectionSlugs:g,drawerSlug:v,filterOptions:n,key:v,selectedCollection:r,uploads:s}),e[21]=T,e[22]=g,e[23]=v,e[24]=n,e[25]=r,e[26]=s,e[27]=F):F=e[27],E=F;let L=E,k,N;e[28]!==v?(N=B=>Gm(uO,{...B,drawerSlug:v}),e[28]=v,e[29]=N):N=e[29],k=N;let P=k,j,V;e[30]!==T||e[31]!==g||e[32]!==a||e[33]!==v||e[34]!==h||e[35]!==R||e[36]!==_?(V={closeDrawer:T,collectionSlugs:g,drawerDepth:a,drawerSlug:v,isDrawerOpen:h,openDrawer:R,setCollectionSlugs:b,toggleDrawer:_},e[30]=T,e[31]=g,e[32]=a,e[33]=v,e[34]=h,e[35]=R,e[36]=_,e[37]=V):V=e[37],j=V;let M=j,O;return e[38]!==L||e[39]!==M||e[40]!==P?(O=[L,P,M],e[38]=L,e[39]=M,e[40]=P,e[41]=O):O=e[41],O};function mO(t){let{slug:e}=t;return e}import{c as gO}from"react/compiler-runtime";import{jsx as di,jsxs as bO}from"react/jsx-runtime";import"react";import{c as fO}from"react/compiler-runtime";import{jsx as ui,jsxs as Wm}from"react/jsx-runtime";import{formatFilesize as pO}from"payload/shared";import"react";var Dn="upload-relationship-details";function zm(t){let e=fO(34),{id:o,allowEdit:n,allowRemove:r,alt:s,byteSize:i,className:l,collectionSlug:a,displayPreview:c,filename:u,mimeType:d,onRemove:f,reloadDoc:m,src:h,thumbnailSrc:p,withMeta:g,x:b,y:x}=t,v=g===void 0?!0:g,{config:C}=W(),y;e[0]!==a||e[1]!==C?(y="collections"in C?C.collections.find(O=>O.slug===a):void 0,e[0]=a,e[1]=C,e[2]=y):y=e[2];let I=y,w=h?o:void 0,A;e[3]!==a||e[4]!==w?(A={id:w,collectionSlug:a},e[3]=a,e[4]=w,e[5]=A):A=e[5];let[_,,D]=Yt(A),{openDrawer:T}=D,S;e[6]!==a||e[7]!==m?(S=async O=>{let{doc:B}=O;return m(B.id,a)},e[6]=a,e[7]=m,e[8]=S):S=e[8];let R=S,E;e[9]!==b||e[10]!==x?(E=function(B,G){let Y=[];return G&&Y.push(pO(G)),b&&x&&Y.push(`${b}x${x}`),B&&Y.push(B),Y.join(" \u2014 ")},e[9]=b,e[10]=x,e[11]=E):E=e[11];let L=v?E(d,i):"",k=c??I.upload?.displayPreview??!0,N;e[12]!==l?(N=[Dn,l].filter(Boolean),e[12]=l,e[13]=N):N=e[13];let P=N.join(" "),j;e[14]!==s||e[15]!==u||e[16]!==k||e[17]!==p?(j=k&&ui(l3,{alt:s,className:`${Dn}__thumbnail`,filename:u,fileSrc:p,size:"small"}),e[14]=s,e[15]=u,e[16]=k,e[17]=p,e[18]=j):j=e[18];let V;e[19]!==u||e[20]!==h?(V=h?ui("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]!==L||e[26]!==f||e[27]!==R||e[28]!==T||e[29]!==V||e[30]!==P||e[31]!==j||e[32]!==v?(M=Wm("div",{className:P,children:[Wm("div",{className:`${Dn}__imageAndDetails`,children:[j,Wm("div",{className:`${Dn}__details`,children:[ui("p",{className:`${Dn}__filename`,children:V}),v?ui("p",{className:`${Dn}__meta`,children:L}):null]})]}),n!==!1||r!==!1?Wm("div",{className:`${Dn}__actions`,children:[n!==!1?ui(ae,{buttonStyle:"icon-label",className:`${Dn}__edit`,icon:"edit",iconStyle:"none",onClick:T}):null,r!==!1?ui(ae,{buttonStyle:"icon-label",className:`${Dn}__remove`,icon:"x",iconStyle:"none",onClick:()=>f()}):null,ui(_,{onSave:R})]}):null]}),e[22]=_,e[23]=n,e[24]=r,e[25]=L,e[26]=f,e[27]=R,e[28]=T,e[29]=V,e[30]=P,e[31]=j,e[32]=v,e[33]=M):M=e[33],M}import{jsx as hO}from"react/jsx-runtime";import"react";var CS="upload-field-card";function Hm({children:t,className:e,size:o="medium"}){return hO("div",{className:[CS,e,`${CS}--size-${o}`].filter(Boolean).join(" "),children:t})}var $c="upload upload--has-many";function yS(t){let e=gO(27),{className:o,displayPreview:n,fileDocs:r,isSortable:s,onRemove:i,onReorder:l,readonly:a,reloadDoc:c,serverURL:u}=t,d;e[0]!==r||e[1]!==l?(d=(x,v)=>{if(x===v)return;let C=[...r],[y]=C.splice(x,1);C.splice(v,0,y),l(C)},e[0]=r,e[1]=l,e[2]=d):d=e[2];let f=d,m;e[3]!==r||e[4]!==i?(m=x=>{let v=[...r||[]];v.splice(x,1),i(v.length===0?[]:v)},e[3]=r,e[4]=i,e[5]=m):m=e[5];let h=m,p;e[6]!==o?(p=[$c,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]!==a||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==g){let x;e[18]!==f?(x=C=>{let{moveFromIndex:y,moveToIndex:I}=C;return f(y,I)},e[18]=f,e[19]=x):x=e[19];let v;e[20]!==n||e[21]!==s||e[22]!==a||e[23]!==c||e[24]!==h||e[25]!==u?(v=(C,y)=>{let{relationTo:I,value:w}=C,A=String(w.id),_,D;if(w.url)try{_=new URL(w.url,u).toString()}catch{_=`${u}${w.url}`}if(w.thumbnailURL)try{D=new URL(w.thumbnailURL,u).toString()}catch{D=`${u}${w.thumbnailURL}`}return di(Wn,{disabled:!s||a,id:A,children:T=>di("div",{className:[`${$c}__dragItem`,T&&s&&`${$c}--has-drag-handle`].filter(Boolean).join(" "),ref:T.setNodeRef,style:{transform:T.transform,transition:T.transition,zIndex:T.isDragging?1:void 0},children:bO(Hm,{size:"small",children:[T&&di("div",{className:`${$c}__drag`,...T.attributes,...T.listeners,children:di(Vs,{})}),di(zm,{allowEdit:!a,allowRemove:!a,alt:w?.alt||w?.filename,byteSize:w.filesize,collectionSlug:I,displayPreview:n,filename:w.filename,id:A,mimeType:w?.mimeType,onRemove:()=>h(y),reloadDoc:c,src:_,thumbnailSrc:D||_,withMeta:!1,x:w?.width,y:w?.height})]})})},A)},e[20]=n,e[21]=s,e[22]=a,e[23]=c,e[24]=h,e[25]=u,e[26]=v):v=e[26],b=di("div",{className:g,children:di(zr,{className:`${$c}__draggable-rows`,ids:r?.map(vO),onDragEnd:x,children:r.map(v)})}),e[8]=n,e[9]=r,e[10]=s,e[11]=f,e[12]=a,e[13]=c,e[14]=h,e[15]=u,e[16]=g,e[17]=b}else b=e[17];return b}function vO(t){let{value:e}=t;return String(e.id)}import{jsx as wS}from"react/jsx-runtime";import"react";var xO="upload upload--has-one";function IS(t){let{className:e,displayPreview:o,fileDoc:n,onRemove:r,readonly:s,reloadDoc:i,serverURL:l}=t,{relationTo:a,value:c}=n,u=String(c?.id),d,f;if(c.url)try{d=new URL(c.url,l).toString()}catch{d=`${l}${c.url}`}if(c.thumbnailURL)try{f=new URL(c.thumbnailURL,l).toString()}catch{f=`${l}${c.thumbnailURL}`}return wS(Hm,{className:[xO,e].filter(Boolean).join(" "),children:wS(zm,{allowEdit:!s,allowRemove:!s,alt:c?.alt||c?.filename,byteSize:c.filesize,collectionSlug:a,displayPreview:o,filename:c.filename,id:u,mimeType:c?.mimeType,onRemove:r,reloadDoc:i,src:d,thumbnailSrc:f||d,x:c?.width,y:c?.height})})}var en="upload";function Xm(t){let{AfterInput:e,allowCreate:o,api:n,BeforeInput:r,className:s,Description:i,description:l,displayPreview:a,Error:c,filterOptions:u,hasMany:d,isSortable:f,Label:m,label:h,localized:p,maxRows:g,onChange:b,path:x,readOnly:v,relationTo:C,required:y,serverURL:I,showError:w,style:A,value:_}=t,[D,T]=Vr.useState(),[S,R]=Vr.useState(Array.isArray(C)?C[0]:C),{openModal:E}=de(),{drawerSlug:F,setCollectionSlug:L,setCurrentActivePath:k,setInitialFiles:N,setMaxFiles:P,setOnSuccess:j}=Wo(),{permissions:V}=Se(),{code:M}=Ee(),{i18n:O,t:B}=$(),G=_S(()=>({...u,[S]:{...u?.[S]||{},id:{...u?.[S]?.id||{},not_in:(u?.[S]?.id?.not_in||[]).concat(...Array.isArray(_)||_?[_]:[])}}}),[_,S,u]),[Y,,{closeDrawer:X,openDrawer:ee}]=kc({collectionSlugs:typeof C=="string"?[C]:C,filterOptions:G}),[q,,{closeDrawer:z,openDrawer:re}]=Yt({collectionSlug:S}),me=Vr.useRef(!1),se=_S(()=>o?!!(typeof S=="string"&&V?.collections&&V.collections?.[S]?.create):!1,[S,V,o]),Z=Vr.useCallback(H=>{typeof b=="function"&&b(H)},[b]),Q=Vr.useCallback(async(H,U)=>{if(!H.length)return;let le={depth:0,draft:!0,limit:H.length,locale:M,where:{and:[{id:{in:H}}]}},De=await fetch(`${I}${n}/${U}`,{body:DS.stringify(le),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 Ne=await De.json(),qe=H.map(Ue=>Ne.docs.find(ke=>String(ke.id)===String(Ue)));return qe.includes(void 0)&&d&&(qe=qe.map((Ue,ke)=>Ue||{id:H[ke],filename:`${B("general:untitled")} - ID: ${H[ke]}`,isPlaceholder:!0})),{...Ne,docs:qe}}return null},[M,I,n,O.language,B,d]),ge=SS(H=>{if(d){let U=[...Array.isArray(_)?_:[],...H.map(le=>le.id)];Z(U),T(le=>[...le||[],...H.map(De=>({relationTo:S,value:De}))])}else{let U=H[0];Z(U.id),T([{relationTo:S,value:U}])}},[_,Z,S,d]),Ie=Vr.useCallback(H=>{let U=H;if(!d&&H&&H.length>1){let le=new DataTransfer;le.items.add(H[0]),U=le.files}U&&N(U),L(C),typeof g=="number"&&P(g),k(x),E(F)},[F,d,E,C,L,N,g,P,x,k]),Fe=Vr.useCallback(async H=>{let U=[];for(let[De,Ne]of H)Ne&&U.push(De);let le=await Q(U,S);le&&T(De=>[...De||[],...le.docs.map(Ne=>({relationTo:S,value:Ne}))]),Z([...Array.isArray(_)?_:[],...U]),X()},[S,X,Z,Q,_]),Le=Vr.useCallback(H=>{H.doc&&(T(U=>[...U||[],{relationTo:S,value:H.doc}]),Z(H.doc.id)),z()},[z,S,Z]),K=SS(async({collectionSlug:H,doc:U})=>{let le=await Q([U.id],H),De=le?le.docs?.[0]:null;T(Ne=>De?d?[...Ne||[],{relationTo:S,value:De}]:[{relationTo:S,value:De}]:Ne),Z(d?[...Array.isArray(_)?_:[],U.id]:U.id),X()},[X,d,Q,Z,_,S]),_e=Vr.useCallback(async(H,U)=>{let{docs:le}=await Q([H],U);if(le[0]){let De=[];T(Ne=>{let qe=Ne?.findIndex(Ue=>(Ue.value?.id===le[0].id||Ue.value?.isPlaceholder)&&Ue.relationTo===U);if(qe>-1){let Ue=[...Ne];return Ue[qe]={relationTo:U,value:le[0]},De=Ue,Ue}}),De.length&&d&&Z(De.map(Ne=>Ne.value?.id))}},[Q,Z,d]),pe=Vr.useCallback(H=>{let U=H.map(({value:le})=>le.id);Z(U),T(H)},[Z]),ce=Vr.useCallback(H=>{let U=H?H.map(({value:le})=>le.id):null;Z(d?U:U?U[0]:null),T(H||[])},[Z,d]);RS(()=>{async function H(){if(_){me.current=!0;let U=await Q(Array.isArray(_)?_:[_],S);U&&T(U.docs.map(le=>({relationTo:S,value:le})))}}me.current||H()},[Q,S,_]),RS(()=>{j(x,ge)},[_,x,ge,j]);let ne=!_||d&&Array.isArray(_)&&(typeof g!="number"||_.length<g)||!d&&D?.[0]&&typeof D[0].value>"u";return mi("div",{className:[Ce,en,s,w&&"error",v&&"read-only"].filter(Boolean).join(" "),id:`field-${x?.replace(/\./g,"__")}`,style:A,children:[kt(oe,{CustomComponent:m,Fallback:kt(be,{label:h,localized:p,path:x,required:y})}),kt("div",{className:`${en}__wrap`,children:kt(oe,{CustomComponent:c,Fallback:kt(Xe,{path:x,showError:w})})}),r,mi("div",{className:`${en}__dropzoneAndUpload`,children:[d&&Array.isArray(_)&&_.length>0?kt(jc,{children:D&&D?.length>0?kt(yS,{displayPreview:a,fileDocs:D,isSortable:f&&!v,onRemove:ce,onReorder:pe,readonly:v,reloadDoc:_e,serverURL:I}):kt("div",{className:`${en}__loadingRows`,children:_.map(H=>kt(wt,{height:"40px"},H))})}):null,!d&&_?kt(jc,{children:D&&D?.length>0&&D[0].value?kt(IS,{displayPreview:a,fileDoc:D[0],onRemove:ce,readonly:v,reloadDoc:_e,serverURL:I}):D&&_&&!D?.[0]?.value?mi(jc,{children:[B("general:untitled")," - ID: ",_]}):kt(wt,{height:"62px"})}):null,ne?kt(ai,{disabled:v||!se,multipleFiles:d,onChange:Ie,children:mi("div",{className:`${en}__dropzoneContent`,children:[mi("div",{className:`${en}__dropzoneContent__buttons`,children:[se&&mi(jc,{children:[kt(ae,{buttonStyle:"pill",className:`${en}__createNewToggler`,disabled:v||!se,onClick:()=>{v||(d?Ie():re())},size:"small",children:B("general:createNew")}),kt("span",{className:`${en}__dropzoneContent__orText`,children:B("general:or")})]}),kt(ae,{buttonStyle:"pill",className:`${en}__listToggler`,disabled:v,onClick:ee,size:"small",children:B("fields:chooseFromExisting")}),kt(q,{onSave:Le}),kt(Y,{allowCreate:se,enableRowSelections:d,onBulkSelect:Fe,onSelect:K})]}),se&&!v&&mi("p",{className:`${en}__dragAndDropText`,children:[B("general:or")," ",B("upload:dragAndDrop")]})]})}):kt(jc,{children:!v&&!D&&(!_||typeof g!="number"||Array.isArray(_)&&_.length<g)?kt(wt,{height:"40px"}):null})]}),e,kt(oe,{CustomComponent:i,Fallback:kt(We,{description:l,path:x})})]})}function IO(t){let{field:e,field:{admin:{allowCreate:o,className:n,description:r,isSortable:s}={},hasMany:i,label:l,localized:a,maxRows:c,relationTo:u,required:d},path:f,readOnly:m,validate:h}=t,{config:p}=W(),g=e.displayPreview,b=yO.useCallback((R,E)=>{if(typeof h=="function")return h(R,{...E,required:d})},[h,d]),{customComponents:{AfterInput:x,BeforeInput:v,Description:C,Error:y,Label:I}={},disabled:w,filterOptions:A,setValue:_,showError:D,value:T}=Te({path:f,validate:b}),S=wO(()=>nt(e),[e]);return CO(Xm,{AfterInput:x,allowCreate:o!==!1,api:p.routes.api,BeforeInput:v,className:n,Description:C,description:r,displayPreview:g,Error:y,filterOptions:A,hasMany:i,isSortable:s,label:l,Label:I,localized:a,maxRows:c,onChange:_,path:f,readOnly:m||w,relationTo:u,required:d,serverURL:p.serverURL,showError:D,style:S,value:T})}var Oc=Oe(IO);function xa(t){let e=SO(13),{clientFieldConfig:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:l,permissions:a,readOnly:c,schemaPath:u}=t,d;e[0]!==l?(d=h=>{let[p]=h;return p&&p?.[l]?.customComponents?.Field},e[0]=l,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]!==l||e[8]!==a||e[9]!==c||e[10]!==u){m=Symbol.for("react.early_return_sentinel");e:{let h={forceRender:n,permissions:a,readOnly:c,schemaPath:u},p={...h,indexPath:r,parentPath:s,parentSchemaPath:i};if(o.admin?.hidden){m=Tt(zl,{...h,path:l});break e}switch(o.type){case"array":{m=Tt(Mc,{...p,field:o,path:l});break e}case"blocks":{m=Tt(wl,{...p,field:o,path:l});break e}case"checkbox":{m=Tt(cr,{...h,field:o,path:l});break e}case"code":{m=Tt(Sl,{...h,field:o,path:l});break e}case"collapsible":{m=Tt(_l,{...p,field:o,path:l});break e}case"date":{m=Tt(Gl,{...h,field:o,path:l});break e}case"email":{m=Tt(Qs,{...h,field:o,path:l});break e}case"group":{m=Tt(Wl,{...p,field:o,path:l});break e}case"join":{m=Tt(tc,{...h,field:o,path:l});break e}case"json":{m=Tt(oc,{...h,field:o,path:l});break e}case"number":{m=Tt(rc,{...h,field:o,path:l});break e}case"point":{m=Tt(nc,{...h,field:o,path:l});break e}case"radio":{m=Tt(ac,{...h,field:o,path:l});break e}case"relationship":{m=Tt(mc,{...h,field:o,path:l});break e}case"richText":{m=Tt(fc,{...h,field:o,path:l});break e}case"row":{m=Tt(pc,{...p,field:o});break e}case"select":{m=Tt(hc,{...h,field:o,path:l});break e}case"tabs":{m=Tt(xc,{...p,field:o,path:l});break e}case"text":{m=Tt(ii,{...h,field:o,path:l});break e}case"textarea":{m=Tt(Cc,{...h,field:o,path:l});break e}case"ui":{let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=Tt(yc,{}),e[12]=g):g=e[12],m=g;break e}case"upload":{m=Tt(Oc,{...h,field:o,path:l});break e}}}e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=l,e[8]=a,e[9]=c,e[10]=u,e[11]=m}else m=e[11];if(m!==Symbol.for("react.early_return_sentinel"))return m}var gb="render-fields",yo=t=>{let e=RO(22),{className:o,fields:n,forceRender:r,margins:s,parentIndexPath:i,parentPath:l,parentSchemaPath:a,permissions:c,readOnly:u}=t,d=Jo();if(n&&n.length>0){let f=s&&`${gb}--margins-${s}`,m=s===!1&&`${gb}--margins-none`,h;e[0]!==o||e[1]!==f||e[2]!==m?(h=[gb,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]!==l||e[9]!==a||e[10]!==c||e[11]!==u||e[12]!==p){let b;e[14]!==r||e[15]!==d||e[16]!==i||e[17]!==l||e[18]!==a||e[19]!==c||e[20]!==u?(b=(x,v)=>{if(!x||_O(x))return null;let{operation:C,permissions:y,read:I}=TO({field:x,operation:d,parentName:l?.includes(".")?l.split(".")[l.split(".").length-1]:l,permissions:c});if("name"in x&&!I)return null;let w=u||x?.admin?.readOnly;w&&x.admin?.readOnly===!1&&(w=!1),"name"in x&&!C&&(w=!0);let{indexPath:A,path:_,schemaPath:D}=DO({field:x,index:v,parentIndexPath:i,parentPath:l,parentSchemaPath:a});return TS(xa,{clientFieldConfig:x,forceRender:r,indexPath:A,parentPath:l,parentSchemaPath:a,path:_,permissions:y,readOnly:w,schemaPath:D},`${_}-${v}`)},e[14]=r,e[15]=d,e[16]=i,e[17]=l,e[18]=a,e[19]=c,e[20]=u,e[21]=b):b=e[21],g=TS(Jx,{className:p,forceRender:r,children:n.map(b)}),e[4]=n,e[5]=r,e[6]=d,e[7]=i,e[8]=l,e[9]=a,e[10]=c,e[11]=u,e[12]=p,e[13]=g}else g=e[13];return g}return null};var Bc="array-field",AS=t=>{let e=AO(42),{addRow:o,attributes:n,CustomRowLabel:r,duplicateRow:s,errorCount:i,fields:l,forceRender:a,hasMaxRows:c,isDragging:u,isLoading:d,isSortable:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:x,readOnly:v,removeRow:C,row:y,rowCount:I,rowIndex:w,schemaPath:A,setCollapse:_,setNodeRef:D,transform:T,transition:S}=t,R=a===void 0?!1:a,E=fd(d,500),{i18n:F}=$(),L=zt(),k=`${EO(m.singular,F)} ${String(w+1).padStart(2,"0")}`,N=i>0&&L,P=N?`${Bc}__row--has-errors`:`${Bc}__row--no-errors`,j;e[0]!==P?(j=[`${Bc}__row`,P].filter(Boolean),e[0]=P,e[1]=j):j=e[1];let V=j.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]!==k||e[9]!==N||e[10]!==l||e[11]!==R||e[12]!==c||e[13]!==F||e[14]!==E||e[15]!==f||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==x||e[21]!==v||e[22]!==C||e[23]!==y.collapsed||e[24]!==y.id||e[25]!==I||e[26]!==w||e[27]!==A||e[28]!==_||e[29]!==D||e[30]!==M||e[31]!==O||e[32]!==T||e[33]!==S){let G;e[35]!==i||e[36]!==N||e[37]!==F?(G=N&&bs(to,{count:i,i18n:F,withMessage:!0}),e[35]=i,e[36]=N,e[37]=F,e[38]=G):G=e[38];let Y;e[39]!==y.id||e[40]!==_?(Y=X=>_(y.id,X),e[39]=y.id,e[40]=_,e[41]=Y):Y=e[41],B=bs("div",{id:M,ref:D,style:{transform:T,transition:S,zIndex:O},children:bs(Gs,{actions:v?void 0:bs(dd,{addRow:o,duplicateRow:s,hasMaxRows:c,index:w,isSortable:f,moveRow:p,removeRow:C,rowCount:I}),className:V,collapsibleStyle:N?"error":"default",dragHandleProps:f?{id:y.id,attributes:n,listeners:h}:void 0,header:FO("div",{className:`${Bc}__row-header`,children:[E?bs(wt,{height:"1rem",width:"8rem"}):bs(sn,{CustomComponent:r,label:k,path:b,rowNumber:w}),G]}),isCollapsed:y.collapsed,onToggle:Y,children:E?bs(wt,{}):bs(yo,{className:`${Bc}__fields`,fields:l,forceRender:R,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:A,permissions:x===!0?x:x?.fields,readOnly:v})})},`${g}-row-${y.id}`),e[2]=r,e[3]=o,e[4]=n,e[5]=V,e[6]=s,e[7]=i,e[8]=k,e[9]=N,e[10]=l,e[11]=R,e[12]=c,e[13]=F,e[14]=E,e[15]=f,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=x,e[21]=v,e[22]=C,e[23]=y.collapsed,e[24]=y.id,e[25]=I,e[26]=w,e[27]=A,e[28]=_,e[29]=D,e[30]=M,e[31]=O,e[32]=T,e[33]=S,e[34]=B}else B=e[34];return B};var br="array-field",LO=t=>{let e=PO(54),{field:o,forceRender:n,path:r,permissions:s,readOnly:i,schemaPath:l,validate:a}=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:x,description:v,isSortable:C}=b,y=C===void 0?!0:C,I=n===void 0?!1:n,w=l??c,A=p??g?1:0,{setDocFieldPreferences:_}=Ae(),{addFieldRow:D,dispatchFields:T,setModified:S}=Me(),R=zt(),{code:E}=Ee(),{i18n:F,t:L}=$(),{config:k}=W(),{localization:N}=k,P;e:{if(N&&N.fallback){let ie=N.defaultLocale;P=E===ie;break e}P=!0}let j=P,V;e[2]!==L?(V=ie=>"labels"in ie&&ie?.labels?ie.labels:"labels"in ie.field&&ie.field.labels?{plural:ie.field.labels?.plural,singular:ie.field.labels?.singular}:"label"in ie.field&&ie.field.label?{plural:void 0,singular:ie.field.label}:{plural:L("general:rows"),singular:L("general:row")},e[2]=L,e[3]=V):V=e[3];let O=V(t),B;e[4]!==j||e[5]!==h||e[6]!==A||e[7]!==g||e[8]!==a?(B=(ie,J)=>{if(!j&&ie===null)return!0;if(typeof a=="function")return a(ie,{...J,maxRows:h,minRows:A,required:g})},e[4]=j,e[5]=h,e[6]=A,e[7]=g,e[8]=a,e[9]=B):B=e[9];let G=B,Y;e[10]!==G||e[11]!==r?(Y={hasRows:!0,path:r,validate:G},e[10]=G,e[11]=r,e[12]=Y):Y=e[12];let{customComponents:X,disabled:ee,errorPaths:q,rows:z,showError:re,valid:me,value:se}=Te(Y),Z;e[13]!==X?(Z=X===void 0?{}:X,e[13]=X,e[14]=Z):Z=e[14];let{AfterInput:Q,BeforeInput:ge,Description:Ie,Error:Fe,Label:Le,RowLabels:K}=Z,_e;e[15]!==z?(_e=z===void 0?[]:z,e[15]=z,e[16]=_e):_e=e[16];let pe=_e,ce;e[17]!==D||e[18]!==r||e[19]!==w?(ce=ie=>{D({path:r,rowIndex:ie,schemaPath:w}),setTimeout(()=>{Gi(`${r}-row-${ie}`)},0)},e[17]=D,e[18]=r,e[19]=w,e[20]=ce):ce=e[20];let ne=ce,H;e[21]!==T||e[22]!==r||e[23]!==S?(H=ie=>{T({type:"DUPLICATE_ROW",path:r,rowIndex:ie}),S(!0),setTimeout(()=>{Gi(`${r}-row-${ie}`)},0)},e[21]=T,e[22]=r,e[23]=S,e[24]=H):H=e[24];let U=H,le;e[25]!==T||e[26]!==r||e[27]!==S?(le=ie=>{T({type:"REMOVE_ROW",path:r,rowIndex:ie}),S(!0)},e[25]=T,e[26]=r,e[27]=S,e[28]=le):le=e[28];let De=le,Ne;e[29]!==T||e[30]!==r||e[31]!==S?(Ne=(ie,J)=>{T({type:"MOVE_ROW",moveFromIndex:ie,moveToIndex:J,path:r}),S(!0)},e[29]=T,e[30]=r,e[31]=S,e[32]=Ne):Ne=e[32];let qe=Ne,Ue;e[33]!==T||e[34]!==r||e[35]!==pe||e[36]!==_?(Ue=ie=>{let{collapsedIDs:J,updatedRows:te}=sd({collapsed:ie,rows:pe});_(r,{collapsed:J}),T({type:"SET_ALL_ROWS_COLLAPSED",path:r,updatedRows:te})},e[33]=T,e[34]=r,e[35]=pe,e[36]=_,e[37]=Ue):Ue=e[37];let ke=Ue,ot;e[38]!==T||e[39]!==r||e[40]!==pe||e[41]!==_?(ot=(ie,J)=>{let{collapsedIDs:te,updatedRows:he}=nd({collapsed:J,rowID:ie,rows:pe});T({type:"SET_ROW_COLLAPSED",path:r,updatedRows:he}),_(r,{collapsed:te})},e[38]=T,e[39]=r,e[40]=pe,e[41]=_,e[42]=ot):ot=e[42];let Ft=ot,Wt=h&&pe.length>=h,mt=q.length,ze=R&&q.length>0,rt=(i||ee)&&pe.length===0,ue=pe.length<A||g&&pe.length===0,ve=ze?`${br}--has-error`:`${br}--has-no-error`,Ve;e[43]!==x||e[44]!==ve?(Ve=[Ce,br,x,ve].filter(Boolean),e[43]=x,e[44]=ve,e[45]=Ve):Ve=e[45];let Ge;e[46]!==Fe||e[47]!==r||e[48]!==re?(Ge=re&&io(oe,{CustomComponent:Fe,Fallback:io(Xe,{path:r,showError:re})}),e[46]=Fe,e[47]=r,e[48]=re,e[49]=Ge):Ge=e[49];let $e;return e[50]!==mt||e[51]!==ze||e[52]!==F?($e=ze&&mt>0&&io(to,{count:mt,i18n:F,withMessage:!0}),e[50]=mt,e[51]=ze,e[52]=F,e[53]=$e):$e=e[53],fi("div",{className:Ve.join(" "),id:`field-${r.replace(/\./g,"__")}`,children:[Ge,fi("header",{className:`${br}__header`,children:[fi("div",{className:`${br}__header-wrap`,children:[fi("div",{className:`${br}__header-content`,children:[io("h3",{className:`${br}__title`,children:io(oe,{CustomComponent:Le,Fallback:io(be,{as:"span",label:f,localized:m,path:r,required:g})})}),$e]}),pe?.length>0&&fi("ul",{className:`${br}__header-actions`,children:[io("li",{children:io("button",{className:`${br}__header-action`,onClick:()=>ke(!0),type:"button",children:L("fields:collapseAll")})}),io("li",{children:io("button",{className:`${br}__header-action`,onClick:()=>ke(!1),type:"button",children:L("fields:showAll")})})]})]}),io(oe,{CustomComponent:Ie,Fallback:io(We,{description:v,path:r})})]}),io(gl,{fieldValue:se,localized:m,path:r}),ge,(pe?.length>0||!me&&(rt||ue))&&fi(zr,{className:`${br}__draggable-rows`,ids:pe.map(kO),onDragEnd:ie=>{let{moveFromIndex:J,moveToIndex:te}=ie;return qe(J,te)},children:[pe.map((ie,J)=>{let{id:te,isLoading:he}=ie,Pe=`${r}.${J}`,je=q?.filter(Ye=>Ye.startsWith(Pe+".")).length;return io(Wn,{disabled:i||ee||!y,id:te,children:Ye=>io(AS,{...Ye,addRow:ne,CustomRowLabel:K?.[J],duplicateRow:U,errorCount:je,fields:d,forceRender:I,hasMaxRows:Wt,isLoading:he,isSortable:y,labels:O,moveRow:qe,parentPath:r,path:Pe,permissions:s,readOnly:i||ee,removeRow:De,row:ie,rowCount:pe?.length,rowIndex:J,schemaPath:w,setCollapse:Ft})},te)}),!me&&fi(NO.Fragment,{children:[rt&&io(yr,{children:L("validation:fieldHasNo",{label:bb(O.plural,F)})}),ue&&io(yr,{type:"error",children:L("validation:requiresAtLeast",{count:A,label:bb(A>1?O.plural:O.singular,F)||L(A>1?"general:rows":"general:row")})})]})]}),!Wt&&!i&&io(ae,{buttonStyle:"icon-label",className:`${br}__add-row`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:()=>{ne(se||0)},children:L("fields:addLabel",{label:bb(O.singular,F)})}),Q]})},Mc=Oe(LO);function kO(t){return t.id}import{c as $O}from"react/compiler-runtime";import{jsx as vb,jsxs as FS}from"react/jsx-runtime";import{confirmPassword as jO}from"payload/shared";import"react";var Vc=t=>{let e=$O(12),{disabled:o,path:n}=t,r=n===void 0?"confirm-password":n,{t:s}=$(),i;e[0]!==r?(i={path:r,validate:OO},e[0]=r,e[1]=i):i=e[1];let{disabled:l,setValue:a,showError:c,value:u}=Te(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]!==l||e[5]!==o||e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==m||e[10]!==u?(h=FS("div",{className:m,children:[vb(be,{htmlFor:"field-confirm-password",label:s("authentication:confirmPassword"),required:!0}),FS("div",{className:`${Ce}__wrap`,children:[vb(Xe,{path:r}),vb("input",{"aria-label":s("authentication:confirmPassword"),autoComplete:"off",disabled:!!(l||o),id:"field-confirm-password",name:"confirm-password",onChange:a,type:"password",value:u||""})]})]}),e[4]=l,e[5]=o,e[6]=r,e[7]=a,e[8]=s,e[9]=m,e[10]=u,e[11]=h):h=e[11],h};function OO(t,e){return jO(t,{name:"confirm-password",type:"text",required:!0,...e})}import{jsx as BO}from"react/jsx-runtime";import{password as VO}from"payload/shared";import{useCallback as GO,useMemo as WO}from"react";import{c as MO}from"react/compiler-runtime";import{jsx as pi,jsxs as xb}from"react/jsx-runtime";import{getTranslation as ES}from"@payloadcms/translations";import"react";var PS=t=>{let e=MO(28),{AfterInput:o,autoComplete:n,BeforeInput:r,className:s,description:i,Description:l,Error:a,inputRef:c,Label:u,label:d,localized:f,onChange:m,onKeyDown:h,path:p,placeholder:g,readOnly:b,required:x,rtl:v,showError:C,style:y,value:I,width:w}=t,A=n===void 0?"off":n,{i18n:_}=$(),D=C&&"error",T=b&&"read-only",S;e[0]!==s||e[1]!==D||e[2]!==T?(S=[Ce,"password",s,D,T].filter(Boolean),e[0]=s,e[1]=D,e[2]=T,e[3]=S):S=e[3];let R=S.join(" "),E;return e[4]!==o||e[5]!==r||e[6]!==l||e[7]!==a||e[8]!==u||e[9]!==A||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]!==x||e[21]!==v||e[22]!==C||e[23]!==y||e[24]!==R||e[25]!==I||e[26]!==w?(E=xb("div",{className:R,style:{...y,width:w},children:[pi(oe,{CustomComponent:u,Fallback:pi(be,{label:d,localized:f,path:p,required:x})}),xb("div",{className:`${Ce}__wrap`,children:[pi(oe,{CustomComponent:a,Fallback:pi(Xe,{path:p,showError:C})}),xb("div",{children:[r,pi("input",{"aria-label":ES(d,_),autoComplete:A,"data-rtl":v,disabled:b,id:`field-${p.replace(/\./g,"__")}`,name:p,onChange:m,onKeyDown:h,placeholder:ES(g,_),ref:c,type:"password",value:I||""}),o]}),pi(oe,{CustomComponent:l,Fallback:pi(We,{description:i,path:p})})]})]}),e[4]=o,e[5]=r,e[6]=l,e[7]=a,e[8]=u,e[9]=A,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]=x,e[21]=v,e[22]=C,e[23]=y,e[24]=R,e[25]=I,e[26]=w,e[27]=E):E=e[27],E};var zO=t=>{let{autoComplete:e,field:o,field:{admin:{className:n,disabled:r,placeholder:s,rtl:i}={},label:l,localized:a,required:c}={},inputRef:u,path:d,validate:f}=t,{t:m}=$(),h=Ee(),{config:p}=W(),g=GO((S,R)=>{let E=d?d.split("."):[];return typeof f=="function"?f(S,{...R,required:c}):VO(S,{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:x,Description:v,Error:C,Label:y}={},disabled:I,setValue:w,showError:A,value:_}=Te({path:d,validate:g}),D=Vi({fieldLocalized:!1,fieldRTL:i,locale:h,localizationConfig:p.localization||void 0}),T=WO(()=>nt(o),[o]);return BO(PS,{AfterInput:b,autoComplete:e,BeforeInput:x,className:n,Description:v,Error:C,inputRef:u,Label:y,label:l,localized:a,onChange:S=>{w(S.target.value)},path:d,placeholder:s,readOnly:I||r,required:c,rtl:D,showError:A,style:T,value:_||""})},Gc=Oe(zO);var NS={array:Mc,blocks:wl,checkbox:cr,code:Sl,collapsible:_l,confirmPassword:Vc,date:Gl,email:Qs,group:Wl,hidden:zl,join:tc,json:oc,number:rc,password:Gc,point:nc,radio:ac,relationship:mc,richText:fc,row:pc,select:hc,tabs:xc,text:ii,textarea:Cc,ui:yc,upload:Oc},HO={...NS,Description:We,Error:Xe,Label:be,RowLabel:sn};import{c as XO}from"react/compiler-runtime";import{setsAreEqual as UO}from"payload/shared";import{useEffect as YO}from"react";var Tn=new Map([]),ZO={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"},LS=t=>(ZO[t.toLowerCase()]||t).trim().toLowerCase().replace("key",""),JO=t=>{let e=LS(t);e==="meta"&&Tn.forEach((o,n)=>n!=="meta"&&Tn.delete(n)),Tn.set(e,Date.now())},qO=t=>{let e=LS(t);e==="meta"&&Tn.clear(),Tn.delete(e)},hi=(t,e)=>{let o=XO(9),{cmdCtrlKey:n,editDepth:r,keyCodes:s}=t,{modalState:i}=de(),l;o[0]!==n||o[1]!==r||o[2]!==e||o[3]!==s||o[4]!==i?(l=f=>{let m=f.detail?.key?f.detail:f;if(m.key===void 0)return;Tn.forEach(QO),m.code&&JO(m.code);let h=window.navigator.userAgent.includes("Mac OS X"),p=[...Tn.keys()].filter(KO);if(UO(new Set(p),new Set(s))&&(!n||h&&Tn.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]=l):l=o[5];let a=l,c=eM,u,d;o[6]!==a?(u=()=>(document.addEventListener("keydown",a,!1),document.addEventListener("bypassKeyDown",a,!1),document.addEventListener("keyup",c,!1),()=>{document.removeEventListener("keydown",a),document.removeEventListener("bypassKeyDown",a),document.removeEventListener("keyup",c)}),d=[a,c],o[6]=a,o[7]=u,o[8]=d):(u=o[7],d=o[8]),YO(u,d)};function QO(t,e){Date.now()-t>3e3&&Tn.delete(e)}function KO(t){return!["alt","ctrl","meta","shift"].includes(t)}function eM(t){t.code&&qO(t.code)}import{c as tM}from"react/compiler-runtime";import*as $S from"qs-esm";import{useEffect as kS,useRef as oM,useState as Um}from"react";var rM=(t,e)=>{let o=tM(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,l;o[2]!==i?(l=i===void 0?{}:i,o[2]=i,o[3]=l):l=o[3];let a=l,{i18n:c}=$(),u;o[4]!==s?(u=s||{},o[4]=s,o[5]=u):u=o[5];let[d,f]=Um(u),[m,h]=Um(a),[p,g]=Um(!s),[b,x]=Um(!1),{code:v}=Ee(),C=oM(!1),y;if(o[6]!==v||o[7]!==m){let E;o[9]!==m?(E=typeof m=="object"?m:{},o[9]=m,o[10]=E):E=o[10],y=$S.stringify({locale:v,...E},{addQueryPrefix:!0}),o[6]=v,o[7]=m,o[8]=y}else y=o[8];let I=y,w;o[11]!==c.language||o[12]!==s||o[13]!==I||o[14]!==t?(w=()=>{if(s&&!C.current){C.current=!0;return}let E=new AbortController;return t?(async()=>{x(!1),g(!0);try{let L=await Ke.get(`${t}${I}`,{headers:{"Accept-Language":c.language},signal:E.signal});L.status>201&&x(!0);let k=await L.json();f(k),g(!1)}catch{E.signal.aborted||(x(!0),g(!1))}})():(x(!1),g(!1)),()=>{try{E.abort()}catch(L){let k=L}}},o[11]=c.language,o[12]=s,o[13]=I,o[14]=t,o[15]=w):w=o[15];let A;o[16]!==c.language||o[17]!==s||o[18]!==v||o[19]!==I||o[20]!==t?(A=[t,v,I,c.language,s],o[16]=c.language,o[17]=s,o[18]=v,o[19]=I,o[20]=t,o[21]=A):A=o[21],kS(w,A);let _,D;o[22]!==s?(_=()=>{s&&C.current&&f(s)},D=[s],o[22]=s,o[23]=_,o[24]=D):(_=o[23],D=o[24]),kS(_,D);let T;o[25]!==d||o[26]!==b||o[27]!==p?(T={data:d,isError:b,isLoading:p},o[25]=d,o[26]=b,o[27]=p,o[28]=T):T=o[28];let S;o[29]===Symbol.for("react.memo_cache_sentinel")?(S={setParams:h},o[29]=S):S=o[29];let R;return o[30]!==T?(R=[T,S],o[30]=T,o[31]=R):R=o[31],R};import{c as nM}from"react/compiler-runtime";import{useEffect as sM,useState as iM}from"react";var aM=t=>{let e=nM(5),[o,n]=iM(),r,s;e[0]!==t?(r=()=>{let l;return t&&(l=new ResizeObserver(a=>{a.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})})}),l.observe(t)),()=>{l&&l.unobserve(t)}},s=[t],e[0]=t,e[1]=r,e[2]=s):(r=e[1],s=e[2]),sM(r,s);let i;return e[3]!==o?(i={size:o},e[3]=o,e[4]=i):i=e[4],i};import{flattenTopLevelFields as lM}from"payload/shared";var Cb=t=>{let{admin:{useAsTitle:e},fields:o}=t;return lM(o)?.find(r=>"name"in r&&r.name===e)};import{jsx as jS}from"react/jsx-runtime";import{toWords as cM,transformColumnsToSearchParams as uM}from"payload/shared";import"react";var dM="query-preset-columns-cell",mM=({cellData:t})=>jS("div",{className:dM,children:t?uM(t).map((e,o)=>{let n=!e.startsWith("-");return n?jS(bt,{pillStyle:n?"always-white":"light",children:cM(e)},o):null}):"No columns selected"});import{jsx as fM}from"react/jsx-runtime";import{toWords as OS}from"payload/shared";import"react";var pM=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`${OS(n)} ${r} ${OS(s)}`}return""},hM=({cellData:t})=>fM("div",{children:t?pM(t):"No where query"});import{jsx as MS,jsxs as BS}from"react/jsx-runtime";import{toWords as VS}from"payload/shared";import{Fragment as gM}from"react";var bM=({cellData:t})=>{let e=["read","update","delete"];return MS("p",{children:e.reduce((o,n,r)=>{let s=t?.[n];return s&&s.constraint&&o.push(BS(gM,{children:[BS("span",{children:[MS("strong",{children:VS(n)}),": ",VS(s.constraint)]}),r!==e.length-1&&", "]},n)),o},[])})};import{c as vM}from"react/compiler-runtime";import{jsx as yb,jsxs as xM}from"react/jsx-runtime";import{toWords as CM,transformColumnsToSearchParams as yM}from"payload/shared";import"react";var wM=t=>{let e=vM(7),{field:o,path:n}=t,{label:r,required:s}=o,i;e[0]!==n?(i={path:n},e[0]=n,e[1]=i):i=e[1];let{value:l}=Te(i),a;return e[2]!==r||e[3]!==n||e[4]!==s||e[5]!==l?(a=xM("div",{className:"field-type query-preset-columns-field",children:[yb(be,{as:"h3",label:r,path:n,required:s}),yb("div",{className:"value-wrapper",children:l?yM(l).map(IM):"No columns selected"})]}),e[2]=r,e[3]=n,e[4]=s,e[5]=l,e[6]=a):a=e[6],a};function IM(t,e){let o=!t.startsWith("-");return yb(bt,{pillStyle:o?"always-white":"light-gray",children:CM(t)},e)}import{c as SM}from"react/compiler-runtime";import{jsx as An,jsxs as Ym}from"react/jsx-runtime";import{getTranslation as RM}from"@payloadcms/translations";import{toWords as GS}from"payload/shared";import WS from"react";var _M=(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],l=r[s][i];if(typeof l=="object")try{l=new Date(l).toLocaleDateString()}catch{l="Unknown error has occurred"}return Ym(bt,{pillStyle:"always-white",children:[An("b",{children:GS(s)})," ",i," ",An("b",{children:GS(l)})]})};return((r,s)=>r.or&&r.or.length>0?An("div",{className:"or-condition",children:r.or.map((i,l)=>An(WS.Fragment,{children:i.and&&i.and.length>0?Ym("div",{className:"and-condition",children:[l===0&&An("span",{className:"label",children:`Filter ${s} where `}),l>0&&An("span",{className:"label",children:" or "}),i.and.map((a,c)=>Ym(WS.Fragment,{children:[o(a),c<i.and.length-1&&An("span",{className:"label",children:" and "})]},c))]}):o(i)},l))}):o(r))(t,e)},DM=t=>{let e=SM(2),{field:o,path:n}=t,{label:r,required:s}=o,i;e[0]!==n?(i={path:n},e[0]=n,e[1]=i):i=e[1];let{value:l}=Te(i),{collectionSlug:a}=so(),{getEntityConfig:c}=W(),u=c({collectionSlug:a}),{i18n:d}=$();return Ym("div",{className:"field-type query-preset-where-field",children:[An(be,{as:"h3",label:r,path:n,required:s}),An("div",{className:"value-wrapper",children:l?_M(l,RM(u.labels.plural,d)):"No where query"})]})};import{c as LM}from"react/compiler-runtime";import{jsx as kM}from"react/jsx-runtime";import $M from"react";import{c as TM}from"react/compiler-runtime";import{useRouter as AM}from"next/navigation.js";import{useEffect as wb,useRef as FM}from"react";function EM(t,...e){t&&t.addEventListener&&t.addEventListener(...e)}function PM(t,...e){t&&t.removeEventListener&&t.removeEventListener(...e)}var NM=(t,e)=>{let o=TM(7),n=t===void 0?!0:t,r;o[0]!==n||o[1]!==e?(r=a=>{if(typeof n!="function"||n())return a.preventDefault(),e&&(a.returnValue=e),e},o[0]=n,o[1]=e,o[2]=r):r=o[2];let s=r,i,l;o[3]!==n||o[4]!==s?(i=()=>{if(n)return EM(window,"beforeunload",s),()=>PM(window,"beforeunload",s)},l=[n,s],o[3]=n,o[4]=s,o[5]=i,o[6]=l):(i=o[5],l=o[6]),wb(i,l)},zS=({hasAccepted:t=!1,message:e="Are you sure want to leave this page?",onAccept:o,onPrevent:n,prevent:r=!0})=>{NM(r,e);let{startRouteTransition:s}=it(),i=AM(),l=FM("");wb(()=>{function a(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=a(h,p),b=m.download!=="",x=m.target==="_blank"||d.metaKey||d.ctrlKey;!(p===h||g||b||x)&&r&&(n||!window.confirm(e))&&(l.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]),wb(()=>{t&&l.current&&(o&&o(),s(()=>i.push(l.current)))},[t,o,i,s])};var Zm="leave-without-saving",Wc=()=>{let t=LM(15),{closeModal:e,openModal:o}=de(),n=Ht(),{isValid:r}=Me(),{user:s}=Se(),[i,l]=$M.useState(!1),{t:a}=$(),c=!!((n||!r)&&s),u;t[0]!==o?(u=()=>{o(Zm)},t[0]=o,t[1]=u):u=t[1];let d=u,f;t[2]!==e?(f=()=>{e(Zm)},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],zS(h);let p;t[9]!==e?(p=()=>{e(Zm)},t[9]=e,t[10]=p):p=t[10];let g=p,b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{l(!0)},t[11]=b):b=t[11];let x=b,v;return t[12]!==g||t[13]!==a?(v=kM(It,{body:a("general:changesNotSaved"),cancelLabel:a("general:stayOnThisPage"),confirmLabel:a("general:leaveAnyway"),heading:a("general:leaveWithoutSaving"),modalSlug:Zm,onCancel:g,onConfirm:x}),t[12]=g,t[13]=a,t[14]=v):v=t[14],v};import{c as jM}from"react/compiler-runtime";import{jsx as zc,jsxs as Ib}from"react/jsx-runtime";import{useEffect as OM}from"react";var Da="document-take-over",Jm="document-take-over",Sb=t=>{let e=jM(17),{handleBackToDashboard:o,isActive:n,onReadOnly:r}=t,{closeModal:s,openModal:i}=de(),{t:l}=$(),{startRouteTransition:a}=it(),c,u;e[0]!==s||e[1]!==n||e[2]!==i?(c=()=>{n?i(Da):s(Da)},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]),OM(c,u);let d;if(e[5]!==s||e[6]!==o||e[7]!==r||e[8]!==a||e[9]!==l){let f;e[11]!==o||e[12]!==a?(f=()=>{a(()=>o())},e[11]=o,e[12]=a,e[13]=f):f=e[13];let m;e[14]!==s||e[15]!==r?(m=()=>{r(),s(Da)},e[14]=s,e[15]=r,e[16]=m):m=e[16],d=zc(Xo,{className:Jm,slug:Da,children:Ib("div",{className:`${Jm}__wrapper`,children:[Ib("div",{className:`${Jm}__content`,children:[zc("h1",{children:l("general:editingTakenOver")}),zc("p",{children:l("general:anotherUserTakenOver")})]}),Ib("div",{className:`${Jm}__controls`,children:[zc(ae,{buttonStyle:"primary",id:`${Da}-back-to-dashboard`,onClick:f,size:"large",children:l("general:backToDashboard")}),zc(ae,{buttonStyle:"secondary",id:`${Da}-view-read-only`,onClick:m,size:"large",children:l("general:viewReadOnly")})]})]})}),e[5]=s,e[6]=o,e[7]=r,e[8]=a,e[9]=l,e[10]=d}else d=e[10];return d};import{c as MM}from"react/compiler-runtime";import{jsx as gi,jsxs as Hc}from"react/jsx-runtime";import{useEffect as BM}from"react";var qm=t=>t&&typeof t=="object";var vs="document-locked",Qm="document-locked",VM=t=>t?new Intl.DateTimeFormat("en-US",{day:"numeric",hour:"numeric",hour12:!0,minute:"numeric",month:"short",year:"numeric"}).format(t):"",Rb=t=>{let e=MM(30),{handleGoBack:o,isActive:n,onReadOnly:r,onTakeOver:s,updatedAt:i,user:l}=t,{closeModal:a,openModal:c}=de(),{t:u}=$(),{startRouteTransition:d}=it(),f,m;e[0]!==a||e[1]!==n||e[2]!==c?(f=()=>{n?c(vs):a(vs)},m=[n,c,a],e[0]=a,e[1]=n,e[2]=c,e[3]=f,e[4]=m):(f=e[3],m=e[4]),BM(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]!==a||e[9]!==o||e[10]!==r||e[11]!==s||e[12]!==d||e[13]!==u||e[14]!==h||e[15]!==i||e[16]!==l){let g;e[18]!==u||e[19]!==l?(g=qm(l)?l.email??l.id:`${u("general:user")}: ${l}`,e[18]=u,e[19]=l,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 x;e[24]!==a||e[25]!==r?(x=()=>{r(),a(vs)},e[24]=a,e[25]=r,e[26]=x):x=e[26];let v;e[27]!==a||e[28]!==s?(v=()=>{s(),a(vs)},e[27]=a,e[28]=s,e[29]=v):v=e[29],p=gi(Xo,{className:Qm,onClose:h,slug:vs,children:Hc("div",{className:`${Qm}__wrapper`,children:[Hc("div",{className:`${Qm}__content`,children:[gi("h1",{children:u("general:documentLocked")}),Hc("p",{children:[gi("strong",{children:g})," ",u("general:currentlyEditing")]}),Hc("p",{children:[u("general:editedSince")," ",gi("strong",{children:VM(i)})]})]}),Hc("div",{className:`${Qm}__controls`,children:[gi(ae,{buttonStyle:"secondary",id:`${vs}-go-back`,onClick:b,size:"large",children:u("general:goBack")}),gi(ae,{buttonStyle:"secondary",id:`${vs}-view-read-only`,onClick:x,size:"large",children:u("general:viewReadOnly")}),gi(ae,{buttonStyle:"primary",id:`${vs}-take-over`,onClick:v,size:"large",children:u("general:takeOver")})]})]})}),e[8]=a,e[9]=o,e[10]=r,e[11]=s,e[12]=d,e[13]=u,e[14]=h,e[15]=i,e[16]=l,e[17]=p}else p=e[17];return p};import{jsx as Km}from"react/jsx-runtime";import"react";var HS=({elements:t,translationString:e})=>{let o=/(<[^>]+>.*?<\/[^>]+>)/g,n=e.split(o);return Km("span",{children:n.map((r,s)=>{if(t&&r.startsWith("<")&&r.endsWith(">")){let i=r[1],l=t[i];if(l){let a=new RegExp(`<${i}>(.*?)</${i}>`,"g"),c=r.replace(a,(u,d)=>d);return Km(l,{children:Km(HS,{translationString:c})},s)}}return r})})},bi=({elements:t,i18nKey:e,t:o,variables:n})=>{let r=o(e,n||{});return t?Km(HS,{elements:t,translationString:r}):r};import{c as GM}from"react/compiler-runtime";import{jsx as WM}from"react/jsx-runtime";import{getTranslation as zM}from"@payloadcms/translations";import iDe from"react";function _b(t){let e=GM(3),{i18n:o}=$(),{description:n}=t;if(n){let r;return e[0]!==n||e[1]!==o?(r=WM("div",{className:"custom-view-description",children:zM(n,o)}),e[0]=n,e[1]=o,e[2]=r):r=e[2],r}return null}import{jsx as zo,jsxs as nf}from"react/jsx-runtime";import{formatAdminURL as AB}from"payload/shared";import{useEffect as FB,useRef as EB,useState as PB}from"react";import{c as ZM}from"react/compiler-runtime";import{jsx as r4}from"react/jsx-runtime";import{usePathname as JM}from"next/navigation.js";import{formatAdminURL as qM}from"payload/shared";import"react";import{jsx as Db,jsxs as HM}from"react/jsx-runtime";import"react";var Xc="graphic-account",XS=t=>HM("svg",{className:[Xc,t?.active&&`${Xc}--active`].filter(Boolean).join(" "),height:"25",viewBox:"0 0 25 25",width:"25",xmlns:"http://www.w3.org/2000/svg",children:[Db("circle",{className:`${Xc}__bg`,cx:"12.5",cy:"12.5",r:"11.5"}),Db("circle",{className:`${Xc}__head`,cx:"12.5",cy:"10.73",r:"3.98"}),Db("path",{className:`${Xc}__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 t4=Is(e4(),1);import{c as UM}from"react/compiler-runtime";import{jsx as YM}from"react/jsx-runtime";import"react";var o4=()=>{let t=UM(2),{user:e}=Se(),o=(0,t4.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=YM("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 Fb=()=>{let t=ZM(3),{config:e}=W(),{admin:o,routes:n}=e,{avatar:r,routes:s}=o,{account:i}=s,{admin:l}=n,{user:a}=Se(),u=JM()===qM({adminRoute:l,path:i});if(!a?.email||r==="default"){let d;return t[0]!==u?(d=r4(XS,{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=r4(o4,{}),t[2]=d):d=t[2],d}};import{c as QM}from"react/compiler-runtime";import{jsx as KM}from"react/jsx-runtime";import{createContext as eB,use as tB,useState as oB}from"react";var n4=eB({Actions:{},setViewActions:()=>{}}),Eb=()=>tB(n4),rB=t=>{let e=QM(4),{Actions:o,children:n}=t,[r,s]=oB(o),i;return e[0]!==o||e[1]!==n||e[2]!==r?(i=KM(n4,{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 nB}from"react/compiler-runtime";import{jsx as ef,jsxs as a4}from"react/jsx-runtime";import"react";import{jsx as s4}from"react/jsx-runtime";import"react";var Pb=()=>s4("svg",{className:"icon icon--close-menu",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:s4("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})});import{jsx as i4}from"react/jsx-runtime";import"react";var Nb=()=>i4("svg",{className:"icon icon--menu",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:i4("path",{className:"stroke",d:"M4.66667 10H15.3333M4.66667 6H15.3333M4.66667 14H15.3333",strokeLinecap:"square"})});var Lb="hamburger",kb=t=>{let e=nB(4),{t:o}=$(),{closeIcon:n,isActive:r}=t,s=n===void 0?"x":n,i=r===void 0?!1:r,l;return e[0]!==s||e[1]!==i||e[2]!==o?(l=a4("div",{className:Lb,children:[!i&&ef("div",{"aria-label":o("general:open"),className:`${Lb}__open-icon`,title:o("general:open"),children:ef(Nb,{})}),i&&a4("div",{"aria-label":o(s==="collapse"?"general:collapse":"general:close"),className:`${Lb}__close-icon`,title:o(s==="collapse"?"general:collapse":"general:close"),children:[s==="x"&&ef(Pb,{}),s==="collapse"&&ef(Je,{direction:"left"})]})]}),e[0]=s,e[1]=i,e[2]=o,e[3]=l):l=e[3],l};import{c as aB}from"react/compiler-runtime";import{jsx as vi,jsxs as lB}from"react/jsx-runtime";import{getTranslation as cB}from"@payloadcms/translations";import{useRouter as uB}from"next/navigation.js";import*as of from"qs-esm";import{Fragment as dB}from"react";import{c as sB}from"react/compiler-runtime";import{jsx as l4,jsxs as $b}from"react/jsx-runtime";import{getTranslation as iB}from"@payloadcms/translations";import"react";var Uc="localizer-button",tf=t=>{let e=sB(12),{ariaLabel:o,className:n}=t,r=Ee(),{i18n:s,t:i}=$(),l;e[0]!==o||e[1]!==i?(l=o||i("general:locale"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let a;e[3]!==n?(a=[Uc,n].filter(Boolean),e[3]=n,e[4]=a):a=e[4];let c=a.join(" "),u=r?r.code:void 0,d=`${i("general:locale")}:`,f;return e[5]!==s||e[6]!==r.label||e[7]!==l||e[8]!==c||e[9]!==u||e[10]!==d?(f=$b("div",{"aria-label":l,className:c,"data-locale":u,children:[$b("div",{className:`${Uc}__label`,children:[d,"\xA0"]}),$b("div",{className:`${Uc}__current`,children:[l4("span",{className:`${Uc}__current-label`,children:`${iB(r.label,s)}`}),l4(Je,{className:`${Uc}__chevron`,size:"small"})]})]}),e[5]=s,e[6]=r.label,e[7]=l,e[8]=c,e[9]=u,e[10]=d,e[11]=f):f=e[11],f};var jb="localizer",c4=t=>{let e=aB(17),{className:o}=t,{config:n}=W(),{localization:r}=n,s=uB(),{startRouteTransition:i}=it(),{setLocaleIsLoading:l}=od(),{i18n:a}=$(),c=Ee();if(r){let{locales:u}=r,d;e[0]!==o?(d=[jb,o].filter(Boolean),e[0]=o,e[1]=d):d=e[1];let f=d.join(" "),m;if(e[2]!==a||e[3]!==c.code||e[4]!==u||e[5]!==s||e[6]!==l||e[7]!==i||e[8]!==f){let h;e[10]!==a||e[11]!==c.code||e[12]!==u||e[13]!==s||e[14]!==l||e[15]!==i?(h=p=>{let{close:g}=p;return vi(Be.ButtonGroup,{children:u.map(b=>{let x=cB(b.label,a);return vi(Be.Button,{active:c.code===b.code,disabled:c.code===b.code,onClick:()=>{l(!0),g();let v=new URLSearchParams(window.location.search),C=of.stringify({...of.parse(v.toString(),{depth:10,ignoreQueryPrefix:!0}),locale:b.code},{addQueryPrefix:!0});i(()=>{s.push(C)})},children:x!==b.code?lB(dB,{children:[x,"\xA0",vi("span",{className:`${jb}__locale-code`,"data-locale":b.code,children:`(${b.code})`})]}):vi("span",{className:`${jb}__locale-code`,"data-locale":b.code,children:x})},b.code)})})},e[10]=a,e[11]=c.code,e[12]=u,e[13]=s,e[14]=l,e[15]=i,e[16]=h):h=e[16],m=vi("div",{className:f,children:vi(fo,{button:vi(tf,{}),horizontalAlign:"right",render:h,showScrollbar:!0,size:"large"})}),e[2]=a,e[3]=c.code,e[4]=u,e[5]=s,e[6]=l,e[7]=i,e[8]=f,e[9]=m}else m=e[9];return m}return null};import{jsx as mB}from"react/jsx-runtime";import{usePathname as fB}from"next/navigation.js";import Zc,{useEffect as Yc,useRef as pB}from"react";var u4=Zc.createContext({hydrated:!1,navOpen:!0,navRef:null,setNavOpen:()=>{},shouldAnimate:!1}),xi=()=>Zc.use(u4),hB=async t=>{let o=(await t("nav"))?.open;return typeof o=="boolean"?o:!0},d4=({children:t,initialIsOpen:e})=>{let{breakpoints:{l:o,m:n,s:r}}=xo(),s=fB(),{getPreference:i}=Do(),l=pB(null),[a,c]=Zc.useState(e),[u,d]=Zc.useState(!1),[f,m]=Zc.useState(!1);return Yc(()=>{o===!1&&(async()=>{let p=await hB(i);c(p)})()},[o,i,c]),Yc(()=>{r===!0&&c(!1)},[s]),Yc(()=>{l.current&&(a&&n?l.current.style.overscrollBehavior="contain":l.current.style.overscrollBehavior="auto")},[a,n]),Yc(()=>{(o===!0||n===!0||r===!0)&&c(!1),m(!0),setTimeout(()=>{d(!0)},100)},[o,n,r]),Yc(()=>()=>{l.current&&(l.current.style.overscrollBehavior="auto")},[]),mB(u4,{value:{hydrated:f,navOpen:a,navRef:l,setNavOpen:c,shouldAnimate:u},children:t})};import{c as gB}from"react/compiler-runtime";import{jsx as bB}from"react/jsx-runtime";import"react";var m4="nav-toggler",Ob=t=>{let e=gB(15),{id:o,children:n,className:r,tabIndex:s}=t,i=s===void 0?0:s,{t:l}=$(),{setPreference:a}=Do(),{navOpen:c,setNavOpen:u}=xi(),{breakpoints:d}=xo(),{l:f}=d,m=`${l(c?"general:close":"general:open")} ${l("general:menu")}`,h=c&&`${m4}--is-open`,p;e[0]!==r||e[1]!==h?(p=[m4,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]!==a?(b=async()=>{u(!c),f||await a("nav",{open:!c},!0)},e[3]=f,e[4]=c,e[5]=u,e[6]=a,e[7]=b):b=e[7];let x;return e[8]!==n||e[9]!==o||e[10]!==m||e[11]!==g||e[12]!==b||e[13]!==i?(x=bB("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]=x):x=e[14],x};import{c as DB}from"react/compiler-runtime";import{jsx as Io,jsxs as h4}from"react/jsx-runtime";import{getTranslation as TB}from"@payloadcms/translations";import{Fragment as g4}from"react";import{jsx as f4,jsxs as vB}from"react/jsx-runtime";import"react";var rf=({fill:t})=>{let e=t||"var(--theme-elevation-1000)";return vB("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:[f4("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}),f4("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 xB}from"react/compiler-runtime";import{jsx as CB}from"react/jsx-runtime";import{createContext as yB,use as wB,useState as IB}from"react";var Fn=()=>wB(p4),p4=yB({}),Mb=t=>{let e=xB(4),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];let[r,s]=IB(n),i;return e[1]!==o||e[2]!==r?(i=CB(p4,{value:{setStepNav:s,stepNav:r},children:o}),e[1]=o,e[2]=r,e[3]=i):i=e[3],i};import{c as SB}from"react/compiler-runtime";import{useEffect as RB}from"react";var _B=t=>{let e=SB(4),{nav:o}=t,{setStepNav:n}=Fn(),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]),RB(r,s),null};var Jc="step-nav",b4=t=>{let e=DB(7),{className:o,CustomIcon:n}=t,{i18n:r}=$(),{stepNav:s}=Fn(),{config:i}=W(),{routes:l}=i,{admin:a}=l,{t:c}=$(),u;return e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==r||e[4]!==s||e[5]!==c?(u=Io(g4,{children:s.length>0?h4("nav",{className:[Jc,o].filter(Boolean).join(" "),children:[Io(Kt,{className:`${Jc}__home`,href:a,prefetch:!1,tabIndex:0,children:Io("span",{title:c("general:dashboard"),children:Io(oe,{CustomComponent:n,Fallback:Io(rf,{})})})}),Io("span",{children:"/"}),s.map((d,f)=>{let m=TB(d.label,r);return s.length===f+1?Io("span",{className:`${Jc}__last`,children:m},f):h4(g4,{children:[d.url?Io(Kt,{href:d.url,prefetch:!1,children:Io("span",{children:m},f)}):Io("span",{children:m},f),Io("span",{children:"/"})]},f)})]}):Io("div",{className:[Jc,o].filter(Boolean).join(" "),children:Io("div",{className:`${Jc}__home`,children:Io("span",{title:c("general:dashboard"),children:Io(oe,{CustomComponent:n,Fallback:Io(rf,{})})})})})}),e[0]=n,e[1]=a,e[2]=o,e[3]=r,e[4]=s,e[5]=c,e[6]=u):u=e[6],u};var So="app-header";function NB({CustomAvatar:t,CustomIcon:e}){let{t:o}=$(),{Actions:n}=Eb(),{config:{admin:{routes:{account:r}},localization:s,routes:{admin:i}}}=W(),{navOpen:l}=xi(),a=EB(null),[c,u]=PB(!1);FB(()=>{let f=()=>{let m=a.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 nf("header",{className:[So,l&&`${So}--nav-open`].filter(Boolean).join(" "),children:[zo("div",{className:`${So}__bg`}),zo("div",{className:`${So}__content`,children:nf("div",{className:`${So}__wrapper`,children:[zo(Ob,{className:`${So}__mobile-nav-toggler`,tabIndex:-1,children:zo(kb,{})}),nf("div",{className:`${So}__controls-wrapper`,children:[zo("div",{className:`${So}__step-nav-wrapper`,children:zo(b4,{className:`${So}__step-nav`,CustomIcon:e})}),nf("div",{className:`${So}__actions-wrapper`,children:[zo("div",{className:`${So}__actions`,ref:a,children:d.map((f,m)=>zo("div",{className:c&&m===d.length-1?`${So}__last-action`:"",children:f},m))}),c&&zo("div",{className:`${So}__gradient-placeholder`})]}),s&&zo(tf,{ariaLabel:"invisible",className:`${So}__localizer-spacing`}),zo(Kt,{"aria-label":o("authentication:account"),className:`${So}__account`,href:AB({adminRoute:i,path:r}),prefetch:!1,tabIndex:0,children:zo(oe,{CustomComponent:t,Fallback:zo(Fb,{})})})]})]})}),zo(c4,{className:`${So}__localizer`})]})}import{jsx as Bb,jsxs as LB}from"react/jsx-runtime";import"react";var qc="card",kB=t=>{let{id:e,actions:o,buttonAriaLabel:n,href:r,onClick:s,title:i,titleAs:l}=t,a=[qc,e,(s||r)&&`${qc}--has-onclick`].filter(Boolean).join(" ");return LB("div",{className:a,id:e,children:[Bb(l??"div",{className:`${qc}__title`,children:i}),o&&Bb("div",{className:`${qc}__actions`,children:o}),(s||r)&&Bb(ae,{"aria-label":n,buttonStyle:"none",className:`${qc}__click`,el:"link",onClick:s,to:r})]})};import{c as $B}from"react/compiler-runtime";import{jsx as xs,jsxs as sf}from"react/jsx-runtime";import{getTranslation as jB}from"@payloadcms/translations";import{useRouter as OB}from"next/navigation.js";import Ta from"react";var af="copy-locale-data",lf="copy-locale",Vb=()=>{let t=$B(38),{config:e}=W(),{localization:o,routes:n,serverURL:r}=e,{admin:s}=n,{code:i}=Ee(),{id:l,collectionSlug:a,globalSlug:c}=Ae(),{i18n:u,t:d}=$(),f=Ht(),{toggleModal:m}=de(),{copyDataFromLocale:h}=Dt(),p=OB(),{startRouteTransition:g}=it(),b;t[0]!==o?(b=o&&o.locales.map(MB)||[],t[0]=o,t[1]=b):b=t[1];let x=b,v;t[2]!==i?(v=G=>G.value!==i,t[2]=i,t[3]=v):v=t[3];let C=x.filter(v),y;t[4]!==u||t[5]!==o?(y=G=>{let Y=o&&o.locales.find(X=>X.code===G);return Y&&Y.label?jB(Y.label,u):G},t[4]=u,t[5]=o,t[6]=y):y=t[6];let I=y,[w,A]=Ta.useState(!1),[_,D]=Ta.useState(null),[T,S]=Ta.useState(i),[R,E]=Ta.useState(!1),F,L;t[7]!==i||t[8]!==T?(F=()=>{T!==i&&S(i)},L=[i,T],t[7]=i,t[8]=T,t[9]=F,t[10]=L):(F=t[9],L=t[10]),Ta.useEffect(F,L);let k;t[11]!==s||t[12]!==a||t[13]!==h||t[14]!==c||t[15]!==l||t[16]!==R||t[17]!==p||t[18]!==r||t[19]!==g||t[20]!==m?(k=async G=>{let{from:Y,to:X}=G;A(!0);try{await h({collectionSlug:a,docID:l,fromLocale:Y,globalSlug:c,overrideData:R,toLocale:X}),A(!1),g(()=>p.push(`${r}${s}/${a?`collections/${a}/${l}`:`globals/${c}`}?locale=${X}`)),m(lf)}catch(ee){let q=ee;fe.error(q.message)}},t[11]=s,t[12]=a,t[13]=h,t[14]=c,t[15]=l,t[16]=R,t[17]=p,t[18]=r,t[19]=g,t[20]=m,t[21]=k):k=t[21];let N=k;if(!l&&!c)return null;let P;t[22]!==f||t[23]!==d||t[24]!==m?(P=()=>{f?fe.info(d("general:unsavedChanges")):m(lf)},t[22]=f,t[23]=d,t[24]=m,t[25]=P):P=t[25];let j;t[26]!==m?(j=()=>{m(lf)},t[26]=m,t[27]=j):j=t[27];let V;t[28]!==N||t[29]!==w||t[30]!==T||t[31]!==d||t[32]!==_?(V=async()=>{if(T===_){fe.error(d("localization:cannotCopySameLocale"));return}w||await N({from:T,to:_})},t[28]=N,t[29]=w,t[30]=T,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&&S(G.value)},t[34]=M):M=t[34];let O;t[35]===Symbol.for("react.memo_cache_sentinel")?(O=G=>{G?.value&&D(G.value)},t[35]=O):O=t[35];let B;return t[36]!==R?(B=()=>E(!R),t[36]=R,t[37]=B):B=t[37],sf(Ta.Fragment,{children:[xs(Be.Button,{id:`${af}__button`,onClick:P,children:d("localization:copyToLocale")}),sf(Pt,{className:af,gutter:!1,Header:xs(ba,{onClose:j,title:d("localization:copyToLocale")}),slug:lf,children:[sf("div",{className:`${af}__sub-header`,children:[xs("span",{children:T&&_?xs("div",{children:d("localization:copyFromTo",{from:I(T),to:I(_)})}):d("localization:selectLocaleToCopy")}),xs(ae,{buttonStyle:"primary",disabled:!T||!_,iconPosition:"left",onClick:V,size:"medium",children:w?d("general:copying")+"...":d("general:copy")})]}),sf("div",{className:`${af}__content`,children:[xs(fa,{label:d("localization:copyFrom"),name:"fromLocale",onChange:M,options:x,path:"fromLocale",readOnly:!0,value:T}),xs(fa,{label:d("localization:copyTo"),name:"toLocale",onChange:O,options:C,path:"toLocale",value:_}),xs(cr,{checked:R,field:{name:"overwriteExisting",label:d("general:overwriteExistingData")},onChange:B,path:"overwriteExisting"})]})]})]})};function MB(t){return{label:t.label,value:t.code}}import{jsx as w4,jsxs as QB}from"react/jsx-runtime";import{getTranslation as I4}from"@payloadcms/translations";import{useRouter as KB,useSearchParams as e7}from"next/navigation.js";import{mergeListSearchAndWhere as t7}from"payload/shared";import*as R4 from"qs-esm";import o7,{useCallback as S4}from"react";import{c as BB}from"react/compiler-runtime";import{jsx as VB}from"react/jsx-runtime";import{usePathname as GB,useRouter as WB}from"next/navigation.js";import{createContext as zB,use as HB,useEffect as XB}from"react";var v4=zB({clearRouteCache:()=>{}}),Gb=t=>{let e=BB(10),{children:o}=t,n=GB(),r=WB(),s;e[0]!==r?(s=()=>{r.refresh()},e[0]=r,e[1]=s):s=e[1];let i=s,l;e[2]!==i?(l=()=>{i()},e[2]=i,e[3]=l):l=e[3];let a;e[4]!==i||e[5]!==n?(a=[n,i],e[4]=i,e[5]=n,e[6]=a):a=e[6],XB(l,a);let c;return e[7]!==o||e[8]!==i?(c=VB(v4,{value:{clearRouteCache:i},children:o}),e[7]=o,e[8]=i,e[9]=c):c=e[9],c},En=()=>HB(v4);import{jsx as UB}from"react/jsx-runtime";import{useSearchParams as YB}from"next/navigation.js";import*as C4 from"qs-esm";import{createContext as ZB,use as JB,useCallback as Wb,useEffect as x4,useRef as qB,useState as zb}from"react";var bo=function(t){return t.AllAvailable="allAvailable",t.AllInPage="allInPage",t.None="none",t.Some="some",t}({}),y4=ZB({}),Hb=({children:t,docs:e=[],totalDocs:o,user:n})=>{let r=qB({}),{code:s}=Ee(),[i,l]=zb(()=>{let g=new Map;return e.forEach(({id:b})=>{g.set(b,!1)}),g}),[a,c]=zb("none"),[u,d]=zb(0),f=YB(),m=Wb((g=!1)=>{let b=new Map;g?(c("allAvailable"),e.forEach(({id:x,_isLocked:v,_userEditing:C})=>{(!v||C?.id===n?.id)&&b.set(x,!0)})):a==="allAvailable"||a==="allInPage"?c("none"):e.forEach(({id:x,_isLocked:v,_userEditing:C})=>{(!v||C?.id===n?.id)&&b.set(x,a!=="some")}),l(b)},[e,a,n?.id]),h=Wb(g=>{let b=e.find(y=>y.id===g);if(b?._isLocked&&n?.id!==b?._userEditing.id)return;let x=i.get(g),v=typeof x=="boolean"?!x:!0,C=new Map(i.set(g,v));a==="allAvailable"&&!v&&c("some"),l(C)},[i,e,a,n?.id]),p=Wb(g=>{let b;if(a==="allAvailable")b=Nr(f)?.where||{id:{not_equals:""}};else{let x=[];for(let[v,C]of i)C&&x.push(v);b={id:{in:x}}}return g&&(b={and:[{...g},b]}),C4.stringify({locale:s,where:b},{addQueryPrefix:!0})},[a,i,s,f]);return x4(()=>{if(a==="allAvailable")return;let g=!1,b=!0;if(!i.size)b=!1,g=!1;else for(let[x,v]of i)b=b&&v,g=g||v;b&&i.size===e.length?c("allInPage"):c(g?"some":"none")},[a,i,o,e]),x4(()=>{let g=0;if(a==="allAvailable")g=o;else for(let[b,x]of i)x&&g++;d(g)},[a,i,o]),r.current={count:u,getQueryParams:p,selectAll:a,selected:i,setSelection:h,toggleAll:m,totalDocs:o},UB(y4,{value:r.current,children:t})},Qt=()=>JB(y4);var r7="delete-documents",Xb=t=>{let{collection:e,collection:{slug:o,labels:{plural:n,singular:r}}={}}=t,{permissions:s}=Se(),{config:{routes:{api:i},serverURL:l}}=W(),{openModal:a}=de(),{count:c,getQueryParams:u,selectAll:d,toggleAll:f}=Qt(),{i18n:m,t:h}=$(),p=KB(),g=e7(),{clearRouteCache:b}=En(),v=s?.collections?.[o]?.delete,C=`delete-${o}`,y=S4(()=>{fe.error(h("error:unknown"))},[h]),I=S4(async()=>{let w=t7({collectionConfig:e,search:g.get("search")}),A=u(w);await Ke.delete(`${l}${i}/${o}${A}`,{headers:{"Accept-Language":m.language,"Content-Type":"application/json"}}).then(async _=>{try{let D=await _.json(),T=D?.docs.length||0,S=T>1?n:r;if(_.status<400||T>0)return fe.success(h("general:deletedCountSuccessfully",{count:T,label:I4(S,m)})),D?.errors.length>0&&fe.error(D.message,{description:D.errors.map(R=>R.message).join(`
55
55
  `)}),f(),p.replace(R4.stringify({page:d?"1":void 0},{addQueryPrefix:!0})),b(),null;if(D.errors)fe.error(D.message,{description:D.errors.map(R=>R.message).join(`
56
- `)});else return y();return!1}catch{return y()}})},[g,y,i,u,m,n,p,d,l,r,o,h,f,b,e]);return d===bo.None||!v?null:QB(o7.Fragment,{children:[w4("button",{className:`${r7}__toggle`,onClick:()=>{a(C)},type:"button",children:h("general:delete")}),w4(It,{body:h("general:aboutToDeleteCount",{count:c,label:I4(c>1?n:r,m)}),confirmingLabel:h("general:deleting"),heading:h("general:confirmDeletion"),modalSlug:C,onConfirm:I})]})};import{c as W7}from"react/compiler-runtime";import{jsx as ct,jsxs as No}from"react/jsx-runtime";import{getTranslation as z7}from"@payloadcms/translations";import{formatAdminURL as H7}from"payload/shared";import Qb,{Fragment as Kc,useEffect as X7}from"react";import{jsx as D4,jsxs as s7}from"react/jsx-runtime";import{dequal as i7}from"dequal/lite";import{reduceFieldsToValues as T4,versionDefaults as a7}from"payload/shared";import A4,{useDeferredValue as l7,useEffect as F4,useRef as En,useState as c7}from"react";import{unflatten as n7}from"payload/shared";var _4=(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=n7(n.data))),n};var u7="autosave",E4=1e3,P4=({id:t,collection:e,global:o})=>{let{config:{routes:{api:n},serverURL:r}}=W(),{docConfig:s,incrementVersionCount:i,lastUpdateTime:l,mostRecentVersionIsAutosaved:a,setLastUpdateTime:c,setMostRecentVersionIsAutosaved:u,setUnpublishedVersionCount:d,updateSavedDocumentData:f}=Ae(),m=En([]),h=En(!1),{reportUpdate:p}=ai(),{dispatchFields:g,isValid:b,setBackgroundProcessing:x,setIsValid:v,setSubmitted:C}=Me(),y=$o(),[I]=Di(),w=Ht(),A=zt(),{code:_}=Ee(),{i18n:D,t:T}=$(),S=s?.versions,R=a7.autosaveInterval;S.drafts&&S.drafts.autosave&&(R=S.drafts.autosave.interval);let E=!!(s?.versions?.drafts&&s?.versions?.drafts.validate),[F,L]=c7(!1),k=l7(F),N=Yo(I,R),P=En(I),j=En(w),V=En(_),M=En(b);P.current=I,j.current=w,V.current=_;let O=A4.useCallback(async()=>{if(h.current||m.current.length===0)return;if(y){m.current=[];return}if(!M.current){m.current=[],M.current=!0;return}h.current=!0;let q=m.current[m.current.length-1];m.current=[],x(!0);try{await q()}finally{h.current=!1,x(!1),m.current.length>0&&await O()}x(!1)},[y,x]),B=En(null),G=Jt(()=>{B.current=void 0;let q,z,re=()=>{z-q<E4?B.current=setTimeout(()=>{L(!1)},E4-(z-q)):ee()},me=async()=>{if(w){q=new Date().getTime(),L(!0);let se,Z,Q;if(e&&t&&(Q=e.slug,se=`${r}${n}/${Q}/${t}?draft=true&autosave=true&locale=${V.current}`,Z="PATCH"),o&&(Q=o.slug,se=`${r}${n}/globals/${Q}?draft=true&autosave=true&locale=${V.current}`,Z="POST"),se&&j.current){let{data:ge,valid:Ie}=_4(P.current,!0);if(ge._status="draft",!(A&&!Ie&&S?.drafts&&S?.drafts?.validate)&&M.current){let Le;try{Le=await fetch(se,{body:JSON.stringify(ge),credentials:"include",headers:{"Accept-Language":D.language,"Content-Type":"application/json"},method:Z})}catch{}let K=new Date;z=K.getTime(),Le.status===200&&(c(K.getTime()),p({id:t,entitySlug:Q,updatedAt:K.toISOString()}),a||(i(),u(!0),d(pe=>pe+1)));let _e=await Le.json();if(S?.drafts&&S?.drafts?.validate&&_e?.errors){if(Array.isArray(_e.errors)){let[pe,ce]=_e.errors.reduce(([ne,H],U)=>{let le=[],De=[];return U?.message&&De.push(U),Array.isArray(U?.data)&&U.data.forEach(Ne=>{Ne?.field?le.push(Ne):De.push(Ne)}),[[...ne,...le],[...H,...De]]},[[],[]]);g({type:"ADD_SERVER_ERRORS",errors:pe}),ce.forEach(ne=>{fe.error(ne.message||D.t("error:unknown"))}),M.current=!1,v(!1),C(!0),re();return}}else{let pe=_e?.doc||_e?.result;pe&&(v(!0),M.current=!0,f(pe))}re()}}}};m.current.push(me),O()}),Y=En(!1),X=En(T4(N));F4(()=>{if(!Y.current){Y.current=!0;return}let q=T4(N);i7(q,X)||(X.current=q,G())},[N]),F4(()=>()=>{ee()},[]);let ee=Jt(()=>{B.current&&clearTimeout(B.current),L(!1)});return s7("div",{className:u7,children:[E&&!b&&D4(Wc,{}),k&&T("general:saving"),!k&&!!l&&D4(A4.Fragment,{children:T("version:lastSavedAgo",{distance:Tx({date:l,i18n:D})})})]})};import{jsx as cf,jsxs as d7}from"react/jsx-runtime";import{getTranslation as N4}from"@payloadcms/translations";import{useRouter as m7}from"next/navigation.js";import{formatAdminURL as f7}from"payload/shared";import p7,{useCallback as L4}from"react";var k4=t=>{let{id:e,buttonId:o,collectionSlug:n,onDelete:r,redirectAfterDelete:s=!0,singularLabel:i,title:l}=t,{config:{routes:{admin:a,api:c},serverURL:u},getEntityConfig:d}=W(),f=d({collectionSlug:n}),{setModified:m}=Me(),h=m7(),{i18n:p,t:g}=$(),{title:b}=Ae(),{startRouteTransition:x}=it(),{openModal:v}=de(),C=`delete-${e}`,y=L4(()=>{fe.error(g("error:deletingTitle",{title:b}))},[g,b]),I=L4(async()=>{m(!1);try{await Ke.delete(`${u}${c}/${n}/${e}`,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(async w=>{try{let A=await w.json();if(w.status<400){if(fe.success(g("general:titleDeleted",{label:N4(i,p),title:b})||A.message),s)return x(()=>h.push(f7({adminRoute:a,path:`/collections/${n}`})));typeof r=="function"&&await r({id:e,collectionConfig:f});return}return A.errors?A.errors.forEach(_=>fe.error(_.message)):y(),!1}catch{return y()}})}catch{return y()}},[m,u,c,n,e,g,i,y,p,b,h,a,s,r,f,x]);return e?d7(p7.Fragment,{children:[cf(Be.Button,{id:o,onClick:()=>{v(C)},children:g("general:delete")}),cf(It,{body:cf(gi,{elements:{1:({children:w})=>cf("strong",{children:w})},i18nKey:"general:aboutToDelete",t:g,variables:{label:N4(i,p),title:l||b||e}}),confirmingLabel:g("general:deleting"),heading:g("general:confirmDeletion"),modalSlug:C,onConfirm:I})]}):null};import{jsx as $4,jsxs as h7}from"react/jsx-runtime";import{getTranslation as j4}from"@payloadcms/translations";import{useRouter as g7}from"next/navigation.js";import{formatAdminURL as b7}from"payload/shared";import O4,{useCallback as M4}from"react";var B4=({id:t,slug:e,onDuplicate:o,redirectAfterDuplicate:n=!0,singularLabel:r})=>{let s=g7(),i=Ht(),{openModal:l}=de(),a=Ee(),{setModified:c}=Me(),{startRouteTransition:u}=it(),{config:{routes:{admin:d,api:f},serverURL:m},getEntityConfig:h}=W(),p=h({collectionSlug:e}),[g,b]=O4.useState(!1),{i18n:x,t:v}=$(),C=`duplicate-${t}`,y=M4(async()=>{b(!0),await Ke.post(`${m}${f}/${e}/${t}/duplicate${a?.code?`?locale=${a.code}`:""}`,{body:JSON.stringify({}),headers:{"Accept-Language":x.language,"Content-Type":"application/json",credentials:"include"}}).then(async w=>{let{doc:A,errors:_,message:D}=await w.json();if(w.status<400){if(fe.success(D||v("general:successfullyDuplicated",{label:j4(r,x)})),c(!1),n)return u(()=>s.push(b7({adminRoute:d,path:`/collections/${e}/${A.id}${a?.code?`?locale=${a.code}`:""}`})));typeof o=="function"&&o({collectionConfig:p,doc:A})}else fe.error(_?.[0].message||D||v("error:unspecific",{label:j4(r,x)}))})},[a,m,f,e,t,x,v,r,o,n,c,s,d,p,u]),I=M4(async()=>{b(!1),await y()},[y]);return h7(O4.Fragment,{children:[$4(Be.Button,{id:"action-duplicate",onClick:()=>i?(b(!0),l(C)):y(),children:v("general:duplicate")}),g&&$4(It,{body:v("general:unsavedChangesDuplicate"),confirmLabel:v("general:duplicateWithoutSaving"),heading:v("general:unsavedChanges"),modalSlug:C,onConfirm:I})]})};import{c as x7}from"react/compiler-runtime";import{jsx as W4,jsxs as C7}from"react/jsx-runtime";import{useState as y7}from"react";import{jsx as V4,jsxs as v7}from"react/jsx-runtime";import"react";var G4=({className:t})=>v7("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:[V4("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"}),V4("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 z4="locked",Qc=t=>{let e=x7(8),{className:o,user:n}=t,[r,s]=y7(!1),{t:i}=$(),l=qm(n)?n.email??n.id:i("general:anotherUser"),a;e[0]!==o?(a=[z4,o].filter(Boolean),e[0]=o,e[1]=a):a=e[1];let c=a.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=`${l} ${i("general:isEditing")}`,m;return e[4]!==r||e[5]!==c||e[6]!==f?(m=C7("div",{className:c,onMouseEnter:u,onMouseLeave:d,role:"button",tabIndex:0,children:[W4(po,{alignCaret:"left",className:`${z4}__tooltip`,position:"top",show:r,children:f}),W4(G4,{})]}),e[4]=r,e[5]=c,e[6]=f,e[7]=m):m=e[7],m};import{c as S7}from"react/compiler-runtime";import{jsx as R7}from"react/jsx-runtime";import"react";import*as X4 from"qs-esm";import{useCallback as w7,useRef as I7,useState as H4}from"react";var U4=()=>{let{id:t,collectionSlug:e,globalSlug:o,versionCount:n}=Ae(),[r,s]=H4(!1),[i,l]=H4(""),{code:a}=Ee(),c=n>0,{config:{routes:{api:u},serverURL:d}}=W(),{t:f}=$(),m=I7(!1);return{generatePreviewURL:w7(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 x=await fetch(`${g}?${X4.stringify({draft:c?"true":"false",locale:a||void 0})}`);if(!x.ok)throw new Error;let v=await x.json();if(!v)throw new Error;l(v),s(!1),m.current=!1,p&&window.open(v,"_blank")}catch{s(!1),m.current=!1,fe.error(f("error:previewing"))}}},[d,u,e,o,c,a,t,f]),isLoading:r,label:f(r?"general:loading":"version:preview"),previewURL:i}};var _7="preview-btn";function Ub(t){let e=S7(5),{generatePreviewURL:o,label:n}=U4(),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=R7(ae,{buttonStyle:"secondary",className:_7,icon:"link",iconPosition:"left",onClick:r,size:"medium",children:n}),e[2]=n,e[3]=r,e[4]=s):s=e[4],s}import{c as L7}from"react/compiler-runtime";import{jsx as Fa,jsxs as eR}from"react/jsx-runtime";import*as oR from"qs-esm";import tR from"react";import{jsx as Y4}from"react/jsx-runtime";import"react";var D7="form-submit",Gr=t=>{let{type:e="submit",buttonId:o,children:n,disabled:r,onClick:s,programmaticSubmit:i,ref:l}=t,a=$o(),c=Xf(),u=Rs(),{disabled:d,submit:f}=Me();return Y4("div",{className:D7,children:Y4(ae,{ref:l,...t,disabled:!(r||u||a||c||d)?void 0:!0,id:o,onClick:s??(i?()=>{f()}:void 0),type:e,children:n})})};import{jsx as Bt,jsxs as xi}from"react/jsx-runtime";import{getTranslation as E7}from"@payloadcms/translations";import*as Q4 from"qs-esm";import Po,{useCallback as P7,useMemo as N7}from"react";import{jsx as xs,jsxs as T7}from"react/jsx-runtime";import"react";var Z4="table",Yb=({appearance:t,columns:e,data:o})=>{let n=e?.filter(r=>r?.active);return!n||n.length===0?xs("div",{children:"No columns selected"}):xs("div",{className:[Z4,t&&`${Z4}--appearance-${t}`].filter(Boolean).join(" "),children:T7("table",{cellPadding:"0",cellSpacing:"0",children:[xs("thead",{children:xs("tr",{children:n.map((r,s)=>xs("th",{id:`heading-${r.accessor}`,children:r.Heading},s))})}),xs("tbody",{children:o&&o.map((r,s)=>xs("tr",{className:`row-${s+1}`,children:n.map((i,l)=>{let{accessor:a}=i;return xs("td",{className:`cell-${a}`,children:i.renderedCells[s]},l)})},s))})]})})};import{jsx as tn,jsxs as A7}from"react/jsx-runtime";import{getTranslation as F7}from"@payloadcms/translations";import"react";var J4=({dateFormat:t,deleteHandler:e,docs:o,i18n:n,localization:r,supportedTimezones:s,t:i})=>{let l=[{accessor:"input.type",active:!0,field:{name:"",type:"text"},Heading:tn("span",{children:i("version:type")}),renderedCells:o.map(a=>{let c=a.input?.type;return A7(bt,{pillStyle:c==="publish"?"success":"warning",children:[c==="publish"&&i("version:publish"),c==="unpublish"&&i("version:unpublish")]},a.id)})},{accessor:"waitUntil",active:!0,field:{name:"",type:"date"},Heading:tn("span",{children:i("general:time")}),renderedCells:o.map(a=>tn("span",{children:pn({date:a.waitUntil,i18n:n,pattern:t,timezone:a.input.timezone})},a.id))},{accessor:"input.timezone",active:!0,field:{name:"",type:"text"},Heading:tn("span",{children:i("general:timezone")}),renderedCells:o.map(a=>{let u=s.find(d=>d.value===a.input.timezone)?.label||a.input.timezone;return tn("span",{children:u||i("general:noValue")},a.id)})}];return r&&l.push({accessor:"input.locale",active:!0,field:{name:"",type:"text"},Heading:tn("span",{children:i("general:locale")}),renderedCells:o.map(a=>{if(a.input.locale){let c=r.locales.find(u=>u.code===a.input.locale);if(c)return tn("span",{children:F7(c.label,n)},a.id)}return tn("span",{children:i("general:all")},a.id)})}),l.push({accessor:"delete",active:!0,field:{name:"delete",type:"text"},Heading:tn("span",{children:i("general:delete")}),renderedCells:o.map(a=>tn(ae,{buttonStyle:"icon-label",className:"schedule-publish__delete",icon:"x",onClick:c=>{c.preventDefault(),e(a.id)},tooltip:i("general:delete")},a.id))}),l};var Aa="schedule-publish",q4={label:"All",value:"all"},K4=({slug:t,defaultType:e})=>{let{toggleModal:o}=de(),{config:{admin:{dateFormat:n,timezones:{defaultTimezone:r,supportedTimezones:s}},localization:i,routes:{api:l},serverURL:a}}=W(),{id:c,collectionSlug:u,globalSlug:d,title:f}=Ae(),{i18n:m,t:h}=$(),{schedulePublish:p}=Dt(),[g,b]=Po.useState(e||"publish"),[x,v]=Po.useState(),[C,y]=Po.useState(r),[I,w]=Po.useState(q4),[A,_]=Po.useState(!1),D=h("general:schedulePublishFor",{title:f}),[T,S]=Po.useState(),[R,E]=Po.useState(),F=Po.useRef(()=>null),L=Intl.DateTimeFormat().resolvedOptions().timeZone,k=Po.useMemo(()=>{if(i){let O=i.locales.map(({code:B,label:G})=>({label:E7(G,m),value:B}));return O.unshift(q4),O}return[]},[i,m]),N=Po.useCallback(async()=>{let O={sort:"waitUntil",where:{and:[{taskSlug:{equals:"schedulePublish"}},{waitUntil:{greater_than:new Date}}]}};u&&(O.where.and.push({"input.doc.value":{equals:String(c)}}),O.where.and.push({"input.doc.relationTo":{equals:u}})),d&&O.where.and.push({"input.global":{equals:d}});let{docs:B}=await Ke.post(`${a}${l}/payload-jobs`,{body:Q4.stringify(O),headers:{"Accept-Language":m.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"}}).then(G=>G.json());E(J4({dateFormat:n,deleteHandler:F.current,docs:B,i18n:m,localization:i,supportedTimezones:s,t:h})),S(B)},[u,d,a,l,m,n,i,s,h,c]),P=Po.useCallback(async O=>{try{await p({deleteID:O}),await N(),fe.success(h("general:deletedSuccessfully"))}catch(B){console.error(B),fe.error(B.message)}},[N,p,h]);Po.useEffect(()=>{F.current=P},[P]);let j=Po.useCallback(async()=>{if(!x)return fe.error(h("general:noDateSelected"));_(!0);let O;typeof I=="object"&&I.value!=="all"&&g==="publish"&&(O=I.value);try{await p({type:g,date:x,doc:u?{relationTo:u,value:String(c)}:void 0,global:d||void 0,locale:O,timezone:C}),v(void 0),fe.success(h("version:scheduledSuccessfully")),N()}catch(B){console.error(B),fe.error(B.message)}_(!1)},[x,I,g,h,p,u,c,d,C,N]),V=N7(()=>{if(C&&L&&x){let O=jt.tz(C),B=jt.tz(L),G=new jt(x).withTimeZone(C),Y=Rr(G,O);return Rr(Y,B).toISOString()}return x},[C,x,L]),M=P7(O=>{if(C&&O){let B=jt.tz(C),G=new jt(O),Y=Rr(G,B);v(Y||null)}else v(O||null)},[v,C]);return Po.useEffect(()=>{T||(async()=>await N())()},[T,N]),xi(Pt,{className:Aa,gutter:!1,Header:xi("div",{className:`${Aa}__drawer-header`,children:[Bt("h2",{title:D,children:D}),Bt(Dm,{onClick:()=>o(t)})]}),slug:t,children:[xi(Bo,{className:`${Aa}__scheduler`,children:[Bt(be,{label:h("version:type"),required:!0}),xi("ul",{className:`${Aa}__type`,children:[Bt("li",{children:Bt(ic,{id:`${t}-type`,isSelected:g==="publish",onChange:()=>b("publish"),option:{label:h("version:publish"),value:"publish"},path:`${t}-type`,readOnly:A})}),Bt("li",{children:Bt(ic,{id:`${t}-type`,isSelected:g==="unpublish",onChange:()=>b("unpublish"),option:{label:h("version:unpublish"),value:"unpublish"},path:`${t}-type`,readOnly:A})})]}),Bt("br",{}),Bt(be,{label:h("general:time"),path:"time",required:!0}),Bt(zi,{id:"time",minDate:new Date,onChange:O=>M(O),pickerAppearance:"dayAndTime",readOnly:A,timeIntervals:5,value:V}),s.length>0&&Bt(Vl,{id:"timezone-picker",onChange:y,options:s,selectedTimezone:C}),Bt("br",{}),k.length>0&&g==="publish"&&xi(Po.Fragment,{children:[Bt(be,{label:h("localization:localeToPublish")}),Bt(yt,{onChange:O=>w(O),options:k,value:I}),Bt("br",{})]}),xi("div",{className:`${Aa}__actions`,children:[Bt(ae,{buttonStyle:"primary",disabled:A,id:"scheduled-publish-save",onClick:j,type:"button",children:h("general:save")}),A?Bt("span",{children:h("general:saving")}):null]})]}),xi(Bo,{className:`${Aa}__upcoming`,children:[Bt("h4",{children:h("general:upcomingEvents")}),!T&&Bt(wt,{}),T?.length===0&&Bt(yr,{type:"info",children:h("general:noUpcomingEventsScheduled")}),T?.length>0&&Bt(Yb,{appearance:"condensed",columns:R,data:T})]})]})};function Zb(t){let e=L7(74),{label:o}=t,{id:n,collectionSlug:r,docConfig:s,globalSlug:i,hasPublishedDoc:l,hasPublishPermission:a,setHasPublishedDoc:c,setMostRecentVersionIsAutosaved:u,setUnpublishedVersionCount:d,unpublishedVersionCount:f,uploadStatus:m}=Ae(),{config:h,getEntityConfig:p}=W(),{submit:g}=Me(),b=Ht(),x=ut(),{code:v}=Ee(),{isModalOpen:C,toggleModal:y}=de(),I=`schedule-publish-${n}`,{localization:w,routes:A,serverURL:_}=h,{api:D}=A,{t:T}=$(),S;e[0]!==o||e[1]!==T?(S=o||T("version:publishChanges"),e[0]=o,e[1]=T,e[2]=S):S=e[2];let R=S,E;e:{if(r){let ce;e[3]!==r||e[4]!==p?(ce=p({collectionSlug:r}),e[3]=r,e[4]=p,e[5]=ce):ce=e[5],E=ce;break e}if(i){let ce;e[6]!==p||e[7]!==i?(ce=p({globalSlug:i}),e[6]=p,e[7]=i,e[8]=ce):ce=e[8],E=ce;break e}E=void 0}let F=E,L=f>0,k=a&&(b||L||!l)&&m!=="uploading",P=!!(typeof F?.versions?.drafts=="object"&&F?.versions?.drafts.schedulePublish&&a&&(i||r&&n)&&!b),V=Jo()==="update"&&!b,M;e[9]!==D||e[10]!==r||e[11]!==V||e[12]!==i||e[13]!==n||e[14]!==v||e[15]!==_||e[16]!==g?(M=async()=>{if(V)return;let ce=`?locale=${v}&depth=0&fallback-locale=null&draft=true`,ne,H="POST";r&&(ne=`${_}${D}/${r}${n?`/${n}`:""}${ce}`,n&&(H="PATCH")),i&&(ne=`${_}${D}/globals/${i}${ce}`),await g({action:ne,method:H,overrides:{_status:"draft"},skipValidation:!0})},e[9]=D,e[10]=r,e[11]=V,e[12]=i,e[13]=n,e[14]=v,e[15]=_,e[16]=g,e[17]=M):M=e[17];let O=M,B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=["s"],e[18]=B):B=e[18];let G;e[19]!==x?(G={cmdCtrlKey:!0,editDepth:x,keyCodes:B},e[19]=x,e[20]=G):G=e[20];let Y;e[21]!==s||e[22]!==O?(Y=ce=>{ce.preventDefault(),ce.stopPropagation(),O&&s.versions?.drafts&&s.versions?.drafts?.autosave&&O()},e[21]=s,e[22]=O,e[23]=Y):Y=e[23],pi(G,Y);let X;e[24]!==c||e[25]!==u||e[26]!==d||e[27]!==g||e[28]!==m?(X=()=>{m!=="uploading"&&(g({overrides:{_status:"published"}}),d(0),u(!1),c(!0))},e[24]=c,e[25]=u,e[26]=d,e[27]=g,e[28]=m,e[29]=X):X=e[29];let ee=X,q;e[30]!==D||e[31]!==r||e[32]!==i||e[33]!==n||e[34]!==_||e[35]!==c||e[36]!==g||e[37]!==m?(q=ce=>{if(m==="uploading")return;let ne=oR.stringify({publishSpecificLocale:ce}),H=`${_}${D}${i?`/globals/${i}`:`/${r}/${n?`${"/"+n}`:""}`}${ne?"?"+ne:""}`;g({action:H,overrides:{_status:"published"}}),c(!0)},e[30]=D,e[31]=r,e[32]=i,e[33]=n,e[34]=_,e[35]=c,e[36]=g,e[37]=m,e[38]=q):q=e[38];let z=q,re=!w||w&&w.defaultLocalePublishOption!=="active",me;e[39]!==v||e[40]!==w?(me=w&&w?.locales.find(ce=>typeof ce=="string"?ce===v:ce.code===v),e[39]=v,e[40]=w,e[41]=me):me=e[41];let se=me,Z=se&&(typeof se.label=="string"?se.label:se.label?.[v]??void 0),Q;e[42]!==se||e[43]!==ee||e[44]!==re||e[45]!==z?(Q=re?ee:()=>z(se.code),e[42]=se,e[43]=ee,e[44]=re,e[45]=z,e[46]=Q):Q=e[46];let ge=Q,Ie;e[47]!==Z||e[48]!==R||e[49]!==re||e[50]!==T?(Ie=re?R:T("version:publishIn",{locale:Z}),e[47]=Z,e[48]=R,e[49]=re,e[50]=T,e[51]=Ie):Ie=e[51];let Fe=Ie,Le;e[52]!==se||e[53]!==ee||e[54]!==re||e[55]!==z?(Le=re?()=>z(se.code):ee,e[52]=se,e[53]=ee,e[54]=re,e[55]=z,e[56]=Le):Le=e[56];let K=Le,_e,pe;if(e[57]!==Z||e[58]!==k||e[59]!==P||e[60]!==Fe||e[61]!==ge||e[62]!==I||e[63]!==L||e[64]!==a||e[65]!==C||e[66]!==R||e[67]!==w||e[68]!==re||e[69]!==K||e[70]!==T||e[71]!==y){pe=Symbol.for("react.early_return_sentinel");e:{let ce=re?T("version:publishIn",{locale:Z}):T("version:publishAllLocales");if(!a){pe=null;break e}_e=eR(tR.Fragment,{children:[Fa(Gr,{buttonId:"action-save",disabled:!k,enableSubMenu:P,onClick:ge,size:"medium",SubMenuPopupContent:w||P?ne=>{let{close:H}=ne;return eR(tR.Fragment,{children:[P&&Fa(Be.ButtonGroup,{children:Fa(Be.Button,{id:"schedule-publish",onClick:()=>[y(I),H()],children:T("version:schedulePublish")})},"schedule-publish"),w&&k&&Fa(Be.ButtonGroup,{children:Fa(Be.Button,{id:"publish-locale",onClick:K,children:ce})})]})}:void 0,type:"button",children:w?Fe:R}),P&&C(I)&&Fa(K4,{defaultType:L?"publish":"unpublish",slug:I})]})}e[57]=Z,e[58]=k,e[59]=P,e[60]=Fe,e[61]=ge,e[62]=I,e[63]=L,e[64]=a,e[65]=C,e[66]=R,e[67]=w,e[68]=re,e[69]=K,e[70]=T,e[71]=y,e[72]=_e,e[73]=pe}else _e=e[72],pe=e[73];return pe!==Symbol.for("react.early_return_sentinel")?pe:_e}import{jsx as k7}from"react/jsx-runtime";import{useRef as $7}from"react";function Jb({label:t}){let{uploadStatus:e}=Ae(),{t:o}=$(),{submit:n}=Me(),r=Ht(),s=t||o("general:save"),i=$7(null),l=ut(),c=Jo()==="update"&&!r||e==="uploading";return pi({cmdCtrlKey:!0,editDepth:l,keyCodes:["s"]},d=>{d.preventDefault(),d.stopPropagation(),i?.current&&i.current.click()}),k7(Gr,{buttonId:"action-save",disabled:c,onClick:()=>{if(e!=="uploading")return void n()},ref:i,size:"medium",type:"button",children:s})}import{jsx as j7}from"react/jsx-runtime";import{useCallback as O7,useRef as M7}from"react";var B7="save-draft";function qb(t){let{config:{routes:{api:e},serverURL:o}}=W(),{id:n,collectionSlug:r,globalSlug:s,setUnpublishedVersionCount:i,uploadStatus:l}=Ae(),a=Ht(),{code:c}=Ee(),u=M7(null),d=ut(),{t:f}=$(),{submit:m}=Me(),p=Jo()==="update"&&!a||l==="uploading",g=O7(async()=>{if(p)return;let b=`?locale=${c}&depth=0&fallback-locale=null&draft=true`,x,v="POST";r&&(x=`${o}${e}/${r}${n?`/${n}`:""}${b}`,n&&(v="PATCH")),s&&(x=`${o}${e}/globals/${s}${b}`),await m({action:x,method:v,overrides:{_status:"draft"},skipValidation:!0}),i(C=>C+1)},[m,r,s,o,e,c,n,p,i]);return pi({cmdCtrlKey:!0,editDepth:d,keyCodes:["s"]},b=>{b.preventDefault(),b.stopPropagation(),u?.current&&u.current.click()}),j7(Gr,{buttonId:"action-save-draft",buttonStyle:"secondary",className:B7,disabled:p,onClick:()=>void g(),ref:u,size:"medium",type:"button",children:f("version:saveDraft")})}import{c as V7}from"react/compiler-runtime";import{jsx as Ea,jsxs as uf}from"react/jsx-runtime";import rR from"react";var Pa="status",nR=()=>{let t=V7(37),{id:e,collectionSlug:o,docPermissions:n,globalSlug:r,hasPublishedDoc:s,incrementVersionCount:i,setHasPublishedDoc:l,setMostRecentVersionIsAutosaved:a,setUnpublishedVersionCount:c,unpublishedVersionCount:u}=Ae(),{toggleModal:d}=de(),{config:f}=W(),{routes:m,serverURL:h}=f,{api:p}=m,{reset:g}=Me(),{code:b}=Ee(),{i18n:x,t:v}=$(),C=`confirm-un-publish-${e}`,y=`confirm-revert-${e}`,I;u>0&&s?I="changed":s?s&&u<=0&&(I="published"):I="draft";let w;t[0]!==p||t[1]!==o||t[2]!==r||t[3]!==x.language||t[4]!==e||t[5]!==i||t[6]!==b||t[7]!==g||t[8]!==h||t[9]!==l||t[10]!==a||t[11]!==c||t[12]!==v?(w=async D=>{let T,S,R;D==="unpublish"&&(R={_status:"draft"}),o&&(T=`${h}${p}/${o}/${e}?locale=${b}&fallback-locale=null&depth=0`,S="patch"),r&&(T=`${h}${p}/globals/${r}?locale=${b}&fallback-locale=null&depth=0`,S="post"),D==="revert"&&(R=await Ke.get(T,{headers:{"Accept-Language":x.language,"Content-Type":"application/json"}}).then(G7));let E=await Ke[S](T,{body:JSON.stringify(R),headers:{"Accept-Language":x.language,"Content-Type":"application/json"}});if(E.status===200){let F,L=await E.json();r?F=L.result:o&&(F=L.doc),g(F),fe.success(L.message),i(),a(!1),D==="unpublish"?l(!1):D==="revert"&&c(0)}else fe.error(v("error:unPublishingDocument"))},t[0]=p,t[1]=o,t[2]=r,t[3]=x.language,t[4]=e,t[5]=i,t[6]=b,t[7]=g,t[8]=h,t[9]=l,t[10]=a,t[11]=c,t[12]=v,t[13]=w):w=t[13];let A=w,_=n?.update;if(I){let D=`${v("version:status")}: ${v(`version:${I}`)}`,T;if(t[14]!==_||t[15]!==A||t[16]!==y||t[17]!==I||t[18]!==v||t[19]!==D||t[20]!==d||t[21]!==C){let S;t[23]!==_||t[24]!==A||t[25]!==I||t[26]!==v||t[27]!==d||t[28]!==C?(S=_&&I==="published"&&uf(rR.Fragment,{children:["\xA0\u2014\xA0",Ea(ae,{buttonStyle:"none",className:`${Pa}__action`,onClick:()=>d(C),children:v("version:unpublish")}),Ea(It,{body:v("version:aboutToUnpublish"),confirmingLabel:v("version:unpublishing"),heading:v("version:confirmUnpublish"),modalSlug:C,onConfirm:()=>A("unpublish")})]}),t[23]=_,t[24]=A,t[25]=I,t[26]=v,t[27]=d,t[28]=C,t[29]=S):S=t[29];let R;t[30]!==_||t[31]!==A||t[32]!==y||t[33]!==I||t[34]!==v||t[35]!==d?(R=_&&I==="changed"&&uf(rR.Fragment,{children:["\xA0\u2014\xA0",Ea(ae,{buttonStyle:"none",className:`${Pa}__action`,id:"action-revert-to-published",onClick:()=>d(y),children:v("version:revertToPublished")}),Ea(It,{body:v("version:aboutToRevertToPublished"),confirmingLabel:v("version:reverting"),heading:v("version:confirmRevertToSaved"),modalSlug:y,onConfirm:()=>A("revert")})]}),t[30]=_,t[31]=A,t[32]=y,t[33]=I,t[34]=v,t[35]=d,t[36]=R):R=t[36],T=Ea("div",{className:Pa,title:D,children:uf("div",{className:`${Pa}__value-wrap`,children:[uf("span",{className:`${Pa}__label`,children:[v("version:status"),":\xA0"]}),Ea("span",{className:`${Pa}__value`,children:v(`version:${I}`)}),S,R]})}),t[14]=_,t[15]=A,t[16]=y,t[17]=I,t[18]=v,t[19]=D,t[20]=d,t[21]=C,t[22]=T}else T=t[22];return T}return null};function G7(t){return t.json()}var At="doc-controls",Kb=t=>{let e=W7(15),{id:o,slug:n,customComponents:r,data:s,disableActions:i,disableCreate:l,hasSavePermission:a,isAccountView:c,isEditing:u,onDelete:d,onDrawerCreateNew:f,onDuplicate:m,onTakeOver:h,permissions:p,readOnlyForIncomingUser:g,redirectAfterDelete:b,redirectAfterDuplicate:x,user:v}=t,C;e[0]!==r?(C=r===void 0?{}:r,e[0]=r,e[1]=C):C=e[1];let{PreviewButton:y,PublishButton:I,SaveButton:w,SaveDraftButton:A}=C,{i18n:_,t:D}=$(),T=ut(),{config:S,getEntityConfig:R}=W(),E=R({collectionSlug:n}),F=R({globalSlug:n}),{admin:L,localization:k,routes:N}=S,{dateFormat:P}=L,{admin:j}=N,[V,M]=Qb.useState(""),[O,B]=Qb.useState(""),G=$o(),Y=Rs(),X,ee;e[2]!==s||e[3]!==P||e[4]!==_?(X=()=>{s?.updatedAt&&M(pn({date:s.updatedAt,i18n:_,pattern:P})),s?.createdAt&&B(pn({date:s.createdAt,i18n:_,pattern:P}))},ee=[s,_,P],e[2]=s,e[3]=P,e[4]=_,e[5]=X,e[6]=ee):(X=e[5],ee=e[6]),X7(X,ee);let q=p&&"create"in p&&p.create,z=p&&"delete"in p&&p.delete,re=!!(E&&o&&!i&&(q||z)),me=!o&&E?.versions?.drafts&&E.versions?.drafts.validate,se=E?.versions?.drafts&&E?.versions?.drafts?.autosave||F?.versions?.drafts&&F?.versions?.drafts?.autosave,Z=k&&!E?.admin?.disableCopyToLocale,Q;e[7]!==g||e[8]!==v?(Q=v&&g&&ct(Qc,{className:`${At}__locked-controls`,user:v}),e[7]=g,e[8]=v,e[9]=Q):Q=e[9];let ge;return e[10]!==h||e[11]!==g||e[12]!==D||e[13]!==v?(ge=v&&g&&ct(ae,{buttonStyle:"secondary",id:"take-over",onClick:h,size:"medium",type:"button",children:D("general:takeOver")}),e[10]=h,e[11]=g,e[12]=D,e[13]=v,e[14]=ge):ge=e[14],No(Bo,{className:At,children:[No("div",{className:`${At}__wrapper`,children:[ct("div",{className:`${At}__content`,children:No("ul",{className:`${At}__meta`,children:[E&&!u&&!c&&ct("li",{className:`${At}__list-item`,children:ct("p",{className:`${At}__value`,children:_.t("general:creatingNewLabel",{label:z7(E?.labels?.singular??_.t("general:document"),_)})})}),Q,(E?.versions?.drafts||F?.versions?.drafts)&&No(Kc,{children:[(F||E&&u)&&ct("li",{className:[`${At}__status`,`${At}__list-item`].filter(Boolean).join(" "),children:ct(nR,{})}),a&&se&&!me&&ct("li",{className:`${At}__list-item`,children:ct(P4,{collection:E,global:F,id:o,publishedDocUpdatedAt:s?.createdAt})})]}),E?.timestamps&&(u||c)&&No(Kc,{children:[No("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:s?.updatedAt?V:"",children:[No("p",{className:`${At}__label`,children:[_.t("general:lastModified"),":\xA0"]}),s?.updatedAt&&ct("p",{className:`${At}__value`,children:V})]}),No("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:s?.createdAt?O:"",children:[No("p",{className:`${At}__label`,children:[_.t("general:created"),":\xA0"]}),s?.createdAt&&ct("p",{className:`${At}__value`,children:O})]})]})]})}),No("div",{className:`${At}__controls-wrapper`,children:[No("div",{className:`${At}__controls`,children:[(E?.admin.preview||F?.admin.preview)&&ct(oe,{CustomComponent:y,Fallback:ct(Ub,{})}),a&&ct(Kc,{children:E?.versions?.drafts||F?.versions?.drafts?No(Kc,{children:[(me||!se)&&ct(oe,{CustomComponent:A,Fallback:ct(qb,{})}),ct(oe,{CustomComponent:I,Fallback:ct(Zb,{})})]}):ct(oe,{CustomComponent:w,Fallback:ct(Jb,{})})}),ge]}),re&&!g&&ct(fo,{button:No("div",{className:`${At}__dots`,children:[ct("div",{}),ct("div",{}),ct("div",{})]}),className:`${At}__popup`,disabled:Y||G,horizontalAlign:"right",size:"large",verticalAlign:"bottom",children:No(Be.ButtonGroup,{children:[Z&&ct(Vb,{}),q&&No(Qb.Fragment,{children:[!l&&ct(Kc,{children:T>1?ct(Be.Button,{id:"action-create",onClick:f,children:_.t("general:createNew")}):ct(Be.Button,{href:H7({adminRoute:j,path:`/collections/${E?.slug}/create`}),id:"action-create",children:_.t("general:createNew")})}),E.disableDuplicate!==!0&&u&&ct(B4,{id:o.toString(),onDuplicate:m,redirectAfterDuplicate:x,singularLabel:E?.labels?.singular,slug:E?.slug})]}),z&&ct(k4,{buttonId:"action-delete",collectionSlug:E?.slug,id:o.toString(),onDelete:d,redirectAfterDelete:b,singularLabel:E?.labels?.singular,useAsTitle:E?.admin?.useAsTitle})]})})]})]}),ct("div",{className:`${At}__divider`})]})};import{c as o8}from"react/compiler-runtime";import{jsx as mf,jsxs as r8}from"react/jsx-runtime";import{useState as n8}from"react";import{c as e1}from"react/compiler-runtime";import{jsx as ao,jsxs as df}from"react/jsx-runtime";import{getTranslation as U7}from"@payloadcms/translations";import{useRouter as Y7,useSearchParams as Z7}from"next/navigation.js";import{mergeListSearchAndWhere as J7,unflatten as sR}from"payload/shared";import*as cR from"qs-esm";import iR,{useCallback as aR,useEffect as q7,useMemo as lR,useState as Q7}from"react";var K7=t=>{let e=e1(7),{action:o,disabled:n}=t,{submit:r}=Me(),{t:s}=$(),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 l=i,a;return e[3]!==n||e[4]!==l||e[5]!==s?(a=ao(Gr,{className:`${Lo}__save`,disabled:n,onClick:l,children:s("general:save")}),e[3]=n,e[4]=l,e[5]=s,e[6]=a):a=e[6],a},e8=t=>{let e=e1(7),{action:o,disabled:n}=t,{submit:r}=Me(),{t:s}=$(),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 l=i,a;return e[3]!==n||e[4]!==l||e[5]!==s?(a=ao(Gr,{className:`${Lo}__publish`,disabled:n,onClick:l,children:s("version:publishChanges")}),e[3]=n,e[4]=l,e[5]=s,e[6]=a):a=e[6],a},t8=t=>{let e=e1(7),{action:o,disabled:n}=t,{submit:r}=Me(),{t:s}=$(),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 l=i,a;return e[3]!==n||e[4]!==l||e[5]!==s?(a=ao(Gr,{buttonStyle:"secondary",className:`${Lo}__draft`,disabled:n,onClick:l,children:s("version:saveDraft")}),e[3]=n,e[4]=l,e[5]=s,e[6]=a):a=e[6],a},uR=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,selectedFields:i,setSelectedFields:l}=t,{permissions:a,user:c}=Se(),{closeModal:u}=de(),{config:{routes:{api:d},serverURL:f}}=W(),{getFormState:m}=Dt(),{count:h,getQueryParams:p,selectAll:g}=Qt(),{i18n:b,t:x}=$(),[v,C]=Q7(!1),y=Y7(),I=iR.useRef(null),{clearRouteCache:w}=Fn(),A=a?.collections?.[r.slug],_=Z7(),D=lR(()=>sR(i.reduce((F,L)=>(F[L.value.path]=!0,F),{})),[i]),T=aR(async({formState:F,submitted:L})=>{let k=er(I),{state:N}=await m({collectionSlug:r.slug,docPermissions:A,docPreferences:null,formState:F,operation:"update",schemaPath:r.slug,select:D,signal:k.signal,skipValidation:!L});return I.current=null,N},[m,r,A,D]);q7(()=>{let F=I.current;return()=>{Ko(F)}},[]);let S=lR(()=>{let F=J7({collectionConfig:r,search:_.get("search")});return p(F)},[r,_,p]),R=()=>{y.replace(cR.stringify({...Nr(_),page:g===bo.AllAvailable?"1":void 0},{addQueryPrefix:!0})),w(),u(s)},E=aR(async({dispatchFields:F,formState:L,selected:k})=>{C(!0),l(k||[]);let{state:N}=await m({collectionSlug:r.slug,docPermissions:A,docPreferences:null,formState:L,operation:"update",schemaPath:r.slug,select:sR(k.reduce((P,j)=>(P[j.value.path]=!0,P),{})),skipValidation:!0});F({type:"UPDATE_MANY",formState:N}),C(!1)},[m,r.slug,A,l]);return ao(dl,{collectionSlug:r.slug,currentEditor:c,hasPublishedDoc:!1,id:null,initialData:{},isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,versionCount:0,children:ao(ud,{value:"update",children:df("div",{className:`${Lo}__main`,children:[df("div",{className:`${Lo}__header`,children:[ao("h2",{className:`${Lo}__header__title`,children:x("general:editingLabel",{count:h,label:U7(h>1?o:n,b)})}),ao("button",{"aria-label":x("general:close"),className:`${Lo}__header__close`,id:`close-drawer__${s}`,onClick:()=>u(s),type:"button",children:ao(pt,{})})]}),df(wn,{className:`${Lo}__form`,isInitializing:v,onChange:[T],onSuccess:R,children:[ao(Nm,{fields:e,onChange:E,permissions:A.fields}),i.length===0?null:ao("div",{className:"render-fields",children:i.map((F,L)=>{let{value:{field:k,fieldPermissions:N,path:P}}=F;return ao(xa,{clientFieldConfig:k,indexPath:"",parentPath:"",parentSchemaPath:"",path:P,permissions:N},`${P}-${L}`)})}),ao("div",{className:`${Lo}__sidebar-wrap`,children:ao("div",{className:`${Lo}__sidebar`,children:ao("div",{className:`${Lo}__sidebar-sticky-wrap`,children:ao("div",{className:`${Lo}__document-actions`,children:r?.versions?.drafts?df(iR.Fragment,{children:[ao(t8,{action:`${f}${d}/${r.slug}${S}&draft=true`,disabled:i.length===0}),ao(e8,{action:`${f}${d}/${r.slug}${S}&draft=true`,disabled:i.length===0})]}):ao(K7,{action:`${f}${d}/${r.slug}${S}`,disabled:i.length===0})})})})})]})]})})})};var Lo="edit-many",t1=t=>{let e=o8(10),{collection:o}=t,{slug:n}=o,{permissions:r}=Se(),{openModal:s}=de(),{selectAll:i}=Qt(),{t:l}=$(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];let[c,u]=n8(a),d=r?.collections?.[n],f=`edit-${n}`;if(i===bo.None||!d?.update)return null;let m;if(e[1]!==f||e[2]!==s||e[3]!==t.collection||e[4]!==c||e[5]!==l){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=r8("div",{className:Lo,children:[mf("button",{"aria-label":l("general:edit"),className:`${Lo}__toggle`,onClick:h,type:"button",children:l("general:edit")}),mf(Ts,{children:mf(Pt,{Header:null,slug:f,children:mf(uR,{collection:t.collection,drawerSlug:f,selectedFields:c,setSelectedFields:u})})})]}),e[1]=f,e[2]=s,e[3]=t.collection,e[4]=c,e[5]=l,e[6]=m}else m=e[6];return m};import{c as s8}from"react/compiler-runtime";import{jsx as i8}from"react/jsx-runtime";import"react";function a8(t){let e=s8(6),o=ut(),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=i8(Xo,{...t,style:{...n,zIndex:r}}),e[2]=t,e[3]=n,e[4]=r,e[5]=s):s=e[5],s}import{jsx as ff,jsxs as l8}from"react/jsx-runtime";import c8,{useCallback as u8}from"react";function o1(t){let{highlightField:e,setKey:o}=t,{id:n}=Ae(),{toggleModal:r}=de(),{t:s}=$(),i=`generate-confirmation-${n}`,l=u8(()=>{o(),fe.success(s("authentication:newAPIKeyGenerated")),e(!0)},[e,o,s]);return l8(c8.Fragment,{children:[ff(ae,{buttonStyle:"secondary",onClick:()=>{r(i)},size:"small",children:s("authentication:generateNewAPIKey")}),ff(It,{body:ff(gi,{elements:{1:({children:a})=>ff("strong",{children:a})},i18nKey:"authentication:generatingNewAPIKeyWillInvalidate",t:s}),confirmLabel:s("authentication:generate"),heading:s("authentication:confirmGeneration"),modalSlug:i,onConfirm:l})]})}import{c as d8}from"react/compiler-runtime";import{useEffect as m8}from"react";function f8(t){let e=d8(4),{permissions:o}=t,{setPermissions:n}=Se(),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]),m8(r,s),null}import{jsx as Vt,jsxs as xf}from"react/jsx-runtime";import{getTranslation as ka}from"@payloadcms/translations";import{validateWhereQuery as Y8}from"payload/shared";import Z8,{Fragment as GR,useEffect as WR,useRef as zR,useState as J8}from"react";import{jsx as r1,jsxs as p8}from"react/jsx-runtime";import"react";var n1="dots",dR=({ariaLabel:t,className:e,noBackground:o,orientation:n="vertical"})=>p8("div",{"aria-label":t,className:[e,n1,o&&`${n1}--no-background`,n&&`${n1}--${n}`].filter(Boolean).join(" "),children:[r1("div",{}),r1("div",{}),r1("div",{})]});import{jsx as mR}from"react/jsx-runtime";import{useEffect as fR,useRef as pR,useState as h8}from"react";import{usePathname as g8}from"next/navigation.js";var hR="search-filter",s1=t=>{let{handleChange:e,initialParams:o,label:n}=t,r=g8(),[s,i]=h8(typeof o?.search=="string"?o?.search:void 0),l=pR(!0),a=pR(typeof o?.search=="string"?o?.search:void 0),c=Yo(s,300);return fR(()=>{o?.search!==a.current&&(l.current=!1,i(o?.search),a.current=o?.search)},[o?.search,r]),fR(()=>{c!==a.current&&l.current&&(e&&e(c),a.current=c)},[c,e]),mR("div",{className:hR,children:mR("input",{"aria-label":n,className:`${hR}__input`,id:"search-filter-input",onChange:u=>{l.current=!0,i(u.target.value)},placeholder:n,type:"text",value:s||""})})};import{jsx as Ln,jsxs as ru}from"react/jsx-runtime";import{getTranslation as O8}from"@payloadcms/translations";import{transformWhereQuery as M8,validateWhereQuery as ER}from"payload/shared";import gf,{useMemo as PR}from"react";import{jsx as Pn,jsxs as p1}from"react/jsx-runtime";import{useCallback as _R,useEffect as E8,useState as P8}from"react";import{jsx as eu}from"react/jsx-runtime";import"react";import{jsx as gR}from"react/jsx-runtime";import"react";var b8="condition-value-date",i1=({disabled:t,field:{admin:e},onChange:o,value:n})=>{let{date:r}=e||{};return gR("div",{className:b8,children:gR(zi,{...r,onChange:o,readOnly:t,value:n})})};import{c as v8}from"react/compiler-runtime";import{jsx as x8}from"react/jsx-runtime";import"react";var C8="condition-value-number",a1=t=>{let e=v8(7),{disabled:o,onChange:n,value:r}=t,{t:s}=$(),i;e[0]!==n?(i=a=>n(a.target.value),e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==s||e[4]!==i||e[5]!==r?(l=x8("input",{className:C8,disabled:o,onChange:i,placeholder:s("general:enterAValue"),type:"number",value:r}),e[2]=o,e[3]=s,e[4]=i,e[5]=r,e[6]=l):l=e[6],l};import{jsx as CR,jsxs as w8}from"react/jsx-runtime";import*as SR from"qs-esm";import yR,{useCallback as pf,useEffect as wR,useReducer as I8,useState as l1}from"react";import{getTranslation as bR}from"@payloadcms/translations";var vR=t=>t.reduce((e,o)=>o.options?[...e,...vR(o.options)]:[...e,o.id],[]),y8=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,data:n,hasMultipleRelations:r,i18n:s,relation:i}=e,l=o.admin.useAsTitle||"id",a=vR(t);if(!r)return[...t,...n.docs.reduce((f,m)=>a.indexOf(m.id)===-1?(a.push(m.id),[...f,{label:m[l],value:m.id}]):f,[])];let c=[...t],u=c.find(f=>f.label===bR(o.labels.plural,s)),d=n.docs.reduce((f,m)=>a.indexOf(m.id)===-1?(a.push(m.id),[...f,{label:m[l],relationTo:i,value:m.id}]):f,[]);return u?u.options=[...u.options,...d]:c.push({label:bR(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}},xR=y8;var IR="condition-value-relationship",S8=10,c1=t=>{let{disabled:e,field:{admin:{isSortable:o}={},hasMany:n,relationTo:r},filterOptions:s,onChange:i,value:l}=t,{config:{routes:{api:a},serverURL:c},getEntityConfig:u}=W(),d=Array.isArray(r),[f,m]=I8(xR,[]),[h,p]=l1(""),g=Yo(h,300),[b,x]=l1(""),[v,C]=l1(!1),{i18n:y,t:I}=$(),w=Ee(),A=d?r:[r],_=yR.useRef(new Map(A.map(N=>[N,{hasLoadedAll:!1,nextPage:1}]))),D=pf((N,P)=>{let j=u({collectionSlug:P});m({type:"ADD",collection:j,data:N,hasMultipleRelations:d,i18n:y,relation:P})},[d,y,u]),T=Jt(async({abortController:N,relationSlug:P})=>{let j=_.current.get(P);if(P&&!j.hasLoadedAll){let M=u({collectionSlug:P})?.admin?.useAsTitle||"id",O={and:[]},B={depth:0,limit:S8,locale:w.code,page:j.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}${a}/${P}${SR.stringify(B,{addQueryPrefix:!0})}`,{credentials:"include",headers:{"Accept-Language":y.language},signal:N.signal});if(G.ok){let Y=await G.json();Y.docs.length>0&&(D(Y,P),Y.nextPage?_.current.set(P,{hasLoadedAll:!1,nextPage:Y.nextPage}):_.current.set(P,{hasLoadedAll:!0,nextPage:null}))}else x(I("error:unspecific"))}catch(G){N.signal.aborted||console.error(G)}}C(!0)}),S=yR.useCallback(()=>{let N=_.current.entries().next().value;if(N[0]&&!N[1].hasLoadedAll){let P=new AbortController;T({abortController:P,relationSlug:N[0]})}},[]),R=pf(()=>{if(l){if(n)return Array.isArray(l)?l.map(N=>{if(d){let P;return f.forEach(j=>{j.options&&j.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=l;return f.forEach(j=>{j?.options&&j.options.some(V=>V?.value==P.value?(N=V,!0):!1)}),N}return f.find(N=>N.value==l)}},[n,d,l,f]),E=pf(N=>{if(N!==h){m({type:"CLEAR",i18n:y,required:!1});let P=Array.isArray(r)?r:[r];_.current=new Map(P.map(j=>[j,{hasLoadedAll:!1,nextPage:1}])),p(N)}},[y,r,h]),F=pf(async(N,P)=>{if(!b&&N!=="null"&&N&&P){let j=await fetch(`${c}${a}/${P}/${N}?depth=0`,{credentials:"include",headers:{"Accept-Language":y.language}});if(j.ok){let V=await j.json();D({docs:[V]},P)}else console.error(I("error:loadingDocument",{id:N}))}},[y,D,a,b,c,I]);wR(()=>{let N=Array.isArray(r)?r:[r];_.current=new Map(N.map(j=>[j,{hasLoadedAll:!1,nextPage:1}])),m({type:"CLEAR",i18n:y,required:!1}),C(!1);let P=[];return N.forEach(j=>{let V=new AbortController;T({abortController:V,relationSlug:j}),P.push(V)}),()=>{P.forEach(j=>{if(j.signal)try{j.abort()}catch{}})}},[y,r,g]),wR(()=>{if(l&&v){if(n)(R()||[]).forEach((P,j)=>{P||(d?F(l[j].value,l[j].relationTo):F(l[j],r))});else if(!R())if(d){let P=l;F(P.value,P.relationTo)}else F(l,r)}},[F,R,n,d,r,l,v]);let L=["field-type",IR,b&&"error-loading"].filter(Boolean).join(" "),k=R()||l;return w8("div",{className:L,children:[!b&&CR(yt,{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:S,options:f,placeholder:I("general:selectValue"),value:k}),b&&CR("div",{className:`${IR}__error-loading`,children:b})]})};import{c as R8}from"react/compiler-runtime";import{jsx as _8}from"react/jsx-runtime";import{getTranslation as u1}from"@payloadcms/translations";import d1 from"react";var m1=t=>{let e=R8(26),{disabled:o,isClearable:n,onChange:r,operator:s,options:i,value:l}=t,{i18n:a}=$(),c;e[0]!==i?(c=Bl(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(l)){let I;e[3]!==a||e[4]!==u?(I=w=>{let A=u.find(_=>_.value===w);return{label:A?u1(A.label,a):w,value:A?.value??w}},e[3]=a,e[4]=u,e[5]=I):I=e[5],h=l.map(I)}else if(l){let I,w;if(e[6]!==a||e[7]!==u||e[8]!==l){let A;e[11]!==l?(A=_=>_.value===l,e[11]=l,e[12]=A):A=e[12],I=u.find(A),w=I?u1(I.label,a):l,e[6]=a,e[7]=u,e[8]=l,e[9]=I,e[10]=w}else I=e[9],w=e[10];h={label:w,value:I?.value??l}}let p;e[13]!==m||e[14]!==r?(p=I=>{let w;I?m?Array.isArray(I)?w=I.map(D8):w=[]:w=I.value:w=null,r(w)},e[13]=m,e[14]=r,e[15]=p):p=e[15];let g=p,b,x;e[16]!==i?(b=()=>{d(Bl(i))},x=[i],e[16]=i,e[17]=b,e[18]=x):(b=e[17],x=e[18]),d1.useEffect(b,x);let v,C;e[19]!==m||e[20]!==r||e[21]!==l?(v=()=>{!m&&Array.isArray(l)&&r(l[0])},C=[m,r,l],e[19]=m,e[20]=r,e[21]=l,e[22]=v,e[23]=C):(v=e[22],C=e[23]),d1.useEffect(v,C);let y;return e[24]!==a?(y=I=>({...I,label:u1(I.label,a)}),e[24]=a,e[25]=y):y=e[25],_8(yt,{disabled:o,isClearable:n,isMulti:m,onChange:g,options:u.map(y),value:h})};function D8(t){return t.value}import{c as T8}from"react/compiler-runtime";import{jsx as A8}from"react/jsx-runtime";import"react";var F8="condition-value-text",f1=t=>{let e=T8(7),{disabled:o,onChange:n,value:r}=t,{t:s}=$(),i;e[0]!==n?(i=a=>n(a.target.value),e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==s||e[4]!==i||e[5]!==r?(l=A8("input",{className:F8,disabled:o,onChange:i,placeholder:s("general:enterAValue"),type:"text",value:r||""}),e[2]=o,e[3]=s,e[4]=i,e[5]=r,e[6]=l):l=e[6],l};var RR=({booleanSelect:t,disabled:e,filterOptions:o,internalField:n,onChange:r,operator:s,options:i,value:l})=>{if(t||["radio","select"].includes(n?.field?.type))return eu(m1,{disabled:e,field:n.field,isClearable:!t,onChange:r,operator:s,options:i,value:l});switch(n?.field?.type){case"date":return eu(i1,{disabled:e,field:n.field,onChange:r,operator:s,value:l});case"number":return eu(a1,{disabled:e,field:n.field,onChange:r,operator:s,value:l});case"relationship":return eu(c1,{disabled:e,field:n.field,filterOptions:o,onChange:r,operator:s,value:l});default:return eu(f1,{disabled:e,field:n?.field,onChange:r,operator:s,value:l})}};var Nn="condition",DR=t=>{let{addCondition:e,andIndex:o,fieldName:n,filterOptions:r,operator:s,orIndex:i,reducedFields:l,removeCondition:a,RenderedFilter:c,updateCondition:u,value:d}=t,{t:f}=$(),m=l.find(w=>w.value===n),[h,p]=P8(d),g=Yo(h,300),b=["exists"].includes(s)||m?.field?.type==="checkbox",x=[];b?x=[{label:f("general:true"),value:"true"},{label:f("general:false"),value:"false"}]:m?.field&&"options"in m.field&&(x=m.field.options);let v=Jt(async w=>{s&&await u({andIndex:o,field:m,operator:s,orIndex:i,value:w===null?"":w})});E8(()=>{v(g)},[g]);let C=!m?.value&&typeof m?.value!="number"||m?.field?.admin?.disableListFilter,y=_R(async w=>{p(void 0),await u({andIndex:o,field:l.find(A=>A.value===w.value),operator:s,orIndex:i,value:void 0})},[o,s,i,l,u]),I=_R(async w=>{await u({andIndex:o,field:m,operator:w.value,orIndex:i,value:d})},[o,m,i,u,d]);return Pn("div",{className:Nn,children:p1("div",{className:`${Nn}__wrap`,children:[p1("div",{className:`${Nn}__inputs`,children:[Pn("div",{className:`${Nn}__field`,children:Pn(yt,{disabled:C,isClearable:!1,onChange:y,options:l.filter(w=>!w.field.admin.disableListFilter),value:m||{value:m?.value}})}),Pn("div",{className:`${Nn}__operator`,children:Pn(yt,{disabled:C,isClearable:!1,onChange:I,options:m?.operators,value:m?.operators.find(w=>s===w.value)||null})}),Pn("div",{className:`${Nn}__value`,children:c||Pn(RR,{booleanSelect:b,disabled:!s||!m||m?.field?.admin?.disableListFilter,filterOptions:r,internalField:m,onChange:p,operator:s,options:x,value:h??""})})]}),p1("div",{className:`${Nn}__actions`,children:[Pn(ae,{buttonStyle:"icon-label",className:`${Nn}__actions-remove`,icon:"x",iconStyle:"with-border",onClick:()=>a({andIndex:o,orIndex:i}),round:!0}),Pn(ae,{buttonStyle:"icon-label",className:`${Nn}__actions-add`,icon:"plus",iconStyle:"with-border",onClick:()=>e({andIndex:o+1,field:l.find(w=>!w.field.admin?.disableListFilter),orIndex:i,relation:"and"}),round:!0})]})]})})};var h1=[{label:"equals",value:"equals"},{label:"isNotEqualTo",value:"not_equals"}],rr=[...h1,{label:"isIn",value:"in"},{label:"isNotIn",value:"not_in"},{label:"exists",value:"exists"}],TR=[...rr,{label:"isGreaterThan",value:"greater_than"},{label:"isLessThan",value:"less_than"},{label:"isLessThanOrEqualTo",value:"less_than_equal"},{label:"isGreaterThanOrEqualTo",value:"greater_than_equal"}],N8=[...h1,{label:"exists",value:"exists"},{label:"near",value:"near"}],AR={label:"within",value:"within"},FR={label:"intersects",value:"intersects"},tu={label:"isLike",value:"like"},ou={label:"isNotLike",value:"not_like"},Na={label:"contains",value:"contains"},L8={checkbox:{component:"Text",operators:h1},code:{component:"Text",operators:[...rr,tu,ou,Na]},date:{component:"Date",operators:[...rr,...TR]},email:{component:"Text",operators:[...rr,Na]},json:{component:"Text",operators:[...rr,tu,Na,ou,AR,FR]},number:{component:"Number",operators:[...rr,...TR]},point:{component:"Point",operators:[...N8,AR,FR]},radio:{component:"Select",operators:[...rr]},relationship:{component:"Relationship",operators:[...rr]},richText:{component:"Text",operators:[...rr,tu,ou,Na]},select:{component:"Select",operators:[...rr]},text:{component:"Text",operators:[...rr,tu,ou,Na]},textarea:{component:"Text",operators:[...rr,tu,ou,Na]},upload:{component:"Text",operators:[...rr]}},Ci=L8;import{getTranslation as hf}from"@payloadcms/translations";import{fieldIsHiddenOrDisabled as k8,fieldIsID as $8,tabHasName as j8}from"payload/shared";var La=({fields:t,i18n:e,labelPrefix:o,pathPrefix:n})=>t.reduce((r,s)=>{if(k8(s)&&!$8(s))return r;if(s.type==="tabs"&&"tabs"in s)return s.tabs.forEach(l=>{if(typeof l.label!="boolean"){let a=hf(l.label,e),c=o?o+" > "+a:a,u=j8(l)&&l.name?n?n+"."+l.name:l.name:n;typeof a=="string"&&r.push(...La({fields:l.fields,i18n:e,labelPrefix:c,pathPrefix:u}))}}),r;if(s.type==="row"&&"fields"in s)return r.push(...La({fields:s.fields,i18n:e,labelPrefix:o,pathPrefix:n})),r;if(s.type==="collapsible"&&"fields"in s){let i=hf(s.label||"",e),l=o?o+" > "+i:i;return r.push(...La({fields:s.fields,i18n:e,labelPrefix:l,pathPrefix:n})),r}if(s.type==="group"&&"fields"in s){let i=hf(s.label||"",e),l=o?i?o+" > "+i:o:i,a=s.name?n?n+"."+s.name:s.name:n;return r.push(...La({fields:s.fields,i18n:e,labelPrefix:l,pathPrefix:a})),r}if(typeof Ci[s.type]=="object"){let i=new Set,l=Ci[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},[]),a=hf(s.label||"",e),c=o?wc({field:s,prefix:o}):a,u=n?va(n,s):s.name,d={label:c,value:u,...Ci[s.type],field:s,operators:l};return r.push(d),r}return r},[]);var on="where-builder",NR=t=>{let{collectionPluralLabel:e,fields:o,renderedFilters:n,resolvedFilterOptions:r}=t,{i18n:s,t:i}=$(),l=PR(()=>La({fields:o,i18n:s}),[o,s]),{handleWhereChange:a,query:c}=so(),u=PR(()=>{let h=c.where;if(h){if(ER(h))return h.or;let p=M8(h);if(ER(p))return p.or;console.warn(`Invalid where query in URL: ${JSON.stringify(h)}`)}return[]},[c.where]),d=gf.useCallback(async({andIndex:h,field:p,orIndex:g,relation:b})=>{let x=[...u],v=Ci[p.field.type].operators[0].value;b==="and"?x[g].and.splice(h,0,{[p.value]:{[v]:void 0}}):x.push({and:[{[p.value]:{[v]:void 0}}]}),await a({or:x})},[u,a]),f=gf.useCallback(async({andIndex:h,field:p,operator:g,orIndex:b,value:x})=>{let v=u[b].and[h],C=Ci[p.field.type],y=g||C.operators[0].value;if(typeof v=="object"&&p.value){let I=x??v?.[y],w=I!==v?.[p.value]?.[y],A=y!==Object.keys(v?.[p.value]||{})?.[0];if(w||A){let _={[p.value]:{[y]:I}},D=[...u];D[b].and[h]=_,await a({or:D})}}},[u,a]),m=gf.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 a({or:g})},[u,a]);return ru("div",{className:on,children:[u.length>0&&ru(gf.Fragment,{children:[Ln("div",{className:`${on}__label`,children:i("general:filterWhere",{label:O8(e,s)})}),Ln("ul",{className:`${on}__or-filters`,children:u.map((h,p)=>{let g=`${p}_${Array.isArray(h?.and)?h.and.length:""}`;return ru("li",{children:[p!==0&&Ln("div",{className:`${on}__label`,children:i("general:or")}),Ln("ul",{className:`${on}__and-filters`,children:Array.isArray(h?.and)&&h.and.map((b,x)=>{let v=u[p].and[x],C=Object.keys(v)[0],y=Object.keys(v?.[C]||{})?.[0]||void 0,I=v?.[C]?.[y]||void 0;return ru("li",{children:[x!==0&&Ln("div",{className:`${on}__label`,children:i("general:and")}),Ln(DR,{addCondition:d,andIndex:x,fieldName:C,filterOptions:r?.get(C),operator:y,orIndex:p,reducedFields:l,removeCondition:m,RenderedFilter:n?.get(C),updateCondition:f,value:I})]},x)})})]},g)})}),Ln(ae,{buttonStyle:"icon-label",className:`${on}__add-or`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{await d({andIndex:0,field:l[0],orIndex:u.length,relation:"or"})},children:i("general:or")})]}),u.length===0&&ru("div",{className:`${on}__no-filters`,children:[Ln("div",{className:`${on}__label`,children:i("general:noFiltersSet")}),Ln(ae,{buttonStyle:"icon-label",className:`${on}__add-first-filter`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{l.length>0&&await d({andIndex:0,field:l.find(h=>!h.field.admin?.disableListFilter),orIndex:u.length,relation:"or"})},children:i("general:addFilter")})]})]})};import{c as B8}from"react/compiler-runtime";import{jsx as bf,jsxs as V8}from"react/jsx-runtime";import{getTranslation as G8}from"@payloadcms/translations";import{jsx as LR}from"react/jsx-runtime";import"react";var kR=({className:t})=>LR("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:LR("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 nu="active-query-preset";function $R(t){let e=B8(36),{activePreset:o,openPresetListDrawer:n,resetPreset:r}=t,{i18n:s,t:i}=$(),{getEntityConfig:l}=W(),a,c,u,d,f,m,h,p,g,b,x;if(e[0]!==o||e[1]!==l||e[2]!==s||e[3]!==n||e[4]!==i){let C=l({collectionSlug:"payload-query-presets"});c=V8,u=bt;let y=o&&`${nu}--active`,I;e[16]!==y?(I=[nu,y].filter(Boolean),e[16]=y,e[17]=I):I=e[17],p=I.join(" "),g="select-preset",e[18]!==n?(b=()=>{n()},e[18]=n,e[19]=b):b=e[19],x=o?"always-white":"light",e[20]!==o?.isShared?(h=o?.isShared&&bf(kR,{className:`${nu}__shared`}),e[20]=o?.isShared,e[21]=h):h=e[21],f=bf,m="div",a=`${nu}__label-text`,d=o?.title||i("general:selectLabel",{label:G8(C.labels.singular,s)}),e[0]=o,e[1]=l,e[2]=s,e[3]=n,e[4]=i,e[5]=a,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]=x}else a=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],x=e[15];let v;return e[22]!==o||e[23]!==r||e[24]!==a||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]!==x?(v=c(u,{className:p,id:g,onClick:b,pillStyle:x,children:[h,f(m,{className:a,children:d}),o?bf("div",{className:`${nu}__clear`,id:"clear-preset",onClick:async C=>{C.stopPropagation(),await r()},onKeyDown:async C=>{C.stopPropagation(),await r()},role:"button",tabIndex:0,children:bf(pt,{})}):null]}),e[22]=o,e[23]=r,e[24]=a,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]=x,e[35]=v):v=e[35],v}import{fieldAffectsData as W8,flattenTopLevelFields as z8}from"payload/shared";var jR=(t,e)=>t?z8(e).filter(n=>W8(n)&&t.includes(n.name)):null;import{jsx as vr,jsxs as H8}from"react/jsx-runtime";import{getTranslation as g1}from"@payloadcms/translations";import{transformColumnsToPreferences as OR,transformColumnsToSearchParams as MR}from"payload/shared";import{Fragment as X8,useCallback as vf,useMemo as U8}from"react";var BR="confirm-delete-preset",su="payload-query-presets",VR=({activePreset:t,collectionSlug:e,queryPresetPermissions:o})=>{let{modified:n,query:r,refineListData:s,setModified:i}=so(),{i18n:l,t:a}=$(),{openModal:c}=de(),{config:{routes:{api:u}},getEntityConfig:d}=W(),f=d({collectionSlug:su}),[m,,{openDrawer:h}]=Yt({id:t?.id,collectionSlug:su}),[p,,{closeDrawer:g,openDrawer:b}]=Yt({collectionSlug:su}),[x,,{closeDrawer:v,openDrawer:C}]=kc({collectionSlugs:[su]}),y=vf(async D=>{await s({columns:D.columns?MR(D.columns):void 0,preset:D.id,where:D.where},!1)},[s]),I=vf(async()=>{await s({columns:void 0,preset:void 0,where:void 0},!1)},[s]),w=vf(async()=>{try{await fetch(`${u}/${su}/${t.id}`,{method:"DELETE"}).then(async D=>{try{let T=await D.json();D.status<400?(fe.success(a("general:titleDeleted",{label:g1(f?.labels?.singular,l),title:t.title})),await I()):T.errors?T.errors.forEach(S=>fe.error(S.message)):fe.error(a("error:deletingTitle",{title:t.title}))}catch{fe.error(a("error:deletingTitle",{title:t.title}))}})}catch{fe.error(a("error:deletingTitle",{title:t.title}))}},[u,t?.id,t?.title,a,f,l,I]),A=vf(async()=>{try{await fetch(`${u}/payload-query-presets/${t.id}`,{body:JSON.stringify({columns:OR(r.columns),where:r.where}),credentials:"include",headers:{"Content-Type":"application/json"},method:"PATCH"}).then(async D=>{try{let T=await D.json();D.status<400?(fe.success(a("general:updatedLabelSuccessfully",{label:g1(f?.labels?.singular,l)})),i(!1)):T.errors?T.errors.forEach(S=>fe.error(S.message)):fe.error(a("error:unknown"))}catch{fe.error(a("error:unknown"))}})}catch{fe.error(a("error:unknown"))}},[u,t?.id,r.columns,r.where,a,f?.labels?.singular,l,i]),_=U8(()=>{let D=[vr(Du,{label:g1(f?.labels?.plural,l)},"preset-group-label")];return t&&n&&(D.push(vr(Be.Button,{onClick:async()=>{await s({columns:MR(t.columns),where:t.where},!1)},children:a("general:reset")})),o.update&&D.push(vr(Be.Button,{onClick:async()=>{await A()},children:t.isShared?a("general:updateForEveryone"):a("general:save")}))),D.push(vr(Be.Button,{onClick:()=>{b()},children:a("general:createNew")})),t&&o?.delete&&D.push(H8(X8,{children:[vr(Be.Button,{onClick:()=>c(BR),children:a("general:delete")}),vr(Be.Button,{onClick:()=>{h()},children:a("general:edit")})]})),D},[t,o?.delete,o?.update,b,h,c,A,a,s,n,f?.labels?.plural,l]);return{CreateNewPresetDrawer:vr(p,{initialData:{columns:OR(r.columns),relatedCollection:e,where:r.where},onSave:async({doc:D})=>{g(),await y(D)},redirectAfterCreate:!1}),DeletePresetModal:vr(It,{body:vr(gi,{elements:{1:({children:D})=>vr("strong",{children:D})},i18nKey:"general:aboutToDelete",t:a,variables:{label:f?.labels?.singular,title:t?.title}}),confirmingLabel:a("general:deleting"),heading:a("general:confirmDeletion"),modalSlug:BR,onConfirm:w}),EditPresetDrawer:vr(m,{onDelete:()=>{},onDuplicate:async({doc:D})=>{await y(D)},onSave:async({doc:D})=>{await y(D)}}),hasModifiedPreset:n,openPresetListDrawer:C,PresetListDrawer:vr(x,{allowCreate:!1,disableQueryPresets:!0,onSelect:async({doc:D})=>{v(),await y(D)}}),queryPresetMenuItems:_,resetPreset:I}};var Ro="list-controls",b1=t=>{let{beforeActions:e,collectionConfig:o,collectionSlug:n,disableQueryPresets:r,enableColumns:s=!0,enableSort:i=!1,listMenuItems:l,queryPreset:a,queryPresetPermissions:c,renderedFilters:u,resolvedFilterOptions:d}=t,{handleSearchChange:f,query:m}=so(),{CreateNewPresetDrawer:h,DeletePresetModal:p,EditPresetDrawer:g,hasModifiedPreset:b,openPresetListDrawer:x,PresetListDrawer:v,queryPresetMenuItems:C,resetPreset:y}=VR({activePreset:a,collectionSlug:n,queryPresetPermissions:c}),I=Cb(o),{i18n:w,t:A}=$(),{breakpoints:{s:_}}=xo(),D=(I&&ka("label"in I&&(typeof I.label=="string"||typeof I.label=="object")?I.label:"name"in I?I.name:null,w))??"ID",T=jR(o.admin.listSearchableFields,o.fields),S=zR(A("general:searchBy",{label:ka(D,w)})),R=zR(!!m?.where),E=Y8(m?.where),[F,L]=J8(E?"where":void 0);WR(()=>{R.current&&!m?.where?R.current=!1:m?.where&&(R.current=!0)},[L,m?.where]),WR(()=>{T?.length>0?S.current=T.reduce((N,P,j)=>{let V="label"in P&&P.label?P.label:"name"in P?P.name:null;return j===0?`${A("general:searchBy",{label:ka(V,w)})}`:j===T.length-1?`${N} ${A("general:or")} ${ka(V,w)}`:`${N}, ${ka(V,w)}`},""):S.current=A("general:searchBy",{label:ka(D,w)})},[A,T,w,D]);let k=l;return o?.enableQueryPresets&&!r&&C?.length>0&&(k=[...C,l?.length>0?Vt(Be.Divider,{},"divider"):null,...l||[]]),xf(GR,{children:[xf("div",{className:Ro,children:[xf("div",{className:`${Ro}__wrap`,children:[Vt(Cl,{}),Vt(s1,{fieldName:I&&"name"in I?I?.name:null,handleChange:N=>void f(N),initialParams:m,label:S.current},n),a&&b?Vt("div",{className:`${Ro}__modified`,children:"Modified"}):null,Vt("div",{className:`${Ro}__buttons`,children:xf("div",{className:`${Ro}__buttons-wrap`,children:[!_&&Vt(Z8.Fragment,{children:e&&e}),s&&Vt(bt,{"aria-controls":`${Ro}-columns`,"aria-expanded":F==="columns",className:`${Ro}__toggle-columns`,icon:Vt(Je,{direction:F==="columns"?"up":"down"}),onClick:()=>L(F!=="columns"?"columns":void 0),pillStyle:"light",children:A("general:columns")}),Vt(bt,{"aria-controls":`${Ro}-where`,"aria-expanded":F==="where",className:`${Ro}__toggle-where`,icon:Vt(Je,{direction:F==="where"?"up":"down"}),onClick:()=>L(F!=="where"?"where":void 0),pillStyle:"light",children:A("general:filters")}),i&&Vt(bt,{"aria-controls":`${Ro}-sort`,"aria-expanded":F==="sort",className:`${Ro}__toggle-sort`,icon:Vt(Je,{}),onClick:()=>L(F!=="sort"?"sort":void 0),pillStyle:"light",children:A("general:sort")}),!r&&Vt($R,{activePreset:a,openPresetListDrawer:x,resetPreset:y}),k&&Array.isArray(k)&&k.length>0&&Vt(fo,{button:Vt(dR,{ariaLabel:A("general:moreOptions")}),className:`${Ro}__popup`,horizontalAlign:"right",id:"list-menu",size:"large",verticalAlign:"bottom",children:Vt(Be.ButtonGroup,{children:k.map((N,P)=>Vt(GR,{children:N},`list-menu-item-${P}`))})})]})})]}),s&&Vt(_r,{className:`${Ro}__columns`,height:F==="columns"?"auto":0,id:`${Ro}-columns`,children:Vt(tm,{collectionSlug:o.slug})}),Vt(_r,{className:`${Ro}__where`,height:F==="where"?"auto":0,id:`${Ro}-where`,children:Vt(NR,{collectionPluralLabel:o?.labels?.plural,collectionSlug:o.slug,fields:o?.fields,renderedFilters:u,resolvedFilterOptions:d})})]}),v,g,h,p]})};import{c as aV}from"react/compiler-runtime";import{jsx as yi,jsxs as KR}from"react/jsx-runtime";import{Fragment as lV}from"react";import{jsx as HR,jsxs as q8}from"react/jsx-runtime";import{getTranslation as XR}from"@payloadcms/translations";import{useRouter as Q8,useSearchParams as K8}from"next/navigation.js";import*as YR from"qs-esm";import eV,{useCallback as UR}from"react";var tV="publish-many",v1=t=>{let{clearRouteCache:e}=Fn(),{collection:{slug:o,labels:{plural:n,singular:r},versions:s}={}}=t,{config:{routes:{api:i},serverURL:l}}=W(),{permissions:a}=Se(),{i18n:c,t:u}=$(),{getQueryParams:d,selectAll:f}=Qt(),m=Q8(),h=K8(),{openModal:p}=de(),b=a?.collections?.[o]?.update,x=`publish-${o}`,v=UR(()=>{fe.error(u("error:unknown"))},[u]),C=UR(async()=>{await Ke.patch(`${l}${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 y=>{try{let I=await y.json(),w=I?.docs.length||0,A=w>1?n:r;return y.status<400||w>0?(fe.success(u("general:updatedCountSuccessfully",{count:w,label:XR(A,c)})),I?.errors.length>0&&fe.error(I.message,{description:I.errors.map(_=>_.message).join(`
57
- `)}),m.replace(YR.stringify({...Nr(h),page:f?"1":void 0},{addQueryPrefix:!0})),e(),null):(I.errors?I.errors.forEach(_=>fe.error(_.message)):v(),!1)}catch{return v()}})},[l,i,o,d,c,n,r,u,m,h,f,e,v]);return!s?.drafts||f===bo.None||!b?null:q8(eV.Fragment,{children:[HR("button",{className:`${tV}__toggle`,onClick:()=>{p(x)},type:"button",children:u("version:publish")}),HR(It,{body:u("version:aboutToPublishSelection",{label:XR(n,c)}),cancelLabel:u("general:cancel"),confirmingLabel:u("version:publishing"),confirmLabel:u("general:confirm"),heading:u("version:confirmPublish"),modalSlug:x,onConfirm:C})]})};import{jsx as ZR,jsxs as oV}from"react/jsx-runtime";import{getTranslation as JR}from"@payloadcms/translations";import{useRouter as rV,useSearchParams as nV}from"next/navigation.js";import*as QR from"qs-esm";import sV,{useCallback as qR}from"react";var iV="unpublish-many",x1=t=>{let{collection:{slug:e,labels:{plural:o,singular:n},versions:r}={}}=t,{config:{routes:{api:s},serverURL:i}}=W(),{permissions:l}=Se(),{toggleModal:a}=de(),{i18n:c,t:u}=$(),d=nV(),{getQueryParams:f,selectAll:m}=Qt(),h=rV(),{clearRouteCache:p}=Fn(),b=l?.collections?.[e]?.update,x=`unpublish-${e}`,v=qR(()=>{fe.error(u("error:unknown"))},[u]),C=qR(async()=>{await Ke.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 y=>{try{let I=await y.json(),w=I?.docs.length||0,A=w>1?o:n;return y.status<400||w>0?(fe.success(u("general:updatedCountSuccessfully",{count:w,label:JR(A,c)})),I?.errors.length>0&&fe.error(I.message,{description:I.errors.map(_=>_.message).join(`
58
- `)}),h.replace(QR.stringify({...Nr(d),page:m?"1":void 0},{addQueryPrefix:!0})),p(),null):(I.errors?I.errors.forEach(_=>fe.error(_.message)):v(),!1)}catch{return v()}})},[i,s,e,f,c,o,n,u,h,d,m,p,v]);return!r?.drafts||m===bo.None||!b?null:oV(sV.Fragment,{children:[ZR("button",{className:`${iV}__toggle`,onClick:()=>{a(x)},type:"button",children:u("version:unpublish")}),ZR(It,{body:u("version:aboutToUnpublishSelection",{label:JR(o,c)}),confirmingLabel:u("version:unpublishing"),heading:u("version:confirmUnpublish"),modalSlug:x,onConfirm:C})]})};var e_="list-selection",iu=t=>{let e=aV(10),{collectionConfig:o,disableBulkDelete:n,disableBulkEdit:r,label:s}=t,{count:i,selectAll:l,toggleAll:a,totalDocs:c}=Qt(),{t:u}=$();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]!==l||e[6]!==u||e[7]!==a||e[8]!==c?(d=KR("div",{className:e_,children:[yi("span",{children:u("general:selectedCount",{count:i,label:""})}),l!==bo.AllAvailable&&i<c&&yi("button",{"aria-label":u("general:selectAll",{count:i,label:s}),className:`${e_}__button`,id:"select-all-across-pages",onClick:()=>a(!0),type:"button",children:u("general:selectAll",{count:c,label:""})}),!r&&!n&&yi("span",{children:"\u2014"}),!r&&KR(lV,{children:[yi(t1,{collection:o}),yi(v1,{collection:o}),yi(x1,{collection:o})]}),!n&&yi(Xb,{collection:o})]}),e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=l,e[6]=u,e[7]=a,e[8]=c,e[9]=d):d=e[9],d};import{jsx as nr,jsxs as $a,Fragment as cV}from"react/jsx-runtime";import{getTranslation as ja}from"@payloadcms/translations";import"react";var t_="list-header",wi="list-drawer",uV=({className:t,collectionConfig:e,Description:o,disableBulkDelete:n,disableBulkEdit:r,hasCreatePermission:s,i18n:i,isBulkUploadEnabled:l,newDocumentURL:a,openBulkUpload:c,smallBreak:u,t:d})=>$a("header",{className:[t_,t].filter(Boolean).join(" "),children:[nr("h1",{children:ja(e?.labels?.plural,i)}),s&&$a(cV,{children:[nr(ae,{"aria-label":i.t("general:createNewLabel",{label:ja(e?.labels?.singular,i)}),buttonStyle:"pill",el:"link",size:"small",to:a,children:i.t("general:createNew")}),l&&nr(ae,{"aria-label":d("upload:bulkUpload"),buttonStyle:"pill",onClick:c,size:"small",children:d("upload:bulkUpload")})]}),!u&&nr(iu,{collectionConfig:e,disableBulkDelete:n,disableBulkEdit:r,label:ja(e?.labels?.plural,i)}),o]}),dV=({Description:t,hasCreatePermission:e,i18n:o,t:n})=>{let{config:{collections:r},getEntityConfig:s}=W(),{closeModal:i}=de(),{DocumentDrawerToggler:l,drawerSlug:a,enabledCollections:c,selectedOption:u,setSelectedOption:d}=Yr(),f=s({collectionSlug:u.value}),m=r.filter(({slug:p})=>c.includes(p)),h=c.length>1;return $a("header",{className:`${wi}__header`,children:[$a("div",{className:`${wi}__header-wrap`,children:[$a("div",{className:`${wi}__header-content`,children:[nr("h2",{className:`${wi}__header-text`,children:ja(f?.labels?.plural,o)}),e&&nr(l,{className:`${wi}__create-new-button`,children:nr(bt,{children:n("general:createNew")})})]}),nr("button",{"aria-label":n("general:close"),className:`${wi}__header-close`,onClick:()=>{i(a)},type:"button",children:nr(pt,{})})]}),t,h&&$a("div",{className:`${wi}__select-collection-wrap`,children:[nr(be,{label:n("upload:selectCollectionToBrowse")}),nr(yt,{className:`${t_}__select-collection`,onChange:d,options:m.map(p=>({label:ja(p.labels.singular,o),value:p.slug})),value:{label:ja(f?.labels.singular,o),value:f?.slug}})]})]})},C1=t=>{let{isInDrawer:e}=Yr();return e?nr(dV,{...t}):nr(uV,{...t})};import{c as mV}from"react/compiler-runtime";import{jsx as r_}from"react/jsx-runtime";import{formatAdminURL as fV}from"payload/shared";import"react";import{jsx as o_}from"react/jsx-runtime";import"react";var y1=()=>o_("svg",{className:"icon icon--logout",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:o_("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 pV="nav",hV=t=>{let e=mV(5),{tabIndex:o}=t,n=o===void 0?0:o,{t:r}=$(),{config:s}=W(),{admin:i,routes:l}=s,{routes:a}=i,{logout:c}=a,{admin:u}=l,d;return e[0]!==u||e[1]!==c||e[2]!==r||e[3]!==n?(d=r_(Kt,{"aria-label":r("authentication:logOut"),className:`${pV}__log-out`,href:fV({adminRoute:u,path:c}),prefetch:!1,tabIndex:n,title:r("authentication:logOut"),children:r_(y1,{})}),e[0]=u,e[1]=c,e[2]=r,e[3]=n,e[4]=d):d=e[4],d};import{c as gV}from"react/compiler-runtime";import{jsx as Oa,jsxs as n_}from"react/jsx-runtime";import bV,{useState as s_}from"react";var Cs="nav-group",vV="nav",xV=t=>{let e=gV(21),{children:o,isOpen:n,label:r}=t,[s,i]=s_(typeof n<"u"?!n:!1),[l,a]=s_(!1),{setPreference:c}=Do(),{navOpen:u}=vi();if(r){let f;e[0]!==s||e[1]!==r||e[2]!==c?(f=()=>{a(!0);let A={};A?.[r]?A[r].open=!!s:A[r]={open:!!s},c(vV,{groups:A},!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&&`${Cs}--collapsed`,g;e[4]!==h||e[5]!==p?(g=[`${Cs}`,h,p].filter(Boolean),e[4]=h,e[5]=p,e[6]=g):g=e[6];let b=g.join(" "),x=`nav-group-${r}`,v=`${Cs}__toggle--${s?"collapsed":"open"}`,C;e[7]!==v?(C=[`${Cs}__toggle`,v].filter(Boolean),e[7]=v,e[8]=C):C=e[8];let y=C.join(" "),I=u?0:-1,w;return e[9]!==l||e[10]!==o||e[11]!==s||e[12]!==r||e[13]!==I||e[14]!==b||e[15]!==x||e[16]!==y||e[17]!==m?(w=n_("div",{className:b,id:x,children:[n_("button",{className:y,onClick:m,tabIndex:I,type:"button",children:[Oa("div",{className:`${Cs}__label`,children:r}),Oa("div",{className:`${Cs}__indicator`,children:Oa(Je,{className:`${Cs}__indicator`,direction:s?void 0:"up"})})]}),Oa(_r,{duration:l?200:0,height:s?0:"auto",children:Oa("div",{className:`${Cs}__content`,children:o})})]}),e[9]=l,e[10]=o,e[11]=s,e[12]=r,e[13]=I,e[14]=b,e[15]=x,e[16]=y,e[17]=m,e[18]=w):w=e[18],w}let d;return e[19]!==o?(d=Oa(bV.Fragment,{children:o}),e[19]=o,e[20]=d):d=e[20],d};import{c as CV}from"react/compiler-runtime";import{jsx as ys,jsxs as i_}from"react/jsx-runtime";import{collectionDefaults as yV,isNumber as wV}from"payload/shared";import"react";var Ma="per-page",IV=yV.admin.pagination.limits,w1=t=>{let e=CV(9),{defaultLimit:o,handleChange:n,limit:r,limits:s}=t,i=o===void 0?10:o,l=s===void 0?IV:s,{t:a}=$(),c=wV(r)?r:i,u;if(e[0]!==n||e[1]!==c||e[2]!==l||e[3]!==a){let d;e[5]!==n||e[6]!==c||e[7]!==l?(d=f=>{let{close:m}=f;return ys(Be.ButtonGroup,{children:l.map((h,p)=>i_(Be.Button,{className:[`${Ma}__button`,h===c&&`${Ma}__button-active`].filter(Boolean).join(" "),onClick:()=>{m(),n&&n(h)},children:[h===c&&ys("div",{className:`${Ma}__chevron`,children:ys(Je,{direction:"right",size:"small"})}),"\xA0",ys("span",{children:h})]},p))})},e[5]=n,e[6]=c,e[7]=l,e[8]=d):d=e[8],u=ys("div",{className:Ma,children:ys(fo,{button:i_("div",{className:`${Ma}__base-button`,children:[ys("span",{children:a("general:perPage",{limit:c})}),"\xA0",ys(Je,{className:`${Ma}__icon`})]}),horizontalAlign:"right",render:d,size:"small"})}),e[0]=n,e[1]=c,e[2]=l,e[3]=a,e[4]=u}else u=e[4];return u};import{c as _V}from"react/compiler-runtime";import{jsx as yf}from"react/jsx-runtime";import{Fragment as l_}from"react";import{jsxs as SV}from"react/jsx-runtime";import"react";function a_(t){return t===void 0||typeof t=="number"?t:decodeURIComponent(t)}var RV="id-label",Cf=({id:t,className:e,prefix:o="ID:"})=>SV("div",{className:[RV,e].filter(Boolean).join(" "),title:t,children:[o,"\xA0",a_(t)]});var I1="render-title",S1=t=>{let e=_V(10),{className:o,element:n,fallback:r,title:s}=t,i=n===void 0?"h1":n,{id:l,isInitializing:a,title:c}=Ae(),u=s||c||r,d=u===l,f=i,m;if(e[0]!==f||e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==a||e[5]!==u){let h=yf(l_,{children:"\xA0"}),p=d&&`${I1}--has-id`,g;e[7]!==o||e[8]!==p?(g=[o,I1,p].filter(Boolean),e[7]=o,e[8]=p,e[9]=g):g=e[9],m=yf(f,{className:g.join(" "),title:u,children:a?h:yf(l_,{children:d?yf(Cf,{className:`${I1}__id`,id:l}):u||h})}),e[0]=f,e[1]=o,e[2]=l,e[3]=d,e[4]=a,e[5]=u,e[6]=m}else m=e[6];return m};import{c as DV}from"react/compiler-runtime";import{jsx as Ba,jsxs as c_}from"react/jsx-runtime";import"react";var rn="sort-column",TV=t=>{let e=DV(22),{name:o,appearance:n,disable:r,Label:s,label:i}=t,l=r===void 0?!1:r,{handleSortChange:a,query:c}=so(),{t:u}=$(),{sort:d}=c,f=`-${o}`,m=o,h;e[0]!==m||e[1]!==d?(h=[`${rn}__asc`],d===m&&h.push(`${rn}--active`),e[0]=m,e[1]=d,e[2]=h):h=e[2];let p;e[3]!==f||e[4]!==d?(p=[`${rn}__desc`],d===f&&p.push(`${rn}--active`),e[3]=f,e[4]=d,e[5]=p):p=e[5];let g=n&&`${rn}--appearance-${n}`,b;e[6]!==g?(b=[rn,g].filter(Boolean),e[6]=g,e[7]=b):b=e[7];let x=b.join(" "),v;e[8]!==s||e[9]!==i?(v=s??Ba(be,{hideLocale:!0,label:i,unstyled:!0}),e[8]=s,e[9]=i,e[10]=v):v=e[10];let C;return e[11]!==m||e[12]!==h||e[13]!==f||e[14]!==p||e[15]!==l||e[16]!==a||e[17]!==i||e[18]!==u||e[19]!==x||e[20]!==v?(C=c_("div",{className:x,children:[Ba("span",{className:`${rn}__label`,children:v}),!l&&c_("div",{className:`${rn}__buttons`,children:[Ba("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:ascending"),label:i}),className:[...h,`${rn}__button`].filter(Boolean).join(" "),onClick:()=>void a(m),type:"button",children:Ba(Je,{direction:"up"})}),Ba("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:descending"),label:i}),className:[...p,`${rn}__button`].filter(Boolean).join(" "),onClick:()=>void a(f),type:"button",children:Ba(Je,{})})]})]}),e[11]=m,e[12]=h,e[13]=f,e[14]=p,e[15]=l,e[16]=a,e[17]=i,e[18]=u,e[19]=x,e[20]=v,e[21]=C):C=e[21],C};import{jsx as u_}from"react/jsx-runtime";import"react";var AV=t=>{let{className:e}=t;return u_("svg",{className:[e,"icon icon--externalLink"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:u_("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 d_}from"react/jsx-runtime";import"react";var FV=()=>d_("svg",{"aria-hidden":"true",className:"graphic code-block-icon",focusable:"false",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:d_("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 R1}from"react/jsx-runtime";import"react";var _1="minimize-maximize",EV=({className:t,isMinimized:e})=>{let o=[_1,e?`${_1}--minimized`:`${_1}--maximized`,t].filter(Boolean).join(" ");return R1("svg",{className:o,height:"20",stroke:"currentColor",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:e?R1("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"}):R1("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 m_,jsxs as PV}from"react/jsx-runtime";import"react";var D1=()=>PV("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[m_("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)"}),m_("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 f_,jsxs as NV}from"react/jsx-runtime";import"react";var T1=()=>NV("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[f_("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)"}),f_("path",{d:"M13 16.1998V12.9998M13 9.7998H13.0077",stroke:"var(--theme-elevation-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as p_,jsxs as LV}from"react/jsx-runtime";import"react";var A1=()=>LV("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[p_("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)"}),p_("path",{d:"M10.6001 13.0004L12.2001 14.6004L15.4001 11.4004",stroke:"var(--theme-success-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as h_,jsxs as kV}from"react/jsx-runtime";import"react";var F1=()=>kV("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-warning-500)"}),h_("path",{d:"M13 10V13.2M13 16.4H13.008",stroke:"var(--theme-warning-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{c as b_}from"react/compiler-runtime";import{jsx as g_}from"react/jsx-runtime";import Va from"react";var v_=Va.createContext({addClientFunction:()=>null,removeClientFunction:()=>null}),x_=Va.createContext({}),E1=t=>{let e=b_(6),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=Va.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 l=i,a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=d=>{s(f=>{let m={...f};return delete m[d.key],m})},e[2]=a):a=e[2];let c=a,u;return e[3]!==o||e[4]!==r?(u=g_(v_,{value:{addClientFunction:l,removeClientFunction:c},children:g_(x_,{value:r,children:o})}),e[3]=o,e[4]=r,e[5]=u):u=e[5],u},$V=(t,e)=>{let o=b_(6),{addClientFunction:n,removeClientFunction:r}=Va.use(v_),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]),Va.useEffect(s,i)},jV=()=>Va.use(x_);import{c as OV}from"react/compiler-runtime";import{jsx as C_}from"react/jsx-runtime";import MV,{useEffect as BV,useRef as VV}from"react";var y_=200,P1="progress-bar",GV=150,WV=()=>{let t=OV(9),{isTransitioning:e,transitionProgress:o}=it(),[n,r]=MV.useState(null),s=VV(!0),i,l;if(t[0]!==e||t[1]!==o?(i=()=>{let a,c;return e?s.current?c=setTimeout(()=>{r(o),s.current=!1},GV):r(o):(s.current=!0,r(1),a=setTimeout(()=>{r(null)},y_*2)),()=>{clearTimeout(a),clearTimeout(c)}},l=[e,o],t[0]=e,t[1]=o,t[2]=i,t[3]=l):(i=t[2],l=t[3]),BV(i,l),typeof n=="number"){let a=n===1&&`${P1}--fade-out`,c;t[4]!==a?(c=[P1,a].filter(Boolean),t[4]=a,t[5]=c):c=t[5];let u=c.join(" "),d;return t[6]!==n||t[7]!==u?(d=C_("div",{className:u,style:{"--transition-duration":`${y_}ms`},children:C_("div",{className:`${P1}__progress`,style:{width:`${(n||0)*100}%`}})}),t[6]=n,t[7]=u,t[8]=d):d=t[8],d}return null};import{c as zV}from"react/compiler-runtime";import{jsx as HV}from"react/jsx-runtime";import{createContext as XV,use as UV}from"react";var w_=XV({}),YV=t=>{let e=zV(6),{children:o,visibleEntities:n}=t,r;e[0]!==n?(r=l=>{let{collectionSlug:a,globalSlug:c}=l;return a?n.collections.includes(a):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=HV(w_,{value:{isEntityVisible:s,visibleEntities:n},children:o}),e[2]=o,e[3]=s,e[4]=n,e[5]=i):i=e[5],i},N1=()=>UV(w_);import{c as ZV}from"react/compiler-runtime";import{jsx as JV}from"react/jsx-runtime";import{useParams as qV}from"next/navigation.js";import{createContext as QV,use as KV}from"react";var I_=QV({}),L1=t=>{let e=ZV(3),{children:o}=t,n=qV(),r;return e[0]!==o||e[1]!==n?(r=JV(I_,{value:n,children:o}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r},eG=()=>KV(I_);import{jsx as $t,jsxs as D_}from"react/jsx-runtime";import Zje,{Fragment as Jje}from"react";import{useContext as oG}from"react";import{createContext as tG}from"react";var au=tG({});var lu=()=>oG(au);import rG,{useCallback as nG,useEffect as sG,useReducer as iG,useRef as aG}from"react";var lG=(t,e)=>{let{timestamp:o,animationRef:n}=e;n.current=null;let{x:r,y:s,xDirection:i,yDirection:l,eventsFired:a,hasScrolled:c}=t,u=c||!!o,d=u?window.pageXOffset:0,f=u?window.pageYOffset:0,m=u?a+1:a,h=d-r,p=f-s,g=d/(document.body.scrollWidth-window.innerWidth)*100,b=f/(document.body.scrollHeight-window.innerHeight)*100,x=(g+b)/2,v=h>0?"right":h<0?"left":i,C=p>0?"down":p<0?"up":l;return{x:d,y:f,xDifference:h,yDifference:p,xDirection:v,yDirection:C,xPercentage:g,yPercentage:b,totalPercentage:x,eventsFired:m,hasScrolled:u}},cu=t=>{let{children:e}=t,o=aG(null),[n,r]=iG(lG,{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=nG(i=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(l=>{r({e:i,timestamp:l,animationRef:o})})},[]);return sG(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[s]),rG.createElement(au.Provider,{value:Object.assign({},n)},e&&e)};import rOe from"react";import{Fragment as T_}from"react";var{WindowInfoProvider:k1}=Bn&&"WindowInfoProvider"in Bn?Bn:{WindowInfoProvider:void 0},{useWindowInfo:$1}=Bn&&"useWindowInfo"in Bn?Bn:{useWindowInfo:void 0};import{jsx as cG}from"react/jsx-runtime";import{useSearchParams as uG}from"next/navigation.js";import*as wf from"qs-esm";import S_,{createContext as dG,use as mG}from"react";var fG={searchParams:{},stringifyParams:()=>""},R_=dG(fG),j1=({children:t})=>{let o=uG().toString(),n=S_.useMemo(()=>wf.parse(o,{depth:10,ignoreQueryPrefix:!0}),[o]),r=S_.useCallback(({params:s,replace:i=!1})=>wf.stringify({...i?{}:n,...s},{addQueryPrefix:!0}),[n]);return cG(R_,{value:{searchParams:n,stringifyParams:r},children:t})},pG=()=>mG(R_);import{jsx as uu}from"react/jsx-runtime";import"react";var __=()=>uu(T0,{className:"payload-toast-container",closeButton:!0,dir:"undefined",gap:8,icons:{error:uu(D1,{}),info:uu(T1,{}),success:uu(A1,{}),warning:uu(F1,{})},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 hG=({children:t,config:e,dateFNSKey:o,fallbackLang:n,isNavOpen:r,languageCode:s,languageOptions:i,locale:l,permissions:a,serverFunction:c,switchLanguageServerAction:u,theme:d,translations:f,user:m})=>{let h=process.env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH==="true"?Gb:T_;return D_(T_,{children:[$t(ig,{serverFunction:c,children:$t(Jf,{children:$t(h,{children:$t(Pf,{config:e,children:$t(E1,{children:$t(Ef,{dateFNSKey:o,fallbackLang:n,language:s,languageOptions:i,switchLanguageServerAction:u,translations:f,children:$t(k1,{breakpoints:{l:"(max-width: 1440px)",m:"(max-width: 1024px)",s:"(max-width: 768px)",xs:"(max-width: 400px)"},children:$t(cu,{children:$t(j1,{children:$t(Ip,{classPrefix:"payload",transTime:0,zIndex:"var(--z-modal)",children:D_(Ep,{permissions:a,user:m,children:[$t(Lp,{children:$t(Lf,{theme:d,children:$t(L1,{children:$t(kp,{locale:l,children:$t(Mb,{children:$t(B2,{children:$t(sb,{children:$t(d4,{initialIsOpen:r,children:$t(Hg,{children:t})})})})})})})})}),$t(Cp,{}),$t(P0,{})]})})})})})})})})})})}),$t(__,{})]})};import{jsx as A_,jsxs as gG}from"react/jsx-runtime";import{email as bG,username as vG}from"payload/shared";import"react";function O1(t){let{className:e,loginWithUsername:o,readOnly:n,t:r}=t,s=!o||o?.requireEmail||o?.allowEmailLogin,i=!!o;return gG("div",{className:e,children:[s?A_(qs,{field:{name:"email",admin:{autoComplete:"off"},label:r("general:email"),required:!o||o&&o.requireEmail},path:"email",readOnly:n,schemaPath:"email",validate:bG}):null,i&&A_(si,{field:{name:"username",label:r("authentication:username"),required:o&&o.requireUsername},path:"username",readOnly:n,schemaPath:"username",validate:vG})]})}import{c as xG}from"react/compiler-runtime";import{jsx as CG}from"react/jsx-runtime";import"react";var F_="select-all",yG=()=>{let t=xG(7),{selectAll:e,toggleAll:o}=Qt(),{i18n:n}=$(),r;if(t[0]!==n||t[1]!==e||t[2]!==o){let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=[F_,`${F_}__checkbox`],t[4]=s):s=t[4];let i;t[5]!==o?(i=()=>o(),t[5]=o,t[6]=i):i=t[6],r=CG(Os,{"aria-label":e===bo.None?n.t("general:selectAllRows"):n.t("general:deselectAllRows"),checked:e===bo.AllInPage||e===bo.AllAvailable,className:s.join(" "),id:"select-all",name:"select-all",onToggle:i,partialChecked:e===bo.Some}),t[0]=n,t[1]=e,t[2]=o,t[3]=r}else r=t[3];return r};import{c as wG}from"react/compiler-runtime";import{jsx as E_}from"react/jsx-runtime";import"react";var P_="select-row",IG=t=>{let e=wG(14),{rowData:o}=t,{user:n}=Se(),{selected:r,setSelection:s}=Qt(),i;e[0]!==o?(i=o||{},e[0]=o,e[1]=i):i=e[1];let{_isLocked:l,_userEditing:a}=i;if(l&&a&&a.id!==n?.id){let p;return e[2]!==a?(p=E_(Qc,{user:a}),e[2]=a,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=[P_,`${P_}__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=E_(Os,{checked:d,className:f.join(" "),onToggle:m}),e[11]=d,e[12]=m,e[13]=h):h=e[13],h};import{jsx as SG}from"react/jsx-runtime";import"react";var Ga=t=>{let{onClick:e}=t,{count:o,selected:n}=Qt();return!n||!o?null:SG(bt,{onClick:()=>{typeof e=="function"&&e(n)},pillStyle:"white",children:`Select ${o}`})};import{c as RG}from"react/compiler-runtime";import{jsx as Gt,jsxs as Ii}from"react/jsx-runtime";import{getTranslation as If}from"@payloadcms/translations";import{useRouter as _G}from"next/navigation.js";import{formatFilesize as DG,isNumber as TG}from"payload/shared";import{Fragment as M1,useEffect as N_,useState as AG}from"react";var kn="collection-list";function FG(t){let e=RG(17),{AfterList:o,AfterListTable:n,beforeActions:r,BeforeList:s,BeforeListTable:i,collectionSlug:l,columnState:a,Description:c,disableBulkDelete:u,disableBulkEdit:d,disableQueryPresets:f,enableRowSelections:m,hasCreatePermission:h,listMenuItems:p,newDocumentURL:g,queryPreset:b,queryPresetPermissions:x,renderedFilters:v,resolvedFilterOptions:C,Table:y}=t,[I,w]=AG(y),{allowCreate:A,createNewDrawerSlug:_,drawerSlug:D,onBulkSelect:T}=Yr(),S=A!==void 0?A&&h:h,R,E;e[0]!==y?(R=()=>{y&&w(y)},E=[y],e[0]=y,e[1]=R,e[2]=E):(R=e[1],E=e[2]),N_(R,E);let{user:F}=Se(),{getEntityConfig:L}=W(),k=_G(),{data:N,defaultLimit:P,handlePageChange:j,handlePerPageChange:V,query:M}=so(),{openModal:O}=de(),{setCollectionSlug:B,setCurrentActivePath:G,setOnSuccess:Y}=Wo(),{drawerSlug:X}=Wo(),ee=L({collectionSlug:l}),{labels:q,upload:z}=ee,re=!!z,me=re&&ee.upload.bulkUpload,se=!!D,{i18n:Z,t:Q}=$(),{setStepNav:ge}=An(),{breakpoints:Ie}=$1(),{s:Fe}=Ie,Le;if(re){let ne;e[3]!==N.docs?(ne=N.docs.map(EG),e[3]=N.docs,e[4]=ne):ne=e[4],Le=ne}else Le=N.docs;let K=Le,_e;e[5]!==X||e[6]!==l||e[7]!==O||e[8]!==k||e[9]!==B||e[10]!==G||e[11]!==Y?(_e=()=>{B(l),G(l),O(X),Y(l,()=>k.refresh())},e[5]=X,e[6]=l,e[7]=O,e[8]=k,e[9]=B,e[10]=G,e[11]=Y,e[12]=_e):_e=e[12];let pe=_e;N_(()=>{se||ge([{label:q?.plural}])},[ge,q,se]);let ce;return e[13]!==r||e[14]!==m||e[15]!==T?(ce=m&&typeof T=="function"?r?[...r,Gt(Ga,{onClick:T},"select-many")]:[Gt(Ga,{onClick:T},"select-many")]:r,e[13]=r,e[14]=m,e[15]=T,e[16]=ce):ce=e[16],Gt(M1,{children:Gt(Ul,{collectionSlug:l,columnState:a,children:Gt("div",{className:`${kn} ${kn}--${l}`,children:Ii(Hb,{docs:K,totalDocs:N.totalDocs,user:F,children:[s,Ii(Bo,{className:`${kn}__wrap`,children:[Gt(C1,{collectionConfig:ee,Description:Gt("div",{className:`${kn}__sub-header`,children:Gt(oe,{CustomComponent:c,Fallback:Gt(_b,{collectionSlug:l,description:ee?.admin?.description})})}),disableBulkDelete:u,disableBulkEdit:d,hasCreatePermission:S,i18n:Z,isBulkUploadEnabled:me&&!z.hideFileInputOnCreate,newDocumentURL:g,openBulkUpload:pe,smallBreak:Fe,t:Q}),Gt(b1,{beforeActions:ce,collectionConfig:ee,collectionSlug:l,disableQueryPresets:ee?.enableQueryPresets!==!0||f,listMenuItems:p,queryPreset:b,queryPresetPermissions:x,renderedFilters:v,resolvedFilterOptions:C}),i,K.length>0&&Gt(ql,{children:I}),K.length===0&&Ii("div",{className:`${kn}__no-results`,children:[Gt("p",{children:Z.t("general:noResults",{label:If(q?.plural,Z)})}),S&&g&&Gt(M1,{children:se?Gt(ae,{el:"button",onClick:()=>O(_),children:Z.t("general:createNewLabel",{label:If(q?.singular,Z)})}):Gt(ae,{el:"link",to:g,children:Z.t("general:createNewLabel",{label:If(q?.singular,Z)})})})]}),n,K.length>0&&Ii("div",{className:`${kn}__page-controls`,children:[Gt(ec,{hasNextPage:N.hasNextPage,hasPrevPage:N.hasPrevPage,limit:N.limit,nextPage:N.nextPage,numberOfNeighbors:1,onChange:ne=>void j(ne),page:N.page,prevPage:N.prevPage,totalPages:N.totalPages}),N.totalDocs>0&&Ii(M1,{children:[Ii("div",{className:`${kn}__page-info`,children:[N.page*N.limit-(N.limit-1),"-",N.totalPages>1&&N.totalPages!==N.page?N.limit*N.page:N.totalDocs," ",Z.t("general:of")," ",N.totalDocs]}),Gt(w1,{handleChange:ne=>void V(ne),limit:TG(M?.limit)?Number(M.limit):P,limits:ee?.admin?.pagination?.limits,resetPage:N.totalDocs<=N.pagingCounter}),Fe&&Ii("div",{className:`${kn}__list-selection`,children:[Gt(iu,{collectionConfig:ee,disableBulkDelete:u,disableBulkEdit:d,label:If(ee.labels.plural,Z)}),Gt("div",{className:`${kn}__list-selection-actions`,children:m&&typeof T=="function"?r?[...r,Gt(Ga,{onClick:T},"select-many")]:[Gt(Ga,{onClick:T},"select-many")]:r})]})]})]})]}),o]})})})})}function EG(t){return{...t,filesize:DG(t.filesize)}}import{jsx as sr,jsxs as z_}from"react/jsx-runtime";import{useRouter as eW,useSearchParams as tW}from"next/navigation.js";import{formatAdminURL as oW}from"payload/shared";import rW,{Fragment as nW,useCallback as H1,useEffect as H_,useMemo as sW,useRef as X1,useState as _f}from"react";import{c as k_}from"react/compiler-runtime";import{jsx as Wa,jsxs as L_}from"react/jsx-runtime";var $_=t=>{let e=k_(7),{drawerSlug:o}=t,{closeModal:n}=de(),{t:r}=$(),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=L_(Bo,{className:`${os}__header`,children:[L_("div",{className:`${os}__header-content`,children:[Wa("h2",{className:`${os}__header-text`,children:Wa(S1,{element:"span"})}),Wa("button",{"aria-label":r("general:close"),className:`${os}__header-close`,onClick:i,type:"button",children:Wa(pt,{})})]}),Wa(PG,{})]}),e[0]=n,e[1]=o,e[2]=r,e[3]=s}else s=e[3];return s},PG=()=>{let t=k_(3),{id:e,title:o}=Ae(),n;return t[0]!==e||t[1]!==o?(n=e&&e!==o?Wa(Cf,{id:e.toString()}):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],n};import{formatAdminURL as NG}from"payload/shared";var j_=({adminRoute:t,router:e})=>{let o=NG({adminRoute:t,path:"/"});e.push(o)};import{formatAdminURL as LG}from"payload/shared";var O_=({adminRoute:t,collectionSlug:e,router:o})=>{let n=LG({adminRoute:t,path:e?`/collections/${e}`:"/"});o.push(n)};var B1=(t,e,o,n,r,s,i,l,a,c)=>{if(a)try{s(t,e??o,n),r||(l.current.hasShownLockedModal=!0),l.current={hasShownLockedModal:l.current?.hasShownLockedModal,isLocked:!0,user:n},i(n),r&&c&&c(!1)}catch(u){console.error("Error during document takeover:",u)}};import{c as VG}from"react/compiler-runtime";import{jsx as nn,jsxs as du}from"react/jsx-runtime";import GG,{Fragment as WG,useEffect as zG,useState as HG}from"react";import{jsx as Sf,jsxs as V1}from"react/jsx-runtime";import{getTranslation as kG}from"@payloadcms/translations";import{text as $G}from"payload/shared";import jG,{useEffect as M_,useMemo as B_,useState as V_}from"react";var OG="apiKey",MG="api-key",BG="field-type",G_=({enabled:t,readOnly:e})=>{let[o]=V_(Wi()),[n,r]=V_(!1),{i18n:s,t:i}=$(),{config:l,getEntityConfig:a}=W(),{collectionSlug:c}=Ae(),u=Et(([C])=>C&&C[OG]||null),d=a({collectionSlug:c})?.fields?.find(C=>"name"in C&&C.name==="apiKey"),f=C=>$G(C,{name:"apiKey",type:"text",blockData:{},data:{},event:"onChange",maxLength:48,minLength:24,path:["apiKey"],preferences:{fields:{}},req:{payload:{config:l},t:i},siblingData:{}}),m=u?.value,h=B_(()=>{let C="API Key";return d?.label&&(C=d.label),kG(C,s)},[d,s]),p=B_(()=>V1("div",{className:`${MG}__label`,children:[Sf("span",{children:h}),Sf(Dc,{value:m})]}),[h,m]),g=Te({path:"apiKey",validate:f}),b=()=>{n&&r(!1),setTimeout(()=>{r(!0)},1)},{setValue:x,value:v}=g;return M_(()=>{!m&&t&&x(o),!t&&m&&x(null)},[m,t,x,o]),M_(()=>{n&&setTimeout(()=>{r(!1)},1e4)},[n]),t?V1(jG.Fragment,{children:[V1("div",{className:[BG,"api-key","read-only"].filter(Boolean).join(" "),children:[p,Sf("input",{"aria-label":h,className:n?"highlight":void 0,disabled:!0,id:"apiKey",name:"apiKey",type:"text",value:v||""})]}),!e&&Sf(o1,{highlightField:b,setKey:()=>x(Wi())})]}):null};var Rf="auth-fields",W_=t=>{let e=VG(57),{className:o,collectionSlug:n,disableLocalStrategy:r,email:s,loginWithUsername:i,operation:l,readOnly:a,requirePassword:c,setValidateBeforeSubmit:u,useAPIKey:d,username:f,verify:m}=t,{permissions:h}=Se(),[p,g]=HG(c),b=Et(XG),x=Et(UG),v=Ht(),{i18n:C,t:y}=$(),{docPermissions:I,isEditing:w,isInitializing:A}=Ae(),{config:_}=W(),{routes:D,serverURL:T}=_,{api:S}=D,R=!r||typeof r=="object"&&r.enableFields===!0,E=a||A,F=I?.fields===!0?!0:I?.fields?.enableAPIKey,L=a||F===!0||F&&typeof F=="object"&&!F?.update,k=a||F!==!0&&!F?.update,N=F===!0||F?.read,P;e:{let z=h?.collections?.[n];if(z){P=!!("unlock"in z&&z.unlock);break e}P=!1}let j=P,V;e[0]!==x||e[1]!==u||e[2]!==y?(V=z=>{z?(u(!0),x({type:"UPDATE",errorMessage:y("validation:required"),path:"password",valid:!1}),x({type:"UPDATE",errorMessage:y("validation:required"),path:"confirm-password",valid:!1})):(u(!1),x({type:"REMOVE",path:"password"}),x({type:"REMOVE",path:"confirm-password"})),g(z)},e[0]=x,e[1]=u,e[2]=y,e[3]=V):V=e[3];let M=V,O;e[4]!==S||e[5]!==n||e[6]!==s||e[7]!==C.language||e[8]!==i||e[9]!==T||e[10]!==y||e[11]!==f?(O=async()=>{let z=`${T}${S}/${n}/unlock`;(await fetch(z,{body:JSON.stringify(i&&f?{username:f}:{email:s}),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/json"},method:"post"})).status===200?fe.success(y("authentication:successfullyUnlocked")):fe.error(y("authentication:failedToUnlock"))},e[4]=S,e[5]=n,e[6]=s,e[7]=C.language,e[8]=i,e[9]=T,e[10]=y,e[11]=f,e[12]=O):O=e[12];let B=O,G,Y;if(e[13]!==v?(G=()=>{v||g(!1)},Y=[v],e[13]=v,e[14]=G,e[15]=Y):(G=e[14],Y=e[15]),zG(G,Y),r&&!R&&!d)return null;let X;e[16]!==o?(X=[Rf,o].filter(Boolean),e[16]=o,e[17]=X):X=e[17];let ee=X.join(" "),q;if(e[18]!==L||e[19]!==N||e[20]!==p||e[21]!==n||e[22]!==r||e[23]!==E||e[24]!==I?.fields||e[25]!==b?.value||e[26]!==k||e[27]!==R||e[28]!==M||e[29]!==j||e[30]!==w||e[31]!==i||e[32]!==l||e[33]!==a||e[34]!==c||e[35]!==y||e[36]!==ee||e[37]!==B||e[38]!==d||e[39]!==m){let z;e[41]!==L||e[42]!==N||e[43]!==n||e[44]!==E||e[45]!==b?.value||e[46]!==k||e[47]!==y||e[48]!==d?(z=d&&nn("div",{className:`${Rf}__api-key`,children:N&&du(WG,{children:[nn(cr,{field:{name:"enableAPIKey",admin:{disabled:E,readOnly:k},label:y("authentication:enableAPIKey")},path:"enableAPIKey",schemaPath:`${n}.enableAPIKey`}),nn(G_,{enabled:!!b?.value,readOnly:L})]})}),e[41]=L,e[42]=N,e[43]=n,e[44]=E,e[45]=b?.value,e[46]=k,e[47]=y,e[48]=d,e[49]=z):z=e[49];let re;e[50]!==n||e[51]!==E||e[52]!==w||e[53]!==a||e[54]!==y||e[55]!==m?(re=m&&w&&nn(cr,{field:{name:"_verified",admin:{disabled:E,readOnly:a},label:y("authentication:verified")},path:"_verified",schemaPath:`${n}._verified`}),e[50]=n,e[51]=E,e[52]=w,e[53]=a,e[54]=y,e[55]=m,e[56]=re):re=e[56],q=du("div",{className:ee,children:[R&&du(GG.Fragment,{children:[nn(O1,{loginWithUsername:i,operation:l,permissions:I?.fields,readOnly:a,t:y}),(p||c)&&(!r||!R)&&du("div",{className:`${Rf}__changing-password`,children:[nn(Gc,{autoComplete:"new-password",field:{name:"password",label:y("authentication:newPassword"),required:!0},indexPath:"",parentPath:"",parentSchemaPath:"",path:"password",schemaPath:"password"}),nn(Vc,{disabled:a})]}),du("div",{className:`${Rf}__controls`,children:[p&&!c&&nn(ae,{buttonStyle:"secondary",disabled:E,onClick:()=>M(!1),size:"medium",children:y("general:cancel")}),!p&&!c&&!r&&nn(ae,{buttonStyle:"secondary",disabled:E,id:"change-password",onClick:()=>M(!0),size:"medium",children:y("authentication:changePassword")}),l==="update"&&j&&nn(ae,{buttonStyle:"secondary",disabled:E,onClick:()=>void B(),size:"medium",children:y("authentication:forceUnlock")})]})]}),z,re]}),e[18]=L,e[19]=N,e[20]=p,e[21]=n,e[22]=r,e[23]=E,e[24]=I?.fields,e[25]=b?.value,e[26]=k,e[27]=R,e[28]=M,e[29]=j,e[30]=w,e[31]=i,e[32]=l,e[33]=a,e[34]=c,e[35]=y,e[36]=ee,e[37]=B,e[38]=d,e[39]=m,e[40]=q}else q=e[40];return q};function XG(t){let[e]=t;return e&&e?.enableAPIKey||null}function UG(t){return t[1]}import{c as YG}from"react/compiler-runtime";import{getTranslation as ZG}from"@payloadcms/translations";import{formatAdminURL as G1}from"payload/shared";import{useEffect as JG}from"react";var W1=t=>{let e=YG(20),{id:o,collectionSlug:n,globalSlug:r,pluralLabel:s,useAsTitle:i}=t,l=t?.view||void 0,{isEditing:a,isInitializing:c,title:u}=Ae(),{isEntityVisible:d}=N1(),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}=An(),{i18n:p,t:g}=$(),{config:b}=W(),{routes:x}=b,{admin:v}=x,C,y;return e[4]!==v||e[5]!==n||e[6]!==r||e[7]!==p||e[8]!==o||e[9]!==a||e[10]!==c||e[11]!==m||e[12]!==s||e[13]!==h||e[14]!==g||e[15]!==u||e[16]!==i||e[17]!==l?(C=()=>{let I=[];c||(n?(I.push({label:ZG(s,p),url:m?G1({adminRoute:v,path:`/collections/${n}`}):void 0}),a?I.push({label:i&&i!=="id"&&u||`${o}`,url:m?G1({adminRoute:v,path:`/collections/${n}/${o}`}):void 0}):I.push({label:g("general:createNew")})):r&&I.push({label:u,url:m?G1({adminRoute:v,path:`/globals/${r}`}):void 0}),l&&I.push({label:l}),h(I))},y=[h,c,a,s,o,i,v,g,p,u,n,r,l,m],e[4]=v,e[5]=n,e[6]=r,e[7]=p,e[8]=o,e[9]=a,e[10]=c,e[11]=m,e[12]=s,e[13]=h,e[14]=g,e[15]=u,e[16]=i,e[17]=l,e[18]=C,e[19]=y):(C=e[18],y=e[19]),JG(C,y),null};import{c as qG}from"react/compiler-runtime";import{useEffect as QG,useRef as KG}from"react";var z1=t=>{let e=qG(13),{collectionConfig:o,config:n,fallback:r,globalConfig:s}=t,i=o?.admin?.useAsTitle,l;e[0]!==i?(l=b=>{let[x]=b;return i&&x&&x?.[i]||null},e[0]=i,e[1]=l):l=e[1];let a=Et(l),c=KG(!1),{i18n:u}=$(),{setDocumentTitle:d}=Ae(),f=n?.admin?.dateFormat,m;e[2]!==o||e[3]!==f||e[4]!==r||e[5]!==a||e[6]!==s||e[7]!==u?(m=lr({collectionConfig:o,data:{id:""},dateFormat:f,fallback:typeof a=="string"?a:typeof a=="number"?String(a):a?.value||r,globalConfig:s,i18n:u}),e[2]=o,e[3]=f,e[4]=r,e[5]=a,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]),QG(p,g),null};var Df="collection-edit";function iW({Description:t,PreviewButton:e,PublishButton:o,SaveButton:n,SaveDraftButton:r,Upload:s}){let{id:i,action:l,AfterDocument:a,AfterFields:c,apiURL:u,BeforeFields:d,collectionSlug:f,currentEditor:m,disableActions:h,disableCreate:p,disableLeaveWithoutSaving:g,docPermissions:b,documentIsLocked:x,getDocPermissions:v,getDocPreferences:C,globalSlug:y,hasPublishPermission:I,hasSavePermission:w,incrementVersionCount:A,initialState:_,isEditing:D,isInitializing:T,lastUpdateTime:S,redirectAfterCreate:R,redirectAfterDelete:E,redirectAfterDuplicate:F,savedDocumentData:L,setCurrentEditor:k,setDocumentIsLocked:N,unlockDocument:P,updateDocumentEditor:j,updateSavedDocumentData:V}=Ae(),{clearDoc:M,drawerSlug:O,onDelete:B,onDuplicate:G,onSave:Y}=Zl(),X=!!O,{refreshCookieAsync:ee,user:q}=Se(),{config:z,config:{admin:{user:re},routes:{admin:me}},getEntityConfig:se}=W(),Z=se({collectionSlug:f}),Q=se({globalSlug:y}),ge=ut(),Ie=eW(),Fe=tW(),{reportUpdate:Le}=ai(),{resetUploadEdits:K}=hn(),{getFormState:_e}=Dt(),{startRouteTransition:pe}=it(),ce=X1(null),ne=X1(null),H=Fe.get("locale"),U=Z?.slug||Q?.slug,le=f&&!i?"create":"update",De=Z?Z.auth:void 0,Ne=Z?Z.upload:void 0,qe=Z||Q,Ue=qe?.lockDocuments!==void 0?qe?.lockDocuments:!0,ke=Ue!==!1,Wt=(typeof Ue=="object"?Ue.duration:300)*1e3,mt=!!(Z?.versions?.drafts&&Z?.versions?.drafts?.autosave||Q?.versions?.drafts&&Q?.versions?.drafts?.autosave),ze=typeof g<"u"?!g:!mt,[rt,ue]=_f(!1),[ve,Ve]=_f(!1),[Ge,$e]=_f(Date.now()),ie=S+Wt,J=Date.now()>ie,te=X1({hasShownLockedModal:!1,isLocked:!1,user:null}),he=[Df,(i||y)&&`${Df}--is-editing`];y&&he.push(`global-edit--${y}`),f&&he.push(`collection-edit--${f}`);let Pe=sW(()=>[U],[U]),[je,Ye]=_f(()=>!!(le==="create"&&De&&!De.disableLocalStrategy)),Qe=H1(Ct=>{N(!0);let lo=typeof te.current?.user=="object"?te.current?.user?.id:te.current?.user;if(Ct){let co=typeof Ct.user=="string"||typeof Ct.user=="number"?Ct.user:Ct.user.id;(!te.current||co!==lo)&&(lo===q.id&&co!==q.id&&(Ve(!0),te.current.hasShownLockedModal=!0),te.current={hasShownLockedModal:te.current?.hasShownLockedModal||!1,isLocked:!0,user:Ct.user},k(Ct.user))}},[k,N,q?.id]),Ze=H1(async Ct=>{let lo=er(ne),co=Ct?.doc||Ct?.result;if(Le({id:i,entitySlug:U,updatedAt:co?.updatedAt||new Date().toISOString()}),q&&f===re&&i===q.id&&ee(),A(),typeof V=="function"&&V(co||{}),typeof Y=="function"){let He=i?"update":"create";Y({...Ct,operation:He,updatedAt:He==="update"?new Date().toISOString():co?.updatedAt||new Date().toISOString()})}if(!D&&ge<2&&R!==!1){let He=oW({adminRoute:me,path:`/collections/${f}/${co?.id}${H?`?locale=${H}`:""}`});pe(()=>Ie.push(He))}else K();if(await v(Ct),(i||y)&&!mt){let He=await C(),{state:uo}=await _e({id:i,collectionSlug:f,data:co,docPermissions:b,docPreferences:He,globalSlug:y,operation:le,renderAllFields:!0,returnLockStatus:!1,schemaPath:Pe.join("."),signal:lo.signal,skipValidation:!0});return ke&&N(!1),ne.current=null,uo}},[Le,i,U,q,f,re,A,V,Y,D,ge,v,y,mt,ee,me,H,Ie,K,C,_e,b,le,Pe,ke,N,pe]),_t=H1(async({formState:Ct,submitted:lo})=>{let co=er(ce),He=Date.now(),uo=He-Ge,ko=ke&&uo>=1e4;ko&&$e(He);let mo=await C(),{lockedState:$n,state:Si}=await _e({id:i,collectionSlug:f,docPermissions:b,docPreferences:mo,formState:Ct,globalSlug:y,operation:le,skipValidation:!lo,renderAllFields:!1,returnLockStatus:ke,schemaPath:Pe.join("."),signal:co.signal,updateLastEdited:ko});return ke&&Qe($n),ce.current=null,Si},[i,f,C,_e,y,Qe,ke,le,Pe,b,Ge]);H_(()=>()=>{ke&&x&&(i||y)&&!["preview","api","versions"].some(lo=>window.location.pathname.includes(lo))&&(typeof te.current?.user=="object"?te.current?.user?.id===q?.id:te.current?.user===q?.id)&&(P(i,f??y),N(!1),k(null)),Ve(!1)},[f,y,i,P,q,k,ke,x,N]),H_(()=>{let Ct=ce.current,lo=ne.current;return()=>{Ko(Ct),Ko(lo)}},[]);let _o=x&&m&&(typeof m=="object"?m.id!==q?.id:m!==q?.id)&&!rt&&!ve&&!te.current?.hasShownLockedModal&&!J;return sr("main",{className:he.filter(Boolean).join(" "),children:sr(ml,{operation:le,children:z_(wn,{action:l,className:`${Df}__form`,disabled:rt||T||!w,disableValidationOnSubmit:!je,initialState:!T&&_,isDocumentForm:!0,isInitializing:T,method:i?"PATCH":"POST",onChange:[_t],onSuccess:Ze,children:[X&&sr($_,{drawerSlug:O}),ke&&_o&&!rt&&sr(Rb,{handleGoBack:()=>O_({adminRoute:me,collectionSlug:f,router:Ie}),isActive:_o,onReadOnly:()=>{ue(!0),Ve(!1)},onTakeOver:()=>B1(i,f,y,q,!1,j,k,te,ke),updatedAt:S,user:m}),ke&&ve&&sr(Sb,{handleBackToDashboard:()=>j_({adminRoute:me,router:Ie}),isActive:ve,onReadOnly:()=>{ue(!0),Ve(!1)}}),!rt&&ze&&sr(Wc,{}),!X&&sr(W1,{collectionSlug:Z?.slug,globalSlug:Q?.slug,id:i,pluralLabel:Z?.labels?.plural,useAsTitle:Z?.admin?.useAsTitle}),sr(z1,{collectionConfig:Z,config:z,fallback:ge<=1?i?.toString():void 0,globalConfig:Q}),sr(Kb,{apiURL:u,customComponents:{PreviewButton:e,PublishButton:o,SaveButton:n,SaveDraftButton:r},data:L,disableActions:h,disableCreate:p,hasPublishPermission:I,hasSavePermission:w,id:i,isEditing:D,onDelete:B,onDrawerCreateNew:M,onDuplicate:G,onSave:Ze,onTakeOver:()=>B1(i,f,y,q,!0,j,k,te,ke,ue),permissions:b,readOnlyForIncomingUser:rt,redirectAfterDelete:E,redirectAfterDuplicate:F,slug:Z?.slug||Q?.slug,user:m}),sr(Rc,{AfterFields:c,BeforeFields:d||z_(nW,{children:[De&&sr(W_,{className:`${Df}__auth`,collectionSlug:Z.slug,disableLocalStrategy:Z.auth?.disableLocalStrategy,email:L?.email,loginWithUsername:De?.loginWithUsername,operation:le,readOnly:!w,requirePassword:!i,setValidateBeforeSubmit:Ye,useAPIKey:De.useAPIKey,username:L?.username,verify:De.verify}),Ne&&sr(rW.Fragment,{children:s||sr(Nc,{collectionSlug:Z.slug,initialState:_,uploadConfig:Ne})})]}),Description:t,docPermissions:b,fields:qe.fields,readOnly:rt||!w,schemaPathSegments:Pe}),a]})})})}export{Fb as Account,rB as ActionsProvider,NB as AppHeader,Mc as ArrayField,Ep as AuthProvider,yr as Banner,yl as BlocksDrawer,wl as BlocksField,dS as BulkUploadDrawer,fb as BulkUploadProvider,ae as Button,eD as CalendarIcon,kB as Card,Yp as CheckIcon,cr as CheckboxField,Os as CheckboxInput,Je as ChevronIcon,E1 as ClientFunctionProvider,Pb as CloseMenuIcon,FV as CodeBlockIcon,Q_ as CodeEdiftor,Il as CodeEditorLazy,Sl as CodeField,Vs as Collapsible,_l as CollapsibleField,Pf as ConfigProvider,Vc as ConfirmPasswordField,It as ConfirmationModal,bl as CopyIcon,Vb as CopyLocaleData,Dc as CopyToClipboard,i1 as DateCondition,tD as DatePicker,Gl as DateTimeField,sh as DefaultBlockImage,Kl as DefaultCell,iW as DefaultEditView,FG as DefaultListView,Xb as DeleteMany,Kb as DocumentControls,sb as DocumentEventsProvider,Rc as DocumentFields,dl as DocumentInfoProvider,Rb as DocumentLocked,Sb as DocumentTakeOver,Bs as DragHandleIcon,Pt as Drawer,ar as DrawerToggler,ii as Dropzone,Ts as EditDepthProvider,wr as EditIcon,t1 as EditMany,ib as EditUpload,O1 as EmailAndUsernameFields,qs as EmailField,YV as EntityVisibilityProvider,D1 as ErrorIcon,to as ErrorPill,AV as ExternalLinkIcon,We as FieldDescription,Xe as FieldError,be as FieldLabel,am as File,ub as FileDetails,wn as Form,R9 as FormLoadingOverlayToggle,Gr as FormSubmit,a8 as FullscreenModal,o1 as GenerateConfirmation,Wl as GroupField,Bo as Gutter,kb as Hamburger,zl as HiddenField,f8 as HydrateAuthProvider,T1 as InfoIcon,oc as JSONField,tc as JoinField,Wc as LeaveWithoutSaving,Zp as LineIcon,Kt as Link,Qf as LinkIcon,b1 as ListControls,og as ListDrawerContextProvider,C1 as ListHeader,sg as ListQueryProvider,iu as ListSelection,vn as LoadingOverlay,G2 as LoadingOverlayToggle,kp as LocaleProvider,Qc as Locked,y1 as LogOutIcon,hV as Logout,Nb as MenuIcon,EV as MinimizeMaximizeIcon,Xo as Modal,Kp as MoreIcon,xV as NavGroup,Ob as NavToggler,gl as NullifyLocaleField,a1 as NumberCondition,rc as NumberField,ml as OperationProvider,ec as Pagination,L1 as ParamsProvider,Gc as PasswordField,rf as PayloadIcon,w1 as PerPage,bt as Pill,jo as PlusIcon,nc as PointField,fo as Popup,Be as PopupList,Lp as PreferencesProvider,Ub as PreviewButton,db as PreviewSizes,WV as ProgressBar,Zb as PublishButton,v1 as PublishMany,bM as QueryPresetsAccessCell,wM as QueryPresetsColumnField,mM as QueryPresetsColumnsCell,hM as QueryPresetsWhereCell,DM as QueryPresetsWhereField,ac as RadioGroupField,yt as ReactSelect,c1 as RelationshipCondition,mc as RelationshipField,ql as RelationshipProvider,Dg as RelationshipTable,oe as RenderCustomComponent,IL as RenderDefaultCell,yo as RenderFields,S1 as RenderTitle,fc as RichTextField,hG as RootProvider,Gb as RouteCacheProvider,Jf as RouteTransitionProvider,pc as RowField,sn as RowLabel,Uf as RowLabelProvider,Jb as SaveButton,qb as SaveDraftButton,cu as ScrollInfoProvider,s1 as SearchFilter,Cl as SearchIcon,j1 as SearchParamsProvider,ih as SectionTitle,yt as Select,yG as SelectAll,m1 as SelectCondition,hc as SelectField,fa as SelectInput,Ga as SelectMany,IG as SelectRow,Hb as SelectionProvider,ig as ServerFunctionsProvider,W1 as SetDocumentStepNav,z1 as SetDocumentTitle,_B as SetStepNav,wt as ShimmerEffect,TV as SortColumn,Z_ as StaggeredShimmers,A1 as SuccessIcon,Kf as SwapIcon,Jg as TabComponent,Yb as Table,Ul as TableColumnsProvider,xc as TabsField,Kh as TabsProvider,f1 as TextCondition,si as TextField,Qg as TextInput,Cc as TextareaField,Kg as TextareaInput,Lf as ThemeProvider,kr as Thumbnail,Vl as TimezonePicker,po as Tooltip,gi as Translation,Ef as TranslationProvider,yc as UIField,x1 as UnpublishMany,Nc as Upload,zp as UploadEditsProvider,Oc as UploadField,Hg as UploadHandlersProvider,Xm as UploadInput,_b as ViewDescription,F1 as WarningIcon,Ws as WatchChildErrors,Up as WatchCondition,k1 as WindowInfoProvider,pt as XIcon,HO as allFieldComponents,J_ as defaultTheme,os as documentDrawerBaseClass,Ce as fieldBaseClass,NS as fieldComponents,bc as fieldReducer,_p as formatDrawerSlug,Nr as parseSearchParams,fe as toast,Eb as useActions,$V as useAddClientFunction,Di as useAllFormFields,Se as useAuth,Wo as useBulkUpload,fS as useBulkUploadDrawerSlug,yg as useCellProps,jV as useClientFunctions,Xn as useCollapsible,W as useConfig,Yo as useDebounce,Lg as useDebouncedCallback,Wg as useDebouncedEffect,Nf as useDelay,ug as useDelayedRender,Yt as useDocumentDrawer,Zl as useDocumentDrawerContext,ai as useDocumentEvents,_i as useDocumentForm,Ae as useDocumentInfo,sl as useDrawerSlug,ut as useEditDepth,Jt as useEffectEvent,N1 as useEntityVisibility,Te as useField,Me as useForm,Xf as useFormBackgroundProcessing,Et as useFormFields,Rs as useFormInitializing,Ht as useFormModified,$o as useFormProcessing,zt as useFormSubmitted,pi as useHotkey,an as useIntersect,kc as useListDrawer,Yr as useListDrawerContext,so as useListQuery,pg as useListRelationships,Ee as useLocale,de as useModal,vi as useNav,Jo as useOperation,eG as useParams,rM as usePayloadAPI,Do as usePreferences,aM as useResize,Fn as useRouteCache,it as useRouteTransition,gD as useRowLabel,lu as useScrollInfo,pG as useSearchParams,Qt as useSelection,Dt as useServerFunctions,An as useStepNav,ia as useTableColumns,q_ as useTheme,ks as useThrottledEffect,$ as useTranslation,hn as useUploadEdits,gc as useUploadHandlers,Cb as useUseTitleField,_u as useWatchForm,$1 as useWindowInfo,Oe as withCondition};
56
+ `)});else return y();return!1}catch{return y()}})},[g,y,i,u,m,n,p,d,l,r,o,h,f,b,e]);return d===bo.None||!v?null:QB(o7.Fragment,{children:[w4("button",{className:`${r7}__toggle`,onClick:()=>{a(C)},type:"button",children:h("general:delete")}),w4(It,{body:h("general:aboutToDeleteCount",{count:c,label:I4(c>1?n:r,m)}),confirmingLabel:h("general:deleting"),heading:h("general:confirmDeletion"),modalSlug:C,onConfirm:I})]})};import{c as W7}from"react/compiler-runtime";import{jsx as ct,jsxs as No}from"react/jsx-runtime";import{getTranslation as z7}from"@payloadcms/translations";import{formatAdminURL as H7}from"payload/shared";import Qb,{Fragment as Kc,useEffect as X7}from"react";import{jsx as D4,jsxs as s7}from"react/jsx-runtime";import{dequal as i7}from"dequal/lite";import{reduceFieldsToValues as T4,versionDefaults as a7}from"payload/shared";import A4,{useDeferredValue as l7,useEffect as F4,useRef as Pn,useState as c7}from"react";import{unflatten as n7}from"payload/shared";var _4=(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=n7(n.data))),n};var u7="autosave",E4=1e3,P4=({id:t,collection:e,global:o})=>{let{config:{routes:{api:n},serverURL:r}}=W(),{docConfig:s,incrementVersionCount:i,lastUpdateTime:l,mostRecentVersionIsAutosaved:a,setLastUpdateTime:c,setMostRecentVersionIsAutosaved:u,setUnpublishedVersionCount:d,updateSavedDocumentData:f}=Ae(),m=Pn([]),h=Pn(!1),{reportUpdate:p}=li(),{dispatchFields:g,isValid:b,setBackgroundProcessing:x,setIsValid:v,setSubmitted:C}=Me(),y=$o(),[I]=Ti(),w=Ht(),A=zt(),{code:_}=Ee(),{i18n:D,t:T}=$(),S=s?.versions,R=a7.autosaveInterval;S.drafts&&S.drafts.autosave&&(R=S.drafts.autosave.interval);let E=!!(s?.versions?.drafts&&s?.versions?.drafts.validate),[F,L]=c7(!1),k=l7(F),N=Yo(I,R),P=Pn(I),j=Pn(w),V=Pn(_),M=Pn(b);P.current=I,j.current=w,V.current=_;let O=A4.useCallback(async()=>{if(h.current||m.current.length===0)return;if(y){m.current=[];return}if(!M.current){m.current=[],M.current=!0;return}h.current=!0;let q=m.current[m.current.length-1];m.current=[],x(!0);try{await q()}finally{h.current=!1,x(!1),m.current.length>0&&await O()}x(!1)},[y,x]),B=Pn(null),G=Jt(()=>{B.current=void 0;let q,z,re=()=>{z-q<E4?B.current=setTimeout(()=>{L(!1)},E4-(z-q)):ee()},me=async()=>{if(w){q=new Date().getTime(),L(!0);let se,Z,Q;if(e&&t&&(Q=e.slug,se=`${r}${n}/${Q}/${t}?draft=true&autosave=true&locale=${V.current}`,Z="PATCH"),o&&(Q=o.slug,se=`${r}${n}/globals/${Q}?draft=true&autosave=true&locale=${V.current}`,Z="POST"),se&&j.current){let{data:ge,valid:Ie}=_4(P.current,!0);if(ge._status="draft",!(A&&!Ie&&S?.drafts&&S?.drafts?.validate)&&M.current){let Le;try{Le=await fetch(se,{body:JSON.stringify(ge),credentials:"include",headers:{"Accept-Language":D.language,"Content-Type":"application/json"},method:Z})}catch{}let K=new Date;z=K.getTime(),Le.status===200&&(c(K.getTime()),p({id:t,entitySlug:Q,updatedAt:K.toISOString()}),a||(i(),u(!0),d(pe=>pe+1)));let _e=await Le.json();if(S?.drafts&&S?.drafts?.validate&&_e?.errors){if(Array.isArray(_e.errors)){let[pe,ce]=_e.errors.reduce(([ne,H],U)=>{let le=[],De=[];return U?.message&&De.push(U),Array.isArray(U?.data)&&U.data.forEach(Ne=>{Ne?.field?le.push(Ne):De.push(Ne)}),[[...ne,...le],[...H,...De]]},[[],[]]);g({type:"ADD_SERVER_ERRORS",errors:pe}),ce.forEach(ne=>{fe.error(ne.message||D.t("error:unknown"))}),M.current=!1,v(!1),C(!0),re();return}}else{let pe=_e?.doc||_e?.result;pe&&(v(!0),M.current=!0,f(pe))}re()}}}};m.current.push(me),O()}),Y=Pn(!1),X=Pn(T4(N));F4(()=>{if(!Y.current){Y.current=!0;return}let q=T4(N);i7(q,X)||(X.current=q,G())},[N]),F4(()=>()=>{ee()},[]);let ee=Jt(()=>{B.current&&clearTimeout(B.current),L(!1)});return s7("div",{className:u7,children:[E&&!b&&D4(Wc,{}),k&&T("general:saving"),!k&&!!l&&D4(A4.Fragment,{children:T("version:lastSavedAgo",{distance:Tx({date:l,i18n:D})})})]})};import{jsx as cf,jsxs as d7}from"react/jsx-runtime";import{getTranslation as N4}from"@payloadcms/translations";import{useRouter as m7}from"next/navigation.js";import{formatAdminURL as f7}from"payload/shared";import p7,{useCallback as L4}from"react";var k4=t=>{let{id:e,buttonId:o,collectionSlug:n,onDelete:r,redirectAfterDelete:s=!0,singularLabel:i,title:l}=t,{config:{routes:{admin:a,api:c},serverURL:u},getEntityConfig:d}=W(),f=d({collectionSlug:n}),{setModified:m}=Me(),h=m7(),{i18n:p,t:g}=$(),{title:b}=Ae(),{startRouteTransition:x}=it(),{openModal:v}=de(),C=`delete-${e}`,y=L4(()=>{fe.error(g("error:deletingTitle",{title:b}))},[g,b]),I=L4(async()=>{m(!1);try{await Ke.delete(`${u}${c}/${n}/${e}`,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(async w=>{try{let A=await w.json();if(w.status<400){if(fe.success(g("general:titleDeleted",{label:N4(i,p),title:b})||A.message),s)return x(()=>h.push(f7({adminRoute:a,path:`/collections/${n}`})));typeof r=="function"&&await r({id:e,collectionConfig:f});return}return A.errors?A.errors.forEach(_=>fe.error(_.message)):y(),!1}catch{return y()}})}catch{return y()}},[m,u,c,n,e,g,i,y,p,b,h,a,s,r,f,x]);return e?d7(p7.Fragment,{children:[cf(Be.Button,{id:o,onClick:()=>{v(C)},children:g("general:delete")}),cf(It,{body:cf(bi,{elements:{1:({children:w})=>cf("strong",{children:w})},i18nKey:"general:aboutToDelete",t:g,variables:{label:N4(i,p),title:l||b||e}}),confirmingLabel:g("general:deleting"),heading:g("general:confirmDeletion"),modalSlug:C,onConfirm:I})]}):null};import{jsx as $4,jsxs as h7}from"react/jsx-runtime";import{getTranslation as j4}from"@payloadcms/translations";import{useRouter as g7}from"next/navigation.js";import{formatAdminURL as b7}from"payload/shared";import O4,{useCallback as M4}from"react";var B4=({id:t,slug:e,onDuplicate:o,redirectAfterDuplicate:n=!0,singularLabel:r})=>{let s=g7(),i=Ht(),{openModal:l}=de(),a=Ee(),{setModified:c}=Me(),{startRouteTransition:u}=it(),{config:{routes:{admin:d,api:f},serverURL:m},getEntityConfig:h}=W(),p=h({collectionSlug:e}),[g,b]=O4.useState(!1),{i18n:x,t:v}=$(),C=`duplicate-${t}`,y=M4(async()=>{b(!0),await Ke.post(`${m}${f}/${e}/${t}/duplicate${a?.code?`?locale=${a.code}`:""}`,{body:JSON.stringify({}),headers:{"Accept-Language":x.language,"Content-Type":"application/json",credentials:"include"}}).then(async w=>{let{doc:A,errors:_,message:D}=await w.json();if(w.status<400){if(fe.success(D||v("general:successfullyDuplicated",{label:j4(r,x)})),c(!1),n)return u(()=>s.push(b7({adminRoute:d,path:`/collections/${e}/${A.id}${a?.code?`?locale=${a.code}`:""}`})));typeof o=="function"&&o({collectionConfig:p,doc:A})}else fe.error(_?.[0].message||D||v("error:unspecific",{label:j4(r,x)}))})},[a,m,f,e,t,x,v,r,o,n,c,s,d,p,u]),I=M4(async()=>{b(!1),await y()},[y]);return h7(O4.Fragment,{children:[$4(Be.Button,{id:"action-duplicate",onClick:()=>i?(b(!0),l(C)):y(),children:v("general:duplicate")}),g&&$4(It,{body:v("general:unsavedChangesDuplicate"),confirmLabel:v("general:duplicateWithoutSaving"),heading:v("general:unsavedChanges"),modalSlug:C,onConfirm:I})]})};import{c as x7}from"react/compiler-runtime";import{jsx as W4,jsxs as C7}from"react/jsx-runtime";import{useState as y7}from"react";import{jsx as V4,jsxs as v7}from"react/jsx-runtime";import"react";var G4=({className:t})=>v7("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:[V4("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"}),V4("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 z4="locked",Qc=t=>{let e=x7(8),{className:o,user:n}=t,[r,s]=y7(!1),{t:i}=$(),l=qm(n)?n.email??n.id:i("general:anotherUser"),a;e[0]!==o?(a=[z4,o].filter(Boolean),e[0]=o,e[1]=a):a=e[1];let c=a.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=`${l} ${i("general:isEditing")}`,m;return e[4]!==r||e[5]!==c||e[6]!==f?(m=C7("div",{className:c,onMouseEnter:u,onMouseLeave:d,role:"button",tabIndex:0,children:[W4(po,{alignCaret:"left",className:`${z4}__tooltip`,position:"top",show:r,children:f}),W4(G4,{})]}),e[4]=r,e[5]=c,e[6]=f,e[7]=m):m=e[7],m};import{c as S7}from"react/compiler-runtime";import{jsx as R7}from"react/jsx-runtime";import"react";import*as X4 from"qs-esm";import{useCallback as w7,useRef as I7,useState as H4}from"react";var U4=()=>{let{id:t,collectionSlug:e,globalSlug:o,versionCount:n}=Ae(),[r,s]=H4(!1),[i,l]=H4(""),{code:a}=Ee(),c=n>0,{config:{routes:{api:u},serverURL:d}}=W(),{t:f}=$(),m=I7(!1);return{generatePreviewURL:w7(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 x=await fetch(`${g}?${X4.stringify({draft:c?"true":"false",locale:a||void 0})}`);if(!x.ok)throw new Error;let v=await x.json();if(!v)throw new Error;l(v),s(!1),m.current=!1,p&&window.open(v,"_blank")}catch{s(!1),m.current=!1,fe.error(f("error:previewing"))}}},[d,u,e,o,c,a,t,f]),isLoading:r,label:f(r?"general:loading":"version:preview"),previewURL:i}};var _7="preview-btn";function Ub(t){let e=S7(5),{generatePreviewURL:o,label:n}=U4(),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=R7(ae,{buttonStyle:"secondary",className:_7,icon:"link",iconPosition:"left",onClick:r,size:"medium",children:n}),e[2]=n,e[3]=r,e[4]=s):s=e[4],s}import{c as L7}from"react/compiler-runtime";import{jsx as Fa,jsxs as eR}from"react/jsx-runtime";import*as oR from"qs-esm";import tR from"react";import{jsx as Y4}from"react/jsx-runtime";import"react";var D7="form-submit",Gr=t=>{let{type:e="submit",buttonId:o,children:n,disabled:r,onClick:s,programmaticSubmit:i,ref:l}=t,a=$o(),c=Xf(),u=_s(),{disabled:d,submit:f}=Me();return Y4("div",{className:D7,children:Y4(ae,{ref:l,...t,disabled:!(r||u||a||c||d)?void 0:!0,id:o,onClick:s??(i?()=>{f()}:void 0),type:e,children:n})})};import{jsx as Bt,jsxs as Ci}from"react/jsx-runtime";import{getTranslation as E7}from"@payloadcms/translations";import*as Q4 from"qs-esm";import Po,{useCallback as P7,useMemo as N7}from"react";import{jsx as Cs,jsxs as T7}from"react/jsx-runtime";import"react";var Z4="table",Yb=({appearance:t,columns:e,data:o})=>{let n=e?.filter(r=>r?.active);return!n||n.length===0?Cs("div",{children:"No columns selected"}):Cs("div",{className:[Z4,t&&`${Z4}--appearance-${t}`].filter(Boolean).join(" "),children:T7("table",{cellPadding:"0",cellSpacing:"0",children:[Cs("thead",{children:Cs("tr",{children:n.map((r,s)=>Cs("th",{id:`heading-${r.accessor}`,children:r.Heading},s))})}),Cs("tbody",{children:o&&o.map((r,s)=>Cs("tr",{className:`row-${s+1}`,children:n.map((i,l)=>{let{accessor:a}=i;return Cs("td",{className:`cell-${a}`,children:i.renderedCells[s]},l)})},s))})]})})};import{jsx as tn,jsxs as A7}from"react/jsx-runtime";import{getTranslation as F7}from"@payloadcms/translations";import"react";var J4=({dateFormat:t,deleteHandler:e,docs:o,i18n:n,localization:r,supportedTimezones:s,t:i})=>{let l=[{accessor:"input.type",active:!0,field:{name:"",type:"text"},Heading:tn("span",{children:i("version:type")}),renderedCells:o.map(a=>{let c=a.input?.type;return A7(bt,{pillStyle:c==="publish"?"success":"warning",children:[c==="publish"&&i("version:publish"),c==="unpublish"&&i("version:unpublish")]},a.id)})},{accessor:"waitUntil",active:!0,field:{name:"",type:"date"},Heading:tn("span",{children:i("general:time")}),renderedCells:o.map(a=>tn("span",{children:pn({date:a.waitUntil,i18n:n,pattern:t,timezone:a.input.timezone})},a.id))},{accessor:"input.timezone",active:!0,field:{name:"",type:"text"},Heading:tn("span",{children:i("general:timezone")}),renderedCells:o.map(a=>{let u=s.find(d=>d.value===a.input.timezone)?.label||a.input.timezone;return tn("span",{children:u||i("general:noValue")},a.id)})}];return r&&l.push({accessor:"input.locale",active:!0,field:{name:"",type:"text"},Heading:tn("span",{children:i("general:locale")}),renderedCells:o.map(a=>{if(a.input.locale){let c=r.locales.find(u=>u.code===a.input.locale);if(c)return tn("span",{children:F7(c.label,n)},a.id)}return tn("span",{children:i("general:all")},a.id)})}),l.push({accessor:"delete",active:!0,field:{name:"delete",type:"text"},Heading:tn("span",{children:i("general:delete")}),renderedCells:o.map(a=>tn(ae,{buttonStyle:"icon-label",className:"schedule-publish__delete",icon:"x",onClick:c=>{c.preventDefault(),e(a.id)},tooltip:i("general:delete")},a.id))}),l};var Aa="schedule-publish",q4={label:"All",value:"all"},K4=({slug:t,defaultType:e})=>{let{toggleModal:o}=de(),{config:{admin:{dateFormat:n,timezones:{defaultTimezone:r,supportedTimezones:s}},localization:i,routes:{api:l},serverURL:a}}=W(),{id:c,collectionSlug:u,globalSlug:d,title:f}=Ae(),{i18n:m,t:h}=$(),{schedulePublish:p}=Dt(),[g,b]=Po.useState(e||"publish"),[x,v]=Po.useState(),[C,y]=Po.useState(r),[I,w]=Po.useState(q4),[A,_]=Po.useState(!1),D=h("general:schedulePublishFor",{title:f}),[T,S]=Po.useState(),[R,E]=Po.useState(),F=Po.useRef(()=>null),L=Intl.DateTimeFormat().resolvedOptions().timeZone,k=Po.useMemo(()=>{if(i){let O=i.locales.map(({code:B,label:G})=>({label:E7(G,m),value:B}));return O.unshift(q4),O}return[]},[i,m]),N=Po.useCallback(async()=>{let O={sort:"waitUntil",where:{and:[{taskSlug:{equals:"schedulePublish"}},{waitUntil:{greater_than:new Date}}]}};u&&(O.where.and.push({"input.doc.value":{equals:String(c)}}),O.where.and.push({"input.doc.relationTo":{equals:u}})),d&&O.where.and.push({"input.global":{equals:d}});let{docs:B}=await Ke.post(`${a}${l}/payload-jobs`,{body:Q4.stringify(O),headers:{"Accept-Language":m.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"}}).then(G=>G.json());E(J4({dateFormat:n,deleteHandler:F.current,docs:B,i18n:m,localization:i,supportedTimezones:s,t:h})),S(B)},[u,d,a,l,m,n,i,s,h,c]),P=Po.useCallback(async O=>{try{await p({deleteID:O}),await N(),fe.success(h("general:deletedSuccessfully"))}catch(B){console.error(B),fe.error(B.message)}},[N,p,h]);Po.useEffect(()=>{F.current=P},[P]);let j=Po.useCallback(async()=>{if(!x)return fe.error(h("general:noDateSelected"));_(!0);let O;typeof I=="object"&&I.value!=="all"&&g==="publish"&&(O=I.value);try{await p({type:g,date:x,doc:u?{relationTo:u,value:String(c)}:void 0,global:d||void 0,locale:O,timezone:C}),v(void 0),fe.success(h("version:scheduledSuccessfully")),N()}catch(B){console.error(B),fe.error(B.message)}_(!1)},[x,I,g,h,p,u,c,d,C,N]),V=N7(()=>{if(C&&L&&x){let O=jt.tz(C),B=jt.tz(L),G=new jt(x).withTimeZone(C),Y=Rr(G,O);return Rr(Y,B).toISOString()}return x},[C,x,L]),M=P7(O=>{if(C&&O){let B=jt.tz(C),G=new jt(O),Y=Rr(G,B);v(Y||null)}else v(O||null)},[v,C]);return Po.useEffect(()=>{T||(async()=>await N())()},[T,N]),Ci(Pt,{className:Aa,gutter:!1,Header:Ci("div",{className:`${Aa}__drawer-header`,children:[Bt("h2",{title:D,children:D}),Bt(Dm,{onClick:()=>o(t)})]}),slug:t,children:[Ci(Bo,{className:`${Aa}__scheduler`,children:[Bt(be,{label:h("version:type"),required:!0}),Ci("ul",{className:`${Aa}__type`,children:[Bt("li",{children:Bt(ic,{id:`${t}-type`,isSelected:g==="publish",onChange:()=>b("publish"),option:{label:h("version:publish"),value:"publish"},path:`${t}-type`,readOnly:A})}),Bt("li",{children:Bt(ic,{id:`${t}-type`,isSelected:g==="unpublish",onChange:()=>b("unpublish"),option:{label:h("version:unpublish"),value:"unpublish"},path:`${t}-type`,readOnly:A})})]}),Bt("br",{}),Bt(be,{label:h("general:time"),path:"time",required:!0}),Bt(zi,{id:"time",minDate:new Date,onChange:O=>M(O),pickerAppearance:"dayAndTime",readOnly:A,timeIntervals:5,value:V}),s.length>0&&Bt(Vl,{id:"timezone-picker",onChange:y,options:s,selectedTimezone:C}),Bt("br",{}),k.length>0&&g==="publish"&&Ci(Po.Fragment,{children:[Bt(be,{label:h("localization:localeToPublish")}),Bt(yt,{onChange:O=>w(O),options:k,value:I}),Bt("br",{})]}),Ci("div",{className:`${Aa}__actions`,children:[Bt(ae,{buttonStyle:"primary",disabled:A,id:"scheduled-publish-save",onClick:j,type:"button",children:h("general:save")}),A?Bt("span",{children:h("general:saving")}):null]})]}),Ci(Bo,{className:`${Aa}__upcoming`,children:[Bt("h4",{children:h("general:upcomingEvents")}),!T&&Bt(wt,{}),T?.length===0&&Bt(yr,{type:"info",children:h("general:noUpcomingEventsScheduled")}),T?.length>0&&Bt(Yb,{appearance:"condensed",columns:R,data:T})]})]})};function Zb(t){let e=L7(74),{label:o}=t,{id:n,collectionSlug:r,docConfig:s,globalSlug:i,hasPublishedDoc:l,hasPublishPermission:a,setHasPublishedDoc:c,setMostRecentVersionIsAutosaved:u,setUnpublishedVersionCount:d,unpublishedVersionCount:f,uploadStatus:m}=Ae(),{config:h,getEntityConfig:p}=W(),{submit:g}=Me(),b=Ht(),x=ut(),{code:v}=Ee(),{isModalOpen:C,toggleModal:y}=de(),I=`schedule-publish-${n}`,{localization:w,routes:A,serverURL:_}=h,{api:D}=A,{t:T}=$(),S;e[0]!==o||e[1]!==T?(S=o||T("version:publishChanges"),e[0]=o,e[1]=T,e[2]=S):S=e[2];let R=S,E;e:{if(r){let ce;e[3]!==r||e[4]!==p?(ce=p({collectionSlug:r}),e[3]=r,e[4]=p,e[5]=ce):ce=e[5],E=ce;break e}if(i){let ce;e[6]!==p||e[7]!==i?(ce=p({globalSlug:i}),e[6]=p,e[7]=i,e[8]=ce):ce=e[8],E=ce;break e}E=void 0}let F=E,L=f>0,k=a&&(b||L||!l)&&m!=="uploading",P=!!(typeof F?.versions?.drafts=="object"&&F?.versions?.drafts.schedulePublish&&a&&(i||r&&n)&&!b),V=Jo()==="update"&&!b,M;e[9]!==D||e[10]!==r||e[11]!==V||e[12]!==i||e[13]!==n||e[14]!==v||e[15]!==_||e[16]!==g?(M=async()=>{if(V)return;let ce=`?locale=${v}&depth=0&fallback-locale=null&draft=true`,ne,H="POST";r&&(ne=`${_}${D}/${r}${n?`/${n}`:""}${ce}`,n&&(H="PATCH")),i&&(ne=`${_}${D}/globals/${i}${ce}`),await g({action:ne,method:H,overrides:{_status:"draft"},skipValidation:!0})},e[9]=D,e[10]=r,e[11]=V,e[12]=i,e[13]=n,e[14]=v,e[15]=_,e[16]=g,e[17]=M):M=e[17];let O=M,B;e[18]===Symbol.for("react.memo_cache_sentinel")?(B=["s"],e[18]=B):B=e[18];let G;e[19]!==x?(G={cmdCtrlKey:!0,editDepth:x,keyCodes:B},e[19]=x,e[20]=G):G=e[20];let Y;e[21]!==s||e[22]!==O?(Y=ce=>{ce.preventDefault(),ce.stopPropagation(),O&&s.versions?.drafts&&s.versions?.drafts?.autosave&&O()},e[21]=s,e[22]=O,e[23]=Y):Y=e[23],hi(G,Y);let X;e[24]!==c||e[25]!==u||e[26]!==d||e[27]!==g||e[28]!==m?(X=()=>{m!=="uploading"&&(g({overrides:{_status:"published"}}),d(0),u(!1),c(!0))},e[24]=c,e[25]=u,e[26]=d,e[27]=g,e[28]=m,e[29]=X):X=e[29];let ee=X,q;e[30]!==D||e[31]!==r||e[32]!==i||e[33]!==n||e[34]!==_||e[35]!==c||e[36]!==g||e[37]!==m?(q=ce=>{if(m==="uploading")return;let ne=oR.stringify({publishSpecificLocale:ce}),H=`${_}${D}${i?`/globals/${i}`:`/${r}/${n?`${"/"+n}`:""}`}${ne?"?"+ne:""}`;g({action:H,overrides:{_status:"published"}}),c(!0)},e[30]=D,e[31]=r,e[32]=i,e[33]=n,e[34]=_,e[35]=c,e[36]=g,e[37]=m,e[38]=q):q=e[38];let z=q,re=!w||w&&w.defaultLocalePublishOption!=="active",me;e[39]!==v||e[40]!==w?(me=w&&w?.locales.find(ce=>typeof ce=="string"?ce===v:ce.code===v),e[39]=v,e[40]=w,e[41]=me):me=e[41];let se=me,Z=se&&(typeof se.label=="string"?se.label:se.label?.[v]??void 0),Q;e[42]!==se||e[43]!==ee||e[44]!==re||e[45]!==z?(Q=re?ee:()=>z(se.code),e[42]=se,e[43]=ee,e[44]=re,e[45]=z,e[46]=Q):Q=e[46];let ge=Q,Ie;e[47]!==Z||e[48]!==R||e[49]!==re||e[50]!==T?(Ie=re?R:T("version:publishIn",{locale:Z}),e[47]=Z,e[48]=R,e[49]=re,e[50]=T,e[51]=Ie):Ie=e[51];let Fe=Ie,Le;e[52]!==se||e[53]!==ee||e[54]!==re||e[55]!==z?(Le=re?()=>z(se.code):ee,e[52]=se,e[53]=ee,e[54]=re,e[55]=z,e[56]=Le):Le=e[56];let K=Le,_e,pe;if(e[57]!==Z||e[58]!==k||e[59]!==P||e[60]!==Fe||e[61]!==ge||e[62]!==I||e[63]!==L||e[64]!==a||e[65]!==C||e[66]!==R||e[67]!==w||e[68]!==re||e[69]!==K||e[70]!==T||e[71]!==y){pe=Symbol.for("react.early_return_sentinel");e:{let ce=re?T("version:publishIn",{locale:Z}):T("version:publishAllLocales");if(!a){pe=null;break e}_e=eR(tR.Fragment,{children:[Fa(Gr,{buttonId:"action-save",disabled:!k,enableSubMenu:P,onClick:ge,size:"medium",SubMenuPopupContent:w||P?ne=>{let{close:H}=ne;return eR(tR.Fragment,{children:[P&&Fa(Be.ButtonGroup,{children:Fa(Be.Button,{id:"schedule-publish",onClick:()=>[y(I),H()],children:T("version:schedulePublish")})},"schedule-publish"),w&&k&&Fa(Be.ButtonGroup,{children:Fa(Be.Button,{id:"publish-locale",onClick:K,children:ce})})]})}:void 0,type:"button",children:w?Fe:R}),P&&C(I)&&Fa(K4,{defaultType:L?"publish":"unpublish",slug:I})]})}e[57]=Z,e[58]=k,e[59]=P,e[60]=Fe,e[61]=ge,e[62]=I,e[63]=L,e[64]=a,e[65]=C,e[66]=R,e[67]=w,e[68]=re,e[69]=K,e[70]=T,e[71]=y,e[72]=_e,e[73]=pe}else _e=e[72],pe=e[73];return pe!==Symbol.for("react.early_return_sentinel")?pe:_e}import{jsx as k7}from"react/jsx-runtime";import{useRef as $7}from"react";function Jb({label:t}){let{uploadStatus:e}=Ae(),{t:o}=$(),{submit:n}=Me(),r=Ht(),s=t||o("general:save"),i=$7(null),l=ut(),c=Jo()==="update"&&!r||e==="uploading";return hi({cmdCtrlKey:!0,editDepth:l,keyCodes:["s"]},d=>{d.preventDefault(),d.stopPropagation(),i?.current&&i.current.click()}),k7(Gr,{buttonId:"action-save",disabled:c,onClick:()=>{if(e!=="uploading")return void n()},ref:i,size:"medium",type:"button",children:s})}import{jsx as j7}from"react/jsx-runtime";import{useCallback as O7,useRef as M7}from"react";var B7="save-draft";function qb(t){let{config:{routes:{api:e},serverURL:o}}=W(),{id:n,collectionSlug:r,globalSlug:s,setUnpublishedVersionCount:i,uploadStatus:l}=Ae(),a=Ht(),{code:c}=Ee(),u=M7(null),d=ut(),{t:f}=$(),{submit:m}=Me(),p=Jo()==="update"&&!a||l==="uploading",g=O7(async()=>{if(p)return;let b=`?locale=${c}&depth=0&fallback-locale=null&draft=true`,x,v="POST";r&&(x=`${o}${e}/${r}${n?`/${n}`:""}${b}`,n&&(v="PATCH")),s&&(x=`${o}${e}/globals/${s}${b}`),await m({action:x,method:v,overrides:{_status:"draft"},skipValidation:!0}),i(C=>C+1)},[m,r,s,o,e,c,n,p,i]);return hi({cmdCtrlKey:!0,editDepth:d,keyCodes:["s"]},b=>{b.preventDefault(),b.stopPropagation(),u?.current&&u.current.click()}),j7(Gr,{buttonId:"action-save-draft",buttonStyle:"secondary",className:B7,disabled:p,onClick:()=>void g(),ref:u,size:"medium",type:"button",children:f("version:saveDraft")})}import{c as V7}from"react/compiler-runtime";import{jsx as Ea,jsxs as uf}from"react/jsx-runtime";import rR from"react";var Pa="status",nR=()=>{let t=V7(37),{id:e,collectionSlug:o,docPermissions:n,globalSlug:r,hasPublishedDoc:s,incrementVersionCount:i,setHasPublishedDoc:l,setMostRecentVersionIsAutosaved:a,setUnpublishedVersionCount:c,unpublishedVersionCount:u}=Ae(),{toggleModal:d}=de(),{config:f}=W(),{routes:m,serverURL:h}=f,{api:p}=m,{reset:g}=Me(),{code:b}=Ee(),{i18n:x,t:v}=$(),C=`confirm-un-publish-${e}`,y=`confirm-revert-${e}`,I;u>0&&s?I="changed":s?s&&u<=0&&(I="published"):I="draft";let w;t[0]!==p||t[1]!==o||t[2]!==r||t[3]!==x.language||t[4]!==e||t[5]!==i||t[6]!==b||t[7]!==g||t[8]!==h||t[9]!==l||t[10]!==a||t[11]!==c||t[12]!==v?(w=async D=>{let T,S,R;D==="unpublish"&&(R={_status:"draft"}),o&&(T=`${h}${p}/${o}/${e}?locale=${b}&fallback-locale=null&depth=0`,S="patch"),r&&(T=`${h}${p}/globals/${r}?locale=${b}&fallback-locale=null&depth=0`,S="post"),D==="revert"&&(R=await Ke.get(T,{headers:{"Accept-Language":x.language,"Content-Type":"application/json"}}).then(G7));let E=await Ke[S](T,{body:JSON.stringify(R),headers:{"Accept-Language":x.language,"Content-Type":"application/json"}});if(E.status===200){let F,L=await E.json();r?F=L.result:o&&(F=L.doc),g(F),fe.success(L.message),i(),a(!1),D==="unpublish"?l(!1):D==="revert"&&c(0)}else fe.error(v("error:unPublishingDocument"))},t[0]=p,t[1]=o,t[2]=r,t[3]=x.language,t[4]=e,t[5]=i,t[6]=b,t[7]=g,t[8]=h,t[9]=l,t[10]=a,t[11]=c,t[12]=v,t[13]=w):w=t[13];let A=w,_=n?.update;if(I){let D=`${v("version:status")}: ${v(`version:${I}`)}`,T;if(t[14]!==_||t[15]!==A||t[16]!==y||t[17]!==I||t[18]!==v||t[19]!==D||t[20]!==d||t[21]!==C){let S;t[23]!==_||t[24]!==A||t[25]!==I||t[26]!==v||t[27]!==d||t[28]!==C?(S=_&&I==="published"&&uf(rR.Fragment,{children:["\xA0\u2014\xA0",Ea(ae,{buttonStyle:"none",className:`${Pa}__action`,onClick:()=>d(C),children:v("version:unpublish")}),Ea(It,{body:v("version:aboutToUnpublish"),confirmingLabel:v("version:unpublishing"),heading:v("version:confirmUnpublish"),modalSlug:C,onConfirm:()=>A("unpublish")})]}),t[23]=_,t[24]=A,t[25]=I,t[26]=v,t[27]=d,t[28]=C,t[29]=S):S=t[29];let R;t[30]!==_||t[31]!==A||t[32]!==y||t[33]!==I||t[34]!==v||t[35]!==d?(R=_&&I==="changed"&&uf(rR.Fragment,{children:["\xA0\u2014\xA0",Ea(ae,{buttonStyle:"none",className:`${Pa}__action`,id:"action-revert-to-published",onClick:()=>d(y),children:v("version:revertToPublished")}),Ea(It,{body:v("version:aboutToRevertToPublished"),confirmingLabel:v("version:reverting"),heading:v("version:confirmRevertToSaved"),modalSlug:y,onConfirm:()=>A("revert")})]}),t[30]=_,t[31]=A,t[32]=y,t[33]=I,t[34]=v,t[35]=d,t[36]=R):R=t[36],T=Ea("div",{className:Pa,title:D,children:uf("div",{className:`${Pa}__value-wrap`,children:[uf("span",{className:`${Pa}__label`,children:[v("version:status"),":\xA0"]}),Ea("span",{className:`${Pa}__value`,children:v(`version:${I}`)}),S,R]})}),t[14]=_,t[15]=A,t[16]=y,t[17]=I,t[18]=v,t[19]=D,t[20]=d,t[21]=C,t[22]=T}else T=t[22];return T}return null};function G7(t){return t.json()}var At="doc-controls",Kb=t=>{let e=W7(15),{id:o,slug:n,customComponents:r,data:s,disableActions:i,disableCreate:l,hasSavePermission:a,isAccountView:c,isEditing:u,onDelete:d,onDrawerCreateNew:f,onDuplicate:m,onTakeOver:h,permissions:p,readOnlyForIncomingUser:g,redirectAfterDelete:b,redirectAfterDuplicate:x,user:v}=t,C;e[0]!==r?(C=r===void 0?{}:r,e[0]=r,e[1]=C):C=e[1];let{PreviewButton:y,PublishButton:I,SaveButton:w,SaveDraftButton:A}=C,{i18n:_,t:D}=$(),T=ut(),{config:S,getEntityConfig:R}=W(),E=R({collectionSlug:n}),F=R({globalSlug:n}),{admin:L,localization:k,routes:N}=S,{dateFormat:P}=L,{admin:j}=N,[V,M]=Qb.useState(""),[O,B]=Qb.useState(""),G=$o(),Y=_s(),X,ee;e[2]!==s||e[3]!==P||e[4]!==_?(X=()=>{s?.updatedAt&&M(pn({date:s.updatedAt,i18n:_,pattern:P})),s?.createdAt&&B(pn({date:s.createdAt,i18n:_,pattern:P}))},ee=[s,_,P],e[2]=s,e[3]=P,e[4]=_,e[5]=X,e[6]=ee):(X=e[5],ee=e[6]),X7(X,ee);let q=p&&"create"in p&&p.create,z=p&&"delete"in p&&p.delete,re=!!(E&&o&&!i&&(q||z)),me=!o&&E?.versions?.drafts&&E.versions?.drafts.validate,se=E?.versions?.drafts&&E?.versions?.drafts?.autosave||F?.versions?.drafts&&F?.versions?.drafts?.autosave,Z=k&&!E?.admin?.disableCopyToLocale,Q;e[7]!==g||e[8]!==v?(Q=v&&g&&ct(Qc,{className:`${At}__locked-controls`,user:v}),e[7]=g,e[8]=v,e[9]=Q):Q=e[9];let ge;return e[10]!==h||e[11]!==g||e[12]!==D||e[13]!==v?(ge=v&&g&&ct(ae,{buttonStyle:"secondary",id:"take-over",onClick:h,size:"medium",type:"button",children:D("general:takeOver")}),e[10]=h,e[11]=g,e[12]=D,e[13]=v,e[14]=ge):ge=e[14],No(Bo,{className:At,children:[No("div",{className:`${At}__wrapper`,children:[ct("div",{className:`${At}__content`,children:No("ul",{className:`${At}__meta`,children:[E&&!u&&!c&&ct("li",{className:`${At}__list-item`,children:ct("p",{className:`${At}__value`,children:_.t("general:creatingNewLabel",{label:z7(E?.labels?.singular??_.t("general:document"),_)})})}),Q,(E?.versions?.drafts||F?.versions?.drafts)&&No(Kc,{children:[(F||E&&u)&&ct("li",{className:[`${At}__status`,`${At}__list-item`].filter(Boolean).join(" "),children:ct(nR,{})}),a&&se&&!me&&ct("li",{className:`${At}__list-item`,children:ct(P4,{collection:E,global:F,id:o,publishedDocUpdatedAt:s?.createdAt})})]}),E?.timestamps&&(u||c)&&No(Kc,{children:[No("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:s?.updatedAt?V:"",children:[No("p",{className:`${At}__label`,children:[_.t("general:lastModified"),":\xA0"]}),s?.updatedAt&&ct("p",{className:`${At}__value`,children:V})]}),No("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:s?.createdAt?O:"",children:[No("p",{className:`${At}__label`,children:[_.t("general:created"),":\xA0"]}),s?.createdAt&&ct("p",{className:`${At}__value`,children:O})]})]})]})}),No("div",{className:`${At}__controls-wrapper`,children:[No("div",{className:`${At}__controls`,children:[(E?.admin.preview||F?.admin.preview)&&ct(oe,{CustomComponent:y,Fallback:ct(Ub,{})}),a&&ct(Kc,{children:E?.versions?.drafts||F?.versions?.drafts?No(Kc,{children:[(me||!se)&&ct(oe,{CustomComponent:A,Fallback:ct(qb,{})}),ct(oe,{CustomComponent:I,Fallback:ct(Zb,{})})]}):ct(oe,{CustomComponent:w,Fallback:ct(Jb,{})})}),ge]}),re&&!g&&ct(fo,{button:No("div",{className:`${At}__dots`,children:[ct("div",{}),ct("div",{}),ct("div",{})]}),className:`${At}__popup`,disabled:Y||G,horizontalAlign:"right",size:"large",verticalAlign:"bottom",children:No(Be.ButtonGroup,{children:[Z&&ct(Vb,{}),q&&No(Qb.Fragment,{children:[!l&&ct(Kc,{children:T>1?ct(Be.Button,{id:"action-create",onClick:f,children:_.t("general:createNew")}):ct(Be.Button,{href:H7({adminRoute:j,path:`/collections/${E?.slug}/create`}),id:"action-create",children:_.t("general:createNew")})}),E.disableDuplicate!==!0&&u&&ct(B4,{id:o.toString(),onDuplicate:m,redirectAfterDuplicate:x,singularLabel:E?.labels?.singular,slug:E?.slug})]}),z&&ct(k4,{buttonId:"action-delete",collectionSlug:E?.slug,id:o.toString(),onDelete:d,redirectAfterDelete:b,singularLabel:E?.labels?.singular,useAsTitle:E?.admin?.useAsTitle})]})})]})]}),ct("div",{className:`${At}__divider`})]})};import{c as o8}from"react/compiler-runtime";import{jsx as mf,jsxs as r8}from"react/jsx-runtime";import{useState as n8}from"react";import{c as e1}from"react/compiler-runtime";import{jsx as ao,jsxs as df}from"react/jsx-runtime";import{getTranslation as U7}from"@payloadcms/translations";import{useRouter as Y7,useSearchParams as Z7}from"next/navigation.js";import{mergeListSearchAndWhere as J7,unflatten as sR}from"payload/shared";import*as cR from"qs-esm";import iR,{useCallback as aR,useEffect as q7,useMemo as lR,useState as Q7}from"react";var K7=t=>{let e=e1(7),{action:o,disabled:n}=t,{submit:r}=Me(),{t:s}=$(),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 l=i,a;return e[3]!==n||e[4]!==l||e[5]!==s?(a=ao(Gr,{className:`${Lo}__save`,disabled:n,onClick:l,children:s("general:save")}),e[3]=n,e[4]=l,e[5]=s,e[6]=a):a=e[6],a},e8=t=>{let e=e1(7),{action:o,disabled:n}=t,{submit:r}=Me(),{t:s}=$(),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 l=i,a;return e[3]!==n||e[4]!==l||e[5]!==s?(a=ao(Gr,{className:`${Lo}__publish`,disabled:n,onClick:l,children:s("version:publishChanges")}),e[3]=n,e[4]=l,e[5]=s,e[6]=a):a=e[6],a},t8=t=>{let e=e1(7),{action:o,disabled:n}=t,{submit:r}=Me(),{t:s}=$(),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 l=i,a;return e[3]!==n||e[4]!==l||e[5]!==s?(a=ao(Gr,{buttonStyle:"secondary",className:`${Lo}__draft`,disabled:n,onClick:l,children:s("version:saveDraft")}),e[3]=n,e[4]=l,e[5]=s,e[6]=a):a=e[6],a},uR=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,selectedFields:i,setSelectedFields:l}=t,{permissions:a,user:c}=Se(),{closeModal:u}=de(),{config:{routes:{api:d},serverURL:f}}=W(),{getFormState:m}=Dt(),{count:h,getQueryParams:p,selectAll:g}=Qt(),{i18n:b,t:x}=$(),[v,C]=Q7(!1),y=Y7(),I=iR.useRef(null),{clearRouteCache:w}=En(),A=a?.collections?.[r.slug],_=Z7(),D=lR(()=>sR(i.reduce((F,L)=>(F[L.value.path]=!0,F),{})),[i]),T=aR(async({formState:F,submitted:L})=>{let k=er(I),{state:N}=await m({collectionSlug:r.slug,docPermissions:A,docPreferences:null,formState:F,operation:"update",schemaPath:r.slug,select:D,signal:k.signal,skipValidation:!L});return I.current=null,N},[m,r,A,D]);q7(()=>{let F=I.current;return()=>{Ko(F)}},[]);let S=lR(()=>{let F=J7({collectionConfig:r,search:_.get("search")});return p(F)},[r,_,p]),R=()=>{y.replace(cR.stringify({...Nr(_),page:g===bo.AllAvailable?"1":void 0},{addQueryPrefix:!0})),w(),u(s)},E=aR(async({dispatchFields:F,formState:L,selected:k})=>{C(!0),l(k||[]);let{state:N}=await m({collectionSlug:r.slug,docPermissions:A,docPreferences:null,formState:L,operation:"update",schemaPath:r.slug,select:sR(k.reduce((P,j)=>(P[j.value.path]=!0,P),{})),skipValidation:!0});F({type:"UPDATE_MANY",formState:N}),C(!1)},[m,r.slug,A,l]);return ao(dl,{collectionSlug:r.slug,currentEditor:c,hasPublishedDoc:!1,id:null,initialData:{},isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,versionCount:0,children:ao(ud,{value:"update",children:df("div",{className:`${Lo}__main`,children:[df("div",{className:`${Lo}__header`,children:[ao("h2",{className:`${Lo}__header__title`,children:x("general:editingLabel",{count:h,label:U7(h>1?o:n,b)})}),ao("button",{"aria-label":x("general:close"),className:`${Lo}__header__close`,id:`close-drawer__${s}`,onClick:()=>u(s),type:"button",children:ao(pt,{})})]}),df(In,{className:`${Lo}__form`,isInitializing:v,onChange:[T],onSuccess:R,children:[ao(Nm,{fields:e,onChange:E,permissions:A.fields}),i.length===0?null:ao("div",{className:"render-fields",children:i.map((F,L)=>{let{value:{field:k,fieldPermissions:N,path:P}}=F;return ao(xa,{clientFieldConfig:k,indexPath:"",parentPath:"",parentSchemaPath:"",path:P,permissions:N},`${P}-${L}`)})}),ao("div",{className:`${Lo}__sidebar-wrap`,children:ao("div",{className:`${Lo}__sidebar`,children:ao("div",{className:`${Lo}__sidebar-sticky-wrap`,children:ao("div",{className:`${Lo}__document-actions`,children:r?.versions?.drafts?df(iR.Fragment,{children:[ao(t8,{action:`${f}${d}/${r.slug}${S}&draft=true`,disabled:i.length===0}),ao(e8,{action:`${f}${d}/${r.slug}${S}&draft=true`,disabled:i.length===0})]}):ao(K7,{action:`${f}${d}/${r.slug}${S}`,disabled:i.length===0})})})})})]})]})})})};var Lo="edit-many",t1=t=>{let e=o8(10),{collection:o}=t,{slug:n}=o,{permissions:r}=Se(),{openModal:s}=de(),{selectAll:i}=Qt(),{t:l}=$(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];let[c,u]=n8(a),d=r?.collections?.[n],f=`edit-${n}`;if(i===bo.None||!d?.update)return null;let m;if(e[1]!==f||e[2]!==s||e[3]!==t.collection||e[4]!==c||e[5]!==l){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=r8("div",{className:Lo,children:[mf("button",{"aria-label":l("general:edit"),className:`${Lo}__toggle`,onClick:h,type:"button",children:l("general:edit")}),mf(As,{children:mf(Pt,{Header:null,slug:f,children:mf(uR,{collection:t.collection,drawerSlug:f,selectedFields:c,setSelectedFields:u})})})]}),e[1]=f,e[2]=s,e[3]=t.collection,e[4]=c,e[5]=l,e[6]=m}else m=e[6];return m};import{c as s8}from"react/compiler-runtime";import{jsx as i8}from"react/jsx-runtime";import"react";function a8(t){let e=s8(6),o=ut(),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=i8(Xo,{...t,style:{...n,zIndex:r}}),e[2]=t,e[3]=n,e[4]=r,e[5]=s):s=e[5],s}import{jsx as ff,jsxs as l8}from"react/jsx-runtime";import c8,{useCallback as u8}from"react";function o1(t){let{highlightField:e,setKey:o}=t,{id:n}=Ae(),{toggleModal:r}=de(),{t:s}=$(),i=`generate-confirmation-${n}`,l=u8(()=>{o(),fe.success(s("authentication:newAPIKeyGenerated")),e(!0)},[e,o,s]);return l8(c8.Fragment,{children:[ff(ae,{buttonStyle:"secondary",onClick:()=>{r(i)},size:"small",children:s("authentication:generateNewAPIKey")}),ff(It,{body:ff(bi,{elements:{1:({children:a})=>ff("strong",{children:a})},i18nKey:"authentication:generatingNewAPIKeyWillInvalidate",t:s}),confirmLabel:s("authentication:generate"),heading:s("authentication:confirmGeneration"),modalSlug:i,onConfirm:l})]})}import{c as d8}from"react/compiler-runtime";import{useEffect as m8}from"react";function f8(t){let e=d8(4),{permissions:o}=t,{setPermissions:n}=Se(),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]),m8(r,s),null}import{jsx as Vt,jsxs as xf}from"react/jsx-runtime";import{getTranslation as ka}from"@payloadcms/translations";import{validateWhereQuery as Y8}from"payload/shared";import Z8,{Fragment as GR,useEffect as WR,useRef as zR,useState as J8}from"react";import{jsx as r1,jsxs as p8}from"react/jsx-runtime";import"react";var n1="dots",dR=({ariaLabel:t,className:e,noBackground:o,orientation:n="vertical"})=>p8("div",{"aria-label":t,className:[e,n1,o&&`${n1}--no-background`,n&&`${n1}--${n}`].filter(Boolean).join(" "),children:[r1("div",{}),r1("div",{}),r1("div",{})]});import{jsx as mR}from"react/jsx-runtime";import{useEffect as fR,useRef as pR,useState as h8}from"react";import{usePathname as g8}from"next/navigation.js";var hR="search-filter",s1=t=>{let{handleChange:e,initialParams:o,label:n}=t,r=g8(),[s,i]=h8(typeof o?.search=="string"?o?.search:void 0),l=pR(!0),a=pR(typeof o?.search=="string"?o?.search:void 0),c=Yo(s,300);return fR(()=>{o?.search!==a.current&&(l.current=!1,i(o?.search),a.current=o?.search)},[o?.search,r]),fR(()=>{c!==a.current&&l.current&&(e&&e(c),a.current=c)},[c,e]),mR("div",{className:hR,children:mR("input",{"aria-label":n,className:`${hR}__input`,id:"search-filter-input",onChange:u=>{l.current=!0,i(u.target.value)},placeholder:n,type:"text",value:s||""})})};import{jsx as kn,jsxs as ru}from"react/jsx-runtime";import{getTranslation as O8}from"@payloadcms/translations";import{transformWhereQuery as M8,validateWhereQuery as ER}from"payload/shared";import gf,{useMemo as PR}from"react";import{jsx as Nn,jsxs as p1}from"react/jsx-runtime";import{useCallback as _R,useEffect as E8,useState as P8}from"react";import{jsx as eu}from"react/jsx-runtime";import"react";import{jsx as gR}from"react/jsx-runtime";import"react";var b8="condition-value-date",i1=({disabled:t,field:{admin:e},onChange:o,value:n})=>{let{date:r}=e||{};return gR("div",{className:b8,children:gR(zi,{...r,onChange:o,readOnly:t,value:n})})};import{c as v8}from"react/compiler-runtime";import{jsx as x8}from"react/jsx-runtime";import"react";var C8="condition-value-number",a1=t=>{let e=v8(7),{disabled:o,onChange:n,value:r}=t,{t:s}=$(),i;e[0]!==n?(i=a=>n(a.target.value),e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==s||e[4]!==i||e[5]!==r?(l=x8("input",{className:C8,disabled:o,onChange:i,placeholder:s("general:enterAValue"),type:"number",value:r}),e[2]=o,e[3]=s,e[4]=i,e[5]=r,e[6]=l):l=e[6],l};import{jsx as CR,jsxs as w8}from"react/jsx-runtime";import*as SR from"qs-esm";import yR,{useCallback as pf,useEffect as wR,useReducer as I8,useState as l1}from"react";import{getTranslation as bR}from"@payloadcms/translations";var vR=t=>t.reduce((e,o)=>o.options?[...e,...vR(o.options)]:[...e,o.id],[]),y8=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,data:n,hasMultipleRelations:r,i18n:s,relation:i}=e,l=o.admin.useAsTitle||"id",a=vR(t);if(!r)return[...t,...n.docs.reduce((f,m)=>a.indexOf(m.id)===-1?(a.push(m.id),[...f,{label:m[l],value:m.id}]):f,[])];let c=[...t],u=c.find(f=>f.label===bR(o.labels.plural,s)),d=n.docs.reduce((f,m)=>a.indexOf(m.id)===-1?(a.push(m.id),[...f,{label:m[l],relationTo:i,value:m.id}]):f,[]);return u?u.options=[...u.options,...d]:c.push({label:bR(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}},xR=y8;var IR="condition-value-relationship",S8=10,c1=t=>{let{disabled:e,field:{admin:{isSortable:o}={},hasMany:n,relationTo:r},filterOptions:s,onChange:i,value:l}=t,{config:{routes:{api:a},serverURL:c},getEntityConfig:u}=W(),d=Array.isArray(r),[f,m]=I8(xR,[]),[h,p]=l1(""),g=Yo(h,300),[b,x]=l1(""),[v,C]=l1(!1),{i18n:y,t:I}=$(),w=Ee(),A=d?r:[r],_=yR.useRef(new Map(A.map(N=>[N,{hasLoadedAll:!1,nextPage:1}]))),D=pf((N,P)=>{let j=u({collectionSlug:P});m({type:"ADD",collection:j,data:N,hasMultipleRelations:d,i18n:y,relation:P})},[d,y,u]),T=Jt(async({abortController:N,relationSlug:P})=>{let j=_.current.get(P);if(P&&!j.hasLoadedAll){let M=u({collectionSlug:P})?.admin?.useAsTitle||"id",O={and:[]},B={depth:0,limit:S8,locale:w.code,page:j.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}${a}/${P}${SR.stringify(B,{addQueryPrefix:!0})}`,{credentials:"include",headers:{"Accept-Language":y.language},signal:N.signal});if(G.ok){let Y=await G.json();Y.docs.length>0&&(D(Y,P),Y.nextPage?_.current.set(P,{hasLoadedAll:!1,nextPage:Y.nextPage}):_.current.set(P,{hasLoadedAll:!0,nextPage:null}))}else x(I("error:unspecific"))}catch(G){N.signal.aborted||console.error(G)}}C(!0)}),S=yR.useCallback(()=>{let N=_.current.entries().next().value;if(N[0]&&!N[1].hasLoadedAll){let P=new AbortController;T({abortController:P,relationSlug:N[0]})}},[]),R=pf(()=>{if(l){if(n)return Array.isArray(l)?l.map(N=>{if(d){let P;return f.forEach(j=>{j.options&&j.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=l;return f.forEach(j=>{j?.options&&j.options.some(V=>V?.value==P.value?(N=V,!0):!1)}),N}return f.find(N=>N.value==l)}},[n,d,l,f]),E=pf(N=>{if(N!==h){m({type:"CLEAR",i18n:y,required:!1});let P=Array.isArray(r)?r:[r];_.current=new Map(P.map(j=>[j,{hasLoadedAll:!1,nextPage:1}])),p(N)}},[y,r,h]),F=pf(async(N,P)=>{if(!b&&N!=="null"&&N&&P){let j=await fetch(`${c}${a}/${P}/${N}?depth=0`,{credentials:"include",headers:{"Accept-Language":y.language}});if(j.ok){let V=await j.json();D({docs:[V]},P)}else console.error(I("error:loadingDocument",{id:N}))}},[y,D,a,b,c,I]);wR(()=>{let N=Array.isArray(r)?r:[r];_.current=new Map(N.map(j=>[j,{hasLoadedAll:!1,nextPage:1}])),m({type:"CLEAR",i18n:y,required:!1}),C(!1);let P=[];return N.forEach(j=>{let V=new AbortController;T({abortController:V,relationSlug:j}),P.push(V)}),()=>{P.forEach(j=>{if(j.signal)try{j.abort()}catch{}})}},[y,r,g]),wR(()=>{if(l&&v){if(n)(R()||[]).forEach((P,j)=>{P||(d?F(l[j].value,l[j].relationTo):F(l[j],r))});else if(!R())if(d){let P=l;F(P.value,P.relationTo)}else F(l,r)}},[F,R,n,d,r,l,v]);let L=["field-type",IR,b&&"error-loading"].filter(Boolean).join(" "),k=R()||l;return w8("div",{className:L,children:[!b&&CR(yt,{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:S,options:f,placeholder:I("general:selectValue"),value:k}),b&&CR("div",{className:`${IR}__error-loading`,children:b})]})};import{c as R8}from"react/compiler-runtime";import{jsx as _8}from"react/jsx-runtime";import{getTranslation as u1}from"@payloadcms/translations";import d1 from"react";var m1=t=>{let e=R8(26),{disabled:o,isClearable:n,onChange:r,operator:s,options:i,value:l}=t,{i18n:a}=$(),c;e[0]!==i?(c=Bl(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(l)){let I;e[3]!==a||e[4]!==u?(I=w=>{let A=u.find(_=>_.value===w);return{label:A?u1(A.label,a):w,value:A?.value??w}},e[3]=a,e[4]=u,e[5]=I):I=e[5],h=l.map(I)}else if(l){let I,w;if(e[6]!==a||e[7]!==u||e[8]!==l){let A;e[11]!==l?(A=_=>_.value===l,e[11]=l,e[12]=A):A=e[12],I=u.find(A),w=I?u1(I.label,a):l,e[6]=a,e[7]=u,e[8]=l,e[9]=I,e[10]=w}else I=e[9],w=e[10];h={label:w,value:I?.value??l}}let p;e[13]!==m||e[14]!==r?(p=I=>{let w;I?m?Array.isArray(I)?w=I.map(D8):w=[]:w=I.value:w=null,r(w)},e[13]=m,e[14]=r,e[15]=p):p=e[15];let g=p,b,x;e[16]!==i?(b=()=>{d(Bl(i))},x=[i],e[16]=i,e[17]=b,e[18]=x):(b=e[17],x=e[18]),d1.useEffect(b,x);let v,C;e[19]!==m||e[20]!==r||e[21]!==l?(v=()=>{!m&&Array.isArray(l)&&r(l[0])},C=[m,r,l],e[19]=m,e[20]=r,e[21]=l,e[22]=v,e[23]=C):(v=e[22],C=e[23]),d1.useEffect(v,C);let y;return e[24]!==a?(y=I=>({...I,label:u1(I.label,a)}),e[24]=a,e[25]=y):y=e[25],_8(yt,{disabled:o,isClearable:n,isMulti:m,onChange:g,options:u.map(y),value:h})};function D8(t){return t.value}import{c as T8}from"react/compiler-runtime";import{jsx as A8}from"react/jsx-runtime";import"react";var F8="condition-value-text",f1=t=>{let e=T8(7),{disabled:o,onChange:n,value:r}=t,{t:s}=$(),i;e[0]!==n?(i=a=>n(a.target.value),e[0]=n,e[1]=i):i=e[1];let l;return e[2]!==o||e[3]!==s||e[4]!==i||e[5]!==r?(l=A8("input",{className:F8,disabled:o,onChange:i,placeholder:s("general:enterAValue"),type:"text",value:r||""}),e[2]=o,e[3]=s,e[4]=i,e[5]=r,e[6]=l):l=e[6],l};var RR=({booleanSelect:t,disabled:e,filterOptions:o,internalField:n,onChange:r,operator:s,options:i,value:l})=>{if(t||["radio","select"].includes(n?.field?.type))return eu(m1,{disabled:e,field:n.field,isClearable:!t,onChange:r,operator:s,options:i,value:l});switch(n?.field?.type){case"date":return eu(i1,{disabled:e,field:n.field,onChange:r,operator:s,value:l});case"number":return eu(a1,{disabled:e,field:n.field,onChange:r,operator:s,value:l});case"relationship":return eu(c1,{disabled:e,field:n.field,filterOptions:o,onChange:r,operator:s,value:l});default:return eu(f1,{disabled:e,field:n?.field,onChange:r,operator:s,value:l})}};var Ln="condition",DR=t=>{let{addCondition:e,andIndex:o,fieldName:n,filterOptions:r,operator:s,orIndex:i,reducedFields:l,removeCondition:a,RenderedFilter:c,updateCondition:u,value:d}=t,{t:f}=$(),m=l.find(w=>w.value===n),[h,p]=P8(d),g=Yo(h,300),b=["exists"].includes(s)||m?.field?.type==="checkbox",x=[];b?x=[{label:f("general:true"),value:"true"},{label:f("general:false"),value:"false"}]:m?.field&&"options"in m.field&&(x=m.field.options);let v=Jt(async w=>{s&&await u({andIndex:o,field:m,operator:s,orIndex:i,value:w===null?"":w})});E8(()=>{v(g)},[g]);let C=!m?.value&&typeof m?.value!="number"||m?.field?.admin?.disableListFilter,y=_R(async w=>{p(void 0),await u({andIndex:o,field:l.find(A=>A.value===w.value),operator:s,orIndex:i,value:void 0})},[o,s,i,l,u]),I=_R(async w=>{await u({andIndex:o,field:m,operator:w.value,orIndex:i,value:d})},[o,m,i,u,d]);return Nn("div",{className:Ln,children:p1("div",{className:`${Ln}__wrap`,children:[p1("div",{className:`${Ln}__inputs`,children:[Nn("div",{className:`${Ln}__field`,children:Nn(yt,{disabled:C,isClearable:!1,onChange:y,options:l.filter(w=>!w.field.admin.disableListFilter),value:m||{value:m?.value}})}),Nn("div",{className:`${Ln}__operator`,children:Nn(yt,{disabled:C,isClearable:!1,onChange:I,options:m?.operators,value:m?.operators.find(w=>s===w.value)||null})}),Nn("div",{className:`${Ln}__value`,children:c||Nn(RR,{booleanSelect:b,disabled:!s||!m||m?.field?.admin?.disableListFilter,filterOptions:r,internalField:m,onChange:p,operator:s,options:x,value:h??""})})]}),p1("div",{className:`${Ln}__actions`,children:[Nn(ae,{buttonStyle:"icon-label",className:`${Ln}__actions-remove`,icon:"x",iconStyle:"with-border",onClick:()=>a({andIndex:o,orIndex:i}),round:!0}),Nn(ae,{buttonStyle:"icon-label",className:`${Ln}__actions-add`,icon:"plus",iconStyle:"with-border",onClick:()=>e({andIndex:o+1,field:l.find(w=>!w.field.admin?.disableListFilter),orIndex:i,relation:"and"}),round:!0})]})]})})};var h1=[{label:"equals",value:"equals"},{label:"isNotEqualTo",value:"not_equals"}],rr=[...h1,{label:"isIn",value:"in"},{label:"isNotIn",value:"not_in"},{label:"exists",value:"exists"}],TR=[...rr,{label:"isGreaterThan",value:"greater_than"},{label:"isLessThan",value:"less_than"},{label:"isLessThanOrEqualTo",value:"less_than_equal"},{label:"isGreaterThanOrEqualTo",value:"greater_than_equal"}],N8=[...h1,{label:"exists",value:"exists"},{label:"near",value:"near"}],AR={label:"within",value:"within"},FR={label:"intersects",value:"intersects"},tu={label:"isLike",value:"like"},ou={label:"isNotLike",value:"not_like"},Na={label:"contains",value:"contains"},L8={checkbox:{component:"Text",operators:h1},code:{component:"Text",operators:[...rr,tu,ou,Na]},date:{component:"Date",operators:[...rr,...TR]},email:{component:"Text",operators:[...rr,Na]},json:{component:"Text",operators:[...rr,tu,Na,ou,AR,FR]},number:{component:"Number",operators:[...rr,...TR]},point:{component:"Point",operators:[...N8,AR,FR]},radio:{component:"Select",operators:[...rr]},relationship:{component:"Relationship",operators:[...rr]},richText:{component:"Text",operators:[...rr,tu,ou,Na]},select:{component:"Select",operators:[...rr]},text:{component:"Text",operators:[...rr,tu,ou,Na]},textarea:{component:"Text",operators:[...rr,tu,ou,Na]},upload:{component:"Text",operators:[...rr]}},yi=L8;import{getTranslation as hf}from"@payloadcms/translations";import{fieldIsHiddenOrDisabled as k8,fieldIsID as $8,tabHasName as j8}from"payload/shared";var La=({fields:t,i18n:e,labelPrefix:o,pathPrefix:n})=>t.reduce((r,s)=>{if(k8(s)&&!$8(s))return r;if(s.type==="tabs"&&"tabs"in s)return s.tabs.forEach(l=>{if(typeof l.label!="boolean"){let a=hf(l.label,e),c=o?o+" > "+a:a,u=j8(l)&&l.name?n?n+"."+l.name:l.name:n;typeof a=="string"&&r.push(...La({fields:l.fields,i18n:e,labelPrefix:c,pathPrefix:u}))}}),r;if(s.type==="row"&&"fields"in s)return r.push(...La({fields:s.fields,i18n:e,labelPrefix:o,pathPrefix:n})),r;if(s.type==="collapsible"&&"fields"in s){let i=hf(s.label||"",e),l=o?o+" > "+i:i;return r.push(...La({fields:s.fields,i18n:e,labelPrefix:l,pathPrefix:n})),r}if(s.type==="group"&&"fields"in s){let i=hf(s.label||"",e),l=o?i?o+" > "+i:o:i,a=s.name?n?n+"."+s.name:s.name:n;return r.push(...La({fields:s.fields,i18n:e,labelPrefix:l,pathPrefix:a})),r}if(typeof yi[s.type]=="object"){let i=new Set,l=yi[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},[]),a=hf(s.label||"",e),c=o?wc({field:s,prefix:o}):a,u=n?va(n,s):s.name,d={label:c,value:u,...yi[s.type],field:s,operators:l};return r.push(d),r}return r},[]);var on="where-builder",NR=t=>{let{collectionPluralLabel:e,fields:o,renderedFilters:n,resolvedFilterOptions:r}=t,{i18n:s,t:i}=$(),l=PR(()=>La({fields:o,i18n:s}),[o,s]),{handleWhereChange:a,query:c}=so(),u=PR(()=>{let h=c.where;if(h){if(ER(h))return h.or;let p=M8(h);if(ER(p))return p.or;console.warn(`Invalid where query in URL: ${JSON.stringify(h)}`)}return[]},[c.where]),d=gf.useCallback(async({andIndex:h,field:p,orIndex:g,relation:b})=>{let x=[...u],v=yi[p.field.type].operators[0].value;b==="and"?x[g].and.splice(h,0,{[p.value]:{[v]:void 0}}):x.push({and:[{[p.value]:{[v]:void 0}}]}),await a({or:x})},[u,a]),f=gf.useCallback(async({andIndex:h,field:p,operator:g,orIndex:b,value:x})=>{let v=u[b].and[h],C=yi[p.field.type],y=g||C.operators[0].value;if(typeof v=="object"&&p.value){let I=x??v?.[y],w=I!==v?.[p.value]?.[y],A=y!==Object.keys(v?.[p.value]||{})?.[0];if(w||A){let _={[p.value]:{[y]:I}},D=[...u];D[b].and[h]=_,await a({or:D})}}},[u,a]),m=gf.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 a({or:g})},[u,a]);return ru("div",{className:on,children:[u.length>0&&ru(gf.Fragment,{children:[kn("div",{className:`${on}__label`,children:i("general:filterWhere",{label:O8(e,s)})}),kn("ul",{className:`${on}__or-filters`,children:u.map((h,p)=>{let g=`${p}_${Array.isArray(h?.and)?h.and.length:""}`;return ru("li",{children:[p!==0&&kn("div",{className:`${on}__label`,children:i("general:or")}),kn("ul",{className:`${on}__and-filters`,children:Array.isArray(h?.and)&&h.and.map((b,x)=>{let v=u[p].and[x],C=Object.keys(v)[0],y=Object.keys(v?.[C]||{})?.[0]||void 0,I=v?.[C]?.[y]||void 0;return ru("li",{children:[x!==0&&kn("div",{className:`${on}__label`,children:i("general:and")}),kn(DR,{addCondition:d,andIndex:x,fieldName:C,filterOptions:r?.get(C),operator:y,orIndex:p,reducedFields:l,removeCondition:m,RenderedFilter:n?.get(C),updateCondition:f,value:I})]},x)})})]},g)})}),kn(ae,{buttonStyle:"icon-label",className:`${on}__add-or`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{await d({andIndex:0,field:l[0],orIndex:u.length,relation:"or"})},children:i("general:or")})]}),u.length===0&&ru("div",{className:`${on}__no-filters`,children:[kn("div",{className:`${on}__label`,children:i("general:noFiltersSet")}),kn(ae,{buttonStyle:"icon-label",className:`${on}__add-first-filter`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{l.length>0&&await d({andIndex:0,field:l.find(h=>!h.field.admin?.disableListFilter),orIndex:u.length,relation:"or"})},children:i("general:addFilter")})]})]})};import{c as B8}from"react/compiler-runtime";import{jsx as bf,jsxs as V8}from"react/jsx-runtime";import{getTranslation as G8}from"@payloadcms/translations";import{jsx as LR}from"react/jsx-runtime";import"react";var kR=({className:t})=>LR("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:LR("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 nu="active-query-preset";function $R(t){let e=B8(36),{activePreset:o,openPresetListDrawer:n,resetPreset:r}=t,{i18n:s,t:i}=$(),{getEntityConfig:l}=W(),a,c,u,d,f,m,h,p,g,b,x;if(e[0]!==o||e[1]!==l||e[2]!==s||e[3]!==n||e[4]!==i){let C=l({collectionSlug:"payload-query-presets"});c=V8,u=bt;let y=o&&`${nu}--active`,I;e[16]!==y?(I=[nu,y].filter(Boolean),e[16]=y,e[17]=I):I=e[17],p=I.join(" "),g="select-preset",e[18]!==n?(b=()=>{n()},e[18]=n,e[19]=b):b=e[19],x=o?"always-white":"light",e[20]!==o?.isShared?(h=o?.isShared&&bf(kR,{className:`${nu}__shared`}),e[20]=o?.isShared,e[21]=h):h=e[21],f=bf,m="div",a=`${nu}__label-text`,d=o?.title||i("general:selectLabel",{label:G8(C.labels.singular,s)}),e[0]=o,e[1]=l,e[2]=s,e[3]=n,e[4]=i,e[5]=a,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]=x}else a=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],x=e[15];let v;return e[22]!==o||e[23]!==r||e[24]!==a||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]!==x?(v=c(u,{className:p,id:g,onClick:b,pillStyle:x,children:[h,f(m,{className:a,children:d}),o?bf("div",{className:`${nu}__clear`,id:"clear-preset",onClick:async C=>{C.stopPropagation(),await r()},onKeyDown:async C=>{C.stopPropagation(),await r()},role:"button",tabIndex:0,children:bf(pt,{})}):null]}),e[22]=o,e[23]=r,e[24]=a,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]=x,e[35]=v):v=e[35],v}import{fieldAffectsData as W8,flattenTopLevelFields as z8}from"payload/shared";var jR=(t,e)=>t?z8(e).filter(n=>W8(n)&&t.includes(n.name)):null;import{jsx as vr,jsxs as H8}from"react/jsx-runtime";import{getTranslation as g1}from"@payloadcms/translations";import{transformColumnsToPreferences as OR,transformColumnsToSearchParams as MR}from"payload/shared";import{Fragment as X8,useCallback as vf,useMemo as U8}from"react";var BR="confirm-delete-preset",su="payload-query-presets",VR=({activePreset:t,collectionSlug:e,queryPresetPermissions:o})=>{let{modified:n,query:r,refineListData:s,setModified:i}=so(),{i18n:l,t:a}=$(),{openModal:c}=de(),{config:{routes:{api:u}},getEntityConfig:d}=W(),f=d({collectionSlug:su}),[m,,{openDrawer:h}]=Yt({id:t?.id,collectionSlug:su}),[p,,{closeDrawer:g,openDrawer:b}]=Yt({collectionSlug:su}),[x,,{closeDrawer:v,openDrawer:C}]=kc({collectionSlugs:[su]}),y=vf(async D=>{await s({columns:D.columns?MR(D.columns):void 0,preset:D.id,where:D.where},!1)},[s]),I=vf(async()=>{await s({columns:void 0,preset:void 0,where:void 0},!1)},[s]),w=vf(async()=>{try{await fetch(`${u}/${su}/${t.id}`,{method:"DELETE"}).then(async D=>{try{let T=await D.json();D.status<400?(fe.success(a("general:titleDeleted",{label:g1(f?.labels?.singular,l),title:t.title})),await I()):T.errors?T.errors.forEach(S=>fe.error(S.message)):fe.error(a("error:deletingTitle",{title:t.title}))}catch{fe.error(a("error:deletingTitle",{title:t.title}))}})}catch{fe.error(a("error:deletingTitle",{title:t.title}))}},[u,t?.id,t?.title,a,f,l,I]),A=vf(async()=>{try{await fetch(`${u}/payload-query-presets/${t.id}`,{body:JSON.stringify({columns:OR(r.columns),where:r.where}),credentials:"include",headers:{"Content-Type":"application/json"},method:"PATCH"}).then(async D=>{try{let T=await D.json();D.status<400?(fe.success(a("general:updatedLabelSuccessfully",{label:g1(f?.labels?.singular,l)})),i(!1)):T.errors?T.errors.forEach(S=>fe.error(S.message)):fe.error(a("error:unknown"))}catch{fe.error(a("error:unknown"))}})}catch{fe.error(a("error:unknown"))}},[u,t?.id,r.columns,r.where,a,f?.labels?.singular,l,i]),_=U8(()=>{let D=[vr(Du,{label:g1(f?.labels?.plural,l)},"preset-group-label")];return t&&n&&(D.push(vr(Be.Button,{onClick:async()=>{await s({columns:MR(t.columns),where:t.where},!1)},children:a("general:reset")})),o.update&&D.push(vr(Be.Button,{onClick:async()=>{await A()},children:t.isShared?a("general:updateForEveryone"):a("general:save")}))),D.push(vr(Be.Button,{onClick:()=>{b()},children:a("general:createNew")})),t&&o?.delete&&D.push(H8(X8,{children:[vr(Be.Button,{onClick:()=>c(BR),children:a("general:delete")}),vr(Be.Button,{onClick:()=>{h()},children:a("general:edit")})]})),D},[t,o?.delete,o?.update,b,h,c,A,a,s,n,f?.labels?.plural,l]);return{CreateNewPresetDrawer:vr(p,{initialData:{columns:OR(r.columns),relatedCollection:e,where:r.where},onSave:async({doc:D})=>{g(),await y(D)},redirectAfterCreate:!1}),DeletePresetModal:vr(It,{body:vr(bi,{elements:{1:({children:D})=>vr("strong",{children:D})},i18nKey:"general:aboutToDelete",t:a,variables:{label:f?.labels?.singular,title:t?.title}}),confirmingLabel:a("general:deleting"),heading:a("general:confirmDeletion"),modalSlug:BR,onConfirm:w}),EditPresetDrawer:vr(m,{onDelete:()=>{},onDuplicate:async({doc:D})=>{await y(D)},onSave:async({doc:D})=>{await y(D)}}),hasModifiedPreset:n,openPresetListDrawer:C,PresetListDrawer:vr(x,{allowCreate:!1,disableQueryPresets:!0,onSelect:async({doc:D})=>{v(),await y(D)}}),queryPresetMenuItems:_,resetPreset:I}};var Ro="list-controls",b1=t=>{let{beforeActions:e,collectionConfig:o,collectionSlug:n,disableQueryPresets:r,enableColumns:s=!0,enableSort:i=!1,listMenuItems:l,queryPreset:a,queryPresetPermissions:c,renderedFilters:u,resolvedFilterOptions:d}=t,{handleSearchChange:f,query:m}=so(),{CreateNewPresetDrawer:h,DeletePresetModal:p,EditPresetDrawer:g,hasModifiedPreset:b,openPresetListDrawer:x,PresetListDrawer:v,queryPresetMenuItems:C,resetPreset:y}=VR({activePreset:a,collectionSlug:n,queryPresetPermissions:c}),I=Cb(o),{i18n:w,t:A}=$(),{breakpoints:{s:_}}=xo(),D=(I&&ka("label"in I&&(typeof I.label=="string"||typeof I.label=="object")?I.label:"name"in I?I.name:null,w))??"ID",T=jR(o.admin.listSearchableFields,o.fields),S=zR(A("general:searchBy",{label:ka(D,w)})),R=zR(!!m?.where),E=Y8(m?.where),[F,L]=J8(E?"where":void 0);WR(()=>{R.current&&!m?.where?R.current=!1:m?.where&&(R.current=!0)},[L,m?.where]),WR(()=>{T?.length>0?S.current=T.reduce((N,P,j)=>{let V="label"in P&&P.label?P.label:"name"in P?P.name:null;return j===0?`${A("general:searchBy",{label:ka(V,w)})}`:j===T.length-1?`${N} ${A("general:or")} ${ka(V,w)}`:`${N}, ${ka(V,w)}`},""):S.current=A("general:searchBy",{label:ka(D,w)})},[A,T,w,D]);let k=l;return o?.enableQueryPresets&&!r&&C?.length>0&&(k=[...C,l?.length>0?Vt(Be.Divider,{},"divider"):null,...l||[]]),xf(GR,{children:[xf("div",{className:Ro,children:[xf("div",{className:`${Ro}__wrap`,children:[Vt(Cl,{}),Vt(s1,{fieldName:I&&"name"in I?I?.name:null,handleChange:N=>void f(N),initialParams:m,label:S.current},n),a&&b?Vt("div",{className:`${Ro}__modified`,children:"Modified"}):null,Vt("div",{className:`${Ro}__buttons`,children:xf("div",{className:`${Ro}__buttons-wrap`,children:[!_&&Vt(Z8.Fragment,{children:e&&e}),s&&Vt(bt,{"aria-controls":`${Ro}-columns`,"aria-expanded":F==="columns",className:`${Ro}__toggle-columns`,icon:Vt(Je,{direction:F==="columns"?"up":"down"}),onClick:()=>L(F!=="columns"?"columns":void 0),pillStyle:"light",children:A("general:columns")}),Vt(bt,{"aria-controls":`${Ro}-where`,"aria-expanded":F==="where",className:`${Ro}__toggle-where`,icon:Vt(Je,{direction:F==="where"?"up":"down"}),onClick:()=>L(F!=="where"?"where":void 0),pillStyle:"light",children:A("general:filters")}),i&&Vt(bt,{"aria-controls":`${Ro}-sort`,"aria-expanded":F==="sort",className:`${Ro}__toggle-sort`,icon:Vt(Je,{}),onClick:()=>L(F!=="sort"?"sort":void 0),pillStyle:"light",children:A("general:sort")}),!r&&Vt($R,{activePreset:a,openPresetListDrawer:x,resetPreset:y}),k&&Array.isArray(k)&&k.length>0&&Vt(fo,{button:Vt(dR,{ariaLabel:A("general:moreOptions")}),className:`${Ro}__popup`,horizontalAlign:"right",id:"list-menu",size:"large",verticalAlign:"bottom",children:Vt(Be.ButtonGroup,{children:k.map((N,P)=>Vt(GR,{children:N},`list-menu-item-${P}`))})})]})})]}),s&&Vt(_r,{className:`${Ro}__columns`,height:F==="columns"?"auto":0,id:`${Ro}-columns`,children:Vt(tm,{collectionSlug:o.slug})}),Vt(_r,{className:`${Ro}__where`,height:F==="where"?"auto":0,id:`${Ro}-where`,children:Vt(NR,{collectionPluralLabel:o?.labels?.plural,collectionSlug:o.slug,fields:o?.fields,renderedFilters:u,resolvedFilterOptions:d})})]}),v,g,h,p]})};import{c as aV}from"react/compiler-runtime";import{jsx as wi,jsxs as KR}from"react/jsx-runtime";import{Fragment as lV}from"react";import{jsx as HR,jsxs as q8}from"react/jsx-runtime";import{getTranslation as XR}from"@payloadcms/translations";import{useRouter as Q8,useSearchParams as K8}from"next/navigation.js";import*as YR from"qs-esm";import eV,{useCallback as UR}from"react";var tV="publish-many",v1=t=>{let{clearRouteCache:e}=En(),{collection:{slug:o,labels:{plural:n,singular:r},versions:s}={}}=t,{config:{routes:{api:i},serverURL:l}}=W(),{permissions:a}=Se(),{i18n:c,t:u}=$(),{getQueryParams:d,selectAll:f}=Qt(),m=Q8(),h=K8(),{openModal:p}=de(),b=a?.collections?.[o]?.update,x=`publish-${o}`,v=UR(()=>{fe.error(u("error:unknown"))},[u]),C=UR(async()=>{await Ke.patch(`${l}${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 y=>{try{let I=await y.json(),w=I?.docs.length||0,A=w>1?n:r;return y.status<400||w>0?(fe.success(u("general:updatedCountSuccessfully",{count:w,label:XR(A,c)})),I?.errors.length>0&&fe.error(I.message,{description:I.errors.map(_=>_.message).join(`
57
+ `)}),m.replace(YR.stringify({...Nr(h),page:f?"1":void 0},{addQueryPrefix:!0})),e(),null):(I.errors?I.errors.forEach(_=>fe.error(_.message)):v(),!1)}catch{return v()}})},[l,i,o,d,c,n,r,u,m,h,f,e,v]);return!s?.drafts||f===bo.None||!b?null:q8(eV.Fragment,{children:[HR("button",{className:`${tV}__toggle`,onClick:()=>{p(x)},type:"button",children:u("version:publish")}),HR(It,{body:u("version:aboutToPublishSelection",{label:XR(n,c)}),cancelLabel:u("general:cancel"),confirmingLabel:u("version:publishing"),confirmLabel:u("general:confirm"),heading:u("version:confirmPublish"),modalSlug:x,onConfirm:C})]})};import{jsx as ZR,jsxs as oV}from"react/jsx-runtime";import{getTranslation as JR}from"@payloadcms/translations";import{useRouter as rV,useSearchParams as nV}from"next/navigation.js";import*as QR from"qs-esm";import sV,{useCallback as qR}from"react";var iV="unpublish-many",x1=t=>{let{collection:{slug:e,labels:{plural:o,singular:n},versions:r}={}}=t,{config:{routes:{api:s},serverURL:i}}=W(),{permissions:l}=Se(),{toggleModal:a}=de(),{i18n:c,t:u}=$(),d=nV(),{getQueryParams:f,selectAll:m}=Qt(),h=rV(),{clearRouteCache:p}=En(),b=l?.collections?.[e]?.update,x=`unpublish-${e}`,v=qR(()=>{fe.error(u("error:unknown"))},[u]),C=qR(async()=>{await Ke.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 y=>{try{let I=await y.json(),w=I?.docs.length||0,A=w>1?o:n;return y.status<400||w>0?(fe.success(u("general:updatedCountSuccessfully",{count:w,label:JR(A,c)})),I?.errors.length>0&&fe.error(I.message,{description:I.errors.map(_=>_.message).join(`
58
+ `)}),h.replace(QR.stringify({...Nr(d),page:m?"1":void 0},{addQueryPrefix:!0})),p(),null):(I.errors?I.errors.forEach(_=>fe.error(_.message)):v(),!1)}catch{return v()}})},[i,s,e,f,c,o,n,u,h,d,m,p,v]);return!r?.drafts||m===bo.None||!b?null:oV(sV.Fragment,{children:[ZR("button",{className:`${iV}__toggle`,onClick:()=>{a(x)},type:"button",children:u("version:unpublish")}),ZR(It,{body:u("version:aboutToUnpublishSelection",{label:JR(o,c)}),confirmingLabel:u("version:unpublishing"),heading:u("version:confirmUnpublish"),modalSlug:x,onConfirm:C})]})};var e_="list-selection",iu=t=>{let e=aV(10),{collectionConfig:o,disableBulkDelete:n,disableBulkEdit:r,label:s}=t,{count:i,selectAll:l,toggleAll:a,totalDocs:c}=Qt(),{t:u}=$();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]!==l||e[6]!==u||e[7]!==a||e[8]!==c?(d=KR("div",{className:e_,children:[wi("span",{children:u("general:selectedCount",{count:i,label:""})}),l!==bo.AllAvailable&&i<c&&wi("button",{"aria-label":u("general:selectAll",{count:i,label:s}),className:`${e_}__button`,id:"select-all-across-pages",onClick:()=>a(!0),type:"button",children:u("general:selectAll",{count:c,label:""})}),!r&&!n&&wi("span",{children:"\u2014"}),!r&&KR(lV,{children:[wi(t1,{collection:o}),wi(v1,{collection:o}),wi(x1,{collection:o})]}),!n&&wi(Xb,{collection:o})]}),e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=l,e[6]=u,e[7]=a,e[8]=c,e[9]=d):d=e[9],d};import{jsx as nr,jsxs as $a,Fragment as cV}from"react/jsx-runtime";import{getTranslation as ja}from"@payloadcms/translations";import"react";var t_="list-header",Ii="list-drawer",uV=({className:t,collectionConfig:e,Description:o,disableBulkDelete:n,disableBulkEdit:r,hasCreatePermission:s,i18n:i,isBulkUploadEnabled:l,newDocumentURL:a,openBulkUpload:c,smallBreak:u,t:d})=>$a("header",{className:[t_,t].filter(Boolean).join(" "),children:[nr("h1",{children:ja(e?.labels?.plural,i)}),s&&$a(cV,{children:[nr(ae,{"aria-label":i.t("general:createNewLabel",{label:ja(e?.labels?.singular,i)}),buttonStyle:"pill",el:"link",size:"small",to:a,children:i.t("general:createNew")}),l&&nr(ae,{"aria-label":d("upload:bulkUpload"),buttonStyle:"pill",onClick:c,size:"small",children:d("upload:bulkUpload")})]}),!u&&nr(iu,{collectionConfig:e,disableBulkDelete:n,disableBulkEdit:r,label:ja(e?.labels?.plural,i)}),o]}),dV=({Description:t,hasCreatePermission:e,i18n:o,t:n})=>{let{config:{collections:r},getEntityConfig:s}=W(),{closeModal:i}=de(),{DocumentDrawerToggler:l,drawerSlug:a,enabledCollections:c,selectedOption:u,setSelectedOption:d}=Yr(),f=s({collectionSlug:u.value}),m=r.filter(({slug:p})=>c.includes(p)),h=c.length>1;return $a("header",{className:`${Ii}__header`,children:[$a("div",{className:`${Ii}__header-wrap`,children:[$a("div",{className:`${Ii}__header-content`,children:[nr("h2",{className:`${Ii}__header-text`,children:ja(f?.labels?.plural,o)}),e&&nr(l,{className:`${Ii}__create-new-button`,children:nr(bt,{children:n("general:createNew")})})]}),nr("button",{"aria-label":n("general:close"),className:`${Ii}__header-close`,onClick:()=>{i(a)},type:"button",children:nr(pt,{})})]}),t,h&&$a("div",{className:`${Ii}__select-collection-wrap`,children:[nr(be,{label:n("upload:selectCollectionToBrowse")}),nr(yt,{className:`${t_}__select-collection`,onChange:d,options:m.map(p=>({label:ja(p.labels.singular,o),value:p.slug})),value:{label:ja(f?.labels.singular,o),value:f?.slug}})]})]})},C1=t=>{let{isInDrawer:e}=Yr();return e?nr(dV,{...t}):nr(uV,{...t})};import{c as mV}from"react/compiler-runtime";import{jsx as r_}from"react/jsx-runtime";import{formatAdminURL as fV}from"payload/shared";import"react";import{jsx as o_}from"react/jsx-runtime";import"react";var y1=()=>o_("svg",{className:"icon icon--logout",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:o_("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 pV="nav",hV=t=>{let e=mV(5),{tabIndex:o}=t,n=o===void 0?0:o,{t:r}=$(),{config:s}=W(),{admin:i,routes:l}=s,{routes:a}=i,{logout:c}=a,{admin:u}=l,d;return e[0]!==u||e[1]!==c||e[2]!==r||e[3]!==n?(d=r_(Kt,{"aria-label":r("authentication:logOut"),className:`${pV}__log-out`,href:fV({adminRoute:u,path:c}),prefetch:!1,tabIndex:n,title:r("authentication:logOut"),children:r_(y1,{})}),e[0]=u,e[1]=c,e[2]=r,e[3]=n,e[4]=d):d=e[4],d};import{c as gV}from"react/compiler-runtime";import{jsx as Oa,jsxs as n_}from"react/jsx-runtime";import bV,{useState as s_}from"react";var ys="nav-group",vV="nav",xV=t=>{let e=gV(21),{children:o,isOpen:n,label:r}=t,[s,i]=s_(typeof n<"u"?!n:!1),[l,a]=s_(!1),{setPreference:c}=Do(),{navOpen:u}=xi();if(r){let f;e[0]!==s||e[1]!==r||e[2]!==c?(f=()=>{a(!0);let A={};A?.[r]?A[r].open=!!s:A[r]={open:!!s},c(vV,{groups:A},!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&&`${ys}--collapsed`,g;e[4]!==h||e[5]!==p?(g=[`${ys}`,h,p].filter(Boolean),e[4]=h,e[5]=p,e[6]=g):g=e[6];let b=g.join(" "),x=`nav-group-${r}`,v=`${ys}__toggle--${s?"collapsed":"open"}`,C;e[7]!==v?(C=[`${ys}__toggle`,v].filter(Boolean),e[7]=v,e[8]=C):C=e[8];let y=C.join(" "),I=u?0:-1,w;return e[9]!==l||e[10]!==o||e[11]!==s||e[12]!==r||e[13]!==I||e[14]!==b||e[15]!==x||e[16]!==y||e[17]!==m?(w=n_("div",{className:b,id:x,children:[n_("button",{className:y,onClick:m,tabIndex:I,type:"button",children:[Oa("div",{className:`${ys}__label`,children:r}),Oa("div",{className:`${ys}__indicator`,children:Oa(Je,{className:`${ys}__indicator`,direction:s?void 0:"up"})})]}),Oa(_r,{duration:l?200:0,height:s?0:"auto",children:Oa("div",{className:`${ys}__content`,children:o})})]}),e[9]=l,e[10]=o,e[11]=s,e[12]=r,e[13]=I,e[14]=b,e[15]=x,e[16]=y,e[17]=m,e[18]=w):w=e[18],w}let d;return e[19]!==o?(d=Oa(bV.Fragment,{children:o}),e[19]=o,e[20]=d):d=e[20],d};import{c as CV}from"react/compiler-runtime";import{jsx as ws,jsxs as i_}from"react/jsx-runtime";import{collectionDefaults as yV,isNumber as wV}from"payload/shared";import"react";var Ma="per-page",IV=yV.admin.pagination.limits,w1=t=>{let e=CV(9),{defaultLimit:o,handleChange:n,limit:r,limits:s}=t,i=o===void 0?10:o,l=s===void 0?IV:s,{t:a}=$(),c=wV(r)?r:i,u;if(e[0]!==n||e[1]!==c||e[2]!==l||e[3]!==a){let d;e[5]!==n||e[6]!==c||e[7]!==l?(d=f=>{let{close:m}=f;return ws(Be.ButtonGroup,{children:l.map((h,p)=>i_(Be.Button,{className:[`${Ma}__button`,h===c&&`${Ma}__button-active`].filter(Boolean).join(" "),onClick:()=>{m(),n&&n(h)},children:[h===c&&ws("div",{className:`${Ma}__chevron`,children:ws(Je,{direction:"right",size:"small"})}),"\xA0",ws("span",{children:h})]},p))})},e[5]=n,e[6]=c,e[7]=l,e[8]=d):d=e[8],u=ws("div",{className:Ma,children:ws(fo,{button:i_("div",{className:`${Ma}__base-button`,children:[ws("span",{children:a("general:perPage",{limit:c})}),"\xA0",ws(Je,{className:`${Ma}__icon`})]}),horizontalAlign:"right",render:d,size:"small"})}),e[0]=n,e[1]=c,e[2]=l,e[3]=a,e[4]=u}else u=e[4];return u};import{c as _V}from"react/compiler-runtime";import{jsx as yf}from"react/jsx-runtime";import{Fragment as l_}from"react";import{jsxs as SV}from"react/jsx-runtime";import"react";function a_(t){return t===void 0||typeof t=="number"?t:decodeURIComponent(t)}var RV="id-label",Cf=({id:t,className:e,prefix:o="ID:"})=>SV("div",{className:[RV,e].filter(Boolean).join(" "),title:t,children:[o,"\xA0",a_(t)]});var I1="render-title",S1=t=>{let e=_V(10),{className:o,element:n,fallback:r,title:s}=t,i=n===void 0?"h1":n,{id:l,isInitializing:a,title:c}=Ae(),u=s||c||r,d=u===l,f=i,m;if(e[0]!==f||e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==a||e[5]!==u){let h=yf(l_,{children:"\xA0"}),p=d&&`${I1}--has-id`,g;e[7]!==o||e[8]!==p?(g=[o,I1,p].filter(Boolean),e[7]=o,e[8]=p,e[9]=g):g=e[9],m=yf(f,{className:g.join(" "),title:u,children:a?h:yf(l_,{children:d?yf(Cf,{className:`${I1}__id`,id:l}):u||h})}),e[0]=f,e[1]=o,e[2]=l,e[3]=d,e[4]=a,e[5]=u,e[6]=m}else m=e[6];return m};import{c as DV}from"react/compiler-runtime";import{jsx as Ba,jsxs as c_}from"react/jsx-runtime";import"react";var rn="sort-column",TV=t=>{let e=DV(22),{name:o,appearance:n,disable:r,Label:s,label:i}=t,l=r===void 0?!1:r,{handleSortChange:a,query:c}=so(),{t:u}=$(),{sort:d}=c,f=`-${o}`,m=o,h;e[0]!==m||e[1]!==d?(h=[`${rn}__asc`],d===m&&h.push(`${rn}--active`),e[0]=m,e[1]=d,e[2]=h):h=e[2];let p;e[3]!==f||e[4]!==d?(p=[`${rn}__desc`],d===f&&p.push(`${rn}--active`),e[3]=f,e[4]=d,e[5]=p):p=e[5];let g=n&&`${rn}--appearance-${n}`,b;e[6]!==g?(b=[rn,g].filter(Boolean),e[6]=g,e[7]=b):b=e[7];let x=b.join(" "),v;e[8]!==s||e[9]!==i?(v=s??Ba(be,{hideLocale:!0,label:i,unstyled:!0}),e[8]=s,e[9]=i,e[10]=v):v=e[10];let C;return e[11]!==m||e[12]!==h||e[13]!==f||e[14]!==p||e[15]!==l||e[16]!==a||e[17]!==i||e[18]!==u||e[19]!==x||e[20]!==v?(C=c_("div",{className:x,children:[Ba("span",{className:`${rn}__label`,children:v}),!l&&c_("div",{className:`${rn}__buttons`,children:[Ba("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:ascending"),label:i}),className:[...h,`${rn}__button`].filter(Boolean).join(" "),onClick:()=>void a(m),type:"button",children:Ba(Je,{direction:"up"})}),Ba("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:descending"),label:i}),className:[...p,`${rn}__button`].filter(Boolean).join(" "),onClick:()=>void a(f),type:"button",children:Ba(Je,{})})]})]}),e[11]=m,e[12]=h,e[13]=f,e[14]=p,e[15]=l,e[16]=a,e[17]=i,e[18]=u,e[19]=x,e[20]=v,e[21]=C):C=e[21],C};import{jsx as u_}from"react/jsx-runtime";import"react";var AV=t=>{let{className:e}=t;return u_("svg",{className:[e,"icon icon--externalLink"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:u_("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 d_}from"react/jsx-runtime";import"react";var FV=()=>d_("svg",{"aria-hidden":"true",className:"graphic code-block-icon",focusable:"false",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:d_("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 R1}from"react/jsx-runtime";import"react";var _1="minimize-maximize",EV=({className:t,isMinimized:e})=>{let o=[_1,e?`${_1}--minimized`:`${_1}--maximized`,t].filter(Boolean).join(" ");return R1("svg",{className:o,height:"20",stroke:"currentColor",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:e?R1("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"}):R1("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 m_,jsxs as PV}from"react/jsx-runtime";import"react";var D1=()=>PV("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[m_("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)"}),m_("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 f_,jsxs as NV}from"react/jsx-runtime";import"react";var T1=()=>NV("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[f_("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)"}),f_("path",{d:"M13 16.1998V12.9998M13 9.7998H13.0077",stroke:"var(--theme-elevation-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as p_,jsxs as LV}from"react/jsx-runtime";import"react";var A1=()=>LV("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[p_("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)"}),p_("path",{d:"M10.6001 13.0004L12.2001 14.6004L15.4001 11.4004",stroke:"var(--theme-success-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as h_,jsxs as kV}from"react/jsx-runtime";import"react";var F1=()=>kV("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-warning-500)"}),h_("path",{d:"M13 10V13.2M13 16.4H13.008",stroke:"var(--theme-warning-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{c as b_}from"react/compiler-runtime";import{jsx as g_}from"react/jsx-runtime";import Va from"react";var v_=Va.createContext({addClientFunction:()=>null,removeClientFunction:()=>null}),x_=Va.createContext({}),E1=t=>{let e=b_(6),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=Va.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 l=i,a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=d=>{s(f=>{let m={...f};return delete m[d.key],m})},e[2]=a):a=e[2];let c=a,u;return e[3]!==o||e[4]!==r?(u=g_(v_,{value:{addClientFunction:l,removeClientFunction:c},children:g_(x_,{value:r,children:o})}),e[3]=o,e[4]=r,e[5]=u):u=e[5],u},$V=(t,e)=>{let o=b_(6),{addClientFunction:n,removeClientFunction:r}=Va.use(v_),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]),Va.useEffect(s,i)},jV=()=>Va.use(x_);import{c as OV}from"react/compiler-runtime";import{jsx as C_}from"react/jsx-runtime";import MV,{useEffect as BV,useRef as VV}from"react";var y_=200,P1="progress-bar",GV=150,WV=()=>{let t=OV(9),{isTransitioning:e,transitionProgress:o}=it(),[n,r]=MV.useState(null),s=VV(!0),i,l;if(t[0]!==e||t[1]!==o?(i=()=>{let a,c;return e?s.current?c=setTimeout(()=>{r(o),s.current=!1},GV):r(o):(s.current=!0,r(1),a=setTimeout(()=>{r(null)},y_*2)),()=>{clearTimeout(a),clearTimeout(c)}},l=[e,o],t[0]=e,t[1]=o,t[2]=i,t[3]=l):(i=t[2],l=t[3]),BV(i,l),typeof n=="number"){let a=n===1&&`${P1}--fade-out`,c;t[4]!==a?(c=[P1,a].filter(Boolean),t[4]=a,t[5]=c):c=t[5];let u=c.join(" "),d;return t[6]!==n||t[7]!==u?(d=C_("div",{className:u,style:{"--transition-duration":`${y_}ms`},children:C_("div",{className:`${P1}__progress`,style:{width:`${(n||0)*100}%`}})}),t[6]=n,t[7]=u,t[8]=d):d=t[8],d}return null};import{c as zV}from"react/compiler-runtime";import{jsx as HV}from"react/jsx-runtime";import{createContext as XV,use as UV}from"react";var w_=XV({}),YV=t=>{let e=zV(6),{children:o,visibleEntities:n}=t,r;e[0]!==n?(r=l=>{let{collectionSlug:a,globalSlug:c}=l;return a?n.collections.includes(a):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=HV(w_,{value:{isEntityVisible:s,visibleEntities:n},children:o}),e[2]=o,e[3]=s,e[4]=n,e[5]=i):i=e[5],i},N1=()=>UV(w_);import{c as ZV}from"react/compiler-runtime";import{jsx as JV}from"react/jsx-runtime";import{useParams as qV}from"next/navigation.js";import{createContext as QV,use as KV}from"react";var I_=QV({}),L1=t=>{let e=ZV(3),{children:o}=t,n=qV(),r;return e[0]!==o||e[1]!==n?(r=JV(I_,{value:n,children:o}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r},eG=()=>KV(I_);import{jsx as $t,jsxs as D_}from"react/jsx-runtime";import Jje,{Fragment as qje}from"react";import{useContext as oG}from"react";import{createContext as tG}from"react";var au=tG({});var lu=()=>oG(au);import rG,{useCallback as nG,useEffect as sG,useReducer as iG,useRef as aG}from"react";var lG=(t,e)=>{let{timestamp:o,animationRef:n}=e;n.current=null;let{x:r,y:s,xDirection:i,yDirection:l,eventsFired:a,hasScrolled:c}=t,u=c||!!o,d=u?window.pageXOffset:0,f=u?window.pageYOffset:0,m=u?a+1:a,h=d-r,p=f-s,g=d/(document.body.scrollWidth-window.innerWidth)*100,b=f/(document.body.scrollHeight-window.innerHeight)*100,x=(g+b)/2,v=h>0?"right":h<0?"left":i,C=p>0?"down":p<0?"up":l;return{x:d,y:f,xDifference:h,yDifference:p,xDirection:v,yDirection:C,xPercentage:g,yPercentage:b,totalPercentage:x,eventsFired:m,hasScrolled:u}},cu=t=>{let{children:e}=t,o=aG(null),[n,r]=iG(lG,{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=nG(i=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(l=>{r({e:i,timestamp:l,animationRef:o})})},[]);return sG(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[s]),rG.createElement(au.Provider,{value:Object.assign({},n)},e&&e)};import nOe from"react";import{Fragment as T_}from"react";var{WindowInfoProvider:k1}=Vn&&"WindowInfoProvider"in Vn?Vn:{WindowInfoProvider:void 0},{useWindowInfo:$1}=Vn&&"useWindowInfo"in Vn?Vn:{useWindowInfo:void 0};import{jsx as cG}from"react/jsx-runtime";import{useSearchParams as uG}from"next/navigation.js";import*as wf from"qs-esm";import S_,{createContext as dG,use as mG}from"react";var fG={searchParams:{},stringifyParams:()=>""},R_=dG(fG),j1=({children:t})=>{let o=uG().toString(),n=S_.useMemo(()=>wf.parse(o,{depth:10,ignoreQueryPrefix:!0}),[o]),r=S_.useCallback(({params:s,replace:i=!1})=>wf.stringify({...i?{}:n,...s},{addQueryPrefix:!0}),[n]);return cG(R_,{value:{searchParams:n,stringifyParams:r},children:t})},pG=()=>mG(R_);import{jsx as uu}from"react/jsx-runtime";import"react";var __=()=>uu(T0,{className:"payload-toast-container",closeButton:!0,dir:"undefined",gap:8,icons:{error:uu(D1,{}),info:uu(T1,{}),success:uu(A1,{}),warning:uu(F1,{})},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 hG=({children:t,config:e,dateFNSKey:o,fallbackLang:n,isNavOpen:r,languageCode:s,languageOptions:i,locale:l,permissions:a,serverFunction:c,switchLanguageServerAction:u,theme:d,translations:f,user:m})=>{let h=process.env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH==="true"?Gb:T_;return D_(T_,{children:[$t(ig,{serverFunction:c,children:$t(Jf,{children:$t(h,{children:$t(Pf,{config:e,children:$t(E1,{children:$t(Ef,{dateFNSKey:o,fallbackLang:n,language:s,languageOptions:i,switchLanguageServerAction:u,translations:f,children:$t(k1,{breakpoints:{l:"(max-width: 1440px)",m:"(max-width: 1024px)",s:"(max-width: 768px)",xs:"(max-width: 400px)"},children:$t(cu,{children:$t(j1,{children:$t(Ip,{classPrefix:"payload",transTime:0,zIndex:"var(--z-modal)",children:D_(Ep,{permissions:a,user:m,children:[$t(Lp,{children:$t(Lf,{theme:d,children:$t(L1,{children:$t(kp,{locale:l,children:$t(Mb,{children:$t(B2,{children:$t(sb,{children:$t(d4,{initialIsOpen:r,children:$t(Hg,{children:t})})})})})})})})}),$t(Cp,{}),$t(P0,{})]})})})})})})})})})})}),$t(__,{})]})};import{jsx as A_,jsxs as gG}from"react/jsx-runtime";import{email as bG,username as vG}from"payload/shared";import"react";function O1(t){let{className:e,loginWithUsername:o,readOnly:n,t:r}=t,s=!o||o?.requireEmail||o?.allowEmailLogin,i=!!o;return gG("div",{className:e,children:[s?A_(Qs,{field:{name:"email",admin:{autoComplete:"off"},label:r("general:email"),required:!o||o&&o.requireEmail},path:"email",readOnly:n,schemaPath:"email",validate:bG}):null,i&&A_(ii,{field:{name:"username",label:r("authentication:username"),required:o&&o.requireUsername},path:"username",readOnly:n,schemaPath:"username",validate:vG})]})}import{c as xG}from"react/compiler-runtime";import{jsx as CG}from"react/jsx-runtime";import"react";var F_="select-all",yG=()=>{let t=xG(7),{selectAll:e,toggleAll:o}=Qt(),{i18n:n}=$(),r;if(t[0]!==n||t[1]!==e||t[2]!==o){let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=[F_,`${F_}__checkbox`],t[4]=s):s=t[4];let i;t[5]!==o?(i=()=>o(),t[5]=o,t[6]=i):i=t[6],r=CG(Ms,{"aria-label":e===bo.None?n.t("general:selectAllRows"):n.t("general:deselectAllRows"),checked:e===bo.AllInPage||e===bo.AllAvailable,className:s.join(" "),id:"select-all",name:"select-all",onToggle:i,partialChecked:e===bo.Some}),t[0]=n,t[1]=e,t[2]=o,t[3]=r}else r=t[3];return r};import{c as wG}from"react/compiler-runtime";import{jsx as E_}from"react/jsx-runtime";import"react";var P_="select-row",IG=t=>{let e=wG(14),{rowData:o}=t,{user:n}=Se(),{selected:r,setSelection:s}=Qt(),i;e[0]!==o?(i=o||{},e[0]=o,e[1]=i):i=e[1];let{_isLocked:l,_userEditing:a}=i;if(l&&a&&a.id!==n?.id){let p;return e[2]!==a?(p=E_(Qc,{user:a}),e[2]=a,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=[P_,`${P_}__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=E_(Ms,{checked:d,className:f.join(" "),onToggle:m}),e[11]=d,e[12]=m,e[13]=h):h=e[13],h};import{jsx as SG}from"react/jsx-runtime";import"react";var Ga=t=>{let{onClick:e}=t,{count:o,selected:n}=Qt();return!n||!o?null:SG(bt,{onClick:()=>{typeof e=="function"&&e(n)},pillStyle:"white",children:`Select ${o}`})};import{c as RG}from"react/compiler-runtime";import{jsx as Gt,jsxs as Si}from"react/jsx-runtime";import{getTranslation as If}from"@payloadcms/translations";import{useRouter as _G}from"next/navigation.js";import{formatFilesize as DG,isNumber as TG}from"payload/shared";import{Fragment as M1,useEffect as N_,useState as AG}from"react";var $n="collection-list";function FG(t){let e=RG(17),{AfterList:o,AfterListTable:n,beforeActions:r,BeforeList:s,BeforeListTable:i,collectionSlug:l,columnState:a,Description:c,disableBulkDelete:u,disableBulkEdit:d,disableQueryPresets:f,enableRowSelections:m,hasCreatePermission:h,listMenuItems:p,newDocumentURL:g,queryPreset:b,queryPresetPermissions:x,renderedFilters:v,resolvedFilterOptions:C,Table:y}=t,[I,w]=AG(y),{allowCreate:A,createNewDrawerSlug:_,drawerSlug:D,onBulkSelect:T}=Yr(),S=A!==void 0?A&&h:h,R,E;e[0]!==y?(R=()=>{y&&w(y)},E=[y],e[0]=y,e[1]=R,e[2]=E):(R=e[1],E=e[2]),N_(R,E);let{user:F}=Se(),{getEntityConfig:L}=W(),k=_G(),{data:N,defaultLimit:P,handlePageChange:j,handlePerPageChange:V,query:M}=so(),{openModal:O}=de(),{setCollectionSlug:B,setCurrentActivePath:G,setOnSuccess:Y}=Wo(),{drawerSlug:X}=Wo(),ee=L({collectionSlug:l}),{labels:q,upload:z}=ee,re=!!z,me=re&&ee.upload.bulkUpload,se=!!D,{i18n:Z,t:Q}=$(),{setStepNav:ge}=Fn(),{breakpoints:Ie}=$1(),{s:Fe}=Ie,Le;if(re){let ne;e[3]!==N.docs?(ne=N.docs.map(EG),e[3]=N.docs,e[4]=ne):ne=e[4],Le=ne}else Le=N.docs;let K=Le,_e;e[5]!==X||e[6]!==l||e[7]!==O||e[8]!==k||e[9]!==B||e[10]!==G||e[11]!==Y?(_e=()=>{B(l),G(l),O(X),Y(l,()=>k.refresh())},e[5]=X,e[6]=l,e[7]=O,e[8]=k,e[9]=B,e[10]=G,e[11]=Y,e[12]=_e):_e=e[12];let pe=_e;N_(()=>{se||ge([{label:q?.plural}])},[ge,q,se]);let ce;return e[13]!==r||e[14]!==m||e[15]!==T?(ce=m&&typeof T=="function"?r?[...r,Gt(Ga,{onClick:T},"select-many")]:[Gt(Ga,{onClick:T},"select-many")]:r,e[13]=r,e[14]=m,e[15]=T,e[16]=ce):ce=e[16],Gt(M1,{children:Gt(Ul,{collectionSlug:l,columnState:a,children:Gt("div",{className:`${$n} ${$n}--${l}`,children:Si(Hb,{docs:K,totalDocs:N.totalDocs,user:F,children:[s,Si(Bo,{className:`${$n}__wrap`,children:[Gt(C1,{collectionConfig:ee,Description:Gt("div",{className:`${$n}__sub-header`,children:Gt(oe,{CustomComponent:c,Fallback:Gt(_b,{collectionSlug:l,description:ee?.admin?.description})})}),disableBulkDelete:u,disableBulkEdit:d,hasCreatePermission:S,i18n:Z,isBulkUploadEnabled:me&&!z.hideFileInputOnCreate,newDocumentURL:g,openBulkUpload:pe,smallBreak:Fe,t:Q}),Gt(b1,{beforeActions:ce,collectionConfig:ee,collectionSlug:l,disableQueryPresets:ee?.enableQueryPresets!==!0||f,listMenuItems:p,queryPreset:b,queryPresetPermissions:x,renderedFilters:v,resolvedFilterOptions:C}),i,K.length>0&&Gt(ql,{children:I}),K.length===0&&Si("div",{className:`${$n}__no-results`,children:[Gt("p",{children:Z.t("general:noResults",{label:If(q?.plural,Z)})}),S&&g&&Gt(M1,{children:se?Gt(ae,{el:"button",onClick:()=>O(_),children:Z.t("general:createNewLabel",{label:If(q?.singular,Z)})}):Gt(ae,{el:"link",to:g,children:Z.t("general:createNewLabel",{label:If(q?.singular,Z)})})})]}),n,K.length>0&&Si("div",{className:`${$n}__page-controls`,children:[Gt(ec,{hasNextPage:N.hasNextPage,hasPrevPage:N.hasPrevPage,limit:N.limit,nextPage:N.nextPage,numberOfNeighbors:1,onChange:ne=>void j(ne),page:N.page,prevPage:N.prevPage,totalPages:N.totalPages}),N.totalDocs>0&&Si(M1,{children:[Si("div",{className:`${$n}__page-info`,children:[N.page*N.limit-(N.limit-1),"-",N.totalPages>1&&N.totalPages!==N.page?N.limit*N.page:N.totalDocs," ",Z.t("general:of")," ",N.totalDocs]}),Gt(w1,{handleChange:ne=>void V(ne),limit:TG(M?.limit)?Number(M.limit):P,limits:ee?.admin?.pagination?.limits,resetPage:N.totalDocs<=N.pagingCounter}),Fe&&Si("div",{className:`${$n}__list-selection`,children:[Gt(iu,{collectionConfig:ee,disableBulkDelete:u,disableBulkEdit:d,label:If(ee.labels.plural,Z)}),Gt("div",{className:`${$n}__list-selection-actions`,children:m&&typeof T=="function"?r?[...r,Gt(Ga,{onClick:T},"select-many")]:[Gt(Ga,{onClick:T},"select-many")]:r})]})]})]})]}),o]})})})})}function EG(t){return{...t,filesize:DG(t.filesize)}}import{jsx as sr,jsxs as z_}from"react/jsx-runtime";import{useRouter as eW,useSearchParams as tW}from"next/navigation.js";import{formatAdminURL as oW}from"payload/shared";import rW,{Fragment as nW,useCallback as H1,useEffect as H_,useMemo as sW,useRef as X1,useState as _f}from"react";import{c as k_}from"react/compiler-runtime";import{jsx as Wa,jsxs as L_}from"react/jsx-runtime";var $_=t=>{let e=k_(7),{drawerSlug:o}=t,{closeModal:n}=de(),{t:r}=$(),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=L_(Bo,{className:`${rs}__header`,children:[L_("div",{className:`${rs}__header-content`,children:[Wa("h2",{className:`${rs}__header-text`,children:Wa(S1,{element:"span"})}),Wa("button",{"aria-label":r("general:close"),className:`${rs}__header-close`,onClick:i,type:"button",children:Wa(pt,{})})]}),Wa(PG,{})]}),e[0]=n,e[1]=o,e[2]=r,e[3]=s}else s=e[3];return s},PG=()=>{let t=k_(3),{id:e,title:o}=Ae(),n;return t[0]!==e||t[1]!==o?(n=e&&e!==o?Wa(Cf,{id:e.toString()}):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],n};import{formatAdminURL as NG}from"payload/shared";var j_=({adminRoute:t,router:e})=>{let o=NG({adminRoute:t,path:"/"});e.push(o)};import{formatAdminURL as LG}from"payload/shared";var O_=({adminRoute:t,collectionSlug:e,router:o})=>{let n=LG({adminRoute:t,path:e?`/collections/${e}`:"/"});o.push(n)};var B1=(t,e,o,n,r,s,i,l,a,c)=>{if(a)try{s(t,e??o,n),r||(l.current.hasShownLockedModal=!0),l.current={hasShownLockedModal:l.current?.hasShownLockedModal,isLocked:!0,user:n},i(n),r&&c&&c(!1)}catch(u){console.error("Error during document takeover:",u)}};import{c as VG}from"react/compiler-runtime";import{jsx as nn,jsxs as du}from"react/jsx-runtime";import GG,{Fragment as WG,useEffect as zG,useState as HG}from"react";import{jsx as Sf,jsxs as V1}from"react/jsx-runtime";import{getTranslation as kG}from"@payloadcms/translations";import{text as $G}from"payload/shared";import jG,{useEffect as M_,useMemo as B_,useState as V_}from"react";var OG="apiKey",MG="api-key",BG="field-type",G_=({enabled:t,readOnly:e})=>{let[o]=V_(bn()),[n,r]=V_(!1),{i18n:s,t:i}=$(),{config:l,getEntityConfig:a}=W(),{collectionSlug:c}=Ae(),u=Et(([C])=>C&&C[OG]||null),d=a({collectionSlug:c})?.fields?.find(C=>"name"in C&&C.name==="apiKey"),f=C=>$G(C,{name:"apiKey",type:"text",blockData:{},data:{},event:"onChange",maxLength:48,minLength:24,path:["apiKey"],preferences:{fields:{}},req:{payload:{config:l},t:i},siblingData:{}}),m=u?.value,h=B_(()=>{let C="API Key";return d?.label&&(C=d.label),kG(C,s)},[d,s]),p=B_(()=>V1("div",{className:`${MG}__label`,children:[Sf("span",{children:h}),Sf(Dc,{value:m})]}),[h,m]),g=Te({path:"apiKey",validate:f}),b=()=>{n&&r(!1),setTimeout(()=>{r(!0)},1)},{setValue:x,value:v}=g;return M_(()=>{!m&&t&&x(o),!t&&m&&x(null)},[m,t,x,o]),M_(()=>{n&&setTimeout(()=>{r(!1)},1e4)},[n]),t?V1(jG.Fragment,{children:[V1("div",{className:[BG,"api-key","read-only"].filter(Boolean).join(" "),children:[p,Sf("input",{"aria-label":h,className:n?"highlight":void 0,disabled:!0,id:"apiKey",name:"apiKey",type:"text",value:v||""})]}),!e&&Sf(o1,{highlightField:b,setKey:()=>x(bn())})]}):null};var Rf="auth-fields",W_=t=>{let e=VG(57),{className:o,collectionSlug:n,disableLocalStrategy:r,email:s,loginWithUsername:i,operation:l,readOnly:a,requirePassword:c,setValidateBeforeSubmit:u,useAPIKey:d,username:f,verify:m}=t,{permissions:h}=Se(),[p,g]=HG(c),b=Et(XG),x=Et(UG),v=Ht(),{i18n:C,t:y}=$(),{docPermissions:I,isEditing:w,isInitializing:A}=Ae(),{config:_}=W(),{routes:D,serverURL:T}=_,{api:S}=D,R=!r||typeof r=="object"&&r.enableFields===!0,E=a||A,F=I?.fields===!0?!0:I?.fields?.enableAPIKey,L=a||F===!0||F&&typeof F=="object"&&!F?.update,k=a||F!==!0&&!F?.update,N=F===!0||F?.read,P;e:{let z=h?.collections?.[n];if(z){P=!!("unlock"in z&&z.unlock);break e}P=!1}let j=P,V;e[0]!==x||e[1]!==u||e[2]!==y?(V=z=>{z?(u(!0),x({type:"UPDATE",errorMessage:y("validation:required"),path:"password",valid:!1}),x({type:"UPDATE",errorMessage:y("validation:required"),path:"confirm-password",valid:!1})):(u(!1),x({type:"REMOVE",path:"password"}),x({type:"REMOVE",path:"confirm-password"})),g(z)},e[0]=x,e[1]=u,e[2]=y,e[3]=V):V=e[3];let M=V,O;e[4]!==S||e[5]!==n||e[6]!==s||e[7]!==C.language||e[8]!==i||e[9]!==T||e[10]!==y||e[11]!==f?(O=async()=>{let z=`${T}${S}/${n}/unlock`;(await fetch(z,{body:JSON.stringify(i&&f?{username:f}:{email:s}),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/json"},method:"post"})).status===200?fe.success(y("authentication:successfullyUnlocked")):fe.error(y("authentication:failedToUnlock"))},e[4]=S,e[5]=n,e[6]=s,e[7]=C.language,e[8]=i,e[9]=T,e[10]=y,e[11]=f,e[12]=O):O=e[12];let B=O,G,Y;if(e[13]!==v?(G=()=>{v||g(!1)},Y=[v],e[13]=v,e[14]=G,e[15]=Y):(G=e[14],Y=e[15]),zG(G,Y),r&&!R&&!d)return null;let X;e[16]!==o?(X=[Rf,o].filter(Boolean),e[16]=o,e[17]=X):X=e[17];let ee=X.join(" "),q;if(e[18]!==L||e[19]!==N||e[20]!==p||e[21]!==n||e[22]!==r||e[23]!==E||e[24]!==I?.fields||e[25]!==b?.value||e[26]!==k||e[27]!==R||e[28]!==M||e[29]!==j||e[30]!==w||e[31]!==i||e[32]!==l||e[33]!==a||e[34]!==c||e[35]!==y||e[36]!==ee||e[37]!==B||e[38]!==d||e[39]!==m){let z;e[41]!==L||e[42]!==N||e[43]!==n||e[44]!==E||e[45]!==b?.value||e[46]!==k||e[47]!==y||e[48]!==d?(z=d&&nn("div",{className:`${Rf}__api-key`,children:N&&du(WG,{children:[nn(cr,{field:{name:"enableAPIKey",admin:{disabled:E,readOnly:k},label:y("authentication:enableAPIKey")},path:"enableAPIKey",schemaPath:`${n}.enableAPIKey`}),nn(G_,{enabled:!!b?.value,readOnly:L})]})}),e[41]=L,e[42]=N,e[43]=n,e[44]=E,e[45]=b?.value,e[46]=k,e[47]=y,e[48]=d,e[49]=z):z=e[49];let re;e[50]!==n||e[51]!==E||e[52]!==w||e[53]!==a||e[54]!==y||e[55]!==m?(re=m&&w&&nn(cr,{field:{name:"_verified",admin:{disabled:E,readOnly:a},label:y("authentication:verified")},path:"_verified",schemaPath:`${n}._verified`}),e[50]=n,e[51]=E,e[52]=w,e[53]=a,e[54]=y,e[55]=m,e[56]=re):re=e[56],q=du("div",{className:ee,children:[R&&du(GG.Fragment,{children:[nn(O1,{loginWithUsername:i,operation:l,permissions:I?.fields,readOnly:a,t:y}),(p||c)&&(!r||!R)&&du("div",{className:`${Rf}__changing-password`,children:[nn(Gc,{autoComplete:"new-password",field:{name:"password",label:y("authentication:newPassword"),required:!0},indexPath:"",parentPath:"",parentSchemaPath:"",path:"password",schemaPath:"password"}),nn(Vc,{disabled:a})]}),du("div",{className:`${Rf}__controls`,children:[p&&!c&&nn(ae,{buttonStyle:"secondary",disabled:E,onClick:()=>M(!1),size:"medium",children:y("general:cancel")}),!p&&!c&&!r&&nn(ae,{buttonStyle:"secondary",disabled:E,id:"change-password",onClick:()=>M(!0),size:"medium",children:y("authentication:changePassword")}),l==="update"&&j&&nn(ae,{buttonStyle:"secondary",disabled:E,onClick:()=>void B(),size:"medium",children:y("authentication:forceUnlock")})]})]}),z,re]}),e[18]=L,e[19]=N,e[20]=p,e[21]=n,e[22]=r,e[23]=E,e[24]=I?.fields,e[25]=b?.value,e[26]=k,e[27]=R,e[28]=M,e[29]=j,e[30]=w,e[31]=i,e[32]=l,e[33]=a,e[34]=c,e[35]=y,e[36]=ee,e[37]=B,e[38]=d,e[39]=m,e[40]=q}else q=e[40];return q};function XG(t){let[e]=t;return e&&e?.enableAPIKey||null}function UG(t){return t[1]}import{c as YG}from"react/compiler-runtime";import{getTranslation as ZG}from"@payloadcms/translations";import{formatAdminURL as G1}from"payload/shared";import{useEffect as JG}from"react";var W1=t=>{let e=YG(20),{id:o,collectionSlug:n,globalSlug:r,pluralLabel:s,useAsTitle:i}=t,l=t?.view||void 0,{isEditing:a,isInitializing:c,title:u}=Ae(),{isEntityVisible:d}=N1(),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}=Fn(),{i18n:p,t:g}=$(),{config:b}=W(),{routes:x}=b,{admin:v}=x,C,y;return e[4]!==v||e[5]!==n||e[6]!==r||e[7]!==p||e[8]!==o||e[9]!==a||e[10]!==c||e[11]!==m||e[12]!==s||e[13]!==h||e[14]!==g||e[15]!==u||e[16]!==i||e[17]!==l?(C=()=>{let I=[];c||(n?(I.push({label:ZG(s,p),url:m?G1({adminRoute:v,path:`/collections/${n}`}):void 0}),a?I.push({label:i&&i!=="id"&&u||`${o}`,url:m?G1({adminRoute:v,path:`/collections/${n}/${o}`}):void 0}):I.push({label:g("general:createNew")})):r&&I.push({label:u,url:m?G1({adminRoute:v,path:`/globals/${r}`}):void 0}),l&&I.push({label:l}),h(I))},y=[h,c,a,s,o,i,v,g,p,u,n,r,l,m],e[4]=v,e[5]=n,e[6]=r,e[7]=p,e[8]=o,e[9]=a,e[10]=c,e[11]=m,e[12]=s,e[13]=h,e[14]=g,e[15]=u,e[16]=i,e[17]=l,e[18]=C,e[19]=y):(C=e[18],y=e[19]),JG(C,y),null};import{c as qG}from"react/compiler-runtime";import{useEffect as QG,useRef as KG}from"react";var z1=t=>{let e=qG(13),{collectionConfig:o,config:n,fallback:r,globalConfig:s}=t,i=o?.admin?.useAsTitle,l;e[0]!==i?(l=b=>{let[x]=b;return i&&x&&x?.[i]||null},e[0]=i,e[1]=l):l=e[1];let a=Et(l),c=KG(!1),{i18n:u}=$(),{setDocumentTitle:d}=Ae(),f=n?.admin?.dateFormat,m;e[2]!==o||e[3]!==f||e[4]!==r||e[5]!==a||e[6]!==s||e[7]!==u?(m=lr({collectionConfig:o,data:{id:""},dateFormat:f,fallback:typeof a=="string"?a:typeof a=="number"?String(a):a?.value||r,globalConfig:s,i18n:u}),e[2]=o,e[3]=f,e[4]=r,e[5]=a,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]),QG(p,g),null};var Df="collection-edit";function iW({Description:t,PreviewButton:e,PublishButton:o,SaveButton:n,SaveDraftButton:r,Upload:s}){let{id:i,action:l,AfterDocument:a,AfterFields:c,apiURL:u,BeforeFields:d,collectionSlug:f,currentEditor:m,disableActions:h,disableCreate:p,disableLeaveWithoutSaving:g,docPermissions:b,documentIsLocked:x,getDocPermissions:v,getDocPreferences:C,globalSlug:y,hasPublishPermission:I,hasSavePermission:w,incrementVersionCount:A,initialState:_,isEditing:D,isInitializing:T,lastUpdateTime:S,redirectAfterCreate:R,redirectAfterDelete:E,redirectAfterDuplicate:F,savedDocumentData:L,setCurrentEditor:k,setDocumentIsLocked:N,unlockDocument:P,updateDocumentEditor:j,updateSavedDocumentData:V}=Ae(),{clearDoc:M,drawerSlug:O,onDelete:B,onDuplicate:G,onSave:Y}=Zl(),X=!!O,{refreshCookieAsync:ee,user:q}=Se(),{config:z,config:{admin:{user:re},routes:{admin:me}},getEntityConfig:se}=W(),Z=se({collectionSlug:f}),Q=se({globalSlug:y}),ge=ut(),Ie=eW(),Fe=tW(),{reportUpdate:Le}=li(),{resetUploadEdits:K}=hn(),{getFormState:_e}=Dt(),{startRouteTransition:pe}=it(),ce=X1(null),ne=X1(null),H=Fe.get("locale"),U=Z?.slug||Q?.slug,le=f&&!i?"create":"update",De=Z?Z.auth:void 0,Ne=Z?Z.upload:void 0,qe=Z||Q,Ue=qe?.lockDocuments!==void 0?qe?.lockDocuments:!0,ke=Ue!==!1,Wt=(typeof Ue=="object"?Ue.duration:300)*1e3,mt=!!(Z?.versions?.drafts&&Z?.versions?.drafts?.autosave||Q?.versions?.drafts&&Q?.versions?.drafts?.autosave),ze=typeof g<"u"?!g:!mt,[rt,ue]=_f(!1),[ve,Ve]=_f(!1),[Ge,$e]=_f(Date.now()),ie=S+Wt,J=Date.now()>ie,te=X1({hasShownLockedModal:!1,isLocked:!1,user:null}),he=[Df,(i||y)&&`${Df}--is-editing`];y&&he.push(`global-edit--${y}`),f&&he.push(`collection-edit--${f}`);let Pe=sW(()=>[U],[U]),[je,Ye]=_f(()=>!!(le==="create"&&De&&!De.disableLocalStrategy)),Qe=H1(Ct=>{N(!0);let lo=typeof te.current?.user=="object"?te.current?.user?.id:te.current?.user;if(Ct){let co=typeof Ct.user=="string"||typeof Ct.user=="number"?Ct.user:Ct.user.id;(!te.current||co!==lo)&&(lo===q.id&&co!==q.id&&(Ve(!0),te.current.hasShownLockedModal=!0),te.current={hasShownLockedModal:te.current?.hasShownLockedModal||!1,isLocked:!0,user:Ct.user},k(Ct.user))}},[k,N,q?.id]),Ze=H1(async Ct=>{let lo=er(ne),co=Ct?.doc||Ct?.result;if(Le({id:i,entitySlug:U,updatedAt:co?.updatedAt||new Date().toISOString()}),q&&f===re&&i===q.id&&ee(),A(),typeof V=="function"&&V(co||{}),typeof Y=="function"){let He=i?"update":"create";Y({...Ct,operation:He,updatedAt:He==="update"?new Date().toISOString():co?.updatedAt||new Date().toISOString()})}if(!D&&ge<2&&R!==!1){let He=oW({adminRoute:me,path:`/collections/${f}/${co?.id}${H?`?locale=${H}`:""}`});pe(()=>Ie.push(He))}else K();if(await v(Ct),(i||y)&&!mt){let He=await C(),{state:uo}=await _e({id:i,collectionSlug:f,data:co,docPermissions:b,docPreferences:He,globalSlug:y,operation:le,renderAllFields:!0,returnLockStatus:!1,schemaPath:Pe.join("."),signal:lo.signal,skipValidation:!0});return ke&&N(!1),ne.current=null,uo}},[Le,i,U,q,f,re,A,V,Y,D,ge,v,y,mt,ee,me,H,Ie,K,C,_e,b,le,Pe,ke,N,pe]),_t=H1(async({formState:Ct,submitted:lo})=>{let co=er(ce),He=Date.now(),uo=He-Ge,ko=ke&&uo>=1e4;ko&&$e(He);let mo=await C(),{lockedState:jn,state:Ri}=await _e({id:i,collectionSlug:f,docPermissions:b,docPreferences:mo,formState:Ct,globalSlug:y,operation:le,skipValidation:!lo,renderAllFields:!1,returnLockStatus:ke,schemaPath:Pe.join("."),signal:co.signal,updateLastEdited:ko});return ke&&Qe(jn),ce.current=null,Ri},[i,f,C,_e,y,Qe,ke,le,Pe,b,Ge]);H_(()=>()=>{ke&&x&&(i||y)&&!["preview","api","versions"].some(lo=>window.location.pathname.includes(lo))&&(typeof te.current?.user=="object"?te.current?.user?.id===q?.id:te.current?.user===q?.id)&&(P(i,f??y),N(!1),k(null)),Ve(!1)},[f,y,i,P,q,k,ke,x,N]),H_(()=>{let Ct=ce.current,lo=ne.current;return()=>{Ko(Ct),Ko(lo)}},[]);let _o=x&&m&&(typeof m=="object"?m.id!==q?.id:m!==q?.id)&&!rt&&!ve&&!te.current?.hasShownLockedModal&&!J;return sr("main",{className:he.filter(Boolean).join(" "),children:sr(ml,{operation:le,children:z_(In,{action:l,className:`${Df}__form`,disabled:rt||T||!w,disableValidationOnSubmit:!je,initialState:!T&&_,isDocumentForm:!0,isInitializing:T,method:i?"PATCH":"POST",onChange:[_t],onSuccess:Ze,children:[X&&sr($_,{drawerSlug:O}),ke&&_o&&!rt&&sr(Rb,{handleGoBack:()=>O_({adminRoute:me,collectionSlug:f,router:Ie}),isActive:_o,onReadOnly:()=>{ue(!0),Ve(!1)},onTakeOver:()=>B1(i,f,y,q,!1,j,k,te,ke),updatedAt:S,user:m}),ke&&ve&&sr(Sb,{handleBackToDashboard:()=>j_({adminRoute:me,router:Ie}),isActive:ve,onReadOnly:()=>{ue(!0),Ve(!1)}}),!rt&&ze&&sr(Wc,{}),!X&&sr(W1,{collectionSlug:Z?.slug,globalSlug:Q?.slug,id:i,pluralLabel:Z?.labels?.plural,useAsTitle:Z?.admin?.useAsTitle}),sr(z1,{collectionConfig:Z,config:z,fallback:ge<=1?i?.toString():void 0,globalConfig:Q}),sr(Kb,{apiURL:u,customComponents:{PreviewButton:e,PublishButton:o,SaveButton:n,SaveDraftButton:r},data:L,disableActions:h,disableCreate:p,hasPublishPermission:I,hasSavePermission:w,id:i,isEditing:D,onDelete:B,onDrawerCreateNew:M,onDuplicate:G,onSave:Ze,onTakeOver:()=>B1(i,f,y,q,!0,j,k,te,ke,ue),permissions:b,readOnlyForIncomingUser:rt,redirectAfterDelete:E,redirectAfterDuplicate:F,slug:Z?.slug||Q?.slug,user:m}),sr(Rc,{AfterFields:c,BeforeFields:d||z_(nW,{children:[De&&sr(W_,{className:`${Df}__auth`,collectionSlug:Z.slug,disableLocalStrategy:Z.auth?.disableLocalStrategy,email:L?.email,loginWithUsername:De?.loginWithUsername,operation:le,readOnly:!w,requirePassword:!i,setValidateBeforeSubmit:Ye,useAPIKey:De.useAPIKey,username:L?.username,verify:De.verify}),Ne&&sr(rW.Fragment,{children:s||sr(Nc,{collectionSlug:Z.slug,initialState:_,uploadConfig:Ne})})]}),Description:t,docPermissions:b,fields:qe.fields,readOnly:rt||!w,schemaPathSegments:Pe}),a]})})})}export{Fb as Account,rB as ActionsProvider,NB as AppHeader,Mc as ArrayField,Ep as AuthProvider,yr as Banner,yl as BlocksDrawer,wl as BlocksField,dS as BulkUploadDrawer,fb as BulkUploadProvider,ae as Button,eD as CalendarIcon,kB as Card,Yp as CheckIcon,cr as CheckboxField,Ms as CheckboxInput,Je as ChevronIcon,E1 as ClientFunctionProvider,Pb as CloseMenuIcon,FV as CodeBlockIcon,Q_ as CodeEdiftor,Il as CodeEditorLazy,Sl as CodeField,Gs as Collapsible,_l as CollapsibleField,Pf as ConfigProvider,Vc as ConfirmPasswordField,It as ConfirmationModal,bl as CopyIcon,Vb as CopyLocaleData,Dc as CopyToClipboard,i1 as DateCondition,tD as DatePicker,Gl as DateTimeField,sh as DefaultBlockImage,Kl as DefaultCell,iW as DefaultEditView,FG as DefaultListView,Xb as DeleteMany,Kb as DocumentControls,sb as DocumentEventsProvider,Rc as DocumentFields,dl as DocumentInfoProvider,Rb as DocumentLocked,Sb as DocumentTakeOver,Vs as DragHandleIcon,Pt as Drawer,ar as DrawerToggler,ai as Dropzone,As as EditDepthProvider,wr as EditIcon,t1 as EditMany,ib as EditUpload,O1 as EmailAndUsernameFields,Qs as EmailField,YV as EntityVisibilityProvider,D1 as ErrorIcon,to as ErrorPill,AV as ExternalLinkIcon,We as FieldDescription,Xe as FieldError,be as FieldLabel,am as File,ub as FileDetails,In as Form,R9 as FormLoadingOverlayToggle,Gr as FormSubmit,a8 as FullscreenModal,o1 as GenerateConfirmation,Wl as GroupField,Bo as Gutter,kb as Hamburger,zl as HiddenField,f8 as HydrateAuthProvider,T1 as InfoIcon,oc as JSONField,tc as JoinField,Wc as LeaveWithoutSaving,Zp as LineIcon,Kt as Link,Qf as LinkIcon,b1 as ListControls,og as ListDrawerContextProvider,C1 as ListHeader,sg as ListQueryProvider,iu as ListSelection,xn as LoadingOverlay,G2 as LoadingOverlayToggle,kp as LocaleProvider,Qc as Locked,y1 as LogOutIcon,hV as Logout,Nb as MenuIcon,EV as MinimizeMaximizeIcon,Xo as Modal,Kp as MoreIcon,xV as NavGroup,Ob as NavToggler,gl as NullifyLocaleField,a1 as NumberCondition,rc as NumberField,ml as OperationProvider,ec as Pagination,L1 as ParamsProvider,Gc as PasswordField,rf as PayloadIcon,w1 as PerPage,bt as Pill,jo as PlusIcon,nc as PointField,fo as Popup,Be as PopupList,Lp as PreferencesProvider,Ub as PreviewButton,db as PreviewSizes,WV as ProgressBar,Zb as PublishButton,v1 as PublishMany,bM as QueryPresetsAccessCell,wM as QueryPresetsColumnField,mM as QueryPresetsColumnsCell,hM as QueryPresetsWhereCell,DM as QueryPresetsWhereField,ac as RadioGroupField,yt as ReactSelect,c1 as RelationshipCondition,mc as RelationshipField,ql as RelationshipProvider,Dg as RelationshipTable,oe as RenderCustomComponent,IL as RenderDefaultCell,yo as RenderFields,S1 as RenderTitle,fc as RichTextField,hG as RootProvider,Gb as RouteCacheProvider,Jf as RouteTransitionProvider,pc as RowField,sn as RowLabel,Uf as RowLabelProvider,Jb as SaveButton,qb as SaveDraftButton,cu as ScrollInfoProvider,s1 as SearchFilter,Cl as SearchIcon,j1 as SearchParamsProvider,ih as SectionTitle,yt as Select,yG as SelectAll,m1 as SelectCondition,hc as SelectField,fa as SelectInput,Ga as SelectMany,IG as SelectRow,Hb as SelectionProvider,ig as ServerFunctionsProvider,W1 as SetDocumentStepNav,z1 as SetDocumentTitle,_B as SetStepNav,wt as ShimmerEffect,TV as SortColumn,Z_ as StaggeredShimmers,A1 as SuccessIcon,Kf as SwapIcon,Jg as TabComponent,Yb as Table,Ul as TableColumnsProvider,xc as TabsField,Kh as TabsProvider,f1 as TextCondition,ii as TextField,Qg as TextInput,Cc as TextareaField,Kg as TextareaInput,Lf as ThemeProvider,kr as Thumbnail,Vl as TimezonePicker,po as Tooltip,bi as Translation,Ef as TranslationProvider,yc as UIField,x1 as UnpublishMany,Nc as Upload,zp as UploadEditsProvider,Oc as UploadField,Hg as UploadHandlersProvider,Xm as UploadInput,_b as ViewDescription,F1 as WarningIcon,zs as WatchChildErrors,Up as WatchCondition,k1 as WindowInfoProvider,pt as XIcon,HO as allFieldComponents,J_ as defaultTheme,rs as documentDrawerBaseClass,Ce as fieldBaseClass,NS as fieldComponents,bc as fieldReducer,_p as formatDrawerSlug,Nr as parseSearchParams,fe as toast,Eb as useActions,$V as useAddClientFunction,Ti as useAllFormFields,Se as useAuth,Wo as useBulkUpload,fS as useBulkUploadDrawerSlug,yg as useCellProps,jV as useClientFunctions,Un as useCollapsible,W as useConfig,Yo as useDebounce,Lg as useDebouncedCallback,Wg as useDebouncedEffect,Nf as useDelay,ug as useDelayedRender,Yt as useDocumentDrawer,Zl as useDocumentDrawerContext,li as useDocumentEvents,Di as useDocumentForm,Ae as useDocumentInfo,sl as useDrawerSlug,ut as useEditDepth,Jt as useEffectEvent,N1 as useEntityVisibility,Te as useField,Me as useForm,Xf as useFormBackgroundProcessing,Et as useFormFields,_s as useFormInitializing,Ht as useFormModified,$o as useFormProcessing,zt as useFormSubmitted,hi as useHotkey,an as useIntersect,kc as useListDrawer,Yr as useListDrawerContext,so as useListQuery,pg as useListRelationships,Ee as useLocale,de as useModal,xi as useNav,Jo as useOperation,eG as useParams,rM as usePayloadAPI,Do as usePreferences,aM as useResize,En as useRouteCache,it as useRouteTransition,gD as useRowLabel,lu as useScrollInfo,pG as useSearchParams,Qt as useSelection,Dt as useServerFunctions,Fn as useStepNav,ia as useTableColumns,q_ as useTheme,$s as useThrottledEffect,$ as useTranslation,hn as useUploadEdits,gc as useUploadHandlers,Cb as useUseTitleField,_u as useWatchForm,$1 as useWindowInfo,Oe as withCondition};
59
59
  /*! Bundled license information:
60
60
 
61
61
  scheduler/cjs/scheduler.production.js: