fansunited-management-components 1.59.0-RC1 → 1.59.0-RC2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Ie,y){typeof exports=="object"&&typeof module!="undefined"?y(exports,require("react"),require("fansunited-sdk-esm"),require("react-dom"),require("@emotion/styled"),require("@emotion/react"),require("react-quill"),require("@mui/joy"),require("@mui/icons-material")):typeof define=="function"&&define.amd?define(["exports","react","fansunited-sdk-esm","react-dom","@emotion/styled","@emotion/react","react-quill","@mui/joy","@mui/icons-material"],y):(Ie=typeof globalThis!="undefined"?globalThis:Ie||self,y(Ie.FansUnitedComponents={},Ie.React,Ie.FansUnitedSDK,Ie.ReactDOM,Ie.EmotionStyled,Ie.EmotionReact,Ie.ReactQuill,Ie.MaterialUIJoy,Ie.MaterialUIIcons))})(this,function(Ie,y,He,yt,Pi,me,Di,h,_e){"use strict";var mz=Object.defineProperty,vz=Object.defineProperties;var bz=Object.getOwnPropertyDescriptors;var Ys=Object.getOwnPropertySymbols,yz=Object.getPrototypeOf,Rb=Object.prototype.hasOwnProperty,Mb=Object.prototype.propertyIsEnumerable,xz=Reflect.get;var _i=Math.pow,Hu=(Ie,y,He)=>y in Ie?mz(Ie,y,{enumerable:!0,configurable:!0,writable:!0,value:He}):Ie[y]=He,B=(Ie,y)=>{for(var He in y||(y={}))Rb.call(y,He)&&Hu(Ie,He,y[He]);if(Ys)for(var He of Ys(y))Mb.call(y,He)&&Hu(Ie,He,y[He]);return Ie},Q=(Ie,y)=>vz(Ie,bz(y));var Ks=Ie=>typeof Ie=="symbol"?Ie:Ie+"",Qe=(Ie,y)=>{var He={};for(var yt in Ie)Rb.call(Ie,yt)&&y.indexOf(yt)<0&&(He[yt]=Ie[yt]);if(Ie!=null&&Ys)for(var yt of Ys(Ie))y.indexOf(yt)<0&&Mb.call(Ie,yt)&&(He[yt]=Ie[yt]);return He};var J=(Ie,y,He)=>Hu(Ie,typeof y!="symbol"?y+"":y,He);var Br=(Ie,y,He)=>xz(yz(Ie),He,y);var _=(Ie,y,He)=>new Promise((yt,Pi)=>{var me=_e=>{try{h(He.next(_e))}catch(Oi){Pi(Oi)}},Di=_e=>{try{h(He.throw(_e))}catch(Oi){Pi(Oi)}},h=_e=>_e.done?yt(_e.value):Promise.resolve(_e.value).then(me,Di);h((He=He.apply(Ie,y)).next())});function Oi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const K=Oi(y),Te={ar:{key:"ar",name:"Arabic"},bg:{key:"bg",name:"Bulgarian"},da:{key:"da",name:"Danish"},de:{key:"de",name:"German"},en:{key:"en",name:"English"},el:{key:"el",name:"Greek"},es:{key:"es",name:"Spanish"},fr:{key:"fr",name:"French"},hi:{key:"hi",name:"Hindi"},hu:{key:"hu",name:"Hungarian"},it:{key:"it",name:"Italian"},nl:{key:"nl",name:"Dutch"},pt:{key:"pt",name:"Portuguese"},"pt-br":{key:"pt-br",name:"Brazilian(Portuguese)"},ro:{key:"ro",name:"Romanian"},sk:{key:"sk",name:"Slovak"},sr:{key:"sr",name:"Serbian"},sv:{key:"sv",name:"Swedish"},sw:{key:"sw",name:"Swahili"}},Ri={ar:Te.ar,"ar-dz":Te.ar,"ar-bh":Te.ar,"ar-eg":Te.ar,"ar-iq":Te.ar,"ar-jo":Te.ar,"ar-kw":Te.ar,"ar-lb":Te.ar,"ar-ly":Te.ar,"ar-ma":Te.ar,"ar-om":Te.ar,"ar-qa":Te.ar,"ar-sa":Te.ar,"ar-sy":Te.ar,"ar-tn":Te.ar,"ar-ae":Te.ar,"ar-ye":Te.ar,bg:Te.bg,da:Te.da,de:Te.de,en:Te.en,"en-gb":Te.en,"en-us":Te.en,el:Te.el,es:Te.es,fr:Te.fr,hi:Te.hi,hu:Te.hu,it:Te.it,nl:Te.nl,pt:Te.pt,"pt-br":Te["pt-br"],ro:Te.ro,sk:Te.sk,sr:Te.sr,sv:Te.sv,sw:Te.sw},qn={ar:"sa",bg:"bg",da:"dk",de:"de",en:"gb",el:"gr",es:"es",fr:"fr",hi:"in",hu:"hu",it:"it",nl:"nl",pt:"pt","pt-br":"br",ro:"ro",sk:"sk",sr:"rs",sv:"se",sw:"ke"};var jt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Wu(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Gu={exports:{}},No={};/**
1
+ (function(Ie,y){typeof exports=="object"&&typeof module!="undefined"?y(exports,require("react"),require("fansunited-sdk-esm"),require("react-dom"),require("@emotion/styled"),require("@emotion/react"),require("react-quill"),require("@mui/joy"),require("@mui/icons-material")):typeof define=="function"&&define.amd?define(["exports","react","fansunited-sdk-esm","react-dom","@emotion/styled","@emotion/react","react-quill","@mui/joy","@mui/icons-material"],y):(Ie=typeof globalThis!="undefined"?globalThis:Ie||self,y(Ie.FansUnitedComponents={},Ie.React,Ie.FansUnitedSDK,Ie.ReactDOM,Ie.EmotionStyled,Ie.EmotionReact,Ie.ReactQuill,Ie.MaterialUIJoy,Ie.MaterialUIIcons))})(this,function(Ie,y,He,yt,Pi,me,Di,h,_e){"use strict";var mz=Object.defineProperty,vz=Object.defineProperties;var bz=Object.getOwnPropertyDescriptors;var Ys=Object.getOwnPropertySymbols,yz=Object.getPrototypeOf,Rb=Object.prototype.hasOwnProperty,Mb=Object.prototype.propertyIsEnumerable,xz=Reflect.get;var _i=Math.pow,Hu=(Ie,y,He)=>y in Ie?mz(Ie,y,{enumerable:!0,configurable:!0,writable:!0,value:He}):Ie[y]=He,B=(Ie,y)=>{for(var He in y||(y={}))Rb.call(y,He)&&Hu(Ie,He,y[He]);if(Ys)for(var He of Ys(y))Mb.call(y,He)&&Hu(Ie,He,y[He]);return Ie},Q=(Ie,y)=>vz(Ie,bz(y));var Ks=Ie=>typeof Ie=="symbol"?Ie:Ie+"",Qe=(Ie,y)=>{var He={};for(var yt in Ie)Rb.call(Ie,yt)&&y.indexOf(yt)<0&&(He[yt]=Ie[yt]);if(Ie!=null&&Ys)for(var yt of Ys(Ie))y.indexOf(yt)<0&&Mb.call(Ie,yt)&&(He[yt]=Ie[yt]);return He};var J=(Ie,y,He)=>Hu(Ie,typeof y!="symbol"?y+"":y,He);var Br=(Ie,y,He)=>xz(yz(Ie),He,y);var _=(Ie,y,He)=>new Promise((yt,Pi)=>{var me=_e=>{try{h(He.next(_e))}catch(Oi){Pi(Oi)}},Di=_e=>{try{h(He.throw(_e))}catch(Oi){Pi(Oi)}},h=_e=>_e.done?yt(_e.value):Promise.resolve(_e.value).then(me,Di);h((He=He.apply(Ie,y)).next())});function Oi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const K=Oi(y),Te={ar:{key:"ar",name:"Arabic"},bg:{key:"bg",name:"Bulgarian"},da:{key:"da",name:"Danish"},de:{key:"de",name:"German"},en:{key:"en",name:"English"},el:{key:"el",name:"Greek"},es:{key:"es",name:"Spanish"},fr:{key:"fr",name:"French"},hi:{key:"hi",name:"Hindi"},hu:{key:"hu",name:"Hungarian"},it:{key:"it",name:"Italian"},nl:{key:"nl",name:"Dutch"},pt:{key:"pt",name:"Portuguese"},"pt-br":{key:"pt-br",name:"Brazilian(Portuguese)"},ro:{key:"ro",name:"Romanian"},sk:{key:"sk",name:"Slovak"},sr:{key:"sr",name:"Serbian"},sv:{key:"sv",name:"Swedish"},sw:{key:"sw",name:"Swahili"}},Ri={ar:Te.ar,"ar-dz":Te.ar,"ar-bh":Te.ar,"ar-eg":Te.ar,"ar-iq":Te.ar,"ar-jo":Te.ar,"ar-kw":Te.ar,"ar-lb":Te.ar,"ar-ly":Te.ar,"ar-ma":Te.ar,"ar-om":Te.ar,"ar-qa":Te.ar,"ar-sa":Te.ar,"ar-sy":Te.ar,"ar-tn":Te.ar,"ar-ae":Te.ar,"ar-ye":Te.ar,bg:Te.bg,da:Te.da,de:Te.de,en:Te.en,"en-gb":Te.en,"en-us":Te.en,el:Te.el,es:Te.es,fr:Te.fr,hi:Te.hi,hu:Te.hu,it:Te.it,nl:Te.nl,pt:Te.pt,"pt-br":Te["pt-br"],ro:Te.ro,sk:Te.sk,sr:Te.sr,sv:Te.sv,sw:Te.sw},qn={ar:"sa",bg:"bg",da:"dk",de:"de",en:"gb",el:"gr",es:"es",fr:"fr",hi:"in",hu:"hu",it:"it",nl:"nl",pt:"pt","pt-br":"br",ro:"ro",sk:"sk",sr:"rs",sv:"se",sw:"ke"};var zt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Wu(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Gu={exports:{}},No={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -111,7 +111,7 @@
111
111
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
112
112
  * See the License for the specific language governing permissions and
113
113
  * limitations under the License.
114
- */const Zb="FirebaseError";class Ut extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=Zb,Object.setPrototypeOf(this,Ut.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,mr.prototype.create)}}class mr{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},i=`${this.service}/${t}`,o=this.errors[t],a=o?e0(o,r):"Error",l=`${this.serviceName}: ${a} (${i}).`;return new Ut(i,l,r)}}function e0(e,t){return e.replace(t0,(n,r)=>{const i=t[r];return i!=null?String(i):`<${r}?>`})}const t0=/\{\$([^}]+)}/g;/**
114
+ */const Zb="FirebaseError";class jt extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=Zb,Object.setPrototypeOf(this,jt.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,mr.prototype.create)}}class mr{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},i=`${this.service}/${t}`,o=this.errors[t],a=o?e0(o,r):"Error",l=`${this.serviceName}: ${a} (${i}).`;return new jt(i,l,r)}}function e0(e,t){return e.replace(t0,(n,r)=>{const i=t[r];return i!=null?String(i):`<${r}?>`})}const t0=/\{\$([^}]+)}/g;/**
115
115
  * @license
116
116
  * Copyright 2017 Google LLC
117
117
  *
@@ -351,7 +351,7 @@
351
351
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
352
352
  * See the License for the specific language governing permissions and
353
353
  * limitations under the License.
354
- */const oy="firebase-heartbeat-database",ay=1,Bi="firebase-heartbeat-store";let cl=null;function Cd(){return cl||(cl=C0(oy,ay,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Bi)}catch(n){console.warn(n)}}}}).catch(e=>{throw tn.create("idb-open",{originalErrorMessage:e.message})})),cl}function sy(e){return _(this,null,function*(){try{const n=(yield Cd()).transaction(Bi),r=yield n.objectStore(Bi).get(Sd(e));return yield n.done,r}catch(t){if(t instanceof Ut)Pn.warn(t.message);else{const n=tn.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Pn.warn(n.message)}}})}function wd(e,t){return _(this,null,function*(){try{const r=(yield Cd()).transaction(Bi,"readwrite");yield r.objectStore(Bi).put(t,Sd(e)),yield r.done}catch(n){if(n instanceof Ut)Pn.warn(n.message);else{const r=tn.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Pn.warn(r.message)}}})}function Sd(e){return`${e.name}!${e.options.appId}`}/**
354
+ */const oy="firebase-heartbeat-database",ay=1,Bi="firebase-heartbeat-store";let cl=null;function Cd(){return cl||(cl=C0(oy,ay,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Bi)}catch(n){console.warn(n)}}}}).catch(e=>{throw tn.create("idb-open",{originalErrorMessage:e.message})})),cl}function sy(e){return _(this,null,function*(){try{const n=(yield Cd()).transaction(Bi),r=yield n.objectStore(Bi).get(Sd(e));return yield n.done,r}catch(t){if(t instanceof jt)Pn.warn(t.message);else{const n=tn.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Pn.warn(n.message)}}})}function wd(e,t){return _(this,null,function*(){try{const r=(yield Cd()).transaction(Bi,"readwrite");yield r.objectStore(Bi).put(t,Sd(e)),yield r.done}catch(n){if(n instanceof jt)Pn.warn(n.message);else{const r=tn.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Pn.warn(r.message)}}})}function Sd(e){return`${e.name}!${e.options.appId}`}/**
355
355
  * @license
356
356
  * Copyright 2021 Google LLC
357
357
  *
@@ -381,7 +381,7 @@
381
381
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
382
382
  * See the License for the specific language governing permissions and
383
383
  * limitations under the License.
384
- */function hy(e){br(new Qn("platform-logger",t=>new I0(t),"PRIVATE")),br(new Qn("heartbeat",t=>new uy(t),"PRIVATE")),Dn(Ho,al,e),Dn(Ho,al,"esm2017"),Dn("fire-js","")}hy("");const py=Object.freeze(Object.defineProperty({__proto__:null,FirebaseError:Ut,SDK_VERSION:yr,_DEFAULT_ENTRY_NAME:Xn,_addComponent:Li,_addOrOverwriteComponent:gd,_apps:Zn,_clearComponents:ey,_components:zr,_getProvider:Wo,_isFirebaseApp:md,_isFirebaseServerApp:Xe,_registerComponent:br,_removeServiceInstance:Z0,_serverApps:Nr,deleteApp:ll,getApp:bd,getApps:iy,initializeApp:sl,initializeServerApp:ry,onLog:yd,registerVersion:Dn,setLogLevel:xd},Symbol.toStringTag,{value:"Module"}));/**
384
+ */function hy(e){br(new Qn("platform-logger",t=>new I0(t),"PRIVATE")),br(new Qn("heartbeat",t=>new uy(t),"PRIVATE")),Dn(Ho,al,e),Dn(Ho,al,"esm2017"),Dn("fire-js","")}hy("");const py=Object.freeze(Object.defineProperty({__proto__:null,FirebaseError:jt,SDK_VERSION:yr,_DEFAULT_ENTRY_NAME:Xn,_addComponent:Li,_addOrOverwriteComponent:gd,_apps:Zn,_clearComponents:ey,_components:zr,_getProvider:Wo,_isFirebaseApp:md,_isFirebaseServerApp:Xe,_registerComponent:br,_removeServiceInstance:Z0,_serverApps:Nr,deleteApp:ll,getApp:bd,getApps:iy,initializeApp:sl,initializeServerApp:ry,onLog:yd,registerVersion:Dn,setLogLevel:xd},Symbol.toStringTag,{value:"Module"}));/**
385
385
  * @license
386
386
  * Copyright 2020 Google LLC
387
387
  *
@@ -657,7 +657,7 @@
657
657
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
658
658
  * See the License for the specific language governing permissions and
659
659
  * limitations under the License.
660
- */const Oy=new Ni(3e4,6e4);function Ze(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}function et(o,a,l,c){return _(this,arguments,function*(e,t,n,r,i={}){return Rd(e,i,()=>_(this,null,function*(){let u={},f={};r&&(t==="GET"?f=r:u={body:JSON.stringify(r)});const d=$r(Object.assign({key:e.config.apiKey},f)).slice(1),p=yield e._getAdditionalHeaders();return p["Content-Type"]="application/json",e.languageCode&&(p["X-Firebase-Locale"]=e.languageCode),Od.fetch()(Md(e,e.config.apiHost,n,d),Object.assign({method:t,headers:p,referrerPolicy:"no-referrer"},u))}))})}function Rd(e,t,n){return _(this,null,function*(){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},Dy),t);try{const i=new My(e),o=yield Promise.race([n(),i.promise]);i.clearNetworkTimeout();const a=yield o.json();if("needConfirmation"in a)throw zi(e,"account-exists-with-different-credential",a);if(o.ok&&!("errorMessage"in a))return a;{const l=o.ok?a.errorMessage:a.error.message,[c,u]=l.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw zi(e,"credential-already-in-use",a);if(c==="EMAIL_EXISTS")throw zi(e,"email-already-in-use",a);if(c==="USER_DISABLED")throw zi(e,"user-disabled",a);const f=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw fl(e,f,u);At(e,f)}}catch(i){if(i instanceof Ut)throw i;At(e,"network-request-failed",{message:String(i)})}})}function On(o,a,l,c){return _(this,arguments,function*(e,t,n,r,i={}){const u=yield et(e,t,n,r,i);return"mfaPendingCredential"in u&&At(e,"multi-factor-auth-required",{_serverResponse:u}),u})}function Md(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?gl(e.config,i):`${e.config.apiScheme}://${i}`}function Ry(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class My{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(Ct(this.auth,"network-request-failed")),Oy.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function zi(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=Ct(e,t,r);return i.customData._tokenResponse=n,i}/**
660
+ */const Oy=new Ni(3e4,6e4);function Ze(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}function et(o,a,l,c){return _(this,arguments,function*(e,t,n,r,i={}){return Rd(e,i,()=>_(this,null,function*(){let u={},f={};r&&(t==="GET"?f=r:u={body:JSON.stringify(r)});const d=$r(Object.assign({key:e.config.apiKey},f)).slice(1),p=yield e._getAdditionalHeaders();return p["Content-Type"]="application/json",e.languageCode&&(p["X-Firebase-Locale"]=e.languageCode),Od.fetch()(Md(e,e.config.apiHost,n,d),Object.assign({method:t,headers:p,referrerPolicy:"no-referrer"},u))}))})}function Rd(e,t,n){return _(this,null,function*(){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},Dy),t);try{const i=new My(e),o=yield Promise.race([n(),i.promise]);i.clearNetworkTimeout();const a=yield o.json();if("needConfirmation"in a)throw zi(e,"account-exists-with-different-credential",a);if(o.ok&&!("errorMessage"in a))return a;{const l=o.ok?a.errorMessage:a.error.message,[c,u]=l.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw zi(e,"credential-already-in-use",a);if(c==="EMAIL_EXISTS")throw zi(e,"email-already-in-use",a);if(c==="USER_DISABLED")throw zi(e,"user-disabled",a);const f=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw fl(e,f,u);At(e,f)}}catch(i){if(i instanceof jt)throw i;At(e,"network-request-failed",{message:String(i)})}})}function On(o,a,l,c){return _(this,arguments,function*(e,t,n,r,i={}){const u=yield et(e,t,n,r,i);return"mfaPendingCredential"in u&&At(e,"multi-factor-auth-required",{_serverResponse:u}),u})}function Md(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?gl(e.config,i):`${e.config.apiScheme}://${i}`}function Ry(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class My{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(Ct(this.auth,"network-request-failed")),Oy.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function zi(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=Ct(e,t,r);return i.customData._tokenResponse=n,i}/**
661
661
  * @license
662
662
  * Copyright 2020 Google LLC
663
663
  *
@@ -732,7 +732,7 @@
732
732
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
733
733
  * See the License for the specific language governing permissions and
734
734
  * limitations under the License.
735
- */function Rn(e,t,n=!1){return _(this,null,function*(){if(n)return t;try{return yield t}catch(r){throw r instanceof Ut&&jy(r)&&e.auth.currentUser===e&&(yield e.auth.signOut()),r}})}function jy({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
735
+ */function Rn(e,t,n=!1){return _(this,null,function*(){if(n)return t;try{return yield t}catch(r){throw r instanceof jt&&jy(r)&&e.auth.currentUser===e&&(yield e.auth.signOut()),r}})}function jy({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
736
736
  * @license
737
737
  * Copyright 2020 Google LLC
738
738
  *
@@ -1332,7 +1332,7 @@
1332
1332
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1333
1333
  * See the License for the specific language governing permissions and
1334
1334
  * limitations under the License.
1335
- */class Xo extends Ut{constructor(t,n,r,i){var o;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,Xo.prototype),this.customData={appName:t.name,tenantId:(o=t.tenantId)!==null&&o!==void 0?o:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,i){return new Xo(t,n,r,i)}}function af(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Xo._fromErrorAndOperation(e,o,t,r):o})}/**
1335
+ */class Xo extends jt{constructor(t,n,r,i){var o;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,Xo.prototype),this.customData={appName:t.name,tenantId:(o=t.tenantId)!==null&&o!==void 0?o:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,i){return new Xo(t,n,r,i)}}function af(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Xo._fromErrorAndOperation(e,o,t,r):o})}/**
1336
1336
  * @license
1337
1337
  * Copyright 2020 Google LLC
1338
1338
  *
@@ -2247,7 +2247,7 @@
2247
2247
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2248
2248
  * See the License for the specific language governing permissions and
2249
2249
  * limitations under the License.
2250
- */function SS(e){return Gf(e)}function IS(e,t){var n;const r=(n=t.customData)===null||n===void 0?void 0:n._tokenResponse;if((t==null?void 0:t.code)==="auth/multi-factor-auth-required"){const i=t;i.resolver=new AS(e,sC(e,t))}else if(r){const i=Gf(t),o=t;i&&(o.credential=i,o.tenantId=r.tenantId||void 0,o.email=r.email||void 0,o.phoneNumber=r.phoneNumber||void 0)}}function Gf(e){const{_tokenResponse:t}=e instanceof Ut?e.customData:e;if(!t)return null;if(!(e instanceof Ut)&&"temporaryProof"in t&&"phoneNumber"in t)return Sr.credentialFromResult(e);const n=t.providerId;if(!n||n===$i.PASSWORD)return null;let r;switch(n){case $i.GOOGLE:r=wn;break;case $i.FACEBOOK:r=Cn;break;case $i.GITHUB:r=Sn;break;case $i.TWITTER:r=In;break;default:const{oauthIdToken:i,oauthAccessToken:o,oauthTokenSecret:a,pendingToken:l,nonce:c}=t;return!o&&!a&&!i&&!l?null:l?n.startsWith("saml.")?qr._create(n,l):xn._fromParams({providerId:n,signInMethod:n,pendingToken:l,idToken:i,accessToken:o}):new Kr(n).credential({idToken:i,accessToken:o,rawNonce:c})}return e instanceof Ut?r.credentialFromError(e):r.credentialFromResult(e)}function Vt(e,t){return t.catch(n=>{throw n instanceof Ut&&IS(e,n),n}).then(n=>{const r=n.operationType,i=n.user;return{operationType:r,credential:SS(n),additionalUserInfo:iC(n),user:Fn.getOrCreate(i)}})}function Ul(e,t){return _(this,null,function*(){const n=yield t;return{verificationId:n.verificationId,confirm:r=>Vt(e,n.confirm(r))}})}class AS{constructor(t,n){this.resolver=n,this.auth=wS(t)}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(t){return Vt(Wf(this.auth),this.resolver.resolveSignIn(t))}}/**
2250
+ */function SS(e){return Gf(e)}function IS(e,t){var n;const r=(n=t.customData)===null||n===void 0?void 0:n._tokenResponse;if((t==null?void 0:t.code)==="auth/multi-factor-auth-required"){const i=t;i.resolver=new AS(e,sC(e,t))}else if(r){const i=Gf(t),o=t;i&&(o.credential=i,o.tenantId=r.tenantId||void 0,o.email=r.email||void 0,o.phoneNumber=r.phoneNumber||void 0)}}function Gf(e){const{_tokenResponse:t}=e instanceof jt?e.customData:e;if(!t)return null;if(!(e instanceof jt)&&"temporaryProof"in t&&"phoneNumber"in t)return Sr.credentialFromResult(e);const n=t.providerId;if(!n||n===$i.PASSWORD)return null;let r;switch(n){case $i.GOOGLE:r=wn;break;case $i.FACEBOOK:r=Cn;break;case $i.GITHUB:r=Sn;break;case $i.TWITTER:r=In;break;default:const{oauthIdToken:i,oauthAccessToken:o,oauthTokenSecret:a,pendingToken:l,nonce:c}=t;return!o&&!a&&!i&&!l?null:l?n.startsWith("saml.")?qr._create(n,l):xn._fromParams({providerId:n,signInMethod:n,pendingToken:l,idToken:i,accessToken:o}):new Kr(n).credential({idToken:i,accessToken:o,rawNonce:c})}return e instanceof jt?r.credentialFromError(e):r.credentialFromResult(e)}function Ut(e,t){return t.catch(n=>{throw n instanceof jt&&IS(e,n),n}).then(n=>{const r=n.operationType,i=n.user;return{operationType:r,credential:SS(n),additionalUserInfo:iC(n),user:Fn.getOrCreate(i)}})}function Ul(e,t){return _(this,null,function*(){const n=yield t;return{verificationId:n.verificationId,confirm:r=>Ut(e,n.confirm(r))}})}class AS{constructor(t,n){this.resolver=n,this.auth=wS(t)}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(t){return Ut(Wf(this.auth),this.resolver.resolveSignIn(t))}}/**
2251
2251
  * @license
2252
2252
  * Copyright 2020 Google LLC
2253
2253
  *
@@ -2262,7 +2262,7 @@
2262
2262
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2263
2263
  * See the License for the specific language governing permissions and
2264
2264
  * limitations under the License.
2265
- */class Fn{constructor(t){this._delegate=t,this.multiFactor=dC(t)}static getOrCreate(t){return Fn.USER_MAP.has(t)||Fn.USER_MAP.set(t,new Fn(t)),Fn.USER_MAP.get(t)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(t){return this._delegate.getIdTokenResult(t)}getIdToken(t){return this._delegate.getIdToken(t)}linkAndRetrieveDataWithCredential(t){return this.linkWithCredential(t)}linkWithCredential(t){return _(this,null,function*(){return Vt(this.auth,uf(this._delegate,t))})}linkWithPhoneNumber(t,n){return _(this,null,function*(){return Ul(this.auth,zC(this._delegate,t,n))})}linkWithPopup(t){return _(this,null,function*(){return Vt(this.auth,qC(this._delegate,t,ir))})}linkWithRedirect(t){return _(this,null,function*(){return yield jl(tt(this.auth)),rw(this._delegate,t,ir)})}reauthenticateAndRetrieveDataWithCredential(t){return this.reauthenticateWithCredential(t)}reauthenticateWithCredential(t){return _(this,null,function*(){return Vt(this.auth,df(this._delegate,t))})}reauthenticateWithPhoneNumber(t,n){return Ul(this.auth,jC(this._delegate,t,n))}reauthenticateWithPopup(t){return Vt(this.auth,KC(this._delegate,t,ir))}reauthenticateWithRedirect(t){return _(this,null,function*(){return yield jl(tt(this.auth)),tw(this._delegate,t,ir)})}sendEmailVerification(t){return Yx(this._delegate,t)}unlink(t){return _(this,null,function*(){return yield Rx(this._delegate,t),this})}updateEmail(t){return Jx(this._delegate,t)}updatePassword(t){return Xx(this._delegate,t)}updatePhoneNumber(t){return UC(this._delegate,t)}updateProfile(t){return Qx(this._delegate,t)}verifyBeforeUpdateEmail(t,n){return Kx(this._delegate,t,n)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}}Fn.USER_MAP=new WeakMap;/**
2265
+ */class Fn{constructor(t){this._delegate=t,this.multiFactor=dC(t)}static getOrCreate(t){return Fn.USER_MAP.has(t)||Fn.USER_MAP.set(t,new Fn(t)),Fn.USER_MAP.get(t)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(t){return this._delegate.getIdTokenResult(t)}getIdToken(t){return this._delegate.getIdToken(t)}linkAndRetrieveDataWithCredential(t){return this.linkWithCredential(t)}linkWithCredential(t){return _(this,null,function*(){return Ut(this.auth,uf(this._delegate,t))})}linkWithPhoneNumber(t,n){return _(this,null,function*(){return Ul(this.auth,zC(this._delegate,t,n))})}linkWithPopup(t){return _(this,null,function*(){return Ut(this.auth,qC(this._delegate,t,ir))})}linkWithRedirect(t){return _(this,null,function*(){return yield jl(tt(this.auth)),rw(this._delegate,t,ir)})}reauthenticateAndRetrieveDataWithCredential(t){return this.reauthenticateWithCredential(t)}reauthenticateWithCredential(t){return _(this,null,function*(){return Ut(this.auth,df(this._delegate,t))})}reauthenticateWithPhoneNumber(t,n){return Ul(this.auth,jC(this._delegate,t,n))}reauthenticateWithPopup(t){return Ut(this.auth,KC(this._delegate,t,ir))}reauthenticateWithRedirect(t){return _(this,null,function*(){return yield jl(tt(this.auth)),tw(this._delegate,t,ir)})}sendEmailVerification(t){return Yx(this._delegate,t)}unlink(t){return _(this,null,function*(){return yield Rx(this._delegate,t),this})}updateEmail(t){return Jx(this._delegate,t)}updatePassword(t){return Xx(this._delegate,t)}updatePhoneNumber(t){return UC(this._delegate,t)}updateProfile(t){return Qx(this._delegate,t)}verifyBeforeUpdateEmail(t,n){return Kx(this._delegate,t,n)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}}Fn.USER_MAP=new WeakMap;/**
2266
2266
  * @license
2267
2267
  * Copyright 2020 Google LLC
2268
2268
  *
@@ -2277,7 +2277,7 @@
2277
2277
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2278
2278
  * See the License for the specific language governing permissions and
2279
2279
  * limitations under the License.
2280
- */const to=le;class Vl{constructor(t,n){if(this.app=t,n.isInitialized()){this._delegate=n.getImmediate(),this.linkUnderlyingAuth();return}const{apiKey:r}=t.options;to(r,"invalid-api-key",{appName:t.name}),to(r,"invalid-api-key",{appName:t.name});const i=typeof window!="undefined"?ir:void 0;this._delegate=n.initialize({options:{persistence:TS(r,t.name),popupRedirectResolver:i}}),this._delegate._updateErrorMap(Ty),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?Fn.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(t){this._delegate.languageCode=t}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(t){this._delegate.tenantId=t}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(t,n){yl(this._delegate,t,n)}applyActionCode(t){return Fx(this._delegate,t)}checkActionCode(t){return ff(this._delegate,t)}confirmPasswordReset(t,n){return $x(this._delegate,t,n)}createUserWithEmailAndPassword(t,n){return _(this,null,function*(){return Vt(this._delegate,zx(this._delegate,t,n))})}fetchProvidersForEmail(t){return this.fetchSignInMethodsForEmail(t)}fetchSignInMethodsForEmail(t){return Gx(this._delegate,t)}isSignInWithEmailLink(t){return Vx(this._delegate,t)}getRedirectResult(){return _(this,null,function*(){to(zl(),this._delegate,"operation-not-supported-in-this-environment");const t=yield ow(this._delegate,ir);return t?Vt(this._delegate,Promise.resolve(t)):{credential:null,user:null}})}addFrameworkForLogging(t){lS(this._delegate,t)}onAuthStateChanged(t,n,r){const{next:i,error:o,complete:a}=Yf(t,n,r);return this._delegate.onAuthStateChanged(i,o,a)}onIdTokenChanged(t,n,r){const{next:i,error:o,complete:a}=Yf(t,n,r);return this._delegate.onIdTokenChanged(i,o,a)}sendSignInLinkToEmail(t,n){return Ux(this._delegate,t,n)}sendPasswordResetEmail(t,n){return Bx(this._delegate,t,n||void 0)}setPersistence(t){return _(this,null,function*(){yS(this._delegate,t);let n;switch(t){case Kt.SESSION:n=rr;break;case Kt.LOCAL:n=(yield Yt(Xr)._isAvailable())?Xr:ra;break;case Kt.NONE:n=Hr;break;default:return At("argument-error",{appName:this._delegate.name})}return this._delegate.setPersistence(n)})}signInAndRetrieveDataWithCredential(t){return this.signInWithCredential(t)}signInAnonymously(){return Vt(this._delegate,Ox(this._delegate))}signInWithCredential(t){return Vt(this._delegate,ea(this._delegate,t))}signInWithCustomToken(t){return Vt(this._delegate,Lx(this._delegate,t))}signInWithEmailAndPassword(t,n){return Vt(this._delegate,jx(this._delegate,t,n))}signInWithEmailLink(t,n){return Vt(this._delegate,Hx(this._delegate,t,n))}signInWithPhoneNumber(t,n){return Ul(this._delegate,NC(this._delegate,t,n))}signInWithPopup(t){return _(this,null,function*(){return to(zl(),this._delegate,"operation-not-supported-in-this-environment"),Vt(this._delegate,YC(this._delegate,t,ir))})}signInWithRedirect(t){return _(this,null,function*(){return to(zl(),this._delegate,"operation-not-supported-in-this-environment"),yield jl(this._delegate),ZC(this._delegate,t,ir)})}updateCurrentUser(t){return this._delegate.updateCurrentUser(t)}verifyPasswordResetCode(t){return Nx(this._delegate,t)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}Vl.Persistence=Kt;function Yf(e,t,n){let r=e;typeof e!="function"&&({next:r,error:t,complete:n}=e);const i=r;return{next:a=>i(a&&Fn.getOrCreate(a)),error:t,complete:n}}function TS(e,t){const n=xS(e,t);if(typeof self!="undefined"&&!n.includes(Xr)&&n.push(Xr),typeof window!="undefined")for(const r of[ra,rr])n.includes(r)||n.push(r);return n.includes(Hr)||n.push(Hr),n}/**
2280
+ */const to=le;class Vl{constructor(t,n){if(this.app=t,n.isInitialized()){this._delegate=n.getImmediate(),this.linkUnderlyingAuth();return}const{apiKey:r}=t.options;to(r,"invalid-api-key",{appName:t.name}),to(r,"invalid-api-key",{appName:t.name});const i=typeof window!="undefined"?ir:void 0;this._delegate=n.initialize({options:{persistence:TS(r,t.name),popupRedirectResolver:i}}),this._delegate._updateErrorMap(Ty),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?Fn.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(t){this._delegate.languageCode=t}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(t){this._delegate.tenantId=t}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(t,n){yl(this._delegate,t,n)}applyActionCode(t){return Fx(this._delegate,t)}checkActionCode(t){return ff(this._delegate,t)}confirmPasswordReset(t,n){return $x(this._delegate,t,n)}createUserWithEmailAndPassword(t,n){return _(this,null,function*(){return Ut(this._delegate,zx(this._delegate,t,n))})}fetchProvidersForEmail(t){return this.fetchSignInMethodsForEmail(t)}fetchSignInMethodsForEmail(t){return Gx(this._delegate,t)}isSignInWithEmailLink(t){return Vx(this._delegate,t)}getRedirectResult(){return _(this,null,function*(){to(zl(),this._delegate,"operation-not-supported-in-this-environment");const t=yield ow(this._delegate,ir);return t?Ut(this._delegate,Promise.resolve(t)):{credential:null,user:null}})}addFrameworkForLogging(t){lS(this._delegate,t)}onAuthStateChanged(t,n,r){const{next:i,error:o,complete:a}=Yf(t,n,r);return this._delegate.onAuthStateChanged(i,o,a)}onIdTokenChanged(t,n,r){const{next:i,error:o,complete:a}=Yf(t,n,r);return this._delegate.onIdTokenChanged(i,o,a)}sendSignInLinkToEmail(t,n){return Ux(this._delegate,t,n)}sendPasswordResetEmail(t,n){return Bx(this._delegate,t,n||void 0)}setPersistence(t){return _(this,null,function*(){yS(this._delegate,t);let n;switch(t){case Kt.SESSION:n=rr;break;case Kt.LOCAL:n=(yield Yt(Xr)._isAvailable())?Xr:ra;break;case Kt.NONE:n=Hr;break;default:return At("argument-error",{appName:this._delegate.name})}return this._delegate.setPersistence(n)})}signInAndRetrieveDataWithCredential(t){return this.signInWithCredential(t)}signInAnonymously(){return Ut(this._delegate,Ox(this._delegate))}signInWithCredential(t){return Ut(this._delegate,ea(this._delegate,t))}signInWithCustomToken(t){return Ut(this._delegate,Lx(this._delegate,t))}signInWithEmailAndPassword(t,n){return Ut(this._delegate,jx(this._delegate,t,n))}signInWithEmailLink(t,n){return Ut(this._delegate,Hx(this._delegate,t,n))}signInWithPhoneNumber(t,n){return Ul(this._delegate,NC(this._delegate,t,n))}signInWithPopup(t){return _(this,null,function*(){return to(zl(),this._delegate,"operation-not-supported-in-this-environment"),Ut(this._delegate,YC(this._delegate,t,ir))})}signInWithRedirect(t){return _(this,null,function*(){return to(zl(),this._delegate,"operation-not-supported-in-this-environment"),yield jl(this._delegate),ZC(this._delegate,t,ir)})}updateCurrentUser(t){return this._delegate.updateCurrentUser(t)}verifyPasswordResetCode(t){return Nx(this._delegate,t)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}Vl.Persistence=Kt;function Yf(e,t,n){let r=e;typeof e!="function"&&({next:r,error:t,complete:n}=e);const i=r;return{next:a=>i(a&&Fn.getOrCreate(a)),error:t,complete:n}}function TS(e,t){const n=xS(e,t);if(typeof self!="undefined"&&!n.includes(Xr)&&n.push(Xr),typeof window!="undefined")for(const r of[ra,rr])n.includes(r)||n.push(r);return n.includes(Hr)||n.push(Hr),n}/**
2281
2281
  * @license
2282
2282
  * Copyright 2020 Google LLC
2283
2283
  *
@@ -2322,7 +2322,7 @@
2322
2322
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2323
2323
  * See the License for the specific language governing permissions and
2324
2324
  * limitations under the License.
2325
- */const _S="auth-compat";function PS(e){e.INTERNAL.registerComponent(new Qn(_S,t=>{const n=t.getProvider("app-compat").getImmediate(),r=t.getProvider("auth");return new Vl(n,r)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:jr.EMAIL_SIGNIN,PASSWORD_RESET:jr.PASSWORD_RESET,RECOVER_EMAIL:jr.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:jr.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:jr.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:jr.VERIFY_EMAIL}},EmailAuthProvider:nr,FacebookAuthProvider:Cn,GithubAuthProvider:Sn,GoogleAuthProvider:wn,OAuthProvider:Kr,SAMLAuthProvider:Jo,PhoneAuthProvider:Hl,PhoneMultiFactorGenerator:Mf,RecaptchaVerifier:kS,TwitterAuthProvider:In,Auth:Vl,AuthCredential:Gr,Error:Ut}).setInstantiationMode("LAZY").setMultipleInstances(!1)),e.registerVersion(cS,uS)}PS(er);let Kf=!1;const no=e=>{if(Kf)return er.auth();if(e&&e==="dev"){er.initializeApp({apiKey:"api_key"});const n=jw();yl(n,"http://localhost:39199")}else{const n={apiKey:e&&e==="staging"?"AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8":"AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",authDomain:"fans-united-clients.firebaseapp.com",projectId:"fans-united-clients",messagingSenderId:"78627953958",appId:"1:78627953958:web:2ee87d5b274e0e7685f5e7",measurementId:"G-RH90B03KJG"};er.initializeApp(n)}return Kf=!0,er.auth()},DS=e=>e==="dev"?"http://localhost:8070/v1":e==="staging"?"https://client.fansunitedstagingapi.com/v1":e==="watg"?"https://client.watg.fansunitedapi.com/v1":e==="yolo"?"https://client.yolo.fansunitedapi.com/v1":e==="cska"?"https://client.cska.fansunitedapi.com/v1":"https://client.fansunitedapi.com/v1";class OS{constructor(t,n){J(this,"apiKey","");J(this,"clientId","");J(this,"environment","");J(this,"mainQueryParams",{key:"",client_id:""});J(this,"headers",{"Content-Type":"application/json"});J(this,"clientApiBaseUrl","");J(this,"sportal365ImagesSearchURL","https://content.api.sportal365.com/v2/images/search?");J(this,"sportal365Config",null);J(this,"generateSignedInUrl",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/generate-signed-url?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(t)})}));J(this,"storeInBucket",(t,n,r)=>_(this,null,function*(){const i=yield fetch(t,{headers:r,method:"PUT",body:n});if(i.ok)return this.constructAssetsUrl(n.name);const o=yield i.text();this.throwErrorFromXmlResponse(o)}));J(this,"fetchImagesFromSportal365",(t,n,r)=>_(this,null,function*(){if(this.sportal365Config){const i={Project:this.sportal365Config.project,Authorization:this.sportal365Config.authorization};let o={query:t,page:r.toString()};return n&&(n.from&&(o=Q(B({},o),{from:n.from})),n.to&&(o=Q(B({},o),{to:n.to}))),yield fetch(this.sportal365ImagesSearchURL+new URLSearchParams(o),{headers:i})}}));J(this,"getSchedulersByEntityId",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks?`,r={key:this.apiKey,limit:"50",entity_id:t},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"setSchedulers",(t,n,r)=>_(this,null,function*(){let i="",o="";n==="CREATE"?(i=`/clients/${this.clientId}/scheduler/tasks?`,o="POST"):(i=`/clients/${this.clientId}/scheduler/tasks/${r}?`,o="PUT");const a={key:this.apiKey},l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l}),body:JSON.stringify(t),method:o})}));J(this,"deleteScheduledTask",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks/${t}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getLoggedInStaffMember",()=>_(this,null,function*(){const r=(yield this.getToken()).split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(window.atob(r).split("").map(function(o){return"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}));J(this,"constructAssetsUrl",t=>this.environment==="dev"?`https://storage.googleapis.com/client_images_cms_fans-united-dev/${this.clientId}/${t}`:this.environment==="staging"?`https://storage.googleapis.com/client_images_cms_fans-united-stage/${this.clientId}/${t}`:`https://uploads.fansunitedassets.com/${this.clientId}/${t}`);J(this,"throwErrorFromXmlResponse",t=>{const n=new window.DOMParser().parseFromString(t,"text/xml"),r=n.getElementsByTagName("Message")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Message")[0].textContent:"",i=n.getElementsByTagName("Details")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Details")[0].textContent:"";throw new Error(r+" "+i)});J(this,"getToken",()=>_(this,null,function*(){const t=no(this.environment).currentUser;return t?yield t.getIdToken():""}));this.apiKey=t.apiKey,this.clientId=t.clientId,this.environment=t.environment,this.mainQueryParams={key:t.apiKey,client_id:t.clientId},this.sportal365Config=n,this.clientApiBaseUrl=DS(this.environment)}}class RS{constructor(t){J(this,"baseUrl","https://v1.formula-1.api-sports.io");J(this,"apiKey");J(this,"headers");this.apiKey=t,this.headers={"X-RapidAPI-Key":this.apiKey,"Content-Type":"application/json"}}getRaces(t,n){return _(this,null,function*(){const r={season:t.toString(),type:(n==null?void 0:n.type)||"Race"};n&&Object.entries(n).forEach(([o,a])=>{a!=null&&(r[o]=a.toString())});const i=`${this.baseUrl}/races?${new URLSearchParams(r)}`;return yield fetch(i,{method:"GET",headers:this.headers})})}makeRequest(t,n){return _(this,null,function*(){let r=`${this.baseUrl}${t}`;return n&&Object.keys(n).length>0&&(r+=`?${new URLSearchParams(n)}`),yield fetch(r,{method:"GET",headers:this.headers})})}}const MS=e=>e==="dev"?"http://localhost:8060/v1":e==="staging"?"https://loyalty.fansunitedstagingapi.com/v1":e==="watg"?"https://loyalty.watg.fansunitedapi.com/v1":e==="yolo"?"https://loyalty.yolo.fansunitedapi.com/v1":e==="cska"?"https://loyalty.cska.fansunitedapi.com/v1":"https://loyalty.fansunitedapi.com/v1",LS=e=>e==="dev"?"http://localhost:8040/v1":e==="staging"?"https://prediction.fansunitedstagingapi.com/v1":e==="watg"?"https://prediction.watg.fansunitedapi.com/v1":e==="yolo"?"https://prediction.yolo.fansunitedapi.com/v1":e==="cska"?"https://prediction.cska.fansunitedapi.com/v1":"https://prediction.fansunitedapi.com/v1",BS=e=>e==="dev"?"http://localhost:9040/v1":e==="staging"?"https://mini-games.fansunitedstagingapi.com/v1":e==="watg"?"https://mini-games.watg.fansunitedapi.com/v1":e==="yolo"?"https://mini-games.yolo.fansunitedapi.com/v1":e==="cska"?"https://mini-games.cska.fansunitedapi.com/v1":"https://mini-games.fansunitedapi.com/v1",$S=e=>e==="dev"?"http://localhost:8020/v1":e==="staging"?"https://reporting.fansunitedstagingapi.com/v1":e==="watg"?"https://reporting.watg.fansunitedapi.com/v1":e==="yolo"?"https://reporting.yolo.fansunitedapi.com/v1":e==="cska"?"https://reporting.cska.fansunitedapi.com/v1":"https://reporting.fansunitedapi.com/v1",FS=e=>e==="dev"?"http://localhost:9030/v1":e==="staging"?"https://voting.fansunitedstagingapi.com/v1":e==="watg"?"https://voting.watg.fansunitedapi.com/v1":e==="yolo"?"https://voting.yolo.fansunitedapi.com/v1":e==="cska"?"https://voting.cska.fansunitedapi.com/v1":"https://voting.fansunitedapi.com/v1",NS=e=>e==="staging"?"https://custom-games-resolver-131809830171.europe-west1.run.app/v1":e==="watg"?"https://custom-games-resolver-1045682138584.southamerica-east1.run.app/v1":e==="yolo"?"https://custom-games-resolver-1054597592566.europe-west1.run.app/v1":e==="cska"?"https://custom-games-resolver-414330847655.europe-west1.run.app/v1":"https://custom-games-resolver-150199313674.europe-west1.run.app/v1",zS=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://profile.fansunitedstagingapi.com/v1":e==="watg"?"https://profile.watg.fansunitedapi.com/v1":e==="yolo"?"https://profile.yolo.fansunitedapi.com/v1":e==="cska"?"https://profile.cska.fansunitedapi.com/v1":"https://profile.fansunitedapi.com/v1",jS=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://discussions.fansunitedstagingapi.com/v1":e==="watg"?"https://discussions.watg.fansunitedapi.com/v1":e==="yolo"?"https://discussions.yolo.fansunitedapi.com/v1":e==="cska"?"https://discussions.cska.fansunitedapi.com/v1":"https://discussions.fansunitedapi.com/v1",US=e=>e==="dev"?"http://localhost:9050/v1":e==="staging"?"https://ai-content-builder-131809830171.europe-west1.run.app/v1":e==="yolo"||e==="cska"?"":"https://ai-content-builder-150199313674.europe-west1.run.app/v1";class VS extends OS{constructor(n,r){super(n,r);J(this,"loyaltyBaseUrl","");J(this,"predictionBaseUrl","");J(this,"miniGamesApiBaseUrl","");J(this,"reportingApiBaseUrl","");J(this,"votingApiBaseUrl","");J(this,"profileApiBaseUrl","");J(this,"customResolverUrl","");J(this,"discussionsApiBaseUrl","");J(this,"aiServiceBaseUrl","");J(this,"apiSports");J(this,"getClientById",()=>_(this,null,function*(){const n=`/clients/${this.clientId}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"createTemplate",n=>_(this,null,function*(){const r="/leaderboard/templates?",i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"editTemplate",(n,r)=>_(this,null,function*(){const i=`/leaderboard/templates/${n}?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteTemplate",n=>_(this,null,function*(){const r=`/leaderboard/templates/${n}?`,i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"setWinners",n=>_(this,null,function*(){const r="/winners?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"exportDetailedLeaderboard",(n,r,i)=>_(this,null,function*(){const o=`/leaderboard/${n}/detailed?`,a=yield this.getToken(),l=B({},this.mainQueryParams);return r&&(l.group_id=r),yield fetch(this.loyaltyBaseUrl+o+new URLSearchParams(Q(B({},l),{limit:i.toString()})),{headers:Q(B({},this.headers),{Authorization:"Bearer "+a})})}));J(this,"exportDetailedGameLeaderboard",(n,r)=>_(this,null,function*(){const i=`/leaderboard/games/${n}/detailed?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(Q(B({},this.mainQueryParams),{limit:r.toString()})),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"createGame",n=>_(this,null,function*(){const r="/games?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"editGame",(n,r)=>_(this,null,function*(){const i=`/games/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));J(this,"getEntityFeature",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o={key:this.apiKey};return r&&(o.disable_cache=Date.now().toString()),yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o))}));J(this,"getClientFeatures",(n,r=1)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features?`,o={key:this.apiKey};n&&(o.disable_cache=Date.now().toString());const a=Q(B({},this.headers),{"x-api-version":r.toString()});return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o),{headers:a})}));J(this,"updateEntityFeatures",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams({key:this.apiKey}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));J(this,"getClassicQuizFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/classic_quiz?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"getEitherOrFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/either_or?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"getPollFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/poll?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"createClassicQuiz",n=>_(this,null,function*(){const r="/classic-quizzes?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateClassicQuiz",(n,r)=>_(this,null,function*(){const i=`/classic-quizzes/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"getClassicQuizById",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}/staff?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"deleteClassicQuiz",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"calculateQuestionsReport",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}/questions-report?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST"})}));J(this,"exportUsers",n=>_(this,null,function*(){const r="/exports/users?",i=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"getClassicQuizParticipations",(n,r,i,o)=>_(this,null,function*(){const a="/classic-quizzes/participations?",l=Q(B({},this.mainQueryParams),{classic_quiz_ids:n,from_date:r,to_date:i,group_by:o}),c=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+a+new URLSearchParams(l),{headers:Q(B({},this.headers),{Authorization:"Bearer "+c})})}));J(this,"getEntityParticipations",(n,r,i)=>_(this,null,function*(){const o=`/participations/${n}/breakdown?`,a=Q(B({},this.mainQueryParams),{from_date:r,to_date:i}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createPoll",n=>_(this,null,function*(){const r="/polls?",i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updatePoll",(n,r)=>_(this,null,function*(){const i=`/polls/${n}?`,o=yield this.getToken();return yield fetch(this.votingApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deletePoll",n=>_(this,null,function*(){const r=`/polls/${n}?`,i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getEitherOrById",(n,r)=>_(this,null,function*(){const i=`/either-or/${n}/staff?`,o=yield this.getToken();let a=null;return r&&(a=Q(B({},this.mainQueryParams),{client_id:r})),yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(a||this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getEitherOrByIdReadOnlyClient",(n,r,i)=>_(this,null,function*(){const o="https://mini-games.fansunitedapi.com/v1",a=`/either-or/${n}/staff?`,l=yield this.getToken(),c={key:r,client_id:i};return yield fetch(o+a+new URLSearchParams(c),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createEitherOr",n=>_(this,null,function*(){const r="/either-or?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateEitherOr",(n,r)=>_(this,null,function*(){const i=`/either-or/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteEitherOr",n=>_(this,null,function*(){const r=`/either-or/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getLists",(n,r,i="DESC")=>_(this,null,function*(){const o=`/clients/${this.clientId}/lists?`,a={key:this.apiKey,limit:n.toString(),sort_order:i};r&&(a.start_after=r);const l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+o+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"getListById",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getListContent",(n,r,i="DESC",o)=>_(this,null,function*(){const a=`/clients/${this.clientId}/lists/${n}/content?`,l={key:this.apiKey,limit:r.toString(),sort_order:i};o&&(l.page=o.toString());const c=yield this.getToken();return yield fetch(this.clientApiBaseUrl+a+new URLSearchParams(l),{headers:Q(B({},this.headers),{Authorization:"Bearer "+c})})}));J(this,"createList",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateList",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/lists/${n}?`,o={key:this.apiKey},a=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o),{headers:Q(B({},this.headers),{Authorization:"Bearer "+a}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteList",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));J(this,"getLanguageConfig",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/config/language?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateLanguageConfig",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/config/language?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(n)})}));J(this,"createBracketGame",n=>_(this,null,function*(){const r="/custom/bracket?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateBracketGame",(n,r)=>_(this,null,function*(){const i=`/custom/bracket/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolvePredictions",n=>_(this,null,function*(){const r="/custom/bracket/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));J(this,"exportLeadsPerEntity",n=>_(this,null,function*(){const r="/leads/export?",i=Q(B({},this.mainQueryParams),{content_id:n}),o=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getLeadStatistics",n=>_(this,null,function*(){const r="/leads/statistics?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(B(B({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"exportLeads",n=>_(this,null,function*(){const r="/leads/export?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(B(B({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"createStandingGame",n=>_(this,null,function*(){const r="/custom/standing?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateStandingGame",(n,r)=>_(this,null,function*(){const i=`/custom/standing/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolveStandingPredictions",n=>_(this,null,function*(){const r="/custom/standing/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));J(this,"moderateUserPosts",(n,r)=>_(this,null,function*(){const i="/moderation/bulk?",o=yield this.getToken(),a=Q(B({},this.mainQueryParams),{user_id:n,reason:r});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"POST"})}));J(this,"getUserBanStatus",n=>_(this,null,function*(){const r=`/discussions/users/${n}/ban?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"banUser",(n,r,i)=>_(this,null,function*(){const o=`/discussions/users/${n}/ban?`,a=yield this.getToken(),l={banned_period_in_days:r,banned_reason:i};return yield fetch(this.discussionsApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(l)})}));J(this,"unbanUser",(n,r)=>_(this,null,function*(){const i=`/discussions/users/${n}/ban?`,o=yield this.getToken(),a={unban_reason:r};return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE",body:JSON.stringify(a)})}));J(this,"updateUser",(n,r,i)=>_(this,null,function*(){const o=`/profiles/${n}/verify?`,a=yield this.getToken(),l=r==="verify"?{verified:i}:{staff_member:i};return yield fetch(this.profileApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(l)})}));J(this,"deleteUserProfile",n=>_(this,null,function*(){const r=`/profiles/${n}?`,i=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"createDiscussion",n=>_(this,null,function*(){const r="/discussions?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"deleteDiscussion",n=>_(this,null,function*(){const r=`/discussions/${n}?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"moderatePosts",(...o)=>_(this,[...o],function*(n="",r=[],i){const a="/moderation/bulk?",l=yield this.getToken();let c={};if(r.length>0){const u=r.join(",");c=Q(B({},this.mainQueryParams),{post_ids:u,reason:i})}else c=Q(B({},this.mainQueryParams),{discussion_id:n,reason:i});return yield fetch(this.discussionsApiBaseUrl+a+new URLSearchParams(c),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l}),method:"POST"})}));J(this,"pinDiscussionPosts",(n,r)=>_(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(B({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH"})}));J(this,"unpinDiscussionPosts",(n,r)=>_(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(B({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));J(this,"getPostsByStaffMember",n=>_(this,null,function*(){const r="/posts/staff?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(B(B({},this.mainQueryParams),n)),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"getReportedPosts",n=>_(this,null,function*(){const r="/posts/staff/reported?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(B(B({},this.mainQueryParams),n)),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateDiscussionsFeature",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/discussions?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));J(this,"updateProfilePreferences",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/profile_preferences?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));J(this,"getClientBadges",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/loyalty/badges?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateClientBadges",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/loyalty/badges?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"PUT",body:JSON.stringify(n)})}));J(this,"getEngagementThroughPredictionsReport",(n,r,i)=>_(this,null,function*(){const o="/predictions/football/engagements?",a=Q(B({},this.mainQueryParams),{from_date:r,to_date:i,type:n}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createPersonalityQuiz",n=>_(this,null,function*(){const r="/personality-quizzes?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updatePersonalityQuiz",(n,r)=>_(this,null,function*(){const i=`/personality-quizzes/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deletePersonalityQuiz",n=>_(this,null,function*(){const r=`/personality-quizzes/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"generatePostMatchQuiz",n=>_(this,null,function*(){const r="/classic-quizzes/post-match?",i={client_id:this.clientId,sport_type:n.sportType,lang:n.lang,event_id:n.eventId},o=yield this.getToken();return yield fetch(this.aiServiceBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"generatePostMatchPoll",n=>_(this,null,function*(){const r="/polls/post-match?",i={client_id:this.clientId,lang:n.lang,event_id:n.eventId};n.targetParticipant&&(i.target_participant=n.targetParticipant);const o=yield this.getToken();return yield fetch(this.aiServiceBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"createEventGame",n=>_(this,null,function*(){const r="/custom/event?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateEventGame",(n,r)=>_(this,null,function*(){const i=`/custom/event/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolveEventGamePredictions",n=>_(this,null,function*(){const r="/custom/event/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));this.loyaltyBaseUrl=MS(n.environment),this.predictionBaseUrl=LS(n.environment),this.miniGamesApiBaseUrl=BS(n.environment),this.reportingApiBaseUrl=$S(n.environment),this.votingApiBaseUrl=FS(n.environment),this.profileApiBaseUrl=zS(n.environment),this.customResolverUrl=NS(n.environment),this.discussionsApiBaseUrl=jS(n.environment),this.aiServiceBaseUrl=US(n.environment);const i="";this.apiSports=new RS(i)}}const HS=(e,t)=>!e&&!t?null:!e&&t?(console.warn("'sportal365Project' prop is not provided. The prop is required when 'sportal365Infrastructure' prop is provided. Functionalities with Sportal365 API will not be exposed"),null):{project:e,authorization:`Bearer ${t&&t==="betway"?"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K":"dEZS1V21veHBIDIik8Y33dDkZAoCmxgge5MBnAORN7IKbltA79giTZLaXJ6OVgQkGnYxwtyRv8ObRSvY"}`},fa=y.createContext(null),WS=({config:e,children:t})=>{const n={apiKey:e.apiKey,clientId:e.clientId,environment:e.environment,lang:e.language,errorHandlingMode:e.errorHandlingMode,authProvider:{getIdToken:()=>"",logout:()=>{}}},r=HS(e.sportal365Project,e.sportal365Infrastructure),i=He.FansUnitedSDK(n),o=new VS(n,r);return s.jsx(fa.Provider,{value:{sdk:i,https:o},children:t})},qf=y.createContext(null),GS=({children:e,environment:t})=>{const[n,r]=y.useState(null),[i,o]=y.useState(!0);return y.useEffect(()=>no(t).onAuthStateChanged(l=>{yt.unstable_batchedUpdates(()=>{o(!1),r(l)})}),[t]),s.jsx(qf.Provider,{value:n,children:!i&&e})};function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(null,arguments)}function De(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var Qf={exports:{}},YS="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",KS=YS,qS=KS;function Jf(){}function Xf(){}Xf.resetWarningCache=Jf;var QS=function(){function e(r,i,o,a,l,c){if(c!==qS){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Xf,resetWarningCache:Jf};return n.PropTypes=n,n};Qf.exports=QS();var JS=Qf.exports;function XS(e){return typeof e=="string"}function ZS(e,t,n){return e===void 0||XS(e)?t:R({},t,{ownerState:R({},t.ownerState,n)})}function Zf(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}function Nn(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function eI(e,t,n){return typeof e=="function"?e(t,n):e}function tI(e){const{rootElementName:t="",componentName:n}=e,[r,i]=K.useState(t.toUpperCase()),o=K.useCallback(a=>{var l;i((l=a==null?void 0:a.tagName)!=null?l:"")},[]);return[r,o]}function nI(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function hn(...e){return K.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{nI(n,t)})},e)}function eh(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=eh(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zn(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=eh(e))&&(r&&(r+=" "),r+=t);return r}function th(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function rI(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const g=zn(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),v=R({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),m=R({},n,i,r);return g.length>0&&(m.className=g),Object.keys(v).length>0&&(m.style=v),{props:m,internalRef:void 0}}const a=Nn(R({},i,r)),l=th(r),c=th(i),u=t(a),f=zn(u==null?void 0:u.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d=R({},u==null?void 0:u.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),p=R({},u,n,c,l);return f.length>0&&(p.className=f),Object.keys(d).length>0&&(p.style=d),{props:p,internalRef:u.ref}}function or(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nh(e){if(K.isValidElement(e)||!or(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=nh(e[n])}),t}function jn(e,t,n={clone:!0}){const r=n.clone?R({},e):e;return or(e)&&or(t)&&Object.keys(t).forEach(i=>{K.isValidElement(t[i])?r[i]=t[i]:or(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&or(e[i])?r[i]=jn(e[i],t[i],n):n.clone?r[i]=or(t[i])?nh(t[i]):t[i]:r[i]=t[i]}),r}function ha(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var rh={exports:{}},je={};/**
2325
+ */const _S="auth-compat";function PS(e){e.INTERNAL.registerComponent(new Qn(_S,t=>{const n=t.getProvider("app-compat").getImmediate(),r=t.getProvider("auth");return new Vl(n,r)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:jr.EMAIL_SIGNIN,PASSWORD_RESET:jr.PASSWORD_RESET,RECOVER_EMAIL:jr.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:jr.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:jr.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:jr.VERIFY_EMAIL}},EmailAuthProvider:nr,FacebookAuthProvider:Cn,GithubAuthProvider:Sn,GoogleAuthProvider:wn,OAuthProvider:Kr,SAMLAuthProvider:Jo,PhoneAuthProvider:Hl,PhoneMultiFactorGenerator:Mf,RecaptchaVerifier:kS,TwitterAuthProvider:In,Auth:Vl,AuthCredential:Gr,Error:jt}).setInstantiationMode("LAZY").setMultipleInstances(!1)),e.registerVersion(cS,uS)}PS(er);let Kf=!1;const no=e=>{if(Kf)return er.auth();if(e&&e==="dev"){er.initializeApp({apiKey:"api_key"});const n=jw();yl(n,"http://localhost:39199")}else{const n={apiKey:e&&e==="staging"?"AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8":"AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",authDomain:"fans-united-clients.firebaseapp.com",projectId:"fans-united-clients",messagingSenderId:"78627953958",appId:"1:78627953958:web:2ee87d5b274e0e7685f5e7",measurementId:"G-RH90B03KJG"};er.initializeApp(n)}return Kf=!0,er.auth()},DS=e=>e==="dev"?"http://localhost:8070/v1":e==="staging"?"https://client.fansunitedstagingapi.com/v1":e==="watg"?"https://client.watg.fansunitedapi.com/v1":e==="yolo"?"https://client.yolo.fansunitedapi.com/v1":e==="cska"?"https://client.cska.fansunitedapi.com/v1":"https://client.fansunitedapi.com/v1";class OS{constructor(t,n){J(this,"apiKey","");J(this,"clientId","");J(this,"environment","");J(this,"mainQueryParams",{key:"",client_id:""});J(this,"headers",{"Content-Type":"application/json"});J(this,"clientApiBaseUrl","");J(this,"sportal365ImagesSearchURL","https://content.api.sportal365.com/v2/images/search?");J(this,"sportal365Config",null);J(this,"generateSignedInUrl",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/generate-signed-url?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(t)})}));J(this,"storeInBucket",(t,n,r)=>_(this,null,function*(){const i=yield fetch(t,{headers:r,method:"PUT",body:n});if(i.ok)return this.constructAssetsUrl(n.name);const o=yield i.text();this.throwErrorFromXmlResponse(o)}));J(this,"fetchImagesFromSportal365",(t,n,r)=>_(this,null,function*(){if(this.sportal365Config){const i={Project:this.sportal365Config.project,Authorization:this.sportal365Config.authorization};let o={query:t,page:r.toString()};return n&&(n.from&&(o=Q(B({},o),{from:n.from})),n.to&&(o=Q(B({},o),{to:n.to}))),yield fetch(this.sportal365ImagesSearchURL+new URLSearchParams(o),{headers:i})}}));J(this,"getSchedulersByEntityId",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks?`,r={key:this.apiKey,limit:"50",entity_id:t},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"setSchedulers",(t,n,r)=>_(this,null,function*(){let i="",o="";n==="CREATE"?(i=`/clients/${this.clientId}/scheduler/tasks?`,o="POST"):(i=`/clients/${this.clientId}/scheduler/tasks/${r}?`,o="PUT");const a={key:this.apiKey},l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l}),body:JSON.stringify(t),method:o})}));J(this,"deleteScheduledTask",t=>_(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks/${t}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getLoggedInStaffMember",()=>_(this,null,function*(){const r=(yield this.getToken()).split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(window.atob(r).split("").map(function(o){return"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}));J(this,"constructAssetsUrl",t=>this.environment==="dev"?`https://storage.googleapis.com/client_images_cms_fans-united-dev/${this.clientId}/${t}`:this.environment==="staging"?`https://storage.googleapis.com/client_images_cms_fans-united-stage/${this.clientId}/${t}`:`https://uploads.fansunitedassets.com/${this.clientId}/${t}`);J(this,"throwErrorFromXmlResponse",t=>{const n=new window.DOMParser().parseFromString(t,"text/xml"),r=n.getElementsByTagName("Message")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Message")[0].textContent:"",i=n.getElementsByTagName("Details")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Details")[0].textContent:"";throw new Error(r+" "+i)});J(this,"getToken",()=>_(this,null,function*(){const t=no(this.environment).currentUser;return t?yield t.getIdToken():""}));this.apiKey=t.apiKey,this.clientId=t.clientId,this.environment=t.environment,this.mainQueryParams={key:t.apiKey,client_id:t.clientId},this.sportal365Config=n,this.clientApiBaseUrl=DS(this.environment)}}class RS{constructor(t){J(this,"baseUrl","https://v1.formula-1.api-sports.io");J(this,"apiKey");J(this,"headers");this.apiKey=t,this.headers={"X-RapidAPI-Key":this.apiKey,"Content-Type":"application/json"}}getRaces(t,n){return _(this,null,function*(){const r={season:t.toString(),type:(n==null?void 0:n.type)||"Race"};n&&Object.entries(n).forEach(([o,a])=>{a!=null&&(r[o]=a.toString())});const i=`${this.baseUrl}/races?${new URLSearchParams(r)}`;return yield fetch(i,{method:"GET",headers:this.headers})})}makeRequest(t,n){return _(this,null,function*(){let r=`${this.baseUrl}${t}`;return n&&Object.keys(n).length>0&&(r+=`?${new URLSearchParams(n)}`),yield fetch(r,{method:"GET",headers:this.headers})})}}const MS=e=>e==="dev"?"http://localhost:8060/v1":e==="staging"?"https://loyalty.fansunitedstagingapi.com/v1":e==="watg"?"https://loyalty.watg.fansunitedapi.com/v1":e==="yolo"?"https://loyalty.yolo.fansunitedapi.com/v1":e==="cska"?"https://loyalty.cska.fansunitedapi.com/v1":"https://loyalty.fansunitedapi.com/v1",LS=e=>e==="dev"?"http://localhost:8040/v1":e==="staging"?"https://prediction.fansunitedstagingapi.com/v1":e==="watg"?"https://prediction.watg.fansunitedapi.com/v1":e==="yolo"?"https://prediction.yolo.fansunitedapi.com/v1":e==="cska"?"https://prediction.cska.fansunitedapi.com/v1":"https://prediction.fansunitedapi.com/v1",BS=e=>e==="dev"?"http://localhost:9040/v1":e==="staging"?"https://mini-games.fansunitedstagingapi.com/v1":e==="watg"?"https://mini-games.watg.fansunitedapi.com/v1":e==="yolo"?"https://mini-games.yolo.fansunitedapi.com/v1":e==="cska"?"https://mini-games.cska.fansunitedapi.com/v1":"https://mini-games.fansunitedapi.com/v1",$S=e=>e==="dev"?"http://localhost:8020/v1":e==="staging"?"https://reporting.fansunitedstagingapi.com/v1":e==="watg"?"https://reporting.watg.fansunitedapi.com/v1":e==="yolo"?"https://reporting.yolo.fansunitedapi.com/v1":e==="cska"?"https://reporting.cska.fansunitedapi.com/v1":"https://reporting.fansunitedapi.com/v1",FS=e=>e==="dev"?"http://localhost:9030/v1":e==="staging"?"https://voting.fansunitedstagingapi.com/v1":e==="watg"?"https://voting.watg.fansunitedapi.com/v1":e==="yolo"?"https://voting.yolo.fansunitedapi.com/v1":e==="cska"?"https://voting.cska.fansunitedapi.com/v1":"https://voting.fansunitedapi.com/v1",NS=e=>e==="staging"?"https://custom-games-resolver-131809830171.europe-west1.run.app/v1":e==="watg"?"https://custom-games-resolver-1045682138584.southamerica-east1.run.app/v1":e==="yolo"?"https://custom-games-resolver-1054597592566.europe-west1.run.app/v1":e==="cska"?"https://custom-games-resolver-414330847655.europe-west1.run.app/v1":"https://custom-games-resolver-150199313674.europe-west1.run.app/v1",zS=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://profile.fansunitedstagingapi.com/v1":e==="watg"?"https://profile.watg.fansunitedapi.com/v1":e==="yolo"?"https://profile.yolo.fansunitedapi.com/v1":e==="cska"?"https://profile.cska.fansunitedapi.com/v1":"https://profile.fansunitedapi.com/v1",jS=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://discussions.fansunitedstagingapi.com/v1":e==="watg"?"https://discussions.watg.fansunitedapi.com/v1":e==="yolo"?"https://discussions.yolo.fansunitedapi.com/v1":e==="cska"?"https://discussions.cska.fansunitedapi.com/v1":"https://discussions.fansunitedapi.com/v1",US=e=>e==="dev"?"http://localhost:9050/v1":e==="staging"?"https://ai-content-builder-131809830171.europe-west1.run.app/v1":e==="yolo"||e==="cska"?"":"https://ai-content-builder-150199313674.europe-west1.run.app/v1";class VS extends OS{constructor(n,r){super(n,r);J(this,"loyaltyBaseUrl","");J(this,"predictionBaseUrl","");J(this,"miniGamesApiBaseUrl","");J(this,"reportingApiBaseUrl","");J(this,"votingApiBaseUrl","");J(this,"profileApiBaseUrl","");J(this,"customResolverUrl","");J(this,"discussionsApiBaseUrl","");J(this,"aiServiceBaseUrl","");J(this,"apiSports");J(this,"getClientById",()=>_(this,null,function*(){const n=`/clients/${this.clientId}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"createTemplate",n=>_(this,null,function*(){const r="/leaderboard/templates?",i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"editTemplate",(n,r)=>_(this,null,function*(){const i=`/leaderboard/templates/${n}?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteTemplate",n=>_(this,null,function*(){const r=`/leaderboard/templates/${n}?`,i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"setWinners",n=>_(this,null,function*(){const r="/winners?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"exportDetailedLeaderboard",(n,r,i)=>_(this,null,function*(){const o=`/leaderboard/${n}/detailed?`,a=yield this.getToken(),l=B({},this.mainQueryParams);return r&&(l.group_id=r),yield fetch(this.loyaltyBaseUrl+o+new URLSearchParams(Q(B({},l),{limit:i.toString()})),{headers:Q(B({},this.headers),{Authorization:"Bearer "+a})})}));J(this,"exportDetailedGameLeaderboard",(n,r)=>_(this,null,function*(){const i=`/leaderboard/games/${n}/detailed?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(Q(B({},this.mainQueryParams),{limit:r.toString()})),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"createGame",n=>_(this,null,function*(){const r="/games?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"editGame",(n,r)=>_(this,null,function*(){const i=`/games/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));J(this,"getEntityFeature",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o={key:this.apiKey};return r&&(o.disable_cache=Date.now().toString()),yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o))}));J(this,"getClientFeatures",(n,r=1)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features?`,o={key:this.apiKey};n&&(o.disable_cache=Date.now().toString());const a=Q(B({},this.headers),{"x-api-version":r.toString()});return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o),{headers:a})}));J(this,"updateEntityFeatures",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams({key:this.apiKey}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));J(this,"getClassicQuizFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/classic_quiz?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"getEitherOrFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/either_or?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"getPollFeature",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/poll?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));J(this,"createClassicQuiz",n=>_(this,null,function*(){const r="/classic-quizzes?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateClassicQuiz",(n,r)=>_(this,null,function*(){const i=`/classic-quizzes/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"getClassicQuizById",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}/staff?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"deleteClassicQuiz",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"calculateQuestionsReport",n=>_(this,null,function*(){const r=`/classic-quizzes/${n}/questions-report?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST"})}));J(this,"exportUsers",n=>_(this,null,function*(){const r="/exports/users?",i=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"getClassicQuizParticipations",(n,r,i,o)=>_(this,null,function*(){const a="/classic-quizzes/participations?",l=Q(B({},this.mainQueryParams),{classic_quiz_ids:n,from_date:r,to_date:i,group_by:o}),c=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+a+new URLSearchParams(l),{headers:Q(B({},this.headers),{Authorization:"Bearer "+c})})}));J(this,"getEntityParticipations",(n,r,i)=>_(this,null,function*(){const o=`/participations/${n}/breakdown?`,a=Q(B({},this.mainQueryParams),{from_date:r,to_date:i}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createPoll",n=>_(this,null,function*(){const r="/polls?",i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updatePoll",(n,r)=>_(this,null,function*(){const i=`/polls/${n}?`,o=yield this.getToken();return yield fetch(this.votingApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deletePoll",n=>_(this,null,function*(){const r=`/polls/${n}?`,i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getEitherOrById",(n,r)=>_(this,null,function*(){const i=`/either-or/${n}/staff?`,o=yield this.getToken();let a=null;return r&&(a=Q(B({},this.mainQueryParams),{client_id:r})),yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(a||this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getEitherOrByIdReadOnlyClient",(n,r,i)=>_(this,null,function*(){const o="https://mini-games.fansunitedapi.com/v1",a=`/either-or/${n}/staff?`,l=yield this.getToken(),c={key:r,client_id:i};return yield fetch(o+a+new URLSearchParams(c),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createEitherOr",n=>_(this,null,function*(){const r="/either-or?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateEitherOr",(n,r)=>_(this,null,function*(){const i=`/either-or/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteEitherOr",n=>_(this,null,function*(){const r=`/either-or/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"getLists",(n,r,i="DESC")=>_(this,null,function*(){const o=`/clients/${this.clientId}/lists?`,a={key:this.apiKey,limit:n.toString(),sort_order:i};r&&(a.start_after=r);const l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+o+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"getListById",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getListContent",(n,r,i="DESC",o)=>_(this,null,function*(){const a=`/clients/${this.clientId}/lists/${n}/content?`,l={key:this.apiKey,limit:r.toString(),sort_order:i};o&&(l.page=o.toString());const c=yield this.getToken();return yield fetch(this.clientApiBaseUrl+a+new URLSearchParams(l),{headers:Q(B({},this.headers),{Authorization:"Bearer "+c})})}));J(this,"createList",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateList",(n,r)=>_(this,null,function*(){const i=`/clients/${this.clientId}/lists/${n}?`,o={key:this.apiKey},a=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o),{headers:Q(B({},this.headers),{Authorization:"Bearer "+a}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deleteList",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));J(this,"getLanguageConfig",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/config/language?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateLanguageConfig",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/config/language?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(n)})}));J(this,"createBracketGame",n=>_(this,null,function*(){const r="/custom/bracket?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateBracketGame",(n,r)=>_(this,null,function*(){const i=`/custom/bracket/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolvePredictions",n=>_(this,null,function*(){const r="/custom/bracket/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));J(this,"exportLeadsPerEntity",n=>_(this,null,function*(){const r="/leads/export?",i=Q(B({},this.mainQueryParams),{content_id:n}),o=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"getLeadStatistics",n=>_(this,null,function*(){const r="/leads/statistics?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(B(B({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"exportLeads",n=>_(this,null,function*(){const r="/leads/export?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(B(B({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"createStandingGame",n=>_(this,null,function*(){const r="/custom/standing?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateStandingGame",(n,r)=>_(this,null,function*(){const i=`/custom/standing/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolveStandingPredictions",n=>_(this,null,function*(){const r="/custom/standing/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));J(this,"moderateUserPosts",(n,r)=>_(this,null,function*(){const i="/moderation/bulk?",o=yield this.getToken(),a=Q(B({},this.mainQueryParams),{user_id:n,reason:r});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"POST"})}));J(this,"getUserBanStatus",n=>_(this,null,function*(){const r=`/discussions/users/${n}/ban?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"banUser",(n,r,i)=>_(this,null,function*(){const o=`/discussions/users/${n}/ban?`,a=yield this.getToken(),l={banned_period_in_days:r,banned_reason:i};return yield fetch(this.discussionsApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(l)})}));J(this,"unbanUser",(n,r)=>_(this,null,function*(){const i=`/discussions/users/${n}/ban?`,o=yield this.getToken(),a={unban_reason:r};return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE",body:JSON.stringify(a)})}));J(this,"updateUser",(n,r,i)=>_(this,null,function*(){const o=`/profiles/${n}/verify?`,a=yield this.getToken(),l=r==="verify"?{verified:i}:{staff_member:i};return yield fetch(this.profileApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(l)})}));J(this,"deleteUserProfile",n=>_(this,null,function*(){const r=`/profiles/${n}?`,i=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"createDiscussion",n=>_(this,null,function*(){const r="/discussions?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"deleteDiscussion",n=>_(this,null,function*(){const r=`/discussions/${n}?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"moderatePosts",(...o)=>_(this,[...o],function*(n="",r=[],i){const a="/moderation/bulk?",l=yield this.getToken();let c={};if(r.length>0){const u=r.join(",");c=Q(B({},this.mainQueryParams),{post_ids:u,reason:i})}else c=Q(B({},this.mainQueryParams),{discussion_id:n,reason:i});return yield fetch(this.discussionsApiBaseUrl+a+new URLSearchParams(c),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l}),method:"POST"})}));J(this,"pinDiscussionPosts",(n,r)=>_(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(B({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH"})}));J(this,"unpinDiscussionPosts",(n,r)=>_(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(B({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));J(this,"getPostsByStaffMember",n=>_(this,null,function*(){const r="/posts/staff?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(B(B({},this.mainQueryParams),n)),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"getReportedPosts",n=>_(this,null,function*(){const r="/posts/staff/reported?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(B(B({},this.mainQueryParams),n)),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateDiscussionsFeature",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/discussions?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));J(this,"updateProfilePreferences",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/profile_preferences?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));J(this,"getClientBadges",()=>_(this,null,function*(){const n=`/clients/${this.clientId}/features/loyalty/badges?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i})})}));J(this,"updateClientBadges",n=>_(this,null,function*(){const r=`/clients/${this.clientId}/features/loyalty/badges?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"PUT",body:JSON.stringify(n)})}));J(this,"getEngagementThroughPredictionsReport",(n,r,i)=>_(this,null,function*(){const o="/predictions/football/engagements?",a=Q(B({},this.mainQueryParams),{from_date:r,to_date:i,type:n}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(B({},this.headers),{Authorization:"Bearer "+l})})}));J(this,"createPersonalityQuiz",n=>_(this,null,function*(){const r="/personality-quizzes?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updatePersonalityQuiz",(n,r)=>_(this,null,function*(){const i=`/personality-quizzes/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"deletePersonalityQuiz",n=>_(this,null,function*(){const r=`/personality-quizzes/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));J(this,"generatePostMatchQuiz",n=>_(this,null,function*(){const r="/classic-quizzes/post-match?",i={client_id:this.clientId,sport_type:n.sportType,lang:n.lang,event_id:n.eventId},o=yield this.getToken();return yield fetch(this.aiServiceBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"generatePostMatchPoll",n=>_(this,null,function*(){const r="/polls/post-match?",i={client_id:this.clientId,lang:n.lang,event_id:n.eventId};n.targetParticipant&&(i.target_participant=n.targetParticipant);const o=yield this.getToken();return yield fetch(this.aiServiceBaseUrl+r+new URLSearchParams(i),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o})})}));J(this,"createEventGame",n=>_(this,null,function*(){const r="/custom/event?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));J(this,"updateEventGame",(n,r)=>_(this,null,function*(){const i=`/custom/event/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));J(this,"resolveEventGamePredictions",n=>_(this,null,function*(){const r="/custom/event/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(B({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));this.loyaltyBaseUrl=MS(n.environment),this.predictionBaseUrl=LS(n.environment),this.miniGamesApiBaseUrl=BS(n.environment),this.reportingApiBaseUrl=$S(n.environment),this.votingApiBaseUrl=FS(n.environment),this.profileApiBaseUrl=zS(n.environment),this.customResolverUrl=NS(n.environment),this.discussionsApiBaseUrl=jS(n.environment),this.aiServiceBaseUrl=US(n.environment);const i="";this.apiSports=new RS(i)}}const HS=(e,t)=>!e&&!t?null:!e&&t?(console.warn("'sportal365Project' prop is not provided. The prop is required when 'sportal365Infrastructure' prop is provided. Functionalities with Sportal365 API will not be exposed"),null):{project:e,authorization:`Bearer ${t&&t==="betway"?"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K":"dEZS1V21veHBIDIik8Y33dDkZAoCmxgge5MBnAORN7IKbltA79giTZLaXJ6OVgQkGnYxwtyRv8ObRSvY"}`},fa=y.createContext(null),WS=({config:e,children:t})=>{const n={apiKey:e.apiKey,clientId:e.clientId,environment:e.environment,lang:e.language,errorHandlingMode:e.errorHandlingMode,authProvider:{getIdToken:()=>"",logout:()=>{}}},r=HS(e.sportal365Project,e.sportal365Infrastructure),i=He.FansUnitedSDK(n),o=new VS(n,r);return s.jsx(fa.Provider,{value:{sdk:i,https:o},children:t})},qf=y.createContext(null),GS=({children:e,environment:t})=>{const[n,r]=y.useState(null),[i,o]=y.useState(!0);return y.useEffect(()=>no(t).onAuthStateChanged(l=>{yt.unstable_batchedUpdates(()=>{o(!1),r(l)})}),[t]),s.jsx(qf.Provider,{value:n,children:!i&&e})};function R(){return R=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(null,arguments)}function De(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var Qf={exports:{}},YS="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",KS=YS,qS=KS;function Jf(){}function Xf(){}Xf.resetWarningCache=Jf;var QS=function(){function e(r,i,o,a,l,c){if(c!==qS){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Xf,resetWarningCache:Jf};return n.PropTypes=n,n};Qf.exports=QS();var JS=Qf.exports;function XS(e){return typeof e=="string"}function ZS(e,t,n){return e===void 0||XS(e)?t:R({},t,{ownerState:R({},t.ownerState,n)})}function Zf(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}function Nn(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function eI(e,t,n){return typeof e=="function"?e(t,n):e}function tI(e){const{rootElementName:t="",componentName:n}=e,[r,i]=K.useState(t.toUpperCase()),o=K.useCallback(a=>{var l;i((l=a==null?void 0:a.tagName)!=null?l:"")},[]);return[r,o]}function nI(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function hn(...e){return K.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{nI(n,t)})},e)}function eh(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=eh(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zn(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=eh(e))&&(r&&(r+=" "),r+=t);return r}function th(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function rI(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const g=zn(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),v=R({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),m=R({},n,i,r);return g.length>0&&(m.className=g),Object.keys(v).length>0&&(m.style=v),{props:m,internalRef:void 0}}const a=Nn(R({},i,r)),l=th(r),c=th(i),u=t(a),f=zn(u==null?void 0:u.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),d=R({},u==null?void 0:u.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),p=R({},u,n,c,l);return f.length>0&&(p.className=f),Object.keys(d).length>0&&(p.style=d),{props:p,internalRef:u.ref}}function or(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function nh(e){if(K.isValidElement(e)||!or(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=nh(e[n])}),t}function jn(e,t,n={clone:!0}){const r=n.clone?R({},e):e;return or(e)&&or(t)&&Object.keys(t).forEach(i=>{K.isValidElement(t[i])?r[i]=t[i]:or(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&or(e[i])?r[i]=jn(e[i],t[i],n):n.clone?r[i]=or(t[i])?nh(t[i]):t[i]:r[i]=t[i]}),r}function ha(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var rh={exports:{}},je={};/**
2326
2326
  * @license React
2327
2327
  * react-is.production.js
2328
2328
  *
@@ -2347,7 +2347,7 @@ export default theme;`}function Fc(e={},...t){const g=e,{breakpoints:n,mixins:r=
2347
2347
  To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function t_(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const An=e=>{try{return e()}catch(t){}},n_=(e="mui")=>Ck(e);function Nc(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=Qk(Q(B({},t),{palette:B({mode:i},t==null?void 0:t.palette)}));return}const l=Fc(Q(B({},n),{palette:B({mode:i},t==null?void 0:t.palette)})),{palette:o}=l,a=Qe(l,["palette"]);return e[r]=Q(B({},t),{palette:o,opacity:B(B({},Ep(i)),t==null?void 0:t.opacity),overlays:(t==null?void 0:t.overlays)||kp(i)}),a}function r_(e={},...t){const F=e,{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:a=Jk,colorSchemeSelector:l=n.light&&n.dark?"media":void 0,rootSelector:c=":root"}=F,u=Qe(F,["colorSchemes","defaultColorScheme","disableCssColorScheme","cssVarPrefix","shouldSkipGeneratingVar","colorSchemeSelector","rootSelector"]),f=Object.keys(n)[0],d=r||(n.light&&f!=="light"?"light":f),p=n_(o),W=n,{[d]:g,light:v,dark:m}=W,b=Qe(W,[Ks(d),"light","dark"]),C=B({},b);let w=g;if((d==="dark"&&!("dark"in n)||d==="light"&&!("light"in n))&&(w=!0),!w)throw new Error(_r(21,d));const x=Nc(C,w,u,d);v&&!C.light&&Nc(C,v,void 0,"light"),m&&!C.dark&&Nc(C,m,void 0,"dark");let I=Q(B({defaultColorScheme:d},x),{cssVarPrefix:o,colorSchemeSelector:l,rootSelector:c,getCssVar:p,colorSchemes:C,font:B(B({},Mk(x.typography)),x.font),spacing:t_(u.spacing)});Object.keys(I.colorSchemes).forEach(O=>{const T=I.colorSchemes[O].palette,N=H=>{const j=H.split("-"),$=j[1],M=j[2];return p(H,T[$][M])};if(T.mode==="light"&&(re(T.common,"background","#fff"),re(T.common,"onBackground","#000")),T.mode==="dark"&&(re(T.common,"background","#000"),re(T.common,"onBackground","#fff")),e_(T,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),T.mode==="light"){re(T.Alert,"errorColor",Ue(T.error.light,.6)),re(T.Alert,"infoColor",Ue(T.info.light,.6)),re(T.Alert,"successColor",Ue(T.success.light,.6)),re(T.Alert,"warningColor",Ue(T.warning.light,.6)),re(T.Alert,"errorFilledBg",N("palette-error-main")),re(T.Alert,"infoFilledBg",N("palette-info-main")),re(T.Alert,"successFilledBg",N("palette-success-main")),re(T.Alert,"warningFilledBg",N("palette-warning-main")),re(T.Alert,"errorFilledColor",An(()=>T.getContrastText(T.error.main))),re(T.Alert,"infoFilledColor",An(()=>T.getContrastText(T.info.main))),re(T.Alert,"successFilledColor",An(()=>T.getContrastText(T.success.main))),re(T.Alert,"warningFilledColor",An(()=>T.getContrastText(T.warning.main))),re(T.Alert,"errorStandardBg",Ve(T.error.light,.9)),re(T.Alert,"infoStandardBg",Ve(T.info.light,.9)),re(T.Alert,"successStandardBg",Ve(T.success.light,.9)),re(T.Alert,"warningStandardBg",Ve(T.warning.light,.9)),re(T.Alert,"errorIconColor",N("palette-error-main")),re(T.Alert,"infoIconColor",N("palette-info-main")),re(T.Alert,"successIconColor",N("palette-success-main")),re(T.Alert,"warningIconColor",N("palette-warning-main")),re(T.AppBar,"defaultBg",N("palette-grey-100")),re(T.Avatar,"defaultBg",N("palette-grey-400")),re(T.Button,"inheritContainedBg",N("palette-grey-300")),re(T.Button,"inheritContainedHoverBg",N("palette-grey-A100")),re(T.Chip,"defaultBorder",N("palette-grey-400")),re(T.Chip,"defaultAvatarColor",N("palette-grey-700")),re(T.Chip,"defaultIconColor",N("palette-grey-700")),re(T.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),re(T.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),re(T.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),re(T.LinearProgress,"primaryBg",Ve(T.primary.main,.62)),re(T.LinearProgress,"secondaryBg",Ve(T.secondary.main,.62)),re(T.LinearProgress,"errorBg",Ve(T.error.main,.62)),re(T.LinearProgress,"infoBg",Ve(T.info.main,.62)),re(T.LinearProgress,"successBg",Ve(T.success.main,.62)),re(T.LinearProgress,"warningBg",Ve(T.warning.main,.62)),re(T.Skeleton,"bg",`rgba(${N("palette-text-primaryChannel")} / 0.11)`),re(T.Slider,"primaryTrack",Ve(T.primary.main,.62)),re(T.Slider,"secondaryTrack",Ve(T.secondary.main,.62)),re(T.Slider,"errorTrack",Ve(T.error.main,.62)),re(T.Slider,"infoTrack",Ve(T.info.main,.62)),re(T.Slider,"successTrack",Ve(T.success.main,.62)),re(T.Slider,"warningTrack",Ve(T.warning.main,.62));const H=ns(T.background.default,.8);re(T.SnackbarContent,"bg",H),re(T.SnackbarContent,"color",An(()=>T.getContrastText(H))),re(T.SpeedDialAction,"fabHoverBg",ns(T.background.paper,.15)),re(T.StepConnector,"border",N("palette-grey-400")),re(T.StepContent,"border",N("palette-grey-400")),re(T.Switch,"defaultColor",N("palette-common-white")),re(T.Switch,"defaultDisabledColor",N("palette-grey-100")),re(T.Switch,"primaryDisabledColor",Ve(T.primary.main,.62)),re(T.Switch,"secondaryDisabledColor",Ve(T.secondary.main,.62)),re(T.Switch,"errorDisabledColor",Ve(T.error.main,.62)),re(T.Switch,"infoDisabledColor",Ve(T.info.main,.62)),re(T.Switch,"successDisabledColor",Ve(T.success.main,.62)),re(T.Switch,"warningDisabledColor",Ve(T.warning.main,.62)),re(T.TableCell,"border",Ve(ts(T.divider,1),.88)),re(T.Tooltip,"bg",ts(T.grey[700],.92))}if(T.mode==="dark"){re(T.Alert,"errorColor",Ve(T.error.light,.6)),re(T.Alert,"infoColor",Ve(T.info.light,.6)),re(T.Alert,"successColor",Ve(T.success.light,.6)),re(T.Alert,"warningColor",Ve(T.warning.light,.6)),re(T.Alert,"errorFilledBg",N("palette-error-dark")),re(T.Alert,"infoFilledBg",N("palette-info-dark")),re(T.Alert,"successFilledBg",N("palette-success-dark")),re(T.Alert,"warningFilledBg",N("palette-warning-dark")),re(T.Alert,"errorFilledColor",An(()=>T.getContrastText(T.error.dark))),re(T.Alert,"infoFilledColor",An(()=>T.getContrastText(T.info.dark))),re(T.Alert,"successFilledColor",An(()=>T.getContrastText(T.success.dark))),re(T.Alert,"warningFilledColor",An(()=>T.getContrastText(T.warning.dark))),re(T.Alert,"errorStandardBg",Ue(T.error.light,.9)),re(T.Alert,"infoStandardBg",Ue(T.info.light,.9)),re(T.Alert,"successStandardBg",Ue(T.success.light,.9)),re(T.Alert,"warningStandardBg",Ue(T.warning.light,.9)),re(T.Alert,"errorIconColor",N("palette-error-main")),re(T.Alert,"infoIconColor",N("palette-info-main")),re(T.Alert,"successIconColor",N("palette-success-main")),re(T.Alert,"warningIconColor",N("palette-warning-main")),re(T.AppBar,"defaultBg",N("palette-grey-900")),re(T.AppBar,"darkBg",N("palette-background-paper")),re(T.AppBar,"darkColor",N("palette-text-primary")),re(T.Avatar,"defaultBg",N("palette-grey-600")),re(T.Button,"inheritContainedBg",N("palette-grey-800")),re(T.Button,"inheritContainedHoverBg",N("palette-grey-700")),re(T.Chip,"defaultBorder",N("palette-grey-700")),re(T.Chip,"defaultAvatarColor",N("palette-grey-300")),re(T.Chip,"defaultIconColor",N("palette-grey-300")),re(T.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),re(T.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),re(T.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),re(T.LinearProgress,"primaryBg",Ue(T.primary.main,.5)),re(T.LinearProgress,"secondaryBg",Ue(T.secondary.main,.5)),re(T.LinearProgress,"errorBg",Ue(T.error.main,.5)),re(T.LinearProgress,"infoBg",Ue(T.info.main,.5)),re(T.LinearProgress,"successBg",Ue(T.success.main,.5)),re(T.LinearProgress,"warningBg",Ue(T.warning.main,.5)),re(T.Skeleton,"bg",`rgba(${N("palette-text-primaryChannel")} / 0.13)`),re(T.Slider,"primaryTrack",Ue(T.primary.main,.5)),re(T.Slider,"secondaryTrack",Ue(T.secondary.main,.5)),re(T.Slider,"errorTrack",Ue(T.error.main,.5)),re(T.Slider,"infoTrack",Ue(T.info.main,.5)),re(T.Slider,"successTrack",Ue(T.success.main,.5)),re(T.Slider,"warningTrack",Ue(T.warning.main,.5));const H=ns(T.background.default,.98);re(T.SnackbarContent,"bg",H),re(T.SnackbarContent,"color",An(()=>T.getContrastText(H))),re(T.SpeedDialAction,"fabHoverBg",ns(T.background.paper,.15)),re(T.StepConnector,"border",N("palette-grey-600")),re(T.StepContent,"border",N("palette-grey-600")),re(T.Switch,"defaultColor",N("palette-grey-300")),re(T.Switch,"defaultDisabledColor",N("palette-grey-600")),re(T.Switch,"primaryDisabledColor",Ue(T.primary.main,.55)),re(T.Switch,"secondaryDisabledColor",Ue(T.secondary.main,.55)),re(T.Switch,"errorDisabledColor",Ue(T.error.main,.55)),re(T.Switch,"infoDisabledColor",Ue(T.info.main,.55)),re(T.Switch,"successDisabledColor",Ue(T.success.main,.55)),re(T.Switch,"warningDisabledColor",Ue(T.warning.main,.55)),re(T.TableCell,"border",Ue(ts(T.divider,1),.68)),re(T.Tooltip,"bg",ts(T.grey[700],.92))}Gn(T.background,"default"),Gn(T.background,"paper"),Gn(T.common,"background"),Gn(T.common,"onBackground"),Gn(T,"divider"),Object.keys(T).forEach(H=>{const j=T[H];H!=="tonalOffset"&&j&&typeof j=="object"&&(j.main&&re(T[H],"mainChannel",fo(go(j.main))),j.light&&re(T[H],"lightChannel",fo(go(j.light))),j.dark&&re(T[H],"darkChannel",fo(go(j.dark))),j.contrastText&&re(T[H],"contrastTextChannel",fo(go(j.contrastText))),H==="text"&&(Gn(T[H],"primary"),Gn(T[H],"secondary")),H==="action"&&(j.active&&Gn(T[H],"active"),j.selected&&Gn(T[H],"selected")))})}),I=t.reduce((O,T)=>Qt(O,T),I);const S={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:a,getSelector:Zk(I)},{vars:A,generateThemeVars:E,generateStyleSheets:k}=Ik(I,S);return I.vars=A,Object.entries(I.colorSchemes[I.defaultColorScheme]).forEach(([O,T])=>{I[O]=T}),I.generateThemeVars=E,I.generateStyleSheets=k,I.generateSpacing=function(){return fp(u.spacing,kc(this))},I.getColorSchemeSelector=Ak(l),I.spacing=I.generateSpacing(),I.shouldSkipGeneratingVar=a,I.unstable_sxConfig=B(B({},Ja),u==null?void 0:u.unstable_sxConfig),I.unstable_sx=function(T){return ri({sx:T,theme:this})},I.toRuntimeSource=Tp,I}function _p(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]=Q(B({},n!==!0&&n),{palette:$c(Q(B({},n===!0?{}:n.palette),{mode:t}))}))}function i_(e={},...t){const f=e,{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode}=f,a=Qe(f,["palette","cssVariables","colorSchemes","defaultColorScheme"]),l=o||"light",c=i==null?void 0:i[l],u=B(B({},i),n?{[l]:Q(B({},typeof c!="boolean"&&c),{palette:n})}:void 0);if(r===!1){if(!("colorSchemes"in e))return Fc(e,...t);let d=n;"palette"in e||u[l]&&(u[l]!==!0?d=u[l].palette:l==="dark"&&(d={mode:"dark"}));const p=Fc(Q(B({},e),{palette:d}),...t);return p.defaultColorScheme=l,p.colorSchemes=u,p.palette.mode==="light"&&(p.colorSchemes.light=Q(B({},u.light!==!0&&u.light),{palette:p.palette}),_p(p,"dark",u.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark=Q(B({},u.dark!==!0&&u.dark),{palette:p.palette}),_p(p,"light",u.light)),p}return!n&&!("light"in u)&&l==="light"&&(u.light=!0),r_(B(Q(B({},a),{colorSchemes:u,defaultColorScheme:l}),typeof r!="boolean"&&r),...t)}const o_=i_(),a_="$$material";function s_(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const l_=sk({themeId:a_,defaultTheme:o_,rootShouldForwardProp:e=>s_(e)&&e!=="classes"}),c_=xk;function u_(e){return yk(e)}function d_(e){return np("MuiSvgIcon",e)}QT("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const f_=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${ti(t)}`,`fontSize${ti(n)}`]};return YT(i,d_,r)},h_=l_("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${ti(n.color)}`],t[`fontSize${ti(n.fontSize)}`]]}})(c_(({theme:e})=>{var t,n,r,i,o,a,l,c,u,f,d,p,g,v,m,b,C,w;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(i=(r=((n=e.vars)!=null?n:e).transitions)==null?void 0:r.duration)==null?void 0:i.shorter}),variants:[{props:x=>!x.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((l=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:l.call(a,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((d=(f=e.typography)==null?void 0:f.pxToRem)==null?void 0:d.call(f,35))||"2.1875rem"}},...Object.entries(((p=e.vars)!=null?p:e).palette).filter(([,x])=>x&&x.main).map(([x])=>{var I,S,A;return{props:{color:x},style:{color:(A=(S=((I=e.vars)!=null?I:e).palette)==null?void 0:S[x])==null?void 0:A.main}}}),{props:{color:"action"},style:{color:(m=(v=((g=e.vars)!=null?g:e).palette)==null?void 0:v.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(w=(C=((b=e.vars)!=null?b:e).palette)==null?void 0:C.action)==null?void 0:w.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),zc=K.forwardRef(function(t,n){const r=u_({props:t,name:"MuiSvgIcon"}),w=r,{children:i,className:o,color:a="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:f=!1,titleAccess:d,viewBox:p="0 0 24 24"}=w,g=Qe(w,["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"]),v=K.isValidElement(i)&&i.type==="svg",m=Q(B({},r),{color:a,component:l,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:f,viewBox:p,hasSvgAsChild:v}),b={};f||(b.viewBox=p);const C=f_(m);return s.jsxs(h_,Q(B(B(B({as:l,className:zn(C.root,o),focusable:"false",color:u,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:n},b),g),v&&i.props),{ownerState:m,children:[v?i.props.children:i,d?s.jsx("title",{children:d}):null]}))});zc.muiName="SvgIcon";function Be(e,t){function n(r,i){return s.jsx(zc,Q(B({"data-testid":`${t}Icon`,ref:i},r),{children:e}))}return n.muiName=zc.muiName,K.memo(K.forwardRef(n))}const jc=Be(s.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image"),p_=Be(s.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8m-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12m3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8m5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8m3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"ColorLens"),g_=Be(s.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function m_(e){return ut("MuiTabPanel",e)}Ke("MuiTabPanel",["root","hidden","sizeSm","sizeMd","sizeLg","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const v_=["children","value","component","color","variant","size","slots","slotProps","keepMounted"],b_=e=>{const{hidden:t,size:n,variant:r,color:i,orientation:o}=e,a={root:["root",t&&"hidden",n&&`size${we(n)}`,o,r&&`variant${we(r)}`,i&&`color${we(i)}`,n&&`size${we(n)}`]};return pt(a,m_,{})},y_=ye("div",{name:"JoyTabPanel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;return R({display:t.hidden?"none":"block",padding:"var(--Tabs-spacing)",flexGrow:1,fontFamily:e.vars.fontFamily.body},e.typography[`body-${t.size}`],(n=e.variants[t.variant])==null?void 0:n[t.color])}),ci=K.forwardRef(function(t,n){const r=gt({props:t,name:"JoyTabPanel"}),{orientation:i}=_a()||{orientation:"horizontal"},o=K.useContext(Sc),{children:a,value:l=0,component:c,color:u="neutral",variant:f="plain",size:d,slots:p={},slotProps:g={},keepMounted:v=!1}=r,m=De(r,v_),{hidden:b,getRootProps:C}=lA(R({},r,{value:l})),w=d!=null?d:o,x=R({},r,{orientation:i,hidden:b,size:w,color:u,variant:f}),I=b_(x),S=R({},m,{component:c,slots:p,slotProps:g}),[A,E]=Ee("root",{ref:n,elementType:y_,getSlotProps:C,externalForwardedProps:S,additionalProps:{role:"tabpanel",ref:n,as:c},ownerState:x,className:I.root});return v?s.jsx(A,R({},E,{children:a})):s.jsx(A,R({},E,{children:!b&&a}))});function x_(e){return ut("MuiInput",e)}const Pp=Ke("MuiInput",["root","input","formControl","focused","disabled","error","adornedStart","adornedEnd","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid","fullWidth","startDecorator","endDecorator"]),rs=K.createContext(void 0),C_=["aria-describedby","aria-label","aria-labelledby","autoComplete","autoFocus","className","defaultValue","disabled","disabledInProp","error","id","name","onClick","onChange","onKeyDown","onKeyUp","onFocus","onBlur","placeholder","readOnly","required","type","value"];function w_(e,t){var n;const r=K.useContext(rs),{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:l,autoFocus:c,className:u,defaultValue:f,disabled:d,disabledInProp:p,error:g,id:v,name:m,onClick:b,onChange:C,onKeyDown:w,onKeyUp:x,onFocus:I,onBlur:S,placeholder:A,readOnly:E,required:k,type:F,value:W}=e,O=De(e,C_),{getRootProps:T,getInputProps:N,focused:H,error:j,disabled:$}=SI({disabled:(n=p!=null?p:r==null?void 0:r.disabled)!=null?n:d,defaultValue:f,error:g,onBlur:S,onClick:b,onChange:C,onFocus:I,required:k!=null?k:r==null?void 0:r.required,value:W}),M={[t.disabled]:$,[t.error]:j,[t.focused]:H,[t.formControl]:!!r,[u]:u},V={[t.disabled]:$};return R({formControl:r,propsToForward:{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:l,autoFocus:c,disabled:$,id:v,onKeyDown:w,onKeyUp:x,name:m,placeholder:A,readOnly:E,type:F},rootStateClasses:M,inputStateClasses:V,getRootProps:T,getInputProps:N,focused:H,error:j,disabled:$},O)}const Uc=e=>t=>`--${e?`${e}-`:""}${t.replace(/^--/,"")}`,mo="data-skip-inverted-colors",Dp=`& :not([${mo}], [${mo}] *)`,Op=e=>{var t,n,r,i,o,a,l,c,u,f,d,p,g,v,m,b,C,w,x,I,S,A;const E=Uc(e.cssVarPrefix);return{"--variant-plainColor":"var(--variant-plainColor) !important","--variant-plainHoverColor":"var(--variant-plainHoverColor) !important","--variant-plainHoverBg":"var(--variant-plainHoverBg) !important","--variant-plainActiveBg":"var(--variant-plainActiveBg) !important","--variant-plainDisabledColor":"var(--variant-plainDisabledColor) !important","--variant-outlinedColor":"var(--variant-outlinedColor) !important","--variant-outlinedBorder":"var(--variant-outlinedBorder) !important","--variant-outlinedHoverColor":"var(--variant-outlinedHoverColor) !important","--variant-outlinedHoverBorder":"var(--variant-outlinedHoverBorder) !important","--variant-outlinedHoverBg":"var(--variant-outlinedHoverBg) !important","--variant-outlinedActiveBg":"var(--variant-outlinedActiveBg) !important","--variant-outlinedDisabledColor":"var(--variant-outlinedDisabledColor) !important","--variant-outlinedDisabledBorder":"var(--variant-outlinedDisabledBorder) !important","--variant-softColor":"var(--variant-softColor) !important","--variant-softHoverColor":"var(--variant-softHoverColor) !important","--variant-softBg":"var(--variant-softBg) !important","--variant-softHoverBg":"var(--variant-softHoverBg) !important","--variant-softActiveBg":"var(--variant-softActiveBg) !important","--variant-softActiveColor":"var(--variant-softActiveColor) !important","--variant-softDisabledColor":"var(--variant-softDisabledColor) !important","--variant-softDisabledBg":"var(--variant-softDisabledBg) !important","--variant-solidColor":"var(--variant-solidColor) !important","--variant-solidBg":"var(--variant-solidBg) !important","--variant-solidHoverBg":"var(--variant-solidHoverBg) !important","--variant-solidActiveBg":"var(--variant-solidActiveBg) !important","--variant-solidDisabledColor":"var(--variant-solidDisabledColor) !important","--variant-solidDisabledBg":"var(--variant-solidDisabledBg) !important","--Badge-ringColor":"var(--Badge-ringColor) !important",colorScheme:"unset",[e.getColorSchemeSelector("light")]:{[E("--palette-focusVisible")]:`${(t=e.colorSchemes.light)==null?void 0:t.palette.focusVisible} !important`,[E("--palette-background-body")]:`${(n=e.colorSchemes.light)==null?void 0:n.palette.background.body} !important`,[E("--palette-background-surface")]:`${(r=e.colorSchemes.light)==null?void 0:r.palette.background.surface} !important`,[E("--palette-background-popup")]:`${(i=e.colorSchemes.light)==null?void 0:i.palette.background.popup} !important`,[E("--palette-background-level1")]:`${(o=e.colorSchemes.light)==null?void 0:o.palette.background.level1} !important`,[E("--palette-background-level2")]:`${(a=e.colorSchemes.light)==null?void 0:a.palette.background.level2} !important`,[E("--palette-background-level3")]:`${(l=e.colorSchemes.light)==null?void 0:l.palette.background.level3} !important`,[E("--palette-text-primary")]:`${(c=e.colorSchemes.light)==null?void 0:c.palette.text.primary} !important`,[E("--palette-text-secondary")]:`${(u=e.colorSchemes.light)==null?void 0:u.palette.text.secondary} !important`,[E("--palette-text-tertiary")]:`${(f=e.colorSchemes.light)==null?void 0:f.palette.text.tertiary} !important`,[E("--palette-divider")]:`${(d=e.colorSchemes.light)==null?void 0:d.palette.divider} !important`},[e.getColorSchemeSelector("dark")]:{[E("--palette-focusVisible")]:`${(p=e.colorSchemes.dark)==null?void 0:p.palette.focusVisible} !important`,[E("--palette-background-body")]:`${(g=e.colorSchemes.dark)==null?void 0:g.palette.background.body} !important`,[E("--palette-background-surface")]:`${(v=e.colorSchemes.dark)==null?void 0:v.palette.background.surface} !important`,[E("--palette-background-popup")]:`${(m=e.colorSchemes.dark)==null?void 0:m.palette.background.popup} !important`,[E("--palette-background-level1")]:`${(b=e.colorSchemes.dark)==null?void 0:b.palette.background.level1} !important`,[E("--palette-background-level2")]:`${(C=e.colorSchemes.dark)==null?void 0:C.palette.background.level2} !important`,[E("--palette-background-level3")]:`${(w=e.colorSchemes.dark)==null?void 0:w.palette.background.level3} !important`,[E("--palette-text-primary")]:`${(x=e.colorSchemes.dark)==null?void 0:x.palette.text.primary} !important`,[E("--palette-text-secondary")]:`${(I=e.colorSchemes.dark)==null?void 0:I.palette.text.secondary} !important`,[E("--palette-text-tertiary")]:`${(S=e.colorSchemes.dark)==null?void 0:S.palette.text.tertiary} !important`,[E("--palette-divider")]:`${(A=e.colorSchemes.dark)==null?void 0:A.palette.divider} !important`}}};function S_(e){return e.theme!==void 0}const I_=e=>t=>{const n=S_(t)?t.theme:t,r=uc(n.cssVarPrefix),i=Uc(n.cssVarPrefix),o=a=>{const l=a.split("-");return r(a,n.palette[l[1]][l[2]])};return{[Dp]:{"--Badge-ringColor":o(`palette-${e}-solidBg`),"--Icon-color":"currentColor",[`${n.getColorSchemeSelector("light")}, ${n.getColorSchemeSelector("dark")}`]:{colorScheme:"dark",[i("--palette-focusVisible")]:o(`palette-${e}-200`),[i("--palette-background-body")]:"rgba(0 0 0 / 0.1)",[i("--palette-background-surface")]:"rgba(0 0 0 / 0.06)",[i("--palette-background-popup")]:o(`palette-${e}-700`),[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.36)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.6)`,[i("--palette-text-primary")]:o("palette-common-white"),[i("--palette-text-secondary")]:o(`palette-${e}-200`),[i("--palette-text-tertiary")]:o(`palette-${e}-300`),[i("--palette-text-icon")]:o(`palette-${e}-200`),[i("--palette-divider")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-plainColor":o(`palette-${e}-50`),"--variant-plainHoverColor":"#fff","--variant-plainHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-outlinedColor":o(`palette-${e}-50`),"--variant-outlinedBorder":`rgba(${o(`palette-${e}-lightChannel`)} / 0.5)`,"--variant-outlinedHoverColor":"#fff","--variant-outlinedHoverBorder":o(`palette-${e}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":"rgba(255 255 255 / 0.2)","--variant-softColor":o("palette-common-white"),"--variant-softHoverColor":o("palette-common-white"),"--variant-softBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.24)`,"--variant-softHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.36)`,"--variant-softActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.16)`,"--variant-softActiveColor":"#fff","--variant-softDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.1)`,"--variant-solidColor":o(`palette-${e}-${e==="neutral"?"600":"500"}`),"--variant-solidBg":o("palette-common-white"),"--variant-solidHoverBg":o("palette-common-white"),"--variant-solidActiveBg":o(`palette-${e}-100`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.1)`}},[`&, & [${mo}]`]:Op(n)}},A_=e=>t=>{const{theme:n=t}=t,r=uc(n.cssVarPrefix),i=Uc(n.cssVarPrefix),o=a=>{const l=a.split("-");return r(a,n.palette[l[1]][l[2]])};return{[Dp]:{"--Badge-ringColor":o(`palette-${e}-softBg`),"--Icon-color":"currentColor",[n.getColorSchemeSelector("dark")]:{[i("--palette-focusVisible")]:o(`palette-${e}-300`),[i("--palette-background-body")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,[i("--palette-text-primary")]:o(`palette-${e}-100`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.6)`,[i("--palette-text-icon")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.6)`,[i("--palette-divider")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.2)`,"--variant-plainColor":`rgba(${o(`palette-${e}-lightChannel`)} / 1)`,"--variant-plainHoverColor":o(`palette-${e}-50`),"--variant-plainHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.16)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-outlinedColor":`rgba(${o(`palette-${e}-lightChannel`)} / 1)`,"--variant-outlinedHoverColor":o(`palette-${e}-50`),"--variant-outlinedBg":"initial","--variant-outlinedBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverBorder":o(`palette-${e}-600`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.16)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,"--variant-softColor":o(`palette-${e}-200`),"--variant-softBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-softHoverColor":"#fff","--variant-softHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-softActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.48)`,"--variant-softDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-solidColor":"#fff","--variant-solidBg":o(`palette-${e}-500`),"--variant-solidHoverColor":"#fff","--variant-solidHoverBg":o(`palette-${e}-600`),"--variant-solidActiveBg":o(`palette-${e}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`},[n.getColorSchemeSelector("light")]:{[i("--palette-focusVisible")]:o(`palette-${e}-500`),[i("--palette-background-body")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.48)`,[i("--palette-text-primary")]:o(`palette-${e}-700`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.8)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.68)`,[i("--palette-text-icon")]:o(`palette-${e}-500`),[i("--palette-divider")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-plainColor":`rgba(${o(`palette-${e}-darkChannel`)} / 0.8)`,"--variant-plainHoverColor":`rgba(${o(`palette-${e}-darkChannel`)} / 1)`,"--variant-plainHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-outlinedColor":`rgba(${o(`palette-${e}-mainChannel`)} / 1)`,"--variant-outlinedBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverColor":o(`palette-${e}-600`),"--variant-outlinedHoverBorder":o(`palette-${e}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-softColor":o(`palette-${e}-600`),"--variant-softBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.8)`,"--variant-softHoverColor":o(`palette-${e}-700`),"--variant-softHoverBg":o(`palette-${e}-200`),"--variant-softActiveBg":o(`palette-${e}-300`),"--variant-softDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,"--variant-solidColor":o("palette-common-white"),"--variant-solidBg":o(`palette-${e}-${e==="neutral"?"700":"500"}`),"--variant-solidHoverColor":o("palette-common-white"),"--variant-solidHoverBg":o(`palette-${e}-600`),"--variant-solidActiveBg":o(`palette-${e}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`}},[`&, & [${mo}]`]:Op(n)}},T_=["propsToForward","rootStateClasses","inputStateClasses","getRootProps","getInputProps","formControl","focused","error","disabled","fullWidth","size","color","variant","startDecorator","endDecorator","component","slots","slotProps"],E_=e=>{const{disabled:t,fullWidth:n,variant:r,color:i,size:o}=e,a={root:["root",t&&"disabled",n&&"fullWidth",r&&`variant${we(r)}`,i&&`color${we(i)}`,o&&`size${we(o)}`],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return pt(a,x_,{})},k_=ye("div")(({theme:e,ownerState:t})=>{var n,r,i,o,a,l;const c=(n=e.variants[`${t.variant}`])==null?void 0:n[t.color];return[R({"--Input-radius":e.vars.radius.sm,"--Input-gap":"0.5rem","--Input-placeholderColor":"inherit","--Input-placeholderOpacity":.64,"--Input-decoratorColor":e.vars.palette.text.icon,"--Input-focused":"0","--Input-focusedThickness":e.vars.focus.thickness,"--Input-focusedHighlight":(r=e.vars.palette[t.color==="neutral"?"primary":t.color])==null?void 0:r[500],[`&:not([${mo}])`]:R({},t.instanceColor&&{"--_Input-focusedHighlight":(i=e.vars.palette[t.instanceColor==="neutral"?"primary":t.instanceColor])==null?void 0:i[500]},{"--Input-focusedHighlight":`var(--_Input-focusedHighlight, ${e.vars.palette.focusVisible})`})},t.size==="sm"&&{"--Input-minHeight":"2rem","--Input-paddingInline":"0.5rem","--Input-decoratorChildHeight":"min(1.5rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl},t.size==="md"&&{"--Input-minHeight":"2.25rem","--Input-paddingInline":"0.75rem","--Input-decoratorChildHeight":"min(1.75rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl2},t.size==="lg"&&{"--Input-minHeight":"2.75rem","--Input-paddingInline":"1rem","--Input-gap":"0.75rem","--Input-decoratorChildHeight":"min(2.25rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl2},{"--Input-decoratorChildOffset":"min(calc(var(--Input-paddingInline) - (var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2), var(--Input-paddingInline))","--_Input-paddingBlock":"max((var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2, 0px)","--Input-decoratorChildRadius":"max(var(--Input-radius) - var(--variant-borderWidth, 0px) - var(--_Input-paddingBlock), min(var(--_Input-paddingBlock) + var(--variant-borderWidth, 0px), var(--Input-radius) / 2))","--Button-minHeight":"var(--Input-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Input-decoratorChildHeight)","--Button-radius":"var(--Input-decoratorChildRadius)","--IconButton-radius":"var(--Input-decoratorChildRadius)",boxSizing:"border-box"},t.variant!=="plain"&&{boxShadow:e.shadow.xs},{minWidth:0,minHeight:"var(--Input-minHeight)"},t.fullWidth&&{width:"100%"},{cursor:"text",position:"relative",display:"flex",paddingInline:"var(--Input-paddingInline)",borderRadius:"var(--Input-radius)"},e.typography[`body-${t.size}`],c,{backgroundColor:(o=c==null?void 0:c.backgroundColor)!=null?o:e.vars.palette.background.surface,"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)",boxShadow:"var(--Input-focusedInset, inset) 0 0 0 calc(var(--Input-focused) * var(--Input-focusedThickness)) var(--Input-focusedHighlight)"}}),{"&:hover":R({},(a=e.variants[`${t.variant}Hover`])==null?void 0:a[t.color],{backgroundColor:null}),[`&.${Pp.disabled}`]:(l=e.variants[`${t.variant}Disabled`])==null?void 0:l[t.color],"&:focus-within::before":{"--Input-focused":"1"}}]}),__=ye("input")(({ownerState:e})=>({border:"none",minWidth:0,outline:0,padding:0,flex:1,color:"inherit",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit",textOverflow:"ellipsis","&:-webkit-autofill":R({paddingInline:"var(--Input-paddingInline)"},!e.startDecorator&&{marginInlineStart:"calc(-1 * var(--Input-paddingInline))",paddingInlineStart:"var(--Input-paddingInline)",borderTopLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"},!e.endDecorator&&{marginInlineEnd:"calc(-1 * var(--Input-paddingInline))",paddingInlineEnd:"var(--Input-paddingInline)",borderTopRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"}),"&::-webkit-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-moz-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&:-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"}})),P_=ye("div")({"--Button-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Input-paddingInline) / -4)",display:"inherit",alignItems:"center",paddingBlock:"var(--unstable_InputPaddingBlock)",flexWrap:"wrap",marginInlineEnd:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),D_=ye("div")({"--Button-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Input-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",marginInlineStart:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),O_=ye(k_,{name:"JoyInput",slot:"Root",overridesResolver:(e,t)=>t.root})({}),R_=ye(__,{name:"JoyInput",slot:"Input",overridesResolver:(e,t)=>t.input})({}),M_=ye(P_,{name:"JoyInput",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({}),L_=ye(D_,{name:"JoyInput",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({}),is=K.forwardRef(function(t,n){var r,i,o,a,l,c;const u=gt({props:t,name:"JoyInput"}),f=w_(R({},u,{disabledInProp:t.disabled}),Pp),{propsToForward:d,rootStateClasses:p,inputStateClasses:g,getRootProps:v,getInputProps:m,formControl:b,focused:C,error:w=!1,disabled:x,fullWidth:I=!1,size:S="md",color:A="neutral",variant:E="outlined",startDecorator:k,endDecorator:F,component:W,slots:O={},slotProps:T={}}=f,N=De(f,T_),H=(r=(i=t.error)!=null?i:b==null?void 0:b.error)!=null?r:w,j=(o=(a=t.size)!=null?a:b==null?void 0:b.size)!=null?o:S,$=(l=t.color)!=null?l:H?"danger":(c=b==null?void 0:b.color)!=null?c:A,M=R({instanceColor:H?"danger":t.color},u,{fullWidth:I,color:$,disabled:x,error:H,focused:C,size:j,variant:E}),V=E_(M),Y=R({},N,{component:W,slots:O,slotProps:T}),[X,D]=Ee("root",{ref:n,className:[V.root,p],elementType:O_,getSlotProps:v,externalForwardedProps:Y,ownerState:M}),[L,U]=Ee("input",R({},b&&{additionalProps:{id:b.htmlFor,"aria-describedby":b["aria-describedby"]}},{className:[V.input,g],elementType:R_,getSlotProps:m,internalForwardedProps:d,externalForwardedProps:Y,ownerState:M})),[G,oe]=Ee("startDecorator",{className:V.startDecorator,elementType:M_,externalForwardedProps:Y,ownerState:M}),[ce,se]=Ee("endDecorator",{className:V.endDecorator,elementType:L_,externalForwardedProps:Y,ownerState:M});return s.jsxs(X,R({},D,{children:[k&&s.jsx(G,R({},oe,{children:k})),s.jsx(L,R({},U)),F&&s.jsx(ce,R({},se,{children:F}))]}))}),Ot=({label:e,placeholder:t,value:n,defaultValue:r,required:i,size:o,readOnly:a=!1,endDecorator:l=void 0,onChange:c})=>s.jsxs(h.FormControl,{size:o||"md",sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{required:i,color:"primary",children:e}),s.jsx(is,{placeholder:t,size:"md",variant:"outlined",color:"neutral",value:n||r,defaultValue:r,readOnly:a,endDecorator:l,onChange:c,sx:{backgroundColor:"#fff",borderRadius:"md"}})]}),Rp=Be(s.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");function B_(e){return ut("MuiCircularProgress",e)}Ke("MuiCircularProgress",["root","determinate","svg","track","progress","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);let $_=e=>e,Mp;const F_=["color","backgroundColor"],N_=["children","className","color","size","variant","thickness","determinate","value","component","slots","slotProps"],z_=me.keyframes({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(270deg)"}}),j_=e=>{const{determinate:t,color:n,variant:r,size:i}=e,o={root:["root",t&&"determinate",n&&`color${we(n)}`,r&&`variant${we(r)}`,i&&`size${we(i)}`],svg:["svg"],track:["track"],progress:["progress"]};return pt(o,B_,{})};function ui(e,t){return`var(--CircularProgress-${e}Thickness, var(--CircularProgress-thickness, ${t}))`}const U_=ye("span",{name:"JoyCircularProgress",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r,i,o;const a=((n=t.variants[e.variant])==null?void 0:n[e.color])||{},{color:l,backgroundColor:c}=a,u=De(a,F_);return R({"--Icon-fontSize":"calc(0.4 * var(--_root-size))","--CircularProgress-trackColor":c,"--CircularProgress-progressColor":l,"--CircularProgress-percent":e.value,"--CircularProgress-linecap":"round"},e.size==="sm"&&{"--_root-size":"var(--CircularProgress-size, 24px)","--_track-thickness":ui("track","3px"),"--_progress-thickness":ui("progress","3px")},e.instanceSize==="sm"&&{"--CircularProgress-size":"24px"},e.size==="md"&&{"--_track-thickness":ui("track","6px"),"--_progress-thickness":ui("progress","6px"),"--_root-size":"var(--CircularProgress-size, 40px)"},e.instanceSize==="md"&&{"--CircularProgress-size":"40px"},e.size==="lg"&&{"--_track-thickness":ui("track","8px"),"--_progress-thickness":ui("progress","8px"),"--_root-size":"var(--CircularProgress-size, 64px)"},e.instanceSize==="lg"&&{"--CircularProgress-size":"64px"},e.thickness&&{"--_track-thickness":`${e.thickness}px`,"--_progress-thickness":`${e.thickness}px`},{"--_thickness-diff":"calc(var(--_track-thickness) - var(--_progress-thickness))","--_inner-size":"calc(var(--_root-size) - 2 * var(--variant-borderWidth, 0px))","--_outlined-inset":"max(var(--_track-thickness), var(--_progress-thickness))",width:"var(--_root-size)",height:"var(--_root-size)",borderRadius:"var(--_root-size)",margin:"var(--CircularProgress-margin)",boxSizing:"border-box",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,position:"relative",color:l},e.children&&{fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.md,fontSize:"calc(0.2 * var(--_root-size))"},u,e.variant==="outlined"&&{"&::before":R({content:'""',display:"block",position:"absolute",borderRadius:"inherit",top:"var(--_outlined-inset)",left:"var(--_outlined-inset)",right:"var(--_outlined-inset)",bottom:"var(--_outlined-inset)"},u)},e.variant==="soft"&&{"--CircularProgress-trackColor":t.variants.soft.neutral.backgroundColor,"--CircularProgress-progressColor":(r=t.variants.solid)==null?void 0:r[e.color].backgroundColor},e.variant==="solid"&&{"--CircularProgress-trackColor":(i=t.variants.softHover)==null?void 0:i[e.color].backgroundColor,"--CircularProgress-progressColor":(o=t.variants.solid)==null?void 0:o[e.color].backgroundColor})}),V_=ye("svg",{name:"JoyCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({width:"inherit",height:"inherit",display:"inherit",boxSizing:"inherit",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))"}),H_=ye("circle",{name:"JoyCircularProgress",slot:"track",overridesResolver:(e,t)=>t.track})({cx:"50%",cy:"50%",r:"calc(var(--_inner-size) / 2 - var(--_track-thickness) / 2 + min(0px, var(--_thickness-diff) / 2))",fill:"transparent",strokeWidth:"var(--_track-thickness)",stroke:"var(--CircularProgress-trackColor)"}),W_=ye("circle",{name:"JoyCircularProgress",slot:"progress",overridesResolver:(e,t)=>t.progress})({"--_progress-radius":"calc(var(--_inner-size) / 2 - var(--_progress-thickness) / 2 - max(0px, var(--_thickness-diff) / 2))","--_progress-length":"calc(2 * 3.1415926535 * var(--_progress-radius))",cx:"50%",cy:"50%",r:"var(--_progress-radius)",fill:"transparent",strokeWidth:"var(--_progress-thickness)",stroke:"var(--CircularProgress-progressColor)",strokeLinecap:"var(--CircularProgress-linecap, round)",strokeDasharray:"var(--_progress-length)",strokeDashoffset:"calc(var(--_progress-length) - var(--CircularProgress-percent) * var(--_progress-length) / 100)",transformOrigin:"center",transform:"rotate(-90deg)"},({ownerState:e})=>!e.determinate&&me.css(Mp||(Mp=$_`
2348
2348
  animation: var(--CircularProgress-circulation, 0.8s linear 0s infinite normal none running)
2349
2349
  ${0};
2350
- `),z_)),Lp=K.forwardRef(function(t,n){const r=gt({props:t,name:"JoyCircularProgress"}),{children:i,className:o,color:a="primary",size:l="md",variant:c="soft",thickness:u,determinate:f=!1,value:d=f?0:25,component:p,slots:g={},slotProps:v={}}=r,m=De(r,N_),b=R({},r,{color:a,size:l,variant:c,thickness:u,value:d,determinate:f,instanceSize:t.size}),C=j_(b),w=R({},m,{component:p,slots:g,slotProps:v}),[x,I]=Ee("root",{ref:n,className:zn(C.root,o),elementType:U_,externalForwardedProps:w,ownerState:b,additionalProps:R({role:"progressbar",style:{"--CircularProgress-percent":d}},d&&f&&{"aria-valuenow":Math.round(typeof d=="number"?d:Number(d||0))})}),[S,A]=Ee("svg",{className:C.svg,elementType:V_,externalForwardedProps:w,ownerState:b}),[E,k]=Ee("track",{className:C.track,elementType:H_,externalForwardedProps:w,ownerState:b}),[F,W]=Ee("progress",{className:C.progress,elementType:W_,externalForwardedProps:w,ownerState:b});return s.jsxs(x,R({},I,{children:[s.jsxs(S,R({},A,{children:[s.jsx(E,R({},k)),s.jsx(F,R({},W))]})),i]}))});function G_(e){return ut("MuiButton",e)}const Bp=Ke("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]),$p=K.createContext({}),Fp=K.createContext(void 0),Y_=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled","component","slots","slotProps"],K_=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,fullWidth:o,size:a,variant:l,loading:c}=e,u={root:["root",n&&"disabled",r&&"focusVisible",o&&"fullWidth",l&&`variant${we(l)}`,t&&`color${we(t)}`,a&&`size${we(a)}`,c&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},f=pt(u,G_,{});return r&&i&&(f.root+=` ${i}`),f},q_=ye("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Q_=ye("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),J_=ye("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,t)=>t.loadingIndicatorCenter})(({theme:e,ownerState:t})=>{var n,r;return R({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),X_=({theme:e,ownerState:t})=>{var n,r,i,o;return[R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.size==="sm"&&{"--Icon-fontSize":e.vars.fontSize.lg,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.25rem)",paddingInline:"0.75rem"},t.size==="md"&&{"--Icon-fontSize":e.vars.fontSize.xl,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.25rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.375rem)",paddingInline:"1rem"},t.size==="lg"&&{"--Icon-fontSize":e.vars.fontSize.xl2,"--CircularProgress-size":"28px","--CircularProgress-thickness":"4px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 2.75rem)",fontSize:e.vars.fontSize.md,paddingBlock:"var(--Button-paddingBlock, 0.5rem)",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",userSelect:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:e.vars.lineHeight.md},t.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),R({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},'&:active, &[aria-pressed="true"]':(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color],[`&.${Bp.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]},t.loadingPosition==="center"&&{[`&.${Bp.loading}`]:{color:"transparent"}})]},Z_=ye("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,t)=>t.root})(X_),di=K.forwardRef(function(t,n){var r;const i=gt({props:t,name:"JoyButton"}),{children:o,action:a,color:l="primary",variant:c="solid",size:u="md",fullWidth:f=!1,startDecorator:d,endDecorator:p,loading:g=!1,loadingPosition:v="center",loadingIndicator:m,disabled:b,component:C,slots:w={},slotProps:x={}}=i,I=De(i,Y_),S=K.useContext($p),A=K.useContext(Fp),E=t.variant||S.variant||c,k=t.size||S.size||u,F=t.color||S.color||l,W=(r=t.loading||t.disabled)!=null?r:S.disabled||g||b,O=K.useRef(null),T=hn(O,n),{focusVisible:N,setFocusVisible:H,getRootProps:j}=Jl(R({},i,{disabled:W,rootRef:T})),$=m!=null?m:s.jsx(Lp,{color:F,thickness:{sm:2,md:3,lg:4}[k]||3});K.useImperativeHandle(a,()=>({focusVisible:()=>{var ne;H(!0),(ne=O.current)==null||ne.focus()}}),[H]);const M=R({},i,{color:F,fullWidth:f,variant:E,size:k,focusVisible:N,loading:g,loadingPosition:v,disabled:W}),V=K_(M),Y=ne=>{var de;let ve=i.onClick;if(typeof x.root=="function"?ve=x.root(M).onClick:x.root&&(ve=x.root.onClick),(de=ve)==null||de(ne),A){var Fe;(Fe=A.onClick)==null||Fe.call(A,ne,i.value)}};let X=i["aria-pressed"];typeof x.root=="function"?X=x.root(M)["aria-pressed"]:x.root&&(X=x.root["aria-pressed"]),A!=null&&A.value&&(Array.isArray(A.value)?X=A.value.indexOf(i.value)!==-1:X=A.value===i.value);const D=R({},I,{component:C,slots:w,slotProps:x}),[L,U]=Ee("root",{ref:n,className:V.root,elementType:Z_,externalForwardedProps:D,getSlotProps:j,ownerState:M,additionalProps:{onClick:Y,"aria-pressed":X}}),[G,oe]=Ee("startDecorator",{className:V.startDecorator,elementType:q_,externalForwardedProps:D,ownerState:M}),[ce,se]=Ee("endDecorator",{className:V.endDecorator,elementType:Q_,externalForwardedProps:D,ownerState:M}),[Z,te]=Ee("loadingIndicatorCenter",{className:V.loadingIndicatorCenter,elementType:J_,externalForwardedProps:D,ownerState:M});return s.jsxs(L,R({},U,{children:[(d||g&&v==="start")&&s.jsx(G,R({},oe,{children:g&&v==="start"?$:d})),o,g&&v==="center"&&s.jsx(Z,R({},te,{children:$})),(p||g&&v==="end")&&s.jsx(ce,R({},se,{children:g&&v==="end"?$:p}))]}))});di.muiName="Button";var Np={exports:{}};function eP(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Vc={exports:{}};const tP=Wu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var zp;function Hc(){return zp||(zp=1,function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n=n||function(r,i){var o;if(typeof window!="undefined"&&window.crypto&&(o=window.crypto),typeof self!="undefined"&&self.crypto&&(o=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window!="undefined"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof jt!="undefined"&&jt.crypto&&(o=jt.crypto),!o&&typeof eP=="function")try{o=tP}catch(w){}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch(w){}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch(w){}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function w(){}return function(x){var I;return w.prototype=x,I=new w,w.prototype=null,I}}(),c={},u=c.lib={},f=u.Base=function(){return{extend:function(w){var x=l(this);return w&&x.mixIn(w),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=u.WordArray=f.extend({init:function(w,x){w=this.words=w||[],x!=i?this.sigBytes=x:this.sigBytes=w.length*4},toString:function(w){return(w||g).stringify(this)},concat:function(w){var x=this.words,I=w.words,S=this.sigBytes,A=w.sigBytes;if(this.clamp(),S%4)for(var E=0;E<A;E++){var k=I[E>>>2]>>>24-E%4*8&255;x[S+E>>>2]|=k<<24-(S+E)%4*8}else for(var F=0;F<A;F+=4)x[S+F>>>2]=I[F>>>2];return this.sigBytes+=A,this},clamp:function(){var w=this.words,x=this.sigBytes;w[x>>>2]&=4294967295<<32-x%4*8,w.length=r.ceil(x/4)},clone:function(){var w=f.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var x=[],I=0;I<w;I+=4)x.push(a());return new d.init(x,w)}}),p=c.enc={},g=p.Hex={stringify:function(w){for(var x=w.words,I=w.sigBytes,S=[],A=0;A<I;A++){var E=x[A>>>2]>>>24-A%4*8&255;S.push((E>>>4).toString(16)),S.push((E&15).toString(16))}return S.join("")},parse:function(w){for(var x=w.length,I=[],S=0;S<x;S+=2)I[S>>>3]|=parseInt(w.substr(S,2),16)<<24-S%8*4;return new d.init(I,x/2)}},v=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,S=[],A=0;A<I;A++){var E=x[A>>>2]>>>24-A%4*8&255;S.push(String.fromCharCode(E))}return S.join("")},parse:function(w){for(var x=w.length,I=[],S=0;S<x;S++)I[S>>>2]|=(w.charCodeAt(S)&255)<<24-S%4*8;return new d.init(I,x)}},m=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(v.stringify(w)))}catch(x){throw new Error("Malformed UTF-8 data")}},parse:function(w){return v.parse(unescape(encodeURIComponent(w)))}},b=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=m.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var x,I=this._data,S=I.words,A=I.sigBytes,E=this.blockSize,k=E*4,F=A/k;w?F=r.ceil(F):F=r.max((F|0)-this._minBufferSize,0);var W=F*E,O=r.min(W*4,A);if(W){for(var T=0;T<W;T+=E)this._doProcessBlock(S,T);x=S.splice(0,W),I.sigBytes-=O}return new d.init(x,O)},clone:function(){var w=f.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});u.Hasher=b.extend({cfg:f.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){b.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(w){return function(x,I){return new w.init(I).finalize(x)}},_createHmacHelper:function(w){return function(x,I){return new C.HMAC.init(w,I).finalize(x)}}});var C=c.algo={};return c}(Math);return n})}(Vc)),Vc.exports}(function(e,t){(function(n,r){e.exports=r(Hc())})(jt,function(n){return function(r){var i=n,o=i.lib,a=o.WordArray,l=o.Hasher,c=i.algo,u=[];(function(){for(var m=0;m<64;m++)u[m]=r.abs(r.sin(m+1))*4294967296|0})();var f=c.MD5=l.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,b){for(var C=0;C<16;C++){var w=b+C,x=m[w];m[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,S=m[b+0],A=m[b+1],E=m[b+2],k=m[b+3],F=m[b+4],W=m[b+5],O=m[b+6],T=m[b+7],N=m[b+8],H=m[b+9],j=m[b+10],$=m[b+11],M=m[b+12],V=m[b+13],Y=m[b+14],X=m[b+15],D=I[0],L=I[1],U=I[2],G=I[3];D=d(D,L,U,G,S,7,u[0]),G=d(G,D,L,U,A,12,u[1]),U=d(U,G,D,L,E,17,u[2]),L=d(L,U,G,D,k,22,u[3]),D=d(D,L,U,G,F,7,u[4]),G=d(G,D,L,U,W,12,u[5]),U=d(U,G,D,L,O,17,u[6]),L=d(L,U,G,D,T,22,u[7]),D=d(D,L,U,G,N,7,u[8]),G=d(G,D,L,U,H,12,u[9]),U=d(U,G,D,L,j,17,u[10]),L=d(L,U,G,D,$,22,u[11]),D=d(D,L,U,G,M,7,u[12]),G=d(G,D,L,U,V,12,u[13]),U=d(U,G,D,L,Y,17,u[14]),L=d(L,U,G,D,X,22,u[15]),D=p(D,L,U,G,A,5,u[16]),G=p(G,D,L,U,O,9,u[17]),U=p(U,G,D,L,$,14,u[18]),L=p(L,U,G,D,S,20,u[19]),D=p(D,L,U,G,W,5,u[20]),G=p(G,D,L,U,j,9,u[21]),U=p(U,G,D,L,X,14,u[22]),L=p(L,U,G,D,F,20,u[23]),D=p(D,L,U,G,H,5,u[24]),G=p(G,D,L,U,Y,9,u[25]),U=p(U,G,D,L,k,14,u[26]),L=p(L,U,G,D,N,20,u[27]),D=p(D,L,U,G,V,5,u[28]),G=p(G,D,L,U,E,9,u[29]),U=p(U,G,D,L,T,14,u[30]),L=p(L,U,G,D,M,20,u[31]),D=g(D,L,U,G,W,4,u[32]),G=g(G,D,L,U,N,11,u[33]),U=g(U,G,D,L,$,16,u[34]),L=g(L,U,G,D,Y,23,u[35]),D=g(D,L,U,G,A,4,u[36]),G=g(G,D,L,U,F,11,u[37]),U=g(U,G,D,L,T,16,u[38]),L=g(L,U,G,D,j,23,u[39]),D=g(D,L,U,G,V,4,u[40]),G=g(G,D,L,U,S,11,u[41]),U=g(U,G,D,L,k,16,u[42]),L=g(L,U,G,D,O,23,u[43]),D=g(D,L,U,G,H,4,u[44]),G=g(G,D,L,U,M,11,u[45]),U=g(U,G,D,L,X,16,u[46]),L=g(L,U,G,D,E,23,u[47]),D=v(D,L,U,G,S,6,u[48]),G=v(G,D,L,U,T,10,u[49]),U=v(U,G,D,L,Y,15,u[50]),L=v(L,U,G,D,W,21,u[51]),D=v(D,L,U,G,M,6,u[52]),G=v(G,D,L,U,k,10,u[53]),U=v(U,G,D,L,j,15,u[54]),L=v(L,U,G,D,A,21,u[55]),D=v(D,L,U,G,N,6,u[56]),G=v(G,D,L,U,X,10,u[57]),U=v(U,G,D,L,O,15,u[58]),L=v(L,U,G,D,V,21,u[59]),D=v(D,L,U,G,F,6,u[60]),G=v(G,D,L,U,$,10,u[61]),U=v(U,G,D,L,E,15,u[62]),L=v(L,U,G,D,H,21,u[63]),I[0]=I[0]+D|0,I[1]=I[1]+L|0,I[2]=I[2]+U|0,I[3]=I[3]+G|0},_doFinalize:function(){var m=this._data,b=m.words,C=this._nDataBytes*8,w=m.sigBytes*8;b[w>>>5]|=128<<24-w%32;var x=r.floor(C/4294967296),I=C;b[(w+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b[(w+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,m.sigBytes=(b.length+1)*4,this._process();for(var S=this._hash,A=S.words,E=0;E<4;E++){var k=A[E];A[E]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}return S},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});function d(m,b,C,w,x,I,S){var A=m+(b&C|~b&w)+x+S;return(A<<I|A>>>32-I)+b}function p(m,b,C,w,x,I,S){var A=m+(b&w|C&~w)+x+S;return(A<<I|A>>>32-I)+b}function g(m,b,C,w,x,I,S){var A=m+(b^C^w)+x+S;return(A<<I|A>>>32-I)+b}function v(m,b,C,w,x,I,S){var A=m+(C^(b|~w))+x+S;return(A<<I|A>>>32-I)+b}i.MD5=l._createHelper(f),i.HmacMD5=l._createHmacHelper(f)}(Math),n.MD5})})(Np);var nP=Np.exports;const jp=bn(nP);var Up={exports:{}};(function(e,t){(function(n,r){e.exports=r(Hc())})(jt,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,i=r.lib,o=i.WordArray,a=o.init,l=o.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var u=c.byteLength,f=[],d=0;d<u;d++)f[d>>>2]|=c[d]<<24-d%4*8;a.call(this,f,u)}else a.apply(this,arguments)};l.prototype=o}}(),n.lib.WordArray})})(Up);var rP=Up.exports;const Vp=bn(rP);var Hp={exports:{}};(function(e,t){(function(n,r){e.exports=r(Hc())})(jt,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,a=r.enc;a.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,d=this._map;c.clamp();for(var p=[],g=0;g<f;g+=3)for(var v=u[g>>>2]>>>24-g%4*8&255,m=u[g+1>>>2]>>>24-(g+1)%4*8&255,b=u[g+2>>>2]>>>24-(g+2)%4*8&255,C=v<<16|m<<8|b,w=0;w<4&&g+w*.75<f;w++)p.push(d.charAt(C>>>6*(3-w)&63));var x=d.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(c){var u=c.length,f=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var p=0;p<f.length;p++)d[f.charCodeAt(p)]=p}var g=f.charAt(64);if(g){var v=c.indexOf(g);v!==-1&&(u=v)}return l(c,u,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(c,u,f){for(var d=[],p=0,g=0;g<u;g++)if(g%4){var v=f[c.charCodeAt(g-1)]<<g%4*2,m=f[c.charCodeAt(g)]>>>6-g%4*2,b=v|m;d[p>>>2]|=b<<24-p%4*8,p++}return o.create(d,p)}}(),n.enc.Base64})})(Hp);var iP=Hp.exports;const oP=bn(iP);class Wp{constructor(){J(this,"readFileAndHash",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,l=Vp.create(new Uint8Array(a)),u=jp(l).toString(oP);n(u)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}));J(this,"generateHashFileName",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,l=Vp.create(new Uint8Array(a)),c=jp(l).toString();n(c)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}))}}const Gp=({title:e,open:t,imageSrc:n,toggleModal:r})=>s.jsx(h.Modal,{open:t,onClose:r,children:s.jsxs(h.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[s.jsx(h.ModalClose,{}),s.jsx(h.DialogTitle,{sx:{marginBottom:"10px"},children:e}),s.jsx(h.DialogContent,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:s.jsx("img",{src:n,alt:"Image modal",style:{maxWidth:"100%",maxHeight:"100%"}})})]})}),Yp=Be(s.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),We=()=>{const e=y.useContext(fa);if(!e)throw new Error("useAPIContext must be used within a APIProvider");return e},aP=Be(s.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),sP=({isLoading:e,images:t,onClick:n})=>s.jsxs(s.Fragment,{children:[s.jsx(h.Grid,{container:!0,spacing:2,children:t.map(r=>{var i,o;return s.jsx(h.Grid,{xs:5,sm:4,md:3,children:s.jsxs(h.Box,{sx:{position:"relative",width:"100%","&:hover .overlay":{backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:1},"&:hover .plusSign":{opacity:1}},onClick:()=>{var a,l;return n(((l=(a=r.urls)==null?void 0:a.uploaded)==null?void 0:l.embed)||"")},children:[s.jsx(h.Box,{component:"img",src:(o=(i=r.urls)==null?void 0:i.uploaded)==null?void 0:o.thumbnail,alt:`image-${r.id}`,sx:{width:"100%",height:"auto",borderRadius:"8px"}}),s.jsx(h.Box,{className:"overlay",sx:{position:"absolute",top:0,left:0,right:0,bottom:5,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0)",opacity:0,transition:"background-color 0.3s ease, opacity 0.3s ease",borderRadius:"8px",cursor:"pointer"},children:s.jsx(h.Typography,{className:"plusSign",level:"h2",sx:{color:"white",opacity:0,transition:"opacity 0.3s ease"},children:"+"})})]})},`sportal-image-${r.id}`)})}),e?s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:s.jsx(h.CircularProgress,{variant:"solid",color:"neutral"})}):s.jsx(s.Fragment,{})]}),lP=Be(s.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),cP=Be(s.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),uP=e=>s.jsx(h.Box,{display:"flex",alignItems:"baseline",flexWrap:"wrap",children:s.jsxs(h.Box,{display:"flex",children:[e.pageCount&&e.pageCount!==1&&s.jsx(h.Button,{variant:"outlined",color:"neutral",startDecorator:s.jsx(lP,{}),onClick:e.getPreviousPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:"4px 0 0 4px",borderRight:0,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.previous}),e.images&&e.images.length===20&&s.jsx(h.Button,{variant:"outlined",color:"neutral",endDecorator:s.jsx(cP,{}),onClick:e.getNextPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:e.pageCount!==1?"0 4px 4px 0":"4px",borderLeft:e.pageCount!==1?0:1,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.next})]})}),Xt=Be(s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),dP=Be(s.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),fP=({color:e})=>e==="warning"?s.jsx(dP,{}):s.jsx(Xt,{}),Ge=e=>s.jsx(h.Snackbar,{anchorOrigin:{vertical:"top",horizontal:"right"},open:e.showToast,onClose:e.hideToast,autoHideDuration:3e3,color:e.color,startDecorator:s.jsx(fP,{color:e.color}),children:e.message},e.message),vo=({label:e,defaultValue:t,required:n,onChange:r})=>{const i=o=>{r(o.target.value)};return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:n,color:"primary",children:e}),s.jsx(h.Input,{type:"date",defaultValue:t,onChange:i,sx:{backgroundColor:"#fff",borderRadius:"md"}})]})},hP=({labels:e,showFilters:t,onClick:n})=>s.jsx(h.Tooltip,{title:t?e.hideFilters:e.showFilters,children:s.jsx(h.IconButton,{"aria-label":"Filters",onClick:n,children:s.jsx(aP,{})})}),Kp=({labels:e,onChangeImages:t})=>{const[n,r]=y.useState(!1),[i,o]=y.useState(!1),[a,l]=y.useState(!1),[c,u]=y.useState(!1),[f,d]=y.useState(1),[p,g]=y.useState(""),[v,m]=y.useState(null),[b,C]=y.useState([]),{https:w}=We();y.useEffect(()=>{E()},[f]);const x=()=>u(!c),I=()=>d(F=>F-1),S=()=>d(F=>F+1),A=()=>_(this,null,function*(){if(p){o(!0);const F=v?B({},v):null,W=yield w.fetchImagesFromSportal365(p,F,f);if(W){const O=yield W.json();W.ok?(C(O.data),d(O.meta.pagination.current_page)):(console.error(O),x())}o(!1)}else C([])}),E=()=>_(this,null,function*(){if(p){l(!0),C([]);const F=v&&v.from&&v.to?B({},v):null,W=yield w.fetchImagesFromSportal365(p,F,f);if(W){const O=yield W.json();W.ok?(C(O.data),d(O.meta.pagination.current_page)):(console.error(O),x())}l(!1)}}),k=(F,W)=>{m(O=>O?Q(B({},O),{[W]:F}):{[W]:F})};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(h.Input,{value:p,onChange:F=>g(F.target.value),sx:{mb:2,width:"100%"},placeholder:e.searchImage,endDecorator:s.jsx(hP,{labels:e,showFilters:n,onClick:()=>r(!n)})}),n?s.jsxs(h.Grid,{container:!0,spacing:2,children:[s.jsx(h.Grid,{xs:6,children:s.jsx(vo,{label:e.fromDate,defaultValue:v==null?void 0:v.from,required:!1,onChange:F=>k(F,"from")})}),s.jsx(h.Grid,{xs:6,children:s.jsx(vo,{label:e.toDate,defaultValue:v==null?void 0:v.to,required:!1,onChange:F=>k(F,"to")})})]}):s.jsx(s.Fragment,{}),s.jsx(h.Button,{onClick:A,sx:{mb:2,backgroundColor:"#ef8b34","&:hover":{backgroundColor:"#d7772e"},"&:active":{backgroundColor:"#c06c29"}},loading:i,children:e.search}),s.jsx(sP,{images:b,isLoading:a,onClick:t}),s.jsx(uP,{labels:e,pageCount:f,images:b,getPreviousPage:I,getNextPage:S})]}),s.jsx(Ge,{showToast:c,message:e.searchSportal365ImagesErrorMessage,color:"danger",hideToast:x})]})},qp=Be(s.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.49 2 2 6.49 2 12s4.49 10 10 10h8c1.1 0 2-.9 2-2v-8c0-5.51-4.49-10-10-10m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"Loupe"),Qp=h.styled("input")`
2350
+ `),z_)),Lp=K.forwardRef(function(t,n){const r=gt({props:t,name:"JoyCircularProgress"}),{children:i,className:o,color:a="primary",size:l="md",variant:c="soft",thickness:u,determinate:f=!1,value:d=f?0:25,component:p,slots:g={},slotProps:v={}}=r,m=De(r,N_),b=R({},r,{color:a,size:l,variant:c,thickness:u,value:d,determinate:f,instanceSize:t.size}),C=j_(b),w=R({},m,{component:p,slots:g,slotProps:v}),[x,I]=Ee("root",{ref:n,className:zn(C.root,o),elementType:U_,externalForwardedProps:w,ownerState:b,additionalProps:R({role:"progressbar",style:{"--CircularProgress-percent":d}},d&&f&&{"aria-valuenow":Math.round(typeof d=="number"?d:Number(d||0))})}),[S,A]=Ee("svg",{className:C.svg,elementType:V_,externalForwardedProps:w,ownerState:b}),[E,k]=Ee("track",{className:C.track,elementType:H_,externalForwardedProps:w,ownerState:b}),[F,W]=Ee("progress",{className:C.progress,elementType:W_,externalForwardedProps:w,ownerState:b});return s.jsxs(x,R({},I,{children:[s.jsxs(S,R({},A,{children:[s.jsx(E,R({},k)),s.jsx(F,R({},W))]})),i]}))});function G_(e){return ut("MuiButton",e)}const Bp=Ke("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]),$p=K.createContext({}),Fp=K.createContext(void 0),Y_=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled","component","slots","slotProps"],K_=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,fullWidth:o,size:a,variant:l,loading:c}=e,u={root:["root",n&&"disabled",r&&"focusVisible",o&&"fullWidth",l&&`variant${we(l)}`,t&&`color${we(t)}`,a&&`size${we(a)}`,c&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},f=pt(u,G_,{});return r&&i&&(f.root+=` ${i}`),f},q_=ye("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Q_=ye("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),J_=ye("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,t)=>t.loadingIndicatorCenter})(({theme:e,ownerState:t})=>{var n,r;return R({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),X_=({theme:e,ownerState:t})=>{var n,r,i,o;return[R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.size==="sm"&&{"--Icon-fontSize":e.vars.fontSize.lg,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.25rem)",paddingInline:"0.75rem"},t.size==="md"&&{"--Icon-fontSize":e.vars.fontSize.xl,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.25rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.375rem)",paddingInline:"1rem"},t.size==="lg"&&{"--Icon-fontSize":e.vars.fontSize.xl2,"--CircularProgress-size":"28px","--CircularProgress-thickness":"4px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 2.75rem)",fontSize:e.vars.fontSize.md,paddingBlock:"var(--Button-paddingBlock, 0.5rem)",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",userSelect:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:e.vars.lineHeight.md},t.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),R({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},'&:active, &[aria-pressed="true"]':(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color],[`&.${Bp.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]},t.loadingPosition==="center"&&{[`&.${Bp.loading}`]:{color:"transparent"}})]},Z_=ye("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,t)=>t.root})(X_),di=K.forwardRef(function(t,n){var r;const i=gt({props:t,name:"JoyButton"}),{children:o,action:a,color:l="primary",variant:c="solid",size:u="md",fullWidth:f=!1,startDecorator:d,endDecorator:p,loading:g=!1,loadingPosition:v="center",loadingIndicator:m,disabled:b,component:C,slots:w={},slotProps:x={}}=i,I=De(i,Y_),S=K.useContext($p),A=K.useContext(Fp),E=t.variant||S.variant||c,k=t.size||S.size||u,F=t.color||S.color||l,W=(r=t.loading||t.disabled)!=null?r:S.disabled||g||b,O=K.useRef(null),T=hn(O,n),{focusVisible:N,setFocusVisible:H,getRootProps:j}=Jl(R({},i,{disabled:W,rootRef:T})),$=m!=null?m:s.jsx(Lp,{color:F,thickness:{sm:2,md:3,lg:4}[k]||3});K.useImperativeHandle(a,()=>({focusVisible:()=>{var ne;H(!0),(ne=O.current)==null||ne.focus()}}),[H]);const M=R({},i,{color:F,fullWidth:f,variant:E,size:k,focusVisible:N,loading:g,loadingPosition:v,disabled:W}),V=K_(M),Y=ne=>{var de;let ve=i.onClick;if(typeof x.root=="function"?ve=x.root(M).onClick:x.root&&(ve=x.root.onClick),(de=ve)==null||de(ne),A){var Fe;(Fe=A.onClick)==null||Fe.call(A,ne,i.value)}};let X=i["aria-pressed"];typeof x.root=="function"?X=x.root(M)["aria-pressed"]:x.root&&(X=x.root["aria-pressed"]),A!=null&&A.value&&(Array.isArray(A.value)?X=A.value.indexOf(i.value)!==-1:X=A.value===i.value);const D=R({},I,{component:C,slots:w,slotProps:x}),[L,U]=Ee("root",{ref:n,className:V.root,elementType:Z_,externalForwardedProps:D,getSlotProps:j,ownerState:M,additionalProps:{onClick:Y,"aria-pressed":X}}),[G,oe]=Ee("startDecorator",{className:V.startDecorator,elementType:q_,externalForwardedProps:D,ownerState:M}),[ce,se]=Ee("endDecorator",{className:V.endDecorator,elementType:Q_,externalForwardedProps:D,ownerState:M}),[Z,te]=Ee("loadingIndicatorCenter",{className:V.loadingIndicatorCenter,elementType:J_,externalForwardedProps:D,ownerState:M});return s.jsxs(L,R({},U,{children:[(d||g&&v==="start")&&s.jsx(G,R({},oe,{children:g&&v==="start"?$:d})),o,g&&v==="center"&&s.jsx(Z,R({},te,{children:$})),(p||g&&v==="end")&&s.jsx(ce,R({},se,{children:g&&v==="end"?$:p}))]}))});di.muiName="Button";var Np={exports:{}};function eP(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Vc={exports:{}};const tP=Wu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var zp;function Hc(){return zp||(zp=1,function(e,t){(function(n,r){e.exports=r()})(zt,function(){var n=n||function(r,i){var o;if(typeof window!="undefined"&&window.crypto&&(o=window.crypto),typeof self!="undefined"&&self.crypto&&(o=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window!="undefined"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof zt!="undefined"&&zt.crypto&&(o=zt.crypto),!o&&typeof eP=="function")try{o=tP}catch(w){}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch(w){}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch(w){}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function w(){}return function(x){var I;return w.prototype=x,I=new w,w.prototype=null,I}}(),c={},u=c.lib={},f=u.Base=function(){return{extend:function(w){var x=l(this);return w&&x.mixIn(w),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=u.WordArray=f.extend({init:function(w,x){w=this.words=w||[],x!=i?this.sigBytes=x:this.sigBytes=w.length*4},toString:function(w){return(w||g).stringify(this)},concat:function(w){var x=this.words,I=w.words,S=this.sigBytes,A=w.sigBytes;if(this.clamp(),S%4)for(var E=0;E<A;E++){var k=I[E>>>2]>>>24-E%4*8&255;x[S+E>>>2]|=k<<24-(S+E)%4*8}else for(var F=0;F<A;F+=4)x[S+F>>>2]=I[F>>>2];return this.sigBytes+=A,this},clamp:function(){var w=this.words,x=this.sigBytes;w[x>>>2]&=4294967295<<32-x%4*8,w.length=r.ceil(x/4)},clone:function(){var w=f.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var x=[],I=0;I<w;I+=4)x.push(a());return new d.init(x,w)}}),p=c.enc={},g=p.Hex={stringify:function(w){for(var x=w.words,I=w.sigBytes,S=[],A=0;A<I;A++){var E=x[A>>>2]>>>24-A%4*8&255;S.push((E>>>4).toString(16)),S.push((E&15).toString(16))}return S.join("")},parse:function(w){for(var x=w.length,I=[],S=0;S<x;S+=2)I[S>>>3]|=parseInt(w.substr(S,2),16)<<24-S%8*4;return new d.init(I,x/2)}},v=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,S=[],A=0;A<I;A++){var E=x[A>>>2]>>>24-A%4*8&255;S.push(String.fromCharCode(E))}return S.join("")},parse:function(w){for(var x=w.length,I=[],S=0;S<x;S++)I[S>>>2]|=(w.charCodeAt(S)&255)<<24-S%4*8;return new d.init(I,x)}},m=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(v.stringify(w)))}catch(x){throw new Error("Malformed UTF-8 data")}},parse:function(w){return v.parse(unescape(encodeURIComponent(w)))}},b=u.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=m.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var x,I=this._data,S=I.words,A=I.sigBytes,E=this.blockSize,k=E*4,F=A/k;w?F=r.ceil(F):F=r.max((F|0)-this._minBufferSize,0);var W=F*E,O=r.min(W*4,A);if(W){for(var T=0;T<W;T+=E)this._doProcessBlock(S,T);x=S.splice(0,W),I.sigBytes-=O}return new d.init(x,O)},clone:function(){var w=f.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});u.Hasher=b.extend({cfg:f.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){b.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(w){return function(x,I){return new w.init(I).finalize(x)}},_createHmacHelper:function(w){return function(x,I){return new C.HMAC.init(w,I).finalize(x)}}});var C=c.algo={};return c}(Math);return n})}(Vc)),Vc.exports}(function(e,t){(function(n,r){e.exports=r(Hc())})(zt,function(n){return function(r){var i=n,o=i.lib,a=o.WordArray,l=o.Hasher,c=i.algo,u=[];(function(){for(var m=0;m<64;m++)u[m]=r.abs(r.sin(m+1))*4294967296|0})();var f=c.MD5=l.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,b){for(var C=0;C<16;C++){var w=b+C,x=m[w];m[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,S=m[b+0],A=m[b+1],E=m[b+2],k=m[b+3],F=m[b+4],W=m[b+5],O=m[b+6],T=m[b+7],N=m[b+8],H=m[b+9],j=m[b+10],$=m[b+11],M=m[b+12],V=m[b+13],Y=m[b+14],X=m[b+15],D=I[0],L=I[1],U=I[2],G=I[3];D=d(D,L,U,G,S,7,u[0]),G=d(G,D,L,U,A,12,u[1]),U=d(U,G,D,L,E,17,u[2]),L=d(L,U,G,D,k,22,u[3]),D=d(D,L,U,G,F,7,u[4]),G=d(G,D,L,U,W,12,u[5]),U=d(U,G,D,L,O,17,u[6]),L=d(L,U,G,D,T,22,u[7]),D=d(D,L,U,G,N,7,u[8]),G=d(G,D,L,U,H,12,u[9]),U=d(U,G,D,L,j,17,u[10]),L=d(L,U,G,D,$,22,u[11]),D=d(D,L,U,G,M,7,u[12]),G=d(G,D,L,U,V,12,u[13]),U=d(U,G,D,L,Y,17,u[14]),L=d(L,U,G,D,X,22,u[15]),D=p(D,L,U,G,A,5,u[16]),G=p(G,D,L,U,O,9,u[17]),U=p(U,G,D,L,$,14,u[18]),L=p(L,U,G,D,S,20,u[19]),D=p(D,L,U,G,W,5,u[20]),G=p(G,D,L,U,j,9,u[21]),U=p(U,G,D,L,X,14,u[22]),L=p(L,U,G,D,F,20,u[23]),D=p(D,L,U,G,H,5,u[24]),G=p(G,D,L,U,Y,9,u[25]),U=p(U,G,D,L,k,14,u[26]),L=p(L,U,G,D,N,20,u[27]),D=p(D,L,U,G,V,5,u[28]),G=p(G,D,L,U,E,9,u[29]),U=p(U,G,D,L,T,14,u[30]),L=p(L,U,G,D,M,20,u[31]),D=g(D,L,U,G,W,4,u[32]),G=g(G,D,L,U,N,11,u[33]),U=g(U,G,D,L,$,16,u[34]),L=g(L,U,G,D,Y,23,u[35]),D=g(D,L,U,G,A,4,u[36]),G=g(G,D,L,U,F,11,u[37]),U=g(U,G,D,L,T,16,u[38]),L=g(L,U,G,D,j,23,u[39]),D=g(D,L,U,G,V,4,u[40]),G=g(G,D,L,U,S,11,u[41]),U=g(U,G,D,L,k,16,u[42]),L=g(L,U,G,D,O,23,u[43]),D=g(D,L,U,G,H,4,u[44]),G=g(G,D,L,U,M,11,u[45]),U=g(U,G,D,L,X,16,u[46]),L=g(L,U,G,D,E,23,u[47]),D=v(D,L,U,G,S,6,u[48]),G=v(G,D,L,U,T,10,u[49]),U=v(U,G,D,L,Y,15,u[50]),L=v(L,U,G,D,W,21,u[51]),D=v(D,L,U,G,M,6,u[52]),G=v(G,D,L,U,k,10,u[53]),U=v(U,G,D,L,j,15,u[54]),L=v(L,U,G,D,A,21,u[55]),D=v(D,L,U,G,N,6,u[56]),G=v(G,D,L,U,X,10,u[57]),U=v(U,G,D,L,O,15,u[58]),L=v(L,U,G,D,V,21,u[59]),D=v(D,L,U,G,F,6,u[60]),G=v(G,D,L,U,$,10,u[61]),U=v(U,G,D,L,E,15,u[62]),L=v(L,U,G,D,H,21,u[63]),I[0]=I[0]+D|0,I[1]=I[1]+L|0,I[2]=I[2]+U|0,I[3]=I[3]+G|0},_doFinalize:function(){var m=this._data,b=m.words,C=this._nDataBytes*8,w=m.sigBytes*8;b[w>>>5]|=128<<24-w%32;var x=r.floor(C/4294967296),I=C;b[(w+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,b[(w+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,m.sigBytes=(b.length+1)*4,this._process();for(var S=this._hash,A=S.words,E=0;E<4;E++){var k=A[E];A[E]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}return S},clone:function(){var m=l.clone.call(this);return m._hash=this._hash.clone(),m}});function d(m,b,C,w,x,I,S){var A=m+(b&C|~b&w)+x+S;return(A<<I|A>>>32-I)+b}function p(m,b,C,w,x,I,S){var A=m+(b&w|C&~w)+x+S;return(A<<I|A>>>32-I)+b}function g(m,b,C,w,x,I,S){var A=m+(b^C^w)+x+S;return(A<<I|A>>>32-I)+b}function v(m,b,C,w,x,I,S){var A=m+(C^(b|~w))+x+S;return(A<<I|A>>>32-I)+b}i.MD5=l._createHelper(f),i.HmacMD5=l._createHmacHelper(f)}(Math),n.MD5})})(Np);var nP=Np.exports;const jp=bn(nP);var Up={exports:{}};(function(e,t){(function(n,r){e.exports=r(Hc())})(zt,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,i=r.lib,o=i.WordArray,a=o.init,l=o.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var u=c.byteLength,f=[],d=0;d<u;d++)f[d>>>2]|=c[d]<<24-d%4*8;a.call(this,f,u)}else a.apply(this,arguments)};l.prototype=o}}(),n.lib.WordArray})})(Up);var rP=Up.exports;const Vp=bn(rP);var Hp={exports:{}};(function(e,t){(function(n,r){e.exports=r(Hc())})(zt,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,a=r.enc;a.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,d=this._map;c.clamp();for(var p=[],g=0;g<f;g+=3)for(var v=u[g>>>2]>>>24-g%4*8&255,m=u[g+1>>>2]>>>24-(g+1)%4*8&255,b=u[g+2>>>2]>>>24-(g+2)%4*8&255,C=v<<16|m<<8|b,w=0;w<4&&g+w*.75<f;w++)p.push(d.charAt(C>>>6*(3-w)&63));var x=d.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(c){var u=c.length,f=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var p=0;p<f.length;p++)d[f.charCodeAt(p)]=p}var g=f.charAt(64);if(g){var v=c.indexOf(g);v!==-1&&(u=v)}return l(c,u,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(c,u,f){for(var d=[],p=0,g=0;g<u;g++)if(g%4){var v=f[c.charCodeAt(g-1)]<<g%4*2,m=f[c.charCodeAt(g)]>>>6-g%4*2,b=v|m;d[p>>>2]|=b<<24-p%4*8,p++}return o.create(d,p)}}(),n.enc.Base64})})(Hp);var iP=Hp.exports;const oP=bn(iP);class Wp{constructor(){J(this,"readFileAndHash",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,l=Vp.create(new Uint8Array(a)),u=jp(l).toString(oP);n(u)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}));J(this,"generateHashFileName",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,l=Vp.create(new Uint8Array(a)),c=jp(l).toString();n(c)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}))}}const Gp=({title:e,open:t,imageSrc:n,toggleModal:r})=>s.jsx(h.Modal,{open:t,onClose:r,children:s.jsxs(h.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[s.jsx(h.ModalClose,{}),s.jsx(h.DialogTitle,{sx:{marginBottom:"10px"},children:e}),s.jsx(h.DialogContent,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:s.jsx("img",{src:n,alt:"Image modal",style:{maxWidth:"100%",maxHeight:"100%"}})})]})}),Yp=Be(s.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),We=()=>{const e=y.useContext(fa);if(!e)throw new Error("useAPIContext must be used within a APIProvider");return e},aP=Be(s.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),sP=({isLoading:e,images:t,onClick:n})=>s.jsxs(s.Fragment,{children:[s.jsx(h.Grid,{container:!0,spacing:2,children:t.map(r=>{var i,o;return s.jsx(h.Grid,{xs:5,sm:4,md:3,children:s.jsxs(h.Box,{sx:{position:"relative",width:"100%","&:hover .overlay":{backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:1},"&:hover .plusSign":{opacity:1}},onClick:()=>{var a,l;return n(((l=(a=r.urls)==null?void 0:a.uploaded)==null?void 0:l.embed)||"")},children:[s.jsx(h.Box,{component:"img",src:(o=(i=r.urls)==null?void 0:i.uploaded)==null?void 0:o.thumbnail,alt:`image-${r.id}`,sx:{width:"100%",height:"auto",borderRadius:"8px"}}),s.jsx(h.Box,{className:"overlay",sx:{position:"absolute",top:0,left:0,right:0,bottom:5,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0)",opacity:0,transition:"background-color 0.3s ease, opacity 0.3s ease",borderRadius:"8px",cursor:"pointer"},children:s.jsx(h.Typography,{className:"plusSign",level:"h2",sx:{color:"white",opacity:0,transition:"opacity 0.3s ease"},children:"+"})})]})},`sportal-image-${r.id}`)})}),e?s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:s.jsx(h.CircularProgress,{variant:"solid",color:"neutral"})}):s.jsx(s.Fragment,{})]}),lP=Be(s.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),cP=Be(s.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),uP=e=>s.jsx(h.Box,{display:"flex",alignItems:"baseline",flexWrap:"wrap",children:s.jsxs(h.Box,{display:"flex",children:[e.pageCount&&e.pageCount!==1&&s.jsx(h.Button,{variant:"outlined",color:"neutral",startDecorator:s.jsx(lP,{}),onClick:e.getPreviousPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:"4px 0 0 4px",borderRight:0,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.previous}),e.images&&e.images.length===20&&s.jsx(h.Button,{variant:"outlined",color:"neutral",endDecorator:s.jsx(cP,{}),onClick:e.getNextPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:e.pageCount!==1?"0 4px 4px 0":"4px",borderLeft:e.pageCount!==1?0:1,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.next})]})}),Xt=Be(s.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),dP=Be(s.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),fP=({color:e})=>e==="warning"?s.jsx(dP,{}):s.jsx(Xt,{}),Ge=e=>s.jsx(h.Snackbar,{anchorOrigin:{vertical:"top",horizontal:"right"},open:e.showToast,onClose:e.hideToast,autoHideDuration:3e3,color:e.color,startDecorator:s.jsx(fP,{color:e.color}),children:e.message},e.message),vo=({label:e,defaultValue:t,required:n,onChange:r})=>{const i=o=>{r(o.target.value)};return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:n,color:"primary",children:e}),s.jsx(h.Input,{type:"date",defaultValue:t,onChange:i,sx:{backgroundColor:"#fff",borderRadius:"md"}})]})},hP=({labels:e,showFilters:t,onClick:n})=>s.jsx(h.Tooltip,{title:t?e.hideFilters:e.showFilters,children:s.jsx(h.IconButton,{"aria-label":"Filters",onClick:n,children:s.jsx(aP,{})})}),Kp=({labels:e,onChangeImages:t})=>{const[n,r]=y.useState(!1),[i,o]=y.useState(!1),[a,l]=y.useState(!1),[c,u]=y.useState(!1),[f,d]=y.useState(1),[p,g]=y.useState(""),[v,m]=y.useState(null),[b,C]=y.useState([]),{https:w}=We();y.useEffect(()=>{E()},[f]);const x=()=>u(!c),I=()=>d(F=>F-1),S=()=>d(F=>F+1),A=()=>_(this,null,function*(){if(p){o(!0);const F=v?B({},v):null,W=yield w.fetchImagesFromSportal365(p,F,f);if(W){const O=yield W.json();W.ok?(C(O.data),d(O.meta.pagination.current_page)):(console.error(O),x())}o(!1)}else C([])}),E=()=>_(this,null,function*(){if(p){l(!0),C([]);const F=v&&v.from&&v.to?B({},v):null,W=yield w.fetchImagesFromSportal365(p,F,f);if(W){const O=yield W.json();W.ok?(C(O.data),d(O.meta.pagination.current_page)):(console.error(O),x())}l(!1)}}),k=(F,W)=>{m(O=>O?Q(B({},O),{[W]:F}):{[W]:F})};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(h.Input,{value:p,onChange:F=>g(F.target.value),sx:{mb:2,width:"100%"},placeholder:e.searchImage,endDecorator:s.jsx(hP,{labels:e,showFilters:n,onClick:()=>r(!n)})}),n?s.jsxs(h.Grid,{container:!0,spacing:2,children:[s.jsx(h.Grid,{xs:6,children:s.jsx(vo,{label:e.fromDate,defaultValue:v==null?void 0:v.from,required:!1,onChange:F=>k(F,"from")})}),s.jsx(h.Grid,{xs:6,children:s.jsx(vo,{label:e.toDate,defaultValue:v==null?void 0:v.to,required:!1,onChange:F=>k(F,"to")})})]}):s.jsx(s.Fragment,{}),s.jsx(h.Button,{onClick:A,sx:{mb:2,backgroundColor:"#ef8b34","&:hover":{backgroundColor:"#d7772e"},"&:active":{backgroundColor:"#c06c29"}},loading:i,children:e.search}),s.jsx(sP,{images:b,isLoading:a,onClick:t}),s.jsx(uP,{labels:e,pageCount:f,images:b,getPreviousPage:I,getNextPage:S})]}),s.jsx(Ge,{showToast:c,message:e.searchSportal365ImagesErrorMessage,color:"danger",hideToast:x})]})},qp=Be(s.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.49 2 2 6.49 2 12s4.49 10 10 10h8c1.1 0 2-.9 2-2v-8c0-5.51-4.49-10-10-10m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"Loupe"),Qp=h.styled("input")`
2351
2351
  clip: rect(0 0 0 0);
2352
2352
  clip-path: inset(50%);
2353
2353
  height: 1px;
@@ -2357,7 +2357,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
2357
2357
  left: 0;
2358
2358
  white-space: nowrap;
2359
2359
  width: 1px;
2360
- `;var Jp=!1,Pr,Wc,Gc,os,as,Xp,ss,Yc,Kc,qc,Zp,Qc,Jc,eg,tg;function Ht(){if(!Jp){Jp=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),n=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(Qc=/\b(iPhone|iP[ao]d)/.exec(e),Jc=/\b(iP[ao]d)/.exec(e),qc=/Android/i.exec(e),eg=/FBAN\/\w+;/i.exec(e),tg=/Mobile/i.exec(e),Zp=!!/Win64/.exec(e),t){Pr=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,Pr&&document&&document.documentMode&&(Pr=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(e);Xp=r?parseFloat(r[1])+4:Pr,Wc=t[2]?parseFloat(t[2]):NaN,Gc=t[3]?parseFloat(t[3]):NaN,os=t[4]?parseFloat(t[4]):NaN,os?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),as=t&&t[1]?parseFloat(t[1]):NaN):as=NaN}else Pr=Wc=Gc=as=os=NaN;if(n){if(n[1]){var i=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);ss=i?parseFloat(i[1].replace("_",".")):!0}else ss=!1;Yc=!!n[2],Kc=!!n[3]}else ss=Yc=Kc=!1}}var Xc={ie:function(){return Ht()||Pr},ieCompatibilityMode:function(){return Ht()||Xp>Pr},ie64:function(){return Xc.ie()&&Zp},firefox:function(){return Ht()||Wc},opera:function(){return Ht()||Gc},webkit:function(){return Ht()||os},safari:function(){return Xc.webkit()},chrome:function(){return Ht()||as},windows:function(){return Ht()||Yc},osx:function(){return Ht()||ss},linux:function(){return Ht()||Kc},iphone:function(){return Ht()||Qc},mobile:function(){return Ht()||Qc||Jc||qc||tg},nativeApp:function(){return Ht()||eg},android:function(){return Ht()||qc},ipad:function(){return Ht()||Jc}},pP=Xc,ls=!!(typeof window!="undefined"&&window.document&&window.document.createElement),gP={canUseDOM:ls,canUseWorkers:typeof Worker!="undefined",canUseEventListeners:ls&&!!(window.addEventListener||window.attachEvent),canUseViewport:ls&&!!window.screen,isInWorker:!ls},mP=gP,ng=mP,rg;ng.canUseDOM&&(rg=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
2360
+ `;var Jp=!1,Pr,Wc,Gc,os,as,Xp,ss,Yc,Kc,qc,Zp,Qc,Jc,eg,tg;function Vt(){if(!Jp){Jp=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),n=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(Qc=/\b(iPhone|iP[ao]d)/.exec(e),Jc=/\b(iP[ao]d)/.exec(e),qc=/Android/i.exec(e),eg=/FBAN\/\w+;/i.exec(e),tg=/Mobile/i.exec(e),Zp=!!/Win64/.exec(e),t){Pr=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,Pr&&document&&document.documentMode&&(Pr=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(e);Xp=r?parseFloat(r[1])+4:Pr,Wc=t[2]?parseFloat(t[2]):NaN,Gc=t[3]?parseFloat(t[3]):NaN,os=t[4]?parseFloat(t[4]):NaN,os?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),as=t&&t[1]?parseFloat(t[1]):NaN):as=NaN}else Pr=Wc=Gc=as=os=NaN;if(n){if(n[1]){var i=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);ss=i?parseFloat(i[1].replace("_",".")):!0}else ss=!1;Yc=!!n[2],Kc=!!n[3]}else ss=Yc=Kc=!1}}var Xc={ie:function(){return Vt()||Pr},ieCompatibilityMode:function(){return Vt()||Xp>Pr},ie64:function(){return Xc.ie()&&Zp},firefox:function(){return Vt()||Wc},opera:function(){return Vt()||Gc},webkit:function(){return Vt()||os},safari:function(){return Xc.webkit()},chrome:function(){return Vt()||as},windows:function(){return Vt()||Yc},osx:function(){return Vt()||ss},linux:function(){return Vt()||Kc},iphone:function(){return Vt()||Qc},mobile:function(){return Vt()||Qc||Jc||qc||tg},nativeApp:function(){return Vt()||eg},android:function(){return Vt()||qc},ipad:function(){return Vt()||Jc}},pP=Xc,ls=!!(typeof window!="undefined"&&window.document&&window.document.createElement),gP={canUseDOM:ls,canUseWorkers:typeof Worker!="undefined",canUseEventListeners:ls&&!!(window.addEventListener||window.attachEvent),canUseViewport:ls&&!!window.screen,isInWorker:!ls},mP=gP,ng=mP,rg;ng.canUseDOM&&(rg=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
2361
2361
  * Checks if an event is supported in the current execution environment.
2362
2362
  *
2363
2363
  * NOTE: This will not work correctly for non-generic events such as `change`,
@@ -2450,17 +2450,17 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
2450
2450
  border-left: 0;
2451
2451
  border-right: 0;
2452
2452
  }
2453
- `,MP=1,LP=3,BP=function(e){Iy(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.imageRef=K.createRef(),n.videoRef=K.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document!="undefined"?document:null,n.currentWindow=typeof window!="undefined"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver=="undefined"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=_P(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=i.crop,a=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}else if(n.props.initialCroppedAreaPixels){var l=DP(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=l.crop,a=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}},n.computeSizes=function(){var r,i,o,a,l,c,u=n.imageRef.current||n.videoRef.current;if(u&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var f=n.containerRect.width/n.containerRect.height,d=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,p=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=n.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,g=u.offsetWidth<d||u.offsetHeight<p,v=d/p,m=void 0;if(g)switch(n.state.mediaObjectFit){default:case"contain":m=f>v?{width:n.containerRect.height*v,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/v};break;case"horizontal-cover":m={width:n.containerRect.width,height:n.containerRect.width/v};break;case"vertical-cover":m={width:n.containerRect.height*v,height:n.containerRect.height};break}else m={width:u.offsetWidth,height:u.offsetHeight};n.mediaSize=Pt(Pt({},m),{naturalWidth:d,naturalHeight:p}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var b=n.props.cropSize?n.props.cropSize:IP(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((l=n.state.cropSize)===null||l===void 0?void 0:l.height)!==b.height||((c=n.state.cropSize)===null||c===void 0?void 0:c.width)!==b.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(b),n.setState({cropSize:b},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(b),b}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var i=t.getMousePoint(r),o=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var a=n.gestureRotationStart+r.rotation;n.props.onRotationChange(a)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,o,a=r.x,l=r.y;n.dragStartPosition={x:a,y:l},n.dragStartCrop=Pt({},n.props.crop),(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i)},n.onDrag=function(r){var i=r.x,o=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||o===void 0)){var a=i-n.dragStartPosition.x,l=o-n.dragStartPosition.y,c={x:n.dragStartCrop.x+a,y:n.dragStartCrop.y+l},u=n.props.restrictPosition?cs(c,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):c;n.props.onCropChange(u)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=t.getMousePoint(r),o=SP(r).pixelY,a=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(a,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var l,c;return(c=(l=n.props).onInteractionStart)===null||c===void 0?void 0:c.call(l)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var l,c;return(c=(l=n.props).onInteractionEnd)===null||c===void 0?void 0:c.call(l)})},250)}},n.getPointOnContainer=function(r,i){var o=r.x,a=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-i.x),y:n.containerRect.height/2-(a-i.y)}},n.getPointOnMedia=function(r){var i=r.x,o=r.y,a=n.props,l=a.crop,c=a.zoom;return{x:(i+l.x)/c,y:(o+l.y)/c}},n.setNewZoom=function(r,i,o){var a=o===void 0?{}:o,l=a.shouldUpdatePosition,c=l===void 0?!0:l;if(!(!n.state.cropSize||!n.props.onZoomChange)){var u=us(r,n.props.minZoom,n.props.maxZoom);if(c){var f=n.getPointOnContainer(i,n.containerPosition),d=n.getPointOnMedia(f),p={x:d.x*u-f.x,y:d.y*u-f.y},g=n.props.restrictPosition?cs(p,n.mediaSize,n.state.cropSize,u,n.props.rotation):p;n.props.onCropChange(g)}n.props.onZoomChange(u)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?cs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return TP(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?cs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver=="undefined"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=RP,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver=="undefined"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,i,o,a,l,c,u,f,d;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((o=n.cropSize)===null||o===void 0?void 0:o.width)!==((a=this.props.cropSize)===null||a===void 0?void 0:a.width)?this.computeSizes():(((l=n.crop)===null||l===void 0?void 0:l.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((u=n.crop)===null||u===void 0?void 0:u.y)!==((f=this.props.crop)===null||f===void 0?void 0:f.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((d=this.videoRef.current)===null||d===void 0||d.load());var p=this.getObjectFit();p!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:p},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},t.prototype.getObjectFit=function(){var n,r,i,o;if(this.props.objectFit==="cover"){var a=this.imageRef.current||this.videoRef.current;if(a&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var l=this.containerRect.width/this.containerRect.height,c=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,f=c/u;return f<l?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),i=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=cg(r,i),this.lastPinchRotation=ug(r,i),this.onDragStart(dg(r,i))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]),a=dg(i,o);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var l=cg(i,o),c=r.props.zoom*(l/r.lastPinchDistance);r.setNewZoom(c,a,{shouldUpdatePosition:!1}),r.lastPinchDistance=l;var u=ug(i,o),f=r.props.rotation+(u-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(f),r.lastPinchRotation=u})}},t.prototype.render=function(){var n=this,r,i=this.props,o=i.image,a=i.video,l=i.mediaProps,c=i.transform,u=i.crop,f=u.x,d=u.y,p=i.rotation,g=i.zoom,v=i.cropShape,m=i.showGrid,b=i.style,C=b.containerStyle,w=b.cropAreaStyle,x=b.mediaStyle,I=i.classes,S=I.containerClassName,A=I.cropAreaClassName,E=I.mediaClassName,k=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return K.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(W){return n.containerRef=W},"data-testid":"container",style:C,className:ds("reactEasyCrop_Container",S)},o?K.createElement("img",Pt({alt:"",className:ds("reactEasyCrop_Image",k==="contain"&&"reactEasyCrop_Contain",k==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",k==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{src:o,ref:this.imageRef,style:Pt(Pt({},x),{transform:c||"translate(".concat(f,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),onLoad:this.onMediaLoad})):a&&K.createElement("video",Pt({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:ds("reactEasyCrop_Video",k==="contain"&&"reactEasyCrop_Contain",k==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",k==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Pt(Pt({},x),{transform:c||"translate(".concat(f,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(F){return K.createElement("source",Pt({key:F.src},F))})),this.state.cropSize&&K.createElement("div",{style:Pt(Pt({},w),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:ds("reactEasyCrop_CropArea",v==="round"&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",A)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:LP,minZoom:MP,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t}(K.Component);const $P=e=>new Promise((t,n)=>{const r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",i=>n(i)),r.crossOrigin="Anonymous",r.src=e});function FP(e){return e*Math.PI/180}function NP(e,t,n=0){return _(this,null,function*(){const r=yield $P(e),i=document.createElement("canvas"),o=i.getContext("2d"),l=2*(Math.max(r.width,r.height)/2*Math.sqrt(2));i.width=l,i.height=l,o.translate(l/2,l/2),o.rotate(FP(n)),o.translate(-l/2,-l/2),o.drawImage(r,l/2-r.width*.5,l/2-r.height*.5);const c=o.getImageData(0,0,l,l);return i.width=t.width,i.height=t.height,o.putImageData(c,Math.round(0-l/2+r.width*.5-t.x),Math.round(0-l/2+r.height*.5-t.y)),new Promise(u=>i.toBlob(f=>{const d=new File([f],`cropped_image_${Date.now()}.jpeg`,{type:"image/jpeg"});u(d)},"image/jpeg"))})}const fg=({labels:e,open:t,imageSrc:n,resetDefaultImageUrl:r,toggleModal:i,uploadImage:o})=>{const[a,l]=y.useState({x:0,y:0}),[c,u]=y.useState(1),[f,d]=y.useState(16/9),[p,g]=y.useState(null),v=(x,I)=>{g(I)},m=(x,I)=>d(I),b=()=>_(this,null,function*(){const x=yield NP(n,p);w(),o(x)}),C=()=>{w(),r()},w=()=>{l({x:0,y:0}),u(1),d(16/9),g(null)};return s.jsx(h.Modal,{open:t,onClose:i,children:s.jsxs(h.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[s.jsx(h.ModalClose,{}),s.jsx(h.DialogTitle,{children:e.cropImage}),s.jsxs(h.DialogContent,{sx:{width:"100%"},children:[s.jsx(h.Box,{position:"relative",height:"100%",width:"100%",mb:2,children:s.jsx(BP,{image:n,crop:a,zoom:c,aspect:f,onCropChange:l,onCropComplete:v,onZoomChange:u})}),s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.aspectRatio}),s.jsxs(h.Select,{value:f,onChange:m,children:[s.jsx(h.Option,{value:4/3,children:"4 / 3"}),s.jsx(h.Option,{value:16/9,children:"16 / 9"}),s.jsx(h.Option,{value:1,children:"1"})]})]}),s.jsx(h.Box,{mb:1,mx:2,children:s.jsx(h.Slider,{value:c,min:1,max:3,step:.1,onChange:(x,I)=>u(I)})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{color:"primary",onClick:b,loading:!1,children:e.crop}),s.jsx(h.Button,{color:"primary",variant:"outlined",onClick:C,loading:!1,children:e.reset})]})]})]})})},hg=Be(s.jsx("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2z"}),"CropOutlined"),pg=({labels:e,title:t,image:n,onChangeImages:r,clearImage:i})=>{const[o,a]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(!1),[d,p]=y.useState(!1),[g,v]=y.useState(""),[m,b]=y.useState("primary"),[C,w]=y.useState(""),x=y.useRef(null),I=()=>p(!d),S=()=>{x.current&&x.current.click()},A=new Wp,E=y.useContext(fa),k=()=>{v(""),c(!1)},F=M=>{let V="",Y="primary";switch(M){case"copy_url":V=e.urlCopiedToClipboardMessage,Y="primary";break;case"image_deleted":V=e.imageDeletedMessage,Y="primary";break;case"image_reset":V=e.imageResetMessage,Y="primary";break;case"upload_success":V=e.uploadingImageMessage,Y="success";break;case"upload_failed":V=e.uploadingImageErrorMessage,Y="danger";break;case"sign_in_url_failed":V=e.generateSignedInUrlErrorMessage,Y="danger";break;case"encrypting_file_failed":V=e.encryptingImageErrorMessage,Y="danger";break}b(Y),v(V),c(!0)},W=()=>f(!u),O=()=>{i(),F("image_deleted")},T=M=>{navigator.clipboard.writeText(M),F("copy_url")},N=M=>_(this,null,function*(){M.persist();const V=M.target.files?M.target.files[0]:null;if(V){a(!0);try{const Y=V.type.split("/")[1],X=yield A.readFileAndHash(V),D=(yield A.generateHashFileName(V))+"."+Y,L={image_type:Y,image_file_name:D,image_size:V.size,base64_sum:X},U=yield E==null?void 0:E.https.generateSignedInUrl(L);if(U!=null&&U.ok){const G=yield U.json(),oe={"Content-Type":V.type,"Content-MD5":X};try{const ce=new File([V],D,{type:V.type}),se=yield E==null?void 0:E.https.storeInBucket(G.data.signed_url,ce,oe);r(se||""),w(se),F("upload_success")}catch(ce){console.error("There was a problem with uploading the file: ",ce),F("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield U==null?void 0:U.json()),F("sign_in_url_failed")}catch(Y){console.error("There was a problem with encrypting file...",Y),F("encrypting_file_failed")}a(!1)}}),H=M=>_(this,null,function*(){if(M){a(!0);try{const V=M.type.split("/")[1],Y=yield A.readFileAndHash(M),X=(yield A.generateHashFileName(M))+"."+V,D={image_type:V,image_file_name:X,image_size:M.size,base64_sum:Y},L=yield E==null?void 0:E.https.generateSignedInUrl(D);if(L!=null&&L.ok){const U=yield L.json(),G={"Content-Type":M.type,"Content-MD5":Y};try{const oe=new File([M],X,{type:M.type}),ce=yield E==null?void 0:E.https.storeInBucket(U.data.signed_url,oe,G);r(ce||""),F("upload_success")}catch(oe){console.error("There was a problem with uploading the file: ",oe),F("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield L==null?void 0:L.json()),F("sign_in_url_failed")}catch(V){console.error("There was a problem with encrypting file...",V),F("encrypting_file_failed")}a(!1)}}),j=()=>{r(C),F("image_reset")},$=M=>{r(M),w(M)};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Card,{sx:{marginBottom:"10px"},children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(h.Typography,{level:"title-lg",children:t}),s.jsx(h.Tooltip,{title:e.clearImage,children:s.jsx(h.IconButton,{"aria-label":e.clearImage,variant:"plain",color:"danger",size:"sm",onClick:O,children:s.jsx(Rp,{})})})]}),s.jsxs(h.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[s.jsxs(h.Skeleton,{loading:o,animation:"wave",children:[n?s.jsx(h.Box,{component:"img",src:n,loading:"lazy",alt:t,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):s.jsx(jc,{sx:{fontSize:"3rem",opacity:.2}}),n?s.jsx(h.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:s.jsx(Yp,{sx:{fontSize:"3rem",color:"#fff"}})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Tooltip,{title:e.copyUrl,children:s.jsx(di,{onClick:()=>T(n),disabled:!n,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})}),s.jsx(h.Tooltip,{title:e.viewImage,children:s.jsx(di,{onClick:W,disabled:!n,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:s.jsx(qp,{})})}),s.jsx(h.Tooltip,{title:e.cropImage,children:s.jsx(di,{onClick:I,disabled:!n,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(hg,{})})})]}),s.jsx(h.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:s.jsxs(di,{sx:{width:"100%"},onClick:S,children:[s.jsx(_e.Upload,{})," ",e.uploadImage,s.jsx(Qp,{type:"file",accept:"image/*",onChange:N,ref:x})]})}),E!=null&&E.https.sportal365Config?s.jsx(h.AccordionGroup,{variant:"soft",children:s.jsxs(h.Accordion,{children:[s.jsx(h.AccordionSummary,{children:s.jsx(h.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.sportal365Images})}),s.jsx(h.AccordionDetails,{children:s.jsx(Kp,{labels:e,onChangeImages:$})})]})}):s.jsx(s.Fragment,{})]}),s.jsx(Ge,{showToast:l,message:g,color:m,hideToast:k}),s.jsx(Gp,{title:e.viewImage,open:u,imageSrc:n,toggleModal:W}),s.jsx(fg,{labels:e,open:d,imageSrc:n,toggleModal:I,uploadImage:H,resetDefaultImageUrl:j})]})},zP=e=>new Map().set("main_logo",e.mainLogo).set("mobile_logo",e.mobileLogo).set("background_image",e.backgroundImage).set("mobile_background_image",e.mobileBackgroundImage).set("additional_image",e.additionalImage),jP=e=>new Map().set("primary_color",e.primaryColor).set("secondary_color",e.secondaryColor).set("content_color",e.contentColor).set("background_color",e.backgroundColor).set("border_color",e.borderColor).set("additional_color",e.additionalColor),UP=e=>new Map().set("primary_url",e.primaryUrl).set("secondary_url",e.secondaryUrl).set("privacy_policy_url",e.privacyPolicyUrl).set("terms_and_conditions_url",e.termsAndConditionsUrl).set("additional_url",e.additionalUrl),VP=({labels:e,defaultValue:t,onChange:n})=>{const[r,i]=y.useState(!1),o=JSON.parse(JSON.stringify(t)),a=["mobile_logo","background_image","mobile_background_image","additional_image"],l=zP(e),c=jP(e),u=UP(e),f=(v,m)=>{const b=v.target.value;o.colors[m]=b,n(o)},d=(v,m)=>{const b=v.target.value;o.urls[m]=b,n(o)},p=(v,m)=>{o.images[m]=v,n(o)},g=v=>{o.images[v]="",n(o)};return s.jsx(h.Box,{children:s.jsxs(Xh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[s.jsxs(Zh,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${Ic.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(jc,{sx:{width:"20px"}})}),e.images]}),s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(p_,{sx:{width:"20px"}})}),e.colors]}),s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(g_,{sx:{width:"20px"}})}),e.urls]})]}),s.jsxs(ci,{value:0,sx:{px:0},children:[s.jsx(pg,{labels:e,title:e.mainLogo,image:o.images.main_logo,onChangeImages:v=>p(v,"main_logo"),clearImage:()=>g("main_logo")}),s.jsx(h.Link,{underline:"hover",onClick:()=>i(!r),sx:{marginBottom:"10px"},children:r?e.hideMoreImages:e.showMoreImages}),r?s.jsx(s.Fragment,{children:a.map(v=>s.jsx(pg,{labels:e,title:l.get(v),image:o.images[v],onChangeImages:m=>p(m,v),clearImage:()=>g(v)},`branding-image-${v}`))}):s.jsx(s.Fragment,{})]}),s.jsx(ci,{value:1,sx:{px:0},children:s.jsx(h.Box,{children:Object.keys(o.colors).map(v=>s.jsx(h.Box,{mb:2,children:s.jsx(Ot,{size:"sm",label:c.get(v),placeholder:"",defaultValue:o.colors[v],required:!1,onChange:m=>f(m,v)})},`branding-color-${v}`))})}),s.jsx(ci,{value:2,sx:{px:0},children:s.jsx(h.Box,{children:Object.keys(o.urls).map(v=>s.jsx(h.Box,{mb:2,children:s.jsx(Ot,{size:"sm",label:u.get(v),placeholder:"",defaultValue:o.urls[v],required:!1,onChange:m=>d(m,v)})},`branding-url-${v}`))})})]})})},gg=Be(s.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutlineOutlined"),mg=e=>{const t=()=>_(this,null,function*(){yield no(e.environment).signOut()});return s.jsx(h.Button,{variant:"outlined",color:"danger",onClick:t,children:e.signOutLabel})},HP=Be(s.jsx("path",{d:"m8.71 11.71 2.59 2.59c.39.39 1.02.39 1.41 0l2.59-2.59c.63-.63.18-1.71-.71-1.71H9.41c-.89 0-1.33 1.08-.7 1.71"}),"ArrowDropDownRounded"),WP=Be(s.jsx("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 6-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25zm-7.5-5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zm-1.51 3.49L9 15.17l-.99-2.18L5.83 12l2.18-.99L9 8.83l.99 2.18 2.18.99z"}),"AutoAwesomeOutlined"),GP=(e,t)=>{let n=[{id:"football_post_match",label:t.generateFootballPostMatchLabel}];switch(e){case"classic_quiz":n=[...n,{id:"formula1_post_event",label:(t==null?void 0:t.generateFormula1PostEventLabel)||""}];break}return n},YP=({createLabel:e,createFromTemplateLabel:t,signOutLabel:n,generateLabels:r,entityType:i,environment:o,onClickCreate:a,onClickCreateFromTemplate:l,onClickGenerate:c})=>{const u=()=>{if(!r||!c)return s.jsx(s.Fragment,{});const f=GP(i,r);return s.jsxs(h.Dropdown,{children:[s.jsxs(h.ButtonGroup,{variant:"solid",size:"md",color:"neutral",children:[s.jsx(h.MenuButton,{slots:{root:h.Button},startDecorator:s.jsx(WP,{}),sx:{border:1,borderColor:"neutral.outlinedBorder",borderRight:"none",borderTopRightRadius:0,borderBottomRightRadius:0,bgcolor:"transparent",color:"neutral.outlinedColor","&:hover":{bgcolor:"neutral.outlinedActiveBg"}},children:r.generateAIEntityLabel}),s.jsx(h.MenuButton,{slots:{root:h.IconButton},"aria-label":"More AI quiz options",sx:{border:1,borderColor:"neutral.outlinedBorder",borderLeft:"none",bgcolor:"transparent",color:"neutral.outlinedColor","&:hover":{bgcolor:"neutral.outlinedActiveBg"},borderTopRightRadius:"6px !important",borderBottomRightRadius:"6px !important"},children:s.jsx(HP,{})})]}),s.jsx(h.Menu,{placement:"bottom",sx:{maxHeight:240,borderRadius:12,boxShadow:"md"},children:f.map(d=>s.jsx(h.MenuItem,{onClick:()=>c(d.id),children:d.label},d.id))})]})};return s.jsx(s.Fragment,{children:s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",p:1,sx:()=>({marginBottom:"16px"}),children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",spacing:2,children:[s.jsx(h.Button,{startDecorator:s.jsx(gg,{}),variant:"solid",color:"primary",onClick:a,children:e}),t?s.jsx(h.Button,{startDecorator:s.jsx(gg,{}),variant:"outlined",color:"primary",onClick:l,children:t}):s.jsx(s.Fragment,{}),u()]}),n?s.jsx(mg,{signOutLabel:n,environment:o}):s.jsx(s.Fragment,{})]})})};var vg={},Zc=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],hi={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return typeof console!="undefined"&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},bo={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Wt=function(e,t){return t===void 0&&(t=2),("000"+e).slice(t*-1)},cn=function(e){return e===!0?1:0};function bg(e,t){var n;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(r,i)},t)}}var eu=function(e){return e instanceof Array?e:[e]};function $t(e,t,n){if(n===!0)return e.classList.add(t);e.classList.remove(t)}function $e(e,t,n){var r=window.document.createElement(e);return t=t||"",n=n||"",r.className=t,n!==void 0&&(r.textContent=n),r}function fs(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function yg(e,t){if(t(e))return e;if(e.parentNode)return yg(e.parentNode,t)}function hs(e,t){var n=$e("div","numInputWrapper"),r=$e("input","numInput "+e),i=$e("span","arrowUp"),o=$e("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return n.appendChild(r),n.appendChild(i),n.appendChild(o),n}function Zt(e){try{if(typeof e.composedPath=="function"){var t=e.composedPath();return t[0]}return e.target}catch(n){return e.target}}var tu=function(){},ps=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},KP={D:tu,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*cn(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(parseFloat(t)*1e3)},W:function(e,t,n){var r=parseInt(t),i=new Date(e.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:tu,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:tu,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},Dr={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},yo={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[yo.w(e,t,n)]},F:function(e,t,n){return ps(yo.n(e,t,n)-1,!1,t)},G:function(e,t,n){return Wt(yo.h(e,t,n))},H:function(e){return Wt(e.getHours())},J:function(e,t){return t.ordinal!==void 0?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[cn(e.getHours()>11)]},M:function(e,t){return ps(e.getMonth(),!0,t)},S:function(e){return Wt(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return Wt(e.getFullYear(),4)},d:function(e){return Wt(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return Wt(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return Wt(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},xg=function(e){var t=e.config,n=t===void 0?hi:t,r=e.l10n,i=r===void 0?bo:r,o=e.isMobile,a=o===void 0?!1:o;return function(l,c,u){var f=u||i;return n.formatDate!==void 0&&!a?n.formatDate(l,c,f):c.split("").map(function(d,p,g){return yo[d]&&g[p-1]!=="\\"?yo[d](l,f,n):d!=="\\"?d:""}).join("")}},nu=function(e){var t=e.config,n=t===void 0?hi:t,r=e.l10n,i=r===void 0?bo:r;return function(o,a,l,c){if(!(o!==0&&!o)){var u=c||i,f,d=o;if(o instanceof Date)f=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)f=new Date(o);else if(typeof o=="string"){var p=a||(n||hi).dateFormat,g=String(o).trim();if(g==="today")f=new Date,l=!0;else if(n&&n.parseDate)f=n.parseDate(o,p);else if(/Z$/.test(g)||/GMT$/.test(g))f=new Date(o);else{for(var v=void 0,m=[],b=0,C=0,w="";b<p.length;b++){var x=p[b],I=x==="\\",S=p[b-1]==="\\"||I;if(Dr[x]&&!S){w+=Dr[x];var A=new RegExp(w).exec(o);A&&(v=!0)&&m[x!=="Y"?"push":"unshift"]({fn:KP[x],val:A[++C]})}else I||(w+=".")}f=!n||!n.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),m.forEach(function(E){var k=E.fn,F=E.val;return f=k(f,F,u)||f}),f=v?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){n.errorHandler(new Error("Invalid date provided: "+d));return}return l===!0&&f.setHours(0,0,0,0),f}}};function en(e,t,n){return n===void 0&&(n=!0),n!==!1?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var qP=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},ru=function(e,t,n){return e*3600+t*60+n},QP=function(e){var t=Math.floor(e/3600),n=(e-t*3600)/60;return[t,n,e-t*3600-n*60]},JP={DAY:864e5};function iu(e){var t=e.defaultHour,n=e.defaultMinute,r=e.defaultSeconds;if(e.minDate!==void 0){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),a=e.minDate.getSeconds();t<i&&(t=i),t===i&&n<o&&(n=o),t===i&&n===o&&r<a&&(r=e.minDate.getSeconds())}if(e.maxDate!==void 0){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();t=Math.min(t,l),t===l&&(n=Math.min(c,n)),t===l&&n===c&&(r=e.maxDate.getSeconds())}return{hours:t,minutes:n,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var r=function(l){l&&Object.keys(l).forEach(function(c){return e[c]=l[c]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return e});var Rt=function(){return Rt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Rt.apply(this,arguments)},Cg=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,l=o.length;a<l;a++,i++)r[i]=o[a];return r},XP=300;function ZP(e,t){var n={config:Rt(Rt({},hi),mt.defaultConfig),l10n:bo};n.parseDate=nu({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=m,n._setHoursFromDate=p,n._positionCalendar=xe,n.changeMonth=D,n.changeYear=se,n.clear=L,n.close=U,n.onMouseOver=ve,n._createElement=$e,n.createDay=A,n.destroy=G,n.isEnabled=Z,n.jumpToDate=w,n.updateValue=Gt,n.open=st,n.redraw=Oe,n.set=Mt,n.setDate=Nt,n.toggle=Fo;function r(){n.utils={getDaysInMonth:function(P,z){return P===void 0&&(P=n.currentMonth),z===void 0&&(z=n.currentYear),P===1&&(z%4===0&&z%100!==0||z%400===0)?29:n.l10n.daysInMonth[P]}}}function i(){n.element=n.input=e,n.isOpen=!1,vt(),ge(),dn(),Ei(),r(),n.isMobile||S(),C(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&p(n.config.noCalendar?n.latestSelectedDateObj:void 0),Gt(!1)),l();var P=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&P&&xe(),Ne("onReady")}function o(){var P;return((P=n.calendarContainer)===null||P===void 0?void 0:P.getRootNode()).activeElement||document.activeElement}function a(P){return P.bind(n)}function l(){var P=n.config;P.weekNumbers===!1&&P.showMonths===1||P.noCalendar!==!0&&window.requestAnimationFrame(function(){if(n.calendarContainer!==void 0&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),n.daysContainer!==void 0){var z=(n.days.offsetWidth+1)*P.showMonths;n.daysContainer.style.width=z+"px",n.calendarContainer.style.width=z+(n.weekWrapper!==void 0?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display")}})}function c(P){if(n.selectedDates.length===0){var z=n.config.minDate===void 0||en(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),q=iu(n.config);z.setHours(q.hours,q.minutes,q.seconds,z.getMilliseconds()),n.selectedDates=[z],n.latestSelectedDateObj=z}P!==void 0&&P.type!=="blur"&&bt(P);var ee=n._input.value;d(),Gt(),n._input.value!==ee&&n._debouncedChange()}function u(P,z){return P%12+12*cn(z===n.l10n.amPM[1])}function f(P){switch(P%24){case 0:case 12:return 12;default:return P%12}}function d(){if(!(n.hourElement===void 0||n.minuteElement===void 0)){var P=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,z=(parseInt(n.minuteElement.value,10)||0)%60,q=n.secondElement!==void 0?(parseInt(n.secondElement.value,10)||0)%60:0;n.amPM!==void 0&&(P=u(P,n.amPM.textContent));var ee=n.config.minTime!==void 0||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&en(n.latestSelectedDateObj,n.config.minDate,!0)===0,ae=n.config.maxTime!==void 0||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&en(n.latestSelectedDateObj,n.config.maxDate,!0)===0;if(n.config.maxTime!==void 0&&n.config.minTime!==void 0&&n.config.minTime>n.config.maxTime){var ue=ru(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),Ce=ru(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),fe=ru(P,z,q);if(fe>Ce&&fe<ue){var Se=QP(ue);P=Se[0],z=Se[1],q=Se[2]}}else{if(ae){var pe=n.config.maxTime!==void 0?n.config.maxTime:n.config.maxDate;P=Math.min(P,pe.getHours()),P===pe.getHours()&&(z=Math.min(z,pe.getMinutes())),z===pe.getMinutes()&&(q=Math.min(q,pe.getSeconds()))}if(ee){var ie=n.config.minTime!==void 0?n.config.minTime:n.config.minDate;P=Math.max(P,ie.getHours()),P===ie.getHours()&&z<ie.getMinutes()&&(z=ie.getMinutes()),z===ie.getMinutes()&&(q=Math.max(q,ie.getSeconds()))}}g(P,z,q)}}function p(P){var z=P||n.latestSelectedDateObj;z&&z instanceof Date&&g(z.getHours(),z.getMinutes(),z.getSeconds())}function g(P,z,q){n.latestSelectedDateObj!==void 0&&n.latestSelectedDateObj.setHours(P%24,z,q||0,0),!(!n.hourElement||!n.minuteElement||n.isMobile)&&(n.hourElement.value=Wt(n.config.time_24hr?P:(12+P)%12+12*cn(P%12===0)),n.minuteElement.value=Wt(z),n.amPM!==void 0&&(n.amPM.textContent=n.l10n.amPM[cn(P>=12)]),n.secondElement!==void 0&&(n.secondElement.value=Wt(q)))}function v(P){var z=Zt(P),q=parseInt(z.value)+(P.delta||0);(q/1e3>1||P.key==="Enter"&&!/[^\d]/.test(q.toString()))&&se(q)}function m(P,z,q,ee){if(z instanceof Array)return z.forEach(function(ae){return m(P,ae,q,ee)});if(P instanceof Array)return P.forEach(function(ae){return m(ae,z,q,ee)});P.addEventListener(z,q,ee),n._handlers.push({remove:function(){return P.removeEventListener(z,q,ee)}})}function b(){Ne("onChange")}function C(){if(n.config.wrap&&["open","close","toggle","clear"].forEach(function(q){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+q+"]"),function(ee){return m(ee,"click",n[q])})}),n.isMobile){$o();return}var P=bg(Fe,50);if(n._debouncedChange=bg(b,XP),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&m(n.daysContainer,"mouseover",function(q){n.config.mode==="range"&&ve(Zt(q))}),m(n._input,"keydown",de),n.calendarContainer!==void 0&&m(n.calendarContainer,"keydown",de),!n.config.inline&&!n.config.static&&m(window,"resize",P),window.ontouchstart!==void 0?m(window.document,"touchstart",ce):m(window.document,"mousedown",ce),m(window.document,"focus",ce,{capture:!0}),n.config.clickOpens===!0&&(m(n._input,"focus",n.open),m(n._input,"click",n.open)),n.daysContainer!==void 0&&(m(n.monthNav,"click",zt),m(n.monthNav,["keyup","increment"],v),m(n.daysContainer,"click",St)),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0){var z=function(q){return Zt(q).select()};m(n.timeContainer,["increment"],c),m(n.timeContainer,"blur",c,{capture:!0}),m(n.timeContainer,"click",x),m([n.hourElement,n.minuteElement],["focus","click"],z),n.secondElement!==void 0&&m(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),n.amPM!==void 0&&m(n.amPM,"click",function(q){c(q)})}n.config.allowInput&&m(n._input,"blur",ne)}function w(P,z){var q=P!==void 0?n.parseDate(P):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),ee=n.currentYear,ae=n.currentMonth;try{q!==void 0&&(n.currentYear=q.getFullYear(),n.currentMonth=q.getMonth())}catch(ue){ue.message="Invalid date supplied: "+q,n.config.errorHandler(ue)}z&&n.currentYear!==ee&&(Ne("onYearChange"),N()),z&&(n.currentYear!==ee||n.currentMonth!==ae)&&Ne("onMonthChange"),n.redraw()}function x(P){var z=Zt(P);~z.className.indexOf("arrow")&&I(P,z.classList.contains("arrowUp")?1:-1)}function I(P,z,q){var ee=P&&Zt(P),ae=q||ee&&ee.parentNode&&ee.parentNode.firstChild,ue=hr("increment");ue.delta=z,ae&&ae.dispatchEvent(ue)}function S(){var P=window.document.createDocumentFragment();if(n.calendarContainer=$e("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(P.appendChild($()),n.innerContainer=$e("div","flatpickr-innerContainer"),n.config.weekNumbers){var z=X(),q=z.weekWrapper,ee=z.weekNumbers;n.innerContainer.appendChild(q),n.weekNumbers=ee,n.weekWrapper=q}n.rContainer=$e("div","flatpickr-rContainer"),n.rContainer.appendChild(V()),n.daysContainer||(n.daysContainer=$e("div","flatpickr-days"),n.daysContainer.tabIndex=-1),T(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),P.appendChild(n.innerContainer)}n.config.enableTime&&P.appendChild(M()),$t(n.calendarContainer,"rangeMode",n.config.mode==="range"),$t(n.calendarContainer,"animate",n.config.animate===!0),$t(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(P);var ae=n.config.appendTo!==void 0&&n.config.appendTo.nodeType!==void 0;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!ae&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):n.config.appendTo!==void 0&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var ue=$e("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(ue,n.element),ue.appendChild(n.element),n.altInput&&ue.appendChild(n.altInput),ue.appendChild(n.calendarContainer)}!n.config.static&&!n.config.inline&&(n.config.appendTo!==void 0?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}function A(P,z,q,ee){var ae=Z(z,!0),ue=$e("span",P,z.getDate().toString());return ue.dateObj=z,ue.$i=ee,ue.setAttribute("aria-label",n.formatDate(z,n.config.ariaDateFormat)),P.indexOf("hidden")===-1&&en(z,n.now)===0&&(n.todayDateElem=ue,ue.classList.add("today"),ue.setAttribute("aria-current","date")),ae?(ue.tabIndex=-1,Lr(z)&&(ue.classList.add("selected"),n.selectedDateElem=ue,n.config.mode==="range"&&($t(ue,"startRange",n.selectedDates[0]&&en(z,n.selectedDates[0],!0)===0),$t(ue,"endRange",n.selectedDates[1]&&en(z,n.selectedDates[1],!0)===0),P==="nextMonthDay"&&ue.classList.add("inRange")))):ue.classList.add("flatpickr-disabled"),n.config.mode==="range"&&ki(z)&&!Lr(z)&&ue.classList.add("inRange"),n.weekNumbers&&n.config.showMonths===1&&P!=="prevMonthDay"&&ee%7===6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(z)+"</span>"),Ne("onDayCreate",ue),ue}function E(P){P.focus(),n.config.mode==="range"&&ve(P)}function k(P){for(var z=P>0?0:n.config.showMonths-1,q=P>0?n.config.showMonths:-1,ee=z;ee!=q;ee+=P)for(var ae=n.daysContainer.children[ee],ue=P>0?0:ae.children.length-1,Ce=P>0?ae.children.length:-1,fe=ue;fe!=Ce;fe+=P){var Se=ae.children[fe];if(Se.className.indexOf("hidden")===-1&&Z(Se.dateObj))return Se}}function F(P,z){for(var q=P.className.indexOf("Month")===-1?P.dateObj.getMonth():n.currentMonth,ee=z>0?n.config.showMonths:-1,ae=z>0?1:-1,ue=q-n.currentMonth;ue!=ee;ue+=ae)for(var Ce=n.daysContainer.children[ue],fe=q-n.currentMonth===ue?P.$i+z:z<0?Ce.children.length-1:0,Se=Ce.children.length,pe=fe;pe>=0&&pe<Se&&pe!=(z>0?Se:-1);pe+=ae){var ie=Ce.children[pe];if(ie.className.indexOf("hidden")===-1&&Z(ie.dateObj)&&Math.abs(P.$i-pe)>=Math.abs(z))return E(ie)}n.changeMonth(ae),W(k(ae),0)}function W(P,z){var q=o(),ee=te(q||document.body),ae=P!==void 0?P:ee?q:n.selectedDateElem!==void 0&&te(n.selectedDateElem)?n.selectedDateElem:n.todayDateElem!==void 0&&te(n.todayDateElem)?n.todayDateElem:k(z>0?1:-1);ae===void 0?n._input.focus():ee?F(ae,z):E(ae)}function O(P,z){for(var q=(new Date(P,z,1).getDay()-n.l10n.firstDayOfWeek+7)%7,ee=n.utils.getDaysInMonth((z-1+12)%12,P),ae=n.utils.getDaysInMonth(z,P),ue=window.document.createDocumentFragment(),Ce=n.config.showMonths>1,fe=Ce?"prevMonthDay hidden":"prevMonthDay",Se=Ce?"nextMonthDay hidden":"nextMonthDay",pe=ee+1-q,ie=0;pe<=ee;pe++,ie++)ue.appendChild(A("flatpickr-day "+fe,new Date(P,z-1,pe),pe,ie));for(pe=1;pe<=ae;pe++,ie++)ue.appendChild(A("flatpickr-day",new Date(P,z,pe),pe,ie));for(var Ae=ae+1;Ae<=42-q&&(n.config.showMonths===1||ie%7!==0);Ae++,ie++)ue.appendChild(A("flatpickr-day "+Se,new Date(P,z+1,Ae%ae),Ae,ie));var Lt=$e("div","dayContainer");return Lt.appendChild(ue),Lt}function T(){if(n.daysContainer!==void 0){fs(n.daysContainer),n.weekNumbers&&fs(n.weekNumbers);for(var P=document.createDocumentFragment(),z=0;z<n.config.showMonths;z++){var q=new Date(n.currentYear,n.currentMonth,1);q.setMonth(n.currentMonth+z),P.appendChild(O(q.getFullYear(),q.getMonth()))}n.daysContainer.appendChild(P),n.days=n.daysContainer.firstChild,n.config.mode==="range"&&n.selectedDates.length===1&&ve()}}function N(){if(!(n.config.showMonths>1||n.config.monthSelectorType!=="dropdown")){var P=function(ee){return n.config.minDate!==void 0&&n.currentYear===n.config.minDate.getFullYear()&&ee<n.config.minDate.getMonth()?!1:!(n.config.maxDate!==void 0&&n.currentYear===n.config.maxDate.getFullYear()&&ee>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var z=0;z<12;z++)if(P(z)){var q=$e("option","flatpickr-monthDropdown-month");q.value=new Date(n.currentYear,z).getMonth().toString(),q.textContent=ps(z,n.config.shorthandCurrentMonth,n.l10n),q.tabIndex=-1,n.currentMonth===z&&(q.selected=!0),n.monthsDropdownContainer.appendChild(q)}}}function H(){var P=$e("div","flatpickr-month"),z=window.document.createDocumentFragment(),q;n.config.showMonths>1||n.config.monthSelectorType==="static"?q=$e("span","cur-month"):(n.monthsDropdownContainer=$e("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),m(n.monthsDropdownContainer,"change",function(Ce){var fe=Zt(Ce),Se=parseInt(fe.value,10);n.changeMonth(Se-n.currentMonth),Ne("onMonthChange")}),N(),q=n.monthsDropdownContainer);var ee=hs("cur-year",{tabindex:"-1"}),ae=ee.getElementsByTagName("input")[0];ae.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&ae.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(ae.setAttribute("max",n.config.maxDate.getFullYear().toString()),ae.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var ue=$e("div","flatpickr-current-month");return ue.appendChild(q),ue.appendChild(ee),z.appendChild(ue),P.appendChild(z),{container:P,yearElement:ae,monthElement:q}}function j(){fs(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var P=n.config.showMonths;P--;){var z=H();n.yearElements.push(z.yearElement),n.monthElements.push(z.monthElement),n.monthNav.appendChild(z.container)}n.monthNav.appendChild(n.nextMonthNav)}function $(){return n.monthNav=$e("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=$e("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=$e("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,j(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(P){n.__hidePrevMonthArrow!==P&&($t(n.prevMonthNav,"flatpickr-disabled",P),n.__hidePrevMonthArrow=P)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(P){n.__hideNextMonthArrow!==P&&($t(n.nextMonthNav,"flatpickr-disabled",P),n.__hideNextMonthArrow=P)}}),n.currentYearElement=n.yearElements[0],pr(),n.monthNav}function M(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var P=iu(n.config);n.timeContainer=$e("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var z=$e("span","flatpickr-time-separator",":"),q=hs("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=q.getElementsByTagName("input")[0];var ee=hs("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=ee.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=Wt(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?P.hours:f(P.hours)),n.minuteElement.value=Wt(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():P.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(q),n.timeContainer.appendChild(z),n.timeContainer.appendChild(ee),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var ae=hs("flatpickr-second");n.secondElement=ae.getElementsByTagName("input")[0],n.secondElement.value=Wt(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():P.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild($e("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(ae)}return n.config.time_24hr||(n.amPM=$e("span","flatpickr-am-pm",n.l10n.amPM[cn((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}function V(){n.weekdayContainer?fs(n.weekdayContainer):n.weekdayContainer=$e("div","flatpickr-weekdays");for(var P=n.config.showMonths;P--;){var z=$e("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(z)}return Y(),n.weekdayContainer}function Y(){if(n.weekdayContainer){var P=n.l10n.firstDayOfWeek,z=Cg(n.l10n.weekdays.shorthand);P>0&&P<z.length&&(z=Cg(z.splice(P,z.length),z.splice(0,P)));for(var q=n.config.showMonths;q--;)n.weekdayContainer.children[q].innerHTML=`
2453
+ `,MP=1,LP=3,BP=function(e){Iy(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.imageRef=K.createRef(),n.videoRef=K.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document!="undefined"?document:null,n.currentWindow=typeof window!="undefined"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver=="undefined"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=_P(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=i.crop,a=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}else if(n.props.initialCroppedAreaPixels){var l=DP(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=l.crop,a=l.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}},n.computeSizes=function(){var r,i,o,a,l,c,u=n.imageRef.current||n.videoRef.current;if(u&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var f=n.containerRect.width/n.containerRect.height,d=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,p=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=n.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,g=u.offsetWidth<d||u.offsetHeight<p,v=d/p,m=void 0;if(g)switch(n.state.mediaObjectFit){default:case"contain":m=f>v?{width:n.containerRect.height*v,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/v};break;case"horizontal-cover":m={width:n.containerRect.width,height:n.containerRect.width/v};break;case"vertical-cover":m={width:n.containerRect.height*v,height:n.containerRect.height};break}else m={width:u.offsetWidth,height:u.offsetHeight};n.mediaSize=Pt(Pt({},m),{naturalWidth:d,naturalHeight:p}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var b=n.props.cropSize?n.props.cropSize:IP(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((l=n.state.cropSize)===null||l===void 0?void 0:l.height)!==b.height||((c=n.state.cropSize)===null||c===void 0?void 0:c.width)!==b.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(b),n.setState({cropSize:b},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(b),b}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var i=t.getMousePoint(r),o=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var a=n.gestureRotationStart+r.rotation;n.props.onRotationChange(a)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,o,a=r.x,l=r.y;n.dragStartPosition={x:a,y:l},n.dragStartCrop=Pt({},n.props.crop),(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i)},n.onDrag=function(r){var i=r.x,o=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||o===void 0)){var a=i-n.dragStartPosition.x,l=o-n.dragStartPosition.y,c={x:n.dragStartCrop.x+a,y:n.dragStartCrop.y+l},u=n.props.restrictPosition?cs(c,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):c;n.props.onCropChange(u)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=t.getMousePoint(r),o=SP(r).pixelY,a=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(a,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var l,c;return(c=(l=n.props).onInteractionStart)===null||c===void 0?void 0:c.call(l)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var l,c;return(c=(l=n.props).onInteractionEnd)===null||c===void 0?void 0:c.call(l)})},250)}},n.getPointOnContainer=function(r,i){var o=r.x,a=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-i.x),y:n.containerRect.height/2-(a-i.y)}},n.getPointOnMedia=function(r){var i=r.x,o=r.y,a=n.props,l=a.crop,c=a.zoom;return{x:(i+l.x)/c,y:(o+l.y)/c}},n.setNewZoom=function(r,i,o){var a=o===void 0?{}:o,l=a.shouldUpdatePosition,c=l===void 0?!0:l;if(!(!n.state.cropSize||!n.props.onZoomChange)){var u=us(r,n.props.minZoom,n.props.maxZoom);if(c){var f=n.getPointOnContainer(i,n.containerPosition),d=n.getPointOnMedia(f),p={x:d.x*u-f.x,y:d.y*u-f.y},g=n.props.restrictPosition?cs(p,n.mediaSize,n.state.cropSize,u,n.props.rotation):p;n.props.onCropChange(g)}n.props.onZoomChange(u)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?cs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return TP(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?cs(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver=="undefined"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=RP,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver=="undefined"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,i,o,a,l,c,u,f,d;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((o=n.cropSize)===null||o===void 0?void 0:o.width)!==((a=this.props.cropSize)===null||a===void 0?void 0:a.width)?this.computeSizes():(((l=n.crop)===null||l===void 0?void 0:l.x)!==((c=this.props.crop)===null||c===void 0?void 0:c.x)||((u=n.crop)===null||u===void 0?void 0:u.y)!==((f=this.props.crop)===null||f===void 0?void 0:f.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((d=this.videoRef.current)===null||d===void 0||d.load());var p=this.getObjectFit();p!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:p},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},t.prototype.getObjectFit=function(){var n,r,i,o;if(this.props.objectFit==="cover"){var a=this.imageRef.current||this.videoRef.current;if(a&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var l=this.containerRect.width/this.containerRect.height,c=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,u=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,f=c/u;return f<l?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),i=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=cg(r,i),this.lastPinchRotation=ug(r,i),this.onDragStart(dg(r,i))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]),a=dg(i,o);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var l=cg(i,o),c=r.props.zoom*(l/r.lastPinchDistance);r.setNewZoom(c,a,{shouldUpdatePosition:!1}),r.lastPinchDistance=l;var u=ug(i,o),f=r.props.rotation+(u-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(f),r.lastPinchRotation=u})}},t.prototype.render=function(){var n=this,r,i=this.props,o=i.image,a=i.video,l=i.mediaProps,c=i.transform,u=i.crop,f=u.x,d=u.y,p=i.rotation,g=i.zoom,v=i.cropShape,m=i.showGrid,b=i.style,C=b.containerStyle,w=b.cropAreaStyle,x=b.mediaStyle,I=i.classes,S=I.containerClassName,A=I.cropAreaClassName,E=I.mediaClassName,k=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return K.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(W){return n.containerRef=W},"data-testid":"container",style:C,className:ds("reactEasyCrop_Container",S)},o?K.createElement("img",Pt({alt:"",className:ds("reactEasyCrop_Image",k==="contain"&&"reactEasyCrop_Contain",k==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",k==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{src:o,ref:this.imageRef,style:Pt(Pt({},x),{transform:c||"translate(".concat(f,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),onLoad:this.onMediaLoad})):a&&K.createElement("video",Pt({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:ds("reactEasyCrop_Video",k==="contain"&&"reactEasyCrop_Contain",k==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",k==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},l,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Pt(Pt({},x),{transform:c||"translate(".concat(f,"px, ").concat(d,"px) rotate(").concat(p,"deg) scale(").concat(g,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(F){return K.createElement("source",Pt({key:F.src},F))})),this.state.cropSize&&K.createElement("div",{style:Pt(Pt({},w),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:ds("reactEasyCrop_CropArea",v==="round"&&"reactEasyCrop_CropAreaRound",m&&"reactEasyCrop_CropAreaGrid",A)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:LP,minZoom:MP,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t}(K.Component);const $P=e=>new Promise((t,n)=>{const r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",i=>n(i)),r.crossOrigin="Anonymous",r.src=e});function FP(e){return e*Math.PI/180}function NP(e,t,n=0){return _(this,null,function*(){const r=yield $P(e),i=document.createElement("canvas"),o=i.getContext("2d"),l=2*(Math.max(r.width,r.height)/2*Math.sqrt(2));i.width=l,i.height=l,o.translate(l/2,l/2),o.rotate(FP(n)),o.translate(-l/2,-l/2),o.drawImage(r,l/2-r.width*.5,l/2-r.height*.5);const c=o.getImageData(0,0,l,l);return i.width=t.width,i.height=t.height,o.putImageData(c,Math.round(0-l/2+r.width*.5-t.x),Math.round(0-l/2+r.height*.5-t.y)),new Promise(u=>i.toBlob(f=>{const d=new File([f],`cropped_image_${Date.now()}.jpeg`,{type:"image/jpeg"});u(d)},"image/jpeg"))})}const fg=({labels:e,open:t,imageSrc:n,resetDefaultImageUrl:r,toggleModal:i,uploadImage:o})=>{const[a,l]=y.useState({x:0,y:0}),[c,u]=y.useState(1),[f,d]=y.useState(16/9),[p,g]=y.useState(null),v=(x,I)=>{g(I)},m=(x,I)=>d(I),b=()=>_(this,null,function*(){const x=yield NP(n,p);w(),o(x)}),C=()=>{w(),r()},w=()=>{l({x:0,y:0}),u(1),d(16/9),g(null)};return s.jsx(h.Modal,{open:t,onClose:i,children:s.jsxs(h.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[s.jsx(h.ModalClose,{}),s.jsx(h.DialogTitle,{children:e.cropImage}),s.jsxs(h.DialogContent,{sx:{width:"100%"},children:[s.jsx(h.Box,{position:"relative",height:"100%",width:"100%",mb:2,children:s.jsx(BP,{image:n,crop:a,zoom:c,aspect:f,onCropChange:l,onCropComplete:v,onZoomChange:u})}),s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.aspectRatio}),s.jsxs(h.Select,{value:f,onChange:m,children:[s.jsx(h.Option,{value:4/3,children:"4 / 3"}),s.jsx(h.Option,{value:16/9,children:"16 / 9"}),s.jsx(h.Option,{value:1,children:"1"})]})]}),s.jsx(h.Box,{mb:1,mx:2,children:s.jsx(h.Slider,{value:c,min:1,max:3,step:.1,onChange:(x,I)=>u(I)})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{color:"primary",onClick:b,loading:!1,children:e.crop}),s.jsx(h.Button,{color:"primary",variant:"outlined",onClick:C,loading:!1,children:e.reset})]})]})]})})},hg=Be(s.jsx("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2z"}),"CropOutlined"),pg=({labels:e,title:t,image:n,onChangeImages:r,clearImage:i})=>{const[o,a]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(!1),[d,p]=y.useState(!1),[g,v]=y.useState(""),[m,b]=y.useState("primary"),[C,w]=y.useState(""),x=y.useRef(null),I=()=>p(!d),S=()=>{x.current&&x.current.click()},A=new Wp,E=y.useContext(fa),k=()=>{v(""),c(!1)},F=M=>{let V="",Y="primary";switch(M){case"copy_url":V=e.urlCopiedToClipboardMessage,Y="primary";break;case"image_deleted":V=e.imageDeletedMessage,Y="primary";break;case"image_reset":V=e.imageResetMessage,Y="primary";break;case"upload_success":V=e.uploadingImageMessage,Y="success";break;case"upload_failed":V=e.uploadingImageErrorMessage,Y="danger";break;case"sign_in_url_failed":V=e.generateSignedInUrlErrorMessage,Y="danger";break;case"encrypting_file_failed":V=e.encryptingImageErrorMessage,Y="danger";break}b(Y),v(V),c(!0)},W=()=>f(!u),O=()=>{i(),F("image_deleted")},T=M=>{navigator.clipboard.writeText(M),F("copy_url")},N=M=>_(this,null,function*(){M.persist();const V=M.target.files?M.target.files[0]:null;if(V){a(!0);try{const Y=V.type.split("/")[1],X=yield A.readFileAndHash(V),D=(yield A.generateHashFileName(V))+"."+Y,L={image_type:Y,image_file_name:D,image_size:V.size,base64_sum:X},U=yield E==null?void 0:E.https.generateSignedInUrl(L);if(U!=null&&U.ok){const G=yield U.json(),oe={"Content-Type":V.type,"Content-MD5":X};try{const ce=new File([V],D,{type:V.type}),se=yield E==null?void 0:E.https.storeInBucket(G.data.signed_url,ce,oe);r(se||""),w(se),F("upload_success")}catch(ce){console.error("There was a problem with uploading the file: ",ce),F("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield U==null?void 0:U.json()),F("sign_in_url_failed")}catch(Y){console.error("There was a problem with encrypting file...",Y),F("encrypting_file_failed")}a(!1)}}),H=M=>_(this,null,function*(){if(M){a(!0);try{const V=M.type.split("/")[1],Y=yield A.readFileAndHash(M),X=(yield A.generateHashFileName(M))+"."+V,D={image_type:V,image_file_name:X,image_size:M.size,base64_sum:Y},L=yield E==null?void 0:E.https.generateSignedInUrl(D);if(L!=null&&L.ok){const U=yield L.json(),G={"Content-Type":M.type,"Content-MD5":Y};try{const oe=new File([M],X,{type:M.type}),ce=yield E==null?void 0:E.https.storeInBucket(U.data.signed_url,oe,G);r(ce||""),F("upload_success")}catch(oe){console.error("There was a problem with uploading the file: ",oe),F("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield L==null?void 0:L.json()),F("sign_in_url_failed")}catch(V){console.error("There was a problem with encrypting file...",V),F("encrypting_file_failed")}a(!1)}}),j=()=>{r(C),F("image_reset")},$=M=>{r(M),w(M)};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Card,{sx:{marginBottom:"10px"},children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(h.Typography,{level:"title-lg",children:t}),s.jsx(h.Tooltip,{title:e.clearImage,children:s.jsx(h.IconButton,{"aria-label":e.clearImage,variant:"plain",color:"danger",size:"sm",onClick:O,children:s.jsx(Rp,{})})})]}),s.jsxs(h.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[s.jsxs(h.Skeleton,{loading:o,animation:"wave",children:[n?s.jsx(h.Box,{component:"img",src:n,loading:"lazy",alt:t,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):s.jsx(jc,{sx:{fontSize:"3rem",opacity:.2}}),n?s.jsx(h.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:s.jsx(Yp,{sx:{fontSize:"3rem",color:"#fff"}})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Tooltip,{title:e.copyUrl,children:s.jsx(di,{onClick:()=>T(n),disabled:!n,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})}),s.jsx(h.Tooltip,{title:e.viewImage,children:s.jsx(di,{onClick:W,disabled:!n,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:s.jsx(qp,{})})}),s.jsx(h.Tooltip,{title:e.cropImage,children:s.jsx(di,{onClick:I,disabled:!n,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(hg,{})})})]}),s.jsx(h.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:s.jsxs(di,{sx:{width:"100%"},onClick:S,children:[s.jsx(_e.Upload,{})," ",e.uploadImage,s.jsx(Qp,{type:"file",accept:"image/*",onChange:N,ref:x})]})}),E!=null&&E.https.sportal365Config?s.jsx(h.AccordionGroup,{variant:"soft",children:s.jsxs(h.Accordion,{children:[s.jsx(h.AccordionSummary,{children:s.jsx(h.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.sportal365Images})}),s.jsx(h.AccordionDetails,{children:s.jsx(Kp,{labels:e,onChangeImages:$})})]})}):s.jsx(s.Fragment,{})]}),s.jsx(Ge,{showToast:l,message:g,color:m,hideToast:k}),s.jsx(Gp,{title:e.viewImage,open:u,imageSrc:n,toggleModal:W}),s.jsx(fg,{labels:e,open:d,imageSrc:n,toggleModal:I,uploadImage:H,resetDefaultImageUrl:j})]})},zP=e=>new Map().set("main_logo",e.mainLogo).set("mobile_logo",e.mobileLogo).set("background_image",e.backgroundImage).set("mobile_background_image",e.mobileBackgroundImage).set("additional_image",e.additionalImage),jP=e=>new Map().set("primary_color",e.primaryColor).set("secondary_color",e.secondaryColor).set("content_color",e.contentColor).set("background_color",e.backgroundColor).set("border_color",e.borderColor).set("additional_color",e.additionalColor),UP=e=>new Map().set("primary_url",e.primaryUrl).set("secondary_url",e.secondaryUrl).set("privacy_policy_url",e.privacyPolicyUrl).set("terms_and_conditions_url",e.termsAndConditionsUrl).set("additional_url",e.additionalUrl),VP=({labels:e,defaultValue:t,onChange:n})=>{const[r,i]=y.useState(!1),o=JSON.parse(JSON.stringify(t)),a=["mobile_logo","background_image","mobile_background_image","additional_image"],l=zP(e),c=jP(e),u=UP(e),f=(v,m)=>{const b=v.target.value;o.colors[m]=b,n(o)},d=(v,m)=>{const b=v.target.value;o.urls[m]=b,n(o)},p=(v,m)=>{o.images[m]=v,n(o)},g=v=>{o.images[v]="",n(o)};return s.jsx(h.Box,{children:s.jsxs(Xh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[s.jsxs(Zh,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${Ic.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(jc,{sx:{width:"20px"}})}),e.images]}),s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(p_,{sx:{width:"20px"}})}),e.colors]}),s.jsxs(ei,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(g_,{sx:{width:"20px"}})}),e.urls]})]}),s.jsxs(ci,{value:0,sx:{px:0},children:[s.jsx(pg,{labels:e,title:e.mainLogo,image:o.images.main_logo,onChangeImages:v=>p(v,"main_logo"),clearImage:()=>g("main_logo")}),s.jsx(h.Link,{underline:"hover",onClick:()=>i(!r),sx:{marginBottom:"10px"},children:r?e.hideMoreImages:e.showMoreImages}),r?s.jsx(s.Fragment,{children:a.map(v=>s.jsx(pg,{labels:e,title:l.get(v),image:o.images[v],onChangeImages:m=>p(m,v),clearImage:()=>g(v)},`branding-image-${v}`))}):s.jsx(s.Fragment,{})]}),s.jsx(ci,{value:1,sx:{px:0},children:s.jsx(h.Box,{children:Object.keys(o.colors).map(v=>s.jsx(h.Box,{mb:2,children:s.jsx(Ot,{size:"sm",label:c.get(v),placeholder:"",defaultValue:o.colors[v],required:!1,onChange:m=>f(m,v)})},`branding-color-${v}`))})}),s.jsx(ci,{value:2,sx:{px:0},children:s.jsx(h.Box,{children:Object.keys(o.urls).map(v=>s.jsx(h.Box,{mb:2,children:s.jsx(Ot,{size:"sm",label:u.get(v),placeholder:"",defaultValue:o.urls[v],required:!1,onChange:m=>d(m,v)})},`branding-url-${v}`))})})]})})},gg=Be(s.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutlineOutlined"),mg=e=>{const t=()=>_(this,null,function*(){yield no(e.environment).signOut()});return s.jsx(h.Button,{variant:"outlined",color:"danger",onClick:t,children:e.signOutLabel})},HP=Be(s.jsx("path",{d:"m8.71 11.71 2.59 2.59c.39.39 1.02.39 1.41 0l2.59-2.59c.63-.63.18-1.71-.71-1.71H9.41c-.89 0-1.33 1.08-.7 1.71"}),"ArrowDropDownRounded"),WP=Be(s.jsx("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 6-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25zm-7.5-5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zm-1.51 3.49L9 15.17l-.99-2.18L5.83 12l2.18-.99L9 8.83l.99 2.18 2.18.99z"}),"AutoAwesomeOutlined"),GP=(e,t)=>{let n=[{id:"football_post_match",label:t.generateFootballPostMatchLabel}];switch(e){case"classic_quiz":n=[...n,{id:"formula1_post_event",label:(t==null?void 0:t.generateFormula1PostEventLabel)||""}];break}return n},YP=({createLabel:e,createFromTemplateLabel:t,signOutLabel:n,generateLabels:r,entityType:i,environment:o,onClickCreate:a,onClickCreateFromTemplate:l,onClickGenerate:c})=>{const u=()=>{if(!r||!c)return s.jsx(s.Fragment,{});const f=GP(i,r);return s.jsxs(h.Dropdown,{children:[s.jsxs(h.ButtonGroup,{variant:"solid",size:"md",color:"neutral",children:[s.jsx(h.MenuButton,{slots:{root:h.Button},startDecorator:s.jsx(WP,{}),sx:{border:1,borderColor:"neutral.outlinedBorder",borderRight:"none",borderTopRightRadius:0,borderBottomRightRadius:0,bgcolor:"transparent",color:"neutral.outlinedColor","&:hover":{bgcolor:"neutral.outlinedActiveBg"}},children:r.generateAIEntityLabel}),s.jsx(h.MenuButton,{slots:{root:h.IconButton},"aria-label":"More AI quiz options",sx:{border:1,borderColor:"neutral.outlinedBorder",borderLeft:"none",bgcolor:"transparent",color:"neutral.outlinedColor","&:hover":{bgcolor:"neutral.outlinedActiveBg"},borderTopRightRadius:"6px !important",borderBottomRightRadius:"6px !important"},children:s.jsx(HP,{})})]}),s.jsx(h.Menu,{placement:"bottom",sx:{maxHeight:240,borderRadius:12,boxShadow:"md"},children:f.map(d=>s.jsx(h.MenuItem,{onClick:()=>c(d.id),children:d.label},d.id))})]})};return s.jsx(s.Fragment,{children:s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",p:1,sx:()=>({marginBottom:"16px"}),children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",spacing:2,children:[s.jsx(h.Button,{startDecorator:s.jsx(gg,{}),variant:"solid",color:"primary",onClick:a,children:e}),t?s.jsx(h.Button,{startDecorator:s.jsx(gg,{}),variant:"outlined",color:"primary",onClick:l,children:t}):s.jsx(s.Fragment,{}),u()]}),n?s.jsx(mg,{signOutLabel:n,environment:o}):s.jsx(s.Fragment,{})]})})};var vg={},Zc=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],hi={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return typeof console!="undefined"&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},bo={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ht=function(e,t){return t===void 0&&(t=2),("000"+e).slice(t*-1)},cn=function(e){return e===!0?1:0};function bg(e,t){var n;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(r,i)},t)}}var eu=function(e){return e instanceof Array?e:[e]};function $t(e,t,n){if(n===!0)return e.classList.add(t);e.classList.remove(t)}function $e(e,t,n){var r=window.document.createElement(e);return t=t||"",n=n||"",r.className=t,n!==void 0&&(r.textContent=n),r}function fs(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function yg(e,t){if(t(e))return e;if(e.parentNode)return yg(e.parentNode,t)}function hs(e,t){var n=$e("div","numInputWrapper"),r=$e("input","numInput "+e),i=$e("span","arrowUp"),o=$e("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return n.appendChild(r),n.appendChild(i),n.appendChild(o),n}function Zt(e){try{if(typeof e.composedPath=="function"){var t=e.composedPath();return t[0]}return e.target}catch(n){return e.target}}var tu=function(){},ps=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},KP={D:tu,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*cn(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(parseFloat(t)*1e3)},W:function(e,t,n){var r=parseInt(t),i=new Date(e.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:tu,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:tu,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},Dr={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},yo={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[yo.w(e,t,n)]},F:function(e,t,n){return ps(yo.n(e,t,n)-1,!1,t)},G:function(e,t,n){return Ht(yo.h(e,t,n))},H:function(e){return Ht(e.getHours())},J:function(e,t){return t.ordinal!==void 0?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[cn(e.getHours()>11)]},M:function(e,t){return ps(e.getMonth(),!0,t)},S:function(e){return Ht(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return Ht(e.getFullYear(),4)},d:function(e){return Ht(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return Ht(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return Ht(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},xg=function(e){var t=e.config,n=t===void 0?hi:t,r=e.l10n,i=r===void 0?bo:r,o=e.isMobile,a=o===void 0?!1:o;return function(l,c,u){var f=u||i;return n.formatDate!==void 0&&!a?n.formatDate(l,c,f):c.split("").map(function(d,p,g){return yo[d]&&g[p-1]!=="\\"?yo[d](l,f,n):d!=="\\"?d:""}).join("")}},nu=function(e){var t=e.config,n=t===void 0?hi:t,r=e.l10n,i=r===void 0?bo:r;return function(o,a,l,c){if(!(o!==0&&!o)){var u=c||i,f,d=o;if(o instanceof Date)f=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)f=new Date(o);else if(typeof o=="string"){var p=a||(n||hi).dateFormat,g=String(o).trim();if(g==="today")f=new Date,l=!0;else if(n&&n.parseDate)f=n.parseDate(o,p);else if(/Z$/.test(g)||/GMT$/.test(g))f=new Date(o);else{for(var v=void 0,m=[],b=0,C=0,w="";b<p.length;b++){var x=p[b],I=x==="\\",S=p[b-1]==="\\"||I;if(Dr[x]&&!S){w+=Dr[x];var A=new RegExp(w).exec(o);A&&(v=!0)&&m[x!=="Y"?"push":"unshift"]({fn:KP[x],val:A[++C]})}else I||(w+=".")}f=!n||!n.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),m.forEach(function(E){var k=E.fn,F=E.val;return f=k(f,F,u)||f}),f=v?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){n.errorHandler(new Error("Invalid date provided: "+d));return}return l===!0&&f.setHours(0,0,0,0),f}}};function en(e,t,n){return n===void 0&&(n=!0),n!==!1?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var qP=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},ru=function(e,t,n){return e*3600+t*60+n},QP=function(e){var t=Math.floor(e/3600),n=(e-t*3600)/60;return[t,n,e-t*3600-n*60]},JP={DAY:864e5};function iu(e){var t=e.defaultHour,n=e.defaultMinute,r=e.defaultSeconds;if(e.minDate!==void 0){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),a=e.minDate.getSeconds();t<i&&(t=i),t===i&&n<o&&(n=o),t===i&&n===o&&r<a&&(r=e.minDate.getSeconds())}if(e.maxDate!==void 0){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();t=Math.min(t,l),t===l&&(n=Math.min(c,n)),t===l&&n===c&&(r=e.maxDate.getSeconds())}return{hours:t,minutes:n,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var r=function(l){l&&Object.keys(l).forEach(function(c){return e[c]=l[c]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return e});var Rt=function(){return Rt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Rt.apply(this,arguments)},Cg=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,l=o.length;a<l;a++,i++)r[i]=o[a];return r},XP=300;function ZP(e,t){var n={config:Rt(Rt({},hi),mt.defaultConfig),l10n:bo};n.parseDate=nu({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=m,n._setHoursFromDate=p,n._positionCalendar=xe,n.changeMonth=D,n.changeYear=se,n.clear=L,n.close=U,n.onMouseOver=ve,n._createElement=$e,n.createDay=A,n.destroy=G,n.isEnabled=Z,n.jumpToDate=w,n.updateValue=Wt,n.open=st,n.redraw=Oe,n.set=Mt,n.setDate=Nt,n.toggle=Fo;function r(){n.utils={getDaysInMonth:function(P,z){return P===void 0&&(P=n.currentMonth),z===void 0&&(z=n.currentYear),P===1&&(z%4===0&&z%100!==0||z%400===0)?29:n.l10n.daysInMonth[P]}}}function i(){n.element=n.input=e,n.isOpen=!1,vt(),ge(),dn(),Ei(),r(),n.isMobile||S(),C(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&p(n.config.noCalendar?n.latestSelectedDateObj:void 0),Wt(!1)),l();var P=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&P&&xe(),Ne("onReady")}function o(){var P;return((P=n.calendarContainer)===null||P===void 0?void 0:P.getRootNode()).activeElement||document.activeElement}function a(P){return P.bind(n)}function l(){var P=n.config;P.weekNumbers===!1&&P.showMonths===1||P.noCalendar!==!0&&window.requestAnimationFrame(function(){if(n.calendarContainer!==void 0&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),n.daysContainer!==void 0){var z=(n.days.offsetWidth+1)*P.showMonths;n.daysContainer.style.width=z+"px",n.calendarContainer.style.width=z+(n.weekWrapper!==void 0?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display")}})}function c(P){if(n.selectedDates.length===0){var z=n.config.minDate===void 0||en(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),q=iu(n.config);z.setHours(q.hours,q.minutes,q.seconds,z.getMilliseconds()),n.selectedDates=[z],n.latestSelectedDateObj=z}P!==void 0&&P.type!=="blur"&&bt(P);var ee=n._input.value;d(),Wt(),n._input.value!==ee&&n._debouncedChange()}function u(P,z){return P%12+12*cn(z===n.l10n.amPM[1])}function f(P){switch(P%24){case 0:case 12:return 12;default:return P%12}}function d(){if(!(n.hourElement===void 0||n.minuteElement===void 0)){var P=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,z=(parseInt(n.minuteElement.value,10)||0)%60,q=n.secondElement!==void 0?(parseInt(n.secondElement.value,10)||0)%60:0;n.amPM!==void 0&&(P=u(P,n.amPM.textContent));var ee=n.config.minTime!==void 0||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&en(n.latestSelectedDateObj,n.config.minDate,!0)===0,ae=n.config.maxTime!==void 0||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&en(n.latestSelectedDateObj,n.config.maxDate,!0)===0;if(n.config.maxTime!==void 0&&n.config.minTime!==void 0&&n.config.minTime>n.config.maxTime){var ue=ru(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),Ce=ru(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),fe=ru(P,z,q);if(fe>Ce&&fe<ue){var Se=QP(ue);P=Se[0],z=Se[1],q=Se[2]}}else{if(ae){var pe=n.config.maxTime!==void 0?n.config.maxTime:n.config.maxDate;P=Math.min(P,pe.getHours()),P===pe.getHours()&&(z=Math.min(z,pe.getMinutes())),z===pe.getMinutes()&&(q=Math.min(q,pe.getSeconds()))}if(ee){var ie=n.config.minTime!==void 0?n.config.minTime:n.config.minDate;P=Math.max(P,ie.getHours()),P===ie.getHours()&&z<ie.getMinutes()&&(z=ie.getMinutes()),z===ie.getMinutes()&&(q=Math.max(q,ie.getSeconds()))}}g(P,z,q)}}function p(P){var z=P||n.latestSelectedDateObj;z&&z instanceof Date&&g(z.getHours(),z.getMinutes(),z.getSeconds())}function g(P,z,q){n.latestSelectedDateObj!==void 0&&n.latestSelectedDateObj.setHours(P%24,z,q||0,0),!(!n.hourElement||!n.minuteElement||n.isMobile)&&(n.hourElement.value=Ht(n.config.time_24hr?P:(12+P)%12+12*cn(P%12===0)),n.minuteElement.value=Ht(z),n.amPM!==void 0&&(n.amPM.textContent=n.l10n.amPM[cn(P>=12)]),n.secondElement!==void 0&&(n.secondElement.value=Ht(q)))}function v(P){var z=Zt(P),q=parseInt(z.value)+(P.delta||0);(q/1e3>1||P.key==="Enter"&&!/[^\d]/.test(q.toString()))&&se(q)}function m(P,z,q,ee){if(z instanceof Array)return z.forEach(function(ae){return m(P,ae,q,ee)});if(P instanceof Array)return P.forEach(function(ae){return m(ae,z,q,ee)});P.addEventListener(z,q,ee),n._handlers.push({remove:function(){return P.removeEventListener(z,q,ee)}})}function b(){Ne("onChange")}function C(){if(n.config.wrap&&["open","close","toggle","clear"].forEach(function(q){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+q+"]"),function(ee){return m(ee,"click",n[q])})}),n.isMobile){$o();return}var P=bg(Fe,50);if(n._debouncedChange=bg(b,XP),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&m(n.daysContainer,"mouseover",function(q){n.config.mode==="range"&&ve(Zt(q))}),m(n._input,"keydown",de),n.calendarContainer!==void 0&&m(n.calendarContainer,"keydown",de),!n.config.inline&&!n.config.static&&m(window,"resize",P),window.ontouchstart!==void 0?m(window.document,"touchstart",ce):m(window.document,"mousedown",ce),m(window.document,"focus",ce,{capture:!0}),n.config.clickOpens===!0&&(m(n._input,"focus",n.open),m(n._input,"click",n.open)),n.daysContainer!==void 0&&(m(n.monthNav,"click",Gt),m(n.monthNav,["keyup","increment"],v),m(n.daysContainer,"click",St)),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0){var z=function(q){return Zt(q).select()};m(n.timeContainer,["increment"],c),m(n.timeContainer,"blur",c,{capture:!0}),m(n.timeContainer,"click",x),m([n.hourElement,n.minuteElement],["focus","click"],z),n.secondElement!==void 0&&m(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),n.amPM!==void 0&&m(n.amPM,"click",function(q){c(q)})}n.config.allowInput&&m(n._input,"blur",ne)}function w(P,z){var q=P!==void 0?n.parseDate(P):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),ee=n.currentYear,ae=n.currentMonth;try{q!==void 0&&(n.currentYear=q.getFullYear(),n.currentMonth=q.getMonth())}catch(ue){ue.message="Invalid date supplied: "+q,n.config.errorHandler(ue)}z&&n.currentYear!==ee&&(Ne("onYearChange"),N()),z&&(n.currentYear!==ee||n.currentMonth!==ae)&&Ne("onMonthChange"),n.redraw()}function x(P){var z=Zt(P);~z.className.indexOf("arrow")&&I(P,z.classList.contains("arrowUp")?1:-1)}function I(P,z,q){var ee=P&&Zt(P),ae=q||ee&&ee.parentNode&&ee.parentNode.firstChild,ue=hr("increment");ue.delta=z,ae&&ae.dispatchEvent(ue)}function S(){var P=window.document.createDocumentFragment();if(n.calendarContainer=$e("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(P.appendChild($()),n.innerContainer=$e("div","flatpickr-innerContainer"),n.config.weekNumbers){var z=X(),q=z.weekWrapper,ee=z.weekNumbers;n.innerContainer.appendChild(q),n.weekNumbers=ee,n.weekWrapper=q}n.rContainer=$e("div","flatpickr-rContainer"),n.rContainer.appendChild(V()),n.daysContainer||(n.daysContainer=$e("div","flatpickr-days"),n.daysContainer.tabIndex=-1),T(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),P.appendChild(n.innerContainer)}n.config.enableTime&&P.appendChild(M()),$t(n.calendarContainer,"rangeMode",n.config.mode==="range"),$t(n.calendarContainer,"animate",n.config.animate===!0),$t(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(P);var ae=n.config.appendTo!==void 0&&n.config.appendTo.nodeType!==void 0;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!ae&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):n.config.appendTo!==void 0&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var ue=$e("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(ue,n.element),ue.appendChild(n.element),n.altInput&&ue.appendChild(n.altInput),ue.appendChild(n.calendarContainer)}!n.config.static&&!n.config.inline&&(n.config.appendTo!==void 0?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}function A(P,z,q,ee){var ae=Z(z,!0),ue=$e("span",P,z.getDate().toString());return ue.dateObj=z,ue.$i=ee,ue.setAttribute("aria-label",n.formatDate(z,n.config.ariaDateFormat)),P.indexOf("hidden")===-1&&en(z,n.now)===0&&(n.todayDateElem=ue,ue.classList.add("today"),ue.setAttribute("aria-current","date")),ae?(ue.tabIndex=-1,Lr(z)&&(ue.classList.add("selected"),n.selectedDateElem=ue,n.config.mode==="range"&&($t(ue,"startRange",n.selectedDates[0]&&en(z,n.selectedDates[0],!0)===0),$t(ue,"endRange",n.selectedDates[1]&&en(z,n.selectedDates[1],!0)===0),P==="nextMonthDay"&&ue.classList.add("inRange")))):ue.classList.add("flatpickr-disabled"),n.config.mode==="range"&&ki(z)&&!Lr(z)&&ue.classList.add("inRange"),n.weekNumbers&&n.config.showMonths===1&&P!=="prevMonthDay"&&ee%7===6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(z)+"</span>"),Ne("onDayCreate",ue),ue}function E(P){P.focus(),n.config.mode==="range"&&ve(P)}function k(P){for(var z=P>0?0:n.config.showMonths-1,q=P>0?n.config.showMonths:-1,ee=z;ee!=q;ee+=P)for(var ae=n.daysContainer.children[ee],ue=P>0?0:ae.children.length-1,Ce=P>0?ae.children.length:-1,fe=ue;fe!=Ce;fe+=P){var Se=ae.children[fe];if(Se.className.indexOf("hidden")===-1&&Z(Se.dateObj))return Se}}function F(P,z){for(var q=P.className.indexOf("Month")===-1?P.dateObj.getMonth():n.currentMonth,ee=z>0?n.config.showMonths:-1,ae=z>0?1:-1,ue=q-n.currentMonth;ue!=ee;ue+=ae)for(var Ce=n.daysContainer.children[ue],fe=q-n.currentMonth===ue?P.$i+z:z<0?Ce.children.length-1:0,Se=Ce.children.length,pe=fe;pe>=0&&pe<Se&&pe!=(z>0?Se:-1);pe+=ae){var ie=Ce.children[pe];if(ie.className.indexOf("hidden")===-1&&Z(ie.dateObj)&&Math.abs(P.$i-pe)>=Math.abs(z))return E(ie)}n.changeMonth(ae),W(k(ae),0)}function W(P,z){var q=o(),ee=te(q||document.body),ae=P!==void 0?P:ee?q:n.selectedDateElem!==void 0&&te(n.selectedDateElem)?n.selectedDateElem:n.todayDateElem!==void 0&&te(n.todayDateElem)?n.todayDateElem:k(z>0?1:-1);ae===void 0?n._input.focus():ee?F(ae,z):E(ae)}function O(P,z){for(var q=(new Date(P,z,1).getDay()-n.l10n.firstDayOfWeek+7)%7,ee=n.utils.getDaysInMonth((z-1+12)%12,P),ae=n.utils.getDaysInMonth(z,P),ue=window.document.createDocumentFragment(),Ce=n.config.showMonths>1,fe=Ce?"prevMonthDay hidden":"prevMonthDay",Se=Ce?"nextMonthDay hidden":"nextMonthDay",pe=ee+1-q,ie=0;pe<=ee;pe++,ie++)ue.appendChild(A("flatpickr-day "+fe,new Date(P,z-1,pe),pe,ie));for(pe=1;pe<=ae;pe++,ie++)ue.appendChild(A("flatpickr-day",new Date(P,z,pe),pe,ie));for(var Ae=ae+1;Ae<=42-q&&(n.config.showMonths===1||ie%7!==0);Ae++,ie++)ue.appendChild(A("flatpickr-day "+Se,new Date(P,z+1,Ae%ae),Ae,ie));var Lt=$e("div","dayContainer");return Lt.appendChild(ue),Lt}function T(){if(n.daysContainer!==void 0){fs(n.daysContainer),n.weekNumbers&&fs(n.weekNumbers);for(var P=document.createDocumentFragment(),z=0;z<n.config.showMonths;z++){var q=new Date(n.currentYear,n.currentMonth,1);q.setMonth(n.currentMonth+z),P.appendChild(O(q.getFullYear(),q.getMonth()))}n.daysContainer.appendChild(P),n.days=n.daysContainer.firstChild,n.config.mode==="range"&&n.selectedDates.length===1&&ve()}}function N(){if(!(n.config.showMonths>1||n.config.monthSelectorType!=="dropdown")){var P=function(ee){return n.config.minDate!==void 0&&n.currentYear===n.config.minDate.getFullYear()&&ee<n.config.minDate.getMonth()?!1:!(n.config.maxDate!==void 0&&n.currentYear===n.config.maxDate.getFullYear()&&ee>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var z=0;z<12;z++)if(P(z)){var q=$e("option","flatpickr-monthDropdown-month");q.value=new Date(n.currentYear,z).getMonth().toString(),q.textContent=ps(z,n.config.shorthandCurrentMonth,n.l10n),q.tabIndex=-1,n.currentMonth===z&&(q.selected=!0),n.monthsDropdownContainer.appendChild(q)}}}function H(){var P=$e("div","flatpickr-month"),z=window.document.createDocumentFragment(),q;n.config.showMonths>1||n.config.monthSelectorType==="static"?q=$e("span","cur-month"):(n.monthsDropdownContainer=$e("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),m(n.monthsDropdownContainer,"change",function(Ce){var fe=Zt(Ce),Se=parseInt(fe.value,10);n.changeMonth(Se-n.currentMonth),Ne("onMonthChange")}),N(),q=n.monthsDropdownContainer);var ee=hs("cur-year",{tabindex:"-1"}),ae=ee.getElementsByTagName("input")[0];ae.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&ae.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(ae.setAttribute("max",n.config.maxDate.getFullYear().toString()),ae.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var ue=$e("div","flatpickr-current-month");return ue.appendChild(q),ue.appendChild(ee),z.appendChild(ue),P.appendChild(z),{container:P,yearElement:ae,monthElement:q}}function j(){fs(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var P=n.config.showMonths;P--;){var z=H();n.yearElements.push(z.yearElement),n.monthElements.push(z.monthElement),n.monthNav.appendChild(z.container)}n.monthNav.appendChild(n.nextMonthNav)}function $(){return n.monthNav=$e("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=$e("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=$e("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,j(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(P){n.__hidePrevMonthArrow!==P&&($t(n.prevMonthNav,"flatpickr-disabled",P),n.__hidePrevMonthArrow=P)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(P){n.__hideNextMonthArrow!==P&&($t(n.nextMonthNav,"flatpickr-disabled",P),n.__hideNextMonthArrow=P)}}),n.currentYearElement=n.yearElements[0],pr(),n.monthNav}function M(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var P=iu(n.config);n.timeContainer=$e("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var z=$e("span","flatpickr-time-separator",":"),q=hs("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=q.getElementsByTagName("input")[0];var ee=hs("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=ee.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=Ht(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?P.hours:f(P.hours)),n.minuteElement.value=Ht(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():P.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(q),n.timeContainer.appendChild(z),n.timeContainer.appendChild(ee),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var ae=hs("flatpickr-second");n.secondElement=ae.getElementsByTagName("input")[0],n.secondElement.value=Ht(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():P.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild($e("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(ae)}return n.config.time_24hr||(n.amPM=$e("span","flatpickr-am-pm",n.l10n.amPM[cn((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}function V(){n.weekdayContainer?fs(n.weekdayContainer):n.weekdayContainer=$e("div","flatpickr-weekdays");for(var P=n.config.showMonths;P--;){var z=$e("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(z)}return Y(),n.weekdayContainer}function Y(){if(n.weekdayContainer){var P=n.l10n.firstDayOfWeek,z=Cg(n.l10n.weekdays.shorthand);P>0&&P<z.length&&(z=Cg(z.splice(P,z.length),z.splice(0,P)));for(var q=n.config.showMonths;q--;)n.weekdayContainer.children[q].innerHTML=`
2454
2454
  <span class='flatpickr-weekday'>
2455
2455
  `+z.join("</span><span class='flatpickr-weekday'>")+`
2456
2456
  </span>
2457
- `}}function X(){n.calendarContainer.classList.add("hasWeeks");var P=$e("div","flatpickr-weekwrapper");P.appendChild($e("span","flatpickr-weekday",n.l10n.weekAbbreviation));var z=$e("div","flatpickr-weeks");return P.appendChild(z),{weekWrapper:P,weekNumbers:z}}function D(P,z){z===void 0&&(z=!0);var q=z?P:P-n.currentMonth;q<0&&n._hidePrevMonthArrow===!0||q>0&&n._hideNextMonthArrow===!0||(n.currentMonth+=q,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,Ne("onYearChange"),N()),T(),Ne("onMonthChange"),pr())}function L(P,z){if(P===void 0&&(P=!0),z===void 0&&(z=!0),n.input.value="",n.altInput!==void 0&&(n.altInput.value=""),n.mobileInput!==void 0&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,z===!0&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),n.config.enableTime===!0){var q=iu(n.config),ee=q.hours,ae=q.minutes,ue=q.seconds;g(ee,ae,ue)}n.redraw(),P&&Ne("onChange")}function U(){n.isOpen=!1,n.isMobile||(n.calendarContainer!==void 0&&n.calendarContainer.classList.remove("open"),n._input!==void 0&&n._input.classList.remove("active")),Ne("onClose")}function G(){n.config!==void 0&&Ne("onDestroy");for(var P=n._handlers.length;P--;)n._handlers[P].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var z=n.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(q){try{delete n[q]}catch(ee){}})}function oe(P){return n.calendarContainer.contains(P)}function ce(P){if(n.isOpen&&!n.config.inline){var z=Zt(P),q=oe(z),ee=z===n.input||z===n.altInput||n.element.contains(z)||P.path&&P.path.indexOf&&(~P.path.indexOf(n.input)||~P.path.indexOf(n.altInput)),ae=!ee&&!q&&!oe(P.relatedTarget),ue=!n.config.ignoredFocusElements.some(function(Ce){return Ce.contains(z)});ae&&ue&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0&&n.input.value!==""&&n.input.value!==void 0&&c(),n.close(),n.config&&n.config.mode==="range"&&n.selectedDates.length===1&&n.clear(!1))}}function se(P){if(!(!P||n.config.minDate&&P<n.config.minDate.getFullYear()||n.config.maxDate&&P>n.config.maxDate.getFullYear())){var z=P,q=n.currentYear!==z;n.currentYear=z||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),q&&(n.redraw(),Ne("onYearChange"),N())}}function Z(P,z){var q;z===void 0&&(z=!0);var ee=n.parseDate(P,void 0,z);if(n.config.minDate&&ee&&en(ee,n.config.minDate,z!==void 0?z:!n.minDateHasTime)<0||n.config.maxDate&&ee&&en(ee,n.config.maxDate,z!==void 0?z:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&n.config.disable.length===0)return!0;if(ee===void 0)return!1;for(var ae=!!n.config.enable,ue=(q=n.config.enable)!==null&&q!==void 0?q:n.config.disable,Ce=0,fe=void 0;Ce<ue.length;Ce++){if(fe=ue[Ce],typeof fe=="function"&&fe(ee))return ae;if(fe instanceof Date&&ee!==void 0&&fe.getTime()===ee.getTime())return ae;if(typeof fe=="string"){var Se=n.parseDate(fe,void 0,!0);return Se&&Se.getTime()===ee.getTime()?ae:!ae}else if(typeof fe=="object"&&ee!==void 0&&fe.from&&fe.to&&ee.getTime()>=fe.from.getTime()&&ee.getTime()<=fe.to.getTime())return ae}return!ae}function te(P){return n.daysContainer!==void 0?P.className.indexOf("hidden")===-1&&P.className.indexOf("flatpickr-disabled")===-1&&n.daysContainer.contains(P):!1}function ne(P){var z=P.target===n._input,q=n._input.value.trimEnd()!==gr();z&&q&&!(P.relatedTarget&&oe(P.relatedTarget))&&n.setDate(n._input.value,!0,P.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function de(P){var z=Zt(P),q=n.config.wrap?e.contains(z):z===n._input,ee=n.config.allowInput,ae=n.isOpen&&(!ee||!q),ue=n.config.inline&&q&&!ee;if(P.keyCode===13&&q){if(ee)return n.setDate(n._input.value,!0,z===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),z.blur();n.open()}else if(oe(z)||ae||ue){var Ce=!!n.timeContainer&&n.timeContainer.contains(z);switch(P.keyCode){case 13:Ce?(P.preventDefault(),c(),Pe()):St(P);break;case 27:P.preventDefault(),Pe();break;case 8:case 46:q&&!n.config.allowInput&&(P.preventDefault(),n.clear());break;case 37:case 39:if(!Ce&&!q){P.preventDefault();var fe=o();if(n.daysContainer!==void 0&&(ee===!1||fe&&te(fe))){var Se=P.keyCode===39?1:-1;P.ctrlKey?(P.stopPropagation(),D(Se),W(k(1),0)):W(void 0,Se)}}else n.hourElement&&n.hourElement.focus();break;case 38:case 40:P.preventDefault();var pe=P.keyCode===40?1:-1;n.daysContainer&&z.$i!==void 0||z===n.input||z===n.altInput?P.ctrlKey?(P.stopPropagation(),se(n.currentYear-pe),W(k(1),0)):Ce||W(void 0,pe*7):z===n.currentYearElement?se(n.currentYear-pe):n.config.enableTime&&(!Ce&&n.hourElement&&n.hourElement.focus(),c(P),n._debouncedChange());break;case 9:if(Ce){var ie=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(lt){return lt}),Ae=ie.indexOf(z);if(Ae!==-1){var Lt=ie[Ae+(P.shiftKey?-1:1)];P.preventDefault(),(Lt||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(z)&&P.shiftKey&&(P.preventDefault(),n._input.focus());break}}if(n.amPM!==void 0&&z===n.amPM)switch(P.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],d(),Gt();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],d(),Gt();break}(q||oe(z))&&Ne("onKeyDown",P)}function ve(P,z){if(z===void 0&&(z="flatpickr-day"),!(n.selectedDates.length!==1||P&&(!P.classList.contains(z)||P.classList.contains("flatpickr-disabled")))){for(var q=P?P.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),ee=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),ae=Math.min(q,n.selectedDates[0].getTime()),ue=Math.max(q,n.selectedDates[0].getTime()),Ce=!1,fe=0,Se=0,pe=ae;pe<ue;pe+=JP.DAY)Z(new Date(pe),!0)||(Ce=Ce||pe>ae&&pe<ue,pe<ee&&(!fe||pe>fe)?fe=pe:pe>ee&&(!Se||pe<Se)&&(Se=pe));var ie=Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+z));ie.forEach(function(Ae){var Lt=Ae.dateObj,lt=Lt.getTime(),vn=fe>0&&lt<fe||Se>0&&lt>Se;if(vn){Ae.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(_n){Ae.classList.remove(_n)});return}else if(Ce&&!vn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(_n){Ae.classList.remove(_n)}),P!==void 0&&(P.classList.add(q<=n.selectedDates[0].getTime()?"startRange":"endRange"),ee<q&&lt===ee?Ae.classList.add("startRange"):ee>q&&lt===ee&&Ae.classList.add("endRange"),lt>=fe&&(Se===0||lt<=Se)&&qP(lt,ee,q)&&Ae.classList.add("inRange"))})}}function Fe(){n.isOpen&&!n.config.static&&!n.config.inline&&xe()}function st(P,z){if(z===void 0&&(z=n._positionElement),n.isMobile===!0){if(P){P.preventDefault();var q=Zt(P);q&&q.blur()}n.mobileInput!==void 0&&(n.mobileInput.focus(),n.mobileInput.click()),Ne("onOpen");return}else if(n._input.disabled||n.config.inline)return;var ee=n.isOpen;n.isOpen=!0,ee||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),Ne("onOpen"),xe(z)),n.config.enableTime===!0&&n.config.noCalendar===!0&&n.config.allowInput===!1&&(P===void 0||!n.timeContainer.contains(P.relatedTarget))&&setTimeout(function(){return n.hourElement.select()},50)}function Je(P){return function(z){var q=n.config["_"+P+"Date"]=n.parseDate(z,n.config.dateFormat),ee=n.config["_"+(P==="min"?"max":"min")+"Date"];q!==void 0&&(n[P==="min"?"minDateHasTime":"maxDateHasTime"]=q.getHours()>0||q.getMinutes()>0||q.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(ae){return Z(ae)}),!n.selectedDates.length&&P==="min"&&p(q),Gt()),n.daysContainer&&(Oe(),q!==void 0?n.currentYearElement[P]=q.getFullYear().toString():n.currentYearElement.removeAttribute(P),n.currentYearElement.disabled=!!ee&&q!==void 0&&ee.getFullYear()===q.getFullYear())}}function vt(){var P=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],z=Rt(Rt({},JSON.parse(JSON.stringify(e.dataset||{}))),t),q={};n.config.parseDate=z.parseDate,n.config.formatDate=z.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(ie){n.config._enable=kn(ie)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(ie){n.config._disable=kn(ie)}});var ee=z.mode==="time";if(!z.dateFormat&&(z.enableTime||ee)){var ae=mt.defaultConfig.dateFormat||hi.dateFormat;q.dateFormat=z.noCalendar||ee?"H:i"+(z.enableSeconds?":S":""):ae+" H:i"+(z.enableSeconds?":S":"")}if(z.altInput&&(z.enableTime||ee)&&!z.altFormat){var ue=mt.defaultConfig.altFormat||hi.altFormat;q.altFormat=z.noCalendar||ee?"h:i"+(z.enableSeconds?":S K":" K"):ue+(" h:i"+(z.enableSeconds?":S":"")+" K")}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:Je("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:Je("max")});var Ce=function(ie){return function(Ae){n.config[ie==="min"?"_minTime":"_maxTime"]=n.parseDate(Ae,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:Ce("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:Ce("max")}),z.mode==="time"&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,q,z);for(var fe=0;fe<P.length;fe++)n.config[P[fe]]=n.config[P[fe]]===!0||n.config[P[fe]]==="true";Zc.filter(function(ie){return n.config[ie]!==void 0}).forEach(function(ie){n.config[ie]=eu(n.config[ie]||[]).map(a)}),n.isMobile=!n.config.disableMobile&&!n.config.inline&&n.config.mode==="single"&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var fe=0;fe<n.config.plugins.length;fe++){var Se=n.config.plugins[fe](n)||{};for(var pe in Se)Zc.indexOf(pe)>-1?n.config[pe]=eu(Se[pe]).map(a).concat(n.config[pe]):typeof z[pe]=="undefined"&&(n.config[pe]=Se[pe])}z.altInputClass||(n.config.altInputClass=he().className+" "+n.config.altInputClass),Ne("onParseConfig")}function he(){return n.config.wrap?e.querySelector("[data-input]"):e}function ge(){typeof n.config.locale!="object"&&typeof mt.l10ns[n.config.locale]=="undefined"&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=Rt(Rt({},mt.l10ns.default),typeof n.config.locale=="object"?n.config.locale:n.config.locale!=="default"?mt.l10ns[n.config.locale]:void 0),Dr.D="("+n.l10n.weekdays.shorthand.join("|")+")",Dr.l="("+n.l10n.weekdays.longhand.join("|")+")",Dr.M="("+n.l10n.months.shorthand.join("|")+")",Dr.F="("+n.l10n.months.longhand.join("|")+")",Dr.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")";var P=Rt(Rt({},t),JSON.parse(JSON.stringify(e.dataset||{})));P.time_24hr===void 0&&mt.defaultConfig.time_24hr===void 0&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=xg(n),n.parseDate=nu({config:n.config,l10n:n.l10n})}function xe(P){if(typeof n.config.position=="function")return void n.config.position(n,P);if(n.calendarContainer!==void 0){Ne("onPreCalendarPosition");var z=P||n._positionElement,q=Array.prototype.reduce.call(n.calendarContainer.children,function(pz,gz){return pz+gz.offsetHeight},0),ee=n.calendarContainer.offsetWidth,ae=n.config.position.split(" "),ue=ae[0],Ce=ae.length>1?ae[1]:null,fe=z.getBoundingClientRect(),Se=window.innerHeight-fe.bottom,pe=ue==="above"||ue!=="below"&&Se<q&&fe.top>q,ie=window.pageYOffset+fe.top+(pe?-q-2:z.offsetHeight+2);if($t(n.calendarContainer,"arrowTop",!pe),$t(n.calendarContainer,"arrowBottom",pe),!n.config.inline){var Ae=window.pageXOffset+fe.left,Lt=!1,lt=!1;Ce==="center"?(Ae-=(ee-fe.width)/2,Lt=!0):Ce==="right"&&(Ae-=ee-fe.width,lt=!0),$t(n.calendarContainer,"arrowLeft",!Lt&&!lt),$t(n.calendarContainer,"arrowCenter",Lt),$t(n.calendarContainer,"arrowRight",lt);var vn=window.document.body.offsetWidth-(window.pageXOffset+fe.right),_n=Ae+ee>window.document.body.offsetWidth,sz=vn+ee>window.document.body.offsetWidth;if($t(n.calendarContainer,"rightMost",_n),!n.config.static)if(n.calendarContainer.style.top=ie+"px",!_n)n.calendarContainer.style.left=Ae+"px",n.calendarContainer.style.right="auto";else if(!sz)n.calendarContainer.style.left="auto",n.calendarContainer.style.right=vn+"px";else{var Vu=ke();if(Vu===void 0)return;var lz=window.document.body.offsetWidth,cz=Math.max(0,lz/2-ee/2),uz=".flatpickr-calendar.centerMost:before",dz=".flatpickr-calendar.centerMost:after",fz=Vu.cssRules.length,hz="{left:"+fe.left+"px;right:auto;}";$t(n.calendarContainer,"rightMost",!1),$t(n.calendarContainer,"centerMost",!0),Vu.insertRule(uz+","+dz+hz,fz),n.calendarContainer.style.left=cz+"px",n.calendarContainer.style.right="auto"}}}}function ke(){for(var P=null,z=0;z<document.styleSheets.length;z++){var q=document.styleSheets[z];if(q.cssRules){try{q.cssRules}catch(ee){continue}P=q;break}}return P!=null?P:Ye()}function Ye(){var P=document.createElement("style");return document.head.appendChild(P),P.sheet}function Oe(){n.config.noCalendar||n.isMobile||(N(),pr(),T())}function Pe(){n._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(n.close,0):n.close()}function St(P){P.preventDefault(),P.stopPropagation();var z=function(ie){return ie.classList&&ie.classList.contains("flatpickr-day")&&!ie.classList.contains("flatpickr-disabled")&&!ie.classList.contains("notAllowed")},q=yg(Zt(P),z);if(q!==void 0){var ee=q,ae=n.latestSelectedDateObj=new Date(ee.dateObj.getTime()),ue=(ae.getMonth()<n.currentMonth||ae.getMonth()>n.currentMonth+n.config.showMonths-1)&&n.config.mode!=="range";if(n.selectedDateElem=ee,n.config.mode==="single")n.selectedDates=[ae];else if(n.config.mode==="multiple"){var Ce=Lr(ae);Ce?n.selectedDates.splice(parseInt(Ce),1):n.selectedDates.push(ae)}else n.config.mode==="range"&&(n.selectedDates.length===2&&n.clear(!1,!1),n.latestSelectedDateObj=ae,n.selectedDates.push(ae),en(ae,n.selectedDates[0],!0)!==0&&n.selectedDates.sort(function(ie,Ae){return ie.getTime()-Ae.getTime()}));if(d(),ue){var fe=n.currentYear!==ae.getFullYear();n.currentYear=ae.getFullYear(),n.currentMonth=ae.getMonth(),fe&&(Ne("onYearChange"),N()),Ne("onMonthChange")}if(pr(),T(),Gt(),!ue&&n.config.mode!=="range"&&n.config.showMonths===1?E(ee):n.selectedDateElem!==void 0&&n.hourElement===void 0&&n.selectedDateElem&&n.selectedDateElem.focus(),n.hourElement!==void 0&&n.hourElement!==void 0&&n.hourElement.focus(),n.config.closeOnSelect){var Se=n.config.mode==="single"&&!n.config.enableTime,pe=n.config.mode==="range"&&n.selectedDates.length===2&&!n.config.enableTime;(Se||pe)&&Pe()}b()}}var It={locale:[ge,Y],showMonths:[j,l,V],minDate:[w],maxDate:[w],positionElement:[Mr],clickOpens:[function(){n.config.clickOpens===!0?(m(n._input,"focus",n.open),m(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function Mt(P,z){if(P!==null&&typeof P=="object"){Object.assign(n.config,P);for(var q in P)It[q]!==void 0&&It[q].forEach(function(ee){return ee()})}else n.config[P]=z,It[P]!==void 0?It[P].forEach(function(ee){return ee()}):Zc.indexOf(P)>-1&&(n.config[P]=eu(z));n.redraw(),Gt(!0)}function _t(P,z){var q=[];if(P instanceof Array)q=P.map(function(ee){return n.parseDate(ee,z)});else if(P instanceof Date||typeof P=="number")q=[n.parseDate(P,z)];else if(typeof P=="string")switch(n.config.mode){case"single":case"time":q=[n.parseDate(P,z)];break;case"multiple":q=P.split(n.config.conjunction).map(function(ee){return n.parseDate(ee,z)});break;case"range":q=P.split(n.l10n.rangeSeparator).map(function(ee){return n.parseDate(ee,z)});break}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(P)));n.selectedDates=n.config.allowInvalidPreload?q:q.filter(function(ee){return ee instanceof Date&&Z(ee,!1)}),n.config.mode==="range"&&n.selectedDates.sort(function(ee,ae){return ee.getTime()-ae.getTime()})}function Nt(P,z,q){if(z===void 0&&(z=!1),q===void 0&&(q=n.config.dateFormat),P!==0&&!P||P instanceof Array&&P.length===0)return n.clear(z);_t(P,q),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),w(void 0,z),p(),n.selectedDates.length===0&&n.clear(!1),Gt(z),z&&Ne("onChange")}function kn(P){return P.slice().map(function(z){return typeof z=="string"||typeof z=="number"||z instanceof Date?n.parseDate(z,void 0,!0):z&&typeof z=="object"&&z.from&&z.to?{from:n.parseDate(z.from,void 0),to:n.parseDate(z.to,void 0)}:z}).filter(function(z){return z})}function Ei(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var P=n.config.defaultDate||((n.input.nodeName==="INPUT"||n.input.nodeName==="TEXTAREA")&&n.input.placeholder&&n.input.value===n.input.placeholder?null:n.input.value);P&&_t(P,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]),n.config.minTime!==void 0&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),n.config.maxTime!==void 0&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}function dn(){if(n.input=he(),!n.input){n.config.errorHandler(new Error("Invalid input element specified"));return}n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=$e(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),Mr()}function Mr(){n._positionElement=n.config.positionElement||n._input}function $o(){var P=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=$e("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=P,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr=P==="datetime-local"?"Y-m-d\\TH:i:S":P==="date"?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",n.altInput!==void 0&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(z){}m(n.mobileInput,"change",function(z){n.setDate(Zt(z).value,!1,n.mobileFormatStr),Ne("onChange"),Ne("onClose")})}function Fo(P){if(n.isOpen===!0)return n.close();n.open(P)}function Ne(P,z){if(n.config!==void 0){var q=n.config[P];if(q!==void 0&&q.length>0)for(var ee=0;q[ee]&&ee<q.length;ee++)q[ee](n.selectedDates,n.input.value,n,z);P==="onChange"&&(n.input.dispatchEvent(hr("change")),n.input.dispatchEvent(hr("input")))}}function hr(P){var z=document.createEvent("Event");return z.initEvent(P,!0,!0),z}function Lr(P){for(var z=0;z<n.selectedDates.length;z++){var q=n.selectedDates[z];if(q instanceof Date&&en(q,P)===0)return""+z}return!1}function ki(P){return n.config.mode!=="range"||n.selectedDates.length<2?!1:en(P,n.selectedDates[0])>=0&&en(P,n.selectedDates[1])<=0}function pr(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(P,z){var q=new Date(n.currentYear,n.currentMonth,1);q.setMonth(n.currentMonth+z),n.config.showMonths>1||n.config.monthSelectorType==="static"?n.monthElements[z].textContent=ps(q.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=q.getMonth().toString(),P.value=q.getFullYear().toString()}),n._hidePrevMonthArrow=n.config.minDate!==void 0&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=n.config.maxDate!==void 0&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function gr(P){var z=P||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(q){return n.formatDate(q,z)}).filter(function(q,ee,ae){return n.config.mode!=="range"||n.config.enableTime||ae.indexOf(q)===ee}).join(n.config.mode!=="range"?n.config.conjunction:n.l10n.rangeSeparator)}function Gt(P){P===void 0&&(P=!0),n.mobileInput!==void 0&&n.mobileFormatStr&&(n.mobileInput.value=n.latestSelectedDateObj!==void 0?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=gr(n.config.dateFormat),n.altInput!==void 0&&(n.altInput.value=gr(n.config.altFormat)),P!==!1&&Ne("onValueUpdate")}function zt(P){var z=Zt(P),q=n.prevMonthNav.contains(z),ee=n.nextMonthNav.contains(z);q||ee?D(q?-1:1):n.yearElements.indexOf(z)>=0?z.select():z.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):z.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}function bt(P){P.preventDefault();var z=P.type==="keydown",q=Zt(P),ee=q;n.amPM!==void 0&&q===n.amPM&&(n.amPM.textContent=n.l10n.amPM[cn(n.amPM.textContent===n.l10n.amPM[0])]);var ae=parseFloat(ee.getAttribute("min")),ue=parseFloat(ee.getAttribute("max")),Ce=parseFloat(ee.getAttribute("step")),fe=parseInt(ee.value,10),Se=P.delta||(z?P.which===38?1:-1:0),pe=fe+Ce*Se;if(typeof ee.value!="undefined"&&ee.value.length===2){var ie=ee===n.hourElement,Ae=ee===n.minuteElement;pe<ae?(pe=ue+pe+cn(!ie)+(cn(ie)&&cn(!n.amPM)),Ae&&I(void 0,-1,n.hourElement)):pe>ue&&(pe=ee===n.hourElement?pe-ue-cn(!n.amPM):ae,Ae&&I(void 0,1,n.hourElement)),n.amPM&&ie&&(Ce===1?pe+fe===23:Math.abs(pe-fe)>Ce)&&(n.amPM.textContent=n.l10n.amPM[cn(n.amPM.textContent===n.l10n.amPM[0])]),ee.value=Wt(pe)}}return i(),n}function pi(e,t){for(var n=Array.prototype.slice.call(e).filter(function(a){return a instanceof HTMLElement}),r=[],i=0;i<n.length;i++){var o=n[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=ZP(o,t||{}),r.push(o._flatpickr)}catch(a){console.error(a)}}return r.length===1?r[0]:r}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return pi(this,e)},HTMLElement.prototype.flatpickr=function(e){return pi([this],e)});var mt=function(e,t){return typeof e=="string"?pi(window.document.querySelectorAll(e),t):e instanceof Node?pi([e],t):pi(e,t)};mt.defaultConfig={},mt.l10ns={en:Rt({},bo),default:Rt({},bo)},mt.localize=function(e){mt.l10ns.default=Rt(Rt({},mt.l10ns.default),e)},mt.setDefaults=function(e){mt.defaultConfig=Rt(Rt({},mt.defaultConfig),e)},mt.parseDate=nu({}),mt.formatDate=xg({}),mt.compareDates=en,typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(e){return pi(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof e=="string"?parseInt(e,10):e))},typeof window!="undefined"&&(window.flatpickr=mt);const eD=Wu(Object.freeze(Object.defineProperty({__proto__:null,default:mt},Symbol.toStringTag,{value:"Module"})));(function(e){function t(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(U){return typeof U}:t=function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},t(D)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(y),r=o(JS),i=o(eD);function o(D){return D&&D.__esModule?D:{default:D}}function a(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return a=function(){return D},D}function l(D){if(D&&D.__esModule)return D;if(D===null||t(D)!=="object"&&typeof D!="function")return{default:D};var L=a();if(L&&L.has(D))return L.get(D);var U={},G=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var oe in D)if(Object.prototype.hasOwnProperty.call(D,oe)){var ce=G?Object.getOwnPropertyDescriptor(D,oe):null;ce&&(ce.get||ce.set)?Object.defineProperty(U,oe,ce):U[oe]=D[oe]}return U.default=D,L&&L.set(D,U),U}function c(D){return p(D)||d(D)||f(D)||u()}function u(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2458
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(D,L){if(D){if(typeof D=="string")return g(D,L);var U=Object.prototype.toString.call(D).slice(8,-1);if(U==="Object"&&D.constructor&&(U=D.constructor.name),U==="Map"||U==="Set")return Array.from(D);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return g(D,L)}}function d(D){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(D))return Array.from(D)}function p(D){if(Array.isArray(D))return g(D)}function g(D,L){(L==null||L>D.length)&&(L=D.length);for(var U=0,G=new Array(L);U<L;U++)G[U]=D[U];return G}function v(){return v=Object.assign||function(D){for(var L=1;L<arguments.length;L++){var U=arguments[L];for(var G in U)Object.prototype.hasOwnProperty.call(U,G)&&(D[G]=U[G])}return D},v.apply(this,arguments)}function m(D,L){if(D==null)return{};var U=b(D,L),G,oe;if(Object.getOwnPropertySymbols){var ce=Object.getOwnPropertySymbols(D);for(oe=0;oe<ce.length;oe++)G=ce[oe],!(L.indexOf(G)>=0)&&Object.prototype.propertyIsEnumerable.call(D,G)&&(U[G]=D[G])}return U}function b(D,L){if(D==null)return{};var U={},G=Object.keys(D),oe,ce;for(ce=0;ce<G.length;ce++)oe=G[ce],!(L.indexOf(oe)>=0)&&(U[oe]=D[oe]);return U}function C(D,L){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(D);L&&(G=G.filter(function(oe){return Object.getOwnPropertyDescriptor(D,oe).enumerable})),U.push.apply(U,G)}return U}function w(D){for(var L=1;L<arguments.length;L++){var U=arguments[L]!=null?arguments[L]:{};L%2?C(Object(U),!0).forEach(function(G){N(D,G,U[G])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):C(Object(U)).forEach(function(G){Object.defineProperty(D,G,Object.getOwnPropertyDescriptor(U,G))})}return D}function x(D,L){if(!(D instanceof L))throw new TypeError("Cannot call a class as a function")}function I(D,L){for(var U=0;U<L.length;U++){var G=L[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(D,G.key,G)}}function S(D,L,U){return L&&I(D.prototype,L),D}function A(D,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(L&&L.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),L&&E(D,L)}function E(D,L){return E=Object.setPrototypeOf||function(G,oe){return G.__proto__=oe,G},E(D,L)}function k(D){var L=O();return function(){var G=T(D),oe;if(L){var ce=T(this).constructor;oe=Reflect.construct(G,arguments,ce)}else oe=G.apply(this,arguments);return F(this,oe)}}function F(D,L){return L&&(t(L)==="object"||typeof L=="function")?L:W(D)}function W(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function O(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(D){return!1}}function T(D){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(U){return U.__proto__||Object.getPrototypeOf(U)},T(D)}function N(D,L,U){return L in D?Object.defineProperty(D,L,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[L]=U,D}var H=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],j=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),$=["onCreate","onDestroy"],M=r.default.func,V=function(D){A(U,D);var L=k(U);function U(){var G;x(this,U);for(var oe=arguments.length,ce=new Array(oe),se=0;se<oe;se++)ce[se]=arguments[se];return G=L.call.apply(L,[this].concat(ce)),N(W(G),"createFlatpickrInstance",function(){var Z=w({onClose:function(){G.node.blur&&G.node.blur()}},G.props.options);Z=Y(Z,G.props),G.flatpickr=(0,i.default)(G.node,Z),G.props.hasOwnProperty("value")&&G.flatpickr.setDate(G.props.value,!1);var te=G.props.onCreate;te&&te(G.flatpickr)}),N(W(G),"destroyFlatpickrInstance",function(){var Z=G.props.onDestroy;Z&&Z(G.flatpickr),G.flatpickr.destroy(),G.flatpickr=null}),N(W(G),"handleNodeChange",function(Z){G.node=Z,G.flatpickr&&(G.destroyFlatpickrInstance(),G.createFlatpickrInstance())}),G}return S(U,[{key:"componentDidUpdate",value:function(oe){var ce=this.props.options,se=oe.options;ce=Y(ce,this.props),se=Y(se,oe);for(var Z=Object.getOwnPropertyNames(ce),te=Z.length-1;te>=0;te--){var ne=Z[te],de=ce[ne];de!==se[ne]&&(H.indexOf(ne)!==-1&&!Array.isArray(de)&&(de=[de]),this.flatpickr.set(ne,de))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&oe.value&&Array.isArray(oe.value)&&this.props.value.every(function(ve,Fe){oe[Fe]}))&&this.props.value!==oe.value&&this.flatpickr.setDate(this.props.value,!1)}},{key:"componentDidMount",value:function(){this.createFlatpickrInstance()}},{key:"componentWillUnmount",value:function(){this.destroyFlatpickrInstance()}},{key:"render",value:function(){var oe=this.props,ce=oe.options,se=oe.defaultValue,Z=oe.value,te=oe.children,ne=oe.render,de=m(oe,["options","defaultValue","value","children","render"]);return H.forEach(function(ve){delete de[ve]}),$.forEach(function(ve){delete de[ve]}),ne?ne(w(w({},de),{},{defaultValue:se,value:Z}),this.handleNodeChange):ce.wrap?n.default.createElement("div",v({},de,{ref:this.handleNodeChange}),te):n.default.createElement("input",v({},de,{defaultValue:se,ref:this.handleNodeChange}))}}]),U}(n.Component);N(V,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:j,onOpen:j,onClose:j,onMonthChange:j,onYearChange:j,onReady:j,onValueUpdate:j,onDayCreate:j,onCreate:M,onDestroy:M,value:r.default.oneOfType([r.default.string,r.default.array,r.default.object,r.default.number]),children:r.default.node,className:r.default.string,render:r.default.func}),N(V,"defaultProps",{options:{}});function Y(D,L){var U=w({},D);return H.forEach(function(G){if(L.hasOwnProperty(G)){var oe;U[G]&&!Array.isArray(U[G])?U[G]=[U[G]]:U[G]||(U[G]=[]);var ce=Array.isArray(L[G])?L[G]:[L[G]];(oe=U[G]).push.apply(oe,c(ce))}}),U}var X=V;e.default=X})(vg);const wg=bn(vg);var Sg={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",l="minute",c="hour",u="day",f="week",d="month",p="quarter",g="year",v="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var j=["th","st","nd","rd"],$=H%100;return"["+H+(j[($-20)%10]||j[$]||j[0])+"]"}},x=function(H,j,$){var M=String(H);return!M||M.length>=j?H:""+Array(j+1-M.length).join($)+H},I={s:x,z:function(H){var j=-H.utcOffset(),$=Math.abs(j),M=Math.floor($/60),V=$%60;return(j<=0?"+":"-")+x(M,2,"0")+":"+x(V,2,"0")},m:function H(j,$){if(j.date()<$.date())return-H($,j);var M=12*($.year()-j.year())+($.month()-j.month()),V=j.clone().add(M,d),Y=$-V<0,X=j.clone().add(M+(Y?-1:1),d);return+(-(M+($-V)/(Y?V-X:X-V))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:d,y:g,w:f,d:u,D:v,h:c,m:l,s:a,ms:o,Q:p}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},S="en",A={};A[S]=w;var E="$isDayjsObject",k=function(H){return H instanceof T||!(!H||!H[E])},F=function H(j,$,M){var V;if(!j)return S;if(typeof j=="string"){var Y=j.toLowerCase();A[Y]&&(V=Y),$&&(A[Y]=$,V=Y);var X=j.split("-");if(!V&&X.length>1)return H(X[0])}else{var D=j.name;A[D]=j,V=D}return!M&&V&&(S=V),V||!M&&S},W=function(H,j){if(k(H))return H.clone();var $=typeof j=="object"?j:{};return $.date=H,$.args=arguments,new T($)},O=I;O.l=F,O.i=k,O.w=function(H,j){return W(H,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var T=function(){function H($){this.$L=F($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[E]=!0}var j=H.prototype;return j.parse=function($){this.$d=function(M){var V=M.date,Y=M.utc;if(V===null)return new Date(NaN);if(O.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var X=V.match(b);if(X){var D=X[2]-1||0,L=(X[7]||"0").substring(0,3);return Y?new Date(Date.UTC(X[1],D,X[3]||1,X[4]||0,X[5]||0,X[6]||0,L)):new Date(X[1],D,X[3]||1,X[4]||0,X[5]||0,X[6]||0,L)}}return new Date(V)}($),this.init()},j.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},j.$utils=function(){return O},j.isValid=function(){return this.$d.toString()!==m},j.isSame=function($,M){var V=W($);return this.startOf(M)<=V&&V<=this.endOf(M)},j.isAfter=function($,M){return W($)<this.startOf(M)},j.isBefore=function($,M){return this.endOf(M)<W($)},j.$g=function($,M,V){return O.u($)?this[M]:this.set(V,$)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function($,M){var V=this,Y=!!O.u(M)||M,X=O.p($),D=function(te,ne){var de=O.w(V.$u?Date.UTC(V.$y,ne,te):new Date(V.$y,ne,te),V);return Y?de:de.endOf(u)},L=function(te,ne){return O.w(V.toDate()[te].apply(V.toDate("s"),(Y?[0,0,0,0]:[23,59,59,999]).slice(ne)),V)},U=this.$W,G=this.$M,oe=this.$D,ce="set"+(this.$u?"UTC":"");switch(X){case g:return Y?D(1,0):D(31,11);case d:return Y?D(1,G):D(0,G+1);case f:var se=this.$locale().weekStart||0,Z=(U<se?U+7:U)-se;return D(Y?oe-Z:oe+(6-Z),G);case u:case v:return L(ce+"Hours",0);case c:return L(ce+"Minutes",1);case l:return L(ce+"Seconds",2);case a:return L(ce+"Milliseconds",3);default:return this.clone()}},j.endOf=function($){return this.startOf($,!1)},j.$set=function($,M){var V,Y=O.p($),X="set"+(this.$u?"UTC":""),D=(V={},V[u]=X+"Date",V[v]=X+"Date",V[d]=X+"Month",V[g]=X+"FullYear",V[c]=X+"Hours",V[l]=X+"Minutes",V[a]=X+"Seconds",V[o]=X+"Milliseconds",V)[Y],L=Y===u?this.$D+(M-this.$W):M;if(Y===d||Y===g){var U=this.clone().set(v,1);U.$d[D](L),U.init(),this.$d=U.set(v,Math.min(this.$D,U.daysInMonth())).$d}else D&&this.$d[D](L);return this.init(),this},j.set=function($,M){return this.clone().$set($,M)},j.get=function($){return this[O.p($)]()},j.add=function($,M){var V,Y=this;$=Number($);var X=O.p(M),D=function(G){var oe=W(Y);return O.w(oe.date(oe.date()+Math.round(G*$)),Y)};if(X===d)return this.set(d,this.$M+$);if(X===g)return this.set(g,this.$y+$);if(X===u)return D(1);if(X===f)return D(7);var L=(V={},V[l]=r,V[c]=i,V[a]=n,V)[X]||1,U=this.$d.getTime()+$*L;return O.w(U,this)},j.subtract=function($,M){return this.add(-1*$,M)},j.format=function($){var M=this,V=this.$locale();if(!this.isValid())return V.invalidDate||m;var Y=$||"YYYY-MM-DDTHH:mm:ssZ",X=O.z(this),D=this.$H,L=this.$m,U=this.$M,G=V.weekdays,oe=V.months,ce=V.meridiem,se=function(ne,de,ve,Fe){return ne&&(ne[de]||ne(M,Y))||ve[de].slice(0,Fe)},Z=function(ne){return O.s(D%12||12,ne,"0")},te=ce||function(ne,de,ve){var Fe=ne<12?"AM":"PM";return ve?Fe.toLowerCase():Fe};return Y.replace(C,function(ne,de){return de||function(ve){switch(ve){case"YY":return String(M.$y).slice(-2);case"YYYY":return O.s(M.$y,4,"0");case"M":return U+1;case"MM":return O.s(U+1,2,"0");case"MMM":return se(V.monthsShort,U,oe,3);case"MMMM":return se(oe,U);case"D":return M.$D;case"DD":return O.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return se(V.weekdaysMin,M.$W,G,2);case"ddd":return se(V.weekdaysShort,M.$W,G,3);case"dddd":return G[M.$W];case"H":return String(D);case"HH":return O.s(D,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return te(D,L,!0);case"A":return te(D,L,!1);case"m":return String(L);case"mm":return O.s(L,2,"0");case"s":return String(M.$s);case"ss":return O.s(M.$s,2,"0");case"SSS":return O.s(M.$ms,3,"0");case"Z":return X}return null}(ne)||X.replace(":","")})},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function($,M,V){var Y,X=this,D=O.p(M),L=W($),U=(L.utcOffset()-this.utcOffset())*r,G=this-L,oe=function(){return O.m(X,L)};switch(D){case g:Y=oe()/12;break;case d:Y=oe();break;case p:Y=oe()/3;break;case f:Y=(G-U)/6048e5;break;case u:Y=(G-U)/864e5;break;case c:Y=G/i;break;case l:Y=G/r;break;case a:Y=G/n;break;default:Y=G}return V?Y:O.a(Y)},j.daysInMonth=function(){return this.endOf(d).$D},j.$locale=function(){return A[this.$L]},j.locale=function($,M){if(!$)return this.$L;var V=this.clone(),Y=F($,M,!0);return Y&&(V.$L=Y),V},j.clone=function(){return O.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},H}(),N=T.prototype;return W.prototype=N,[["$ms",o],["$s",a],["$m",l],["$H",c],["$W",u],["$M",d],["$y",g],["$D",v]].forEach(function(H){N[H[1]]=function(j){return this.$g(j,H[0],H[1])}}),W.extend=function(H,j){return H.$i||(H(j,T,W),H.$i=!0),W},W.locale=F,W.isDayjs=k,W.unix=function(H){return W(1e3*H)},W.en=A[S],W.Ls=A,W.p={},W})})(Sg);var tD=Sg.exports;const ft=bn(tD);var Ig={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(i,o,a){var l,c=function(p,g,v){v===void 0&&(v={});var m=new Date(p),b=function(C,w){w===void 0&&(w={});var x=w.timeZoneName||"short",I=C+"|"+x,S=r[I];return S||(S=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:C,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),r[I]=S),S}(g,v);return b.formatToParts(m)},u=function(p,g){for(var v=c(p,g),m=[],b=0;b<v.length;b+=1){var C=v[b],w=C.type,x=C.value,I=n[w];I>=0&&(m[I]=parseInt(x,10))}var S=m[3],A=S===24?0:S,E=m[0]+"-"+m[1]+"-"+m[2]+" "+A+":"+m[4]+":"+m[5]+":000",k=+p;return(a.utc(E).valueOf()-(k-=k%1e3))/6e4},f=o.prototype;f.tz=function(p,g){p===void 0&&(p=l);var v,m=this.utcOffset(),b=this.toDate(),C=b.toLocaleString("en-US",{timeZone:p}),w=Math.round((b-new Date(C))/1e3/60),x=15*-Math.round(b.getTimezoneOffset()/15)-w;if(!Number(x))v=this.utcOffset(0,g);else if(v=a(C,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),g){var I=v.utcOffset();v=v.add(m-I,"minute")}return v.$x.$timezone=p,v},f.offsetName=function(p){var g=this.$x.$timezone||a.tz.guess(),v=c(this.valueOf(),g,{timeZoneName:p}).find(function(m){return m.type.toLowerCase()==="timezonename"});return v&&v.value};var d=f.startOf;f.startOf=function(p,g){if(!this.$x||!this.$x.$timezone)return d.call(this,p,g);var v=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(v,p,g).tz(this.$x.$timezone,!0)},a.tz=function(p,g,v){var m=v&&g,b=v||g||l,C=u(+a(),b);if(typeof p!="string")return a(p).tz(b);var w=function(A,E,k){var F=A-60*E*1e3,W=u(F,k);if(E===W)return[F,E];var O=u(F-=60*(W-E)*1e3,k);return W===O?[F,W]:[A-60*Math.min(W,O)*1e3,Math.max(W,O)]}(a.utc(p,m).valueOf(),C,b),x=w[0],I=w[1],S=a(x).utcOffset(I);return S.$x.$timezone=b,S},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(p){l=p}}})})(Ig);var nD=Ig.exports;const rD=bn(nD);var Ag={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jt,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(o,a,l){var c=a.prototype;l.utc=function(m){var b={date:m,utc:!0,args:arguments};return new a(b)},c.utc=function(m){var b=l(this.toDate(),{locale:this.$L,utc:!0});return m?b.add(this.utcOffset(),n):b},c.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var u=c.parse;c.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),u.call(this,m)};var f=c.init;c.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else f.call(this)};var d=c.utcOffset;c.utcOffset=function(m,b){var C=this.$utils().u;if(C(m))return this.$u?0:C(this.$offset)?d.call(this):this.$offset;if(typeof m=="string"&&(m=function(S){S===void 0&&(S="");var A=S.match(r);if(!A)return null;var E=(""+A[0]).match(i)||["-",0,0],k=E[0],F=60*+E[1]+ +E[2];return F===0?0:k==="+"?F:-F}(m),m===null))return this;var w=Math.abs(m)<=16?60*m:m,x=this;if(b)return x.$offset=w,x.$u=m===0,x;if(m!==0){var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(w+I,n)).$offset=w,x.$x.$localOffset=I}else x=this.utc();return x};var p=c.format;c.format=function(m){var b=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,b)},c.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(m){return m==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var v=c.diff;c.diff=function(m,b,C){if(m&&this.$u===m.$u)return v.call(this,m,b,C);var w=this.local(),x=l(m).local();return v.call(w,x,b,C)}}})})(Ag);var iD=Ag.exports;const oD=bn(iD);ft.extend(rD),ft.extend(oD);const aD=e=>{if(!ft(e).isAfter(ft(Date.now()).subtract(15,"minute")))return ft(Date.now()).add(15,"minute").toDate()},ou=({defaultDate:e,minDate:t,maxDate:n,dateFormat:r="DD.MM.YYYY HH:mm",onChange:i})=>{const o=a=>{if(a&&a.length){const l=ft.utc(a[0]).toISOString();i(l)}else i("")};return s.jsx(h.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",paddingLeft:"0.5rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,minHeight:"37px",color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:s.jsx(wg,{value:e&&ft(e).format("YYYY-MM-DD HH:mm")||void 0,onChange:o,className:"flatpickr-input",options:{enableTime:!0,dateFormat:r,position:"below",minDate:t||aD(e),maxDate:n,parseDate:(a,l)=>ft(a,l).toDate(),formatDate:(a,l)=>ft(a).format(l),time_24hr:!0,minuteIncrement:1}})})},sD=({required:e,defaultValue:t,onChangeFromDate:n,onChangeToDate:r})=>{const[i,o]=t;return s.jsxs(h.Box,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormControl,{children:s.jsx(h.FormLabel,{required:e,color:"primary",children:"Duration"})}),s.jsxs(h.Grid,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"flex-start",children:[s.jsx(vo,{label:"From date",defaultValue:i,required:e,onChange:n}),s.jsx(vo,{label:"To date",defaultValue:o,required:e,onChange:r})]})]})},Tg=e=>{if(!e)return[];const{from:t,to:n}=e,r=[];return t&&r.push(ft(t).toDate()),n&&r.push(ft(n).toDate()),r},lD=({label:e,defaultValue:t,required:n,onChange:r})=>{const[i,o]=y.useState(Tg(t)),[a,l]=y.useState(!1),c=()=>l(!a),u=f=>{if(f&&f.length>0){const d="YYYY-MM-DD",p=ft(f[0]).format(d),g=ft(f[1]).format(d);r({from:p,to:g})}else f&&f.length===0&&(r({from:"",to:""}),c());o(f)};return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:n,color:"primary",children:e}),s.jsx(h.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",padding:"0.5rem 0.75rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:s.jsx(wg,{value:i,onChange:u,placeholder:"Select Date...",className:"flatpickr-input",options:{mode:"range",enableTime:!1,dateFormat:"DD.MM.YYYY",altFormat:"DD.MM.YYYY",position:"below",parseDate:(f,d)=>ft(f,d).toDate(),formatDate:(f,d)=>ft(f).format(d),defaultDate:Tg(t)||void 0}})}),s.jsx(Ge,{showToast:a,message:"Succesfully cleared the duration time",color:"primary",hideToast:c})]})},cD=({environment:e,labels:t,setNoPermission:n})=>{const{featureDisabled:r,noPermissionMessage:i,tryAgainButton:o}=t,a=()=>{no(e).signOut().then(()=>n(null)).catch(l=>{console.error("There was a problem logging out the user:",l)})};return s.jsx(h.Box,{"data-testid":"no permission card",sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",bgcolor:"background.body"},children:s.jsx(h.Card,{variant:"outlined",sx:{maxWidth:300,overflow:"hidden",borderRadius:"md"},children:s.jsxs(h.CardContent,{children:[s.jsx(h.Typography,{level:"h2",textAlign:"center",mb:2,children:r}),s.jsx(h.Typography,{level:"body-md",color:"neutral",mb:2,children:i}),s.jsx(h.Box,{display:"flex",justifyContent:"center",children:s.jsx(h.Button,{variant:"solid",color:"neutral",fullWidth:!0,size:"sm",onClick:a,children:o})})]})})})},Eg=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],au=e=>e.reduce((t,n)=>(t[n.key]=n.value,t),{}),uD=({labels:e,type:t,defaultValue:n,onChange:r})=>{const[i,o]=y.useState(Eg(n)),[a,l]=y.useState(null),[c,u]=y.useState(""),[f,d]=y.useState(""),[p,g]=y.useState(""),[v,m]=y.useState("");y.useEffect(()=>o(Eg(n)),[n]);const b=()=>{const I=[...i];I.push({key:c,value:p}),o(I),u(""),g(""),r(au(I))},C=I=>{const S=i.filter((A,E)=>E!==I);o(S),r(au(S))},w=(I,S)=>{d(S.key),m(S.value),l(I)},x=I=>{const S=[...i];S[I]={key:f,value:v},o(S),l(null),d(""),m(""),r(au(S))};return s.jsxs(h.Box,{children:[i.map((I,S)=>s.jsx(h.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:s.jsx(h.CardContent,{style:{flex:1},children:a===S?s.jsxs(h.Box,{display:"flex",alignItems:"center",children:[s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:f,onChange:A=>d(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:v,onChange:A=>m(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Tooltip,{title:e.save,children:f&&v?s.jsx(h.IconButton,{onClick:()=>x(S),children:s.jsx(_e.Check,{})}):s.jsx("span",{children:s.jsx(h.IconButton,{disabled:!0,children:s.jsx(_e.Check,{})})})})]}):s.jsxs(h.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{style:{fontWeight:"bold"},children:[e.keyDynamicFields,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:I.key})]}),s.jsxs(h.Typography,{style:{color:"gray"},children:[e.valueDynamicFields,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:I.value})]})]}),s.jsxs(h.Box,{children:[s.jsx(h.Tooltip,{title:e.edit,children:s.jsx(h.IconButton,{onClick:()=>w(S,I),children:s.jsx(_e.Edit,{})})}),s.jsx(h.Tooltip,{title:e.delete,children:s.jsx(h.IconButton,{onClick:()=>C(S),children:s.jsx(_e.Delete,{})})})]})]})})},`dynamic-fields-${t}-${S}`)),s.jsxs(h.Box,{display:"flex",alignItems:"center",style:{marginTop:i&&i.length?"20px":"0px"},children:[s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",value:c,placeholder:e.keyDynamicFields,onChange:I=>u(I.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",value:p,onChange:I=>g(I.target.value),placeholder:e.valueDynamicFields,sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Tooltip,{title:e.add,children:c&&p?s.jsx(h.Button,{onClick:b,children:s.jsx(_e.Add,{})}):s.jsx("span",{children:s.jsx(h.Button,{disabled:!0,children:s.jsx(_e.Add,{})})})})]})]})};function xo(e,t,n){return(t=fc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kg(Object(n),!0).forEach(function(r){xo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fc(r.key),r)}}function fD(e,t,n){return t&&_g(e.prototype,t),n&&_g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function su(e,t){return su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},su(e,t)}function hD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&su(e,t)}function gs(e){return gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gs(e)}function Pg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pg=function(){return!!e})()}function pD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gD(e,t){if(t&&(Er(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pD(e)}function mD(e){var t=Pg();return function(){var n,r=gs(e);if(t){var i=gs(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return gD(this,n)}}function lu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vD(e){if(Array.isArray(e))return lu(e)}function bD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Dg(e,t){if(e){if(typeof e=="string")return lu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lu(e,t):void 0}}function yD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2457
+ `}}function X(){n.calendarContainer.classList.add("hasWeeks");var P=$e("div","flatpickr-weekwrapper");P.appendChild($e("span","flatpickr-weekday",n.l10n.weekAbbreviation));var z=$e("div","flatpickr-weeks");return P.appendChild(z),{weekWrapper:P,weekNumbers:z}}function D(P,z){z===void 0&&(z=!0);var q=z?P:P-n.currentMonth;q<0&&n._hidePrevMonthArrow===!0||q>0&&n._hideNextMonthArrow===!0||(n.currentMonth+=q,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,Ne("onYearChange"),N()),T(),Ne("onMonthChange"),pr())}function L(P,z){if(P===void 0&&(P=!0),z===void 0&&(z=!0),n.input.value="",n.altInput!==void 0&&(n.altInput.value=""),n.mobileInput!==void 0&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,z===!0&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),n.config.enableTime===!0){var q=iu(n.config),ee=q.hours,ae=q.minutes,ue=q.seconds;g(ee,ae,ue)}n.redraw(),P&&Ne("onChange")}function U(){n.isOpen=!1,n.isMobile||(n.calendarContainer!==void 0&&n.calendarContainer.classList.remove("open"),n._input!==void 0&&n._input.classList.remove("active")),Ne("onClose")}function G(){n.config!==void 0&&Ne("onDestroy");for(var P=n._handlers.length;P--;)n._handlers[P].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var z=n.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(q){try{delete n[q]}catch(ee){}})}function oe(P){return n.calendarContainer.contains(P)}function ce(P){if(n.isOpen&&!n.config.inline){var z=Zt(P),q=oe(z),ee=z===n.input||z===n.altInput||n.element.contains(z)||P.path&&P.path.indexOf&&(~P.path.indexOf(n.input)||~P.path.indexOf(n.altInput)),ae=!ee&&!q&&!oe(P.relatedTarget),ue=!n.config.ignoredFocusElements.some(function(Ce){return Ce.contains(z)});ae&&ue&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0&&n.input.value!==""&&n.input.value!==void 0&&c(),n.close(),n.config&&n.config.mode==="range"&&n.selectedDates.length===1&&n.clear(!1))}}function se(P){if(!(!P||n.config.minDate&&P<n.config.minDate.getFullYear()||n.config.maxDate&&P>n.config.maxDate.getFullYear())){var z=P,q=n.currentYear!==z;n.currentYear=z||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),q&&(n.redraw(),Ne("onYearChange"),N())}}function Z(P,z){var q;z===void 0&&(z=!0);var ee=n.parseDate(P,void 0,z);if(n.config.minDate&&ee&&en(ee,n.config.minDate,z!==void 0?z:!n.minDateHasTime)<0||n.config.maxDate&&ee&&en(ee,n.config.maxDate,z!==void 0?z:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&n.config.disable.length===0)return!0;if(ee===void 0)return!1;for(var ae=!!n.config.enable,ue=(q=n.config.enable)!==null&&q!==void 0?q:n.config.disable,Ce=0,fe=void 0;Ce<ue.length;Ce++){if(fe=ue[Ce],typeof fe=="function"&&fe(ee))return ae;if(fe instanceof Date&&ee!==void 0&&fe.getTime()===ee.getTime())return ae;if(typeof fe=="string"){var Se=n.parseDate(fe,void 0,!0);return Se&&Se.getTime()===ee.getTime()?ae:!ae}else if(typeof fe=="object"&&ee!==void 0&&fe.from&&fe.to&&ee.getTime()>=fe.from.getTime()&&ee.getTime()<=fe.to.getTime())return ae}return!ae}function te(P){return n.daysContainer!==void 0?P.className.indexOf("hidden")===-1&&P.className.indexOf("flatpickr-disabled")===-1&&n.daysContainer.contains(P):!1}function ne(P){var z=P.target===n._input,q=n._input.value.trimEnd()!==gr();z&&q&&!(P.relatedTarget&&oe(P.relatedTarget))&&n.setDate(n._input.value,!0,P.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function de(P){var z=Zt(P),q=n.config.wrap?e.contains(z):z===n._input,ee=n.config.allowInput,ae=n.isOpen&&(!ee||!q),ue=n.config.inline&&q&&!ee;if(P.keyCode===13&&q){if(ee)return n.setDate(n._input.value,!0,z===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),z.blur();n.open()}else if(oe(z)||ae||ue){var Ce=!!n.timeContainer&&n.timeContainer.contains(z);switch(P.keyCode){case 13:Ce?(P.preventDefault(),c(),Pe()):St(P);break;case 27:P.preventDefault(),Pe();break;case 8:case 46:q&&!n.config.allowInput&&(P.preventDefault(),n.clear());break;case 37:case 39:if(!Ce&&!q){P.preventDefault();var fe=o();if(n.daysContainer!==void 0&&(ee===!1||fe&&te(fe))){var Se=P.keyCode===39?1:-1;P.ctrlKey?(P.stopPropagation(),D(Se),W(k(1),0)):W(void 0,Se)}}else n.hourElement&&n.hourElement.focus();break;case 38:case 40:P.preventDefault();var pe=P.keyCode===40?1:-1;n.daysContainer&&z.$i!==void 0||z===n.input||z===n.altInput?P.ctrlKey?(P.stopPropagation(),se(n.currentYear-pe),W(k(1),0)):Ce||W(void 0,pe*7):z===n.currentYearElement?se(n.currentYear-pe):n.config.enableTime&&(!Ce&&n.hourElement&&n.hourElement.focus(),c(P),n._debouncedChange());break;case 9:if(Ce){var ie=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(lt){return lt}),Ae=ie.indexOf(z);if(Ae!==-1){var Lt=ie[Ae+(P.shiftKey?-1:1)];P.preventDefault(),(Lt||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(z)&&P.shiftKey&&(P.preventDefault(),n._input.focus());break}}if(n.amPM!==void 0&&z===n.amPM)switch(P.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],d(),Wt();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],d(),Wt();break}(q||oe(z))&&Ne("onKeyDown",P)}function ve(P,z){if(z===void 0&&(z="flatpickr-day"),!(n.selectedDates.length!==1||P&&(!P.classList.contains(z)||P.classList.contains("flatpickr-disabled")))){for(var q=P?P.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),ee=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),ae=Math.min(q,n.selectedDates[0].getTime()),ue=Math.max(q,n.selectedDates[0].getTime()),Ce=!1,fe=0,Se=0,pe=ae;pe<ue;pe+=JP.DAY)Z(new Date(pe),!0)||(Ce=Ce||pe>ae&&pe<ue,pe<ee&&(!fe||pe>fe)?fe=pe:pe>ee&&(!Se||pe<Se)&&(Se=pe));var ie=Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+z));ie.forEach(function(Ae){var Lt=Ae.dateObj,lt=Lt.getTime(),vn=fe>0&&lt<fe||Se>0&&lt>Se;if(vn){Ae.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(_n){Ae.classList.remove(_n)});return}else if(Ce&&!vn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(_n){Ae.classList.remove(_n)}),P!==void 0&&(P.classList.add(q<=n.selectedDates[0].getTime()?"startRange":"endRange"),ee<q&&lt===ee?Ae.classList.add("startRange"):ee>q&&lt===ee&&Ae.classList.add("endRange"),lt>=fe&&(Se===0||lt<=Se)&&qP(lt,ee,q)&&Ae.classList.add("inRange"))})}}function Fe(){n.isOpen&&!n.config.static&&!n.config.inline&&xe()}function st(P,z){if(z===void 0&&(z=n._positionElement),n.isMobile===!0){if(P){P.preventDefault();var q=Zt(P);q&&q.blur()}n.mobileInput!==void 0&&(n.mobileInput.focus(),n.mobileInput.click()),Ne("onOpen");return}else if(n._input.disabled||n.config.inline)return;var ee=n.isOpen;n.isOpen=!0,ee||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),Ne("onOpen"),xe(z)),n.config.enableTime===!0&&n.config.noCalendar===!0&&n.config.allowInput===!1&&(P===void 0||!n.timeContainer.contains(P.relatedTarget))&&setTimeout(function(){return n.hourElement.select()},50)}function Je(P){return function(z){var q=n.config["_"+P+"Date"]=n.parseDate(z,n.config.dateFormat),ee=n.config["_"+(P==="min"?"max":"min")+"Date"];q!==void 0&&(n[P==="min"?"minDateHasTime":"maxDateHasTime"]=q.getHours()>0||q.getMinutes()>0||q.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(ae){return Z(ae)}),!n.selectedDates.length&&P==="min"&&p(q),Wt()),n.daysContainer&&(Oe(),q!==void 0?n.currentYearElement[P]=q.getFullYear().toString():n.currentYearElement.removeAttribute(P),n.currentYearElement.disabled=!!ee&&q!==void 0&&ee.getFullYear()===q.getFullYear())}}function vt(){var P=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],z=Rt(Rt({},JSON.parse(JSON.stringify(e.dataset||{}))),t),q={};n.config.parseDate=z.parseDate,n.config.formatDate=z.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(ie){n.config._enable=kn(ie)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(ie){n.config._disable=kn(ie)}});var ee=z.mode==="time";if(!z.dateFormat&&(z.enableTime||ee)){var ae=mt.defaultConfig.dateFormat||hi.dateFormat;q.dateFormat=z.noCalendar||ee?"H:i"+(z.enableSeconds?":S":""):ae+" H:i"+(z.enableSeconds?":S":"")}if(z.altInput&&(z.enableTime||ee)&&!z.altFormat){var ue=mt.defaultConfig.altFormat||hi.altFormat;q.altFormat=z.noCalendar||ee?"h:i"+(z.enableSeconds?":S K":" K"):ue+(" h:i"+(z.enableSeconds?":S":"")+" K")}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:Je("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:Je("max")});var Ce=function(ie){return function(Ae){n.config[ie==="min"?"_minTime":"_maxTime"]=n.parseDate(Ae,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:Ce("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:Ce("max")}),z.mode==="time"&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,q,z);for(var fe=0;fe<P.length;fe++)n.config[P[fe]]=n.config[P[fe]]===!0||n.config[P[fe]]==="true";Zc.filter(function(ie){return n.config[ie]!==void 0}).forEach(function(ie){n.config[ie]=eu(n.config[ie]||[]).map(a)}),n.isMobile=!n.config.disableMobile&&!n.config.inline&&n.config.mode==="single"&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var fe=0;fe<n.config.plugins.length;fe++){var Se=n.config.plugins[fe](n)||{};for(var pe in Se)Zc.indexOf(pe)>-1?n.config[pe]=eu(Se[pe]).map(a).concat(n.config[pe]):typeof z[pe]=="undefined"&&(n.config[pe]=Se[pe])}z.altInputClass||(n.config.altInputClass=he().className+" "+n.config.altInputClass),Ne("onParseConfig")}function he(){return n.config.wrap?e.querySelector("[data-input]"):e}function ge(){typeof n.config.locale!="object"&&typeof mt.l10ns[n.config.locale]=="undefined"&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=Rt(Rt({},mt.l10ns.default),typeof n.config.locale=="object"?n.config.locale:n.config.locale!=="default"?mt.l10ns[n.config.locale]:void 0),Dr.D="("+n.l10n.weekdays.shorthand.join("|")+")",Dr.l="("+n.l10n.weekdays.longhand.join("|")+")",Dr.M="("+n.l10n.months.shorthand.join("|")+")",Dr.F="("+n.l10n.months.longhand.join("|")+")",Dr.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")";var P=Rt(Rt({},t),JSON.parse(JSON.stringify(e.dataset||{})));P.time_24hr===void 0&&mt.defaultConfig.time_24hr===void 0&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=xg(n),n.parseDate=nu({config:n.config,l10n:n.l10n})}function xe(P){if(typeof n.config.position=="function")return void n.config.position(n,P);if(n.calendarContainer!==void 0){Ne("onPreCalendarPosition");var z=P||n._positionElement,q=Array.prototype.reduce.call(n.calendarContainer.children,function(pz,gz){return pz+gz.offsetHeight},0),ee=n.calendarContainer.offsetWidth,ae=n.config.position.split(" "),ue=ae[0],Ce=ae.length>1?ae[1]:null,fe=z.getBoundingClientRect(),Se=window.innerHeight-fe.bottom,pe=ue==="above"||ue!=="below"&&Se<q&&fe.top>q,ie=window.pageYOffset+fe.top+(pe?-q-2:z.offsetHeight+2);if($t(n.calendarContainer,"arrowTop",!pe),$t(n.calendarContainer,"arrowBottom",pe),!n.config.inline){var Ae=window.pageXOffset+fe.left,Lt=!1,lt=!1;Ce==="center"?(Ae-=(ee-fe.width)/2,Lt=!0):Ce==="right"&&(Ae-=ee-fe.width,lt=!0),$t(n.calendarContainer,"arrowLeft",!Lt&&!lt),$t(n.calendarContainer,"arrowCenter",Lt),$t(n.calendarContainer,"arrowRight",lt);var vn=window.document.body.offsetWidth-(window.pageXOffset+fe.right),_n=Ae+ee>window.document.body.offsetWidth,sz=vn+ee>window.document.body.offsetWidth;if($t(n.calendarContainer,"rightMost",_n),!n.config.static)if(n.calendarContainer.style.top=ie+"px",!_n)n.calendarContainer.style.left=Ae+"px",n.calendarContainer.style.right="auto";else if(!sz)n.calendarContainer.style.left="auto",n.calendarContainer.style.right=vn+"px";else{var Vu=ke();if(Vu===void 0)return;var lz=window.document.body.offsetWidth,cz=Math.max(0,lz/2-ee/2),uz=".flatpickr-calendar.centerMost:before",dz=".flatpickr-calendar.centerMost:after",fz=Vu.cssRules.length,hz="{left:"+fe.left+"px;right:auto;}";$t(n.calendarContainer,"rightMost",!1),$t(n.calendarContainer,"centerMost",!0),Vu.insertRule(uz+","+dz+hz,fz),n.calendarContainer.style.left=cz+"px",n.calendarContainer.style.right="auto"}}}}function ke(){for(var P=null,z=0;z<document.styleSheets.length;z++){var q=document.styleSheets[z];if(q.cssRules){try{q.cssRules}catch(ee){continue}P=q;break}}return P!=null?P:Ye()}function Ye(){var P=document.createElement("style");return document.head.appendChild(P),P.sheet}function Oe(){n.config.noCalendar||n.isMobile||(N(),pr(),T())}function Pe(){n._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(n.close,0):n.close()}function St(P){P.preventDefault(),P.stopPropagation();var z=function(ie){return ie.classList&&ie.classList.contains("flatpickr-day")&&!ie.classList.contains("flatpickr-disabled")&&!ie.classList.contains("notAllowed")},q=yg(Zt(P),z);if(q!==void 0){var ee=q,ae=n.latestSelectedDateObj=new Date(ee.dateObj.getTime()),ue=(ae.getMonth()<n.currentMonth||ae.getMonth()>n.currentMonth+n.config.showMonths-1)&&n.config.mode!=="range";if(n.selectedDateElem=ee,n.config.mode==="single")n.selectedDates=[ae];else if(n.config.mode==="multiple"){var Ce=Lr(ae);Ce?n.selectedDates.splice(parseInt(Ce),1):n.selectedDates.push(ae)}else n.config.mode==="range"&&(n.selectedDates.length===2&&n.clear(!1,!1),n.latestSelectedDateObj=ae,n.selectedDates.push(ae),en(ae,n.selectedDates[0],!0)!==0&&n.selectedDates.sort(function(ie,Ae){return ie.getTime()-Ae.getTime()}));if(d(),ue){var fe=n.currentYear!==ae.getFullYear();n.currentYear=ae.getFullYear(),n.currentMonth=ae.getMonth(),fe&&(Ne("onYearChange"),N()),Ne("onMonthChange")}if(pr(),T(),Wt(),!ue&&n.config.mode!=="range"&&n.config.showMonths===1?E(ee):n.selectedDateElem!==void 0&&n.hourElement===void 0&&n.selectedDateElem&&n.selectedDateElem.focus(),n.hourElement!==void 0&&n.hourElement!==void 0&&n.hourElement.focus(),n.config.closeOnSelect){var Se=n.config.mode==="single"&&!n.config.enableTime,pe=n.config.mode==="range"&&n.selectedDates.length===2&&!n.config.enableTime;(Se||pe)&&Pe()}b()}}var It={locale:[ge,Y],showMonths:[j,l,V],minDate:[w],maxDate:[w],positionElement:[Mr],clickOpens:[function(){n.config.clickOpens===!0?(m(n._input,"focus",n.open),m(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function Mt(P,z){if(P!==null&&typeof P=="object"){Object.assign(n.config,P);for(var q in P)It[q]!==void 0&&It[q].forEach(function(ee){return ee()})}else n.config[P]=z,It[P]!==void 0?It[P].forEach(function(ee){return ee()}):Zc.indexOf(P)>-1&&(n.config[P]=eu(z));n.redraw(),Wt(!0)}function _t(P,z){var q=[];if(P instanceof Array)q=P.map(function(ee){return n.parseDate(ee,z)});else if(P instanceof Date||typeof P=="number")q=[n.parseDate(P,z)];else if(typeof P=="string")switch(n.config.mode){case"single":case"time":q=[n.parseDate(P,z)];break;case"multiple":q=P.split(n.config.conjunction).map(function(ee){return n.parseDate(ee,z)});break;case"range":q=P.split(n.l10n.rangeSeparator).map(function(ee){return n.parseDate(ee,z)});break}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(P)));n.selectedDates=n.config.allowInvalidPreload?q:q.filter(function(ee){return ee instanceof Date&&Z(ee,!1)}),n.config.mode==="range"&&n.selectedDates.sort(function(ee,ae){return ee.getTime()-ae.getTime()})}function Nt(P,z,q){if(z===void 0&&(z=!1),q===void 0&&(q=n.config.dateFormat),P!==0&&!P||P instanceof Array&&P.length===0)return n.clear(z);_t(P,q),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),w(void 0,z),p(),n.selectedDates.length===0&&n.clear(!1),Wt(z),z&&Ne("onChange")}function kn(P){return P.slice().map(function(z){return typeof z=="string"||typeof z=="number"||z instanceof Date?n.parseDate(z,void 0,!0):z&&typeof z=="object"&&z.from&&z.to?{from:n.parseDate(z.from,void 0),to:n.parseDate(z.to,void 0)}:z}).filter(function(z){return z})}function Ei(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var P=n.config.defaultDate||((n.input.nodeName==="INPUT"||n.input.nodeName==="TEXTAREA")&&n.input.placeholder&&n.input.value===n.input.placeholder?null:n.input.value);P&&_t(P,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]),n.config.minTime!==void 0&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),n.config.maxTime!==void 0&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}function dn(){if(n.input=he(),!n.input){n.config.errorHandler(new Error("Invalid input element specified"));return}n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=$e(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),Mr()}function Mr(){n._positionElement=n.config.positionElement||n._input}function $o(){var P=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=$e("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=P,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr=P==="datetime-local"?"Y-m-d\\TH:i:S":P==="date"?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",n.altInput!==void 0&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(z){}m(n.mobileInput,"change",function(z){n.setDate(Zt(z).value,!1,n.mobileFormatStr),Ne("onChange"),Ne("onClose")})}function Fo(P){if(n.isOpen===!0)return n.close();n.open(P)}function Ne(P,z){if(n.config!==void 0){var q=n.config[P];if(q!==void 0&&q.length>0)for(var ee=0;q[ee]&&ee<q.length;ee++)q[ee](n.selectedDates,n.input.value,n,z);P==="onChange"&&(n.input.dispatchEvent(hr("change")),n.input.dispatchEvent(hr("input")))}}function hr(P){var z=document.createEvent("Event");return z.initEvent(P,!0,!0),z}function Lr(P){for(var z=0;z<n.selectedDates.length;z++){var q=n.selectedDates[z];if(q instanceof Date&&en(q,P)===0)return""+z}return!1}function ki(P){return n.config.mode!=="range"||n.selectedDates.length<2?!1:en(P,n.selectedDates[0])>=0&&en(P,n.selectedDates[1])<=0}function pr(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(P,z){var q=new Date(n.currentYear,n.currentMonth,1);q.setMonth(n.currentMonth+z),n.config.showMonths>1||n.config.monthSelectorType==="static"?n.monthElements[z].textContent=ps(q.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=q.getMonth().toString(),P.value=q.getFullYear().toString()}),n._hidePrevMonthArrow=n.config.minDate!==void 0&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=n.config.maxDate!==void 0&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function gr(P){var z=P||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(q){return n.formatDate(q,z)}).filter(function(q,ee,ae){return n.config.mode!=="range"||n.config.enableTime||ae.indexOf(q)===ee}).join(n.config.mode!=="range"?n.config.conjunction:n.l10n.rangeSeparator)}function Wt(P){P===void 0&&(P=!0),n.mobileInput!==void 0&&n.mobileFormatStr&&(n.mobileInput.value=n.latestSelectedDateObj!==void 0?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=gr(n.config.dateFormat),n.altInput!==void 0&&(n.altInput.value=gr(n.config.altFormat)),P!==!1&&Ne("onValueUpdate")}function Gt(P){var z=Zt(P),q=n.prevMonthNav.contains(z),ee=n.nextMonthNav.contains(z);q||ee?D(q?-1:1):n.yearElements.indexOf(z)>=0?z.select():z.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):z.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}function bt(P){P.preventDefault();var z=P.type==="keydown",q=Zt(P),ee=q;n.amPM!==void 0&&q===n.amPM&&(n.amPM.textContent=n.l10n.amPM[cn(n.amPM.textContent===n.l10n.amPM[0])]);var ae=parseFloat(ee.getAttribute("min")),ue=parseFloat(ee.getAttribute("max")),Ce=parseFloat(ee.getAttribute("step")),fe=parseInt(ee.value,10),Se=P.delta||(z?P.which===38?1:-1:0),pe=fe+Ce*Se;if(typeof ee.value!="undefined"&&ee.value.length===2){var ie=ee===n.hourElement,Ae=ee===n.minuteElement;pe<ae?(pe=ue+pe+cn(!ie)+(cn(ie)&&cn(!n.amPM)),Ae&&I(void 0,-1,n.hourElement)):pe>ue&&(pe=ee===n.hourElement?pe-ue-cn(!n.amPM):ae,Ae&&I(void 0,1,n.hourElement)),n.amPM&&ie&&(Ce===1?pe+fe===23:Math.abs(pe-fe)>Ce)&&(n.amPM.textContent=n.l10n.amPM[cn(n.amPM.textContent===n.l10n.amPM[0])]),ee.value=Ht(pe)}}return i(),n}function pi(e,t){for(var n=Array.prototype.slice.call(e).filter(function(a){return a instanceof HTMLElement}),r=[],i=0;i<n.length;i++){var o=n[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=ZP(o,t||{}),r.push(o._flatpickr)}catch(a){console.error(a)}}return r.length===1?r[0]:r}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return pi(this,e)},HTMLElement.prototype.flatpickr=function(e){return pi([this],e)});var mt=function(e,t){return typeof e=="string"?pi(window.document.querySelectorAll(e),t):e instanceof Node?pi([e],t):pi(e,t)};mt.defaultConfig={},mt.l10ns={en:Rt({},bo),default:Rt({},bo)},mt.localize=function(e){mt.l10ns.default=Rt(Rt({},mt.l10ns.default),e)},mt.setDefaults=function(e){mt.defaultConfig=Rt(Rt({},mt.defaultConfig),e)},mt.parseDate=nu({}),mt.formatDate=xg({}),mt.compareDates=en,typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(e){return pi(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof e=="string"?parseInt(e,10):e))},typeof window!="undefined"&&(window.flatpickr=mt);const eD=Wu(Object.freeze(Object.defineProperty({__proto__:null,default:mt},Symbol.toStringTag,{value:"Module"})));(function(e){function t(D){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(U){return typeof U}:t=function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},t(D)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=l(y),r=o(JS),i=o(eD);function o(D){return D&&D.__esModule?D:{default:D}}function a(){if(typeof WeakMap!="function")return null;var D=new WeakMap;return a=function(){return D},D}function l(D){if(D&&D.__esModule)return D;if(D===null||t(D)!=="object"&&typeof D!="function")return{default:D};var L=a();if(L&&L.has(D))return L.get(D);var U={},G=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var oe in D)if(Object.prototype.hasOwnProperty.call(D,oe)){var ce=G?Object.getOwnPropertyDescriptor(D,oe):null;ce&&(ce.get||ce.set)?Object.defineProperty(U,oe,ce):U[oe]=D[oe]}return U.default=D,L&&L.set(D,U),U}function c(D){return p(D)||d(D)||f(D)||u()}function u(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2458
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(D,L){if(D){if(typeof D=="string")return g(D,L);var U=Object.prototype.toString.call(D).slice(8,-1);if(U==="Object"&&D.constructor&&(U=D.constructor.name),U==="Map"||U==="Set")return Array.from(D);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return g(D,L)}}function d(D){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(D))return Array.from(D)}function p(D){if(Array.isArray(D))return g(D)}function g(D,L){(L==null||L>D.length)&&(L=D.length);for(var U=0,G=new Array(L);U<L;U++)G[U]=D[U];return G}function v(){return v=Object.assign||function(D){for(var L=1;L<arguments.length;L++){var U=arguments[L];for(var G in U)Object.prototype.hasOwnProperty.call(U,G)&&(D[G]=U[G])}return D},v.apply(this,arguments)}function m(D,L){if(D==null)return{};var U=b(D,L),G,oe;if(Object.getOwnPropertySymbols){var ce=Object.getOwnPropertySymbols(D);for(oe=0;oe<ce.length;oe++)G=ce[oe],!(L.indexOf(G)>=0)&&Object.prototype.propertyIsEnumerable.call(D,G)&&(U[G]=D[G])}return U}function b(D,L){if(D==null)return{};var U={},G=Object.keys(D),oe,ce;for(ce=0;ce<G.length;ce++)oe=G[ce],!(L.indexOf(oe)>=0)&&(U[oe]=D[oe]);return U}function C(D,L){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(D);L&&(G=G.filter(function(oe){return Object.getOwnPropertyDescriptor(D,oe).enumerable})),U.push.apply(U,G)}return U}function w(D){for(var L=1;L<arguments.length;L++){var U=arguments[L]!=null?arguments[L]:{};L%2?C(Object(U),!0).forEach(function(G){N(D,G,U[G])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):C(Object(U)).forEach(function(G){Object.defineProperty(D,G,Object.getOwnPropertyDescriptor(U,G))})}return D}function x(D,L){if(!(D instanceof L))throw new TypeError("Cannot call a class as a function")}function I(D,L){for(var U=0;U<L.length;U++){var G=L[U];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(D,G.key,G)}}function S(D,L,U){return L&&I(D.prototype,L),D}function A(D,L){if(typeof L!="function"&&L!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(L&&L.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),L&&E(D,L)}function E(D,L){return E=Object.setPrototypeOf||function(G,oe){return G.__proto__=oe,G},E(D,L)}function k(D){var L=O();return function(){var G=T(D),oe;if(L){var ce=T(this).constructor;oe=Reflect.construct(G,arguments,ce)}else oe=G.apply(this,arguments);return F(this,oe)}}function F(D,L){return L&&(t(L)==="object"||typeof L=="function")?L:W(D)}function W(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function O(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(D){return!1}}function T(D){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(U){return U.__proto__||Object.getPrototypeOf(U)},T(D)}function N(D,L,U){return L in D?Object.defineProperty(D,L,{value:U,enumerable:!0,configurable:!0,writable:!0}):D[L]=U,D}var H=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],j=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),$=["onCreate","onDestroy"],M=r.default.func,V=function(D){A(U,D);var L=k(U);function U(){var G;x(this,U);for(var oe=arguments.length,ce=new Array(oe),se=0;se<oe;se++)ce[se]=arguments[se];return G=L.call.apply(L,[this].concat(ce)),N(W(G),"createFlatpickrInstance",function(){var Z=w({onClose:function(){G.node.blur&&G.node.blur()}},G.props.options);Z=Y(Z,G.props),G.flatpickr=(0,i.default)(G.node,Z),G.props.hasOwnProperty("value")&&G.flatpickr.setDate(G.props.value,!1);var te=G.props.onCreate;te&&te(G.flatpickr)}),N(W(G),"destroyFlatpickrInstance",function(){var Z=G.props.onDestroy;Z&&Z(G.flatpickr),G.flatpickr.destroy(),G.flatpickr=null}),N(W(G),"handleNodeChange",function(Z){G.node=Z,G.flatpickr&&(G.destroyFlatpickrInstance(),G.createFlatpickrInstance())}),G}return S(U,[{key:"componentDidUpdate",value:function(oe){var ce=this.props.options,se=oe.options;ce=Y(ce,this.props),se=Y(se,oe);for(var Z=Object.getOwnPropertyNames(ce),te=Z.length-1;te>=0;te--){var ne=Z[te],de=ce[ne];de!==se[ne]&&(H.indexOf(ne)!==-1&&!Array.isArray(de)&&(de=[de]),this.flatpickr.set(ne,de))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&oe.value&&Array.isArray(oe.value)&&this.props.value.every(function(ve,Fe){oe[Fe]}))&&this.props.value!==oe.value&&this.flatpickr.setDate(this.props.value,!1)}},{key:"componentDidMount",value:function(){this.createFlatpickrInstance()}},{key:"componentWillUnmount",value:function(){this.destroyFlatpickrInstance()}},{key:"render",value:function(){var oe=this.props,ce=oe.options,se=oe.defaultValue,Z=oe.value,te=oe.children,ne=oe.render,de=m(oe,["options","defaultValue","value","children","render"]);return H.forEach(function(ve){delete de[ve]}),$.forEach(function(ve){delete de[ve]}),ne?ne(w(w({},de),{},{defaultValue:se,value:Z}),this.handleNodeChange):ce.wrap?n.default.createElement("div",v({},de,{ref:this.handleNodeChange}),te):n.default.createElement("input",v({},de,{defaultValue:se,ref:this.handleNodeChange}))}}]),U}(n.Component);N(V,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:j,onOpen:j,onClose:j,onMonthChange:j,onYearChange:j,onReady:j,onValueUpdate:j,onDayCreate:j,onCreate:M,onDestroy:M,value:r.default.oneOfType([r.default.string,r.default.array,r.default.object,r.default.number]),children:r.default.node,className:r.default.string,render:r.default.func}),N(V,"defaultProps",{options:{}});function Y(D,L){var U=w({},D);return H.forEach(function(G){if(L.hasOwnProperty(G)){var oe;U[G]&&!Array.isArray(U[G])?U[G]=[U[G]]:U[G]||(U[G]=[]);var ce=Array.isArray(L[G])?L[G]:[L[G]];(oe=U[G]).push.apply(oe,c(ce))}}),U}var X=V;e.default=X})(vg);const wg=bn(vg);var Sg={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(zt,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",l="minute",c="hour",u="day",f="week",d="month",p="quarter",g="year",v="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var j=["th","st","nd","rd"],$=H%100;return"["+H+(j[($-20)%10]||j[$]||j[0])+"]"}},x=function(H,j,$){var M=String(H);return!M||M.length>=j?H:""+Array(j+1-M.length).join($)+H},I={s:x,z:function(H){var j=-H.utcOffset(),$=Math.abs(j),M=Math.floor($/60),V=$%60;return(j<=0?"+":"-")+x(M,2,"0")+":"+x(V,2,"0")},m:function H(j,$){if(j.date()<$.date())return-H($,j);var M=12*($.year()-j.year())+($.month()-j.month()),V=j.clone().add(M,d),Y=$-V<0,X=j.clone().add(M+(Y?-1:1),d);return+(-(M+($-V)/(Y?V-X:X-V))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:d,y:g,w:f,d:u,D:v,h:c,m:l,s:a,ms:o,Q:p}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},S="en",A={};A[S]=w;var E="$isDayjsObject",k=function(H){return H instanceof T||!(!H||!H[E])},F=function H(j,$,M){var V;if(!j)return S;if(typeof j=="string"){var Y=j.toLowerCase();A[Y]&&(V=Y),$&&(A[Y]=$,V=Y);var X=j.split("-");if(!V&&X.length>1)return H(X[0])}else{var D=j.name;A[D]=j,V=D}return!M&&V&&(S=V),V||!M&&S},W=function(H,j){if(k(H))return H.clone();var $=typeof j=="object"?j:{};return $.date=H,$.args=arguments,new T($)},O=I;O.l=F,O.i=k,O.w=function(H,j){return W(H,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var T=function(){function H($){this.$L=F($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[E]=!0}var j=H.prototype;return j.parse=function($){this.$d=function(M){var V=M.date,Y=M.utc;if(V===null)return new Date(NaN);if(O.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var X=V.match(b);if(X){var D=X[2]-1||0,L=(X[7]||"0").substring(0,3);return Y?new Date(Date.UTC(X[1],D,X[3]||1,X[4]||0,X[5]||0,X[6]||0,L)):new Date(X[1],D,X[3]||1,X[4]||0,X[5]||0,X[6]||0,L)}}return new Date(V)}($),this.init()},j.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},j.$utils=function(){return O},j.isValid=function(){return this.$d.toString()!==m},j.isSame=function($,M){var V=W($);return this.startOf(M)<=V&&V<=this.endOf(M)},j.isAfter=function($,M){return W($)<this.startOf(M)},j.isBefore=function($,M){return this.endOf(M)<W($)},j.$g=function($,M,V){return O.u($)?this[M]:this.set(V,$)},j.unix=function(){return Math.floor(this.valueOf()/1e3)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function($,M){var V=this,Y=!!O.u(M)||M,X=O.p($),D=function(te,ne){var de=O.w(V.$u?Date.UTC(V.$y,ne,te):new Date(V.$y,ne,te),V);return Y?de:de.endOf(u)},L=function(te,ne){return O.w(V.toDate()[te].apply(V.toDate("s"),(Y?[0,0,0,0]:[23,59,59,999]).slice(ne)),V)},U=this.$W,G=this.$M,oe=this.$D,ce="set"+(this.$u?"UTC":"");switch(X){case g:return Y?D(1,0):D(31,11);case d:return Y?D(1,G):D(0,G+1);case f:var se=this.$locale().weekStart||0,Z=(U<se?U+7:U)-se;return D(Y?oe-Z:oe+(6-Z),G);case u:case v:return L(ce+"Hours",0);case c:return L(ce+"Minutes",1);case l:return L(ce+"Seconds",2);case a:return L(ce+"Milliseconds",3);default:return this.clone()}},j.endOf=function($){return this.startOf($,!1)},j.$set=function($,M){var V,Y=O.p($),X="set"+(this.$u?"UTC":""),D=(V={},V[u]=X+"Date",V[v]=X+"Date",V[d]=X+"Month",V[g]=X+"FullYear",V[c]=X+"Hours",V[l]=X+"Minutes",V[a]=X+"Seconds",V[o]=X+"Milliseconds",V)[Y],L=Y===u?this.$D+(M-this.$W):M;if(Y===d||Y===g){var U=this.clone().set(v,1);U.$d[D](L),U.init(),this.$d=U.set(v,Math.min(this.$D,U.daysInMonth())).$d}else D&&this.$d[D](L);return this.init(),this},j.set=function($,M){return this.clone().$set($,M)},j.get=function($){return this[O.p($)]()},j.add=function($,M){var V,Y=this;$=Number($);var X=O.p(M),D=function(G){var oe=W(Y);return O.w(oe.date(oe.date()+Math.round(G*$)),Y)};if(X===d)return this.set(d,this.$M+$);if(X===g)return this.set(g,this.$y+$);if(X===u)return D(1);if(X===f)return D(7);var L=(V={},V[l]=r,V[c]=i,V[a]=n,V)[X]||1,U=this.$d.getTime()+$*L;return O.w(U,this)},j.subtract=function($,M){return this.add(-1*$,M)},j.format=function($){var M=this,V=this.$locale();if(!this.isValid())return V.invalidDate||m;var Y=$||"YYYY-MM-DDTHH:mm:ssZ",X=O.z(this),D=this.$H,L=this.$m,U=this.$M,G=V.weekdays,oe=V.months,ce=V.meridiem,se=function(ne,de,ve,Fe){return ne&&(ne[de]||ne(M,Y))||ve[de].slice(0,Fe)},Z=function(ne){return O.s(D%12||12,ne,"0")},te=ce||function(ne,de,ve){var Fe=ne<12?"AM":"PM";return ve?Fe.toLowerCase():Fe};return Y.replace(C,function(ne,de){return de||function(ve){switch(ve){case"YY":return String(M.$y).slice(-2);case"YYYY":return O.s(M.$y,4,"0");case"M":return U+1;case"MM":return O.s(U+1,2,"0");case"MMM":return se(V.monthsShort,U,oe,3);case"MMMM":return se(oe,U);case"D":return M.$D;case"DD":return O.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return se(V.weekdaysMin,M.$W,G,2);case"ddd":return se(V.weekdaysShort,M.$W,G,3);case"dddd":return G[M.$W];case"H":return String(D);case"HH":return O.s(D,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return te(D,L,!0);case"A":return te(D,L,!1);case"m":return String(L);case"mm":return O.s(L,2,"0");case"s":return String(M.$s);case"ss":return O.s(M.$s,2,"0");case"SSS":return O.s(M.$ms,3,"0");case"Z":return X}return null}(ne)||X.replace(":","")})},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function($,M,V){var Y,X=this,D=O.p(M),L=W($),U=(L.utcOffset()-this.utcOffset())*r,G=this-L,oe=function(){return O.m(X,L)};switch(D){case g:Y=oe()/12;break;case d:Y=oe();break;case p:Y=oe()/3;break;case f:Y=(G-U)/6048e5;break;case u:Y=(G-U)/864e5;break;case c:Y=G/i;break;case l:Y=G/r;break;case a:Y=G/n;break;default:Y=G}return V?Y:O.a(Y)},j.daysInMonth=function(){return this.endOf(d).$D},j.$locale=function(){return A[this.$L]},j.locale=function($,M){if(!$)return this.$L;var V=this.clone(),Y=F($,M,!0);return Y&&(V.$L=Y),V},j.clone=function(){return O.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},H}(),N=T.prototype;return W.prototype=N,[["$ms",o],["$s",a],["$m",l],["$H",c],["$W",u],["$M",d],["$y",g],["$D",v]].forEach(function(H){N[H[1]]=function(j){return this.$g(j,H[0],H[1])}}),W.extend=function(H,j){return H.$i||(H(j,T,W),H.$i=!0),W},W.locale=F,W.isDayjs=k,W.unix=function(H){return W(1e3*H)},W.en=A[S],W.Ls=A,W.p={},W})})(Sg);var tD=Sg.exports;const ft=bn(tD);var Ig={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(zt,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(i,o,a){var l,c=function(p,g,v){v===void 0&&(v={});var m=new Date(p),b=function(C,w){w===void 0&&(w={});var x=w.timeZoneName||"short",I=C+"|"+x,S=r[I];return S||(S=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:C,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),r[I]=S),S}(g,v);return b.formatToParts(m)},u=function(p,g){for(var v=c(p,g),m=[],b=0;b<v.length;b+=1){var C=v[b],w=C.type,x=C.value,I=n[w];I>=0&&(m[I]=parseInt(x,10))}var S=m[3],A=S===24?0:S,E=m[0]+"-"+m[1]+"-"+m[2]+" "+A+":"+m[4]+":"+m[5]+":000",k=+p;return(a.utc(E).valueOf()-(k-=k%1e3))/6e4},f=o.prototype;f.tz=function(p,g){p===void 0&&(p=l);var v,m=this.utcOffset(),b=this.toDate(),C=b.toLocaleString("en-US",{timeZone:p}),w=Math.round((b-new Date(C))/1e3/60),x=15*-Math.round(b.getTimezoneOffset()/15)-w;if(!Number(x))v=this.utcOffset(0,g);else if(v=a(C,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),g){var I=v.utcOffset();v=v.add(m-I,"minute")}return v.$x.$timezone=p,v},f.offsetName=function(p){var g=this.$x.$timezone||a.tz.guess(),v=c(this.valueOf(),g,{timeZoneName:p}).find(function(m){return m.type.toLowerCase()==="timezonename"});return v&&v.value};var d=f.startOf;f.startOf=function(p,g){if(!this.$x||!this.$x.$timezone)return d.call(this,p,g);var v=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return d.call(v,p,g).tz(this.$x.$timezone,!0)},a.tz=function(p,g,v){var m=v&&g,b=v||g||l,C=u(+a(),b);if(typeof p!="string")return a(p).tz(b);var w=function(A,E,k){var F=A-60*E*1e3,W=u(F,k);if(E===W)return[F,E];var O=u(F-=60*(W-E)*1e3,k);return W===O?[F,W]:[A-60*Math.min(W,O)*1e3,Math.max(W,O)]}(a.utc(p,m).valueOf(),C,b),x=w[0],I=w[1],S=a(x).utcOffset(I);return S.$x.$timezone=b,S},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(p){l=p}}})})(Ig);var nD=Ig.exports;const rD=bn(nD);var Ag={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(zt,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(o,a,l){var c=a.prototype;l.utc=function(m){var b={date:m,utc:!0,args:arguments};return new a(b)},c.utc=function(m){var b=l(this.toDate(),{locale:this.$L,utc:!0});return m?b.add(this.utcOffset(),n):b},c.local=function(){return l(this.toDate(),{locale:this.$L,utc:!1})};var u=c.parse;c.parse=function(m){m.utc&&(this.$u=!0),this.$utils().u(m.$offset)||(this.$offset=m.$offset),u.call(this,m)};var f=c.init;c.init=function(){if(this.$u){var m=this.$d;this.$y=m.getUTCFullYear(),this.$M=m.getUTCMonth(),this.$D=m.getUTCDate(),this.$W=m.getUTCDay(),this.$H=m.getUTCHours(),this.$m=m.getUTCMinutes(),this.$s=m.getUTCSeconds(),this.$ms=m.getUTCMilliseconds()}else f.call(this)};var d=c.utcOffset;c.utcOffset=function(m,b){var C=this.$utils().u;if(C(m))return this.$u?0:C(this.$offset)?d.call(this):this.$offset;if(typeof m=="string"&&(m=function(S){S===void 0&&(S="");var A=S.match(r);if(!A)return null;var E=(""+A[0]).match(i)||["-",0,0],k=E[0],F=60*+E[1]+ +E[2];return F===0?0:k==="+"?F:-F}(m),m===null))return this;var w=Math.abs(m)<=16?60*m:m,x=this;if(b)return x.$offset=w,x.$u=m===0,x;if(m!==0){var I=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(w+I,n)).$offset=w,x.$x.$localOffset=I}else x=this.utc();return x};var p=c.format;c.format=function(m){var b=m||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return p.call(this,b)},c.valueOf=function(){var m=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*m},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var g=c.toDate;c.toDate=function(m){return m==="s"&&this.$offset?l(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():g.call(this)};var v=c.diff;c.diff=function(m,b,C){if(m&&this.$u===m.$u)return v.call(this,m,b,C);var w=this.local(),x=l(m).local();return v.call(w,x,b,C)}}})})(Ag);var iD=Ag.exports;const oD=bn(iD);ft.extend(rD),ft.extend(oD);const aD=e=>{if(!ft(e).isAfter(ft(Date.now()).subtract(15,"minute")))return ft(Date.now()).add(15,"minute").toDate()},ou=({defaultDate:e,minDate:t,maxDate:n,dateFormat:r="DD.MM.YYYY HH:mm",onChange:i})=>{const o=a=>{if(a&&a.length){const l=ft.utc(a[0]).toISOString();i(l)}else i("")};return s.jsx(h.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",paddingLeft:"0.5rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,minHeight:"37px",color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:s.jsx(wg,{value:e&&ft(e).format("YYYY-MM-DD HH:mm")||void 0,onChange:o,className:"flatpickr-input",options:{enableTime:!0,dateFormat:r,position:"below",minDate:t||aD(e),maxDate:n,parseDate:(a,l)=>ft(a,l).toDate(),formatDate:(a,l)=>ft(a).format(l),time_24hr:!0,minuteIncrement:1}})})},sD=({required:e,defaultValue:t,onChangeFromDate:n,onChangeToDate:r})=>{const[i,o]=t;return s.jsxs(h.Box,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormControl,{children:s.jsx(h.FormLabel,{required:e,color:"primary",children:"Duration"})}),s.jsxs(h.Grid,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"flex-start",children:[s.jsx(vo,{label:"From date",defaultValue:i,required:e,onChange:n}),s.jsx(vo,{label:"To date",defaultValue:o,required:e,onChange:r})]})]})},Tg=e=>{if(!e)return[];const{from:t,to:n}=e,r=[];return t&&r.push(ft(t).toDate()),n&&r.push(ft(n).toDate()),r},lD=({label:e,defaultValue:t,required:n,onChange:r})=>{const[i,o]=y.useState(Tg(t)),[a,l]=y.useState(!1),c=()=>l(!a),u=f=>{if(f&&f.length>0){const d="YYYY-MM-DD",p=ft(f[0]).format(d),g=ft(f[1]).format(d);r({from:p,to:g})}else f&&f.length===0&&(r({from:"",to:""}),c());o(f)};return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:n,color:"primary",children:e}),s.jsx(h.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",padding:"0.5rem 0.75rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:s.jsx(wg,{value:i,onChange:u,placeholder:"Select Date...",className:"flatpickr-input",options:{mode:"range",enableTime:!1,dateFormat:"DD.MM.YYYY",altFormat:"DD.MM.YYYY",position:"below",parseDate:(f,d)=>ft(f,d).toDate(),formatDate:(f,d)=>ft(f).format(d),defaultDate:Tg(t)||void 0}})}),s.jsx(Ge,{showToast:a,message:"Succesfully cleared the duration time",color:"primary",hideToast:c})]})},cD=({environment:e,labels:t,setNoPermission:n})=>{const{featureDisabled:r,noPermissionMessage:i,tryAgainButton:o}=t,a=()=>{no(e).signOut().then(()=>n(null)).catch(l=>{console.error("There was a problem logging out the user:",l)})};return s.jsx(h.Box,{"data-testid":"no permission card",sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",bgcolor:"background.body"},children:s.jsx(h.Card,{variant:"outlined",sx:{maxWidth:300,overflow:"hidden",borderRadius:"md"},children:s.jsxs(h.CardContent,{children:[s.jsx(h.Typography,{level:"h2",textAlign:"center",mb:2,children:r}),s.jsx(h.Typography,{level:"body-md",color:"neutral",mb:2,children:i}),s.jsx(h.Box,{display:"flex",justifyContent:"center",children:s.jsx(h.Button,{variant:"solid",color:"neutral",fullWidth:!0,size:"sm",onClick:a,children:o})})]})})})},Eg=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],au=e=>e.reduce((t,n)=>(t[n.key]=n.value,t),{}),uD=({labels:e,type:t,defaultValue:n,onChange:r})=>{const[i,o]=y.useState(Eg(n)),[a,l]=y.useState(null),[c,u]=y.useState(""),[f,d]=y.useState(""),[p,g]=y.useState(""),[v,m]=y.useState("");y.useEffect(()=>o(Eg(n)),[n]);const b=()=>{const I=[...i];I.push({key:c,value:p}),o(I),u(""),g(""),r(au(I))},C=I=>{const S=i.filter((A,E)=>E!==I);o(S),r(au(S))},w=(I,S)=>{d(S.key),m(S.value),l(I)},x=I=>{const S=[...i];S[I]={key:f,value:v},o(S),l(null),d(""),m(""),r(au(S))};return s.jsxs(h.Box,{children:[i.map((I,S)=>s.jsx(h.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:s.jsx(h.CardContent,{style:{flex:1},children:a===S?s.jsxs(h.Box,{display:"flex",alignItems:"center",children:[s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:f,onChange:A=>d(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:v,onChange:A=>m(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Tooltip,{title:e.save,children:f&&v?s.jsx(h.IconButton,{onClick:()=>x(S),children:s.jsx(_e.Check,{})}):s.jsx("span",{children:s.jsx(h.IconButton,{disabled:!0,children:s.jsx(_e.Check,{})})})})]}):s.jsxs(h.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{style:{fontWeight:"bold"},children:[e.keyDynamicFields,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:I.key})]}),s.jsxs(h.Typography,{style:{color:"gray"},children:[e.valueDynamicFields,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:I.value})]})]}),s.jsxs(h.Box,{children:[s.jsx(h.Tooltip,{title:e.edit,children:s.jsx(h.IconButton,{onClick:()=>w(S,I),children:s.jsx(_e.Edit,{})})}),s.jsx(h.Tooltip,{title:e.delete,children:s.jsx(h.IconButton,{onClick:()=>C(S),children:s.jsx(_e.Delete,{})})})]})]})})},`dynamic-fields-${t}-${S}`)),s.jsxs(h.Box,{display:"flex",alignItems:"center",style:{marginTop:i&&i.length?"20px":"0px"},children:[s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",value:c,placeholder:e.keyDynamicFields,onChange:I=>u(I.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Input,{size:"md",variant:"outlined",color:"neutral",value:p,onChange:I=>g(I.target.value),placeholder:e.valueDynamicFields,sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),s.jsx(h.Tooltip,{title:e.add,children:c&&p?s.jsx(h.Button,{onClick:b,children:s.jsx(_e.Add,{})}):s.jsx("span",{children:s.jsx(h.Button,{disabled:!0,children:s.jsx(_e.Add,{})})})})]})]})};function xo(e,t,n){return(t=fc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kg(Object(n),!0).forEach(function(r){xo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dD(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fc(r.key),r)}}function fD(e,t,n){return t&&_g(e.prototype,t),n&&_g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function su(e,t){return su=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},su(e,t)}function hD(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&su(e,t)}function gs(e){return gs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},gs(e)}function Pg(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Pg=function(){return!!e})()}function pD(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gD(e,t){if(t&&(Er(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pD(e)}function mD(e){var t=Pg();return function(){var n,r=gs(e);if(t){var i=gs(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return gD(this,n)}}function lu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vD(e){if(Array.isArray(e))return lu(e)}function bD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Dg(e,t){if(e){if(typeof e=="string")return lu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lu(e,t):void 0}}function yD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2459
2459
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gi(e){return vD(e)||bD(e)||Dg(e)||yD()}function xD(e){if(Array.isArray(e))return e}function CD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,l=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function wD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2460
2460
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yn(e,t){return xD(e)||CD(e,t)||Dg(e,t)||wD()}function Tn(e,t){if(e==null)return{};var n,r,i=De(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function SD(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var cu=y.useLayoutEffect,ID=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],ms=function(){};function AD(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function TD(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(AD(e,a)));return o.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var vs=function(t){return LD(t)?t.filter(Boolean):Er(t)==="object"&&t!==null?[t]:[]},Og=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=Tn(t,ID);return be({},n)},at=function(t,n,r){var i=t.cx,o=t.getStyles,a=t.getClassNames,l=t.className;return{css:o(n,t),className:i(r!=null?r:{},a(n,t),l)}};function bs(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function ED(e){return bs(e)?window.innerHeight:e.clientHeight}function Rg(e){return bs(e)?window.pageYOffset:e.scrollTop}function ys(e,t){if(bs(e)){window.scrollTo(0,t);return}e.scrollTop=t}function kD(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function _D(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function xs(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:ms,i=Rg(e),o=t-i,a=10,l=0;function c(){l+=a;var u=_D(l,i,o,n);ys(e,u),l<n?window.requestAnimationFrame(c):r(e)}c()}function Mg(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?ys(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&ys(e,Math.max(t.offsetTop-i,0))}function PD(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Lg(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}function DD(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}var Bg=!1,OD={get passive(){return Bg=!0}},Cs=typeof window!="undefined"?window:{};Cs.addEventListener&&Cs.removeEventListener&&(Cs.addEventListener("p",ms,OD),Cs.removeEventListener("p",ms,!1));var RD=Bg;function MD(e){return e!=null}function LD(e){return Array.isArray(e)}function Co(e,t,n){return e?t:n}function _z(e){return e}function Pz(e){return e}var BD=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(a){var l=Yn(a,1),c=l[0];return!r.includes(c)});return o.reduce(function(a,l){var c=Yn(l,2),u=c[0],f=c[1];return a[u]=f,a},{})},$D=["children","innerProps"],FD=["children","innerProps"];function ND(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,a=e.isFixedPosition,l=e.controlHeight,c=kD(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var f=c.getBoundingClientRect(),d=f.height,p=n.getBoundingClientRect(),g=p.bottom,v=p.height,m=p.top,b=n.offsetParent.getBoundingClientRect(),C=b.top,w=a?window.innerHeight:ED(c),x=Rg(c),I=parseInt(getComputedStyle(n).marginBottom,10),S=parseInt(getComputedStyle(n).marginTop,10),A=C-S,E=w-m,k=A+x,F=d-x-m,W=g-w+x+I,O=x+m-S,T=160;switch(i){case"auto":case"bottom":if(E>=v)return{placement:"bottom",maxHeight:t};if(F>=v&&!a)return o&&xs(c,W,T),{placement:"bottom",maxHeight:t};if(!a&&F>=r||a&&E>=r){o&&xs(c,W,T);var N=a?E-I:F-I;return{placement:"bottom",maxHeight:N}}if(i==="auto"||a){var H=t,j=a?A:k;return j>=r&&(H=Math.min(j-I-l,t)),{placement:"top",maxHeight:H}}if(i==="bottom")return o&&ys(c,W),{placement:"bottom",maxHeight:t};break;case"top":if(A>=v)return{placement:"top",maxHeight:t};if(k>=v&&!a)return o&&xs(c,O,T),{placement:"top",maxHeight:t};if(!a&&k>=r||a&&A>=r){var $=t;return(!a&&k>=r||a&&A>=r)&&($=a?A-S:k-S),o&&xs(c,O,T),{placement:"top",maxHeight:$}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return u}function zD(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var $g=function(t){return t==="auto"?"bottom":t},jD=function(t,n){var r,i=t.placement,o=t.theme,a=o.borderRadius,l=o.spacing,c=o.colors;return be((r={label:"menu"},xo(r,zD(i),"100%"),xo(r,"position","absolute"),xo(r,"width","100%"),xo(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:a,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})},Fg=y.createContext(null),UD=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,l=t.menuShouldScrollIntoView,c=t.theme,u=y.useContext(Fg)||{},f=u.setPortalPlacement,d=y.useRef(null),p=y.useState(i),g=Yn(p,2),v=g[0],m=g[1],b=y.useState(null),C=Yn(b,2),w=C[0],x=C[1],I=c.spacing.controlHeight;return cu(function(){var S=d.current;if(S){var A=a==="fixed",E=l&&!A,k=ND({maxHeight:i,menuEl:S,minHeight:r,placement:o,shouldScroll:E,isFixedPosition:A,controlHeight:I});m(k.maxHeight),x(k.placement),f==null||f(k.placement)}},[i,o,a,l,r,f,I]),n({ref:d,placerProps:be(be({},t),{},{placement:w||$g(o),maxHeight:v})})},VD=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return me.jsx("div",R({},at(t,"menu",{menu:!0}),{ref:r},i),n)},HD=VD,WD=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return be({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},GD=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return me.jsx("div",R({},at(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},Ng=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return be({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},YD=Ng,KD=Ng,qD=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=Tn(t,$D);return me.jsx("div",R({},at(be(be({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},QD=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=Tn(t,FD);return me.jsx("div",R({},at(be(be({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},JD=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},XD=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,a=t.menuPlacement,l=t.menuPosition,c=y.useRef(null),u=y.useRef(null),f=y.useState($g(a)),d=Yn(f,2),p=d[0],g=d[1],v=y.useMemo(function(){return{setPortalPlacement:g}},[]),m=y.useState(null),b=Yn(m,2),C=b[0],w=b[1],x=y.useCallback(function(){if(i){var E=PD(i),k=l==="fixed"?0:window.pageYOffset,F=E[p]+k;(F!==(C==null?void 0:C.offset)||E.left!==(C==null?void 0:C.rect.left)||E.width!==(C==null?void 0:C.rect.width))&&w({offset:F,rect:E})}},[i,l,p,C==null?void 0:C.offset,C==null?void 0:C.rect.left,C==null?void 0:C.rect.width]);cu(function(){x()},[x]);var I=y.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),i&&c.current&&(u.current=rA(i,c.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);cu(function(){I()},[I]);var S=y.useCallback(function(E){c.current=E,I()},[I]);if(!n&&l!=="fixed"||!C)return null;var A=me.jsx("div",R({ref:S},at(be(be({},t),{},{offset:C.offset,position:l,rect:C.rect}),"menuPortal",{"menu-portal":!0}),o),r);return me.jsx(Fg.Provider,{value:v},n?yt.createPortal(A,n):A)},ZD=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},eO=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return me.jsx("div",R({},at(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},tO=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return be({alignItems:"center",display:i&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},nO=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return me.jsx("div",R({},at(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},rO=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},iO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},at(t,"indicatorsContainer",{indicators:!0}),r),n)},zg,oO=["size"],aO=["innerProps","isRtl","size"],sO={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},jg=function(t){var n=t.size,r=Tn(t,oO);return me.jsx("svg",R({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:sO},r))},uu=function(t){return me.jsx(jg,R({size:20},t),me.jsx("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"}))},Ug=function(t){return me.jsx(jg,R({size:20},t),me.jsx("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"}))},Vg=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,a=i.colors;return be({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?a.neutral60:a.neutral20,padding:o*2,":hover":{color:r?a.neutral80:a.neutral40}})},lO=Vg,cO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},at(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||me.jsx(Ug,null))},uO=Vg,dO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},at(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||me.jsx(uu,null))},fO=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,a=i.colors;return be({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},hO=function(t){var n=t.innerProps;return me.jsx("span",R({},n,at(t,"indicatorSeparator",{"indicator-separator":!0})))},pO=me.keyframes(zg||(zg=SD([`
2461
2461
  0%, 80%, 100% { opacity: 0; }
2462
2462
  40% { opacity: 1; }
2463
- `]))),gO=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,a=o.colors,l=o.spacing.baseUnit;return be({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:l*2})},du=function(t){var n=t.delay,r=t.offset;return me.jsx("span",{css:me.css({animation:"".concat(pO," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},mO=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,a=Tn(t,aO);return me.jsx("div",R({},at(be(be({},a),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),me.jsx(du,{delay:0,offset:r}),me.jsx(du,{delay:160,offset:!0}),me.jsx(du,{delay:320,offset:!r}))},vO=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,a=o.colors,l=o.borderRadius,c=o.spacing;return be({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},bO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,a=t.innerProps,l=t.menuIsOpen;return me.jsx("div",R({ref:o},at(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),a,{"aria-disabled":r||void 0}),n)},yO=bO,xO=["data"],CO=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},wO=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,a=t.Heading,l=t.headingProps,c=t.innerProps,u=t.label,f=t.theme,d=t.selectProps;return me.jsx("div",R({},at(t,"group",{group:!0}),c),me.jsx(a,R({},l,{selectProps:d,theme:f,getStyles:i,getClassNames:o,cx:r}),u),me.jsx("div",null,n))},SO=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return be({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},IO=function(t){var n=Og(t);n.data;var r=Tn(n,xO);return me.jsx("div",R({},at(t,"groupHeading",{"group-heading":!0}),r))},AO=wO,TO=["innerRef","isDisabled","isHidden","inputClassName"],EO=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,a=o.spacing,l=o.colors;return be(be({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},kO),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:l.neutral80})},Hg={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},kO={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":be({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Hg)},_O=function(t){return be({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Hg)},PO=function(t){var n=t.cx,r=t.value,i=Og(t),o=i.innerRef,a=i.isDisabled,l=i.isHidden,c=i.inputClassName,u=Tn(i,TO);return me.jsx("div",R({},at(t,"input",{"input-container":!0}),{"data-value":r||""}),me.jsx("input",R({className:n({input:!0},c),ref:o,style:_O(l),disabled:a},u)))},DO=PO,OO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return be({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},RO=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,a=t.cropWithEllipsis;return be({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},MO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors,l=t.isFocused;return be({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:l?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Wg=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",r,n)},LO=Wg,BO=Wg;function $O(e){var t=e.children,n=e.innerProps;return me.jsx("div",R({role:"button"},n),t||me.jsx(uu,{size:14}))}var FO=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,a=t.isDisabled,l=t.removeProps,c=t.selectProps,u=r.Container,f=r.Label,d=r.Remove;return me.jsx(u,{data:i,innerProps:be(be({},at(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:c},me.jsx(f,{data:i,innerProps:be({},at(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),me.jsx(d,{data:i,innerProps:be(be({},at(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:c}))},NO=FO,zO=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.theme,l=a.spacing,c=a.colors;return be({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?c.primary:i?c.primary25:"transparent",color:r?c.neutral20:o?c.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?c.primary:c.primary50}})},jO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.innerRef,l=t.innerProps;return me.jsx("div",R({},at(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},l),n)},UO=jO,VO=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return be({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},HO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},at(t,"placeholder",{placeholder:!0}),r),n)},WO=HO,GO=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,a=i.colors;return be({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},YO=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return me.jsx("div",R({},at(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},KO=YO,qO={ClearIndicator:dO,Control:yO,DropdownIndicator:cO,DownChevron:Ug,CrossIcon:uu,Group:AO,GroupHeading:IO,IndicatorsContainer:iO,IndicatorSeparator:hO,Input:DO,LoadingIndicator:mO,Menu:HD,MenuList:GD,MenuPortal:XD,LoadingMessage:QD,NoOptionsMessage:qD,MultiValue:NO,MultiValueContainer:LO,MultiValueLabel:BO,MultiValueRemove:$O,Option:UO,Placeholder:WO,SelectContainer:eO,SingleValue:KO,ValueContainer:nO},QO=function(t){return be(be({},qO),t.components)},Gg=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function JO(e,t){return!!(e===t||Gg(e)&&Gg(t))}function XO(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!JO(e[n],t[n]))return!1;return!0}function ZO(e,t){t===void 0&&(t=XO);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}for(var eR={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"},tR=function(t){return me.jsx("span",R({css:eR},t))},Yg=tR,nR={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){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(i?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" 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(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,a=o===void 0?"":o,l=t.selectValue,c=t.isDisabled,u=t.isSelected,f=t.isAppleDevice,d=function(m,b){return m&&m.length?"".concat(m.indexOf(b)+1," of ").concat(m.length):""};if(n==="value"&&l)return"value ".concat(a," focused, ").concat(d(l,r),".");if(n==="menu"&&f){var p=c?" disabled":"",g="".concat(u?" selected":"").concat(p);return"".concat(a).concat(g,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},rR=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,a=t.isFocused,l=t.selectValue,c=t.selectProps,u=t.id,f=t.isAppleDevice,d=c.ariaLiveMessages,p=c.getOptionLabel,g=c.inputValue,v=c.isMulti,m=c.isOptionDisabled,b=c.isSearchable,C=c.menuIsOpen,w=c.options,x=c.screenReaderStatus,I=c.tabSelectsValue,S=c.isLoading,A=c["aria-label"],E=c["aria-live"],k=y.useMemo(function(){return be(be({},nR),d||{})},[d]),F=y.useMemo(function(){var j="";if(n&&k.onChange){var $=n.option,M=n.options,V=n.removedValue,Y=n.removedValues,X=n.value,D=function(Z){return Array.isArray(Z)?null:Z},L=V||$||D(X),U=L?p(L):"",G=M||Y||void 0,oe=G?G.map(p):[],ce=be({isDisabled:L&&m(L,l),label:U,labels:oe},n);j=k.onChange(ce)}return j},[n,k,m,l,p]),W=y.useMemo(function(){var j="",$=r||i,M=!!(r&&l&&l.includes(r));if($&&k.onFocus){var V={focused:$,label:p($),isDisabled:m($,l),isSelected:M,options:o,context:$===r?"menu":"value",selectValue:l,isAppleDevice:f};j=k.onFocus(V)}return j},[r,i,p,m,k,o,l,f]),O=y.useMemo(function(){var j="";if(C&&w.length&&!S&&k.onFilter){var $=x({count:o.length});j=k.onFilter({inputValue:g,resultsMessage:$})}return j},[o,g,C,k,w,x,S]),T=(n==null?void 0:n.action)==="initial-input-focus",N=y.useMemo(function(){var j="";if(k.guidance){var $=i?"value":C?"menu":"input";j=k.guidance({"aria-label":A,context:$,isDisabled:r&&m(r,l),isMulti:v,isSearchable:b,tabSelectsValue:I,isInitialFocus:T})}return j},[A,r,i,v,m,b,C,k,l,I,T]),H=me.jsx(y.Fragment,null,me.jsx("span",{id:"aria-selection"},F),me.jsx("span",{id:"aria-focused"},W),me.jsx("span",{id:"aria-results"},O),me.jsx("span",{id:"aria-guidance"},N));return me.jsx(y.Fragment,null,me.jsx(Yg,{id:u},T&&H),me.jsx(Yg,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!T&&H))},iR=rR,fu=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],oR=new RegExp("["+fu.map(function(e){return e.letters}).join("")+"]","g"),Kg={},hu=0;hu<fu.length;hu++)for(var pu=fu[hu],gu=0;gu<pu.letters.length;gu++)Kg[pu.letters[gu]]=pu.base;var qg=function(t){return t.replace(oR,function(n){return Kg[n]})},aR=ZO(qg),Qg=function(t){return t.replace(/^\s+|\s+$/g,"")},sR=function(t){return"".concat(t.label," ").concat(t.value)},lR=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=be({ignoreCase:!0,ignoreAccents:!0,stringify:sR,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,a=i.ignoreAccents,l=i.stringify,c=i.trim,u=i.matchFrom,f=c?Qg(r):r,d=c?Qg(l(n)):l(n);return o&&(f=f.toLowerCase(),d=d.toLowerCase()),a&&(f=aR(f),d=qg(d)),u==="start"?d.substr(0,f.length)===f:d.indexOf(f)>-1}},cR=["innerRef"];function uR(e){var t=e.innerRef,n=Tn(e,cR),r=BD(n,"onExited","in","enter","exit","appear");return me.jsx("input",R({ref:t},r,{css:me.css({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 dR=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function fR(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,a=y.useRef(!1),l=y.useRef(!1),c=y.useRef(0),u=y.useRef(null),f=y.useCallback(function(b,C){if(u.current!==null){var w=u.current,x=w.scrollTop,I=w.scrollHeight,S=w.clientHeight,A=u.current,E=C>0,k=I-S-x,F=!1;k>C&&a.current&&(r&&r(b),a.current=!1),E&&l.current&&(o&&o(b),l.current=!1),E&&C>k?(n&&!a.current&&n(b),A.scrollTop=I,F=!0,a.current=!0):!E&&-C>x&&(i&&!l.current&&i(b),A.scrollTop=0,F=!0,l.current=!0),F&&dR(b)}},[n,r,i,o]),d=y.useCallback(function(b){f(b,b.deltaY)},[f]),p=y.useCallback(function(b){c.current=b.changedTouches[0].clientY},[]),g=y.useCallback(function(b){var C=c.current-b.changedTouches[0].clientY;f(b,C)},[f]),v=y.useCallback(function(b){if(b){var C=RD?{passive:!1}:!1;b.addEventListener("wheel",d,C),b.addEventListener("touchstart",p,C),b.addEventListener("touchmove",g,C)}},[g,p,d]),m=y.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",p,!1),b.removeEventListener("touchmove",g,!1))},[g,p,d]);return y.useEffect(function(){if(t){var b=u.current;return v(b),function(){m(b)}}},[t,v,m]),function(b){u.current=b}}var Jg=["boxSizing","height","overflow","paddingRight","position"],Xg={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Zg(e){e.preventDefault()}function em(e){e.stopPropagation()}function tm(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function nm(){return"ontouchstart"in window||navigator.maxTouchPoints}var rm=!!(typeof window!="undefined"&&window.document&&window.document.createElement),wo=0,mi={capture:!1,passive:!1};function hR(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=y.useRef({}),o=y.useRef(null),a=y.useCallback(function(c){if(rm){var u=document.body,f=u&&u.style;if(r&&Jg.forEach(function(v){var m=f&&f[v];i.current[v]=m}),r&&wo<1){var d=parseInt(i.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,g=window.innerWidth-p+d||0;Object.keys(Xg).forEach(function(v){var m=Xg[v];f&&(f[v]=m)}),f&&(f.paddingRight="".concat(g,"px"))}u&&nm()&&(u.addEventListener("touchmove",Zg,mi),c&&(c.addEventListener("touchstart",tm,mi),c.addEventListener("touchmove",em,mi))),wo+=1}},[r]),l=y.useCallback(function(c){if(rm){var u=document.body,f=u&&u.style;wo=Math.max(wo-1,0),r&&wo<1&&Jg.forEach(function(d){var p=i.current[d];f&&(f[d]=p)}),u&&nm()&&(u.removeEventListener("touchmove",Zg,mi),c&&(c.removeEventListener("touchstart",tm,mi),c.removeEventListener("touchmove",em,mi)))}},[r]);return y.useEffect(function(){if(t){var c=o.current;return a(c),function(){l(c)}}},[t,a,l]),function(c){o.current=c}}var pR=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},gR={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function mR(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,c=e.onTopLeave,u=fR({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:l,onTopLeave:c}),f=hR({isEnabled:n}),d=function(g){u(g),f(g)};return me.jsx(y.Fragment,null,n&&me.jsx("div",{onClick:pR,css:gR}),t(d))}var vR={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},bR=function(t){var n=t.name,r=t.onFocus;return me.jsx("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:vR,value:"",onChange:function(){}})},yR=bR;function mu(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function xR(){return mu(/^iPhone/i)}function im(){return mu(/^Mac/i)}function CR(){return mu(/^iPad/i)||im()&&navigator.maxTouchPoints>1}function wR(){return xR()||CR()}function SR(){return im()||wR()}var IR=function(t){return t.label},om=function(t){return t.label},am=function(t){return t.value},AR=function(t){return!!t.isDisabled},TR={clearIndicator:uO,container:ZD,control:vO,dropdownIndicator:lO,group:CO,groupHeading:SO,indicatorsContainer:rO,indicatorSeparator:fO,input:EO,loadingIndicator:gO,loadingMessage:KD,menu:jD,menuList:WD,menuPortal:JD,multiValue:OO,multiValueLabel:RO,multiValueRemove:MO,noOptionsMessage:YD,option:zO,placeholder:VO,singleValue:GO,valueContainer:tO},ER={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%)"},kR=4,sm=4,_R=38,PR=sm*2,DR={baseUnit:sm,controlHeight:_R,menuGutter:PR},vu={borderRadius:kR,colors:ER,spacing:DR},OR={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Lg(),captureMenuScroll:!Lg(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:lR(),formatGroupLabel:IR,getOptionLabel:om,getOptionValue:am,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:AR,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!DD(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function lm(e,t,n,r){var i=hm(e,t,n),o=pm(e,t,n),a=fm(e,t),l=Ss(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:a,value:l,index:r}}function ws(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(a,l){return lm(e,a,t,l)}).filter(function(a){return dm(e,a)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=lm(e,n,t,r);return dm(e,o)?o:void 0}).filter(MD)}function cm(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,gi(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function um(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,gi(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function RR(e,t){return cm(ws(e,t))}function dm(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,a=t.label,l=t.value;return(!mm(e)||!o)&&gm(e,{label:a,value:l,data:i},r)}function MR(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function LR(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var bu=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},fm=function(t,n){return t.getOptionLabel(n)},Ss=function(t,n){return t.getOptionValue(n)};function hm(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function pm(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Ss(e,t);return n.some(function(i){return Ss(e,i)===r})}function gm(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var mm=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},BR=1,vm=function(e){hD(n,e);var t=mD(n);function n(r){var i;if(dD(this,n),i=t.call(this,r),i.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:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=SR(),i.controlRef=null,i.getControlRef=function(c){i.controlRef=c},i.focusedOptionRef=null,i.getFocusedOptionRef=function(c){i.focusedOptionRef=c},i.menuListRef=null,i.getMenuListRef=function(c){i.menuListRef=c},i.inputRef=null,i.getInputRef=function(c){i.inputRef=c},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(c,u){var f=i.props,d=f.onChange,p=f.name;u.name=p,i.ariaOnChange(c,u),d(c,u)},i.setValue=function(c,u,f){var d=i.props,p=d.closeMenuOnSelect,g=d.isMulti,v=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:v}),p&&(i.setState({inputIsHiddenAfterUpdate:!g}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(c,{action:u,option:f})},i.selectOption=function(c){var u=i.props,f=u.blurInputOnSelect,d=u.isMulti,p=u.name,g=i.state.selectValue,v=d&&i.isOptionSelected(c,g),m=i.isOptionDisabled(c,g);if(v){var b=i.getOptionValue(c);i.setValue(g.filter(function(C){return i.getOptionValue(C)!==b}),"deselect-option",c)}else if(!m)d?i.setValue([].concat(gi(g),[c]),"select-option",c):i.setValue(c,"select-option");else{i.ariaOnChange(c,{action:"select-option",option:c,name:p});return}f&&i.blurInput()},i.removeValue=function(c){var u=i.props.isMulti,f=i.state.selectValue,d=i.getOptionValue(c),p=f.filter(function(v){return i.getOptionValue(v)!==d}),g=Co(u,p,p[0]||null);i.onChange(g,{action:"remove-value",removedValue:c}),i.focusInput()},i.clearValue=function(){var c=i.state.selectValue;i.onChange(Co(i.props.isMulti,[],null),{action:"clear",removedValues:c})},i.popValue=function(){var c=i.props.isMulti,u=i.state.selectValue,f=u[u.length-1],d=u.slice(0,u.length-1),p=Co(c,d,d[0]||null);i.onChange(p,{action:"pop-value",removedValue:f})},i.getFocusedOptionId=function(c){return bu(i.state.focusableOptionsWithIds,c)},i.getFocusableOptionsWithIds=function(){return um(ws(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return TD.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(c){return fm(i.props,c)},i.getOptionValue=function(c){return Ss(i.props,c)},i.getStyles=function(c,u){var f=i.props.unstyled,d=TR[c](u,f);d.boxSizing="border-box";var p=i.props.styles[c];return p?p(d,u):d},i.getClassNames=function(c,u){var f,d;return(f=(d=i.props.classNames)[c])===null||f===void 0?void 0:f.call(d,u)},i.getElementId=function(c){return"".concat(i.state.instancePrefix,"-").concat(c)},i.getComponents=function(){return QO(i.props)},i.buildCategorizedOptions=function(){return ws(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return cm(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(c,u){i.setState({ariaSelection:be({value:c},u)})},i.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(c){i.blockOptionHover=!1},i.onControlMouseDown=function(c){if(!c.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},i.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!i.props.isDisabled){var u=i.props,f=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!f}),i.onMenuClose()):i.openMenu("first"),c.preventDefault()}},i.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(i.clearValue(),c.preventDefault(),i.openAfterFocus=!1,c.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(c){typeof i.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&bs(c.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(c)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(c){var u=c.touches,f=u&&u.item(0);f&&(i.initialTouchX=f.clientX,i.initialTouchY=f.clientY,i.userIsDragging=!1)},i.onTouchMove=function(c){var u=c.touches,f=u&&u.item(0);if(f){var d=Math.abs(f.clientX-i.initialTouchX),p=Math.abs(f.clientY-i.initialTouchY),g=5;i.userIsDragging=d>g||p>g}},i.onTouchEnd=function(c){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(c.target)&&i.menuListRef&&!i.menuListRef.contains(c.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(c){i.userIsDragging||i.onControlMouseDown(c)},i.onClearIndicatorTouchEnd=function(c){i.userIsDragging||i.onClearIndicatorMouseDown(c)},i.onDropdownIndicatorTouchEnd=function(c){i.userIsDragging||i.onDropdownIndicatorMouseDown(c)},i.handleInputChange=function(c){var u=i.props.inputValue,f=c.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(f,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(c){i.props.onFocus&&i.props.onFocus(c),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(c){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(c),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(c){if(!(i.blockOptionHover||i.state.focusedOption===c)){var u=i.getFocusableOptions(),f=u.indexOf(c);i.setState({focusedOption:c,focusedOptionId:f>-1?i.getFocusedOptionId(c):null})}},i.shouldHideSelectedOptions=function(){return mm(i.props)},i.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),i.focus()},i.onKeyDown=function(c){var u=i.props,f=u.isMulti,d=u.backspaceRemovesValue,p=u.escapeClearsValue,g=u.inputValue,v=u.isClearable,m=u.isDisabled,b=u.menuIsOpen,C=u.onKeyDown,w=u.tabSelectsValue,x=u.openMenuOnFocus,I=i.state,S=I.focusedOption,A=I.focusedValue,E=I.selectValue;if(!m&&!(typeof C=="function"&&(C(c),c.defaultPrevented))){switch(i.blockOptionHover=!0,c.key){case"ArrowLeft":if(!f||g)return;i.focusValue("previous");break;case"ArrowRight":if(!f||g)return;i.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(A)i.removeValue(A);else{if(!d)return;f?i.popValue():v&&i.clearValue()}break;case"Tab":if(i.isComposing||c.shiftKey||!b||!w||!S||x&&i.isOptionSelected(S,E))return;i.selectOption(S);break;case"Enter":if(c.keyCode===229)break;if(b){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":b?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:g}),i.onMenuClose()):v&&p&&i.clearValue();break;case" ":if(g)return;if(!b){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":b?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":b?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!b)return;i.focusOption("pageup");break;case"PageDown":if(!b)return;i.focusOption("pagedown");break;case"Home":if(!b)return;i.focusOption("first");break;case"End":if(!b)return;i.focusOption("last");break;default:return}c.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++BR),i.state.selectValue=vs(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),l=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[l],i.state.focusedOptionId=bu(o,a[l])}return i}return fD(n,[{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&&Mg(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,l=o.menuIsOpen,c=this.state.isFocused;(c&&!a&&i.isDisabled||c&&l&&!i.menuIsOpen)&&this.focusInput(),c&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Mg(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(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,a=this.state,l=a.selectValue,c=a.isFocused,u=this.buildFocusableOptions(),f=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(l[0]);d>-1&&(f=d)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[f],focusedOptionId:this.getFocusedOptionId(u[f])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,l=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=a.indexOf(l);l||(c=-1);var u=a.length-1,f=-1;if(a.length){switch(i){case"previous":c===0?f=0:c===-1?f=u:f=c-1;break;case"next":c>-1&&c<u&&(f=c+1);break}this.setState({inputIsHidden:f!==-1,focusedValue:a[f]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var c=0,u=l.indexOf(a);a||(u=-1),i==="up"?c=u>0?u-1:l.length-1:i==="down"?c=(u+1)%l.length:i==="pageup"?(c=u-o,c<0&&(c=0)):i==="pagedown"?(c=u+o,c>l.length-1&&(c=l.length-1)):i==="last"&&(c=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(vu):be(be({},vu),this.props.theme):vu}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,l=this.getClassNames,c=this.getValue,u=this.selectOption,f=this.setValue,d=this.props,p=d.isMulti,g=d.isRtl,v=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:l,getValue:c,hasValue:m,isMulti:p,isRtl:g,options:v,selectOption:u,selectProps:d,setValue:f,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return hm(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return pm(this.props,i,o)}},{key:"filterOption",value:function(i,o){return gm(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:l})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{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 i=this.props,o=i.isDisabled,a=i.isSearchable,l=i.inputId,c=i.inputValue,u=i.tabIndex,f=i.form,d=i.menuIsOpen,p=i.required,g=this.getComponents(),v=g.Input,m=this.state,b=m.inputIsHidden,C=m.ariaSelection,w=this.commonProps,x=l||this.getElementId("input"),I=be(be(be({"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":p,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(C==null?void 0:C.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?K.createElement(v,R({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:f,type:"text",value:c},I)):K.createElement(uR,R({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ms,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:f,value:""},I))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,l=o.MultiValueContainer,c=o.MultiValueLabel,u=o.MultiValueRemove,f=o.SingleValue,d=o.Placeholder,p=this.commonProps,g=this.props,v=g.controlShouldRenderValue,m=g.isDisabled,b=g.isMulti,C=g.inputValue,w=g.placeholder,x=this.state,I=x.selectValue,S=x.focusedValue,A=x.isFocused;if(!this.hasValue()||!v)return C?null:K.createElement(d,R({},p,{key:"placeholder",isDisabled:m,isFocused:A,innerProps:{id:this.getElementId("placeholder")}}),w);if(b)return I.map(function(k,F){var W=k===S,O="".concat(i.getOptionLabel(k),"-").concat(i.getOptionValue(k));return K.createElement(a,R({},p,{components:{Container:l,Label:c,Remove:u},isFocused:W,isDisabled:m,key:O,index:F,removeProps:{onClick:function(){return i.removeValue(k)},onTouchEnd:function(){return i.removeValue(k)},onMouseDown:function(N){N.preventDefault()}},data:k}),i.formatOptionLabel(k,"value"))});if(C)return null;var E=I[0];return K.createElement(f,R({},p,{data:E,isDisabled:m}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,f=this.state.isFocused;if(!this.isClearable()||!o||c||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:d,isFocused:f}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,f=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:d,isDisabled:c,isFocused:f}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var l=this.commonProps,c=this.props.isDisabled,u=this.state.isFocused;return K.createElement(a,R({},l,{isDisabled:c,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,l=o.GroupHeading,c=o.Menu,u=o.MenuList,f=o.MenuPortal,d=o.LoadingMessage,p=o.NoOptionsMessage,g=o.Option,v=this.commonProps,m=this.state.focusedOption,b=this.props,C=b.captureMenuScroll,w=b.inputValue,x=b.isLoading,I=b.loadingMessage,S=b.minMenuHeight,A=b.maxMenuHeight,E=b.menuIsOpen,k=b.menuPlacement,F=b.menuPosition,W=b.menuPortalTarget,O=b.menuShouldBlockScroll,T=b.menuShouldScrollIntoView,N=b.noOptionsMessage,H=b.onMenuScrollToTop,j=b.onMenuScrollToBottom;if(!E)return null;var $=function(U,G){var oe=U.type,ce=U.data,se=U.isDisabled,Z=U.isSelected,te=U.label,ne=U.value,de=m===ce,ve=se?void 0:function(){return i.onOptionHover(ce)},Fe=se?void 0:function(){return i.selectOption(ce)},st="".concat(i.getElementId("option"),"-").concat(G),Je={id:st,onClick:Fe,onMouseMove:ve,onMouseOver:ve,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:Z};return K.createElement(g,R({},v,{innerProps:Je,data:ce,isDisabled:se,isSelected:Z,key:st,label:te,type:oe,value:ne,isFocused:de,innerRef:de?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(U.data,"menu"))},M;if(this.hasOptions())M=this.getCategorizedOptions().map(function(L){if(L.type==="group"){var U=L.data,G=L.options,oe=L.index,ce="".concat(i.getElementId("group"),"-").concat(oe),se="".concat(ce,"-heading");return K.createElement(a,R({},v,{key:ce,data:U,options:G,Heading:l,headingProps:{id:se,data:L.data},label:i.formatGroupLabel(L.data)}),L.options.map(function(Z){return $(Z,"".concat(oe,"-").concat(Z.index))}))}else if(L.type==="option")return $(L,"".concat(L.index))});else if(x){var V=I({inputValue:w});if(V===null)return null;M=K.createElement(d,v,V)}else{var Y=N({inputValue:w});if(Y===null)return null;M=K.createElement(p,v,Y)}var X={minMenuHeight:S,maxMenuHeight:A,menuPlacement:k,menuPosition:F,menuShouldScrollIntoView:T},D=K.createElement(UD,R({},v,X),function(L){var U=L.ref,G=L.placerProps,oe=G.placement,ce=G.maxHeight;return K.createElement(c,R({},v,X,{innerRef:U,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:oe}),K.createElement(mR,{captureEnabled:C,onTopArrive:H,onBottomArrive:j,lockEnabled:O},function(se){return K.createElement(u,R({},v,{innerRef:function(te){i.getMenuListRef(te),se(te)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:ce,focusedOption:m}),M)}))});return W||F==="fixed"?K.createElement(f,R({},v,{appendTo:W,controlElement:this.controlRef,menuPlacement:k,menuPosition:F}),D):D}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,l=o.isDisabled,c=o.isMulti,u=o.name,f=o.required,d=this.state.selectValue;if(f&&!this.hasValue()&&!l)return K.createElement(yR,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(c)if(a){var p=d.map(function(m){return i.getOptionValue(m)}).join(a);return K.createElement("input",{name:u,type:"hidden",value:p})}else{var g=d.length>0?d.map(function(m,b){return K.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:i.getOptionValue(m)})}):K.createElement("input",{name:u,type:"hidden",value:""});return K.createElement("div",null,g)}else{var v=d[0]?this.getOptionValue(d[0]):"";return K.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,l=o.focusedOption,c=o.focusedValue,u=o.isFocused,f=o.selectValue,d=this.getFocusableOptions();return K.createElement(iR,R({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:l,focusedValue:c,isFocused:u,selectValue:f,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,l=i.SelectContainer,c=i.ValueContainer,u=this.props,f=u.className,d=u.id,p=u.isDisabled,g=u.menuIsOpen,v=this.state.isFocused,m=this.commonProps=this.getCommonProps();return K.createElement(l,R({},m,{className:f,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:v}),this.renderLiveRegion(),K.createElement(o,R({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:v,menuIsOpen:g}),K.createElement(c,R({},m,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),K.createElement(a,R({},m,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,l=o.clearFocusValueOnUpdate,c=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,f=o.isFocused,d=o.prevWasFocused,p=o.instancePrefix,g=i.options,v=i.value,m=i.menuIsOpen,b=i.inputValue,C=i.isMulti,w=vs(v),x={};if(a&&(v!==a.value||g!==a.options||m!==a.menuIsOpen||b!==a.inputValue)){var I=m?RR(i,w):[],S=m?um(ws(i,w),"".concat(p,"-option")):[],A=l?MR(o,w):null,E=LR(o,I),k=bu(S,E);x={selectValue:w,focusedOption:E,focusedOptionId:k,focusableOptionsWithIds:S,focusedValue:A,clearFocusValueOnUpdate:!1}}var F=c!=null&&i!==a?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},W=u,O=f&&d;return f&&!O&&(W={value:Co(C,w,w[0]||null),options:w,action:"initial-input-focus"},O=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(W=null),be(be(be({},x),F),{},{prevProps:i,ariaSelection:W,prevWasFocused:O})}}]),n}(y.Component);vm.defaultProps=OR;var $R=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function FR(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,a=o===void 0?null:o,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,f=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,g=e.value,v=Tn(e,$R),m=y.useState(l!==void 0?l:n),b=Yn(m,2),C=b[0],w=b[1],x=y.useState(c!==void 0?c:i),I=Yn(x,2),S=I[0],A=I[1],E=y.useState(g!==void 0?g:a),k=Yn(E,2),F=k[0],W=k[1],O=y.useCallback(function(V,Y){typeof u=="function"&&u(V,Y),W(V)},[u]),T=y.useCallback(function(V,Y){var X;typeof f=="function"&&(X=f(V,Y)),w(X!==void 0?X:V)},[f]),N=y.useCallback(function(){typeof p=="function"&&p(),A(!0)},[p]),H=y.useCallback(function(){typeof d=="function"&&d(),A(!1)},[d]),j=l!==void 0?l:C,$=c!==void 0?c:S,M=g!==void 0?g:F;return be(be({},v),{},{inputValue:j,menuIsOpen:$,onChange:O,onInputChange:T,onMenuClose:H,onMenuOpen:N,value:M})}var NR=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],bm=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),a=String(r.getOptionLabel(n)).toLowerCase();return o===i||a===i},yu={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return bm(t,o,i)})||r.some(function(o){return bm(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function zR(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,a=o===void 0?yu.formatCreateLabel:o,l=e.isValidNewOption,c=l===void 0?yu.isValidNewOption:l,u=e.getNewOptionData,f=u===void 0?yu.getNewOptionData:u,d=e.onCreateOption,p=e.options,g=p===void 0?[]:p,v=e.onChange,m=Tn(e,NR),b=m.getOptionValue,C=b===void 0?am:b,w=m.getOptionLabel,x=w===void 0?om:w,I=m.inputValue,S=m.isLoading,A=m.isMulti,E=m.value,k=m.name,F=y.useMemo(function(){return c(I,vs(E),g,{getOptionValue:C,getOptionLabel:x})?f(I,a(I)):void 0},[a,f,x,C,I,c,g,E]),W=y.useMemo(function(){return(n||!S)&&F?i==="first"?[F].concat(gi(g)):[].concat(gi(g),[F]):g},[n,i,S,F,g]),O=y.useCallback(function(T,N){if(N.action!=="select-option")return v(T,N);var H=Array.isArray(T)?T:[T];if(H[H.length-1]===F){if(d)d(I);else{var j=f(I,I),$={action:"create-option",name:k,option:j};v(Co(A,[].concat(gi(vs(E)),[j]),j),$)}return}v(T,N)},[f,I,A,k,F,d,v,E]);return be(be({},m),{},{options:W,onChange:O})}var jR=y.forwardRef(function(e,t){var n=FR(e),r=zR(n);return K.createElement(vm,R({ref:t},r))}),ym=jR;const UR={control:(e,t)=>Q(B({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px",fontFamily:'var(--joy-fontFamily-body, "Inter", var(--joy-fontFamily-fallback, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"));',"&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(B({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(B({},e),{minHeight:"36px"}),menu:e=>Q(B({},e),{position:"relative"}),clearIndicator:e=>Q(B({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(B({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(B({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(B({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"14px"}),multiValueLabel:e=>Q(B({},e),{color:"#333"})},VR=e=>e.map(t=>({label:t,value:t})),HR=e=>{const[t,n]=y.useState(""),[r,i]=y.useState(!1),o=e.sx||{marginBottom:"16px"},a=VR(e.flags),l=()=>i(!r),c=p=>{e.onChange(p.map(g=>g.value))},u=p=>{n(p)},f=p=>{p.persist();const{key:g}=p;if(t)switch(g){case"Enter":case"Tab":if(e.flags&&e.flags.length===0){const v=[...e.flags,t];e.onChange(v)}if(e.flags&&e.flags.length>0&&d()){const v=[...e.flags,t];e.onChange(v)}n(""),p.preventDefault()}},d=()=>{let p=!1;return e.flags.length&&e.flags.includes(t)?(l(),p):(p=!0,p)};return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:o,children:s.jsx(ym,{styles:UR,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:c,onInputChange:u,onKeyDown:f,placeholder:e.labels.flagsPlaceholder,value:a})}),s.jsx(Ge,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:l})]})},So=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState("primary"),[g,v]=y.useState(""),m=y.useRef(null),b=()=>{m.current&&m.current.click()},C=new Wp,w=We(),x=()=>{f(""),i(!1)},I=N=>{let H="",j="primary";switch(N){case"copy_url":H=e.labels.urlCopiedToClipboardMessage,j="primary";break;case"image_deleted":H=e.labels.imageDeletedMessage,j="primary";break;case"image_reset":H=e.labels.imageResetMessage,j="primary";break;case"upload_success":H=e.labels.uploadingImageMessage,j="success";break;case"upload_failed":H=e.labels.uploadingImageErrorMessage,j="danger";break;case"sign_in_url_failed":H=e.labels.generateSignedInUrlErrorMessage,j="danger";break;case"encrypting_file_failed":H=e.labels.encryptingImageErrorMessage,j="danger";break}p(j),f(H),i(!0)},S=()=>a(!o),A=()=>c(!l),E=()=>{e.clearImage(),I("image_deleted")},k=N=>{navigator.clipboard.writeText(N),I("copy_url")},F=N=>_(this,null,function*(){N.persist();const H=N.target.files?N.target.files[0]:null;if(H){n(!0);try{const j=H.type.split("/")[1],$=yield C.readFileAndHash(H),M=(yield C.generateHashFileName(H))+"."+j,V={image_type:j,image_file_name:M,image_size:H.size,base64_sum:$},Y=yield w==null?void 0:w.https.generateSignedInUrl(V);if(Y!=null&&Y.ok){const X=yield Y.json(),D={"Content-Type":H.type,"Content-MD5":$};try{const L=new File([H],M,{type:H.type}),U=yield w==null?void 0:w.https.storeInBucket(X.data.signed_url,L,D);e.onChangeImages(U||""),v(U),I("upload_success")}catch(L){console.error("There was a problem with uploading the file: ",L),I("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield Y==null?void 0:Y.json()),I("sign_in_url_failed")}catch(j){console.error("There was a problem with encrypting file...",j),I("encrypting_file_failed")}n(!1)}}),W=N=>_(this,null,function*(){if(N){n(!0);try{const H=N.type.split("/")[1],j=yield C.readFileAndHash(N),$=(yield C.generateHashFileName(N))+"."+H,M={image_type:H,image_file_name:$,image_size:N.size,base64_sum:j},V=yield w==null?void 0:w.https.generateSignedInUrl(M);if(V!=null&&V.ok){const Y=yield V.json(),X={"Content-Type":N.type,"Content-MD5":j};try{const D=new File([N],$,{type:N.type}),L=yield w==null?void 0:w.https.storeInBucket(Y.data.signed_url,D,X);e.onChangeImages(L||""),I("upload_success")}catch(D){console.error("There was a problem with uploading the file: ",D),I("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield V==null?void 0:V.json()),I("sign_in_url_failed")}catch(H){console.error("There was a problem with encrypting file...",H),I("encrypting_file_failed")}n(!1)}}),O=()=>{e.onChangeImages(g),I("image_reset")},T=N=>{e.onChangeImages(N),v(N)};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Card,{sx:{marginBottom:"10px"},children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(h.Typography,{level:"title-lg",children:e.title}),s.jsx(h.Tooltip,{title:e.labels.clearImage,children:s.jsx(h.IconButton,{variant:"plain",color:"danger",size:"sm",onClick:E,children:s.jsx(Rp,{})})})]}),s.jsxs(h.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[s.jsxs(h.Skeleton,{loading:t,animation:"wave",children:[e.image?s.jsx(h.Box,{component:"img",src:e.image,loading:"lazy",alt:e.title,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):s.jsx(jc,{sx:{fontSize:"3rem",opacity:.2}}),e.image?s.jsx(h.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:s.jsx(Yp,{sx:{fontSize:"3rem",color:"#fff"}})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Tooltip,{title:e.labels.copyUrl,children:s.jsx(h.Button,{onClick:()=>k(e.image),disabled:!e.image,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})}),s.jsx(h.Tooltip,{title:e.labels.viewImage,children:s.jsx(h.Button,{onClick:S,disabled:!e.image,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:s.jsx(qp,{})})}),s.jsx(h.Tooltip,{title:e.labels.cropImage,children:s.jsx(h.Button,{onClick:A,disabled:!e.image,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(hg,{})})})]}),s.jsx(h.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:s.jsxs(h.Button,{sx:{width:"100%"},onClick:b,children:[s.jsx(_e.Upload,{})," ",e.labels.uploadImage,s.jsx(Qp,{type:"file",accept:"image/*",onChange:F,ref:m})]})}),w.https.sportal365Config?s.jsx(h.AccordionGroup,{variant:"soft",children:s.jsxs(h.Accordion,{children:[s.jsx(h.AccordionSummary,{children:s.jsx(h.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.labels.sportal365Images})}),s.jsx(h.AccordionDetails,{children:s.jsx(Kp,{labels:e.labels,onChangeImages:T})})]})}):s.jsx(s.Fragment,{})]}),s.jsx(Ge,{showToast:r,message:u,color:d,hideToast:x}),s.jsx(Gp,{title:e.labels.viewImage,open:o,imageSrc:e.image,toggleModal:S}),s.jsx(fg,{labels:e.labels,open:l,imageSrc:e.image,toggleModal:A,uploadImage:W,resetDefaultImageUrl:O})]})},WR=["cover","mobile"],GR=e=>new Map().set("main",e.mainImage).set("cover",e.coverImage).set("mobile",e.mobileImage),YR=e=>e?B({},e):{main:"",mobile:"",cover:""},KR=e=>{const[t,n]=y.useState(!1),r=YR(e.defaultValue),i=GR(e.labels),o=(l,c)=>{r[c]=l,e.onChange(r)},a=l=>{r[l]="",e.onChange(r)};return s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(So,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:l=>o(l,"main"),clearImage:()=>a("main")}),s.jsx(h.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?s.jsx(s.Fragment,{children:WR.map(l=>s.jsx(So,{labels:e.labels,title:i.get(l),image:r[l],onChangeImages:c=>o(c,l),clearImage:()=>a(l)},`images-${l}`))}):s.jsx(s.Fragment,{})]})};function qR(e){return ut("MuiSheet",e)}Ke("MuiSheet",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const QR=["className","color","component","variant","invertedColors","slots","slotProps"],JR=e=>{const{variant:t,color:n}=e,r={root:["root",t&&`variant${we(t)}`,n&&`color${we(n)}`]};return pt(r,qR,{})},XR=ye("div",{name:"JoySheet",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r;const i=(n=e.variants[t.variant])==null?void 0:n[t.color],{borderRadius:o,bgcolor:a,backgroundColor:l,background:c}=vc({theme:e,ownerState:t},["borderRadius","bgcolor","backgroundColor","background"]),u=ar(e,`palette.${a}`)||a||ar(e,`palette.${l}`)||l||c||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||e.vars.palette.background.surface;return[R({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,"--ListItem-stickyBackground":u==="transparent"?"initial":u,"--Sheet-background":u==="transparent"?"initial":u},o!==void 0&&{"--List-radius":`calc(${o} - var(--variant-borderWidth, 0px))`,"--unstable_actionRadius":`calc(${o} - var(--variant-borderWidth, 0px))`},{backgroundColor:e.vars.palette.background.surface,position:"relative"}),R({},e.typography["body-md"],t.variant==="solid"&&t.color&&t.invertedColors&&I_(t.color)(e),t.variant==="soft"&&t.color&&t.invertedColors&&A_(t.color)(e),(r=e.variants[t.variant])==null?void 0:r[t.color],i)]}),ZR=K.forwardRef(function(t,n){const r=gt({props:t,name:"JoySheet"}),{className:i,color:o="neutral",component:a="div",variant:l="plain",invertedColors:c=!1,slots:u={},slotProps:f={}}=r,d=De(r,QR),p=R({},r,{color:o,component:a,invertedColors:c,variant:l}),g=JR(p),v=R({},d,{component:a,slots:u,slotProps:f}),[m,b]=Ee("root",{ref:n,className:zn(g.root,i),elementType:XR,externalForwardedProps:v,ownerState:p});return s.jsx(m,R({},b))});function eM(e){return ut("MuiTypography",e)}Ke("MuiTypography",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const tM=["color","textColor"],nM=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant","slots","slotProps"],xu=K.createContext(!1),rM=K.createContext(!1),iM=e=>{const{gutterBottom:t,noWrap:n,level:r,color:i,variant:o}=e,a={root:["root",r,t&&"gutterBottom",n&&"noWrap",i&&`color${we(i)}`,o&&`variant${we(o)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return pt(a,eM,{})},oM=ye("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),aM=ye("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),sM=ye("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const l=t.level!=="inherit"?(n=e.typography[t.level])==null?void 0:n.lineHeight:"1";return R({"--Icon-fontSize":`calc(1em * ${l})`},t.color&&{"--Icon-color":"currentColor"},{margin:"var(--Typography-margin, 0px)"},t.nesting?{display:"inline"}:R({display:"block"},t.unstable_hasSkeleton&&{position:"relative"}),(t.startDecorator||t.endDecorator)&&R({display:"flex",alignItems:"center"},t.nesting&&R({display:"inline-flex"},t.startDecorator&&{verticalAlign:"bottom"})),t.level&&t.level!=="inherit"&&e.typography[t.level],{fontSize:`var(--Typography-fontSize, ${t.level&&t.level!=="inherit"&&(r=(i=e.typography[t.level])==null?void 0:i.fontSize)!=null?r:"inherit"})`},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.color&&{color:`var(--variant-plainColor, rgba(${(o=e.vars.palette[t.color])==null?void 0:o.mainChannel} / 1))`},t.variant&&R({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!t.nesting&&{marginInline:"-0.25em"},(a=e.variants[t.variant])==null?void 0:a[t.color]))}),xm={h1:"h1",h2:"h2",h3:"h3",h4:"h4","title-lg":"p","title-md":"p","title-sm":"p","body-lg":"p","body-md":"p","body-sm":"p","body-xs":"span",inherit:"p"},Cu=K.forwardRef(function(t,n){var r;const i=gt({props:t,name:"JoyTypography"}),{color:o,textColor:a}=i,l=De(i,tM),c=K.useContext(xu),u=K.useContext(rM),f=p1(R({},l,{color:a})),{component:d,gutterBottom:p=!1,noWrap:g=!1,level:v="body-md",levelMapping:m=xm,children:b,endDecorator:C,startDecorator:w,variant:x,slots:I={},slotProps:S={}}=f,A=De(f,nM),E=(r=t.color)!=null?r:x?o!=null?o:"neutral":o,k=c||u?t.level||"inherit":v,F=oh(b,["Skeleton"]),W=d||(c?"span":m[k]||xm[k]||"span"),O=R({},f,{level:k,component:W,color:E,gutterBottom:p,noWrap:g,nesting:c,variant:x,unstable_hasSkeleton:F}),T=iM(O),N=R({},A,{component:W,slots:I,slotProps:S}),[H,j]=Ee("root",{ref:n,className:T.root,elementType:sM,externalForwardedProps:N,ownerState:O}),[$,M]=Ee("startDecorator",{className:T.startDecorator,elementType:oM,externalForwardedProps:N,ownerState:O}),[V,Y]=Ee("endDecorator",{className:T.endDecorator,elementType:aM,externalForwardedProps:N,ownerState:O});return s.jsx(xu.Provider,{value:!0,children:s.jsxs(H,R({},j,{children:[w&&s.jsx($,R({},M,{children:w})),F?K.cloneElement(b,{variant:b.props.variant||"inline"}):b,C&&s.jsx(V,R({},Y,{children:C}))]}))})});Cu.muiName="Typography";function lM(e){return ut("MuiFormControl",e)}const Cm=Ke("MuiFormControl",["root","error","disabled","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","sizeSm","sizeMd","sizeLg","horizontal","vertical"]),cM=Ke("MuiSwitch",["root","checked","disabled","action","input","thumb","track","focusVisible","readOnly","colorPrimary","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid","startDecorator","endDecorator"]),uM=["id","className","component","disabled","required","error","color","size","orientation","slots","slotProps"],dM=e=>{const{disabled:t,error:n,size:r,color:i,orientation:o}=e,a={root:["root",o,t&&"disabled",n&&"error",i&&`color${we(i)}`,r&&`size${we(r)}`]};return pt(a,lM,{})},fM=ye("div",{name:"JoyFormControl",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i;return R({"--unstable_RadioGroup-margin":"0.5rem 0","--FormLabel-alignSelf":t.orientation==="horizontal"?"align-items":"flex-start","--FormLabel-asteriskColor":e.vars.palette.danger[500]},t.size==="sm"&&{"--FormLabel-fontSize":e.vars.fontSize.xs,"--FormLabel-lineHeight":e.vars.lineHeight.xl,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.5rem 0 0":"0 0 0.25rem 0","--FormHelperText-fontSize":e.vars.fontSize.xs,"--FormHelperText-lineHeight":e.vars.lineHeight.xl},t.size==="md"&&{"--FormLabel-fontSize":e.vars.fontSize.sm,"--FormLabel-lineHeight":e.vars.lineHeight.sm,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.75rem 0 0":"0 0 0.375rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.size==="lg"&&{"--FormLabel-fontSize":e.vars.fontSize.md,"--FormLabel-lineHeight":e.vars.lineHeight.md,"--FormLabel-margin":t.orientation==="horizontal"?"0 1rem 0 0":"0 0 0.5rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.color&&{"--FormHelperText-color":(n=e.vars.palette[t.color])==null?void 0:n[500]},{"--FormHelperText-margin":"0.375rem 0 0 0",[`&.${Cm.error}`]:{"--FormHelperText-color":e.vars.palette.danger[500]},[`&.${Cm.disabled}`]:{"--FormLabel-color":(r=e.variants.plainDisabled)==null||(r=r[t.color||"neutral"])==null?void 0:r.color,"--FormHelperText-color":(i=e.variants.plainDisabled)==null||(i=i[t.color||"neutral"])==null?void 0:i.color},display:"flex",position:"relative",flexDirection:t.orientation==="horizontal"?"row":"column"},t.orientation==="horizontal"&&{[`& > label ~ .${cM.root}`]:{"--unstable_Switch-margin":"0 0 0 auto"}})}),wu=K.forwardRef(function(t,n){const r=gt({props:t,name:"JoyFormControl"}),{id:i,className:o,component:a="div",disabled:l=!1,required:c=!1,error:u=!1,color:f,size:d="md",orientation:p="vertical",slots:g={},slotProps:v={}}=r,m=De(r,uM),b=ro(i),[C,w]=K.useState(null),x=R({},r,{id:b,component:a,color:f,disabled:l,error:u,required:c,size:d,orientation:p});let I;const S=dM(x),[A,E]=Ee("root",{ref:n,className:zn(S.root,o),elementType:fM,externalForwardedProps:R({},m,{component:a,slots:g,slotProps:v}),ownerState:x}),k=K.useMemo(()=>({disabled:l,required:c,error:u,color:f,size:d,htmlFor:b,labelId:`${b}-label`,"aria-describedby":C?`${b}-helper-text`:void 0,setHelperText:w,registerEffect:I}),[f,l,u,C,b,I,c,d]);return s.jsx(rs.Provider,{value:k,children:s.jsx(A,R({},E))})});function hM(e){return ut("MuiFormLabel",e)}Ke("MuiFormLabel",["root","asterisk"]);const pM=["children","component","htmlFor","id","slots","slotProps"],gM=()=>pt({root:["root"],asterisk:["asterisk"]},hM,{}),mM=ye("label",{name:"JoyFormLabel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({"--Icon-fontSize":"calc(var(--FormLabel-lineHeight) * 1em)",WebkitTapHighlightColor:"transparent",alignSelf:"var(--FormLabel-alignSelf)",display:"flex",gap:"2px",alignItems:"center",flexWrap:"wrap",userSelect:"none",fontFamily:e.vars.fontFamily.body,fontSize:`var(--FormLabel-fontSize, ${e.vars.fontSize.sm})`,fontWeight:e.vars.fontWeight.md,lineHeight:`var(--FormLabel-lineHeight, ${e.vars.lineHeight.sm})`,color:`var(--FormLabel-color, ${e.vars.palette.text.primary})`,margin:"var(--FormLabel-margin, 0px)"})),vM=ye("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})({color:"var(--FormLabel-asteriskColor)"}),Su=K.forwardRef(function(t,n){var r,i;const o=gt({props:t,name:"JoyFormLabel"}),{children:a,component:l="label",htmlFor:c,id:u,slots:f={},slotProps:d={}}=o,p=De(o,pM),g=K.useContext(rs),v=(r=(i=t.required)!=null?i:g==null?void 0:g.required)!=null?r:!1,m=R({},o,{required:v}),b=gM(),C=R({},p,{component:l,slots:f,slotProps:d}),[w,x]=Ee("root",{additionalProps:{htmlFor:c!=null?c:g==null?void 0:g.htmlFor,id:u!=null?u:g==null?void 0:g.labelId},ref:n,className:b.root,elementType:mM,externalForwardedProps:C,ownerState:m}),[I,S]=Ee("asterisk",{additionalProps:{"aria-hidden":!0},className:b.asterisk,elementType:vM,externalForwardedProps:C,ownerState:m});return s.jsxs(w,R({},x,{children:[a,v&&s.jsxs(I,R({},S,{children:[" ","*"]}))]}))}),bM=({environment:e,userNotFound:t})=>{const[n,r]=y.useState(""),[i,o]=y.useState(""),[a,l]=y.useState(!1),c=()=>{l(!a)},u=p=>{p.persist(),r(p.target.value)},f=p=>{p.persist(),o(p.target.value)},d=()=>_(this,null,function*(){try{yield no(e).signInWithEmailAndPassword(n,i)}catch(p){console.error(p),c()}});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:s.jsxs(ZR,{sx:{width:300,mx:"auto",py:3,px:2,display:"flex",flexDirection:"column",justifyContent:"center",gap:2,borderRadius:"sm",boxShadow:"md"},variant:"outlined",children:[s.jsxs("div",{children:[s.jsx(Cu,{level:"h4",component:"h1",children:s.jsx("b",{children:"Sign in"})}),s.jsx(Cu,{level:"body-sm",children:"Use your account in the Fans United platform."})]}),s.jsxs(wu,{children:[s.jsx(Su,{children:"Email"}),s.jsx(is,{name:"email",type:"email",onChange:u})]}),s.jsxs(wu,{children:[s.jsx(Su,{children:"Password"}),s.jsx(is,{name:"password",type:"password",onChange:f})]}),s.jsx(di,{sx:{mt:1},onClick:d,children:"Log in"})]})}),s.jsx(Ge,{showToast:a,message:t,color:"danger",hideToast:c})]})};function yM(e){return ut("MuiCheckbox",e)}const vi=Ke("MuiCheckbox",["root","checkbox","action","input","label","checked","disabled","focusVisible","indeterminate","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid"]),xM=xc(s.jsx("path",{d:"M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"}),"Check"),CM=xc(s.jsx("path",{d:"M19 13H5c-.55 0-1-.45-1-1s.45-1 1-1h14c.55 0 1 .45 1 1s-.45 1-1 1z"}),"HorizontalRule"),wM=["checked","uncheckedIcon","checkedIcon","label","defaultChecked","disabled","disableIcon","overlay","id","indeterminate","indeterminateIcon","name","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","value","color","variant","size","component","slots","slotProps"],SM=e=>{const{checked:t,disabled:n,disableIcon:r,focusVisible:i,color:o,variant:a,size:l,indeterminate:c}=e,u={root:["root",t&&"checked",n&&"disabled",i&&"focusVisible",a&&`variant${we(a)}`,o&&`color${we(o)}`,l&&`size${we(l)}`],checkbox:["checkbox",t&&"checked",c&&"indeterminate",n&&"disabled"],action:["action",t&&"checked",r&&n&&"disabled",i&&"focusVisible"],input:["input"],label:["label"]};return pt(u,yM,{})},IM=ye("span",{name:"JoyCheckbox",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r,i;return R({"--Icon-fontSize":"var(--Checkbox-size)"},e.size==="sm"&&{"--Checkbox-size":"1rem","& ~ *":{"--FormHelperText-margin":"0 0 0 1.5rem"},fontSize:t.vars.fontSize.sm,gap:"var(--Checkbox-gap, 0.5rem)"},e.size==="md"&&{"--Checkbox-size":"1.25rem","& ~ *":{"--FormHelperText-margin":"0.25rem 0 0 1.875rem"},fontSize:t.vars.fontSize.md,gap:"var(--Checkbox-gap, 0.625rem)"},e.size==="lg"&&{"--Checkbox-size":"1.5rem","& ~ *":{"--FormHelperText-margin":"0.375rem 0 0 2.25rem"},fontSize:t.vars.fontSize.lg,gap:"var(--Checkbox-gap, 0.75rem)"},{position:e.overlay?"initial":"relative",display:"inline-flex",fontFamily:t.vars.fontFamily.body,lineHeight:"var(--Checkbox-size)",color:t.vars.palette.text.primary,[`&.${vi.disabled}`]:{color:(n=t.variants.plainDisabled)==null||(n=n[e.color])==null?void 0:n.color}},e.disableIcon&&{color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color,[`&.${vi.disabled}`]:{color:(i=t.variants[`${e.variant}Disabled`])==null||(i=i[e.color])==null?void 0:i.color}})}),AM=ye("span",{name:"JoyCheckbox",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const l=(n=e.variants[`${t.variant}`])==null?void 0:n[t.color];return[R({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,boxSizing:"border-box",borderRadius:`min(${e.vars.radius.sm}, 0.25rem)`,width:"var(--Checkbox-size)",height:"var(--Checkbox-size)",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0},t.disableIcon&&{display:"contents"},{[`&.${vi.checked}, &.${vi.indeterminate}`]:{"--Icon-color":"currentColor"}}),...t.disableIcon?[]:[R({},l,{backgroundColor:(r=l==null?void 0:l.backgroundColor)!=null?r:e.vars.palette.background.surface}),{"&:hover":{"@media (hover: hover)":(i=e.variants[`${t.variant}Hover`])==null?void 0:i[t.color]}},{"&:active":(o=e.variants[`${t.variant}Active`])==null?void 0:o[t.color]},{[`&.${vi.disabled}`]:(a=e.variants[`${t.variant}Disabled`])==null?void 0:a[t.color]}]]}),TM=ye("span",{name:"JoyCheckbox",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var n,r,i,o;return[{borderRadius:`var(--Checkbox-actionRadius, ${t.overlay?"var(--unstable_actionRadius, inherit)":"inherit"})`,textAlign:"left",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",zIndex:1,[e.focus.selector]:e.focus.default},...t.disableIcon?[(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},{"&:active":(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]},{[`&.${vi.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]}]:[]]}),EM=ye("input",{name:"JoyCheckbox",slot:"Input",overridesResolver:(e,t)=>t.input})(()=>({margin:0,opacity:0,position:"absolute",width:"100%",height:"100%",cursor:"pointer"})),kM=ye("label",{name:"JoyCheckbox",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>R({flex:1,minWidth:0},e.disableIcon&&{zIndex:1,pointerEvents:"none"})),_M=s.jsx(xM,{}),PM=s.jsx(CM,{}),DM=K.forwardRef(function(t,n){var r,i,o,a,l;const c=gt({props:t,name:"JoyCheckbox"}),{checked:u,uncheckedIcon:f,checkedIcon:d=_M,label:p,defaultChecked:g,disabled:v,disableIcon:m=!1,overlay:b,id:C,indeterminate:w=!1,indeterminateIcon:x=PM,name:I,onBlur:S,onChange:A,onFocus:E,onFocusVisible:k,readOnly:F,required:W,value:O,color:T,variant:N,size:H="md",component:j,slots:$={},slotProps:M={}}=c,V=De(c,wM),Y=K.useContext(rs),X=(r=(i=t.disabled)!=null?i:Y==null?void 0:Y.disabled)!=null?r:v,D=(o=(a=t.size)!=null?a:Y==null?void 0:Y.size)!=null?o:H,L=ro(C!=null?C:Y==null?void 0:Y.htmlFor),U={checked:u,defaultChecked:g,disabled:X,onBlur:S,onChange:A,onFocus:E,onFocusVisible:k},{getInputProps:G,checked:oe,disabled:ce,focusVisible:se}=iA(U),Z=oe||w,de=Z?N||"solid":N||"outlined",ve=t.color||(Y!=null&&Y.error?"danger":(l=Y==null?void 0:Y.color)!=null?l:T),Je=R({},c,{checked:oe,disabled:ce,disableIcon:m,overlay:b,focusVisible:se,color:Z?ve||"primary":ve||"neutral",variant:de,size:D}),vt=SM(Je),he=R({},V,{component:j,slots:$,slotProps:M}),[ge,xe]=Ee("root",{ref:n,className:vt.root,elementType:IM,externalForwardedProps:he,ownerState:Je}),[ke,Ye]=Ee("checkbox",{className:vt.checkbox,elementType:AM,externalForwardedProps:he,ownerState:Je}),[Oe,Pe]=Ee("action",{className:vt.action,elementType:TM,externalForwardedProps:he,ownerState:Je}),[St,It]=Ee("input",{additionalProps:R({id:L,name:I,value:O,readOnly:F,role:void 0,required:W!=null?W:Y==null?void 0:Y.required,"aria-describedby":Y==null?void 0:Y["aria-describedby"]},w&&{"aria-checked":"mixed"}),className:vt.input,elementType:EM,externalForwardedProps:he,getSlotProps:G,ownerState:Je}),[Mt,_t]=Ee("label",{additionalProps:{htmlFor:L},className:vt.label,elementType:kM,externalForwardedProps:he,ownerState:Je});let Nt=f;return m?Nt=null:w?Nt=x:oe&&(Nt=d),s.jsxs(ge,R({},xe,{children:[s.jsxs(ke,R({},Ye,{children:[s.jsx(Oe,R({},Pe,{children:s.jsx(St,R({},It))})),Nt]})),p&&s.jsx(xu.Provider,{value:!0,children:s.jsx(Mt,R({},_t,{children:p}))})]}))}),OM=Be(s.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done"),Or=({label:e,values:t,allValues:n,valuesMap:r,showAll:i,showAllLabel:o,onChange:a,toggleShowAll:l})=>{const c=(u,f)=>{u.persist();let d=[...t];if(u.target.checked){d.push(f),a(d);return}d=t.filter(p=>p!==f),a(d)};return s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"body-sm",mb:1,children:e}),s.jsxs(cT,{orientation:"horizontal",wrap:!0,sx:{columnGap:"12px","--List-gap":"8px","--ListItem-radius":"20px","--ListItem-minHeight":"32px","--ListItem-gap":"4px"},children:[n.map(u=>s.jsxs(Kh,{children:[t.includes(u)&&s.jsx(OM,{fontSize:"medium",color:"primary",sx:{ml:-.5,zIndex:2,pointerEvents:"none"}}),s.jsx(DM,{checked:t.includes(u),variant:t.includes(u)?"soft":"outlined",overlay:!0,disableIcon:!0,label:r[u]||"N/A",onChange:f=>c(f,u),slotProps:{action:({checked:f})=>({sx:f?{border:"1px solid",borderColor:"primary.500"}:{backgroundColor:"#fff"}})}})]},`checkbox-value-${e}-${u}`)),i===!1?s.jsx(Kh,{children:s.jsx(h.Link,{onClick:l,children:o})}):s.jsx(s.Fragment,{})]})]})},bi={popular:["FT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","CORRECT_SCORE","OVER_CORNERS_9_5"],playerRelated:["PLAYER_YELLOW_CARD","PLAYER_RED_CARD","PLAYER_SCORE","PLAYER_SCORE_FIRST_GOAL","PLAYER_SCORE_TWICE","PLAYER_SCORE_HATTRICK"],goals:["OVER_GOALS_0_5","OVER_GOALS_1_5","OVER_GOALS_2_5","OVER_GOALS_3_5","OVER_GOALS_4_5","OVER_GOALS_5_5","OVER_GOALS_6_5"],corners:["CORNERS_MATCH","OVER_CORNERS_6_5","OVER_CORNERS_7_5","OVER_CORNERS_8_5","OVER_CORNERS_9_5","OVER_CORNERS_10_5","OVER_CORNERS_11_5","OVER_CORNERS_12_5","OVER_CORNERS_13_5"],correctScores:["CORRECT_SCORE","CORRECT_SCORE_HT","CORRECT_SCORE_ADVANCED"],misc:["FT_1X2","HT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","HT_FT","RED_CARD_MATCH","PENALTY_MATCH"]},RM=({labels:e,values:t,valuesMap:n,onChange:r})=>{const[i,o]=y.useState(!1);return s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.marketSelection}),s.jsx(h.FormHelperText,{sx:{mb:2},children:e.marketSelectionDescription}),s.jsx(Or,{label:"Popular",values:t,allValues:bi.popular,valuesMap:n,showAll:i,showAllLabel:e.showAll,onChange:r,toggleShowAll:()=>o(!0)}),i?s.jsxs(s.Fragment,{children:[s.jsx(Or,{label:e.playerRelated,values:t,allValues:bi.playerRelated,valuesMap:n,onChange:r}),s.jsx(Or,{label:e.goals,values:t,allValues:bi.goals,valuesMap:n,onChange:r}),s.jsx(Or,{label:e.corners,values:t,allValues:bi.corners,valuesMap:n,onChange:r}),s.jsx(Or,{label:e.correctScores,values:t,allValues:bi.correctScores,valuesMap:n,onChange:r}),s.jsx(Or,{label:e.misc,values:t,allValues:bi.misc,valuesMap:n,onChange:r})]}):s.jsx(s.Fragment,{})]})},Le={avatar:"data:image/png;base64,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",team:"data:image/png;base64,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",competition:"data:image/png;base64,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",bin:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA8klEQVR4nOWUvQ3CMBCFX5MGloAJwgQwAUwAYoAwATSUMAGZACYgA/CzQSaAjgGgQTIyegU6WfbZioQET3Lxonf+4uR8wL9oCcCItUrZyDS0vgewqhnK306nnDW2NqiK4WEEYMSavSZcMlx8PJNHl35Gv9EAFo4uMQHAmn6uAUwY3kYAdvRjDWDA8CkCcKbvawBdhi8RgCt9RwPIADy5MgXAlQ9KvpHxAFwnDkp+U+MBuP5ZULIrjAfg6rqgZF8bD8B1b4IqWFTSHx2Ag+fmNzpbqoTZhV7EdKwTpi/aAB4R8/8OoIVITQHcFJvbjO2kH9UL+0+m+SiE/A0AAAAASUVORK5CYII=",checkMark:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE10lEQVR4nO2ZXVBUdRjGdzS78BLqSmqyIKducjKZuvKqNMMpMgQW17IENEIFEWhVViYEJlm+dmG/JAFFZFcQ+QqlRKAQiNUWli/5EJYFgd0FUWI/gJ7mv+ZkAp497GG3Znhmzv3vec/7f//veQ6LtaIVrchuySFfLbY0vpc528DNtDQUCi31bemm+vE0Y50lZbrWkmysGedP31AnTVUXJk1d5yZOVr/LA28Vy9n6AU0vSeaaEiUzTVrRbCMyZxogtNyEwFyPdNMvSDXWIcVYi+TpGiT9cQOnp6rx/cPrSHz4E+Inrw3GTV5N4Okr3BwOnoVbL8rmlBLJbJNZMtsEuvAJD6pwavIa4u5fxXfjleaTExUi3oOSFxwCL8MttnROaZDO/Qa74ScqETvxI06OV4CnL9MfHyv1WzZwCZrXnIFSJvtTCcbhDWU4oS/FcV0JuKNXxEGQrGEafu0ZKCuWG/7Y2BV8O1aMqJGict5QyVomK+8w+OjRy8QAjg4rqnhq+fN2G3BE2xx7Gv7eJUQMKxA+JBfZCX87wGnww3KEDRXgkDbfd0nwOWh0lc0pdc6EP6y9iNDBC4bwoTz6I5bMeWfDHxzMR6gmDyH95zNowUuhcmPkkmIA/puB8/h6INcc1Jvzss0GrOuBg+CPaC/CuywWIT25i8Cfw4H+XAT3ZSfYBM8DVolnmgYdAR+uLcDGU/5wYb+D9Yc+QHB71oLw++/mILD3rNYH8tWUBshW6ajKvxXnB9fdm60GXPw3wT1s24LwQX3ZxAC+6pV5UhqwrsSOgud4zjOwOHwW9vbKoikNZFhuFi1728SzH8Fz/jHwysH3sU8tXRT+y54z+KJbpqA0ILDUq22BjxkpAefn04jVly+t8k8YeDVsKwLbnw2/t1uGPXekLdQGTL8aKOGHi7EheocV4O14NmJ0pfQr//ezPmwrZeUJ/Od3pNjTJdFRGkg31pmp2uZN7if/gtgUH4ATo8X0Ks/xxGsRHyKwXWYrPHZ3ik2UBlKna81UPf/GUwYevwnuSNGywXO6xAjoEFEbSDHWGKgOLHewEBuivOZBbYzzQ+TwJRvaZhv2tUnpwXeKwG4XUreQNT2wYdpEaRR4fQETpNoRWgXz8B0Z8GsTUh/ipKnqIltHZUR/ATwiFzbBWNt0PoL3bxdiV5uAeoyS3IbOnD9y9wI8Ij+aB8tk5f3bhfBtE8BHnRZFaYCETnQvqcN9ec80wQT8LnU6vFtTN1MaIIlZwmSVhu4NG9qTC/fI7csGv7M1bcDmNI8kZkvZ50O6s+F+dDvj8J+p07CzNTXeJnjrW9BXuJHEbCkfI/s7z8Ijeof1sefA+j4J35Ji8rnNX8eiIxL32f8lxUjl4a1KFtCCt76F+5UuMfoynbPhP1Xx9V7NSUvLTUlW6VT4lmR4t/B9WPaIZJXOgv/4d76QZa/Id2jUaNFlh8Or+GVbqnnPsZgQCVoj7inKHQhf6tUsYSbcfSwSeZOs0hFts4Wpyi8kklWGavJ1jI/KFv6Y3QfWVoVoc1xJ3Hdg4JyJiUvKW5Us8FHzXViOVrAmex1JzAL7sjW0dxt1moasB7Rv2OUQWbJI6ERyGxJ9kPSA0yU2cLpE5oDOTDO7Q2jwbxOoyD5PVmKyVf4nfrOuaEWs/7/+Atqs1blaLwVcAAAAAElFTkSuQmCC",upload:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC+ElEQVR4nO2aO2gUURSGP8T1AaImIGjUIkIMooj4KgRBbFJZiYVY2agIVj5WsDC9VklIsLNQwS2yhZVmN4KotYVPWERFLBbER1Y0aBy5cAaGZXZm7nhn92bmfnBg2T1n98x/z5z7mAWHw+FwOBwOh8MheDm3WLycmxMgDi/n5gSIw8u5OQHi8BLaPHAJGBAry3uFqYBySGy5SAJsCIldXyQBBkJiNxb9FricUdK3gDu2CTAvImTdBN8Ca4C1wAebBPC6YL+BA4HcDgJ/iiTA1ZD8rhdFgMfA0pD8lgPP8i7AV2AwIsftwM88C3AiQZ7n8yTAJ6ACnAK2JEkSWALU8yDAbdKjFl6fF7MAH4F+/o+jNgrQBI4BR6S8w3wWgMOY4Z1NAlSAdYHv6wNuhPhdwxw3bRCgKaMexqE23+fACoMCnOy1AJW2UW/nYcD3F7ATswz2SoBmxKh3Gn01f2fBMmAlsAnYD5wD7gKtrASoxIx62OjXZf7uJquBM7KrNCbAC40ERiXmC7AZcwzLFrwGvJKRbsnrmnymfHxUz7liSoBRzWSV/3HMsA+Y1ahUVXV7dX7AS2BqM9JtSsAk8DdFk1YxE/IdsXgGy98U/W29JK3NyrokEi/FIUWWlDRLPs4eyYzREdvKf9Lgxfs2HvWDXo/tvZz6+A0vyT0/F8i/lbAn7LFVgNOBXJKWfiMQ00gYM2OjAD+AVZLHNs3zQ58nGnHDtgmglq5pnjNOB+KmNeIu2ibA2UAeNY24qUDclEbcA9sEUJsYnzcdfFpyn6tSr8osMRKIG5H3quLTiGiMr20TQD1d9pnr4JOWuNnDCgGChyTfuyDAt6SO3TJ//u/pLWALM11ogvexmLTTYFUj7gIWM6RxIarUfZ5qxG3Fcuq9WArbxC55gBJ3MarJGdsM2cZEBrPNGIuIUsqnwKkPRGykz9CpUD3JkZjNlTCe8lB0Qco+7C83i44dwD2Ni1fdfjc5ZEj282pLqx6GqI2NspeywlOfKZ9I/gGPNfEFBL9FwQAAAABJRU5ErkJggg==",upArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAz0lEQVR4nO3YywrCMBBG4fOE1oWDC/vsCiq+RAuVQLpzvDVtJvAfCJSki/nIqgWllFJKKaUqtwfuwDU/N5kBAzDlNQI9jSOmFjHmIJrCHF8gBmcvvdvMTYzACTg4Z31LiLnwGPsCER5jPyDCYuwPRDiMLUCEwVgBRHWMFURUw9gKiM0xtiJiM4xtgFgdYxsi5opjaiCKY2oiimEiIBZjuoDfDkdnpjSr2y0Y4h0m/dBwewREeJg0q1uXpedPV1epDrjkGXe1h1FKKaWUUrTVE5bz7NyN3sYLAAAAAElFTkSuQmCC",downArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAgklEQVR4nO2UOwrAIBAF5xKReP+bJFV+TSxynATBQiSI0TXVDggW7htesYKiKIogE7ADRiDLZxzAXPJ4BW7ANcpNyPBZS8nAAJxh4AJshTTNGGsH7R/SFnmztEYuJv0iF5eWyLtJc/Lu0rfddMld4sPJErfs3jTFt9vC6d5UURSFmAePTDtnrV72/QAAAABJRU5ErkJggg==",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAABvUlEQVR4nO2XTUrDQBSAPwXBn7ps0TO4EFfd24obEfQQHqOt4qIewAt4BkFci+610IIW7MpFXQtWxJGRNxBK02k0qTPpfDCUvDbJ+/LezDQQCARmBpWTQe5EfEUFEcdQoSKOoUJFMmIZOAG6wEA+G8CSTxXRyd7F7A+3FhmnRI4lh2egAqwAVaAn8bovIl3JYXsoXpX4ky8iA8mhMBRflfh7miIlYJNsK1IZiu9I/DEtES3RAtrAIunTkBx60k4FkTBzpJaGiJEwvztL3+NnVdKr06hV68by8CYSiUroCfcpo5yBjE62LvcZyGdtgg6wihSBB/muA6xJNcyxbaOaFmqcSLQSLTlGnk5b4s2YCy/giEgpRsJQjrTYHnAAnAJXQD/mnKmLFEe00yialtdOfe76f4mULJWIYlqsL5XQFTmUfWbSa2Qm0kqYQNxqkuSBZCKiLO2UhGiLjmu/rSxEOilJJJH5kF19Pu05Mi30HnQOfMm9r/+wOCgX/v3uAi9y/1dg31cRpBMuI3lcyIuVdyKaOeAIeLPMqXHDCRHDBnCfB5HfEERcQ4XWcgwVKuIYKrcVUZ4PciMSCARmgG9mLvK/OR2iiQAAAABJRU5ErkJggg==",flag:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIUAAACBCAYAAADuS3kqAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACfRJREFUeJztnXuIXNUdx913shutjfVBqtGFupuZ3Xnd9zz3Ne/dYKEo/isSEGqFSlslSFBi2kStSqkiCEGl1D/ECP4hKLYmTUziZjfRjUl8FzU0pbJLtIlJ1t2N37PZQHBM9t67d845d+b3hS8z9+59nfP73N/5nZnZmcsuI5FIJJJE0pOlpqg+2NwbTbUEQlZLd4/ecnNAbT3vrqDWuqbXbA1GEq0RbaBFSxSbRF8zySOF1b5G1cqtDCl93Xhcq1r530X1gYeMVHlUTxSPYnkqZgydBCDTCP4cfJY9YnkG608pVu44gDiGbXdFtP6N2P4+xcwWw2p/AH/vwHYEi+xC8BoQrOUI1q3wk1jeA39ppIZPm+nhOSuz9uxSjePMmjgeYPlIjeffCGt9vwcoAZyvRXT7SQvCUHAFAjIIGNYjUP/A8gkzPbLk4DsxzjmtJQrjgGNzVBtI4FpaRfdL3QkdvwypPaPFC5uMZGkcmQAgDHMF4cezyMickSxPApLtuL518C8AS6Po/qppYShYjbtwHdL2q3qyfEo0BIsMM3OoXY4iez0AeDvNVLlBdP/VjHC3tQGComLmtgGE06KD7caA42u0YyOK3JVL7hAccAW8DR5d8L6LeAze6kEMpBIq/lvUeGEn7rrvRAd26ZljZE5PFg+j7uhH1nA/pOBgP4E/sXni3R7GQ5gwdbwaIGzAuPwpagVPZgwyGVnjjBYvbsEweLmrDqonKBQru0q18vdjDJ4UHbhqm9UbGBJfQpHc5bijcIArah0KFI8rAMPdyAzHWIoVHTCOnsFM5UHHHVbLUKDwuhLTtQ1Ip/+TIEAiPAsoNjruOIdQ7KlC7DwXIOjQ4vlfYZjYgTQ6I0FwfAnFx7UCRdQY7EIR+SJgmJYgKKJd31AoZu46DTAgSxAMHkBxuZ+hAAjNmHr9AUPFvyUIgmyuLygw1boKReSv8fhxnc0onELxsOPO9RsUmHtfjaxwJ4aJccBwRoKOl9lcoNhbhTjbEoaIFTEzu05Plj63MpQZ6hYKI1VqiZlD3agb/gYYpmiYkBiKrqDeGlIyN1jpYc8/6ME+PBLVB8PICvdgmHgbU8uTEnSuX+0aihVOoQAQIRR5n8HPhrW+jGrl25YCgmJmGwFCGhlhA471MrLCccoKnkGxiQsUCGAMQZv/AAoeZ1D8/Ze9RqBYubvwPN8TSXZim9W406/HRf0cvhLPVyELrAZQnRGtP6InSndgm3uxfif2+8pIDc9K0Im1ZjFQ/MBz7GVlzAxO4vFrKz0yhXWTWP4cy5PY5zj7WBt7a5dtK0Gn1bqXBMVHNk/yDtsHd3z0IlCQ5TJBQfYOig6CombNEQozGwEU30rQaPLiUPyRCxSYQoYJCl+YCxSj56DIERT+MEcorFyIoPCF+UGhnoOCXn6W366haHcORb6XoPCFZ40ULyjiBIVPzBOKAkHhD7N/QP6TWyg+tHmSfWwfLVHoISh8YZ5QFINWeuSEBI0mywKFTlD4xa6hWO4YimQpYGUICh+YoCCLgWLsHBRlQLGWoJDfDIrNvKBYg+f/l6DRZFmgMAgKv5gjFKlyN0HhCwOKYVdQLHMKhZkaJij8YY5QpEe68PwbCRpNXhyKLW6h+MDmScYXMsWNOFnNf5lYDZgfFOynCmJm1m52IdcDFDcHVPZFIXb3IfsQijbnUGiAIntEgkaTZYGiKwgoTILCB2ZQPFJtKPZfAMVhCRpNlgiKJoWg8IN5QqE3IVMckqDRZFmg6O4hKHxi11C0uoECw8f7EjSaLA8UBqDIERTym0HxaLWhOHABFAclaDS5ilDYfc2BoPCXOULROw/FhASNJlcJihanUKzpNQkKf5g7FO9J0Gjy4lA8xguKRoLCF+YCxbvzUISsRsXKvStBo8kEBVlaKAKAQrVyByRoNLlKUDQ7hyIOKPIEhfzmCEV4Hor9EjSavDgUfyYoyJ5BYfcDM++xfYLhBINiXIJGkwkKMi8omhxDEQEU8fyYBI0mywJFTyRJUPjDXKFo0OKFfRI0mrw4FI9XG4qJeSiiBIVfzBuKUdENJksFRapBJSh8YbdQNDqFovccFO+IbjBZJihiKTZ8EBQ+MEco0gyKvaIbLKPN9MhZLVE4ZaTKX+nJ0ljUGHpBtfLPaoni01j+q5Es/0WHsfwUsu0zMTO7VbVyryF4x7DuhNe/3IzjPuEWCrv/7XWQ7RMiKM4DwKZ8JxHcCS1ReiOiDdyvxvO3OQ7Cgsz0MIbl/K1hrf8+gPU6IPoC677zBxRKpgFU7xEdFEEgnEWwvgEIb8aM7DoEsFNPFJrdgnAp4cb7Kc5T1uL5vyPzTFkZ51mENxS7RQeIlwHBDIJzULFyW5ANBsJqX4PnBCwiPVFcFlb7h5BJngcgtr+Z0C0UDQRFpdnQABjYOP9yVB8soc3XeB5pF0L2aAYYA7i25wDHot9QyBGKvpqFYr5QjBcOozjcHDUGA4qZ5Z4V7ArXVgQcE+yaLwHFk44P7BCK98/vByjeFh1Aj2GYBQzjipn7ZUTrlxaEHxMyx1Zc/4wMUOwSHUgvjDttFiBsQ7V/i5EstnsaLU7SE6V2tOMx+LRQKHSfQ4Gp3oyRLO/AMJEVUThWQ6h9CgDjuDgoksWdogPrEoZpdNx+DBVr0YZGT6MigZDBkyhA/4Ppq3somNxBUfIdFADhQxRntxvJUodnUZBQMTO7CnXGAQYGbyj+JTrI9jLD/ItNX6jxwnpkiZWe9bzkwrD4M7T7Jdj5ex9MLNg2O/nQ+X38AAXS6CSKyMdjxuBNyBI1UTc4EWJ0LWo/xdXOLqHYITrol4BhFrOJ15BCcyi+6g4GT1QrUACGM0ibb0b1gSxqh5orIrnKHRTl7aIhuACGGWSFVzBMpCNaP8HghdxAgTn+WyJBWCggj0aNwU3ICgZlBo/lEop/CgCB/XreFIqn7Sgcf6tauWBYyRAM1RA63O7XH7Kp63zhhuBwgWIhI5zA8LBLsXL3KOZQJ7JCk+g+q3m5gQKB+Q3u1DH23r6RWtqngy4EAMeaRhaaBAB7o8bQw3AhrPa1ITMQCDzlBgoA0RhSMq0IXjceFUwB740ZQw/GzOwzAGU3UvwYZgIT+PshAHQE6z9gZs+x/qAaLxxABhiF34poA6wuWI9tb++NpsL4+40hta8Z56DppCi5geJiYu8nIMDLAUp7IBxvX9NrdHQFdVhbsI51ZnswkliODLAMw0Ibr3aSHMhLKEg1IgdQHCYo6kQItN2vVCYo6kUEBalCBAWpQgQFqUIEBalCDqGg9xrqQQi03Z9pICjqRQQFqUIEBalCBAWpQgQFqUIItN1f+TlCUNSJCApShQgKUoUIClKFCApShRxCQR+grQch0HZ/OZCgqBcRFKQKERSkChEUJBKJRCKRHOh7LktbCRuu/n0AAAAASUVORK5CYII="},MM=({match:e,timeFormat:t})=>{var n,r,i,o;return s.jsxs(h.Box,{display:"flex",alignItems:"center",gap:.5,fontSize:"xs",children:[s.jsxs(h.Typography,{mr:1,children:["[",ft(e.kickoffAt).format(t),"]"]}),e.homeTeam.code?s.jsx(h.Tooltip,{title:e.homeTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",minWidth:"60px",justifyContent:"flex-end",children:[s.jsx(h.Typography,{children:e.homeTeam.code||e.homeTeam.name}),s.jsx(h.Avatar,{src:((n=e.homeTeam.assets)==null?void 0:n.logo)||Le.team,sx:{width:"20px",height:"20px"}})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{children:e.homeTeam.code||e.homeTeam.name}),s.jsx(h.Avatar,{src:((r=e.homeTeam.assets)==null?void 0:r.logo)||Le.team,sx:{width:"20px",height:"20px"}})]}),"-",e.awayTeam.code?s.jsx(h.Tooltip,{title:e.awayTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",children:[s.jsx(h.Avatar,{src:((i=e.awayTeam.assets)==null?void 0:i.logo)||Le.team,sx:{width:"20px",height:"20px"}})," ",s.jsx(h.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Avatar,{src:((o=e.awayTeam.assets)==null?void 0:o.logo)||Le.team,sx:{width:"20px",height:"20px"}}),s.jsx(h.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})]})},Is=Be(s.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),LM=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),{sdk:l}=We(),c=()=>_(this,null,function*(){try{const p=yield l.topX.getGames({limit:50},!0),g=yield l.matchQuiz.getGames({limit:50},!0),v=[...p.data,...g.data];if(e.related&&e.related.length>0){const m=v.filter(b=>{var C;return(C=e.related)==null?void 0:C.some(w=>w.entity_id===b.id)}).map(b=>b.id);n(m)}i(v)}catch(d){console.error(d),f()}}),u=(d,p)=>{const g=p.map(v=>({entity_id:v,entity_type:"GAME",entity_relationship:"relatedTo"}));e.onChange(g)},f=()=>a(!o);return y.useEffect(()=>{c()},[]),s.jsxs(s.Fragment,{children:[r.length>0?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.label}),s.jsx(h.Select,{multiple:!0,indicator:s.jsx(Is,{}),defaultValue:t,renderValue:d=>s.jsx(h.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:d.map((p,g)=>s.jsx(h.Chip,{variant:"soft",color:"primary",children:p.label},`related-game-${p.label}-${g}`))}),onChange:u,sx:{minWidth:"15rem",[`& .${h.selectClasses.indicator}`]:{transition:"0.2s",[`&.${h.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(d=>s.jsx(h.Option,{value:d.id,children:d.title?d.title+` (${d.type})`:`Game with no title (${d.type}). ID: ${d.id}`},`related-game-title-${d.id}`))})]}):s.jsx(s.Fragment,{}),s.jsx(Ge,{showToast:o,message:"There was a problem witch fetching games for related options",color:"danger",hideToast:f})]})},BM=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),{sdk:l}=We(),c=()=>_(this,null,function*(){try{const p=yield l.loyalty.getTemplates(void 0,!0);if(e.related&&e.related.length>0){const g=p.data.filter(v=>{var m;return(m=e.related)==null?void 0:m.some(b=>b.entity_id===v.id)}).map(v=>v.id);n(g)}i(p.data)}catch(d){console.error(d),f()}}),u=(d,p)=>{const g=p.map(v=>({entity_id:v,entity_type:"TEMPLATE",entity_relationship:"relatedTo"}));e.onChange(g)},f=()=>a(!o);return y.useEffect(()=>{c()},[]),s.jsxs(s.Fragment,{children:[r.length>0?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.label}),s.jsx(h.Select,{multiple:!0,indicator:s.jsx(Is,{}),defaultValue:t,renderValue:d=>s.jsx(h.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:d.map((p,g)=>s.jsx(h.Chip,{variant:"soft",color:"primary",children:p.label},`related-template-${p.label}-${g}`))}),onChange:u,sx:{minWidth:"15rem",[`& .${h.selectClasses.indicator}`]:{transition:"0.2s",[`&.${h.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(d=>s.jsx(h.Option,{value:d.id,children:d.name||`Template with no name. ID: ${d.id}`},`related-template-name-${d.id}`))})]}):s.jsx(s.Fragment,{}),s.jsx(Ge,{showToast:o,message:"There was a problem witch fetching templates for related options",color:"danger",hideToast:f})]})},wm=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="game"),Sm=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="template"),$M=e=>{const t=(n,r)=>{if(r==="games"){const i=Sm(e.related);e.onChange([...n,...i])}if(r==="templates"){const i=wm(e.related);e.onChange([...n,...i])}};return s.jsxs(s.Fragment,{children:[s.jsx(LM,{label:e.labels.games,related:wm(e.related),onChange:n=>t(n,"games")}),s.jsx(BM,{label:e.labels.templates,related:Sm(e.related),onChange:n=>t(n,"templates")})]})},FM=(e,t)=>{const[n,r]=y.useState(null),{https:i}=We(),o=()=>_(this,null,function*(){const a=yield i.getSchedulersByEntityId(e);if(a.ok){const l=yield a.json();r(l.data);return}r([])});return y.useEffect(()=>(o(),()=>r(null)),[e,t]),n},yi=({my:e})=>s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",my:e},children:s.jsx(h.CircularProgress,{variant:"solid",color:"neutral"})}),NM=["PENDING","LIVE","SETTLED"],zM=["OPEN"],jM=["ACTIVE","INACTIVE","EXPIRED"],UM=new Map().set("PENDING","Pending").set("LIVE","Live").set("SETTLED","Settled").set("CANCELED","Canceled").set("OPEN","Open").set("ACTIVE","Active").set("INACTIVE","Inactive").set("PENDING","Pending").set("EXPIRED","Expired"),Im=e=>{let t=[];return e.entityType==="CLASSIC_QUIZ"||e.entityType==="PERSONALITY_QUIZ"||e.entityType==="EITHER_OR"||e.entityType==="POLL"?t=Array.from(jM):e.entityType==="TEMPLATE"?t=Array.from(NM):t=Array.from(zM),s.jsx(s.Fragment,{children:t.map(n=>s.jsx(h.Option,{value:n,children:UM.get(n)},`${e.entityType}-${n}-status`))})};class VM{constructor(){J(this,"name","");J(this,"scheduled_task_config",{entity_id:"",entity_type:"",change:{status:""}});J(this,"trigger",{trigger_type:"DATETIME",date:""})}}const HM=Be(s.jsx("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3M12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1m1 4h-2v-2h2z"}),"WarningRounded"),WM=e=>{const[t,n]=y.useState(!1),{https:r}=We(),i=o=>_(this,null,function*(){if(o.stopPropagation(),n(!0),(yield r.deleteScheduledTask(e.taskId)).ok){n(!1),e.toggleToast("success",e.labels.deleteScheduledTaskMessage),e.refetchTasks(),e.toggleModal();return}n(!1),e.toggleToast("danger",e.labels.deleteScheduledTaskErrorMessage)});return s.jsx(s.Fragment,{children:s.jsx(h.Modal,{open:e.isOpen,onClose:e.toggleModal,children:s.jsxs(h.ModalDialog,{children:[s.jsxs(h.DialogTitle,{children:[s.jsx(HM,{}),e.labels.deleteScheduledTaskModalTitle]}),s.jsx(h.Divider,{}),s.jsx(h.DialogContent,{children:s.jsxs(h.Typography,{children:[e.labels.deleteScheduledTaskModalParagraph,s.jsx(h.Typography,{fontWeight:"bold",children:e.taskName}),"?"]})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{loading:t,variant:"solid",color:"danger",onClick:o=>i(o),children:e.labels.delete}),s.jsx(h.Button,{variant:"plain",color:"neutral",onClick:o=>{o.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]})})})},GM=e=>{const[t,n]=y.useState(null),[r,i]=y.useState(""),[o,a]=y.useState(""),[l,c]=y.useState(""),[u,f]=y.useState(""),[d,p]=y.useState(!1),[g,v]=y.useState(!1),[m,b]=y.useState(!1),[C,w]=y.useState("success"),[x,I]=y.useState(""),[S,A]=y.useState(!1),E=y.useRef(!1),k=FM(e.entityId,E.current),{https:F}=We();if(!k)return s.jsx(yi,{my:10});const W=()=>A(!S),O=(M,V)=>{b(!0),w(M),I(V)},T=(M,V)=>{i(V.scheduled_task_config.change.status),c(V.trigger.date),n(M)},N=()=>_(this,null,function*(){p(!0);const M=$("CREATE","");if((yield F.setSchedulers(M,"CREATE",null)).ok){p(!1),a(""),f(""),E.current=!E.current,O("success",e.labels.createScheduledTaskMessage);return}p(!1),a(""),f(""),O("danger",e.labels.createScheduledTaskErrorMessage)}),H=(M,V)=>_(this,null,function*(){v(!0);const Y=$("UPDATE",V);if((yield F.setSchedulers(Y,"UPDATE",M)).ok){v(!1),n(null),i(""),c(""),E.current=!E.current,O("success",e.labels.updateScheduledTaskMessage);return}v(!1),O("danger",e.labels.updateScheduledTaskErrorMessage),n(null),i(""),c("")}),j=()=>{E.current=!E.current},$=(M,V)=>{const Y=new VM,X=M==="CREATE"?o:r,D=M==="CREATE"?null:V,L=M==="CREATE"?u:l;return Y.scheduled_task_config.entity_id=e.entityId,Y.scheduled_task_config.entity_type=e.entityType,Y.scheduled_task_config.change.status=X,Y.trigger.date=L,Y.name=D,Y};return s.jsxs(s.Fragment,{children:[k.map((M,V)=>s.jsx(h.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:s.jsx(h.CardContent,{children:t===V?s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%"},children:[s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),s.jsx(h.Select,{value:r,size:"sm",name:"status",onChange:(Y,X)=>i(X),sx:{minHeight:"36px"},children:s.jsx(Im,{entityType:e.entityType})})]}),s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.at}),s.jsx(ou,{defaultDate:l,onChange:Y=>c(Y)})]}),r&&l?s.jsx(h.Button,{onClick:()=>H(M.id,M.name),loading:g,sx:{mt:"auto"},children:e.labels.save}):s.jsx(h.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.save})]}):s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"}},children:[s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{style:{fontWeight:"bold"},children:[e.labels.name,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:M.name})]}),s.jsxs(h.Typography,{style:{color:"gray"},children:[e.labels.status,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:M.status})]})]}),!e.readOnly&&s.jsxs(h.Box,{children:[s.jsx(h.Tooltip,{title:e.labels.edit,children:s.jsx(h.IconButton,{onClick:()=>T(V,M),children:s.jsx(_e.Edit,{})})}),s.jsx(h.Tooltip,{title:e.labels.delete,children:s.jsx(h.IconButton,{onClick:W,children:s.jsx(_e.Delete,{})})})]}),s.jsx(WM,{labels:e.labels,isOpen:S,taskId:M.id,taskName:M.name,toggleModal:W,refetchTasks:j,toggleToast:O})]})})},`scheduled-task-${e.entityId}-${e.entityType}-${M.id}`)),!e.readOnly&&s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%",mt:k&&k.length?2:0},children:[s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),s.jsx(h.Select,{value:o,size:"sm",name:"status",onChange:(M,V)=>a(V),sx:{minHeight:"37px"},children:s.jsx(Im,{entityType:e.entityType})})]}),s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.at}),s.jsx(ou,{defaultDate:u,onChange:M=>f(M)})]}),o&&u?s.jsx(h.Button,{onClick:N,loading:d,sx:{mt:"auto"},children:e.labels.create}):s.jsx(h.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.create})]}),s.jsx(Ge,{showToast:m,message:x,color:C,hideToast:()=>b(!1)})]})};function YM(e){return ut("MuiIconButton",e)}Ke("MuiIconButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","loading","loadingIndicator"]);const KM=["children","action","component","color","disabled","variant","loading","loadingIndicator","size","slots","slotProps"],qM=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,size:o,variant:a,loading:l}=e,c={root:["root",n&&"disabled",r&&"focusVisible",a&&`variant${we(a)}`,t&&`color${we(t)}`,o&&`size${we(o)}`,l&&"loading"],loadingIndicator:["loadingIndicator"]},u=pt(c,YM,{});return r&&i&&(u.root+=` ${i}`),u},QM=ye("button")(({theme:e,ownerState:t})=>{var n,r,i,o;return[R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.instanceSize&&{"--IconButton-size":{sm:"2rem",md:"2.25rem",lg:"2.75rem"}[t.instanceSize]},t.size==="sm"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.6)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:e.vars.fontSize.sm,paddingInline:"2px"},t.size==="md"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.25rem) / 1.5)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2.25rem)",minHeight:"var(--IconButton-size, 2.25rem)",fontSize:e.vars.fontSize.md,paddingInline:"0.25rem"},t.size==="lg"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.75rem) / 1.571)","--CircularProgress-size":"28px","--CircularProgress-thickness":"4px",minWidth:"var(--IconButton-size, 2.75rem)",minHeight:"var(--IconButton-size, 2.75rem)",fontSize:e.vars.fontSize.lg,paddingInline:"0.375rem"},{WebkitTapHighlightColor:"transparent",paddingBlock:0,fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.md,margin:"var(--IconButton-margin)",borderRadius:`var(--IconButton-radius, ${e.vars.radius.sm})`,border:"none",boxSizing:"border-box",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",[e.focus.selector]:R({"--Icon-color":"currentColor"},e.focus.default)}),R({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":R({"--Icon-color":"currentColor"},(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color])},'&:active, &[aria-pressed="true"]':R({"--Icon-color":"currentColor"},(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]),"&:disabled":(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]})]}),JM=ye(QM,{name:"JoyIconButton",slot:"Root",overridesResolver:(e,t)=>t.root})({}),XM=ye("span",{name:"JoyIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e,ownerState:t})=>{var n,r;return R({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),Am=K.forwardRef(function(t,n){var r;const i=gt({props:t,name:"JoyIconButton"}),{children:o,action:a,component:l="button",color:c="neutral",disabled:u,variant:f="plain",loading:d=!1,loadingIndicator:p,size:g="md",slots:v={},slotProps:m={}}=i,b=De(i,KM),C=K.useContext($p),w=K.useContext(Fp),x=t.variant||C.variant||f,I=t.size||C.size||g,S=t.color||C.color||c,A=(r=t.loading||t.disabled)!=null?r:C.disabled||d||u,E=K.useRef(null),k=hn(E,n),{focusVisible:F,setFocusVisible:W,getRootProps:O}=Jl(R({},i,{disabled:A,rootRef:k})),T=p!=null?p:s.jsx(Lp,{color:S,thickness:{sm:2,md:3,lg:4}[I]||3});K.useImperativeHandle(a,()=>({focusVisible:()=>{var L;W(!0),(L=E.current)==null||L.focus()}}),[W]);const N=R({},i,{component:l,color:S,disabled:A,variant:x,loading:d,size:I,focusVisible:F,instanceSize:t.size}),H=qM(N),j=L=>{var U;let G=i.onClick;if(typeof m.root=="function"?G=m.root(N).onClick:m.root&&(G=m.root.onClick),(U=G)==null||U(L),w){var oe;(oe=w.onClick)==null||oe.call(w,L,i.value)}};let $=i["aria-pressed"];typeof m.root=="function"?$=m.root(N)["aria-pressed"]:m.root&&($=m.root["aria-pressed"]),w!=null&&w.value&&(Array.isArray(w.value)?$=w.value.indexOf(i.value)!==-1:$=w.value===i.value);const M=R({},b,{component:l,slots:v,slotProps:m}),[V,Y]=Ee("root",{ref:n,className:H.root,elementType:JM,getSlotProps:O,externalForwardedProps:M,ownerState:N,additionalProps:{onClick:j,"aria-pressed":$}}),[X,D]=Ee("loadingIndicator",{className:H.loadingIndicator,elementType:XM,externalForwardedProps:M,ownerState:N});return s.jsx(V,R({},Y,{children:d?s.jsx(X,R({},D,{children:T})):o}))});Am.muiName="IconButton";const As=Be(s.jsx("path",{d:"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"CloseRounded"),ZM=({label:e,defaultValue:t,options:n,required:r,onChange:i})=>{function o(c){var u,f;return c?s.jsxs(s.Fragment,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(h.Avatar,{size:"sm",src:((f=(u=n.find(d=>d.id===c.value))==null?void 0:u.assets)==null?void 0:f.logo)||Le.competition})}),c.label]}):null}const a=y.useRef(null),l=(c,u)=>{i(u)};return s.jsxs(h.FormControl,{sx:{mb:1},children:[s.jsx(h.FormLabel,{required:r,color:"primary",children:e}),s.jsx(h.Select,Q(B({slotProps:{button:{sx:{whiteSpace:"nowrap"}}},sx:{"--ListItemDecorator-size":"44px",minHeight:"37px"},renderValue:o,value:t,onChange:l},t&&{endDecorator:s.jsx(Am,{variant:"plain",color:"neutral",onMouseDown:c=>{c.stopPropagation()},onClick:()=>{var c;i(""),(c=a.current)==null||c.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(As,{})}),indicator:null}),{children:n.map((c,u)=>{var f;return s.jsxs(y.Fragment,{children:[u!==0?s.jsx(h.ListDivider,{role:"none"}):null,s.jsxs(h.Option,{value:c.id,label:c.name,children:[s.jsx(h.ListItemDecorator,{children:s.jsx(h.Avatar,{size:"sm",src:((f=c.assets)==null?void 0:f.logo)||Le.competition})}),c.name]})]},`${c.id}-${u}`)})}))]})};function eL(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Tm=eL,tL=typeof jt=="object"&&jt&&jt.Object===Object&&jt,nL=tL,rL=nL,iL=typeof self=="object"&&self&&self.Object===Object&&self,oL=rL||iL||Function("return this")(),Em=oL,aL=Em,sL=function(){return aL.Date.now()},lL=sL,cL=/\s/;function uL(e){for(var t=e.length;t--&&cL.test(e.charAt(t)););return t}var dL=uL,fL=dL,hL=/^\s+/;function pL(e){return e&&e.slice(0,fL(e)+1).replace(hL,"")}var gL=pL,mL=Em,vL=mL.Symbol,Iu=vL,km=Iu,_m=Object.prototype,bL=_m.hasOwnProperty,yL=_m.toString,Io=km?km.toStringTag:void 0;function xL(e){var t=bL.call(e,Io),n=e[Io];try{e[Io]=void 0;var r=!0}catch(o){}var i=yL.call(e);return r&&(t?e[Io]=n:delete e[Io]),i}var CL=xL,wL=Object.prototype,SL=wL.toString;function IL(e){return SL.call(e)}var AL=IL,Pm=Iu,TL=CL,EL=AL,kL="[object Null]",_L="[object Undefined]",Dm=Pm?Pm.toStringTag:void 0;function PL(e){return e==null?e===void 0?_L:kL:Dm&&Dm in Object(e)?TL(e):EL(e)}var DL=PL;function OL(e){return e!=null&&typeof e=="object"}var RL=OL,ML=DL,LL=RL,BL="[object Symbol]";function $L(e){return typeof e=="symbol"||LL(e)&&ML(e)==BL}var Om=$L,FL=gL,Rm=Tm,NL=Om,Mm=NaN,zL=/^[-+]0x[0-9a-f]+$/i,jL=/^0b[01]+$/i,UL=/^0o[0-7]+$/i,VL=parseInt;function HL(e){if(typeof e=="number")return e;if(NL(e))return Mm;if(Rm(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Rm(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=FL(e);var n=jL.test(e);return n||UL.test(e)?VL(e.slice(2),n?2:8):zL.test(e)?Mm:+e}var WL=HL,GL=Tm,Au=lL,Lm=WL,YL="Expected a function",KL=Math.max,qL=Math.min;function QL(e,t,n){var r,i,o,a,l,c,u=0,f=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(YL);t=Lm(t)||0,GL(n)&&(f=!!n.leading,d="maxWait"in n,o=d?KL(Lm(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p);function g(A){var E=r,k=i;return r=i=void 0,u=A,a=e.apply(k,E),a}function v(A){return u=A,l=setTimeout(C,t),f?g(A):a}function m(A){var E=A-c,k=A-u,F=t-E;return d?qL(F,o-k):F}function b(A){var E=A-c,k=A-u;return c===void 0||E>=t||E<0||d&&k>=o}function C(){var A=Au();if(b(A))return w(A);l=setTimeout(C,m(A))}function w(A){return l=void 0,p&&r?g(A):(r=i=void 0,a)}function x(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function I(){return l===void 0?a:w(Au())}function S(){var A=Au(),E=b(A);if(r=arguments,i=this,c=A,E){if(l===void 0)return v(c);if(d)return clearTimeout(l),l=setTimeout(C,t),g(c)}return l===void 0&&(l=setTimeout(C,t)),a}return S.cancel=x,S.flush=I,S}var JL=QL;const cr=bn(JL),En=({option:e})=>s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:e.logo}),s.jsx(h.Typography,{children:e.label}),s.jsx(h.Typography,{ml:.5,level:"body-xs",children:`(${e.countryName})`})]}),Bm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||Le.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Le.flag}}))||[],XL=({labels:e,label:t,ids:n,required:r,onChange:i})=>{const[o,a]=y.useState([]),[l,c]=y.useState([]),[u,f]=y.useState(!1),[d,p]=y.useState(""),[g,v]=y.useState(!1),{sdk:m}=We(),b=()=>v(!g),C=(S,A)=>{a(A),i(A[0]?[A[0].id]:[])},w=3;y.useEffect(()=>{!d&&n&&n.length&&m.football.getCompetitions({competitionIds:n}).then(S=>{a(Bm(S))}).catch(S=>{console.error(S),b(),a([])})},[]);const x=y.useMemo(()=>cr(S=>{f(!0),m.football.getCompetitions({name:S}).then(A=>{c([...Bm(A)]),f(!1)}).catch(A=>{console.error(A),b(),c([]),f(!1)})},300),[]);y.useEffect(()=>{if(!d||d.length<w){c([]);return}return x(d),()=>x.cancel()},[d,x]);const I=(S,A)=>S.map((E,k)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:F=>A({index:k}).onClick(F),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(En,{option:E},`option_${E.id}`)},E.id));return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:r,color:"primary",children:t}),s.jsx(h.Box,{children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:u,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(S,A)=>S.id===A.id,endDecorator:u?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.competitionsSelectionPlaceholder,options:l,disabled:o.length===1,filterOptions:S=>S.filter(A=>!o.some(E=>E.value===A.value)),onInputChange:(S,A)=>{p(A)},onChange:C,getOptionKey:S=>S.id,value:o,renderTags:I,renderOption:(S,A)=>s.jsx(h.AutocompleteOption,Q(B({},S),{children:s.jsx(En,{option:A})}))})}),s.jsx(Ge,{showToast:g,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:b})]})},$m=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||Le.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Le.flag}}))||[],ZL=({labels:e,ids:t,scope:n,onChange:r})=>{const[i,o]=y.useState([]),[a,l]=y.useState([]),[c,u]=y.useState(!1),[f,d]=y.useState(""),[p,g]=y.useState(!1),{sdk:v}=We(),m=()=>g(!p),b=(I,S)=>{o(S);const A=S.map(E=>E.id);r(A&&A.length?A:null)},C=3;y.useEffect(()=>{!f&&t&&t.length&&v.football.getCompetitions({competitionIds:t}).then(I=>{o($m(I))}).catch(I=>{console.error(I),m(),o([])})},[]);const w=y.useMemo(()=>cr(I=>{u(!0);const S={name:I,competitionIds:[""]};n&&Array.isArray(n)&&n.length>0?S.competitionIds=Array.from(n):delete S.competitionIds,v.football.getCompetitions(S).then(A=>{l([...$m(A)]),u(!1)}).catch(A=>{console.error(A),m(),l([]),u(!1)})},300),[]);y.useEffect(()=>{if(!f||f.length<C){l([]);return}return w(f),()=>w.cancel()},[f,w]);const x=(I,S)=>I.map((A,E)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>S({index:E}).onClick(k),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(En,{option:A},`option_${A.id}`)},A.id));return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:c,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(I,S)=>I.id===S.id,endDecorator:c?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e.competitionsSelectionPlaceholder,options:a,filterOptions:I=>I.filter(S=>!i.some(A=>A.value===S.value)),onInputChange:(I,S)=>{d(S)},onChange:b,getOptionKey:I=>I.id,value:i,renderTags:x,renderOption:(I,S)=>s.jsx(h.AutocompleteOption,Q(B({},I),{children:s.jsx(En,{option:S})}))})}),s.jsx(Ge,{showToast:p,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:m})]})},Fm=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],e2=({labels:e,ids:t,onChange:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState([]),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState(!1),{sdk:g}=We(),v=()=>p(!d),m=(x,I)=>{i(I);const S=I.map(A=>A.id);n(S&&S.length?S:null)},b=3;y.useEffect(()=>{!u&&t&&t.length&&g.profile.getByIds(t).then(x=>{i(Fm(x))}).catch(x=>{v(),console.error(x),i([])})},[]);const C=y.useMemo(()=>cr(x=>{c(!0),g.profile.getByIds([],x).then(I=>{a([...Fm(I)]),c(!1)}).catch(I=>{console.error(I),v(),a([]),c(!1)})},300),[]);y.useEffect(()=>{if(!u||u.length<b){a([]);return}return C(u),()=>C.cancel()},[u,C]);const w=(x,I)=>x.map((S,A)=>{var E;return s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>I({index:A}).onClick(k),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(E=S.avatar)!=null?E:Le.avatar}),s.jsx(h.Typography,{children:S.label})]})},S.id)});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:l,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(x,I)=>x.id===I.id,endDecorator:l?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:x=>x.filter(I=>!r.some(S=>S.value===I.value)),onInputChange:(x,I)=>{f(I)},onChange:m,getOptionKey:x=>x.id,value:r,renderTags:w,renderOption:(x,I)=>{var S;return s.jsx(h.AutocompleteOption,Q(B({},x),{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(S=I.avatar)!=null?S:Le.avatar}),s.jsx(h.Typography,{children:I.label})]})}))}})}),s.jsx(Ge,{showToast:d,message:e.searchProfilesErrorMessage,color:"danger",hideToast:v})]})},Nm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Team with no name",label:t.name?t.name:"Team with no name",logo:((n=t.assets)==null?void 0:n.logo)||Le.team,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Le.flag}}))||[],zm=({labels:e,ids:t,scope:n,readOnly:r,AdditionalCheckbox:i,onChange:o})=>{const[a,l]=y.useState([]),[c,u]=y.useState([]),[f,d]=y.useState(!1),[p,g]=y.useState(""),[v,m]=y.useState(!1),{sdk:b}=We(),C=()=>m(!v),w=(A,E)=>{l(E),o(E)},x=3;y.useEffect(()=>{!p&&t&&t.length&&b.football.getTeams({teamIds:t,scope:n}).then(A=>{const E=A.data.filter(k=>!k.name.includes("/"));l(Nm(E))}).catch(A=>{console.error(A),C(),l([])})},[]);const I=y.useMemo(()=>cr((A,E)=>{d(!0),b.football.getTeams({name:A,scope:E}).then(k=>{const F=k.data.filter(W=>!W.name.includes("/"));u([...Nm(F)]),d(!1)}).catch(k=>{console.error(k),C(),u([]),d(!1)})},300),[]);y.useEffect(()=>{if(!p||p.length<x){u([]);return}return I(p,n),()=>I.cancel()},[p,I]);const S=(A,E)=>A.map((k,F)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:W=>E({index:F}).onClick(W),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(En,{option:k},`option_${k.id}`)},k.id));return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{marginBottom:"16px"},children:[s.jsx(h.Autocomplete,{readOnly:r||!1,forcePopupIcon:!1,multiple:!0,loading:f,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38,marginBottom:i?1:0}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:f?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:a.length>0?"":e.teamsSelectionPlaceholder,options:c,filterOptions:A=>A.filter(E=>!a.some(k=>k.value===E.value)),onInputChange:(A,E)=>{g(E)},onChange:w,getOptionKey:A=>A.id,value:a,renderTags:S,renderOption:(A,E)=>s.jsx(h.AutocompleteOption,Q(B({},A),{children:s.jsx(En,{option:E})}))}),i]}),s.jsx(Ge,{showToast:v,message:e.searchTeamsErrorMessage,color:"danger",hideToast:C})]})},t2=({checked:e,disabled:t,sx:n,onChange:r})=>{const i=n?B({},n):{ml:1};return s.jsx(h.Switch,{color:e?"success":"danger",checked:e,disabled:t,onChange:o=>r(o.target.checked),sx:Q(B({},i),{"--Switch-thumbSize":"16px","--Switch-trackWidth":"40px","--Switch-trackHeight":"24px","--Switch-trackBackground":"#EE5E52","&:hover":{"--Switch-trackBackground":"#EE5E52"},[`&.${h.switchClasses.checked}`]:{"--Switch-trackBackground":"#5CB176","&:hover":{"--Switch-trackBackground":"#5CB176"}}})})},pn=({label:e,labelPosition:t="start",defaultValue:n,description:r,disabled:i,descriptionColor:o,sx:a,onChange:l})=>{const c=s.jsx(t2,{checked:n,disabled:i,onChange:l,sx:a==null?void 0:a.switch}),u=a!=null&&a.container?B({},a.container):{mb:2},f=a!=null&&a.label?B({},a.label):{};return r?s.jsxs(h.Box,{sx:B({},u),children:[s.jsx(h.Typography,{component:"label",startDecorator:t=="start"?void 0:c,endDecorator:t=="start"?c:void 0,sx:f,children:e}),s.jsx(h.Typography,{level:"body-sm",color:o||"neutral",children:r})]}):s.jsx(h.Typography,{sx:Object.keys(f)?B({},f):{mb:2},component:"label",startDecorator:t=="start"?void 0:c,endDecorator:t=="start"?c:void 0,children:e})},n2={control:(e,t)=>Q(B({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px","&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(B({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(B({},e),{minHeight:"36px"}),menu:e=>Q(B({},e),{position:"relative"}),clearIndicator:e=>Q(B({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(B({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(B({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(B({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"13px"}),multiValueLabel:e=>Q(B({},e),{color:"#333"})},r2=e=>e.map(t=>({label:t,value:t})),jm=e=>{const[t,n]=y.useState(""),[r,i]=y.useState(!1),o=r2(e.tags),a=()=>i(!r),l=d=>{e.onChange(d.map(p=>p.value))},c=d=>{n(d)},u=d=>{d.persist();const{key:p}=d;if(t)switch(p){case"Enter":case"Tab":if(e.tags&&e.tags.length===0){const g=[...e.tags,t];e.onChange(g)}if(e.tags&&e.tags.length>0&&f()){const g=[...e.tags,t];e.onChange(g)}n(""),d.preventDefault()}},f=()=>{let d=!1;return e.tags&&e.tags.length&&e.tags.includes(t)?(a(),d):(d=!0,d)};return s.jsxs(s.Fragment,{children:[s.jsx(ym,{styles:n2,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:l,onInputChange:c,onKeyDown:u,placeholder:e.labels.tagsPlaceholder,value:o}),s.jsx(Ge,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:a})]})},i2=Be(s.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos");class Um{constructor(){J(this,"contestId","");J(this,"contestType","");J(this,"description","");J(this,"userList",[])}}const o2=(e,t,n)=>{const[r,i]=y.useState(null),{sdk:o}=We(),a=()=>_(this,null,function*(){try{let l;switch(t){case"top_x":l=yield o.topX.getGameWinners(e,!0);break;case"match_quiz":l=yield o.matchQuiz.getGameWinners(e,!0);break;default:l=yield o.loyalty.getTemplateWinners(e,!0)}l.userList&&l.userList.forEach(c=>{c.tags||(c.tags=[])}),i(l)}catch(l){const c=o.helpers.getSDKConfiguration();let u=null;c.errorHandlingMode==="standard"?u=l.error:u=l.data.error,u.code!==404&&u.status!=="code_unknown_contest"&&n(),i(new Um)}});return y.useEffect(()=>{a()},[]),r};class a2{constructor(){J(this,"position","");J(this,"profileId","");J(this,"note","");J(this,"tags",[])}}function s2(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var l2=s2,c2=Array.isArray,u2=c2,Vm=Iu,d2=l2,f2=u2,h2=Om,p2=1/0,Hm=Vm?Vm.prototype:void 0,Wm=Hm?Hm.toString:void 0;function Gm(e){if(typeof e=="string")return e;if(f2(e))return d2(e,Gm)+"";if(h2(e))return Wm?Wm.call(e):"";var t=e+"";return t=="0"&&1/e==-p2?"-0":t}var g2=Gm,m2=g2;function v2(e){return e==null?"":m2(e)}var Ym=v2;function b2(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}var y2=b2;function x2(e){return function(t){return e==null?void 0:e[t]}}var C2=x2,w2=C2,S2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},I2=w2(S2),A2=I2,T2=A2,E2=Ym,k2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_2="\\u0300-\\u036f",P2="\\ufe20-\\ufe2f",D2="\\u20d0-\\u20ff",O2=_2+P2+D2,R2="["+O2+"]",M2=RegExp(R2,"g");function L2(e){return e=E2(e),e&&e.replace(k2,T2).replace(M2,"")}var B2=L2,$2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function F2(e){return e.match($2)||[]}var N2=F2,z2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function j2(e){return z2.test(e)}var U2=j2,Km="\\ud800-\\udfff",V2="\\u0300-\\u036f",H2="\\ufe20-\\ufe2f",W2="\\u20d0-\\u20ff",G2=V2+H2+W2,qm="\\u2700-\\u27bf",Qm="a-z\\xdf-\\xf6\\xf8-\\xff",Y2="\\xac\\xb1\\xd7\\xf7",K2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",q2="\\u2000-\\u206f",Q2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Jm="A-Z\\xc0-\\xd6\\xd8-\\xde",J2="\\ufe0e\\ufe0f",Xm=Y2+K2+q2+Q2,Zm="['’]",ev="["+Xm+"]",X2="["+G2+"]",tv="\\d+",Z2="["+qm+"]",nv="["+Qm+"]",rv="[^"+Km+Xm+tv+qm+Qm+Jm+"]",eB="\\ud83c[\\udffb-\\udfff]",tB="(?:"+X2+"|"+eB+")",nB="[^"+Km+"]",iv="(?:\\ud83c[\\udde6-\\uddff]){2}",ov="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+Jm+"]",rB="\\u200d",av="(?:"+nv+"|"+rv+")",iB="(?:"+xi+"|"+rv+")",sv="(?:"+Zm+"(?:d|ll|m|re|s|t|ve))?",lv="(?:"+Zm+"(?:D|LL|M|RE|S|T|VE))?",cv=tB+"?",uv="["+J2+"]?",oB="(?:"+rB+"(?:"+[nB,iv,ov].join("|")+")"+uv+cv+")*",aB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",sB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lB=uv+cv+oB,cB="(?:"+[Z2,iv,ov].join("|")+")"+lB,uB=RegExp([xi+"?"+nv+"+"+sv+"(?="+[ev,xi,"$"].join("|")+")",iB+"+"+lv+"(?="+[ev,xi+av,"$"].join("|")+")",xi+"?"+av+"+"+sv,xi+"+"+lv,sB,aB,tv,cB].join("|"),"g");function dB(e){return e.match(uB)||[]}var fB=dB,hB=N2,pB=U2,gB=Ym,mB=fB;function vB(e,t,n){return e=gB(e),t=n?void 0:t,t===void 0?pB(e)?mB(e):hB(e):e.match(t)||[]}var bB=vB,yB=y2,xB=B2,CB=bB,wB="['’]",SB=RegExp(wB,"g");function IB(e){return function(t){return yB(CB(xB(t).replace(SB,"")),e,"")}}var AB=IB,TB=AB,EB=TB(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),kB=EB;const _B=bn(kB);class PB{constructor(){J(this,"id","");J(this,"value","");J(this,"label","")}}class DB extends PB{constructor(){super(...arguments);J(this,"logo","");J(this,"countryFlag","");J(this,"countryName","")}}class dv extends DB{constructor(){super(...arguments);J(this,"group","")}}const OB=(e,t)=>t||e||"-------------",Tu=(e,t)=>Array.isArray(e)?e.map(n=>Tu(n)):e!=null&&e.constructor===Object?Object.keys(e).reduce((n,r)=>Q(B({},n),{[_B(r)]:Tu(e[r])}),{}):e,fv=e=>{const t=[];return e.competitions.forEach(n=>{t.push(Eu(n,"competition"))}),e.teams.forEach(n=>{t.push(Eu(n,"team"))}),e.players.forEach(n=>{t.push(Eu(n,"player"))}),t},Eu=(e,t)=>{var r,i,o,a,l;const n=new dv;return n.label=e.name,n.value=e.id,n.id=e.id,n.group=t,t==="player"?n.logo=((r=e.assets)==null?void 0:r.headshot)||Le.avatar:t==="team"?n.logo=((i=e.assets)==null?void 0:i.logo)||Le.team:n.logo=((o=e.assets)==null?void 0:o.logo)||Le.competition,n.countryName=e.country.name,n.countryFlag=((l=(a=e.country)==null?void 0:a.assets)==null?void 0:l.flag)||Le.country,n},RB=e=>{switch(e){case"CLASSIC_QUIZ":return"success";case"EITHER_OR":return"success";case"POLL":return"warning";case"TOP_X":return"primary";case"MATCH_QUIZ":return"primary";case"LEADERBOARD_TEMPLATES":return"neutral";default:return"neutral"}},MB=e=>{switch(e){case"CLASSIC_QUIZ":return"CLASSIC QUIZ";case"EITHER_OR":return"EITHER/OR";case"POLL":return"POLL";case"TOP_X":return"TOP X";case"MATCH_QUIZ":return"MATCH QUIZ";case"LEADERBOARD_TEMPLATES":return"LEADERBOARD TEMPLATES"}},LB=({profile:e,winner:t,labels:n,onChange:r,onRemove:i})=>{var b,C,w,x,I,S;const[o,a]=y.useState(t.position),[l,c]=y.useState(t.note),[u,f]=y.useState(t.tags),d=o||l||u.length>0,p=A=>{A.persist();const{value:E}=A.target;a(E),r("position",E)},g=A=>{A.persist();const{value:E}=A.target;c(E),r("note",E)},v=A=>{f(A),r("tags",A)},m=()=>{a(""),c(""),f([]),i()};return s.jsxs("tr",{style:{backgroundColor:d?"rgb(255 237 213)":""},children:[s.jsx("td",{children:s.jsx(h.Input,{name:"position",placeholder:"#",value:o,onChange:p,sx:{backgroundColor:"#fff"}})}),s.jsx("td",{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",children:[s.jsx(h.Avatar,{src:((b=e.profileModel)==null?void 0:b.avatar)||"",alt:((C=e.profileModel)==null?void 0:C.name)||"Unknown",sx:{mr:1}}),s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{fontWeight:"md",children:[OB((w=e.profileModel)==null?void 0:w.name,(x=e.profileModel)==null?void 0:x.nickname),"  ",(I=e.profileModel)!=null&&I.name?s.jsxs(h.Typography,{children:["(",(S=e.profileModel)==null?void 0:S.name,")"]}):s.jsx(s.Fragment,{})]}),s.jsx(h.Typography,{fontSize:"sm",sx:{opacity:"0.5"},children:e.profileModel&&e.profileModel.country?e.profileModel.country.name:""})]})]})}),s.jsx("td",{style:{textAlign:"center"},children:e.points}),s.jsx("td",{style:{textAlign:"center"},children:e.predictionsMade}),s.jsx("td",{children:s.jsx(h.Input,{name:"note",value:l,placeholder:"This user has...",onChange:g,sx:{backgroundColor:"#fff"}})}),s.jsx("td",{children:s.jsx(jm,{labels:n,tags:u,onChange:v})}),s.jsx("td",{children:s.jsx(h.Tooltip,{title:n.clearWinner,children:s.jsx(h.IconButton,{onClick:m,variant:"outlined",color:"danger",disabled:!d,children:s.jsx(_e.Remove,{})})})})]})},BB=e=>{const t=(i,o,a)=>{if(e.winners.find(f=>f.profileId===i)){const f=e.winners.map(d=>d.profileId===i?Q(B({},d),{[o]:a}):d);r(f);return}const c=new a2;c.profileId=i,c[o]=a;const u=[...e.winners,c];r(u)},n=i=>{const o=e.winners.filter(a=>a.profileId!==i);r(o)},r=i=>{e.setWinnersRequestBody(o=>Q(B({},o),{userList:i}))};return e.leaderboard?s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"h4",children:e.labels.configureWinners}),e.leaderboard.length===0?s.jsx(h.Typography,{level:"body-lg",textAlign:"center",fontWeight:"bold",children:e.labels.noStandingsAvailable}):s.jsx(s.Fragment,{}),s.jsxs(h.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:last-child, & > tbody > tr > td:last-child":{textAlign:"center",width:"50px"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"70px"},children:e.labels.position}),s.jsx("th",{children:e.labels.nicknameAndName}),s.jsx("th",{style:{width:"70px",textAlign:"center"},children:e.labels.points}),s.jsx("th",{style:{width:"100px",textAlign:"center"},children:e.labels.predictions}),s.jsx("th",{children:e.labels.note}),s.jsx("th",{children:e.labels.tags}),s.jsx("th",{children:e.labels.actions})]})}),s.jsxs("tbody",{children:[e.leaderboard.length>0?e.leaderboard.map(i=>s.jsx(LB,{winner:e.winners.find(o=>o.profileId===i.profileId)||{position:"",profileId:"",note:"",tags:[]},profile:i,labels:e.labels,onChange:(o,a)=>t(i.profileId,o,a),onRemove:()=>n(i.profileId)},`winner-profile-${i.profileId}`)):s.jsx(s.Fragment,{}),s.jsx("tr",{children:s.jsx("td",{colSpan:7,children:e.hasMoreParticipants?s.jsx(h.Box,{textAlign:"center",my:1,children:s.jsx(h.Button,{variant:"plain",sx:{width:"100%"},onClick:()=>e.setPage(i=>i+1),loading:e.isLoading,children:e.labels.loadMore})}):s.jsx(s.Fragment,{})})})]})]})]}):s.jsx(yi,{my:40})},$B=(e,t,n,r,i)=>{const[o,a]=y.useState(null),[l,c]=y.useState(!1),[u,f]=y.useState(!1),{sdk:d}=We(),p=()=>_(this,null,function*(){f(!0);const g={limit:10,page:r},v=!0;try{let m;t==="template"?m=yield d.loyalty.getLeaderboard(e,g,v):m=yield d.loyalty.getLeaderboardForGame(e,g,v),m.meta.pagination.numberOfPages>r?c(!0):c(!1),o&&o.length?a(b=>[...b,...m.data]):a(m.data)}catch(m){console.error(m),i("danger",n),a([])}f(!1)});return y.useEffect(()=>{p()},[r]),{leaderboard:o,hasMoreParticipants:l,isLeaderboardLoading:u}};class FB{constructor(){J(this,"isValid",!0);J(this,"message","");J(this,"validate",(t,n,r)=>(this.validateField(t,n),this.validateWinnerIds(t,r),this));J(this,"validateField",(t,n)=>{const r=t.every(i=>i.position&&i.profileId);r||(this.isValid=r,this.message=n)});J(this,"validateWinnerIds",(t,n)=>{const r=t.map(o=>o.profileId),i=new Set(r);r.length!==i.size&&(this.isValid=!1,this.message=n)})}}const NB=e=>{const t=e.winners.userList.length>0&&(e.winners.userList[0].position||e.winners.userList[0].profileId||e.winners.userList[0].note||e.winners.userList[0].tags.length);return s.jsx(h.Card,{variant:"plain",children:t?s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"body-lg",mb:2,fontWeight:"bold",children:e.labels.preview}),s.jsx(h.Sheet,{children:s.jsxs(h.Table,{sx:{"& > thead > tr > th:nth-of-type(n + 3), & > tbody > tr > td:nth-of-type(n + 3)":{textAlign:"right"},"& > thead > tr > th:nth-of-type(3), & > thead > tr > th:nth-of-type(4), & > tbody > tr > td:nth-of-type(3), & > tbody > tr > td:nth-of-type(4)":{fontSize:"sm",display:{xs:"none",md:"table-cell"}}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"3%"},children:"#"}),s.jsx("th",{children:e.labels.name}),s.jsx("th",{children:e.labels.note}),s.jsx("th",{children:e.labels.tags})]})}),s.jsx("tbody",{children:e.winners.userList.map(n=>{var i;const r=e.profiles.find(o=>o.id===n.profileId);return s.jsxs("tr",{children:[s.jsx("td",{children:n.position}),s.jsx("td",{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",justifyContent:{xs:"center",md:"flex-start"},gap:2,children:[s.jsx(h.Avatar,{src:(r==null?void 0:r.avatar)||"",alt:(r==null?void 0:r.name)||"Unknown"}),s.jsxs(h.Box,{textAlign:"left",children:[s.jsxs(h.Typography,{fontWeight:"bold",children:[(r==null?void 0:r.nickname)||"-------------"," ",s.jsxs(h.Typography,{children:["(",(r==null?void 0:r.name)||"-------------",")"]})]}),s.jsx(h.Typography,{fontSize:"sm",color:"neutral",children:(i=r==null?void 0:r.country)==null?void 0:i.name})]})]})}),s.jsx("td",{children:n.note}),s.jsx("td",{children:n.tags.map(o=>s.jsx(h.Chip,{variant:"soft",color:"neutral",size:"sm",sx:{mr:1},children:o},`preview-winner-${n.profileId}-tag-${o}`))})]},`preview-winner-${n.profileId}`)})})]})})]}):s.jsx(h.Typography,{textAlign:"center",fontWeight:"bold",children:e.labels.noSetWinnersMessage})})},zB=e=>Object.keys(e).length?(e.userList||(e.userList=[]),e):new Um,jB=e=>{var S;const[t,n]=y.useState(zB(e.winners)),[r,i]=y.useState(((S=e.winners)==null?void 0:S.description)||""),[o,a]=y.useState(!1),[l,c]=y.useState(1),[u,f]=y.useState(!1),[d,p]=y.useState("danger"),[g,v]=y.useState(""),m=(A,E)=>{p(A),v(E),f(!0)},{leaderboard:b,hasMoreParticipants:C,isLeaderboardLoading:w}=$B(e.entityId,e.entityType,e.labels.leaderboardErrorMessage,l,m),{https:x}=We(),I=()=>_(this,null,function*(){a(!0);const A=JSON.parse(JSON.stringify(t));if(A.contestId=e.entityId,A.contestType=e.entityType==="template"?"TEMPLATE":"GAME",A.description=r,delete A.contestModel,A.userList.length>0){const k=new FB().validate(A.userList,e.labels.positionAndWinnerRequiredMessage,e.labels.sameChosenWinnerMessage);if(!k.isValid){m("danger",k.message),a(!1);return}}else delete A.userList;const E=Tu(A);try{yield x.setWinners(E),m("success",Object.keys(e.winners).length?e.labels.editWinnersMessage:e.labels.createWinnersMessage)}catch(k){console.error(k),m("danger",Object.keys(e.winners).length?e.labels.editWinnersErrorMessage:e.labels.createWinnersErrorMessage)}a(!1)});return s.jsxs(s.Fragment,{children:[s.jsx("section",{style:{marginRight:"auto",marginLeft:"auto"},children:s.jsx(h.Box,{width:"100%",overflow:"hidden",borderRadius:"4px",bgcolor:"#fff",children:s.jsxs(h.Box,{width:"100%",sx:{overflowX:"auto"},children:[s.jsxs(h.Card,{variant:"plain",children:[s.jsx(wc,{property:"description",label:e.labels.description,defaultValue:r,placeholder:e.labels.winnersDescription,onChange:A=>{i(A)}}),s.jsx(BB,{winners:t.userList,leaderboard:b,hasMoreParticipants:C,isLoading:w,setPage:c,setWinnersRequestBody:n,labels:e.labels}),s.jsx(h.Box,{textAlign:"center",my:3,children:s.jsx(h.Button,{variant:"solid",color:"primary",onClick:I,loading:o,children:e.labels.save})}),s.jsx(h.Divider,{sx:{my:4}})]}),b?s.jsx(NB,{winners:t,profiles:b.map(A=>A.profileModel),labels:e.labels}):s.jsx(s.Fragment,{})]})})}),s.jsx(Ge,{showToast:u,color:d,message:g,hideToast:()=>f(!1)})]})},UB=e=>{const[t,n]=y.useState(!1),r=()=>n(!0),i=o2(e.entityId,e.entityType,r);return i?s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{p:2,children:[s.jsx(h.Typography,{fontSize:"12px",sx:{cursor:"pointer"},startDecorator:s.jsx(i2,{fontSize:"inherit"}),onClick:e.onClickBack,children:e.labels.back}),s.jsxs(h.Typography,{level:"h3",children:[e.labels.manageWinners,":"," ",s.jsx(h.Typography,{level:"title-lg",fontWeight:"italic",children:e.entityName})]})]}),s.jsx(jB,{labels:e.labels,winners:i,entityId:e.entityId,entityType:e.entityType}),s.jsx(Ge,{showToast:t,color:"danger",message:e.labels.winnersErrorMessage,hideToast:()=>n(!1)})]}):s.jsx(yi,{my:50})},VB=10,HB=e=>{var d;const[t,n]=y.useState([]),[r,i]=y.useState(!1),[o,a]=y.useState(""),{sdk:l}=We(),c=y.useMemo(()=>cr(p=>{if(!p){n([]),i(!1);return}i(!0),l.football.search({query:p}).then(g=>{n([...fv(g)]),i(!1)}).catch(g=>{console.error(g),n([]),i(!1)})},300),[]);y.useEffect(()=>(c(o),()=>c.cancel()),[o,c]);const u=(p,g)=>{const v=g.map(m=>m.id);e.setOptions(g),e.handleResetData(),e.setFilters(m=>Q(B({},m),{entityIds:v}))},f=(p,g)=>p.map((v,m)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:b=>g({index:m}).onClick(b),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(En,{option:v},`option_${v.id}`)},v.id));return s.jsxs(h.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{sx:{fontSize:12},color:"primary",children:e.labels.contextEntityTag}),s.jsx(h.Autocomplete,{getOptionDisabled:()=>e.options.length===VB,forcePopupIcon:!1,multiple:!0,loading:r,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(p,g)=>p.id===g.id,endDecorator:r?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.options.length>0?"":e.labels.typeContextTagNamePlaceholder,options:t,filterOptions:p=>p.filter(g=>!e.options.some(v=>v.value===g.value)),onInputChange:(p,g)=>{a(g)},onChange:u,getOptionKey:p=>p.id,groupBy:p=>p.group+"s",value:(d=e.options)!=null?d:[],renderTags:f,renderOption:(p,g)=>s.jsx(h.AutocompleteOption,Q(B({},p),{children:s.jsx(En,{option:g})}))})]})};function hv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Ao;(function(e){e.event="event",e.props="prop"})(Ao||(Ao={}));function ur(){}function WB(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(o,a){return o===t[a]})||(t=r,n=e.apply(void 0,r)),n}}function To(e){return!!(e||"").match(/\d/)}function Ci(e){return e==null}function GB(e){return typeof e=="number"&&isNaN(e)}function pv(e){return Ci(e)||GB(e)||typeof e=="number"&&!isFinite(e)}function gv(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function YB(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function KB(e,t,n){var r=YB(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function qB(e){var t=y.useRef(e);t.current=e;var n=y.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function ku(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],a=i[1]||"";return{beforeDecimal:o,afterDecimal:a,hasNegation:n,addNegation:r}}function QB(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function mv(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function vv(e,t){return Array(t+1).join(e)}function bv(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],o=r[1];if(o=Number(o),!o)return n+i;i=i.replace(".","");var a=1+o,l=i.length;return a<0?i="0."+vv("0",Math.abs(a))+i:a>=l?i=i+vv("0",a-l):i=(i.substring(0,a)||"0")+"."+i.substring(a),n+i}function yv(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=ku(e),o=i.beforeDecimal,a=i.afterDecimal,l=i.hasNegation,c=parseFloat("0."+(a||"0")),u=a.length<=t?"0."+a:c.toFixed(t),f=u.split("."),d=o;o&&Number(f[0])&&(d=o.split("").reverse().reduce(function(m,b,C){return m.length>C?(Number(m[0])+Number(b)).toString()+m.substring(1,m.length):b+m},f[0]));var p=mv(f[1]||"",t,n),g=l?"-":"",v=r?".":"";return""+g+d+v+p}function Rr(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var xv=WB(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),JB=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function XB(e,t,n){return Math.min(Math.max(e,t),n)}function _u(e){return Math.max(e.selectionStart,e.selectionEnd)}function ZB(){return typeof navigator!="undefined"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function e$(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function t$(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function n$(e,t,n,r,i,o,a){a===void 0&&(a=t$);var l=i.findIndex(function(I){return I}),c=e.slice(0,l);!t&&!n.startsWith(c)&&(t=c,n=c+n,r=r+c.length);for(var u=n.length,f=e.length,d={},p=new Array(u),g=0;g<u;g++){p[g]=-1;for(var v=0,m=f;v<m;v++){var b=a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:g,formattedValueIndex:v});if(b&&d[v]!==!0){p[g]=v,d[v]=!0;break}}}for(var C=r;C<u&&(p[C]===-1||!o(n[C]));)C++;var w=C===u||p[C]===-1?f:p[C];for(C=r-1;C>0&&p[C]===-1;)C--;var x=C===-1||p[C]===-1?0:p[C]+1;return x>w?w:r-x<w-r?x:w}function Cv(e,t,n,r){var i=e.length;if(t=XB(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function r$(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(To(e[n])||To(e[n-1]));return t}function wv(e,t,n,r,i,o){o===void 0&&(o=ur);var a=qB(function(v,m){var b,C;return pv(v)?(C="",b=""):typeof v=="number"||m?(C=typeof v=="number"?bv(v):v,b=r(C)):(C=i(v,void 0),b=r(C)),{formattedValue:b,numAsString:C}}),l=y.useState(function(){return a(Ci(e)?t:e,n)}),c=l[0],u=l[1],f=function(v,m){v.formattedValue!==c.formattedValue&&u({formattedValue:v.formattedValue,numAsString:v.value}),o(v,m)},d=e,p=n;Ci(e)&&(d=c.numAsString,p=!0);var g=a(d,p);return y.useMemo(function(){u(g)},[g.formattedValue]),[c,f]}function i$(e){return e.replace(/[^0-9]/g,"")}function o$(e){return e}function a$(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,o=e.getInputRef,a=e.format;a===void 0&&(a=o$);var l=e.removeFormatting;l===void 0&&(l=i$);var c=e.defaultValue,u=e.valueIsNumericString,f=e.onValueChange,d=e.isAllowed,p=e.onChange;p===void 0&&(p=ur);var g=e.onKeyDown;g===void 0&&(g=ur);var v=e.onMouseUp;v===void 0&&(v=ur);var m=e.onFocus;m===void 0&&(m=ur);var b=e.onBlur;b===void 0&&(b=ur);var C=e.value,w=e.getCaretBoundary;w===void 0&&(w=r$);var x=e.isValidInputCharacter;x===void 0&&(x=To);var I=e.isCharacterSame,S=hv(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=wv(C,c,!!u,a,l,f),E=A[0],k=E.formattedValue,F=E.numAsString,W=A[1],O=y.useRef(),T=y.useRef({formattedValue:k,numAsString:F}),N=function(he,ge){T.current={formattedValue:he.formattedValue,numAsString:he.value},W(he,ge)},H=y.useState(!1),j=H[0],$=H[1],M=y.useRef(null),V=y.useRef({setCaretTimeout:null,focusTimeout:null});y.useEffect(function(){return $(!0),function(){clearTimeout(V.current.setCaretTimeout),clearTimeout(V.current.focusTimeout)}},[]);var Y=a,X=function(he,ge){var xe=parseFloat(ge);return{formattedValue:he,value:ge,floatValue:isNaN(xe)?void 0:xe}},D=function(he,ge,xe){he.selectionStart===0&&he.selectionEnd===he.value.length||(Rr(he,ge),V.current.setCaretTimeout=setTimeout(function(){he.value===xe&&he.selectionStart!==ge&&Rr(he,ge)},0))},L=function(he,ge,xe){return Cv(he,ge,w(he),xe)},U=function(he,ge,xe){var ke=w(ge),Ye=n$(ge,k,he,xe,ke,x,I);return Ye=Cv(ge,Ye,ke),Ye},G=function(he){var ge=he.formattedValue;ge===void 0&&(ge="");var xe=he.input,ke=he.source,Ye=he.event,Oe=he.numAsString,Pe;if(xe){var St=he.inputValue||xe.value,It=_u(xe);xe.value=ge,Pe=U(St,ge,It),Pe!==void 0&&D(xe,Pe,ge)}ge!==k&&N(X(ge,Oe),{event:Ye,source:ke})};y.useEffect(function(){var he=T.current,ge=he.formattedValue,xe=he.numAsString;(k!==ge||F!==xe)&&N(X(k,F),{event:void 0,source:Ao.props})},[k,F]);var oe=M.current?_u(M.current):void 0,ce=typeof window!="undefined"?y.useLayoutEffect:y.useEffect;ce(function(){var he=M.current;if(k!==T.current.formattedValue&&he){var ge=U(T.current.formattedValue,k,oe);he.value=k,D(he,ge,k)}},[k]);var se=function(he,ge,xe){var ke=ge.target,Ye=O.current?JB(O.current,ke.selectionEnd):xv(k,he),Oe=Object.assign(Object.assign({},Ye),{lastValue:k}),Pe=l(he,Oe),St=Y(Pe);if(Pe=l(St,void 0),d&&!d(X(St,Pe))){var It=ge.target,Mt=_u(It),_t=U(he,k,Mt);return It.value=k,D(It,_t,k),!1}return G({formattedValue:St,numAsString:Pe,inputValue:he,event:ge,source:xe,input:ge.target}),!0},Z=function(he,ge){ge===void 0&&(ge=0);var xe=he.selectionStart,ke=he.selectionEnd;O.current={selectionStart:xe,selectionEnd:ke+ge}},te=function(he){var ge=he.target,xe=ge.value,ke=se(xe,he,Ao.event);ke&&p(he),O.current=void 0},ne=function(he){var ge=he.target,xe=he.key,ke=ge.selectionStart,Ye=ge.selectionEnd,Oe=ge.value;Oe===void 0&&(Oe="");var Pe;xe==="ArrowLeft"||xe==="Backspace"?Pe=Math.max(ke-1,0):xe==="ArrowRight"?Pe=Math.min(ke+1,Oe.length):xe==="Delete"&&(Pe=ke);var St=0;xe==="Delete"&&ke===Ye&&(St=1);var It=xe==="ArrowLeft"||xe==="ArrowRight";if(Pe===void 0||ke!==Ye&&!It){g(he),Z(ge,St);return}var Mt=Pe;if(It){var _t=xe==="ArrowLeft"?"left":"right";Mt=L(Oe,Pe,_t),Mt!==Pe&&he.preventDefault()}else xe==="Delete"&&!x(Oe[Pe])?Mt=L(Oe,Pe,"right"):xe==="Backspace"&&!x(Oe[Pe])&&(Mt=L(Oe,Pe,"left"));Mt!==Pe&&D(ge,Mt,Oe),g(he),Z(ge,St)},de=function(he){var ge=he.target,xe=function(){var ke=ge.selectionStart,Ye=ge.selectionEnd,Oe=ge.value;if(Oe===void 0&&(Oe=""),ke===Ye){var Pe=L(Oe,ke);Pe!==ke&&D(ge,Pe,Oe)}};xe(),requestAnimationFrame(function(){xe()}),v(he),Z(ge)},ve=function(he){he.persist&&he.persist();var ge=he.target,xe=he.currentTarget;M.current=ge,V.current.focusTimeout=setTimeout(function(){var ke=ge.selectionStart,Ye=ge.selectionEnd,Oe=ge.value;Oe===void 0&&(Oe="");var Pe=L(Oe,ke);Pe!==ke&&!(ke===0&&Ye===Oe.length)&&D(ge,Pe,Oe),m(Object.assign(Object.assign({},he),{currentTarget:xe}))},0)},Fe=function(he){M.current=null,clearTimeout(V.current.focusTimeout),clearTimeout(V.current.setCaretTimeout),b(he)},st=j&&ZB()?"numeric":void 0,Je=Object.assign({inputMode:st},S,{type:t,value:k,onChange:te,onKeyDown:ne,onMouseUp:de,onFocus:ve,onBlur:Fe});if(n==="text")return i?y.createElement(y.Fragment,null,i(k,S)||null):y.createElement("span",Object.assign({},S,{ref:o}),k);if(r){var vt=r;return y.createElement(vt,Object.assign({},Je,{ref:o}))}return y.createElement("input",Object.assign({},Je,{ref:o}))}function Sv(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var a=t.allowNegative,l=t.thousandsGroupStyle;if(l===void 0&&(l="thousand"),e===""||e==="-")return e;var c=Ts(t),u=c.thousandSeparator,f=c.decimalSeparator,d=n!==0&&e.indexOf(".")!==-1||n&&r,p=ku(e,a),g=p.beforeDecimal,v=p.afterDecimal,m=p.addNegation;return n!==void 0&&(v=mv(v,n,!!r)),u&&(g=KB(g,u,l)),i&&(g=i+g),o&&(v=v+o),m&&(g="-"+g),e=g+(d&&f||"")+v,e}function Ts(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function s$(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function l$(e,t){return new RegExp("(^-)|[0-9]|"+gv(e),"g")}function c$(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function u$(e,t,n){var r;t===void 0&&(t=e$(e));var i=n.allowNegative,o=n.prefix;o===void 0&&(o="");var a=n.suffix;a===void 0&&(a="");var l=n.decimalScale,c=t.from,u=t.to,f=u.start,d=u.end,p=Ts(n),g=p.allowedDecimalSeparators,v=p.decimalSeparator,m=e[d]===v;if(To(e)&&(e===o||e===a)&&t.lastValue==="")return e;if(d-f===1&&g.indexOf(e[f])!==-1){var b=l===0?"":v;e=e.substring(0,f)+b+e.substring(f+1,e.length)}var C=function(M,V,Y){var X=!1,D=!1;o.startsWith("-")?X=!1:M.startsWith("--")?(X=!1,D=!0):a.startsWith("-")&&M.length===a.length?X=!1:M[0]==="-"&&(X=!0);var L=X?1:0;return D&&(L=2),L&&(M=M.substring(L),V-=L,Y-=L),{value:M,start:V,end:Y,hasNegation:X}},w=C(e,f,d),x=w.hasNegation;r=w,e=r.value,f=r.start,d=r.end;var I=C(t.lastValue,c.start,c.end),S=I.start,A=I.end,E=I.value,k=e.substring(f,d);e.length&&E.length&&(S>E.length-a.length||A<o.length)&&!(k&&a.startsWith(k))&&(e=E);var F=0;e.startsWith(o)?F+=o.length:f<o.length&&(F=f),e=e.substring(F),d-=F;var W=e.length,O=e.length-a.length;e.endsWith(a)?W=O:(d>O||d>e.length-a.length)&&(W=d),e=e.substring(0,W),e=s$(x?"-"+e:e,i),e=(e.match(l$(v))||[]).join("");var T=e.indexOf(v);e=e.replace(new RegExp(gv(v),"g"),function(M,V){return V===T?".":""});var N=ku(e,i),H=N.beforeDecimal,j=N.afterDecimal,$=N.addNegation;return u.end-u.start<c.end-c.start&&H===""&&m&&!parseFloat(j)&&(e=$?"-":""),e}function d$(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,n.length+(o?1:0));var a=e.length;return i.fill(!1,a-r.length+1,a+1),i}function f$(e){var t=Ts(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
2463
+ `]))),gO=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,a=o.colors,l=o.spacing.baseUnit;return be({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:l*2})},du=function(t){var n=t.delay,r=t.offset;return me.jsx("span",{css:me.css({animation:"".concat(pO," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},mO=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,a=Tn(t,aO);return me.jsx("div",R({},at(be(be({},a),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),me.jsx(du,{delay:0,offset:r}),me.jsx(du,{delay:160,offset:!0}),me.jsx(du,{delay:320,offset:!r}))},vO=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,a=o.colors,l=o.borderRadius,c=o.spacing;return be({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},bO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,a=t.innerProps,l=t.menuIsOpen;return me.jsx("div",R({ref:o},at(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":l}),a,{"aria-disabled":r||void 0}),n)},yO=bO,xO=["data"],CO=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},wO=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,a=t.Heading,l=t.headingProps,c=t.innerProps,u=t.label,f=t.theme,d=t.selectProps;return me.jsx("div",R({},at(t,"group",{group:!0}),c),me.jsx(a,R({},l,{selectProps:d,theme:f,getStyles:i,getClassNames:o,cx:r}),u),me.jsx("div",null,n))},SO=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return be({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},IO=function(t){var n=Og(t);n.data;var r=Tn(n,xO);return me.jsx("div",R({},at(t,"groupHeading",{"group-heading":!0}),r))},AO=wO,TO=["innerRef","isDisabled","isHidden","inputClassName"],EO=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,a=o.spacing,l=o.colors;return be(be({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},kO),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:l.neutral80})},Hg={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},kO={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":be({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Hg)},_O=function(t){return be({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Hg)},PO=function(t){var n=t.cx,r=t.value,i=Og(t),o=i.innerRef,a=i.isDisabled,l=i.isHidden,c=i.inputClassName,u=Tn(i,TO);return me.jsx("div",R({},at(t,"input",{"input-container":!0}),{"data-value":r||""}),me.jsx("input",R({className:n({input:!0},c),ref:o,style:_O(l),disabled:a},u)))},DO=PO,OO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return be({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},RO=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,a=t.cropWithEllipsis;return be({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},MO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors,l=t.isFocused;return be({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:l?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Wg=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",r,n)},LO=Wg,BO=Wg;function $O(e){var t=e.children,n=e.innerProps;return me.jsx("div",R({role:"button"},n),t||me.jsx(uu,{size:14}))}var FO=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,a=t.isDisabled,l=t.removeProps,c=t.selectProps,u=r.Container,f=r.Label,d=r.Remove;return me.jsx(u,{data:i,innerProps:be(be({},at(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:c},me.jsx(f,{data:i,innerProps:be({},at(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),me.jsx(d,{data:i,innerProps:be(be({},at(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},l),selectProps:c}))},NO=FO,zO=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.theme,l=a.spacing,c=a.colors;return be({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?c.primary:i?c.primary25:"transparent",color:r?c.neutral20:o?c.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?c.primary:c.primary50}})},jO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.innerRef,l=t.innerProps;return me.jsx("div",R({},at(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},l),n)},UO=jO,VO=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return be({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},HO=function(t){var n=t.children,r=t.innerProps;return me.jsx("div",R({},at(t,"placeholder",{placeholder:!0}),r),n)},WO=HO,GO=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,a=i.colors;return be({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},YO=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return me.jsx("div",R({},at(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},KO=YO,qO={ClearIndicator:dO,Control:yO,DropdownIndicator:cO,DownChevron:Ug,CrossIcon:uu,Group:AO,GroupHeading:IO,IndicatorsContainer:iO,IndicatorSeparator:hO,Input:DO,LoadingIndicator:mO,Menu:HD,MenuList:GD,MenuPortal:XD,LoadingMessage:QD,NoOptionsMessage:qD,MultiValue:NO,MultiValueContainer:LO,MultiValueLabel:BO,MultiValueRemove:$O,Option:UO,Placeholder:WO,SelectContainer:eO,SingleValue:KO,ValueContainer:nO},QO=function(t){return be(be({},qO),t.components)},Gg=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function JO(e,t){return!!(e===t||Gg(e)&&Gg(t))}function XO(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!JO(e[n],t[n]))return!1;return!0}function ZO(e,t){t===void 0&&(t=XO);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}for(var eR={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"},tR=function(t){return me.jsx("span",R({css:eR},t))},Yg=tR,nR={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){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(i?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" 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(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,a=o===void 0?"":o,l=t.selectValue,c=t.isDisabled,u=t.isSelected,f=t.isAppleDevice,d=function(m,b){return m&&m.length?"".concat(m.indexOf(b)+1," of ").concat(m.length):""};if(n==="value"&&l)return"value ".concat(a," focused, ").concat(d(l,r),".");if(n==="menu"&&f){var p=c?" disabled":"",g="".concat(u?" selected":"").concat(p);return"".concat(a).concat(g,", ").concat(d(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},rR=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,a=t.isFocused,l=t.selectValue,c=t.selectProps,u=t.id,f=t.isAppleDevice,d=c.ariaLiveMessages,p=c.getOptionLabel,g=c.inputValue,v=c.isMulti,m=c.isOptionDisabled,b=c.isSearchable,C=c.menuIsOpen,w=c.options,x=c.screenReaderStatus,I=c.tabSelectsValue,S=c.isLoading,A=c["aria-label"],E=c["aria-live"],k=y.useMemo(function(){return be(be({},nR),d||{})},[d]),F=y.useMemo(function(){var j="";if(n&&k.onChange){var $=n.option,M=n.options,V=n.removedValue,Y=n.removedValues,X=n.value,D=function(Z){return Array.isArray(Z)?null:Z},L=V||$||D(X),U=L?p(L):"",G=M||Y||void 0,oe=G?G.map(p):[],ce=be({isDisabled:L&&m(L,l),label:U,labels:oe},n);j=k.onChange(ce)}return j},[n,k,m,l,p]),W=y.useMemo(function(){var j="",$=r||i,M=!!(r&&l&&l.includes(r));if($&&k.onFocus){var V={focused:$,label:p($),isDisabled:m($,l),isSelected:M,options:o,context:$===r?"menu":"value",selectValue:l,isAppleDevice:f};j=k.onFocus(V)}return j},[r,i,p,m,k,o,l,f]),O=y.useMemo(function(){var j="";if(C&&w.length&&!S&&k.onFilter){var $=x({count:o.length});j=k.onFilter({inputValue:g,resultsMessage:$})}return j},[o,g,C,k,w,x,S]),T=(n==null?void 0:n.action)==="initial-input-focus",N=y.useMemo(function(){var j="";if(k.guidance){var $=i?"value":C?"menu":"input";j=k.guidance({"aria-label":A,context:$,isDisabled:r&&m(r,l),isMulti:v,isSearchable:b,tabSelectsValue:I,isInitialFocus:T})}return j},[A,r,i,v,m,b,C,k,l,I,T]),H=me.jsx(y.Fragment,null,me.jsx("span",{id:"aria-selection"},F),me.jsx("span",{id:"aria-focused"},W),me.jsx("span",{id:"aria-results"},O),me.jsx("span",{id:"aria-guidance"},N));return me.jsx(y.Fragment,null,me.jsx(Yg,{id:u},T&&H),me.jsx(Yg,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!T&&H))},iR=rR,fu=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],oR=new RegExp("["+fu.map(function(e){return e.letters}).join("")+"]","g"),Kg={},hu=0;hu<fu.length;hu++)for(var pu=fu[hu],gu=0;gu<pu.letters.length;gu++)Kg[pu.letters[gu]]=pu.base;var qg=function(t){return t.replace(oR,function(n){return Kg[n]})},aR=ZO(qg),Qg=function(t){return t.replace(/^\s+|\s+$/g,"")},sR=function(t){return"".concat(t.label," ").concat(t.value)},lR=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=be({ignoreCase:!0,ignoreAccents:!0,stringify:sR,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,a=i.ignoreAccents,l=i.stringify,c=i.trim,u=i.matchFrom,f=c?Qg(r):r,d=c?Qg(l(n)):l(n);return o&&(f=f.toLowerCase(),d=d.toLowerCase()),a&&(f=aR(f),d=qg(d)),u==="start"?d.substr(0,f.length)===f:d.indexOf(f)>-1}},cR=["innerRef"];function uR(e){var t=e.innerRef,n=Tn(e,cR),r=BD(n,"onExited","in","enter","exit","appear");return me.jsx("input",R({ref:t},r,{css:me.css({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 dR=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function fR(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,a=y.useRef(!1),l=y.useRef(!1),c=y.useRef(0),u=y.useRef(null),f=y.useCallback(function(b,C){if(u.current!==null){var w=u.current,x=w.scrollTop,I=w.scrollHeight,S=w.clientHeight,A=u.current,E=C>0,k=I-S-x,F=!1;k>C&&a.current&&(r&&r(b),a.current=!1),E&&l.current&&(o&&o(b),l.current=!1),E&&C>k?(n&&!a.current&&n(b),A.scrollTop=I,F=!0,a.current=!0):!E&&-C>x&&(i&&!l.current&&i(b),A.scrollTop=0,F=!0,l.current=!0),F&&dR(b)}},[n,r,i,o]),d=y.useCallback(function(b){f(b,b.deltaY)},[f]),p=y.useCallback(function(b){c.current=b.changedTouches[0].clientY},[]),g=y.useCallback(function(b){var C=c.current-b.changedTouches[0].clientY;f(b,C)},[f]),v=y.useCallback(function(b){if(b){var C=RD?{passive:!1}:!1;b.addEventListener("wheel",d,C),b.addEventListener("touchstart",p,C),b.addEventListener("touchmove",g,C)}},[g,p,d]),m=y.useCallback(function(b){b&&(b.removeEventListener("wheel",d,!1),b.removeEventListener("touchstart",p,!1),b.removeEventListener("touchmove",g,!1))},[g,p,d]);return y.useEffect(function(){if(t){var b=u.current;return v(b),function(){m(b)}}},[t,v,m]),function(b){u.current=b}}var Jg=["boxSizing","height","overflow","paddingRight","position"],Xg={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Zg(e){e.preventDefault()}function em(e){e.stopPropagation()}function tm(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function nm(){return"ontouchstart"in window||navigator.maxTouchPoints}var rm=!!(typeof window!="undefined"&&window.document&&window.document.createElement),wo=0,mi={capture:!1,passive:!1};function hR(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=y.useRef({}),o=y.useRef(null),a=y.useCallback(function(c){if(rm){var u=document.body,f=u&&u.style;if(r&&Jg.forEach(function(v){var m=f&&f[v];i.current[v]=m}),r&&wo<1){var d=parseInt(i.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,g=window.innerWidth-p+d||0;Object.keys(Xg).forEach(function(v){var m=Xg[v];f&&(f[v]=m)}),f&&(f.paddingRight="".concat(g,"px"))}u&&nm()&&(u.addEventListener("touchmove",Zg,mi),c&&(c.addEventListener("touchstart",tm,mi),c.addEventListener("touchmove",em,mi))),wo+=1}},[r]),l=y.useCallback(function(c){if(rm){var u=document.body,f=u&&u.style;wo=Math.max(wo-1,0),r&&wo<1&&Jg.forEach(function(d){var p=i.current[d];f&&(f[d]=p)}),u&&nm()&&(u.removeEventListener("touchmove",Zg,mi),c&&(c.removeEventListener("touchstart",tm,mi),c.removeEventListener("touchmove",em,mi)))}},[r]);return y.useEffect(function(){if(t){var c=o.current;return a(c),function(){l(c)}}},[t,a,l]),function(c){o.current=c}}var pR=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},gR={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function mR(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,a=e.onBottomLeave,l=e.onTopArrive,c=e.onTopLeave,u=fR({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:l,onTopLeave:c}),f=hR({isEnabled:n}),d=function(g){u(g),f(g)};return me.jsx(y.Fragment,null,n&&me.jsx("div",{onClick:pR,css:gR}),t(d))}var vR={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},bR=function(t){var n=t.name,r=t.onFocus;return me.jsx("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:vR,value:"",onChange:function(){}})},yR=bR;function mu(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function xR(){return mu(/^iPhone/i)}function im(){return mu(/^Mac/i)}function CR(){return mu(/^iPad/i)||im()&&navigator.maxTouchPoints>1}function wR(){return xR()||CR()}function SR(){return im()||wR()}var IR=function(t){return t.label},om=function(t){return t.label},am=function(t){return t.value},AR=function(t){return!!t.isDisabled},TR={clearIndicator:uO,container:ZD,control:vO,dropdownIndicator:lO,group:CO,groupHeading:SO,indicatorsContainer:rO,indicatorSeparator:fO,input:EO,loadingIndicator:gO,loadingMessage:KD,menu:jD,menuList:WD,menuPortal:JD,multiValue:OO,multiValueLabel:RO,multiValueRemove:MO,noOptionsMessage:YD,option:zO,placeholder:VO,singleValue:GO,valueContainer:tO},ER={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%)"},kR=4,sm=4,_R=38,PR=sm*2,DR={baseUnit:sm,controlHeight:_R,menuGutter:PR},vu={borderRadius:kR,colors:ER,spacing:DR},OR={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Lg(),captureMenuScroll:!Lg(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:lR(),formatGroupLabel:IR,getOptionLabel:om,getOptionValue:am,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:AR,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!DD(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function lm(e,t,n,r){var i=hm(e,t,n),o=pm(e,t,n),a=fm(e,t),l=Ss(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:a,value:l,index:r}}function ws(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(a,l){return lm(e,a,t,l)}).filter(function(a){return dm(e,a)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=lm(e,n,t,r);return dm(e,o)?o:void 0}).filter(MD)}function cm(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,gi(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function um(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,gi(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function RR(e,t){return cm(ws(e,t))}function dm(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,a=t.label,l=t.value;return(!mm(e)||!o)&&gm(e,{label:a,value:l,data:i},r)}function MR(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function LR(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var bu=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},fm=function(t,n){return t.getOptionLabel(n)},Ss=function(t,n){return t.getOptionValue(n)};function hm(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function pm(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=Ss(e,t);return n.some(function(i){return Ss(e,i)===r})}function gm(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var mm=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},BR=1,vm=function(e){hD(n,e);var t=mD(n);function n(r){var i;if(dD(this,n),i=t.call(this,r),i.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:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=SR(),i.controlRef=null,i.getControlRef=function(c){i.controlRef=c},i.focusedOptionRef=null,i.getFocusedOptionRef=function(c){i.focusedOptionRef=c},i.menuListRef=null,i.getMenuListRef=function(c){i.menuListRef=c},i.inputRef=null,i.getInputRef=function(c){i.inputRef=c},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(c,u){var f=i.props,d=f.onChange,p=f.name;u.name=p,i.ariaOnChange(c,u),d(c,u)},i.setValue=function(c,u,f){var d=i.props,p=d.closeMenuOnSelect,g=d.isMulti,v=d.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:v}),p&&(i.setState({inputIsHiddenAfterUpdate:!g}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(c,{action:u,option:f})},i.selectOption=function(c){var u=i.props,f=u.blurInputOnSelect,d=u.isMulti,p=u.name,g=i.state.selectValue,v=d&&i.isOptionSelected(c,g),m=i.isOptionDisabled(c,g);if(v){var b=i.getOptionValue(c);i.setValue(g.filter(function(C){return i.getOptionValue(C)!==b}),"deselect-option",c)}else if(!m)d?i.setValue([].concat(gi(g),[c]),"select-option",c):i.setValue(c,"select-option");else{i.ariaOnChange(c,{action:"select-option",option:c,name:p});return}f&&i.blurInput()},i.removeValue=function(c){var u=i.props.isMulti,f=i.state.selectValue,d=i.getOptionValue(c),p=f.filter(function(v){return i.getOptionValue(v)!==d}),g=Co(u,p,p[0]||null);i.onChange(g,{action:"remove-value",removedValue:c}),i.focusInput()},i.clearValue=function(){var c=i.state.selectValue;i.onChange(Co(i.props.isMulti,[],null),{action:"clear",removedValues:c})},i.popValue=function(){var c=i.props.isMulti,u=i.state.selectValue,f=u[u.length-1],d=u.slice(0,u.length-1),p=Co(c,d,d[0]||null);i.onChange(p,{action:"pop-value",removedValue:f})},i.getFocusedOptionId=function(c){return bu(i.state.focusableOptionsWithIds,c)},i.getFocusableOptionsWithIds=function(){return um(ws(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];return TD.apply(void 0,[i.props.classNamePrefix].concat(u))},i.getOptionLabel=function(c){return fm(i.props,c)},i.getOptionValue=function(c){return Ss(i.props,c)},i.getStyles=function(c,u){var f=i.props.unstyled,d=TR[c](u,f);d.boxSizing="border-box";var p=i.props.styles[c];return p?p(d,u):d},i.getClassNames=function(c,u){var f,d;return(f=(d=i.props.classNames)[c])===null||f===void 0?void 0:f.call(d,u)},i.getElementId=function(c){return"".concat(i.state.instancePrefix,"-").concat(c)},i.getComponents=function(){return QO(i.props)},i.buildCategorizedOptions=function(){return ws(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return cm(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(c,u){i.setState({ariaSelection:be({value:c},u)})},i.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(c){i.blockOptionHover=!1},i.onControlMouseDown=function(c){if(!c.defaultPrevented){var u=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&i.onMenuClose():u&&i.openMenu("first"):(u&&(i.openAfterFocus=!0),i.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},i.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!i.props.isDisabled){var u=i.props,f=u.isMulti,d=u.menuIsOpen;i.focusInput(),d?(i.setState({inputIsHiddenAfterUpdate:!f}),i.onMenuClose()):i.openMenu("first"),c.preventDefault()}},i.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(i.clearValue(),c.preventDefault(),i.openAfterFocus=!1,c.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(c){typeof i.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&bs(c.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(c)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(c){var u=c.touches,f=u&&u.item(0);f&&(i.initialTouchX=f.clientX,i.initialTouchY=f.clientY,i.userIsDragging=!1)},i.onTouchMove=function(c){var u=c.touches,f=u&&u.item(0);if(f){var d=Math.abs(f.clientX-i.initialTouchX),p=Math.abs(f.clientY-i.initialTouchY),g=5;i.userIsDragging=d>g||p>g}},i.onTouchEnd=function(c){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(c.target)&&i.menuListRef&&!i.menuListRef.contains(c.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(c){i.userIsDragging||i.onControlMouseDown(c)},i.onClearIndicatorTouchEnd=function(c){i.userIsDragging||i.onClearIndicatorMouseDown(c)},i.onDropdownIndicatorTouchEnd=function(c){i.userIsDragging||i.onDropdownIndicatorMouseDown(c)},i.handleInputChange=function(c){var u=i.props.inputValue,f=c.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(f,{action:"input-change",prevInputValue:u}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(c){i.props.onFocus&&i.props.onFocus(c),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(c){var u=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(c),i.onInputChange("",{action:"input-blur",prevInputValue:u}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(c){if(!(i.blockOptionHover||i.state.focusedOption===c)){var u=i.getFocusableOptions(),f=u.indexOf(c);i.setState({focusedOption:c,focusedOptionId:f>-1?i.getFocusedOptionId(c):null})}},i.shouldHideSelectedOptions=function(){return mm(i.props)},i.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),i.focus()},i.onKeyDown=function(c){var u=i.props,f=u.isMulti,d=u.backspaceRemovesValue,p=u.escapeClearsValue,g=u.inputValue,v=u.isClearable,m=u.isDisabled,b=u.menuIsOpen,C=u.onKeyDown,w=u.tabSelectsValue,x=u.openMenuOnFocus,I=i.state,S=I.focusedOption,A=I.focusedValue,E=I.selectValue;if(!m&&!(typeof C=="function"&&(C(c),c.defaultPrevented))){switch(i.blockOptionHover=!0,c.key){case"ArrowLeft":if(!f||g)return;i.focusValue("previous");break;case"ArrowRight":if(!f||g)return;i.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(A)i.removeValue(A);else{if(!d)return;f?i.popValue():v&&i.clearValue()}break;case"Tab":if(i.isComposing||c.shiftKey||!b||!w||!S||x&&i.isOptionSelected(S,E))return;i.selectOption(S);break;case"Enter":if(c.keyCode===229)break;if(b){if(!S||i.isComposing)return;i.selectOption(S);break}return;case"Escape":b?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:g}),i.onMenuClose()):v&&p&&i.clearValue();break;case" ":if(g)return;if(!b){i.openMenu("first");break}if(!S)return;i.selectOption(S);break;case"ArrowUp":b?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":b?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!b)return;i.focusOption("pageup");break;case"PageDown":if(!b)return;i.focusOption("pagedown");break;case"Home":if(!b)return;i.focusOption("first");break;case"End":if(!b)return;i.focusOption("last");break;default:return}c.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++BR),i.state.selectValue=vs(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),l=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[l],i.state.focusedOptionId=bu(o,a[l])}return i}return fD(n,[{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&&Mg(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,l=o.menuIsOpen,c=this.state.isFocused;(c&&!a&&i.isDisabled||c&&l&&!i.menuIsOpen)&&this.focusInput(),c&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Mg(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(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,a=this.state,l=a.selectValue,c=a.isFocused,u=this.buildFocusableOptions(),f=i==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(l[0]);d>-1&&(f=d)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[f],focusedOptionId:this.getFocusedOptionId(u[f])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,l=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=a.indexOf(l);l||(c=-1);var u=a.length-1,f=-1;if(a.length){switch(i){case"previous":c===0?f=0:c===-1?f=u:f=c-1;break;case"next":c>-1&&c<u&&(f=c+1);break}this.setState({inputIsHidden:f!==-1,focusedValue:a[f]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var c=0,u=l.indexOf(a);a||(u=-1),i==="up"?c=u>0?u-1:l.length-1:i==="down"?c=(u+1)%l.length:i==="pageup"?(c=u-o,c<0&&(c=0)):i==="pagedown"?(c=u+o,c>l.length-1&&(c=l.length-1)):i==="last"&&(c=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(vu):be(be({},vu),this.props.theme):vu}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,l=this.getClassNames,c=this.getValue,u=this.selectOption,f=this.setValue,d=this.props,p=d.isMulti,g=d.isRtl,v=d.options,m=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:l,getValue:c,hasValue:m,isMulti:p,isRtl:g,options:v,selectOption:u,selectProps:d,setValue:f,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return hm(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return pm(this.props,i,o)}},{key:"filterOption",value:function(i,o){return gm(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:l})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{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 i=this.props,o=i.isDisabled,a=i.isSearchable,l=i.inputId,c=i.inputValue,u=i.tabIndex,f=i.form,d=i.menuIsOpen,p=i.required,g=this.getComponents(),v=g.Input,m=this.state,b=m.inputIsHidden,C=m.ariaSelection,w=this.commonProps,x=l||this.getElementId("input"),I=be(be(be({"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":p,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(C==null?void 0:C.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?K.createElement(v,R({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:f,type:"text",value:c},I)):K.createElement(uR,R({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:ms,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:f,value:""},I))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,l=o.MultiValueContainer,c=o.MultiValueLabel,u=o.MultiValueRemove,f=o.SingleValue,d=o.Placeholder,p=this.commonProps,g=this.props,v=g.controlShouldRenderValue,m=g.isDisabled,b=g.isMulti,C=g.inputValue,w=g.placeholder,x=this.state,I=x.selectValue,S=x.focusedValue,A=x.isFocused;if(!this.hasValue()||!v)return C?null:K.createElement(d,R({},p,{key:"placeholder",isDisabled:m,isFocused:A,innerProps:{id:this.getElementId("placeholder")}}),w);if(b)return I.map(function(k,F){var W=k===S,O="".concat(i.getOptionLabel(k),"-").concat(i.getOptionValue(k));return K.createElement(a,R({},p,{components:{Container:l,Label:c,Remove:u},isFocused:W,isDisabled:m,key:O,index:F,removeProps:{onClick:function(){return i.removeValue(k)},onTouchEnd:function(){return i.removeValue(k)},onMouseDown:function(N){N.preventDefault()}},data:k}),i.formatOptionLabel(k,"value"))});if(C)return null;var E=I[0];return K.createElement(f,R({},p,{data:E,isDisabled:m}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,f=this.state.isFocused;if(!this.isClearable()||!o||c||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:d,isFocused:f}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,l=this.props,c=l.isDisabled,u=l.isLoading,f=this.state.isFocused;if(!o||!u)return null;var d={"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:d,isDisabled:c,isFocused:f}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var l=this.commonProps,c=this.props.isDisabled,u=this.state.isFocused;return K.createElement(a,R({},l,{isDisabled:c,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return K.createElement(o,R({},a,{innerProps:u,isDisabled:l,isFocused:c}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,l=o.GroupHeading,c=o.Menu,u=o.MenuList,f=o.MenuPortal,d=o.LoadingMessage,p=o.NoOptionsMessage,g=o.Option,v=this.commonProps,m=this.state.focusedOption,b=this.props,C=b.captureMenuScroll,w=b.inputValue,x=b.isLoading,I=b.loadingMessage,S=b.minMenuHeight,A=b.maxMenuHeight,E=b.menuIsOpen,k=b.menuPlacement,F=b.menuPosition,W=b.menuPortalTarget,O=b.menuShouldBlockScroll,T=b.menuShouldScrollIntoView,N=b.noOptionsMessage,H=b.onMenuScrollToTop,j=b.onMenuScrollToBottom;if(!E)return null;var $=function(U,G){var oe=U.type,ce=U.data,se=U.isDisabled,Z=U.isSelected,te=U.label,ne=U.value,de=m===ce,ve=se?void 0:function(){return i.onOptionHover(ce)},Fe=se?void 0:function(){return i.selectOption(ce)},st="".concat(i.getElementId("option"),"-").concat(G),Je={id:st,onClick:Fe,onMouseMove:ve,onMouseOver:ve,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:Z};return K.createElement(g,R({},v,{innerProps:Je,data:ce,isDisabled:se,isSelected:Z,key:st,label:te,type:oe,value:ne,isFocused:de,innerRef:de?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(U.data,"menu"))},M;if(this.hasOptions())M=this.getCategorizedOptions().map(function(L){if(L.type==="group"){var U=L.data,G=L.options,oe=L.index,ce="".concat(i.getElementId("group"),"-").concat(oe),se="".concat(ce,"-heading");return K.createElement(a,R({},v,{key:ce,data:U,options:G,Heading:l,headingProps:{id:se,data:L.data},label:i.formatGroupLabel(L.data)}),L.options.map(function(Z){return $(Z,"".concat(oe,"-").concat(Z.index))}))}else if(L.type==="option")return $(L,"".concat(L.index))});else if(x){var V=I({inputValue:w});if(V===null)return null;M=K.createElement(d,v,V)}else{var Y=N({inputValue:w});if(Y===null)return null;M=K.createElement(p,v,Y)}var X={minMenuHeight:S,maxMenuHeight:A,menuPlacement:k,menuPosition:F,menuShouldScrollIntoView:T},D=K.createElement(UD,R({},v,X),function(L){var U=L.ref,G=L.placerProps,oe=G.placement,ce=G.maxHeight;return K.createElement(c,R({},v,X,{innerRef:U,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:oe}),K.createElement(mR,{captureEnabled:C,onTopArrive:H,onBottomArrive:j,lockEnabled:O},function(se){return K.createElement(u,R({},v,{innerRef:function(te){i.getMenuListRef(te),se(te)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:ce,focusedOption:m}),M)}))});return W||F==="fixed"?K.createElement(f,R({},v,{appendTo:W,controlElement:this.controlRef,menuPlacement:k,menuPosition:F}),D):D}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,l=o.isDisabled,c=o.isMulti,u=o.name,f=o.required,d=this.state.selectValue;if(f&&!this.hasValue()&&!l)return K.createElement(yR,{name:u,onFocus:this.onValueInputFocus});if(!(!u||l))if(c)if(a){var p=d.map(function(m){return i.getOptionValue(m)}).join(a);return K.createElement("input",{name:u,type:"hidden",value:p})}else{var g=d.length>0?d.map(function(m,b){return K.createElement("input",{key:"i-".concat(b),name:u,type:"hidden",value:i.getOptionValue(m)})}):K.createElement("input",{name:u,type:"hidden",value:""});return K.createElement("div",null,g)}else{var v=d[0]?this.getOptionValue(d[0]):"";return K.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,l=o.focusedOption,c=o.focusedValue,u=o.isFocused,f=o.selectValue,d=this.getFocusableOptions();return K.createElement(iR,R({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:l,focusedValue:c,isFocused:u,selectValue:f,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,l=i.SelectContainer,c=i.ValueContainer,u=this.props,f=u.className,d=u.id,p=u.isDisabled,g=u.menuIsOpen,v=this.state.isFocused,m=this.commonProps=this.getCommonProps();return K.createElement(l,R({},m,{className:f,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:v}),this.renderLiveRegion(),K.createElement(o,R({},m,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:v,menuIsOpen:g}),K.createElement(c,R({},m,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),K.createElement(a,R({},m,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,l=o.clearFocusValueOnUpdate,c=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,f=o.isFocused,d=o.prevWasFocused,p=o.instancePrefix,g=i.options,v=i.value,m=i.menuIsOpen,b=i.inputValue,C=i.isMulti,w=vs(v),x={};if(a&&(v!==a.value||g!==a.options||m!==a.menuIsOpen||b!==a.inputValue)){var I=m?RR(i,w):[],S=m?um(ws(i,w),"".concat(p,"-option")):[],A=l?MR(o,w):null,E=LR(o,I),k=bu(S,E);x={selectValue:w,focusedOption:E,focusedOptionId:k,focusableOptionsWithIds:S,focusedValue:A,clearFocusValueOnUpdate:!1}}var F=c!=null&&i!==a?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},W=u,O=f&&d;return f&&!O&&(W={value:Co(C,w,w[0]||null),options:w,action:"initial-input-focus"},O=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(W=null),be(be(be({},x),F),{},{prevProps:i,ariaSelection:W,prevWasFocused:O})}}]),n}(y.Component);vm.defaultProps=OR;var $R=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function FR(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,a=o===void 0?null:o,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,f=e.onInputChange,d=e.onMenuClose,p=e.onMenuOpen,g=e.value,v=Tn(e,$R),m=y.useState(l!==void 0?l:n),b=Yn(m,2),C=b[0],w=b[1],x=y.useState(c!==void 0?c:i),I=Yn(x,2),S=I[0],A=I[1],E=y.useState(g!==void 0?g:a),k=Yn(E,2),F=k[0],W=k[1],O=y.useCallback(function(V,Y){typeof u=="function"&&u(V,Y),W(V)},[u]),T=y.useCallback(function(V,Y){var X;typeof f=="function"&&(X=f(V,Y)),w(X!==void 0?X:V)},[f]),N=y.useCallback(function(){typeof p=="function"&&p(),A(!0)},[p]),H=y.useCallback(function(){typeof d=="function"&&d(),A(!1)},[d]),j=l!==void 0?l:C,$=c!==void 0?c:S,M=g!==void 0?g:F;return be(be({},v),{},{inputValue:j,menuIsOpen:$,onChange:O,onInputChange:T,onMenuClose:H,onMenuOpen:N,value:M})}var NR=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],bm=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),a=String(r.getOptionLabel(n)).toLowerCase();return o===i||a===i},yu={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return bm(t,o,i)})||r.some(function(o){return bm(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function zR(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,a=o===void 0?yu.formatCreateLabel:o,l=e.isValidNewOption,c=l===void 0?yu.isValidNewOption:l,u=e.getNewOptionData,f=u===void 0?yu.getNewOptionData:u,d=e.onCreateOption,p=e.options,g=p===void 0?[]:p,v=e.onChange,m=Tn(e,NR),b=m.getOptionValue,C=b===void 0?am:b,w=m.getOptionLabel,x=w===void 0?om:w,I=m.inputValue,S=m.isLoading,A=m.isMulti,E=m.value,k=m.name,F=y.useMemo(function(){return c(I,vs(E),g,{getOptionValue:C,getOptionLabel:x})?f(I,a(I)):void 0},[a,f,x,C,I,c,g,E]),W=y.useMemo(function(){return(n||!S)&&F?i==="first"?[F].concat(gi(g)):[].concat(gi(g),[F]):g},[n,i,S,F,g]),O=y.useCallback(function(T,N){if(N.action!=="select-option")return v(T,N);var H=Array.isArray(T)?T:[T];if(H[H.length-1]===F){if(d)d(I);else{var j=f(I,I),$={action:"create-option",name:k,option:j};v(Co(A,[].concat(gi(vs(E)),[j]),j),$)}return}v(T,N)},[f,I,A,k,F,d,v,E]);return be(be({},m),{},{options:W,onChange:O})}var jR=y.forwardRef(function(e,t){var n=FR(e),r=zR(n);return K.createElement(vm,R({ref:t},r))}),ym=jR;const UR={control:(e,t)=>Q(B({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px",fontFamily:'var(--joy-fontFamily-body, "Inter", var(--joy-fontFamily-fallback, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"));',"&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(B({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(B({},e),{minHeight:"36px"}),menu:e=>Q(B({},e),{position:"relative"}),clearIndicator:e=>Q(B({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(B({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(B({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(B({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"14px"}),multiValueLabel:e=>Q(B({},e),{color:"#333"})},VR=e=>e.map(t=>({label:t,value:t})),HR=e=>{const[t,n]=y.useState(""),[r,i]=y.useState(!1),o=e.sx||{marginBottom:"16px"},a=VR(e.flags),l=()=>i(!r),c=p=>{e.onChange(p.map(g=>g.value))},u=p=>{n(p)},f=p=>{p.persist();const{key:g}=p;if(t)switch(g){case"Enter":case"Tab":if(e.flags&&e.flags.length===0){const v=[...e.flags,t];e.onChange(v)}if(e.flags&&e.flags.length>0&&d()){const v=[...e.flags,t];e.onChange(v)}n(""),p.preventDefault()}},d=()=>{let p=!1;return e.flags.length&&e.flags.includes(t)?(l(),p):(p=!0,p)};return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:o,children:s.jsx(ym,{styles:UR,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:c,onInputChange:u,onKeyDown:f,placeholder:e.labels.flagsPlaceholder,value:a})}),s.jsx(Ge,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:l})]})},So=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState("primary"),[g,v]=y.useState(""),m=y.useRef(null),b=()=>{m.current&&m.current.click()},C=new Wp,w=We(),x=()=>{f(""),i(!1)},I=N=>{let H="",j="primary";switch(N){case"copy_url":H=e.labels.urlCopiedToClipboardMessage,j="primary";break;case"image_deleted":H=e.labels.imageDeletedMessage,j="primary";break;case"image_reset":H=e.labels.imageResetMessage,j="primary";break;case"upload_success":H=e.labels.uploadingImageMessage,j="success";break;case"upload_failed":H=e.labels.uploadingImageErrorMessage,j="danger";break;case"sign_in_url_failed":H=e.labels.generateSignedInUrlErrorMessage,j="danger";break;case"encrypting_file_failed":H=e.labels.encryptingImageErrorMessage,j="danger";break}p(j),f(H),i(!0)},S=()=>a(!o),A=()=>c(!l),E=()=>{e.clearImage(),I("image_deleted")},k=N=>{navigator.clipboard.writeText(N),I("copy_url")},F=N=>_(this,null,function*(){N.persist();const H=N.target.files?N.target.files[0]:null;if(H){n(!0);try{const j=H.type.split("/")[1],$=yield C.readFileAndHash(H),M=(yield C.generateHashFileName(H))+"."+j,V={image_type:j,image_file_name:M,image_size:H.size,base64_sum:$},Y=yield w==null?void 0:w.https.generateSignedInUrl(V);if(Y!=null&&Y.ok){const X=yield Y.json(),D={"Content-Type":H.type,"Content-MD5":$};try{const L=new File([H],M,{type:H.type}),U=yield w==null?void 0:w.https.storeInBucket(X.data.signed_url,L,D);e.onChangeImages(U||""),v(U),I("upload_success")}catch(L){console.error("There was a problem with uploading the file: ",L),I("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield Y==null?void 0:Y.json()),I("sign_in_url_failed")}catch(j){console.error("There was a problem with encrypting file...",j),I("encrypting_file_failed")}n(!1)}}),W=N=>_(this,null,function*(){if(N){n(!0);try{const H=N.type.split("/")[1],j=yield C.readFileAndHash(N),$=(yield C.generateHashFileName(N))+"."+H,M={image_type:H,image_file_name:$,image_size:N.size,base64_sum:j},V=yield w==null?void 0:w.https.generateSignedInUrl(M);if(V!=null&&V.ok){const Y=yield V.json(),X={"Content-Type":N.type,"Content-MD5":j};try{const D=new File([N],$,{type:N.type}),L=yield w==null?void 0:w.https.storeInBucket(Y.data.signed_url,D,X);e.onChangeImages(L||""),I("upload_success")}catch(D){console.error("There was a problem with uploading the file: ",D),I("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield V==null?void 0:V.json()),I("sign_in_url_failed")}catch(H){console.error("There was a problem with encrypting file...",H),I("encrypting_file_failed")}n(!1)}}),O=()=>{e.onChangeImages(g),I("image_reset")},T=N=>{e.onChangeImages(N),v(N)};return s.jsxs(s.Fragment,{children:[s.jsxs(h.Card,{sx:{marginBottom:"10px"},children:[s.jsxs(h.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[s.jsx(h.Typography,{level:"title-lg",children:e.title}),s.jsx(h.Tooltip,{title:e.labels.clearImage,children:s.jsx(h.IconButton,{variant:"plain",color:"danger",size:"sm",onClick:E,children:s.jsx(Rp,{})})})]}),s.jsxs(h.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[s.jsxs(h.Skeleton,{loading:t,animation:"wave",children:[e.image?s.jsx(h.Box,{component:"img",src:e.image,loading:"lazy",alt:e.title,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):s.jsx(jc,{sx:{fontSize:"3rem",opacity:.2}}),e.image?s.jsx(h.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:s.jsx(Yp,{sx:{fontSize:"3rem",color:"#fff"}})}):s.jsx(s.Fragment,{})]}),s.jsx(h.Tooltip,{title:e.labels.copyUrl,children:s.jsx(h.Button,{onClick:()=>k(e.image),disabled:!e.image,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})}),s.jsx(h.Tooltip,{title:e.labels.viewImage,children:s.jsx(h.Button,{onClick:S,disabled:!e.image,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:s.jsx(qp,{})})}),s.jsx(h.Tooltip,{title:e.labels.cropImage,children:s.jsx(h.Button,{onClick:A,disabled:!e.image,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:s.jsx(hg,{})})})]}),s.jsx(h.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:s.jsxs(h.Button,{sx:{width:"100%"},onClick:b,children:[s.jsx(_e.Upload,{})," ",e.labels.uploadImage,s.jsx(Qp,{type:"file",accept:"image/*",onChange:F,ref:m})]})}),w.https.sportal365Config?s.jsx(h.AccordionGroup,{variant:"soft",children:s.jsxs(h.Accordion,{children:[s.jsx(h.AccordionSummary,{children:s.jsx(h.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.labels.sportal365Images})}),s.jsx(h.AccordionDetails,{children:s.jsx(Kp,{labels:e.labels,onChangeImages:T})})]})}):s.jsx(s.Fragment,{})]}),s.jsx(Ge,{showToast:r,message:u,color:d,hideToast:x}),s.jsx(Gp,{title:e.labels.viewImage,open:o,imageSrc:e.image,toggleModal:S}),s.jsx(fg,{labels:e.labels,open:l,imageSrc:e.image,toggleModal:A,uploadImage:W,resetDefaultImageUrl:O})]})},WR=["cover","mobile"],GR=e=>new Map().set("main",e.mainImage).set("cover",e.coverImage).set("mobile",e.mobileImage),YR=e=>e?B({},e):{main:"",mobile:"",cover:""},KR=e=>{const[t,n]=y.useState(!1),r=YR(e.defaultValue),i=GR(e.labels),o=(l,c)=>{r[c]=l,e.onChange(r)},a=l=>{r[l]="",e.onChange(r)};return s.jsxs(h.Box,{sx:{marginBottom:"10px"},children:[s.jsx(So,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:l=>o(l,"main"),clearImage:()=>a("main")}),s.jsx(h.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?s.jsx(s.Fragment,{children:WR.map(l=>s.jsx(So,{labels:e.labels,title:i.get(l),image:r[l],onChangeImages:c=>o(c,l),clearImage:()=>a(l)},`images-${l}`))}):s.jsx(s.Fragment,{})]})};function qR(e){return ut("MuiSheet",e)}Ke("MuiSheet",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const QR=["className","color","component","variant","invertedColors","slots","slotProps"],JR=e=>{const{variant:t,color:n}=e,r={root:["root",t&&`variant${we(t)}`,n&&`color${we(n)}`]};return pt(r,qR,{})},XR=ye("div",{name:"JoySheet",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r;const i=(n=e.variants[t.variant])==null?void 0:n[t.color],{borderRadius:o,bgcolor:a,backgroundColor:l,background:c}=vc({theme:e,ownerState:t},["borderRadius","bgcolor","backgroundColor","background"]),u=ar(e,`palette.${a}`)||a||ar(e,`palette.${l}`)||l||c||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||e.vars.palette.background.surface;return[R({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,"--ListItem-stickyBackground":u==="transparent"?"initial":u,"--Sheet-background":u==="transparent"?"initial":u},o!==void 0&&{"--List-radius":`calc(${o} - var(--variant-borderWidth, 0px))`,"--unstable_actionRadius":`calc(${o} - var(--variant-borderWidth, 0px))`},{backgroundColor:e.vars.palette.background.surface,position:"relative"}),R({},e.typography["body-md"],t.variant==="solid"&&t.color&&t.invertedColors&&I_(t.color)(e),t.variant==="soft"&&t.color&&t.invertedColors&&A_(t.color)(e),(r=e.variants[t.variant])==null?void 0:r[t.color],i)]}),ZR=K.forwardRef(function(t,n){const r=gt({props:t,name:"JoySheet"}),{className:i,color:o="neutral",component:a="div",variant:l="plain",invertedColors:c=!1,slots:u={},slotProps:f={}}=r,d=De(r,QR),p=R({},r,{color:o,component:a,invertedColors:c,variant:l}),g=JR(p),v=R({},d,{component:a,slots:u,slotProps:f}),[m,b]=Ee("root",{ref:n,className:zn(g.root,i),elementType:XR,externalForwardedProps:v,ownerState:p});return s.jsx(m,R({},b))});function eM(e){return ut("MuiTypography",e)}Ke("MuiTypography",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const tM=["color","textColor"],nM=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant","slots","slotProps"],xu=K.createContext(!1),rM=K.createContext(!1),iM=e=>{const{gutterBottom:t,noWrap:n,level:r,color:i,variant:o}=e,a={root:["root",r,t&&"gutterBottom",n&&"noWrap",i&&`color${we(i)}`,o&&`variant${we(o)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return pt(a,eM,{})},oM=ye("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),aM=ye("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),sM=ye("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const l=t.level!=="inherit"?(n=e.typography[t.level])==null?void 0:n.lineHeight:"1";return R({"--Icon-fontSize":`calc(1em * ${l})`},t.color&&{"--Icon-color":"currentColor"},{margin:"var(--Typography-margin, 0px)"},t.nesting?{display:"inline"}:R({display:"block"},t.unstable_hasSkeleton&&{position:"relative"}),(t.startDecorator||t.endDecorator)&&R({display:"flex",alignItems:"center"},t.nesting&&R({display:"inline-flex"},t.startDecorator&&{verticalAlign:"bottom"})),t.level&&t.level!=="inherit"&&e.typography[t.level],{fontSize:`var(--Typography-fontSize, ${t.level&&t.level!=="inherit"&&(r=(i=e.typography[t.level])==null?void 0:i.fontSize)!=null?r:"inherit"})`},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.color&&{color:`var(--variant-plainColor, rgba(${(o=e.vars.palette[t.color])==null?void 0:o.mainChannel} / 1))`},t.variant&&R({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!t.nesting&&{marginInline:"-0.25em"},(a=e.variants[t.variant])==null?void 0:a[t.color]))}),xm={h1:"h1",h2:"h2",h3:"h3",h4:"h4","title-lg":"p","title-md":"p","title-sm":"p","body-lg":"p","body-md":"p","body-sm":"p","body-xs":"span",inherit:"p"},Cu=K.forwardRef(function(t,n){var r;const i=gt({props:t,name:"JoyTypography"}),{color:o,textColor:a}=i,l=De(i,tM),c=K.useContext(xu),u=K.useContext(rM),f=p1(R({},l,{color:a})),{component:d,gutterBottom:p=!1,noWrap:g=!1,level:v="body-md",levelMapping:m=xm,children:b,endDecorator:C,startDecorator:w,variant:x,slots:I={},slotProps:S={}}=f,A=De(f,nM),E=(r=t.color)!=null?r:x?o!=null?o:"neutral":o,k=c||u?t.level||"inherit":v,F=oh(b,["Skeleton"]),W=d||(c?"span":m[k]||xm[k]||"span"),O=R({},f,{level:k,component:W,color:E,gutterBottom:p,noWrap:g,nesting:c,variant:x,unstable_hasSkeleton:F}),T=iM(O),N=R({},A,{component:W,slots:I,slotProps:S}),[H,j]=Ee("root",{ref:n,className:T.root,elementType:sM,externalForwardedProps:N,ownerState:O}),[$,M]=Ee("startDecorator",{className:T.startDecorator,elementType:oM,externalForwardedProps:N,ownerState:O}),[V,Y]=Ee("endDecorator",{className:T.endDecorator,elementType:aM,externalForwardedProps:N,ownerState:O});return s.jsx(xu.Provider,{value:!0,children:s.jsxs(H,R({},j,{children:[w&&s.jsx($,R({},M,{children:w})),F?K.cloneElement(b,{variant:b.props.variant||"inline"}):b,C&&s.jsx(V,R({},Y,{children:C}))]}))})});Cu.muiName="Typography";function lM(e){return ut("MuiFormControl",e)}const Cm=Ke("MuiFormControl",["root","error","disabled","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","sizeSm","sizeMd","sizeLg","horizontal","vertical"]),cM=Ke("MuiSwitch",["root","checked","disabled","action","input","thumb","track","focusVisible","readOnly","colorPrimary","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid","startDecorator","endDecorator"]),uM=["id","className","component","disabled","required","error","color","size","orientation","slots","slotProps"],dM=e=>{const{disabled:t,error:n,size:r,color:i,orientation:o}=e,a={root:["root",o,t&&"disabled",n&&"error",i&&`color${we(i)}`,r&&`size${we(r)}`]};return pt(a,lM,{})},fM=ye("div",{name:"JoyFormControl",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i;return R({"--unstable_RadioGroup-margin":"0.5rem 0","--FormLabel-alignSelf":t.orientation==="horizontal"?"align-items":"flex-start","--FormLabel-asteriskColor":e.vars.palette.danger[500]},t.size==="sm"&&{"--FormLabel-fontSize":e.vars.fontSize.xs,"--FormLabel-lineHeight":e.vars.lineHeight.xl,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.5rem 0 0":"0 0 0.25rem 0","--FormHelperText-fontSize":e.vars.fontSize.xs,"--FormHelperText-lineHeight":e.vars.lineHeight.xl},t.size==="md"&&{"--FormLabel-fontSize":e.vars.fontSize.sm,"--FormLabel-lineHeight":e.vars.lineHeight.sm,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.75rem 0 0":"0 0 0.375rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.size==="lg"&&{"--FormLabel-fontSize":e.vars.fontSize.md,"--FormLabel-lineHeight":e.vars.lineHeight.md,"--FormLabel-margin":t.orientation==="horizontal"?"0 1rem 0 0":"0 0 0.5rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.color&&{"--FormHelperText-color":(n=e.vars.palette[t.color])==null?void 0:n[500]},{"--FormHelperText-margin":"0.375rem 0 0 0",[`&.${Cm.error}`]:{"--FormHelperText-color":e.vars.palette.danger[500]},[`&.${Cm.disabled}`]:{"--FormLabel-color":(r=e.variants.plainDisabled)==null||(r=r[t.color||"neutral"])==null?void 0:r.color,"--FormHelperText-color":(i=e.variants.plainDisabled)==null||(i=i[t.color||"neutral"])==null?void 0:i.color},display:"flex",position:"relative",flexDirection:t.orientation==="horizontal"?"row":"column"},t.orientation==="horizontal"&&{[`& > label ~ .${cM.root}`]:{"--unstable_Switch-margin":"0 0 0 auto"}})}),wu=K.forwardRef(function(t,n){const r=gt({props:t,name:"JoyFormControl"}),{id:i,className:o,component:a="div",disabled:l=!1,required:c=!1,error:u=!1,color:f,size:d="md",orientation:p="vertical",slots:g={},slotProps:v={}}=r,m=De(r,uM),b=ro(i),[C,w]=K.useState(null),x=R({},r,{id:b,component:a,color:f,disabled:l,error:u,required:c,size:d,orientation:p});let I;const S=dM(x),[A,E]=Ee("root",{ref:n,className:zn(S.root,o),elementType:fM,externalForwardedProps:R({},m,{component:a,slots:g,slotProps:v}),ownerState:x}),k=K.useMemo(()=>({disabled:l,required:c,error:u,color:f,size:d,htmlFor:b,labelId:`${b}-label`,"aria-describedby":C?`${b}-helper-text`:void 0,setHelperText:w,registerEffect:I}),[f,l,u,C,b,I,c,d]);return s.jsx(rs.Provider,{value:k,children:s.jsx(A,R({},E))})});function hM(e){return ut("MuiFormLabel",e)}Ke("MuiFormLabel",["root","asterisk"]);const pM=["children","component","htmlFor","id","slots","slotProps"],gM=()=>pt({root:["root"],asterisk:["asterisk"]},hM,{}),mM=ye("label",{name:"JoyFormLabel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({"--Icon-fontSize":"calc(var(--FormLabel-lineHeight) * 1em)",WebkitTapHighlightColor:"transparent",alignSelf:"var(--FormLabel-alignSelf)",display:"flex",gap:"2px",alignItems:"center",flexWrap:"wrap",userSelect:"none",fontFamily:e.vars.fontFamily.body,fontSize:`var(--FormLabel-fontSize, ${e.vars.fontSize.sm})`,fontWeight:e.vars.fontWeight.md,lineHeight:`var(--FormLabel-lineHeight, ${e.vars.lineHeight.sm})`,color:`var(--FormLabel-color, ${e.vars.palette.text.primary})`,margin:"var(--FormLabel-margin, 0px)"})),vM=ye("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})({color:"var(--FormLabel-asteriskColor)"}),Su=K.forwardRef(function(t,n){var r,i;const o=gt({props:t,name:"JoyFormLabel"}),{children:a,component:l="label",htmlFor:c,id:u,slots:f={},slotProps:d={}}=o,p=De(o,pM),g=K.useContext(rs),v=(r=(i=t.required)!=null?i:g==null?void 0:g.required)!=null?r:!1,m=R({},o,{required:v}),b=gM(),C=R({},p,{component:l,slots:f,slotProps:d}),[w,x]=Ee("root",{additionalProps:{htmlFor:c!=null?c:g==null?void 0:g.htmlFor,id:u!=null?u:g==null?void 0:g.labelId},ref:n,className:b.root,elementType:mM,externalForwardedProps:C,ownerState:m}),[I,S]=Ee("asterisk",{additionalProps:{"aria-hidden":!0},className:b.asterisk,elementType:vM,externalForwardedProps:C,ownerState:m});return s.jsxs(w,R({},x,{children:[a,v&&s.jsxs(I,R({},S,{children:[" ","*"]}))]}))}),bM=({environment:e,userNotFound:t})=>{const[n,r]=y.useState(""),[i,o]=y.useState(""),[a,l]=y.useState(!1),c=()=>{l(!a)},u=p=>{p.persist(),r(p.target.value)},f=p=>{p.persist(),o(p.target.value)},d=()=>_(this,null,function*(){try{yield no(e).signInWithEmailAndPassword(n,i)}catch(p){console.error(p),c()}});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:s.jsxs(ZR,{sx:{width:300,mx:"auto",py:3,px:2,display:"flex",flexDirection:"column",justifyContent:"center",gap:2,borderRadius:"sm",boxShadow:"md"},variant:"outlined",children:[s.jsxs("div",{children:[s.jsx(Cu,{level:"h4",component:"h1",children:s.jsx("b",{children:"Sign in"})}),s.jsx(Cu,{level:"body-sm",children:"Use your account in the Fans United platform."})]}),s.jsxs(wu,{children:[s.jsx(Su,{children:"Email"}),s.jsx(is,{name:"email",type:"email",onChange:u})]}),s.jsxs(wu,{children:[s.jsx(Su,{children:"Password"}),s.jsx(is,{name:"password",type:"password",onChange:f})]}),s.jsx(di,{sx:{mt:1},onClick:d,children:"Log in"})]})}),s.jsx(Ge,{showToast:a,message:t,color:"danger",hideToast:c})]})};function yM(e){return ut("MuiCheckbox",e)}const vi=Ke("MuiCheckbox",["root","checkbox","action","input","label","checked","disabled","focusVisible","indeterminate","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid"]),xM=xc(s.jsx("path",{d:"M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"}),"Check"),CM=xc(s.jsx("path",{d:"M19 13H5c-.55 0-1-.45-1-1s.45-1 1-1h14c.55 0 1 .45 1 1s-.45 1-1 1z"}),"HorizontalRule"),wM=["checked","uncheckedIcon","checkedIcon","label","defaultChecked","disabled","disableIcon","overlay","id","indeterminate","indeterminateIcon","name","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","value","color","variant","size","component","slots","slotProps"],SM=e=>{const{checked:t,disabled:n,disableIcon:r,focusVisible:i,color:o,variant:a,size:l,indeterminate:c}=e,u={root:["root",t&&"checked",n&&"disabled",i&&"focusVisible",a&&`variant${we(a)}`,o&&`color${we(o)}`,l&&`size${we(l)}`],checkbox:["checkbox",t&&"checked",c&&"indeterminate",n&&"disabled"],action:["action",t&&"checked",r&&n&&"disabled",i&&"focusVisible"],input:["input"],label:["label"]};return pt(u,yM,{})},IM=ye("span",{name:"JoyCheckbox",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r,i;return R({"--Icon-fontSize":"var(--Checkbox-size)"},e.size==="sm"&&{"--Checkbox-size":"1rem","& ~ *":{"--FormHelperText-margin":"0 0 0 1.5rem"},fontSize:t.vars.fontSize.sm,gap:"var(--Checkbox-gap, 0.5rem)"},e.size==="md"&&{"--Checkbox-size":"1.25rem","& ~ *":{"--FormHelperText-margin":"0.25rem 0 0 1.875rem"},fontSize:t.vars.fontSize.md,gap:"var(--Checkbox-gap, 0.625rem)"},e.size==="lg"&&{"--Checkbox-size":"1.5rem","& ~ *":{"--FormHelperText-margin":"0.375rem 0 0 2.25rem"},fontSize:t.vars.fontSize.lg,gap:"var(--Checkbox-gap, 0.75rem)"},{position:e.overlay?"initial":"relative",display:"inline-flex",fontFamily:t.vars.fontFamily.body,lineHeight:"var(--Checkbox-size)",color:t.vars.palette.text.primary,[`&.${vi.disabled}`]:{color:(n=t.variants.plainDisabled)==null||(n=n[e.color])==null?void 0:n.color}},e.disableIcon&&{color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color,[`&.${vi.disabled}`]:{color:(i=t.variants[`${e.variant}Disabled`])==null||(i=i[e.color])==null?void 0:i.color}})}),AM=ye("span",{name:"JoyCheckbox",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const l=(n=e.variants[`${t.variant}`])==null?void 0:n[t.color];return[R({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,boxSizing:"border-box",borderRadius:`min(${e.vars.radius.sm}, 0.25rem)`,width:"var(--Checkbox-size)",height:"var(--Checkbox-size)",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0},t.disableIcon&&{display:"contents"},{[`&.${vi.checked}, &.${vi.indeterminate}`]:{"--Icon-color":"currentColor"}}),...t.disableIcon?[]:[R({},l,{backgroundColor:(r=l==null?void 0:l.backgroundColor)!=null?r:e.vars.palette.background.surface}),{"&:hover":{"@media (hover: hover)":(i=e.variants[`${t.variant}Hover`])==null?void 0:i[t.color]}},{"&:active":(o=e.variants[`${t.variant}Active`])==null?void 0:o[t.color]},{[`&.${vi.disabled}`]:(a=e.variants[`${t.variant}Disabled`])==null?void 0:a[t.color]}]]}),TM=ye("span",{name:"JoyCheckbox",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var n,r,i,o;return[{borderRadius:`var(--Checkbox-actionRadius, ${t.overlay?"var(--unstable_actionRadius, inherit)":"inherit"})`,textAlign:"left",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",zIndex:1,[e.focus.selector]:e.focus.default},...t.disableIcon?[(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},{"&:active":(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]},{[`&.${vi.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]}]:[]]}),EM=ye("input",{name:"JoyCheckbox",slot:"Input",overridesResolver:(e,t)=>t.input})(()=>({margin:0,opacity:0,position:"absolute",width:"100%",height:"100%",cursor:"pointer"})),kM=ye("label",{name:"JoyCheckbox",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>R({flex:1,minWidth:0},e.disableIcon&&{zIndex:1,pointerEvents:"none"})),_M=s.jsx(xM,{}),PM=s.jsx(CM,{}),DM=K.forwardRef(function(t,n){var r,i,o,a,l;const c=gt({props:t,name:"JoyCheckbox"}),{checked:u,uncheckedIcon:f,checkedIcon:d=_M,label:p,defaultChecked:g,disabled:v,disableIcon:m=!1,overlay:b,id:C,indeterminate:w=!1,indeterminateIcon:x=PM,name:I,onBlur:S,onChange:A,onFocus:E,onFocusVisible:k,readOnly:F,required:W,value:O,color:T,variant:N,size:H="md",component:j,slots:$={},slotProps:M={}}=c,V=De(c,wM),Y=K.useContext(rs),X=(r=(i=t.disabled)!=null?i:Y==null?void 0:Y.disabled)!=null?r:v,D=(o=(a=t.size)!=null?a:Y==null?void 0:Y.size)!=null?o:H,L=ro(C!=null?C:Y==null?void 0:Y.htmlFor),U={checked:u,defaultChecked:g,disabled:X,onBlur:S,onChange:A,onFocus:E,onFocusVisible:k},{getInputProps:G,checked:oe,disabled:ce,focusVisible:se}=iA(U),Z=oe||w,de=Z?N||"solid":N||"outlined",ve=t.color||(Y!=null&&Y.error?"danger":(l=Y==null?void 0:Y.color)!=null?l:T),Je=R({},c,{checked:oe,disabled:ce,disableIcon:m,overlay:b,focusVisible:se,color:Z?ve||"primary":ve||"neutral",variant:de,size:D}),vt=SM(Je),he=R({},V,{component:j,slots:$,slotProps:M}),[ge,xe]=Ee("root",{ref:n,className:vt.root,elementType:IM,externalForwardedProps:he,ownerState:Je}),[ke,Ye]=Ee("checkbox",{className:vt.checkbox,elementType:AM,externalForwardedProps:he,ownerState:Je}),[Oe,Pe]=Ee("action",{className:vt.action,elementType:TM,externalForwardedProps:he,ownerState:Je}),[St,It]=Ee("input",{additionalProps:R({id:L,name:I,value:O,readOnly:F,role:void 0,required:W!=null?W:Y==null?void 0:Y.required,"aria-describedby":Y==null?void 0:Y["aria-describedby"]},w&&{"aria-checked":"mixed"}),className:vt.input,elementType:EM,externalForwardedProps:he,getSlotProps:G,ownerState:Je}),[Mt,_t]=Ee("label",{additionalProps:{htmlFor:L},className:vt.label,elementType:kM,externalForwardedProps:he,ownerState:Je});let Nt=f;return m?Nt=null:w?Nt=x:oe&&(Nt=d),s.jsxs(ge,R({},xe,{children:[s.jsxs(ke,R({},Ye,{children:[s.jsx(Oe,R({},Pe,{children:s.jsx(St,R({},It))})),Nt]})),p&&s.jsx(xu.Provider,{value:!0,children:s.jsx(Mt,R({},_t,{children:p}))})]}))}),OM=Be(s.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done"),Or=({label:e,values:t,allValues:n,valuesMap:r,showAll:i,showAllLabel:o,onChange:a,toggleShowAll:l})=>{const c=(u,f)=>{u.persist();let d=[...t];if(u.target.checked){d.push(f),a(d);return}d=t.filter(p=>p!==f),a(d)};return s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"body-sm",mb:1,children:e}),s.jsxs(cT,{orientation:"horizontal",wrap:!0,sx:{columnGap:"12px","--List-gap":"8px","--ListItem-radius":"20px","--ListItem-minHeight":"32px","--ListItem-gap":"4px"},children:[n.map(u=>s.jsxs(Kh,{children:[t.includes(u)&&s.jsx(OM,{fontSize:"medium",color:"primary",sx:{ml:-.5,zIndex:2,pointerEvents:"none"}}),s.jsx(DM,{checked:t.includes(u),variant:t.includes(u)?"soft":"outlined",overlay:!0,disableIcon:!0,label:r[u]||"N/A",onChange:f=>c(f,u),slotProps:{action:({checked:f})=>({sx:f?{border:"1px solid",borderColor:"primary.500"}:{backgroundColor:"#fff"}})}})]},`checkbox-value-${e}-${u}`)),i===!1?s.jsx(Kh,{children:s.jsx(h.Link,{onClick:l,children:o})}):s.jsx(s.Fragment,{})]})]})},bi={popular:["FT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","CORRECT_SCORE","OVER_CORNERS_9_5"],playerRelated:["PLAYER_YELLOW_CARD","PLAYER_RED_CARD","PLAYER_SCORE","PLAYER_SCORE_FIRST_GOAL","PLAYER_SCORE_TWICE","PLAYER_SCORE_HATTRICK"],goals:["OVER_GOALS_0_5","OVER_GOALS_1_5","OVER_GOALS_2_5","OVER_GOALS_3_5","OVER_GOALS_4_5","OVER_GOALS_5_5","OVER_GOALS_6_5"],corners:["CORNERS_MATCH","OVER_CORNERS_6_5","OVER_CORNERS_7_5","OVER_CORNERS_8_5","OVER_CORNERS_9_5","OVER_CORNERS_10_5","OVER_CORNERS_11_5","OVER_CORNERS_12_5","OVER_CORNERS_13_5"],correctScores:["CORRECT_SCORE","CORRECT_SCORE_HT","CORRECT_SCORE_ADVANCED"],misc:["FT_1X2","HT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","HT_FT","RED_CARD_MATCH","PENALTY_MATCH"]},RM=({labels:e,values:t,valuesMap:n,onChange:r})=>{const[i,o]=y.useState(!1);return s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.marketSelection}),s.jsx(h.FormHelperText,{sx:{mb:2},children:e.marketSelectionDescription}),s.jsx(Or,{label:"Popular",values:t,allValues:bi.popular,valuesMap:n,showAll:i,showAllLabel:e.showAll,onChange:r,toggleShowAll:()=>o(!0)}),i?s.jsxs(s.Fragment,{children:[s.jsx(Or,{label:e.playerRelated,values:t,allValues:bi.playerRelated,valuesMap:n,onChange:r}),s.jsx(Or,{label:e.goals,values:t,allValues:bi.goals,valuesMap:n,onChange:r}),s.jsx(Or,{label:e.corners,values:t,allValues:bi.corners,valuesMap:n,onChange:r}),s.jsx(Or,{label:e.correctScores,values:t,allValues:bi.correctScores,valuesMap:n,onChange:r}),s.jsx(Or,{label:e.misc,values:t,allValues:bi.misc,valuesMap:n,onChange:r})]}):s.jsx(s.Fragment,{})]})},Le={avatar:"data:image/png;base64,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",team:"data:image/png;base64,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",competition:"data:image/png;base64,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",bin:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA8klEQVR4nOWUvQ3CMBCFX5MGloAJwgQwAUwAYoAwATSUMAGZACYgA/CzQSaAjgGgQTIyegU6WfbZioQET3Lxonf+4uR8wL9oCcCItUrZyDS0vgewqhnK306nnDW2NqiK4WEEYMSavSZcMlx8PJNHl35Gv9EAFo4uMQHAmn6uAUwY3kYAdvRjDWDA8CkCcKbvawBdhi8RgCt9RwPIADy5MgXAlQ9KvpHxAFwnDkp+U+MBuP5ZULIrjAfg6rqgZF8bD8B1b4IqWFTSHx2Ag+fmNzpbqoTZhV7EdKwTpi/aAB4R8/8OoIVITQHcFJvbjO2kH9UL+0+m+SiE/A0AAAAASUVORK5CYII=",checkMark:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE10lEQVR4nO2ZXVBUdRjGdzS78BLqSmqyIKducjKZuvKqNMMpMgQW17IENEIFEWhVViYEJlm+dmG/JAFFZFcQ+QqlRKAQiNUWli/5EJYFgd0FUWI/gJ7mv+ZkAp497GG3Znhmzv3vec/7f//veQ6LtaIVrchuySFfLbY0vpc528DNtDQUCi31bemm+vE0Y50lZbrWkmysGedP31AnTVUXJk1d5yZOVr/LA28Vy9n6AU0vSeaaEiUzTVrRbCMyZxogtNyEwFyPdNMvSDXWIcVYi+TpGiT9cQOnp6rx/cPrSHz4E+Inrw3GTV5N4Okr3BwOnoVbL8rmlBLJbJNZMtsEuvAJD6pwavIa4u5fxXfjleaTExUi3oOSFxwCL8MttnROaZDO/Qa74ScqETvxI06OV4CnL9MfHyv1WzZwCZrXnIFSJvtTCcbhDWU4oS/FcV0JuKNXxEGQrGEafu0ZKCuWG/7Y2BV8O1aMqJGict5QyVomK+8w+OjRy8QAjg4rqnhq+fN2G3BE2xx7Gv7eJUQMKxA+JBfZCX87wGnww3KEDRXgkDbfd0nwOWh0lc0pdc6EP6y9iNDBC4bwoTz6I5bMeWfDHxzMR6gmDyH95zNowUuhcmPkkmIA/puB8/h6INcc1Jvzss0GrOuBg+CPaC/CuywWIT25i8Cfw4H+XAT3ZSfYBM8DVolnmgYdAR+uLcDGU/5wYb+D9Yc+QHB71oLw++/mILD3rNYH8tWUBshW6ajKvxXnB9fdm60GXPw3wT1s24LwQX3ZxAC+6pV5UhqwrsSOgud4zjOwOHwW9vbKoikNZFhuFi1728SzH8Fz/jHwysH3sU8tXRT+y54z+KJbpqA0ILDUq22BjxkpAefn04jVly+t8k8YeDVsKwLbnw2/t1uGPXekLdQGTL8aKOGHi7EheocV4O14NmJ0pfQr//ezPmwrZeUJ/Od3pNjTJdFRGkg31pmp2uZN7if/gtgUH4ATo8X0Ks/xxGsRHyKwXWYrPHZ3ik2UBlKna81UPf/GUwYevwnuSNGywXO6xAjoEFEbSDHWGKgOLHewEBuivOZBbYzzQ+TwJRvaZhv2tUnpwXeKwG4XUreQNT2wYdpEaRR4fQETpNoRWgXz8B0Z8GsTUh/ipKnqIltHZUR/ATwiFzbBWNt0PoL3bxdiV5uAeoyS3IbOnD9y9wI8Ij+aB8tk5f3bhfBtE8BHnRZFaYCETnQvqcN9ec80wQT8LnU6vFtTN1MaIIlZwmSVhu4NG9qTC/fI7csGv7M1bcDmNI8kZkvZ50O6s+F+dDvj8J+p07CzNTXeJnjrW9BXuJHEbCkfI/s7z8Ijeof1sefA+j4J35Ji8rnNX8eiIxL32f8lxUjl4a1KFtCCt76F+5UuMfoynbPhP1Xx9V7NSUvLTUlW6VT4lmR4t/B9WPaIZJXOgv/4d76QZa/Id2jUaNFlh8Or+GVbqnnPsZgQCVoj7inKHQhf6tUsYSbcfSwSeZOs0hFts4Wpyi8kklWGavJ1jI/KFv6Y3QfWVoVoc1xJ3Hdg4JyJiUvKW5Us8FHzXViOVrAmex1JzAL7sjW0dxt1moasB7Rv2OUQWbJI6ERyGxJ9kPSA0yU2cLpE5oDOTDO7Q2jwbxOoyD5PVmKyVf4nfrOuaEWs/7/+Atqs1blaLwVcAAAAAElFTkSuQmCC",upload:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC+ElEQVR4nO2aO2gUURSGP8T1AaImIGjUIkIMooj4KgRBbFJZiYVY2agIVj5WsDC9VklIsLNQwS2yhZVmN4KotYVPWERFLBbER1Y0aBy5cAaGZXZm7nhn92bmfnBg2T1n98x/z5z7mAWHw+FwOBwOh8MheDm3WLycmxMgDi/n5gSIw8u5OQHi8BLaPHAJGBAry3uFqYBySGy5SAJsCIldXyQBBkJiNxb9FricUdK3gDu2CTAvImTdBN8Ca4C1wAebBPC6YL+BA4HcDgJ/iiTA1ZD8rhdFgMfA0pD8lgPP8i7AV2AwIsftwM88C3AiQZ7n8yTAJ6ACnAK2JEkSWALU8yDAbdKjFl6fF7MAH4F+/o+jNgrQBI4BR6S8w3wWgMOY4Z1NAlSAdYHv6wNuhPhdwxw3bRCgKaMexqE23+fACoMCnOy1AJW2UW/nYcD3F7ATswz2SoBmxKh3Gn01f2fBMmAlsAnYD5wD7gKtrASoxIx62OjXZf7uJquBM7KrNCbAC40ERiXmC7AZcwzLFrwGvJKRbsnrmnymfHxUz7liSoBRzWSV/3HMsA+Y1ahUVXV7dX7AS2BqM9JtSsAk8DdFk1YxE/IdsXgGy98U/W29JK3NyrokEi/FIUWWlDRLPs4eyYzREdvKf9Lgxfs2HvWDXo/tvZz6+A0vyT0/F8i/lbAn7LFVgNOBXJKWfiMQ00gYM2OjAD+AVZLHNs3zQ58nGnHDtgmglq5pnjNOB+KmNeIu2ibA2UAeNY24qUDclEbcA9sEUJsYnzcdfFpyn6tSr8osMRKIG5H3quLTiGiMr20TQD1d9pnr4JOWuNnDCgGChyTfuyDAt6SO3TJ//u/pLWALM11ogvexmLTTYFUj7gIWM6RxIarUfZ5qxG3Fcuq9WArbxC55gBJ3MarJGdsM2cZEBrPNGIuIUsqnwKkPRGykz9CpUD3JkZjNlTCe8lB0Qco+7C83i44dwD2Ni1fdfjc5ZEj282pLqx6GqI2NspeywlOfKZ9I/gGPNfEFBL9FwQAAAABJRU5ErkJggg==",upArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAz0lEQVR4nO3YywrCMBBG4fOE1oWDC/vsCiq+RAuVQLpzvDVtJvAfCJSki/nIqgWllFJKKaUqtwfuwDU/N5kBAzDlNQI9jSOmFjHmIJrCHF8gBmcvvdvMTYzACTg4Z31LiLnwGPsCER5jPyDCYuwPRDiMLUCEwVgBRHWMFURUw9gKiM0xtiJiM4xtgFgdYxsi5opjaiCKY2oiimEiIBZjuoDfDkdnpjSr2y0Y4h0m/dBwewREeJg0q1uXpedPV1epDrjkGXe1h1FKKaWUUrTVE5bz7NyN3sYLAAAAAElFTkSuQmCC",downArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAgklEQVR4nO2UOwrAIBAF5xKReP+bJFV+TSxynATBQiSI0TXVDggW7htesYKiKIogE7ADRiDLZxzAXPJ4BW7ANcpNyPBZS8nAAJxh4AJshTTNGGsH7R/SFnmztEYuJv0iF5eWyLtJc/Lu0rfddMld4sPJErfs3jTFt9vC6d5UURSFmAePTDtnrV72/QAAAABJRU5ErkJggg==",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAABvUlEQVR4nO2XTUrDQBSAPwXBn7ps0TO4EFfd24obEfQQHqOt4qIewAt4BkFci+610IIW7MpFXQtWxJGRNxBK02k0qTPpfDCUvDbJ+/LezDQQCARmBpWTQe5EfEUFEcdQoSKOoUJFMmIZOAG6wEA+G8CSTxXRyd7F7A+3FhmnRI4lh2egAqwAVaAn8bovIl3JYXsoXpX4ky8iA8mhMBRflfh7miIlYJNsK1IZiu9I/DEtES3RAtrAIunTkBx60k4FkTBzpJaGiJEwvztL3+NnVdKr06hV68by8CYSiUroCfcpo5yBjE62LvcZyGdtgg6wihSBB/muA6xJNcyxbaOaFmqcSLQSLTlGnk5b4s2YCy/giEgpRsJQjrTYHnAAnAJXQD/mnKmLFEe00yialtdOfe76f4mULJWIYlqsL5XQFTmUfWbSa2Qm0kqYQNxqkuSBZCKiLO2UhGiLjmu/rSxEOilJJJH5kF19Pu05Mi30HnQOfMm9r/+wOCgX/v3uAi9y/1dg31cRpBMuI3lcyIuVdyKaOeAIeLPMqXHDCRHDBnCfB5HfEERcQ4XWcgwVKuIYKrcVUZ4PciMSCARmgG9mLvK/OR2iiQAAAABJRU5ErkJggg==",flag:"data:image/png;base64,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"},MM=({match:e,timeFormat:t})=>{var n,r,i,o;return s.jsxs(h.Box,{display:"flex",alignItems:"center",gap:.5,fontSize:"xs",children:[s.jsxs(h.Typography,{mr:1,children:["[",ft(e.kickoffAt).format(t),"]"]}),e.homeTeam.code?s.jsx(h.Tooltip,{title:e.homeTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",minWidth:"60px",justifyContent:"flex-end",children:[s.jsx(h.Typography,{children:e.homeTeam.code||e.homeTeam.name}),s.jsx(h.Avatar,{src:((n=e.homeTeam.assets)==null?void 0:n.logo)||Le.team,sx:{width:"20px",height:"20px"}})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{children:e.homeTeam.code||e.homeTeam.name}),s.jsx(h.Avatar,{src:((r=e.homeTeam.assets)==null?void 0:r.logo)||Le.team,sx:{width:"20px",height:"20px"}})]}),"-",e.awayTeam.code?s.jsx(h.Tooltip,{title:e.awayTeam.name,children:s.jsxs(h.Box,{display:"flex",gap:.5,alignItems:"center",children:[s.jsx(h.Avatar,{src:((i=e.awayTeam.assets)==null?void 0:i.logo)||Le.team,sx:{width:"20px",height:"20px"}})," ",s.jsx(h.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})}):s.jsxs(s.Fragment,{children:[s.jsx(h.Avatar,{src:((o=e.awayTeam.assets)==null?void 0:o.logo)||Le.team,sx:{width:"20px",height:"20px"}}),s.jsx(h.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})]})},Is=Be(s.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),LM=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),{sdk:l}=We(),c=()=>_(this,null,function*(){try{const p=yield l.topX.getGames({limit:50},!0),g=yield l.matchQuiz.getGames({limit:50},!0),v=[...p.data,...g.data];if(e.related&&e.related.length>0){const m=v.filter(b=>{var C;return(C=e.related)==null?void 0:C.some(w=>w.entity_id===b.id)}).map(b=>b.id);n(m)}i(v)}catch(d){console.error(d),f()}}),u=(d,p)=>{const g=p.map(v=>({entity_id:v,entity_type:"GAME",entity_relationship:"relatedTo"}));e.onChange(g)},f=()=>a(!o);return y.useEffect(()=>{c()},[]),s.jsxs(s.Fragment,{children:[r.length>0?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.label}),s.jsx(h.Select,{multiple:!0,indicator:s.jsx(Is,{}),defaultValue:t,renderValue:d=>s.jsx(h.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:d.map((p,g)=>s.jsx(h.Chip,{variant:"soft",color:"primary",children:p.label},`related-game-${p.label}-${g}`))}),onChange:u,sx:{minWidth:"15rem",[`& .${h.selectClasses.indicator}`]:{transition:"0.2s",[`&.${h.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(d=>s.jsx(h.Option,{value:d.id,children:d.title?d.title+` (${d.type})`:`Game with no title (${d.type}). ID: ${d.id}`},`related-game-title-${d.id}`))})]}):s.jsx(s.Fragment,{}),s.jsx(Ge,{showToast:o,message:"There was a problem witch fetching games for related options",color:"danger",hideToast:f})]})},BM=e=>{const[t,n]=y.useState([]),[r,i]=y.useState([]),[o,a]=y.useState(!1),{sdk:l}=We(),c=()=>_(this,null,function*(){try{const p=yield l.loyalty.getTemplates(void 0,!0);if(e.related&&e.related.length>0){const g=p.data.filter(v=>{var m;return(m=e.related)==null?void 0:m.some(b=>b.entity_id===v.id)}).map(v=>v.id);n(g)}i(p.data)}catch(d){console.error(d),f()}}),u=(d,p)=>{const g=p.map(v=>({entity_id:v,entity_type:"TEMPLATE",entity_relationship:"relatedTo"}));e.onChange(g)},f=()=>a(!o);return y.useEffect(()=>{c()},[]),s.jsxs(s.Fragment,{children:[r.length>0?s.jsxs(h.FormControl,{sx:()=>({marginBottom:"16px"}),children:[s.jsx(h.FormLabel,{color:"primary",children:e.label}),s.jsx(h.Select,{multiple:!0,indicator:s.jsx(Is,{}),defaultValue:t,renderValue:d=>s.jsx(h.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:d.map((p,g)=>s.jsx(h.Chip,{variant:"soft",color:"primary",children:p.label},`related-template-${p.label}-${g}`))}),onChange:u,sx:{minWidth:"15rem",[`& .${h.selectClasses.indicator}`]:{transition:"0.2s",[`&.${h.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(d=>s.jsx(h.Option,{value:d.id,children:d.name||`Template with no name. ID: ${d.id}`},`related-template-name-${d.id}`))})]}):s.jsx(s.Fragment,{}),s.jsx(Ge,{showToast:o,message:"There was a problem witch fetching templates for related options",color:"danger",hideToast:f})]})},wm=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="game"),Sm=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="template"),$M=e=>{const t=(n,r)=>{if(r==="games"){const i=Sm(e.related);e.onChange([...n,...i])}if(r==="templates"){const i=wm(e.related);e.onChange([...n,...i])}};return s.jsxs(s.Fragment,{children:[s.jsx(LM,{label:e.labels.games,related:wm(e.related),onChange:n=>t(n,"games")}),s.jsx(BM,{label:e.labels.templates,related:Sm(e.related),onChange:n=>t(n,"templates")})]})},FM=(e,t)=>{const[n,r]=y.useState(null),{https:i}=We(),o=()=>_(this,null,function*(){const a=yield i.getSchedulersByEntityId(e);if(a.ok){const l=yield a.json();r(l.data);return}r([])});return y.useEffect(()=>(o(),()=>r(null)),[e,t]),n},yi=({my:e})=>s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",my:e},children:s.jsx(h.CircularProgress,{variant:"solid",color:"neutral"})}),NM=["PENDING","LIVE","SETTLED"],zM=["OPEN"],jM=["ACTIVE","INACTIVE","EXPIRED"],UM=new Map().set("PENDING","Pending").set("LIVE","Live").set("SETTLED","Settled").set("CANCELED","Canceled").set("OPEN","Open").set("ACTIVE","Active").set("INACTIVE","Inactive").set("PENDING","Pending").set("EXPIRED","Expired"),Im=e=>{let t=[];return e.entityType==="CLASSIC_QUIZ"||e.entityType==="PERSONALITY_QUIZ"||e.entityType==="EITHER_OR"||e.entityType==="POLL"?t=Array.from(jM):e.entityType==="TEMPLATE"?t=Array.from(NM):t=Array.from(zM),s.jsx(s.Fragment,{children:t.map(n=>s.jsx(h.Option,{value:n,children:UM.get(n)},`${e.entityType}-${n}-status`))})};class VM{constructor(){J(this,"name","");J(this,"scheduled_task_config",{entity_id:"",entity_type:"",change:{status:""}});J(this,"trigger",{trigger_type:"DATETIME",date:""})}}const HM=Be(s.jsx("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3M12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1m1 4h-2v-2h2z"}),"WarningRounded"),WM=e=>{const[t,n]=y.useState(!1),{https:r}=We(),i=o=>_(this,null,function*(){if(o.stopPropagation(),n(!0),(yield r.deleteScheduledTask(e.taskId)).ok){n(!1),e.toggleToast("success",e.labels.deleteScheduledTaskMessage),e.refetchTasks(),e.toggleModal();return}n(!1),e.toggleToast("danger",e.labels.deleteScheduledTaskErrorMessage)});return s.jsx(s.Fragment,{children:s.jsx(h.Modal,{open:e.isOpen,onClose:e.toggleModal,children:s.jsxs(h.ModalDialog,{children:[s.jsxs(h.DialogTitle,{children:[s.jsx(HM,{}),e.labels.deleteScheduledTaskModalTitle]}),s.jsx(h.Divider,{}),s.jsx(h.DialogContent,{children:s.jsxs(h.Typography,{children:[e.labels.deleteScheduledTaskModalParagraph,s.jsx(h.Typography,{fontWeight:"bold",children:e.taskName}),"?"]})}),s.jsxs(h.DialogActions,{children:[s.jsx(h.Button,{loading:t,variant:"solid",color:"danger",onClick:o=>i(o),children:e.labels.delete}),s.jsx(h.Button,{variant:"plain",color:"neutral",onClick:o=>{o.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]})})})},GM=e=>{const[t,n]=y.useState(null),[r,i]=y.useState(""),[o,a]=y.useState(""),[l,c]=y.useState(""),[u,f]=y.useState(""),[d,p]=y.useState(!1),[g,v]=y.useState(!1),[m,b]=y.useState(!1),[C,w]=y.useState("success"),[x,I]=y.useState(""),[S,A]=y.useState(!1),E=y.useRef(!1),k=FM(e.entityId,E.current),{https:F}=We();if(!k)return s.jsx(yi,{my:10});const W=()=>A(!S),O=(M,V)=>{b(!0),w(M),I(V)},T=(M,V)=>{i(V.scheduled_task_config.change.status),c(V.trigger.date),n(M)},N=()=>_(this,null,function*(){p(!0);const M=$("CREATE","");if((yield F.setSchedulers(M,"CREATE",null)).ok){p(!1),a(""),f(""),E.current=!E.current,O("success",e.labels.createScheduledTaskMessage);return}p(!1),a(""),f(""),O("danger",e.labels.createScheduledTaskErrorMessage)}),H=(M,V)=>_(this,null,function*(){v(!0);const Y=$("UPDATE",V);if((yield F.setSchedulers(Y,"UPDATE",M)).ok){v(!1),n(null),i(""),c(""),E.current=!E.current,O("success",e.labels.updateScheduledTaskMessage);return}v(!1),O("danger",e.labels.updateScheduledTaskErrorMessage),n(null),i(""),c("")}),j=()=>{E.current=!E.current},$=(M,V)=>{const Y=new VM,X=M==="CREATE"?o:r,D=M==="CREATE"?null:V,L=M==="CREATE"?u:l;return Y.scheduled_task_config.entity_id=e.entityId,Y.scheduled_task_config.entity_type=e.entityType,Y.scheduled_task_config.change.status=X,Y.trigger.date=L,Y.name=D,Y};return s.jsxs(s.Fragment,{children:[k.map((M,V)=>s.jsx(h.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:s.jsx(h.CardContent,{children:t===V?s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%"},children:[s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),s.jsx(h.Select,{value:r,size:"sm",name:"status",onChange:(Y,X)=>i(X),sx:{minHeight:"36px"},children:s.jsx(Im,{entityType:e.entityType})})]}),s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.at}),s.jsx(ou,{defaultDate:l,onChange:Y=>c(Y)})]}),r&&l?s.jsx(h.Button,{onClick:()=>H(M.id,M.name),loading:g,sx:{mt:"auto"},children:e.labels.save}):s.jsx(h.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.save})]}):s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"}},children:[s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{style:{fontWeight:"bold"},children:[e.labels.name,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:M.name})]}),s.jsxs(h.Typography,{style:{color:"gray"},children:[e.labels.status,": ",s.jsx(h.Typography,{whiteSpace:"wrap",children:M.status})]})]}),!e.readOnly&&s.jsxs(h.Box,{children:[s.jsx(h.Tooltip,{title:e.labels.edit,children:s.jsx(h.IconButton,{onClick:()=>T(V,M),children:s.jsx(_e.Edit,{})})}),s.jsx(h.Tooltip,{title:e.labels.delete,children:s.jsx(h.IconButton,{onClick:W,children:s.jsx(_e.Delete,{})})})]}),s.jsx(WM,{labels:e.labels,isOpen:S,taskId:M.id,taskName:M.name,toggleModal:W,refetchTasks:j,toggleToast:O})]})})},`scheduled-task-${e.entityId}-${e.entityType}-${M.id}`)),!e.readOnly&&s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%",mt:k&&k.length?2:0},children:[s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),s.jsx(h.Select,{value:o,size:"sm",name:"status",onChange:(M,V)=>a(V),sx:{minHeight:"37px"},children:s.jsx(Im,{entityType:e.entityType})})]}),s.jsxs(h.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:e.labels.at}),s.jsx(ou,{defaultDate:u,onChange:M=>f(M)})]}),o&&u?s.jsx(h.Button,{onClick:N,loading:d,sx:{mt:"auto"},children:e.labels.create}):s.jsx(h.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.create})]}),s.jsx(Ge,{showToast:m,message:x,color:C,hideToast:()=>b(!1)})]})};function YM(e){return ut("MuiIconButton",e)}Ke("MuiIconButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","loading","loadingIndicator"]);const KM=["children","action","component","color","disabled","variant","loading","loadingIndicator","size","slots","slotProps"],qM=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,size:o,variant:a,loading:l}=e,c={root:["root",n&&"disabled",r&&"focusVisible",a&&`variant${we(a)}`,t&&`color${we(t)}`,o&&`size${we(o)}`,l&&"loading"],loadingIndicator:["loadingIndicator"]},u=pt(c,YM,{});return r&&i&&(u.root+=` ${i}`),u},QM=ye("button")(({theme:e,ownerState:t})=>{var n,r,i,o;return[R({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.instanceSize&&{"--IconButton-size":{sm:"2rem",md:"2.25rem",lg:"2.75rem"}[t.instanceSize]},t.size==="sm"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.6)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:e.vars.fontSize.sm,paddingInline:"2px"},t.size==="md"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.25rem) / 1.5)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2.25rem)",minHeight:"var(--IconButton-size, 2.25rem)",fontSize:e.vars.fontSize.md,paddingInline:"0.25rem"},t.size==="lg"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.75rem) / 1.571)","--CircularProgress-size":"28px","--CircularProgress-thickness":"4px",minWidth:"var(--IconButton-size, 2.75rem)",minHeight:"var(--IconButton-size, 2.75rem)",fontSize:e.vars.fontSize.lg,paddingInline:"0.375rem"},{WebkitTapHighlightColor:"transparent",paddingBlock:0,fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.md,margin:"var(--IconButton-margin)",borderRadius:`var(--IconButton-radius, ${e.vars.radius.sm})`,border:"none",boxSizing:"border-box",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",[e.focus.selector]:R({"--Icon-color":"currentColor"},e.focus.default)}),R({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":R({"--Icon-color":"currentColor"},(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color])},'&:active, &[aria-pressed="true"]':R({"--Icon-color":"currentColor"},(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]),"&:disabled":(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]})]}),JM=ye(QM,{name:"JoyIconButton",slot:"Root",overridesResolver:(e,t)=>t.root})({}),XM=ye("span",{name:"JoyIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e,ownerState:t})=>{var n,r;return R({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),Am=K.forwardRef(function(t,n){var r;const i=gt({props:t,name:"JoyIconButton"}),{children:o,action:a,component:l="button",color:c="neutral",disabled:u,variant:f="plain",loading:d=!1,loadingIndicator:p,size:g="md",slots:v={},slotProps:m={}}=i,b=De(i,KM),C=K.useContext($p),w=K.useContext(Fp),x=t.variant||C.variant||f,I=t.size||C.size||g,S=t.color||C.color||c,A=(r=t.loading||t.disabled)!=null?r:C.disabled||d||u,E=K.useRef(null),k=hn(E,n),{focusVisible:F,setFocusVisible:W,getRootProps:O}=Jl(R({},i,{disabled:A,rootRef:k})),T=p!=null?p:s.jsx(Lp,{color:S,thickness:{sm:2,md:3,lg:4}[I]||3});K.useImperativeHandle(a,()=>({focusVisible:()=>{var L;W(!0),(L=E.current)==null||L.focus()}}),[W]);const N=R({},i,{component:l,color:S,disabled:A,variant:x,loading:d,size:I,focusVisible:F,instanceSize:t.size}),H=qM(N),j=L=>{var U;let G=i.onClick;if(typeof m.root=="function"?G=m.root(N).onClick:m.root&&(G=m.root.onClick),(U=G)==null||U(L),w){var oe;(oe=w.onClick)==null||oe.call(w,L,i.value)}};let $=i["aria-pressed"];typeof m.root=="function"?$=m.root(N)["aria-pressed"]:m.root&&($=m.root["aria-pressed"]),w!=null&&w.value&&(Array.isArray(w.value)?$=w.value.indexOf(i.value)!==-1:$=w.value===i.value);const M=R({},b,{component:l,slots:v,slotProps:m}),[V,Y]=Ee("root",{ref:n,className:H.root,elementType:JM,getSlotProps:O,externalForwardedProps:M,ownerState:N,additionalProps:{onClick:j,"aria-pressed":$}}),[X,D]=Ee("loadingIndicator",{className:H.loadingIndicator,elementType:XM,externalForwardedProps:M,ownerState:N});return s.jsx(V,R({},Y,{children:d?s.jsx(X,R({},D,{children:T})):o}))});Am.muiName="IconButton";const As=Be(s.jsx("path",{d:"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"CloseRounded"),ZM=({label:e,defaultValue:t,options:n,required:r,onChange:i})=>{function o(c){var u,f;return c?s.jsxs(s.Fragment,{children:[s.jsx(h.ListItemDecorator,{children:s.jsx(h.Avatar,{size:"sm",src:((f=(u=n.find(d=>d.id===c.value))==null?void 0:u.assets)==null?void 0:f.logo)||Le.competition})}),c.label]}):null}const a=y.useRef(null),l=(c,u)=>{i(u)};return s.jsxs(h.FormControl,{sx:{mb:1},children:[s.jsx(h.FormLabel,{required:r,color:"primary",children:e}),s.jsx(h.Select,Q(B({slotProps:{button:{sx:{whiteSpace:"nowrap"}}},sx:{"--ListItemDecorator-size":"44px",minHeight:"37px"},renderValue:o,value:t,onChange:l},t&&{endDecorator:s.jsx(Am,{variant:"plain",color:"neutral",onMouseDown:c=>{c.stopPropagation()},onClick:()=>{var c;i(""),(c=a.current)==null||c.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(As,{})}),indicator:null}),{children:n.map((c,u)=>{var f;return s.jsxs(y.Fragment,{children:[u!==0?s.jsx(h.ListDivider,{role:"none"}):null,s.jsxs(h.Option,{value:c.id,label:c.name,children:[s.jsx(h.ListItemDecorator,{children:s.jsx(h.Avatar,{size:"sm",src:((f=c.assets)==null?void 0:f.logo)||Le.competition})}),c.name]})]},`${c.id}-${u}`)})}))]})};function eL(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Tm=eL,tL=typeof zt=="object"&&zt&&zt.Object===Object&&zt,nL=tL,rL=nL,iL=typeof self=="object"&&self&&self.Object===Object&&self,oL=rL||iL||Function("return this")(),Em=oL,aL=Em,sL=function(){return aL.Date.now()},lL=sL,cL=/\s/;function uL(e){for(var t=e.length;t--&&cL.test(e.charAt(t)););return t}var dL=uL,fL=dL,hL=/^\s+/;function pL(e){return e&&e.slice(0,fL(e)+1).replace(hL,"")}var gL=pL,mL=Em,vL=mL.Symbol,Iu=vL,km=Iu,_m=Object.prototype,bL=_m.hasOwnProperty,yL=_m.toString,Io=km?km.toStringTag:void 0;function xL(e){var t=bL.call(e,Io),n=e[Io];try{e[Io]=void 0;var r=!0}catch(o){}var i=yL.call(e);return r&&(t?e[Io]=n:delete e[Io]),i}var CL=xL,wL=Object.prototype,SL=wL.toString;function IL(e){return SL.call(e)}var AL=IL,Pm=Iu,TL=CL,EL=AL,kL="[object Null]",_L="[object Undefined]",Dm=Pm?Pm.toStringTag:void 0;function PL(e){return e==null?e===void 0?_L:kL:Dm&&Dm in Object(e)?TL(e):EL(e)}var DL=PL;function OL(e){return e!=null&&typeof e=="object"}var RL=OL,ML=DL,LL=RL,BL="[object Symbol]";function $L(e){return typeof e=="symbol"||LL(e)&&ML(e)==BL}var Om=$L,FL=gL,Rm=Tm,NL=Om,Mm=NaN,zL=/^[-+]0x[0-9a-f]+$/i,jL=/^0b[01]+$/i,UL=/^0o[0-7]+$/i,VL=parseInt;function HL(e){if(typeof e=="number")return e;if(NL(e))return Mm;if(Rm(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Rm(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=FL(e);var n=jL.test(e);return n||UL.test(e)?VL(e.slice(2),n?2:8):zL.test(e)?Mm:+e}var WL=HL,GL=Tm,Au=lL,Lm=WL,YL="Expected a function",KL=Math.max,qL=Math.min;function QL(e,t,n){var r,i,o,a,l,c,u=0,f=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(YL);t=Lm(t)||0,GL(n)&&(f=!!n.leading,d="maxWait"in n,o=d?KL(Lm(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p);function g(A){var E=r,k=i;return r=i=void 0,u=A,a=e.apply(k,E),a}function v(A){return u=A,l=setTimeout(C,t),f?g(A):a}function m(A){var E=A-c,k=A-u,F=t-E;return d?qL(F,o-k):F}function b(A){var E=A-c,k=A-u;return c===void 0||E>=t||E<0||d&&k>=o}function C(){var A=Au();if(b(A))return w(A);l=setTimeout(C,m(A))}function w(A){return l=void 0,p&&r?g(A):(r=i=void 0,a)}function x(){l!==void 0&&clearTimeout(l),u=0,r=c=i=l=void 0}function I(){return l===void 0?a:w(Au())}function S(){var A=Au(),E=b(A);if(r=arguments,i=this,c=A,E){if(l===void 0)return v(c);if(d)return clearTimeout(l),l=setTimeout(C,t),g(c)}return l===void 0&&(l=setTimeout(C,t)),a}return S.cancel=x,S.flush=I,S}var JL=QL;const cr=bn(JL),En=({option:e})=>s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:e.logo}),s.jsx(h.Typography,{children:e.label}),s.jsx(h.Typography,{ml:.5,level:"body-xs",children:`(${e.countryName})`})]}),Bm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||Le.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Le.flag}}))||[],XL=({labels:e,label:t,ids:n,required:r,onChange:i})=>{const[o,a]=y.useState([]),[l,c]=y.useState([]),[u,f]=y.useState(!1),[d,p]=y.useState(""),[g,v]=y.useState(!1),{sdk:m}=We(),b=()=>v(!g),C=(S,A)=>{a(A),i(A[0]?[A[0].id]:[])},w=3;y.useEffect(()=>{!d&&n&&n.length&&m.football.getCompetitions({competitionIds:n}).then(S=>{a(Bm(S))}).catch(S=>{console.error(S),b(),a([])})},[]);const x=y.useMemo(()=>cr(S=>{f(!0),m.football.getCompetitions({name:S}).then(A=>{c([...Bm(A)]),f(!1)}).catch(A=>{console.error(A),b(),c([]),f(!1)})},300),[]);y.useEffect(()=>{if(!d||d.length<w){c([]);return}return x(d),()=>x.cancel()},[d,x]);const I=(S,A)=>S.map((E,k)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:F=>A({index:k}).onClick(F),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(En,{option:E},`option_${E.id}`)},E.id));return s.jsxs(h.FormControl,{sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{required:r,color:"primary",children:t}),s.jsx(h.Box,{children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:u,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(S,A)=>S.id===A.id,endDecorator:u?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.competitionsSelectionPlaceholder,options:l,disabled:o.length===1,filterOptions:S=>S.filter(A=>!o.some(E=>E.value===A.value)),onInputChange:(S,A)=>{p(A)},onChange:C,getOptionKey:S=>S.id,value:o,renderTags:I,renderOption:(S,A)=>s.jsx(h.AutocompleteOption,Q(B({},S),{children:s.jsx(En,{option:A})}))})}),s.jsx(Ge,{showToast:g,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:b})]})},$m=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||Le.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Le.flag}}))||[],ZL=({labels:e,ids:t,scope:n,onChange:r})=>{const[i,o]=y.useState([]),[a,l]=y.useState([]),[c,u]=y.useState(!1),[f,d]=y.useState(""),[p,g]=y.useState(!1),{sdk:v}=We(),m=()=>g(!p),b=(I,S)=>{o(S);const A=S.map(E=>E.id);r(A&&A.length?A:null)},C=3;y.useEffect(()=>{!f&&t&&t.length&&v.football.getCompetitions({competitionIds:t}).then(I=>{o($m(I))}).catch(I=>{console.error(I),m(),o([])})},[]);const w=y.useMemo(()=>cr(I=>{u(!0);const S={name:I,competitionIds:[""]};n&&Array.isArray(n)&&n.length>0?S.competitionIds=Array.from(n):delete S.competitionIds,v.football.getCompetitions(S).then(A=>{l([...$m(A)]),u(!1)}).catch(A=>{console.error(A),m(),l([]),u(!1)})},300),[]);y.useEffect(()=>{if(!f||f.length<C){l([]);return}return w(f),()=>w.cancel()},[f,w]);const x=(I,S)=>I.map((A,E)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>S({index:E}).onClick(k),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(En,{option:A},`option_${A.id}`)},A.id));return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:c,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(I,S)=>I.id===S.id,endDecorator:c?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e.competitionsSelectionPlaceholder,options:a,filterOptions:I=>I.filter(S=>!i.some(A=>A.value===S.value)),onInputChange:(I,S)=>{d(S)},onChange:b,getOptionKey:I=>I.id,value:i,renderTags:x,renderOption:(I,S)=>s.jsx(h.AutocompleteOption,Q(B({},I),{children:s.jsx(En,{option:S})}))})}),s.jsx(Ge,{showToast:p,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:m})]})},Fm=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],e2=({labels:e,ids:t,onChange:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState([]),[l,c]=y.useState(!1),[u,f]=y.useState(""),[d,p]=y.useState(!1),{sdk:g}=We(),v=()=>p(!d),m=(x,I)=>{i(I);const S=I.map(A=>A.id);n(S&&S.length?S:null)},b=3;y.useEffect(()=>{!u&&t&&t.length&&g.profile.getByIds(t).then(x=>{i(Fm(x))}).catch(x=>{v(),console.error(x),i([])})},[]);const C=y.useMemo(()=>cr(x=>{c(!0),g.profile.getByIds([],x).then(I=>{a([...Fm(I)]),c(!1)}).catch(I=>{console.error(I),v(),a([]),c(!1)})},300),[]);y.useEffect(()=>{if(!u||u.length<b){a([]);return}return C(u),()=>C.cancel()},[u,C]);const w=(x,I)=>x.map((S,A)=>{var E;return s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:k=>I({index:A}).onClick(k),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(E=S.avatar)!=null?E:Le.avatar}),s.jsx(h.Typography,{children:S.label})]})},S.id)});return s.jsxs(s.Fragment,{children:[s.jsx(h.Box,{sx:{marginBottom:"16px"},children:s.jsx(h.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:l,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(x,I)=>x.id===I.id,endDecorator:l?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:x=>x.filter(I=>!r.some(S=>S.value===I.value)),onInputChange:(x,I)=>{f(I)},onChange:m,getOptionKey:x=>x.id,value:r,renderTags:w,renderOption:(x,I)=>{var S;return s.jsx(h.AutocompleteOption,Q(B({},x),{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",mr:1,children:[s.jsx(h.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(S=I.avatar)!=null?S:Le.avatar}),s.jsx(h.Typography,{children:I.label})]})}))}})}),s.jsx(Ge,{showToast:d,message:e.searchProfilesErrorMessage,color:"danger",hideToast:v})]})},Nm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Team with no name",label:t.name?t.name:"Team with no name",logo:((n=t.assets)==null?void 0:n.logo)||Le.team,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||Le.flag}}))||[],zm=({labels:e,ids:t,scope:n,readOnly:r,AdditionalCheckbox:i,onChange:o})=>{const[a,l]=y.useState([]),[c,u]=y.useState([]),[f,d]=y.useState(!1),[p,g]=y.useState(""),[v,m]=y.useState(!1),{sdk:b}=We(),C=()=>m(!v),w=(A,E)=>{l(E),o(E)},x=3;y.useEffect(()=>{!p&&t&&t.length&&b.football.getTeams({teamIds:t,scope:n}).then(A=>{const E=A.data.filter(k=>!k.name.includes("/"));l(Nm(E))}).catch(A=>{console.error(A),C(),l([])})},[]);const I=y.useMemo(()=>cr((A,E)=>{d(!0),b.football.getTeams({name:A,scope:E}).then(k=>{const F=k.data.filter(W=>!W.name.includes("/"));u([...Nm(F)]),d(!1)}).catch(k=>{console.error(k),C(),u([]),d(!1)})},300),[]);y.useEffect(()=>{if(!p||p.length<x){u([]);return}return I(p,n),()=>I.cancel()},[p,I]);const S=(A,E)=>A.map((k,F)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:W=>E({index:F}).onClick(W),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(En,{option:k},`option_${k.id}`)},k.id));return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{sx:{marginBottom:"16px"},children:[s.jsx(h.Autocomplete,{readOnly:r||!1,forcePopupIcon:!1,multiple:!0,loading:f,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38,marginBottom:i?1:0}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:f?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:a.length>0?"":e.teamsSelectionPlaceholder,options:c,filterOptions:A=>A.filter(E=>!a.some(k=>k.value===E.value)),onInputChange:(A,E)=>{g(E)},onChange:w,getOptionKey:A=>A.id,value:a,renderTags:S,renderOption:(A,E)=>s.jsx(h.AutocompleteOption,Q(B({},A),{children:s.jsx(En,{option:E})}))}),i]}),s.jsx(Ge,{showToast:v,message:e.searchTeamsErrorMessage,color:"danger",hideToast:C})]})},t2=({checked:e,disabled:t,sx:n,onChange:r})=>{const i=n?B({},n):{ml:1};return s.jsx(h.Switch,{color:e?"success":"danger",checked:e,disabled:t,onChange:o=>r(o.target.checked),sx:Q(B({},i),{"--Switch-thumbSize":"16px","--Switch-trackWidth":"40px","--Switch-trackHeight":"24px","--Switch-trackBackground":"#EE5E52","&:hover":{"--Switch-trackBackground":"#EE5E52"},[`&.${h.switchClasses.checked}`]:{"--Switch-trackBackground":"#5CB176","&:hover":{"--Switch-trackBackground":"#5CB176"}}})})},pn=({label:e,labelPosition:t="start",defaultValue:n,description:r,disabled:i,descriptionColor:o,sx:a,onChange:l})=>{const c=s.jsx(t2,{checked:n,disabled:i,onChange:l,sx:a==null?void 0:a.switch}),u=a!=null&&a.container?B({},a.container):{mb:2},f=a!=null&&a.label?B({},a.label):{};return r?s.jsxs(h.Box,{sx:B({},u),children:[s.jsx(h.Typography,{component:"label",startDecorator:t=="start"?void 0:c,endDecorator:t=="start"?c:void 0,sx:f,children:e}),s.jsx(h.Typography,{level:"body-sm",color:o||"neutral",children:r})]}):s.jsx(h.Typography,{sx:Object.keys(f)?B({},f):{mb:2},component:"label",startDecorator:t=="start"?void 0:c,endDecorator:t=="start"?c:void 0,children:e})},n2={control:(e,t)=>Q(B({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px","&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(B({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(B({},e),{minHeight:"36px"}),menu:e=>Q(B({},e),{position:"relative"}),clearIndicator:e=>Q(B({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(B({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(B({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(B({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"13px"}),multiValueLabel:e=>Q(B({},e),{color:"#333"})},r2=e=>e.map(t=>({label:t,value:t})),jm=e=>{const[t,n]=y.useState(""),[r,i]=y.useState(!1),o=r2(e.tags),a=()=>i(!r),l=d=>{e.onChange(d.map(p=>p.value))},c=d=>{n(d)},u=d=>{d.persist();const{key:p}=d;if(t)switch(p){case"Enter":case"Tab":if(e.tags&&e.tags.length===0){const g=[...e.tags,t];e.onChange(g)}if(e.tags&&e.tags.length>0&&f()){const g=[...e.tags,t];e.onChange(g)}n(""),d.preventDefault()}},f=()=>{let d=!1;return e.tags&&e.tags.length&&e.tags.includes(t)?(a(),d):(d=!0,d)};return s.jsxs(s.Fragment,{children:[s.jsx(ym,{styles:n2,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:l,onInputChange:c,onKeyDown:u,placeholder:e.labels.tagsPlaceholder,value:o}),s.jsx(Ge,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:a})]})},i2=Be(s.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos");class Um{constructor(){J(this,"contestId","");J(this,"contestType","");J(this,"description","");J(this,"userList",[])}}const o2=(e,t,n)=>{const[r,i]=y.useState(null),{sdk:o}=We(),a=()=>_(this,null,function*(){try{let l;switch(t){case"top_x":l=yield o.topX.getGameWinners(e,!0);break;case"match_quiz":l=yield o.matchQuiz.getGameWinners(e,!0);break;default:l=yield o.loyalty.getTemplateWinners(e,!0)}l.userList&&l.userList.forEach(c=>{c.tags||(c.tags=[])}),i(l)}catch(l){const c=o.helpers.getSDKConfiguration();let u=null;c.errorHandlingMode==="standard"?u=l.error:u=l.data.error,u.code!==404&&u.status!=="code_unknown_contest"&&n(),i(new Um)}});return y.useEffect(()=>{a()},[]),r};class a2{constructor(){J(this,"position","");J(this,"profileId","");J(this,"note","");J(this,"tags",[])}}function s2(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var l2=s2,c2=Array.isArray,u2=c2,Vm=Iu,d2=l2,f2=u2,h2=Om,p2=1/0,Hm=Vm?Vm.prototype:void 0,Wm=Hm?Hm.toString:void 0;function Gm(e){if(typeof e=="string")return e;if(f2(e))return d2(e,Gm)+"";if(h2(e))return Wm?Wm.call(e):"";var t=e+"";return t=="0"&&1/e==-p2?"-0":t}var g2=Gm,m2=g2;function v2(e){return e==null?"":m2(e)}var Ym=v2;function b2(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}var y2=b2;function x2(e){return function(t){return e==null?void 0:e[t]}}var C2=x2,w2=C2,S2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},I2=w2(S2),A2=I2,T2=A2,E2=Ym,k2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_2="\\u0300-\\u036f",P2="\\ufe20-\\ufe2f",D2="\\u20d0-\\u20ff",O2=_2+P2+D2,R2="["+O2+"]",M2=RegExp(R2,"g");function L2(e){return e=E2(e),e&&e.replace(k2,T2).replace(M2,"")}var B2=L2,$2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function F2(e){return e.match($2)||[]}var N2=F2,z2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function j2(e){return z2.test(e)}var U2=j2,Km="\\ud800-\\udfff",V2="\\u0300-\\u036f",H2="\\ufe20-\\ufe2f",W2="\\u20d0-\\u20ff",G2=V2+H2+W2,qm="\\u2700-\\u27bf",Qm="a-z\\xdf-\\xf6\\xf8-\\xff",Y2="\\xac\\xb1\\xd7\\xf7",K2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",q2="\\u2000-\\u206f",Q2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Jm="A-Z\\xc0-\\xd6\\xd8-\\xde",J2="\\ufe0e\\ufe0f",Xm=Y2+K2+q2+Q2,Zm="['’]",ev="["+Xm+"]",X2="["+G2+"]",tv="\\d+",Z2="["+qm+"]",nv="["+Qm+"]",rv="[^"+Km+Xm+tv+qm+Qm+Jm+"]",eB="\\ud83c[\\udffb-\\udfff]",tB="(?:"+X2+"|"+eB+")",nB="[^"+Km+"]",iv="(?:\\ud83c[\\udde6-\\uddff]){2}",ov="[\\ud800-\\udbff][\\udc00-\\udfff]",xi="["+Jm+"]",rB="\\u200d",av="(?:"+nv+"|"+rv+")",iB="(?:"+xi+"|"+rv+")",sv="(?:"+Zm+"(?:d|ll|m|re|s|t|ve))?",lv="(?:"+Zm+"(?:D|LL|M|RE|S|T|VE))?",cv=tB+"?",uv="["+J2+"]?",oB="(?:"+rB+"(?:"+[nB,iv,ov].join("|")+")"+uv+cv+")*",aB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",sB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",lB=uv+cv+oB,cB="(?:"+[Z2,iv,ov].join("|")+")"+lB,uB=RegExp([xi+"?"+nv+"+"+sv+"(?="+[ev,xi,"$"].join("|")+")",iB+"+"+lv+"(?="+[ev,xi+av,"$"].join("|")+")",xi+"?"+av+"+"+sv,xi+"+"+lv,sB,aB,tv,cB].join("|"),"g");function dB(e){return e.match(uB)||[]}var fB=dB,hB=N2,pB=U2,gB=Ym,mB=fB;function vB(e,t,n){return e=gB(e),t=n?void 0:t,t===void 0?pB(e)?mB(e):hB(e):e.match(t)||[]}var bB=vB,yB=y2,xB=B2,CB=bB,wB="['’]",SB=RegExp(wB,"g");function IB(e){return function(t){return yB(CB(xB(t).replace(SB,"")),e,"")}}var AB=IB,TB=AB,EB=TB(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),kB=EB;const _B=bn(kB);class PB{constructor(){J(this,"id","");J(this,"value","");J(this,"label","")}}class DB extends PB{constructor(){super(...arguments);J(this,"logo","");J(this,"countryFlag","");J(this,"countryName","")}}class dv extends DB{constructor(){super(...arguments);J(this,"group","")}}const OB=(e,t)=>t||e||"-------------",Tu=(e,t)=>Array.isArray(e)?e.map(n=>Tu(n)):e!=null&&e.constructor===Object?Object.keys(e).reduce((n,r)=>Q(B({},n),{[_B(r)]:Tu(e[r])}),{}):e,fv=e=>{const t=[];return e.competitions.forEach(n=>{t.push(Eu(n,"competition"))}),e.teams.forEach(n=>{t.push(Eu(n,"team"))}),e.players.forEach(n=>{t.push(Eu(n,"player"))}),t},Eu=(e,t)=>{var r,i,o,a,l;const n=new dv;return n.label=e.name,n.value=e.id,n.id=e.id,n.group=t,t==="player"?n.logo=((r=e.assets)==null?void 0:r.headshot)||Le.avatar:t==="team"?n.logo=((i=e.assets)==null?void 0:i.logo)||Le.team:n.logo=((o=e.assets)==null?void 0:o.logo)||Le.competition,n.countryName=e.country.name,n.countryFlag=((l=(a=e.country)==null?void 0:a.assets)==null?void 0:l.flag)||Le.country,n},RB=e=>{switch(e){case"CLASSIC_QUIZ":return"success";case"EITHER_OR":return"success";case"POLL":return"warning";case"TOP_X":return"primary";case"MATCH_QUIZ":return"primary";case"LEADERBOARD_TEMPLATES":return"neutral";default:return"neutral"}},MB=e=>{switch(e){case"CLASSIC_QUIZ":return"CLASSIC QUIZ";case"EITHER_OR":return"EITHER/OR";case"POLL":return"POLL";case"TOP_X":return"TOP X";case"MATCH_QUIZ":return"MATCH QUIZ";case"LEADERBOARD_TEMPLATES":return"LEADERBOARD TEMPLATES"}},LB=({profile:e,winner:t,labels:n,onChange:r,onRemove:i})=>{var b,C,w,x,I,S;const[o,a]=y.useState(t.position),[l,c]=y.useState(t.note),[u,f]=y.useState(t.tags),d=o||l||u.length>0,p=A=>{A.persist();const{value:E}=A.target;a(E),r("position",E)},g=A=>{A.persist();const{value:E}=A.target;c(E),r("note",E)},v=A=>{f(A),r("tags",A)},m=()=>{a(""),c(""),f([]),i()};return s.jsxs("tr",{style:{backgroundColor:d?"rgb(255 237 213)":""},children:[s.jsx("td",{children:s.jsx(h.Input,{name:"position",placeholder:"#",value:o,onChange:p,sx:{backgroundColor:"#fff"}})}),s.jsx("td",{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",children:[s.jsx(h.Avatar,{src:((b=e.profileModel)==null?void 0:b.avatar)||"",alt:((C=e.profileModel)==null?void 0:C.name)||"Unknown",sx:{mr:1}}),s.jsxs(h.Box,{children:[s.jsxs(h.Typography,{fontWeight:"md",children:[OB((w=e.profileModel)==null?void 0:w.name,(x=e.profileModel)==null?void 0:x.nickname),"  ",(I=e.profileModel)!=null&&I.name?s.jsxs(h.Typography,{children:["(",(S=e.profileModel)==null?void 0:S.name,")"]}):s.jsx(s.Fragment,{})]}),s.jsx(h.Typography,{fontSize:"sm",sx:{opacity:"0.5"},children:e.profileModel&&e.profileModel.country?e.profileModel.country.name:""})]})]})}),s.jsx("td",{style:{textAlign:"center"},children:e.points}),s.jsx("td",{style:{textAlign:"center"},children:e.predictionsMade}),s.jsx("td",{children:s.jsx(h.Input,{name:"note",value:l,placeholder:"This user has...",onChange:g,sx:{backgroundColor:"#fff"}})}),s.jsx("td",{children:s.jsx(jm,{labels:n,tags:u,onChange:v})}),s.jsx("td",{children:s.jsx(h.Tooltip,{title:n.clearWinner,children:s.jsx(h.IconButton,{onClick:m,variant:"outlined",color:"danger",disabled:!d,children:s.jsx(_e.Remove,{})})})})]})},BB=e=>{const t=(i,o,a)=>{if(e.winners.find(f=>f.profileId===i)){const f=e.winners.map(d=>d.profileId===i?Q(B({},d),{[o]:a}):d);r(f);return}const c=new a2;c.profileId=i,c[o]=a;const u=[...e.winners,c];r(u)},n=i=>{const o=e.winners.filter(a=>a.profileId!==i);r(o)},r=i=>{e.setWinnersRequestBody(o=>Q(B({},o),{userList:i}))};return e.leaderboard?s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"h4",children:e.labels.configureWinners}),e.leaderboard.length===0?s.jsx(h.Typography,{level:"body-lg",textAlign:"center",fontWeight:"bold",children:e.labels.noStandingsAvailable}):s.jsx(s.Fragment,{}),s.jsxs(h.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:last-child, & > tbody > tr > td:last-child":{textAlign:"center",width:"50px"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"70px"},children:e.labels.position}),s.jsx("th",{children:e.labels.nicknameAndName}),s.jsx("th",{style:{width:"70px",textAlign:"center"},children:e.labels.points}),s.jsx("th",{style:{width:"100px",textAlign:"center"},children:e.labels.predictions}),s.jsx("th",{children:e.labels.note}),s.jsx("th",{children:e.labels.tags}),s.jsx("th",{children:e.labels.actions})]})}),s.jsxs("tbody",{children:[e.leaderboard.length>0?e.leaderboard.map(i=>s.jsx(LB,{winner:e.winners.find(o=>o.profileId===i.profileId)||{position:"",profileId:"",note:"",tags:[]},profile:i,labels:e.labels,onChange:(o,a)=>t(i.profileId,o,a),onRemove:()=>n(i.profileId)},`winner-profile-${i.profileId}`)):s.jsx(s.Fragment,{}),s.jsx("tr",{children:s.jsx("td",{colSpan:7,children:e.hasMoreParticipants?s.jsx(h.Box,{textAlign:"center",my:1,children:s.jsx(h.Button,{variant:"plain",sx:{width:"100%"},onClick:()=>e.setPage(i=>i+1),loading:e.isLoading,children:e.labels.loadMore})}):s.jsx(s.Fragment,{})})})]})]})]}):s.jsx(yi,{my:40})},$B=(e,t,n,r,i)=>{const[o,a]=y.useState(null),[l,c]=y.useState(!1),[u,f]=y.useState(!1),{sdk:d}=We(),p=()=>_(this,null,function*(){f(!0);const g={limit:10,page:r},v=!0;try{let m;t==="template"?m=yield d.loyalty.getLeaderboard(e,g,v):m=yield d.loyalty.getLeaderboardForGame(e,g,v),m.meta.pagination.numberOfPages>r?c(!0):c(!1),o&&o.length?a(b=>[...b,...m.data]):a(m.data)}catch(m){console.error(m),i("danger",n),a([])}f(!1)});return y.useEffect(()=>{p()},[r]),{leaderboard:o,hasMoreParticipants:l,isLeaderboardLoading:u}};class FB{constructor(){J(this,"isValid",!0);J(this,"message","");J(this,"validate",(t,n,r)=>(this.validateField(t,n),this.validateWinnerIds(t,r),this));J(this,"validateField",(t,n)=>{const r=t.every(i=>i.position&&i.profileId);r||(this.isValid=r,this.message=n)});J(this,"validateWinnerIds",(t,n)=>{const r=t.map(o=>o.profileId),i=new Set(r);r.length!==i.size&&(this.isValid=!1,this.message=n)})}}const NB=e=>{const t=e.winners.userList.length>0&&(e.winners.userList[0].position||e.winners.userList[0].profileId||e.winners.userList[0].note||e.winners.userList[0].tags.length);return s.jsx(h.Card,{variant:"plain",children:t?s.jsxs(s.Fragment,{children:[s.jsx(h.Typography,{level:"body-lg",mb:2,fontWeight:"bold",children:e.labels.preview}),s.jsx(h.Sheet,{children:s.jsxs(h.Table,{sx:{"& > thead > tr > th:nth-of-type(n + 3), & > tbody > tr > td:nth-of-type(n + 3)":{textAlign:"right"},"& > thead > tr > th:nth-of-type(3), & > thead > tr > th:nth-of-type(4), & > tbody > tr > td:nth-of-type(3), & > tbody > tr > td:nth-of-type(4)":{fontSize:"sm",display:{xs:"none",md:"table-cell"}}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"3%"},children:"#"}),s.jsx("th",{children:e.labels.name}),s.jsx("th",{children:e.labels.note}),s.jsx("th",{children:e.labels.tags})]})}),s.jsx("tbody",{children:e.winners.userList.map(n=>{var i;const r=e.profiles.find(o=>o.id===n.profileId);return s.jsxs("tr",{children:[s.jsx("td",{children:n.position}),s.jsx("td",{children:s.jsxs(h.Box,{display:"flex",alignItems:"center",justifyContent:{xs:"center",md:"flex-start"},gap:2,children:[s.jsx(h.Avatar,{src:(r==null?void 0:r.avatar)||"",alt:(r==null?void 0:r.name)||"Unknown"}),s.jsxs(h.Box,{textAlign:"left",children:[s.jsxs(h.Typography,{fontWeight:"bold",children:[(r==null?void 0:r.nickname)||"-------------"," ",s.jsxs(h.Typography,{children:["(",(r==null?void 0:r.name)||"-------------",")"]})]}),s.jsx(h.Typography,{fontSize:"sm",color:"neutral",children:(i=r==null?void 0:r.country)==null?void 0:i.name})]})]})}),s.jsx("td",{children:n.note}),s.jsx("td",{children:n.tags.map(o=>s.jsx(h.Chip,{variant:"soft",color:"neutral",size:"sm",sx:{mr:1},children:o},`preview-winner-${n.profileId}-tag-${o}`))})]},`preview-winner-${n.profileId}`)})})]})})]}):s.jsx(h.Typography,{textAlign:"center",fontWeight:"bold",children:e.labels.noSetWinnersMessage})})},zB=e=>Object.keys(e).length?(e.userList||(e.userList=[]),e):new Um,jB=e=>{var S;const[t,n]=y.useState(zB(e.winners)),[r,i]=y.useState(((S=e.winners)==null?void 0:S.description)||""),[o,a]=y.useState(!1),[l,c]=y.useState(1),[u,f]=y.useState(!1),[d,p]=y.useState("danger"),[g,v]=y.useState(""),m=(A,E)=>{p(A),v(E),f(!0)},{leaderboard:b,hasMoreParticipants:C,isLeaderboardLoading:w}=$B(e.entityId,e.entityType,e.labels.leaderboardErrorMessage,l,m),{https:x}=We(),I=()=>_(this,null,function*(){a(!0);const A=JSON.parse(JSON.stringify(t));if(A.contestId=e.entityId,A.contestType=e.entityType==="template"?"TEMPLATE":"GAME",A.description=r,delete A.contestModel,A.userList.length>0){const k=new FB().validate(A.userList,e.labels.positionAndWinnerRequiredMessage,e.labels.sameChosenWinnerMessage);if(!k.isValid){m("danger",k.message),a(!1);return}}else delete A.userList;const E=Tu(A);try{yield x.setWinners(E),m("success",Object.keys(e.winners).length?e.labels.editWinnersMessage:e.labels.createWinnersMessage)}catch(k){console.error(k),m("danger",Object.keys(e.winners).length?e.labels.editWinnersErrorMessage:e.labels.createWinnersErrorMessage)}a(!1)});return s.jsxs(s.Fragment,{children:[s.jsx("section",{style:{marginRight:"auto",marginLeft:"auto"},children:s.jsx(h.Box,{width:"100%",overflow:"hidden",borderRadius:"4px",bgcolor:"#fff",children:s.jsxs(h.Box,{width:"100%",sx:{overflowX:"auto"},children:[s.jsxs(h.Card,{variant:"plain",children:[s.jsx(wc,{property:"description",label:e.labels.description,defaultValue:r,placeholder:e.labels.winnersDescription,onChange:A=>{i(A)}}),s.jsx(BB,{winners:t.userList,leaderboard:b,hasMoreParticipants:C,isLoading:w,setPage:c,setWinnersRequestBody:n,labels:e.labels}),s.jsx(h.Box,{textAlign:"center",my:3,children:s.jsx(h.Button,{variant:"solid",color:"primary",onClick:I,loading:o,children:e.labels.save})}),s.jsx(h.Divider,{sx:{my:4}})]}),b?s.jsx(NB,{winners:t,profiles:b.map(A=>A.profileModel),labels:e.labels}):s.jsx(s.Fragment,{})]})})}),s.jsx(Ge,{showToast:u,color:d,message:g,hideToast:()=>f(!1)})]})},UB=e=>{const[t,n]=y.useState(!1),r=()=>n(!0),i=o2(e.entityId,e.entityType,r);return i?s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{p:2,children:[s.jsx(h.Typography,{fontSize:"12px",sx:{cursor:"pointer"},startDecorator:s.jsx(i2,{fontSize:"inherit"}),onClick:e.onClickBack,children:e.labels.back}),s.jsxs(h.Typography,{level:"h3",children:[e.labels.manageWinners,":"," ",s.jsx(h.Typography,{level:"title-lg",fontWeight:"italic",children:e.entityName})]})]}),s.jsx(jB,{labels:e.labels,winners:i,entityId:e.entityId,entityType:e.entityType}),s.jsx(Ge,{showToast:t,color:"danger",message:e.labels.winnersErrorMessage,hideToast:()=>n(!1)})]}):s.jsx(yi,{my:50})},VB=10,HB=e=>{var d;const[t,n]=y.useState([]),[r,i]=y.useState(!1),[o,a]=y.useState(""),{sdk:l}=We(),c=y.useMemo(()=>cr(p=>{if(!p){n([]),i(!1);return}i(!0),l.football.search({query:p}).then(g=>{n([...fv(g)]),i(!1)}).catch(g=>{console.error(g),n([]),i(!1)})},300),[]);y.useEffect(()=>(c(o),()=>c.cancel()),[o,c]);const u=(p,g)=>{const v=g.map(m=>m.id);e.setOptions(g),e.handleResetData(),e.setFilters(m=>Q(B({},m),{entityIds:v}))},f=(p,g)=>p.map((v,m)=>s.jsx(h.Chip,{variant:"solid",endDecorator:s.jsx(h.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:b=>g({index:m}).onClick(b),children:s.jsx(_e.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:s.jsx(En,{option:v},`option_${v.id}`)},v.id));return s.jsxs(h.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[s.jsx(h.FormLabel,{sx:{fontSize:12},color:"primary",children:e.labels.contextEntityTag}),s.jsx(h.Autocomplete,{getOptionDisabled:()=>e.options.length===VB,forcePopupIcon:!1,multiple:!0,loading:r,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(p,g)=>p.id===g.id,endDecorator:r?s.jsx(h.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.options.length>0?"":e.labels.typeContextTagNamePlaceholder,options:t,filterOptions:p=>p.filter(g=>!e.options.some(v=>v.value===g.value)),onInputChange:(p,g)=>{a(g)},onChange:u,getOptionKey:p=>p.id,groupBy:p=>p.group+"s",value:(d=e.options)!=null?d:[],renderTags:f,renderOption:(p,g)=>s.jsx(h.AutocompleteOption,Q(B({},p),{children:s.jsx(En,{option:g})}))})]})};function hv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Ao;(function(e){e.event="event",e.props="prop"})(Ao||(Ao={}));function ur(){}function WB(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(o,a){return o===t[a]})||(t=r,n=e.apply(void 0,r)),n}}function To(e){return!!(e||"").match(/\d/)}function Ci(e){return e==null}function GB(e){return typeof e=="number"&&isNaN(e)}function pv(e){return Ci(e)||GB(e)||typeof e=="number"&&!isFinite(e)}function gv(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function YB(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function KB(e,t,n){var r=YB(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function qB(e){var t=y.useRef(e);t.current=e;var n=y.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function ku(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],a=i[1]||"";return{beforeDecimal:o,afterDecimal:a,hasNegation:n,addNegation:r}}function QB(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function mv(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function vv(e,t){return Array(t+1).join(e)}function bv(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],o=r[1];if(o=Number(o),!o)return n+i;i=i.replace(".","");var a=1+o,l=i.length;return a<0?i="0."+vv("0",Math.abs(a))+i:a>=l?i=i+vv("0",a-l):i=(i.substring(0,a)||"0")+"."+i.substring(a),n+i}function yv(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=ku(e),o=i.beforeDecimal,a=i.afterDecimal,l=i.hasNegation,c=parseFloat("0."+(a||"0")),u=a.length<=t?"0."+a:c.toFixed(t),f=u.split("."),d=o;o&&Number(f[0])&&(d=o.split("").reverse().reduce(function(m,b,C){return m.length>C?(Number(m[0])+Number(b)).toString()+m.substring(1,m.length):b+m},f[0]));var p=mv(f[1]||"",t,n),g=l?"-":"",v=r?".":"";return""+g+d+v+p}function Rr(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var xv=WB(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),JB=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function XB(e,t,n){return Math.min(Math.max(e,t),n)}function _u(e){return Math.max(e.selectionStart,e.selectionEnd)}function ZB(){return typeof navigator!="undefined"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function e$(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function t$(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function n$(e,t,n,r,i,o,a){a===void 0&&(a=t$);var l=i.findIndex(function(I){return I}),c=e.slice(0,l);!t&&!n.startsWith(c)&&(t=c,n=c+n,r=r+c.length);for(var u=n.length,f=e.length,d={},p=new Array(u),g=0;g<u;g++){p[g]=-1;for(var v=0,m=f;v<m;v++){var b=a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:g,formattedValueIndex:v});if(b&&d[v]!==!0){p[g]=v,d[v]=!0;break}}}for(var C=r;C<u&&(p[C]===-1||!o(n[C]));)C++;var w=C===u||p[C]===-1?f:p[C];for(C=r-1;C>0&&p[C]===-1;)C--;var x=C===-1||p[C]===-1?0:p[C]+1;return x>w?w:r-x<w-r?x:w}function Cv(e,t,n,r){var i=e.length;if(t=XB(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function r$(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(To(e[n])||To(e[n-1]));return t}function wv(e,t,n,r,i,o){o===void 0&&(o=ur);var a=qB(function(v,m){var b,C;return pv(v)?(C="",b=""):typeof v=="number"||m?(C=typeof v=="number"?bv(v):v,b=r(C)):(C=i(v,void 0),b=r(C)),{formattedValue:b,numAsString:C}}),l=y.useState(function(){return a(Ci(e)?t:e,n)}),c=l[0],u=l[1],f=function(v,m){v.formattedValue!==c.formattedValue&&u({formattedValue:v.formattedValue,numAsString:v.value}),o(v,m)},d=e,p=n;Ci(e)&&(d=c.numAsString,p=!0);var g=a(d,p);return y.useMemo(function(){u(g)},[g.formattedValue]),[c,f]}function i$(e){return e.replace(/[^0-9]/g,"")}function o$(e){return e}function a$(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,o=e.getInputRef,a=e.format;a===void 0&&(a=o$);var l=e.removeFormatting;l===void 0&&(l=i$);var c=e.defaultValue,u=e.valueIsNumericString,f=e.onValueChange,d=e.isAllowed,p=e.onChange;p===void 0&&(p=ur);var g=e.onKeyDown;g===void 0&&(g=ur);var v=e.onMouseUp;v===void 0&&(v=ur);var m=e.onFocus;m===void 0&&(m=ur);var b=e.onBlur;b===void 0&&(b=ur);var C=e.value,w=e.getCaretBoundary;w===void 0&&(w=r$);var x=e.isValidInputCharacter;x===void 0&&(x=To);var I=e.isCharacterSame,S=hv(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=wv(C,c,!!u,a,l,f),E=A[0],k=E.formattedValue,F=E.numAsString,W=A[1],O=y.useRef(),T=y.useRef({formattedValue:k,numAsString:F}),N=function(he,ge){T.current={formattedValue:he.formattedValue,numAsString:he.value},W(he,ge)},H=y.useState(!1),j=H[0],$=H[1],M=y.useRef(null),V=y.useRef({setCaretTimeout:null,focusTimeout:null});y.useEffect(function(){return $(!0),function(){clearTimeout(V.current.setCaretTimeout),clearTimeout(V.current.focusTimeout)}},[]);var Y=a,X=function(he,ge){var xe=parseFloat(ge);return{formattedValue:he,value:ge,floatValue:isNaN(xe)?void 0:xe}},D=function(he,ge,xe){he.selectionStart===0&&he.selectionEnd===he.value.length||(Rr(he,ge),V.current.setCaretTimeout=setTimeout(function(){he.value===xe&&he.selectionStart!==ge&&Rr(he,ge)},0))},L=function(he,ge,xe){return Cv(he,ge,w(he),xe)},U=function(he,ge,xe){var ke=w(ge),Ye=n$(ge,k,he,xe,ke,x,I);return Ye=Cv(ge,Ye,ke),Ye},G=function(he){var ge=he.formattedValue;ge===void 0&&(ge="");var xe=he.input,ke=he.source,Ye=he.event,Oe=he.numAsString,Pe;if(xe){var St=he.inputValue||xe.value,It=_u(xe);xe.value=ge,Pe=U(St,ge,It),Pe!==void 0&&D(xe,Pe,ge)}ge!==k&&N(X(ge,Oe),{event:Ye,source:ke})};y.useEffect(function(){var he=T.current,ge=he.formattedValue,xe=he.numAsString;(k!==ge||F!==xe)&&N(X(k,F),{event:void 0,source:Ao.props})},[k,F]);var oe=M.current?_u(M.current):void 0,ce=typeof window!="undefined"?y.useLayoutEffect:y.useEffect;ce(function(){var he=M.current;if(k!==T.current.formattedValue&&he){var ge=U(T.current.formattedValue,k,oe);he.value=k,D(he,ge,k)}},[k]);var se=function(he,ge,xe){var ke=ge.target,Ye=O.current?JB(O.current,ke.selectionEnd):xv(k,he),Oe=Object.assign(Object.assign({},Ye),{lastValue:k}),Pe=l(he,Oe),St=Y(Pe);if(Pe=l(St,void 0),d&&!d(X(St,Pe))){var It=ge.target,Mt=_u(It),_t=U(he,k,Mt);return It.value=k,D(It,_t,k),!1}return G({formattedValue:St,numAsString:Pe,inputValue:he,event:ge,source:xe,input:ge.target}),!0},Z=function(he,ge){ge===void 0&&(ge=0);var xe=he.selectionStart,ke=he.selectionEnd;O.current={selectionStart:xe,selectionEnd:ke+ge}},te=function(he){var ge=he.target,xe=ge.value,ke=se(xe,he,Ao.event);ke&&p(he),O.current=void 0},ne=function(he){var ge=he.target,xe=he.key,ke=ge.selectionStart,Ye=ge.selectionEnd,Oe=ge.value;Oe===void 0&&(Oe="");var Pe;xe==="ArrowLeft"||xe==="Backspace"?Pe=Math.max(ke-1,0):xe==="ArrowRight"?Pe=Math.min(ke+1,Oe.length):xe==="Delete"&&(Pe=ke);var St=0;xe==="Delete"&&ke===Ye&&(St=1);var It=xe==="ArrowLeft"||xe==="ArrowRight";if(Pe===void 0||ke!==Ye&&!It){g(he),Z(ge,St);return}var Mt=Pe;if(It){var _t=xe==="ArrowLeft"?"left":"right";Mt=L(Oe,Pe,_t),Mt!==Pe&&he.preventDefault()}else xe==="Delete"&&!x(Oe[Pe])?Mt=L(Oe,Pe,"right"):xe==="Backspace"&&!x(Oe[Pe])&&(Mt=L(Oe,Pe,"left"));Mt!==Pe&&D(ge,Mt,Oe),g(he),Z(ge,St)},de=function(he){var ge=he.target,xe=function(){var ke=ge.selectionStart,Ye=ge.selectionEnd,Oe=ge.value;if(Oe===void 0&&(Oe=""),ke===Ye){var Pe=L(Oe,ke);Pe!==ke&&D(ge,Pe,Oe)}};xe(),requestAnimationFrame(function(){xe()}),v(he),Z(ge)},ve=function(he){he.persist&&he.persist();var ge=he.target,xe=he.currentTarget;M.current=ge,V.current.focusTimeout=setTimeout(function(){var ke=ge.selectionStart,Ye=ge.selectionEnd,Oe=ge.value;Oe===void 0&&(Oe="");var Pe=L(Oe,ke);Pe!==ke&&!(ke===0&&Ye===Oe.length)&&D(ge,Pe,Oe),m(Object.assign(Object.assign({},he),{currentTarget:xe}))},0)},Fe=function(he){M.current=null,clearTimeout(V.current.focusTimeout),clearTimeout(V.current.setCaretTimeout),b(he)},st=j&&ZB()?"numeric":void 0,Je=Object.assign({inputMode:st},S,{type:t,value:k,onChange:te,onKeyDown:ne,onMouseUp:de,onFocus:ve,onBlur:Fe});if(n==="text")return i?y.createElement(y.Fragment,null,i(k,S)||null):y.createElement("span",Object.assign({},S,{ref:o}),k);if(r){var vt=r;return y.createElement(vt,Object.assign({},Je,{ref:o}))}return y.createElement("input",Object.assign({},Je,{ref:o}))}function Sv(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var a=t.allowNegative,l=t.thousandsGroupStyle;if(l===void 0&&(l="thousand"),e===""||e==="-")return e;var c=Ts(t),u=c.thousandSeparator,f=c.decimalSeparator,d=n!==0&&e.indexOf(".")!==-1||n&&r,p=ku(e,a),g=p.beforeDecimal,v=p.afterDecimal,m=p.addNegation;return n!==void 0&&(v=mv(v,n,!!r)),u&&(g=KB(g,u,l)),i&&(g=i+g),o&&(v=v+o),m&&(g="-"+g),e=g+(d&&f||"")+v,e}function Ts(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function s$(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function l$(e,t){return new RegExp("(^-)|[0-9]|"+gv(e),"g")}function c$(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function u$(e,t,n){var r;t===void 0&&(t=e$(e));var i=n.allowNegative,o=n.prefix;o===void 0&&(o="");var a=n.suffix;a===void 0&&(a="");var l=n.decimalScale,c=t.from,u=t.to,f=u.start,d=u.end,p=Ts(n),g=p.allowedDecimalSeparators,v=p.decimalSeparator,m=e[d]===v;if(To(e)&&(e===o||e===a)&&t.lastValue==="")return e;if(d-f===1&&g.indexOf(e[f])!==-1){var b=l===0?"":v;e=e.substring(0,f)+b+e.substring(f+1,e.length)}var C=function(M,V,Y){var X=!1,D=!1;o.startsWith("-")?X=!1:M.startsWith("--")?(X=!1,D=!0):a.startsWith("-")&&M.length===a.length?X=!1:M[0]==="-"&&(X=!0);var L=X?1:0;return D&&(L=2),L&&(M=M.substring(L),V-=L,Y-=L),{value:M,start:V,end:Y,hasNegation:X}},w=C(e,f,d),x=w.hasNegation;r=w,e=r.value,f=r.start,d=r.end;var I=C(t.lastValue,c.start,c.end),S=I.start,A=I.end,E=I.value,k=e.substring(f,d);e.length&&E.length&&(S>E.length-a.length||A<o.length)&&!(k&&a.startsWith(k))&&(e=E);var F=0;e.startsWith(o)?F+=o.length:f<o.length&&(F=f),e=e.substring(F),d-=F;var W=e.length,O=e.length-a.length;e.endsWith(a)?W=O:(d>O||d>e.length-a.length)&&(W=d),e=e.substring(0,W),e=s$(x?"-"+e:e,i),e=(e.match(l$(v))||[]).join("");var T=e.indexOf(v);e=e.replace(new RegExp(gv(v),"g"),function(M,V){return V===T?".":""});var N=ku(e,i),H=N.beforeDecimal,j=N.afterDecimal,$=N.addNegation;return u.end-u.start<c.end-c.start&&H===""&&m&&!parseFloat(j)&&(e=$?"-":""),e}function d$(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,n.length+(o?1:0));var a=e.length;return i.fill(!1,a-r.length+1,a+1),i}function f$(e){var t=Ts(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
2464
2464
  Decimal separator can't be same as thousand separator.
2465
2465
  thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
2466
2466
  decimalSeparator: `+r+` (default value for decimalSeparator is .)
@@ -2472,7 +2472,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2472
2472
  To pick up a draggable item, press the space bar.
2473
2473
  While dragging, use the arrow keys to move the item.
2474
2474
  Press space again to drop the item in its new position, or press escape to cancel.
2475
- `},F$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function N$(e){let{announcements:t=F$,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=$$}=e;const{announce:o,announcement:a}=M$(),l=Po("DndLiveRegion"),[c,u]=y.useState(!1);if(y.useEffect(()=>{u(!0)},[]),L$(y.useMemo(()=>({onDragStart(d){let{active:p}=d;o(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:g}=d;t.onDragMove&&o(t.onDragMove({active:p,over:g}))},onDragOver(d){let{active:p,over:g}=d;o(t.onDragOver({active:p,over:g}))},onDragEnd(d){let{active:p,over:g}=d;o(t.onDragEnd({active:p,over:g}))},onDragCancel(d){let{active:p,over:g}=d;o(t.onDragCancel({active:p,over:g}))}}),[o,t])),!c)return null;const f=y.createElement(y.Fragment,null,y.createElement(O$,{id:r,value:i.draggable}),y.createElement(R$,{id:l,announcement:a}));return n?yt.createPortal(f,n):f}var wt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(wt||(wt={}));function Rs(){}function Ms(e,t){return y.useMemo(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function kv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const mn=Object.freeze({x:0,y:0});function z$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function j$(e,t){const n=Os(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function U$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function V$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function _v(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Pv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const H$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=_v(t),o=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const u=_v(c),f=i.reduce((p,g,v)=>p+z$(u[v],g),0),d=Number((f/4).toFixed(4));o.push({id:l,data:{droppableContainer:a,value:d}})}}return o.sort(U$)};function W$(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,l=o-n;if(r<i&&n<o){const c=t.width*t.height,u=e.width*e.height,f=a*l,d=f/(c+u-f);return Number(d.toFixed(4))}return 0}const G$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=W$(l,t);c>0&&i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(V$)};function Y$(e,t,n){return Q(B({},e),{scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1})}function Dv(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:mn}function K$(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,l)=>Q(B({},a),{top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),B({},n))}}const q$=K$(1);function Ov(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Q$(e,t,n){const r=Ov(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:l}=r,c=e.left-a-(1-i)*parseFloat(n),u=e.top-l-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),f=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c}}const J$={ignoreTransform:!1};function Ai(e,t){t===void 0&&(t=J$);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=Ft(e).getComputedStyle(e);u&&(n=Q$(n,u,f))}const{top:r,left:i,width:o,height:a,bottom:l,right:c}=n;return{top:r,left:i,width:o,height:a,bottom:l,right:c}}function Rv(e){return Ai(e,{ignoreTransform:!0})}function X$(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Z$(e,t){return t===void 0&&(t=Ft(e).getComputedStyle(e)),t.position==="fixed"}function eF(e,t){t===void 0&&(t=Ft(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function Ls(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ou(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Eo(i)||Iv(i)||n.includes(i))return n;const o=Ft(e).getComputedStyle(i);return i!==e&&eF(i,o)&&n.push(i),Z$(i,o)?n:r(i.parentNode)}return e?r(e):n}function Mv(e){const[t]=Ls(e,1);return t!=null?t:null}function Mu(e){return!Es||!e?null:wi(e)?e:Du(e)?Ou(e)||e===Si(e).scrollingElement?window:Eo(e)?e:null:null}function Lv(e){return wi(e)?e.scrollX:e.scrollLeft}function Bv(e){return wi(e)?e.scrollY:e.scrollTop}function Lu(e){return{x:Lv(e),y:Bv(e)}}var kt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(kt||(kt={}));function $v(e){return!Es||!e?!1:e===document.scrollingElement}function Fv(e){const t={x:0,y:0},n=$v(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:l,maxScroll:r,minScroll:t}}const tF={x:.2,y:.2};function nF(e,t,n,r,i){let{top:o,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=tF);const{isTop:u,isBottom:f,isLeft:d,isRight:p}=Fv(e),g={x:0,y:0},v={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+m.height?(g.y=kt.Backward,v.y=r*Math.abs((t.top+m.height-o)/m.height)):!f&&c>=t.bottom-m.height&&(g.y=kt.Forward,v.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!p&&l>=t.right-m.width?(g.x=kt.Forward,v.x=r*Math.abs((t.right-m.width-l)/m.width)):!d&&a<=t.left+m.width&&(g.x=kt.Backward,v.x=r*Math.abs((t.left+m.width-a)/m.width)),{direction:g,speed:v}}function rF(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Nv(e){return e.reduce((t,n)=>Ii(t,Lu(n)),mn)}function iF(e){return e.reduce((t,n)=>t+Lv(n),0)}function oF(e){return e.reduce((t,n)=>t+Bv(n),0)}function zv(e,t){if(t===void 0&&(t=Ai),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);Mv(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const aF=[["x",["left","right"],iF],["y",["top","bottom"],oF]];class Bu{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ls(n),i=Nv(r);this.rect=B({},t),this.width=t.width,this.height=t.height;for(const[o,a,l]of aF)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=l(r),f=i[o]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Oo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function sF(e){const{EventTarget:t}=Ft(e);return e instanceof t?e:Si(e)}function $u(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(_i(n,2)+_i(r,2))>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var un;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(un||(un={}));function jv(e){e.preventDefault()}function lF(e){e.stopPropagation()}var Re;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Re||(Re={}));const Uv={start:[Re.Space,Re.Enter],cancel:[Re.Esc],end:[Re.Space,Re.Enter,Re.Tab]},cF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Re.Right:return Q(B({},n),{x:n.x+25});case Re.Left:return Q(B({},n),{x:n.x-25});case Re.Down:return Q(B({},n),{y:n.y+25});case Re.Up:return Q(B({},n),{y:n.y-25})}};class Bs{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Oo(Si(n)),this.windowListeners=new Oo(Ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(un.Resize,this.handleCancel),this.windowListeners.add(un.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(un.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&zv(r),n(mn)}handleKeyDown(t){if(Ds(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=Uv,coordinateGetter:a=cF,scrollBehavior:l="smooth"}=i,{code:c}=t;if(o.end.includes(c)){this.handleEnd(t);return}if(o.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:mn;this.referenceCoordinates||(this.referenceCoordinates=f);const d=a(t,{active:n,context:r.current,currentCoordinates:f});if(d){const p=Do(d,f),g={x:0,y:0},{scrollableAncestors:v}=r.current;for(const m of v){const b=t.code,{isTop:C,isRight:w,isLeft:x,isBottom:I,maxScroll:S,minScroll:A}=Fv(m),E=rF(m),k={x:Math.min(b===Re.Right?E.right-E.width/2:E.right,Math.max(b===Re.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(b===Re.Down?E.bottom-E.height/2:E.bottom,Math.max(b===Re.Down?E.top:E.top+E.height/2,d.y))},F=b===Re.Right&&!w||b===Re.Left&&!x,W=b===Re.Down&&!I||b===Re.Up&&!C;if(F&&k.x!==d.x){const O=m.scrollLeft+p.x,T=b===Re.Right&&O<=S.x||b===Re.Left&&O>=A.x;if(T&&!p.y){m.scrollTo({left:O,behavior:l});return}T?g.x=m.scrollLeft-O:g.x=b===Re.Right?m.scrollLeft-S.x:m.scrollLeft-A.x,g.x&&m.scrollBy({left:-g.x,behavior:l});break}else if(W&&k.y!==d.y){const O=m.scrollTop+p.y,T=b===Re.Down&&O<=S.y||b===Re.Up&&O>=A.y;if(T&&!p.x){m.scrollTo({top:O,behavior:l});return}T?g.y=m.scrollTop-O:g.y=b===Re.Down?m.scrollTop-S.y:m.scrollTop-A.y,g.y&&m.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Ii(Do(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Bs.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Uv,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const l=o.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Vv(e){return!!(e&&"distance"in e)}function Hv(e){return!!(e&&"delay"in e)}class Fu{constructor(t,n,r){var i;r===void 0&&(r=sF(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=Si(a),this.documentListeners=new Oo(this.document),this.listeners=new Oo(r),this.windowListeners=new Oo(Ft(a)),this.initialCoordinates=(i=Os(o))!=null?i:mn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(un.Resize,this.handleCancel),this.windowListeners.add(un.DragStart,jv),this.windowListeners.add(un.VisibilityChange,this.handleCancel),this.windowListeners.add(un.ContextMenu,jv),this.documentListeners.add(un.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Hv(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Vv(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(un.Click,lF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(un.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!i)return;const c=(n=Os(t))!=null?n:mn,u=Do(i,c);if(!r&&l){if(Vv(l)){if(l.tolerance!=null&&$u(u,l.tolerance))return this.handleCancel();if($u(u,l.distance))return this.handleStart()}if(Hv(l)&&$u(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Re.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const uF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class $s extends Fu{constructor(t){const{event:n}=t,r=Si(n.target);super(t,uF,r)}}$s.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const dF={move:{name:"mousemove"},end:{name:"mouseup"}};var Nu;(function(e){e[e.RightClick=2]="RightClick"})(Nu||(Nu={}));class fF extends Fu{constructor(t){super(t,dF,Si(t.event.target))}}fF.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Nu.RightClick?!1:(r==null||r({event:n}),!0)}}];const zu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class hF extends Fu{constructor(t){super(t,zu)}static setup(){return window.addEventListener(zu.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(zu.move.name,t)};function t(){}}}hF.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Ro;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ro||(Ro={}));var Fs;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Fs||(Fs={}));function pF(e){let{acceleration:t,activator:n=Ro.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:l=Fs.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:p}=e;const g=mF({delta:d,disabled:!o}),[v,m]=E$(),b=y.useRef({x:0,y:0}),C=y.useRef({x:0,y:0}),w=y.useMemo(()=>{switch(n){case Ro.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ro.DraggableRect:return i}},[n,i,c]),x=y.useRef(null),I=y.useCallback(()=>{const A=x.current;if(!A)return;const E=b.current.x*C.current.x,k=b.current.y*C.current.y;A.scrollBy(E,k)},[]),S=y.useMemo(()=>l===Fs.TreeOrder?[...u].reverse():u,[l,u]);y.useEffect(()=>{if(!o||!u.length||!w){m();return}for(const A of S){if((r==null?void 0:r(A))===!1)continue;const E=u.indexOf(A),k=f[E];if(!k)continue;const{direction:F,speed:W}=nF(A,k,w,t,p);for(const O of["x","y"])g[O][F[O]]||(W[O]=0,F[O]=0);if(W.x>0||W.y>0){m(),x.current=A,v(I,a),b.current=W,C.current=F;return}}b.current={x:0,y:0},C.current={x:0,y:0},m()},[t,I,r,m,o,a,JSON.stringify(w),JSON.stringify(g),v,u,S,f,JSON.stringify(p)])}const gF={x:{[kt.Backward]:!1,[kt.Forward]:!1},y:{[kt.Backward]:!1,[kt.Forward]:!1}};function mF(e){let{delta:t,disabled:n}=e;const r=Ps(t);return _o(i=>{if(n||!r||!i)return gF;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[kt.Backward]:i.x[kt.Backward]||o.x===-1,[kt.Forward]:i.x[kt.Forward]||o.x===1},y:{[kt.Backward]:i.y[kt.Backward]||o.y===-1,[kt.Forward]:i.y[kt.Forward]||o.y===1}}},[n,t,r])}function vF(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return _o(i=>{var o;return t==null?null:(o=r!=null?r:i)!=null?o:null},[r,t])}function bF(e,t){return y.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var Mo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Mo||(Mo={}));var ju;(function(e){e.Optimized="optimized"})(ju||(ju={}));const Wv=new Map;function yF(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=y.useState(null),{frequency:l,measure:c,strategy:u}=i,f=y.useRef(e),d=b(),p=ko(d),g=y.useCallback(function(C){C===void 0&&(C=[]),!p.current&&a(w=>w===null?C:w.concat(C.filter(x=>!w.includes(x))))},[p]),v=y.useRef(null),m=_o(C=>{if(d&&!n)return Wv;if(!C||C===Wv||f.current!==e||o!=null){const w=new Map;for(let x of e){if(!x)continue;if(o&&o.length>0&&!o.includes(x.id)&&x.rect.current){w.set(x.id,x.rect.current);continue}const I=x.node.current,S=I?new Bu(c(I),I):null;x.rect.current=S,S&&w.set(x.id,S)}return w}return C},[e,o,n,d,c]);return y.useEffect(()=>{f.current=e},[e]),y.useEffect(()=>{d||g()},[n,d]),y.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),y.useEffect(()=>{d||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{g(),v.current=null},l))},[l,d,g,...r]),{droppableRects:m,measureDroppableContainers:g,measuringScheduled:o!=null};function b(){switch(u){case Mo.Always:return!1;case Mo.BeforeDragging:return n;default:return!n}}}function Uu(e,t){return _o(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function xF(e,t){return Uu(e,t)}function CF(e){let{callback:t,disabled:n}=e;const r=ks(t),i=y.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ns(e){let{callback:t,disabled:n}=e;const r=ks(t),i=y.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function wF(e){return new Bu(Ai(e),e)}function Gv(e,t,n){t===void 0&&(t=wF);const[r,i]=y.useState(null);function o(){i(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c!=null?c:n)!=null?u:null}const f=t(e);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const a=CF({callback(c){if(e)for(const u of c){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){o();break}}}}),l=Ns({callback:o});return gn(()=>{o(),e?(l==null||l.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[e]),r}function SF(e){const t=Uu(e);return Dv(e,t)}const Yv=[];function IF(e){const t=y.useRef(e),n=_o(r=>e?r&&r!==Yv&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ls(e):Yv,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function AF(e){const[t,n]=y.useState(null),r=y.useRef(e),i=y.useCallback(o=>{const a=Mu(o.target);a&&n(l=>l?(l.set(a,Lu(a)),new Map(l)):null)},[]);return y.useEffect(()=>{const o=r.current;if(e!==o){a(o);const l=e.map(c=>{const u=Mu(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Lu(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(o)};function a(l){l.forEach(c=>{const u=Mu(c);u==null||u.removeEventListener("scroll",i)})}},[i,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>Ii(o,a),mn):Nv(e):mn,[e,t])}function Kv(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const r=e!==mn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Do(e,n.current):mn}function TF(e){y.useEffect(()=>{if(!Es)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function EF(e,t){return y.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function qv(e){return y.useMemo(()=>e?X$(e):null,[e])}const Qv=[];function kF(e,t){t===void 0&&(t=Ai);const[n]=e,r=qv(n?Ft(n):null),[i,o]=y.useState(Qv);function a(){o(()=>e.length?e.map(c=>$v(c)?r:new Bu(t(c),c)):Qv)}const l=Ns({callback:a});return gn(()=>{l==null||l.disconnect(),a(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),i}function Jv(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Eo(t)?t:e}function _F(e){let{measure:t}=e;const[n,r]=y.useState(null),i=y.useCallback(u=>{for(const{target:f}of u)if(Eo(f)){r(d=>{const p=t(f);return d?Q(B({},d),{width:p.width,height:p.height}):p});break}},[t]),o=Ns({callback:i}),a=y.useCallback(u=>{const f=Jv(u);o==null||o.disconnect(),f&&(o==null||o.observe(f)),r(f?t(f):null)},[t,o]),[l,c]=_s(a);return y.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const PF=[{sensor:$s,options:{}},{sensor:Bs,options:{}}],DF={current:{}},zs={draggable:{measure:Rv},droppable:{measure:Rv,strategy:Mo.WhileDragging,frequency:ju.Optimized},dragOverlay:{measure:Ai}};class Lo extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const OF={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Lo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Rs},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:zs,measureDroppableContainers:Rs,windowRect:null,measuringScheduled:!1},Xv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Rs,draggableNodes:new Map,over:null,measureDroppableContainers:Rs},Bo=y.createContext(Xv),Zv=y.createContext(OF);function RF(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Lo}}}function MF(e,t){switch(t.type){case wt.DragStart:return Q(B({},e),{draggable:Q(B({},e.draggable),{initialCoordinates:t.initialCoordinates,active:t.active})});case wt.DragMove:return e.draggable.active==null?e:Q(B({},e),{draggable:Q(B({},e.draggable),{translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}})});case wt.DragEnd:case wt.DragCancel:return Q(B({},e),{draggable:Q(B({},e.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case wt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Lo(e.droppable.containers);return i.set(r,n),Q(B({},e),{droppable:Q(B({},e.droppable),{containers:i})})}case wt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Lo(e.droppable.containers);return a.set(n,Q(B({},o),{disabled:i})),Q(B({},e),{droppable:Q(B({},e.droppable),{containers:a})})}case wt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Lo(e.droppable.containers);return o.delete(n),Q(B({},e),{droppable:Q(B({},e.droppable),{containers:o})})}default:return e}}function LF(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=y.useContext(Bo),o=Ps(r),a=Ps(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!Ds(o)||document.activeElement===o.target)return;const l=i.get(a);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const d=P$(f);if(d){d.focus();break}}})}},[r,t,i,a,o]),null}function eb(e,t){let i=t,{transform:n}=i,r=Qe(i,["transform"]);return e!=null&&e.length?e.reduce((o,a)=>a(B({transform:o},r)),n):n}function BF(e){return y.useMemo(()=>({draggable:B(B({},zs.draggable),e==null?void 0:e.draggable),droppable:B(B({},zs.droppable),e==null?void 0:e.droppable),dragOverlay:B(B({},zs.dragOverlay),e==null?void 0:e.dragOverlay)}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function $F(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=y.useRef(!1),{x:a,y:l}=typeof i=="boolean"?{x:i,y:i}:i;gn(()=>{if(!a&&!l||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=Dv(f,r);if(a||(d.x=0),l||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=Mv(u);p&&p.scrollBy({top:d.y,left:d.x})}},[t,a,l,r,n])}const js=y.createContext(Q(B({},mn),{scaleX:1,scaleY:1}));var dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(dr||(dr={}));const tb=y.memo(function(t){var n,r,i,o;let zt=t,{id:a,accessibility:l,autoScroll:c=!0,children:u,sensors:f=PF,collisionDetection:d=G$,measuring:p,modifiers:g}=zt,v=Qe(zt,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const m=y.useReducer(MF,void 0,RF),[b,C]=m,[w,x]=B$(),[I,S]=y.useState(dr.Uninitialized),A=I===dr.Initialized,{draggable:{active:E,nodes:k,translate:F},droppable:{containers:W}}=b,O=E!=null?k.get(E):null,T=y.useRef({initial:null,translated:null}),N=y.useMemo(()=>{var bt;return E!=null?{id:E,data:(bt=O==null?void 0:O.data)!=null?bt:DF,rect:T}:null},[E,O]),H=y.useRef(null),[j,$]=y.useState(null),[M,V]=y.useState(null),Y=ko(v,Object.values(v)),X=Po("DndDescribedBy",a),D=y.useMemo(()=>W.getEnabled(),[W]),L=BF(p),{droppableRects:U,measureDroppableContainers:G,measuringScheduled:oe}=yF(D,{dragging:A,dependencies:[F.x,F.y],config:L.droppable}),ce=vF(k,E),se=y.useMemo(()=>M?Os(M):null,[M]),Z=Gt(),te=xF(ce,L.draggable.measure);$F({activeNode:E!=null?k.get(E):null,config:Z.layoutShiftCompensation,initialRect:te,measure:L.draggable.measure});const ne=Gv(ce,L.draggable.measure,te),de=Gv(ce?ce.parentElement:null),ve=y.useRef({activatorEvent:null,active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Fe=W.getNodeFor((n=ve.current.over)==null?void 0:n.id),st=_F({measure:L.dragOverlay.measure}),Je=(r=st.nodeRef.current)!=null?r:ce,vt=A?(i=st.rect)!=null?i:ne:null,he=!!(st.nodeRef.current&&st.rect),ge=SF(he?null:ne),xe=qv(Je?Ft(Je):null),ke=IF(A?Fe!=null?Fe:ce:null),Ye=kF(ke),Oe=eb(g,{transform:{x:F.x-ge.x,y:F.y-ge.y,scaleX:1,scaleY:1},activatorEvent:M,active:N,activeNodeRect:ne,containerNodeRect:de,draggingNodeRect:vt,over:ve.current.over,overlayNodeRect:st.rect,scrollableAncestors:ke,scrollableAncestorRects:Ye,windowRect:xe}),Pe=se?Ii(se,F):null,St=AF(ke),It=Kv(St),Mt=Kv(St,[ne]),_t=Ii(Oe,It),Nt=vt?q$(vt,Oe):null,kn=N&&Nt?d({active:N,collisionRect:Nt,droppableRects:U,droppableContainers:D,pointerCoordinates:Pe}):null,Ei=Pv(kn,"id"),[dn,Mr]=y.useState(null),$o=he?Oe:Ii(Oe,Mt),Fo=Y$($o,(o=dn==null?void 0:dn.rect)!=null?o:null,ne),Ne=y.useRef(null),hr=y.useCallback((bt,P)=>{let{sensor:z,options:q}=P;if(H.current==null)return;const ee=k.get(H.current);if(!ee)return;const ae=bt.nativeEvent,ue=new z({active:H.current,activeNode:ee,event:ae,options:q,context:ve,onAbort(fe){if(!k.get(fe))return;const{onDragAbort:pe}=Y.current,ie={id:fe};pe==null||pe(ie),w({type:"onDragAbort",event:ie})},onPending(fe,Se,pe,ie){if(!k.get(fe))return;const{onDragPending:Lt}=Y.current,lt={id:fe,constraint:Se,initialCoordinates:pe,offset:ie};Lt==null||Lt(lt),w({type:"onDragPending",event:lt})},onStart(fe){const Se=H.current;if(Se==null)return;const pe=k.get(Se);if(!pe)return;const{onDragStart:ie}=Y.current,Ae={activatorEvent:ae,active:{id:Se,data:pe.data,rect:T}};yt.unstable_batchedUpdates(()=>{ie==null||ie(Ae),S(dr.Initializing),C({type:wt.DragStart,initialCoordinates:fe,active:Se}),w({type:"onDragStart",event:Ae}),$(Ne.current),V(ae)})},onMove(fe){C({type:wt.DragMove,coordinates:fe})},onEnd:Ce(wt.DragEnd),onCancel:Ce(wt.DragCancel)});Ne.current=ue;function Ce(fe){return function(){return _(this,null,function*(){const{active:pe,collisions:ie,over:Ae,scrollAdjustedTranslate:Lt}=ve.current;let lt=null;if(pe&&Lt){const{cancelDrop:vn}=Y.current;lt={activatorEvent:ae,active:pe,collisions:ie,delta:Lt,over:Ae},fe===wt.DragEnd&&typeof vn=="function"&&(yield Promise.resolve(vn(lt)))&&(fe=wt.DragCancel)}H.current=null,yt.unstable_batchedUpdates(()=>{C({type:fe}),S(dr.Uninitialized),Mr(null),$(null),V(null),Ne.current=null;const vn=fe===wt.DragEnd?"onDragEnd":"onDragCancel";if(lt){const _n=Y.current[vn];_n==null||_n(lt),w({type:vn,event:lt})}})})}}},[k]),Lr=y.useCallback((bt,P)=>(z,q)=>{const ee=z.nativeEvent,ae=k.get(q);if(H.current!==null||!ae||ee.dndKit||ee.defaultPrevented)return;const ue={active:ae};bt(z,P.options,ue)===!0&&(ee.dndKit={capturedBy:P.sensor},H.current=q,hr(z,P))},[k,hr]),ki=bF(f,Lr);TF(f),gn(()=>{ne&&I===dr.Initializing&&S(dr.Initialized)},[ne,I]),y.useEffect(()=>{const{onDragMove:bt}=Y.current,{active:P,activatorEvent:z,collisions:q,over:ee}=ve.current;if(!P||!z)return;const ae={active:P,activatorEvent:z,collisions:q,delta:{x:_t.x,y:_t.y},over:ee};yt.unstable_batchedUpdates(()=>{bt==null||bt(ae),w({type:"onDragMove",event:ae})})},[_t.x,_t.y]),y.useEffect(()=>{const{active:bt,activatorEvent:P,collisions:z,droppableContainers:q,scrollAdjustedTranslate:ee}=ve.current;if(!bt||H.current==null||!P||!ee)return;const{onDragOver:ae}=Y.current,ue=q.get(Ei),Ce=ue&&ue.rect.current?{id:ue.id,rect:ue.rect.current,data:ue.data,disabled:ue.disabled}:null,fe={active:bt,activatorEvent:P,collisions:z,delta:{x:ee.x,y:ee.y},over:Ce};yt.unstable_batchedUpdates(()=>{Mr(Ce),ae==null||ae(fe),w({type:"onDragOver",event:fe})})},[Ei]),gn(()=>{ve.current={activatorEvent:M,active:N,activeNode:ce,collisionRect:Nt,collisions:kn,droppableRects:U,draggableNodes:k,draggingNode:Je,draggingNodeRect:vt,droppableContainers:W,over:dn,scrollableAncestors:ke,scrollAdjustedTranslate:_t},T.current={initial:vt,translated:Nt}},[N,ce,kn,Nt,k,Je,vt,U,W,dn,ke,_t]),pF(Q(B({},Z),{delta:F,draggingRect:Nt,pointerCoordinates:Pe,scrollableAncestors:ke,scrollableAncestorRects:Ye}));const pr=y.useMemo(()=>({active:N,activeNode:ce,activeNodeRect:ne,activatorEvent:M,collisions:kn,containerNodeRect:de,dragOverlay:st,draggableNodes:k,droppableContainers:W,droppableRects:U,over:dn,measureDroppableContainers:G,scrollableAncestors:ke,scrollableAncestorRects:Ye,measuringConfiguration:L,measuringScheduled:oe,windowRect:xe}),[N,ce,ne,M,kn,de,st,k,W,U,dn,G,ke,Ye,L,oe,xe]),gr=y.useMemo(()=>({activatorEvent:M,activators:ki,active:N,activeNodeRect:ne,ariaDescribedById:{draggable:X},dispatch:C,draggableNodes:k,over:dn,measureDroppableContainers:G}),[M,ki,N,ne,C,X,k,dn,G]);return y.createElement(Ev.Provider,{value:x},y.createElement(Bo.Provider,{value:gr},y.createElement(Zv.Provider,{value:pr},y.createElement(js.Provider,{value:Fo},u)),y.createElement(LF,{disabled:(l==null?void 0:l.restoreFocus)===!1})),y.createElement(N$,Q(B({},l),{hiddenTextDescribedById:X})));function Gt(){const bt=(j==null?void 0:j.autoScrollEnabled)===!1,P=typeof c=="object"?c.enabled===!1:c===!1,z=A&&!bt&&!P;return typeof c=="object"?Q(B({},c),{enabled:z}):{enabled:z}}}),FF=y.createContext(null),nb="button",NF="Draggable";function zF(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=Po(NF),{activators:a,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:p}=y.useContext(Bo),{role:g=nb,roleDescription:v="draggable",tabIndex:m=0}=i!=null?i:{},b=(c==null?void 0:c.id)===t,C=y.useContext(b?js:FF),[w,x]=_s(),[I,S]=_s(),A=EF(a,t),E=ko(n);gn(()=>(d.set(t,{id:t,key:o,node:w,activatorNode:I,data:E}),()=>{const F=d.get(t);F&&F.key===o&&d.delete(t)}),[d,t]);const k=y.useMemo(()=>({role:g,tabIndex:m,"aria-disabled":r,"aria-pressed":b&&g===nb?!0:void 0,"aria-roledescription":v,"aria-describedby":f.draggable}),[r,g,m,b,v,f.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:k,isDragging:b,listeners:r?void 0:A,node:w,over:p,setNodeRef:x,setActivatorNodeRef:S,transform:C}}function rb(){return y.useContext(Zv)}const jF="Droppable",UF={timeout:25};function VF(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=Po(jF),{active:a,dispatch:l,over:c,measureDroppableContainers:u}=y.useContext(Bo),f=y.useRef({disabled:n}),d=y.useRef(!1),p=y.useRef(null),g=y.useRef(null),{disabled:v,updateMeasurementsFor:m,timeout:b}=B(B({},UF),i),C=ko(m!=null?m:r),w=y.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(C.current)?C.current:[C.current]),g.current=null},b)},[b]),x=Ns({callback:w,disabled:v||!a}),I=y.useCallback((k,F)=>{x&&(F&&(x.unobserve(F),d.current=!1),k&&x.observe(k))},[x]),[S,A]=_s(I),E=ko(t);return y.useEffect(()=>{!x||!S.current||(x.disconnect(),d.current=!1,x.observe(S.current))},[S,x]),y.useEffect(()=>(l({type:wt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:p,data:E}}),()=>l({type:wt.UnregisterDroppable,key:o,id:r})),[r]),y.useEffect(()=>{n!==f.current.disabled&&(l({type:wt.SetDroppableDisabled,id:r,key:o,disabled:n}),f.current.disabled=n)},[r,o,n,l]),{active:a,rect:p,isOver:(c==null?void 0:c.id)===r,node:S,over:c,setNodeRef:A}}function HF(e){let{animation:t,children:n}=e;const[r,i]=y.useState(null),[o,a]=y.useState(null),l=Ps(n);return!n&&!r&&l&&i(l),gn(()=>{if(!o)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),y.createElement(y.Fragment,null,n,r?y.cloneElement(r,{ref:a}):null)}const WF={x:0,y:0,scaleX:1,scaleY:1};function GF(e){let{children:t}=e;return y.createElement(Bo.Provider,{value:Xv},y.createElement(js.Provider,{value:WF},t))}const YF={position:"fixed",touchAction:"none"},KF=e=>Ds(e)?"transform 250ms ease":void 0,qF=y.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:l,style:c,transform:u,transition:f=KF}=e;if(!l)return null;const d=i?u:Q(B({},u),{scaleX:1,scaleY:1}),p=B(Q(B({},YF),{width:l.width,height:l.height,top:l.top,left:l.left,transform:Kn.Transform.toString(d),transformOrigin:i&&r?j$(r,l):void 0,transition:typeof f=="function"?f(r):f}),c);return y.createElement(n,{className:a,style:p,ref:t},o)}),ib=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[l,c]of Object.entries(o.active))c!==void 0&&(i[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,c));if(o!=null&&o.dragOverlay)for(const[l,c]of Object.entries(o.dragOverlay))c!==void 0&&r.node.style.setProperty(l,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[c,u]of Object.entries(i))n.node.style.setProperty(c,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},QF={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Kn.Transform.toString(t)},{transform:Kn.Transform.toString(n)}]},sideEffects:ib({styles:{active:{opacity:"0"}}})};function JF(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return ks((o,a)=>{if(t===null)return;const l=n.get(o);if(!l)return;const c=l.node.current;if(!c)return;const u=Jv(a);if(!u)return;const{transform:f}=Ft(a).getComputedStyle(a),d=Ov(f);if(!d)return;const p=typeof t=="function"?t:XF(t);return zv(c,i.draggable.measure),p({active:{id:o,data:l.data,node:c,rect:i.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function XF(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}=B(B({},QF),e);return o=>{let w=o,{active:a,dragOverlay:l,transform:c}=w,u=Qe(w,["active","dragOverlay","transform"]);if(!t)return;const f={x:l.rect.left-a.rect.left,y:l.rect.top-a.rect.top},d={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/l.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/l.rect.height:1},p=B({x:c.x-f.x,y:c.y-f.y},d),g=i(Q(B({},u),{active:a,dragOverlay:l,transform:{initial:c,final:p}})),[v]=g,m=g[g.length-1];if(JSON.stringify(v)===JSON.stringify(m))return;const b=r==null?void 0:r(B({active:a,dragOverlay:l},u)),C=l.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(x=>{C.onfinish=()=>{b==null||b(),x()}})}}let ob=0;function ZF(e){return y.useMemo(()=>{if(e!=null)return ob++,ob},[e])}const eN=y.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:l="div",className:c,zIndex:u=999}=e;const{activatorEvent:f,active:d,activeNodeRect:p,containerNodeRect:g,draggableNodes:v,droppableContainers:m,dragOverlay:b,over:C,measuringConfiguration:w,scrollableAncestors:x,scrollableAncestorRects:I,windowRect:S}=rb(),A=y.useContext(js),E=ZF(d==null?void 0:d.id),k=eb(a,{activatorEvent:f,active:d,activeNodeRect:p,containerNodeRect:g,draggingNodeRect:b.rect,over:C,overlayNodeRect:b.rect,scrollableAncestors:x,scrollableAncestorRects:I,transform:A,windowRect:S}),F=Uu(p),W=JF({config:r,draggableNodes:v,droppableContainers:m,measuringConfiguration:w}),O=F?b.setRef:void 0;return y.createElement(GF,null,y.createElement(HF,{animation:W},d&&E?y.createElement(qF,{key:E,id:d.id,ref:O,as:l,activatorEvent:f,adjustScale:t,className:c,transition:o,rect:F,style:B({zIndex:u},i),transform:k},n):null))});function Us(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function tN(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Vs(e){return e!==null&&e>=0}function nN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function rN(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ab=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=Us(t,r,n),a=t[i],l=o[i];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},sb="Sortable",lb=y.createContext({activeIndex:-1,containerId:sb,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ab,disabled:{draggable:!1,droppable:!1}});function cb(e){let{children:t,id:n,items:r,strategy:i=ab,disabled:o=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:f}=rb(),d=Po(sb,n),p=l.rect!==null,g=y.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),v=a!=null,m=a?g.indexOf(a.id):-1,b=u?g.indexOf(u.id):-1,C=y.useRef(g),w=!nN(g,C.current),x=b!==-1&&m===-1||w,I=rN(o);gn(()=>{w&&v&&f(g)},[w,g,v,f]),y.useEffect(()=>{C.current=g},[g]);const S=y.useMemo(()=>({activeIndex:m,containerId:d,disabled:I,disableTransforms:x,items:g,overIndex:b,useDragOverlay:p,sortedRects:tN(g,c),strategy:i}),[m,d,I.draggable,I.droppable,x,g,b,c,p,i]);return y.createElement(lb.Provider,{value:S},t)}const iN=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Us(n,r,i).indexOf(t)},oN=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==o&&i===a?!1:n?!0:a!==i&&t===c},aN={duration:200,easing:"ease"},ub="transform",sN=Kn.Transition.toString({property:ub,duration:0,easing:"linear"}),lN={roleDescription:"sortable"};function cN(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,a]=y.useState(null),l=y.useRef(n);return gn(()=>{if(!t&&n!==l.current&&r.current){const c=i.current;if(c){const u=Ai(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&a(f)}}n!==l.current&&(l.current=n)},[t,n,r,i]),y.useEffect(()=>{o&&a(null)},[o]),o}function db(e){let{animateLayoutChanges:t=oN,attributes:n,disabled:r,data:i,getNewIndex:o=iN,id:a,strategy:l,resizeObserverConfig:c,transition:u=aN}=e;const{items:f,containerId:d,activeIndex:p,disabled:g,disableTransforms:v,sortedRects:m,overIndex:b,useDragOverlay:C,strategy:w}=y.useContext(lb),x=uN(r,g),I=f.indexOf(a),S=y.useMemo(()=>B({sortable:{containerId:d,index:I,items:f}},i),[d,i,I,f]),A=y.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:E,node:k,isOver:F,setNodeRef:W}=VF({id:a,data:S,disabled:x.droppable,resizeObserverConfig:B({updateMeasurementsFor:A},c)}),{active:O,activatorEvent:T,activeNodeRect:N,attributes:H,setNodeRef:j,listeners:$,isDragging:M,over:V,setActivatorNodeRef:Y,transform:X}=zF({id:a,data:S,attributes:B(B({},lN),n),disabled:x.draggable}),D=T$(W,j),L=!!O,U=L&&!v&&Vs(p)&&Vs(b),G=!C&&M,oe=G&&U?X:null,ce=l!=null?l:w,se=U?oe!=null?oe:ce({rects:m,activeNodeRect:N,activeIndex:p,overIndex:b,index:I}):null,Z=Vs(p)&&Vs(b)?o({id:a,items:f,activeIndex:p,overIndex:b}):I,te=O==null?void 0:O.id,ne=y.useRef({activeId:te,items:f,newIndex:Z,containerId:d}),de=f!==ne.current.items,ve=t({active:O,containerId:d,isDragging:M,isSorting:L,id:a,index:I,items:f,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:u,wasDragging:ne.current.activeId!=null}),Fe=cN({disabled:!ve,index:I,node:k,rect:E});return y.useEffect(()=>{L&&ne.current.newIndex!==Z&&(ne.current.newIndex=Z),d!==ne.current.containerId&&(ne.current.containerId=d),f!==ne.current.items&&(ne.current.items=f)},[L,Z,d,f]),y.useEffect(()=>{if(te===ne.current.activeId)return;if(te!=null&&ne.current.activeId==null){ne.current.activeId=te;return}const Je=setTimeout(()=>{ne.current.activeId=te},50);return()=>clearTimeout(Je)},[te]),{active:O,activeIndex:p,attributes:H,data:S,rect:E,index:I,newIndex:Z,items:f,isOver:F,isSorting:L,isDragging:M,listeners:$,node:k,overIndex:b,over:V,setNodeRef:D,setActivatorNodeRef:Y,setDroppableNodeRef:W,setDraggableNodeRef:j,transform:Fe!=null?Fe:se,transition:st()};function st(){if(Fe||de&&ne.current.newIndex===I)return sN;if(!(G&&!Ds(T)||!u)&&(L||ve))return Kn.Transition.toString(Q(B({},u),{property:ub}))}}function uN(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Hs(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const dN=[Re.Down,Re.Right,Re.Up,Re.Left],fb=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:a,scrollableAncestors:l}}=t;if(dN.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];o.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=i.get(d.id);if(p)switch(e.code){case Re.Down:r.top<p.top&&c.push(d);break;case Re.Up:r.top>p.top&&c.push(d);break;case Re.Left:r.left>p.left&&c.push(d);break;case Re.Right:r.left<p.left&&c.push(d);break}});const u=H$({active:n,collisionRect:r,droppableRects:i,droppableContainers:c,pointerCoordinates:null});let f=Pv(u,"id");if(f===(a==null?void 0:a.id)&&u.length>1&&(f=u[1].id),f!=null){const d=o.get(n.id),p=o.get(f),g=p?i.get(p.id):null,v=p==null?void 0:p.node.current;if(v&&g&&d&&p){const b=Ls(v).some((A,E)=>l[E]!==A),C=hb(d,p),w=fN(d,p),x=b||!C?{x:0,y:0}:{x:w?r.width-g.width:0,y:w?r.height-g.height:0},I={x:g.left,y:g.top};return x.x&&x.y?I:Do(I,x)}}}};function hb(e,t){return!Hs(e)||!Hs(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function fN(e,t){return!Hs(e)||!Hs(t)||!hb(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const pb=Be(s.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Ws=y.createContext({attributes:{},listeners:void 0,ref(){}}),hN=()=>{const{attributes:e,listeners:t,ref:n}=y.useContext(Ws);return s.jsx(h.Button,Q(B(B({sx:{backgroundColor:"transparent",color:"#919eab",width:"10px",":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}},e),t),{ref:n,children:s.jsx(pb,{})}))},gb=({children:e,id:t,tooltipTitle:n,removeItem:r,useDraggable:i=!0,variant:o="plain"})=>{const{attributes:a,isDragging:l,listeners:c,setNodeRef:u,setActivatorNodeRef:f,transform:d,transition:p}=db({id:t}),g=y.useMemo(()=>({attributes:a,listeners:c,ref:f}),[a,c,f]),v={opacity:l?.6:void 0,transform:Kn.Translate.toString(d),transition:p};return s.jsx(Ws.Provider,{value:g,children:s.jsx(h.ListItem,{variant:o,ref:u,style:v,startAction:i?s.jsx(hN,{}):s.jsx(s.Fragment,{}),endAction:i?s.jsx(h.Tooltip,{title:n,children:s.jsx(h.Button,{variant:"outlined",color:"danger",onClick:r,sx:{ml:"auto",p:.5},size:"sm",children:s.jsx(_e.Remove,{})})}):s.jsx(s.Fragment,{}),sx:{p:2,borderRadius:"sm"},children:e})})},pN={sideEffects:ib({styles:{active:{opacity:"0.6"}}})},mb=({children:e})=>s.jsx(eN,{dropAnimation:pN,children:e}),gN=({entities:e=[],labels:t,disabled:n,setEntities:r,removeItem:i})=>{const[o,a]=y.useState(null),l=y.useMemo(()=>e.find(u=>u.id===(o==null?void 0:o.id)),[o,e]),c=kv(Ms($s),Ms(Bs,{coordinateGetter:fb}));return s.jsxs(tb,{sensors:c,onDragStart:({active:u})=>{a(u)},onDragEnd:({active:u,over:f})=>{if(f&&u.id!==(f==null?void 0:f.id)){const d=e.findIndex(({id:g})=>g===u.id),p=e.findIndex(({id:g})=>g===f.id);r(Us(e,d,p))}a(null)},onDragCancel:()=>{a(null)},children:[s.jsx(cb,{items:e,children:s.jsx(h.List,{sx:{gap:"10px",padding:0},children:e.map(u=>s.jsxs(gb,{id:u.id,variant:"outlined",removeItem:()=>i(u.id),tooltipTitle:t.removeEntity,useDraggable:!n,children:[s.jsx(h.Typography,{ml:n?0:2.5,children:u.title||u.name}),u.type&&s.jsx(h.Chip,{color:RB(u.type),sx:{marginLeft:2,marginRight:4},children:MB(u.type)})]},`sortable-item-${u.id}`))})}),s.jsx(mb,{children:l?s.jsx(s.Fragment,{children:e.map(u=>s.jsx(gb,{id:u.id,useDraggable:!1,removeItem:()=>{},tooltipTitle:t.removeEntity},`sortable-overlay-item-${u.id}`))}):s.jsx(s.Fragment,{})})]})},mN=({labels:e,value:t,options:n,size:r="sm",disabled:i=!1,sx:o={},onChange:a})=>s.jsxs(h.FormControl,{size:r,disabled:i,children:[s.jsx(h.FormLabel,{children:e.itemsPerPage}),s.jsx(h.Select,{value:t,size:r,onChange:a,sx:Q(B({},o),{minHeight:"37px"}),children:n.map((l,c)=>s.jsx(h.Option,{value:l,children:l},`items-per-page-${l}-${c}`))})]}),vN=(e,t)=>{const[n,r]=y.useState(null),{sdk:i}=We(),o=()=>_(this,null,function*(){let l=[];if(!e){r(l);return}try{switch(e){case"top_x":l=(yield i.topX.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"match_quiz":l=(yield i.matchQuiz.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"template":l=(yield i.loyalty.getTemplates(void 0,!0)).data.map(C=>({id:C.id,name:C.name,status:C.status,type:e,relationship:"relatedTo"}));break;case"classic_quiz":l=(yield i.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"personality_quiz":l=(yield i.miniGames.getPersonalityQuizzes({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"either_or":l=(yield i.miniGames.getEitherOrs({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"poll":l=(yield i.voting.getPolls({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"bracket":l=(yield i.bracketGame.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"standing":l=(yield i.standingGame.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break}}catch(c){console.error(c),r(l),t();return}r(l)});return y.useEffect(()=>(o(),()=>r(null)),[e]),n},bN=({status:e})=>{let t="neutral";switch(e){case"DYNAMIC":t="primary";break;case"CUSTOM":t="success";break;case"OPEN":t="primary";break;case"LIVE":t="primary";break;case"CANCELED":t="warning";break;case"SETTLED":t="success";break;case"INACTIVE":t="danger";break;case"ACTIVE":t="success";break;case"EXPIRED":t="neutral";break}return s.jsx(h.Chip,{color:t,variant:"solid",size:"sm",children:e})},yN=Be(s.jsx("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond"),xN=Be(s.jsx("path",{d:"m21.58 16.09-1.09-7.66C20.21 6.46 18.52 5 16.53 5H7.47C5.48 5 3.79 6.46 3.51 8.43l-1.09 7.66C2.2 17.63 3.39 19 4.94 19c.68 0 1.32-.27 1.8-.75L9 16h6l2.25 2.25c.48.48 1.13.75 1.8.75 1.56 0 2.75-1.37 2.53-2.91M11 11H9v2H8v-2H6v-1h2V8h1v2h2zm4-1c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"SportsEsports"),CN=Be(s.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),wN=Be(s.jsx("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows"),SN=Be(s.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Poll"),IN=e=>{switch(e.entityType){case"top_x":return s.jsx(h.Tooltip,{title:"Top X",children:s.jsx(yN,{})});case"match_quiz":return s.jsx(h.Tooltip,{title:"Match Quiz",children:s.jsx(xN,{})});case"template":return s.jsx(h.Tooltip,{title:"Leaderboard Templates",children:s.jsx(_e.EmojiEvents,{})});case"classic_quiz":return s.jsx(h.Tooltip,{title:"Classic Quiz",children:s.jsx(CN,{})});case"either_or":return s.jsx(h.Tooltip,{title:"Either/Or",children:s.jsx(wN,{})});case"poll":return s.jsx(h.Tooltip,{title:"Poll",children:s.jsx(SN,{})});case"bracket":return s.jsx(h.Tooltip,{title:"Custom Bracket Game",children:s.jsx(_e.EmojiEvents,{})});case"standing":return s.jsx(h.Tooltip,{title:"Custom Standings Game",children:s.jsx(_e.EmojiEvents,{})});default:return null}},vb=({entity:e,deleteLabel:t,onDelete:n})=>s.jsx(s.Fragment,{children:s.jsx(h.Card,{sx:{p:2,mb:2},children:s.jsx(h.CardContent,{children:s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"space-between"},children:[s.jsx(h.Typography,{fontSize:"sm",startDecorator:s.jsx(IN,{entityType:e.type}),children:e.name}),s.jsx(h.Box,{display:{xs:"none",md:"block"},children:s.jsx(bN,{status:e.status})}),s.jsx(h.Box,{children:s.jsx(h.Tooltip,{title:t,children:s.jsx(h.IconButton,{onClick:()=>n(e.id,e.relationship),color:"danger",size:"sm",children:s.jsx(_e.Delete,{})})})})]})})})}),AN=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=new Map;t.forEach(l=>{if(a.has(l.entity_type)){const c=a.get(l.entity_type);a.set(l.entity_type,[...c,[l.entity_id,l.entity_relationship]])}else a.set(l.entity_type,[[l.entity_id,l.entity_relationship]])});try{for(const[l,c]of a)switch(l){case"top_x":const u=c.map(([O])=>O),f=yield e.topX.getGames({limit:u.length,gameIds:u},!0);o=[...o,...f.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"match_quiz":const d=c.map(([O])=>O),p=yield e.matchQuiz.getGames({limit:d.length,gameIds:d},!0);o=[...o,...p.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"template":const g=c.map(([O])=>O),v=yield e.loyalty.getTemplates(void 0,!0);o=[...o,...v.data.filter(O=>g.includes(O.id)).map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"classic_quiz":const m=c.map(([O])=>O),b=yield e.miniGames.getClassicQuizzes({limit:m.length,classicQuizIds:m},!1,!0);o=[...o,...b.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"personality_quiz":const C=c.map(([O])=>O),w=yield e.miniGames.getPersonalityQuizzes({limit:C.length,personalityQuizIds:C},!1,!0);o=[...o,...w.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"either_or":const x=c.map(([O])=>O),I=yield e.miniGames.getEitherOrs({limit:x.length,eitherOrIds:x},!1,!0);o=[...o,...I.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"poll":const S=c.map(([O])=>O),A=yield e.voting.getPolls({limit:S.length,pollIds:S},!0);o=[...o,...A.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"bracket":const E=c.map(([O])=>O),k=yield e.bracketGame.getGames({limit:E.length,gameIds:E},!0);o=[...o,...k.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"standing":const F=c.map(([O])=>O),W=yield e.standingGame.getGames({limit:F.length,gameIds:F},!0);o=[...o,...W.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;default:}}catch(l){console.error("Error loading related entities",l),n(o),r()}n(o)}),TN=["top_x","match_quiz","template","classic_quiz","personality_quiz","poll","either_or","bracket","standing"],EN=["relatedTo","blocks","blockedBy","bonusPointsGame","nextInSeries","previousInSeries"],kN=new Map().set("template","Leaderboard Templates").set("classic_quiz","Classic Quiz").set("personality_quiz","Personality Quiz").set("either_or","Either/Or").set("match_quiz","Match Quiz").set("top_x","Top X").set("bracket","Custom Bracket Game").set("standing","Custom Standing Game").set("poll","Poll"),bb=new Map().set("relatedTo","Related to").set("blocks","Blocks").set("blockedBy","Blocked by").set("nextInSeries","Next in series").set("previousInSeries","Previous in series").set("bonusPointsGame","Bonus points game"),_N=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState(""),[l,c]=y.useState(null),[u,f]=y.useState("relatedTo"),[d,p]=y.useState(!1),g=()=>p(!d),v=vN(l,g),{sdk:m}=We();y.useEffect(()=>(e.length>0&&AN(m,e,i,g),()=>{i([]),a(""),c(null),f("relatedTo")}),[]);const b=()=>{if(e.some(E=>E.entity_id===o&&E.entity_relationship===u)){a("");return}const S=[...e,{entity_id:o,entity_type:l,entity_relationship:u}],A=(v==null?void 0:v.filter(E=>E.id===o).map(E=>({id:E.id,name:E.name,type:l,status:E.status,relationship:u})))||[];i([...r,...A]),t(S),a("")},C=(I,S)=>{const A=e.filter(k=>!(k.entity_id===I&&k.entity_relationship===S)),E=r.filter(k=>!(k.id===I&&k.relationship===S));i(E),t(A)},w=r.reduce((I,S)=>{const A=S.relationship;return I[A]||(I[A]=[]),I[A].push(S),I},{}),x=Object.keys(w).sort();return s.jsxs(s.Fragment,{children:[x.map(I=>s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:s.jsx(h.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:bb.get(I)||"Unknown relationship"})}),w[I].map((S,A)=>s.jsx(vb,{entity:S,deleteLabel:n.delete,onDelete:C},`related-entity-relationship-${S.id}-${A}`))]},`relationship-group-${I}`)),s.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.type}),s.jsx(h.Select,{value:l,size:"sm",name:"entity_type",onChange:(I,S)=>c(S),sx:{minHeight:"37px"},children:TN.map(I=>s.jsx(h.Option,{value:I,children:kN.get(I)},`entity-type-option-${I}`))})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.relationship}),s.jsx(h.Select,{value:u,size:"sm",name:"entity_relationship",onChange:(I,S)=>f(S),sx:{minHeight:"37px"},children:EN.map(I=>s.jsx(h.Option,{value:I,children:bb.get(I)},`entity-relationship-option-${I}`))})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.entity}),s.jsx(h.Select,{value:o,size:"sm",name:"entity_id",onChange:(I,S)=>a(S),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!v&&s.jsx(h.CircularProgress,{size:"sm"}),children:v&&v.map(I=>s.jsx(h.Option,{value:I.id,children:I.name},`entity--${I.id}`))})]}),s.jsx(h.Button,{startDecorator:s.jsx(_e.Add,{}),disabled:!o||!l,onClick:b,sx:{mb:1},children:n.add})]}),s.jsx(Ge,{showToast:d,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:g})]})},PN=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=t.filter(l=>l.entity_type==="classic_quiz"&&l.entity_relationship==="bonusPointsGame").map(l=>[l.entity_id,l.entity_relationship]);if(a.length===0){n([]);return}try{const l=a.map(([u])=>u);o=(yield e.miniGames.getClassicQuizzes({limit:l.length,classicQuizIds:l},!1,!0)).data.map(u=>{var d;const f=((d=a.find(([p])=>p===u.id))==null?void 0:d[1])||"bonusPointsGame";return{id:u.id,name:u.title,status:u.status,type:"classic_quiz",relationship:f}})}catch(l){console.error("Error loading related entities",l),n(o),r()}n(o)}),DN=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState(""),[l,c]=y.useState(null),[u,f]=y.useState(!1),d=()=>f(!u),{sdk:p}=We();y.useEffect(()=>(e.length>0&&PN(p,e,i,d),()=>{i([]),a("")}),[]),y.useEffect(()=>(_(this,null,function*(){try{const w=(yield p.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(x=>({id:x.id,name:x.title,status:x.status,type:"classic_quiz",relationship:"bonusPointsGame"}));c(w)}catch(C){console.error(C),c([]),d()}}),()=>c(null)),[]);const g=()=>{if(e.some(w=>w.entity_id===o&&w.entity_relationship==="bonusPointsGame")){a("");return}const b=[...e,{entity_id:o,entity_type:"classic_quiz",entity_relationship:"bonusPointsGame"}],C=(l==null?void 0:l.filter(w=>w.id===o).map(w=>({id:w.id,name:w.name,type:"classic_quiz",status:w.status,relationship:"bonusPointsGame"})))||[];i([...r,...C]),t(b),a("")},v=(m,b)=>{const C=e.filter(x=>!(x.entity_id===m&&x.entity_relationship===b)),w=r.filter(x=>!(x.id===m&&x.relationship===b));i(w),t(C)};return s.jsxs(s.Fragment,{children:[r.length>0&&s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:s.jsx(h.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:"Bonus points game"})}),r.map((m,b)=>s.jsx(vb,{entity:m,deleteLabel:n.delete,onDelete:v},`related-entity-relationship-${m.id}-${b}`))]}),s.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.type}),s.jsx(h.Input,{value:"Classic Quiz",readOnly:!0,disabled:!0,size:"sm",sx:{minHeight:"37px"}})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.relationship}),s.jsx(h.Input,{value:"Bonus Points Game",readOnly:!0,disabled:!0,size:"sm",sx:{minHeight:"37px"}})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.entity}),s.jsx(h.Select,{value:o,size:"sm",name:"entity_id",onChange:(m,b)=>a(b),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!l&&s.jsx(h.CircularProgress,{size:"sm"}),children:l&&l.map(m=>s.jsx(h.Option,{value:m.id,children:m.name},`entity--${m.id}`))})]}),s.jsx(h.Button,{startDecorator:s.jsx(_e.Add,{}),disabled:!o,onClick:g,sx:{mb:1},children:n.add})]}),s.jsx(Ge,{showToast:u,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:d})]})},ON=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState("success"),[l,c]=y.useState(""),u=y.useContext(fa),f=(p,g)=>{a(p),c(g),i(!0)},d=()=>_(this,null,function*(){n(!0);const p=yield u==null?void 0:u.https.exportLeadsPerEntity(e.entityId);if(p!=null&&p.ok){const g=yield p.blob(),v=URL.createObjectURL(g),m=document.createElement("a");m.href=v,m.download=`${e.entityType}_${e.entityName}_exported_users_leads.csv`,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(v),n(!1),f("success",e.labels.usersLeadsExportMessage)}else console.error("Failed to export all users leads: ",yield p==null?void 0:p.json()),n(!1),f("danger",e.labels.usersLeadsExportErrorMessage)});return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{mb:2,children:[s.jsx(h.Box,{display:"flex",alignItems:"center",mb:1,children:s.jsx(h.Typography,{level:"body-lg",sx:{mx:"auto"},children:e.labels.exportUsersLeads})}),s.jsx(h.Sheet,{sx:{overflowX:"auto",minWidth:"700px"},children:s.jsxs(h.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left",width:"50%"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:e.labels.category}),s.jsx("th",{children:e.labels.action})]})}),s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:"600",children:e.labels.exportAllUsersLeads}),s.jsx(h.Typography,{level:"body-xs",color:"neutral",children:e.labels.exportAllUsersLeadsDescription})]}),s.jsx("td",{children:s.jsx(h.Button,{loading:t,onClick:d,children:e.labels.exportAllUsersLeads})})]})})]})})]}),s.jsx(Ge,{showToast:r,color:o,message:l,hideToast:()=>i(!1)})]})},RN=({tooltipContent:e="Drag to reorder"})=>{const{attributes:t,listeners:n,ref:r}=y.useContext(Ws);return s.jsx(h.Tooltip,{title:e,placement:"left",arrow:!0,children:s.jsx(h.IconButton,Q(B(B({variant:"plain",color:"neutral",size:"sm",sx:{color:"text.tertiary",my:"auto",mr:1,":hover":{bgcolor:"action.hover"},":active":{bgcolor:"action.selected"},transition:"all 0.2s",cursor:"grab","&:active":{cursor:"grabbing"}}},t),n),{ref:r,children:s.jsx(pb,{})}))})},yb=({id:e,useDraggable:t=!0,variant:n="outlined",item:r,tooltipContent:i})=>{const{attributes:o,isDragging:a,listeners:l,setNodeRef:c,setActivatorNodeRef:u,transform:f,transition:d}=db({id:e}),p=y.useMemo(()=>({attributes:o,listeners:l,ref:u}),[o,l,u]),g={opacity:a?.6:void 0,transform:Kn.Translate.toString(f),transition:d},v=b=>b.split(" ").map(C=>C[0]).join("").toUpperCase().substring(0,2),m=b=>r!=null&&r.color?r.color:`hsl(${b.split("").reduce((x,I)=>I.charCodeAt(0)+((x<<5)-x),0)%360}, 70%, 80%)`;return s.jsx(Ws.Provider,{value:p,children:s.jsx(h.ListItem,{variant:n,ref:c,style:g,endAction:t?s.jsx(RN,{tooltipContent:i}):null,sx:{p:0,borderRadius:"md",overflow:"hidden",transition:"all 0.2s",boxShadow:a?"md":"sm",transform:`scale(${a?1.02:1})`,border:"1px solid",borderColor:"divider"},children:s.jsxs(h.Box,{sx:{display:"flex",width:"100%",alignItems:"center",gap:2,p:0},children:[s.jsx(h.Sheet,{sx:{width:"8px",alignSelf:"stretch",bgcolor:m(r.name)}}),s.jsx(h.Avatar,{src:r.image,alt:r.name,sx:{bgcolor:m(r.name),my:2,ml:1},children:v(r.name)}),s.jsxs(h.Box,{sx:{py:2,pr:2,flexGrow:1,display:"flex",flexDirection:"column",gap:.5},children:[s.jsx(h.Typography,{level:"title-md",children:r.name}),r.description&&s.jsx(h.Typography,{level:"body-sm",sx:{color:"text.secondary",textOverflow:"ellipsis"},children:r.description}),s.jsx(h.Box,{sx:{mt:.5},children:r.type&&s.jsx(h.Chip,{variant:"soft",color:"primary",size:"sm",sx:{px:1,bgcolor:`${m(r.type)}40`},children:r.type})})]})]})})})},MN=({items:e=[],labels:t,setItems:n})=>{const[r,i]=y.useState(null),o=y.useMemo(()=>e.find(l=>l.id===(r==null?void 0:r.id)),[r,e]),a=kv(Ms($s,{activationConstraint:{distance:8}}),Ms(Bs,{coordinateGetter:fb}));return e.length===0?s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",border:"1px dashed",borderColor:"divider",borderRadius:"md"},children:s.jsx(h.Typography,{level:"body-lg",color:"neutral",children:(t==null?void 0:t.noItemsToDisplay)||"No items to display"})}):s.jsxs(tb,{sensors:a,onDragStart:({active:l})=>{i(l)},onDragEnd:({active:l,over:c})=>{if(c&&l.id!==(c==null?void 0:c.id)){const u=e.findIndex(({id:d})=>d===l.id),f=e.findIndex(({id:d})=>d===c.id);n(Us(e,u,f))}i(null)},onDragCancel:()=>{i(null)},children:[s.jsx(cb,{items:e,children:s.jsx(h.List,{sx:{gap:2,maxHeight:"70vh",overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"action.focus",borderRadius:"4px"}},children:e.map(l=>s.jsx(yb,{id:l.id,variant:"outlined",item:l,tooltipContent:t==null?void 0:t.dragToReorder},`sortable-item-${l.id}`))})}),s.jsx(mb,{children:o?s.jsx(yb,{id:o.id,useDraggable:!1,item:o,tooltipContent:t.dragToReorder},`sortable-overlay-item-${o.id}`):null})]})},LN=({entityType:e,entityId:t,authRequirement:n,labels:r})=>{const i=y.useRef(null),o=y.useRef(null),[a,l]=y.useState(!1),[c,u]=y.useState(!1),[f,d]=y.useState(!1),[p,g]=y.useState(""),[v,m]=y.useState(""),[b,C]=y.useState(""),[w,x]=y.useState(null),[I,S]=y.useState(""),[A,E]=y.useState(""),[k,F]=y.useState(""),[W,O]=y.useState(null),[T,N]=y.useState([]),[H,j]=y.useState("before"),[$,M]=y.useState(!1),[V,Y]=y.useState(""),[X,D]=y.useState(""),[L,U]=y.useState("STANDARD"),[G,oe]=y.useState("left"),[ce,se]=y.useState(!0),[Z,te]=y.useState(!0),[ne,de]=y.useState(!0),[ve,Fe]=y.useState(!0),[st,Je]=y.useState(!0),[vt,he]=y.useState(!1);y.useEffect(()=>{n!=="LEAD"&&l(!1),n!=="REGISTERED"&&u(!1)},[n]);const ge=`
2475
+ `},F$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function N$(e){let{announcements:t=F$,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=$$}=e;const{announce:o,announcement:a}=M$(),l=Po("DndLiveRegion"),[c,u]=y.useState(!1);if(y.useEffect(()=>{u(!0)},[]),L$(y.useMemo(()=>({onDragStart(d){let{active:p}=d;o(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:g}=d;t.onDragMove&&o(t.onDragMove({active:p,over:g}))},onDragOver(d){let{active:p,over:g}=d;o(t.onDragOver({active:p,over:g}))},onDragEnd(d){let{active:p,over:g}=d;o(t.onDragEnd({active:p,over:g}))},onDragCancel(d){let{active:p,over:g}=d;o(t.onDragCancel({active:p,over:g}))}}),[o,t])),!c)return null;const f=y.createElement(y.Fragment,null,y.createElement(O$,{id:r,value:i.draggable}),y.createElement(R$,{id:l,announcement:a}));return n?yt.createPortal(f,n):f}var wt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(wt||(wt={}));function Rs(){}function Ms(e,t){return y.useMemo(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function kv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const mn=Object.freeze({x:0,y:0});function z$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function j$(e,t){const n=Os(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function U$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function V$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function _v(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Pv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const H$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=_v(t),o=[];for(const a of r){const{id:l}=a,c=n.get(l);if(c){const u=_v(c),f=i.reduce((p,g,v)=>p+z$(u[v],g),0),d=Number((f/4).toFixed(4));o.push({id:l,data:{droppableContainer:a,value:d}})}}return o.sort(U$)};function W$(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,l=o-n;if(r<i&&n<o){const c=t.width*t.height,u=e.width*e.height,f=a*l,d=f/(c+u-f);return Number(d.toFixed(4))}return 0}const G$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,l=n.get(a);if(l){const c=W$(l,t);c>0&&i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(V$)};function Y$(e,t,n){return Q(B({},e),{scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1})}function Dv(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:mn}function K$(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,l)=>Q(B({},a),{top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),B({},n))}}const q$=K$(1);function Ov(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Q$(e,t,n){const r=Ov(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:l}=r,c=e.left-a-(1-i)*parseFloat(n),u=e.top-l-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),f=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c}}const J$={ignoreTransform:!1};function Ai(e,t){t===void 0&&(t=J$);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=Ft(e).getComputedStyle(e);u&&(n=Q$(n,u,f))}const{top:r,left:i,width:o,height:a,bottom:l,right:c}=n;return{top:r,left:i,width:o,height:a,bottom:l,right:c}}function Rv(e){return Ai(e,{ignoreTransform:!0})}function X$(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Z$(e,t){return t===void 0&&(t=Ft(e).getComputedStyle(e)),t.position==="fixed"}function eF(e,t){t===void 0&&(t=Ft(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function Ls(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Ou(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Eo(i)||Iv(i)||n.includes(i))return n;const o=Ft(e).getComputedStyle(i);return i!==e&&eF(i,o)&&n.push(i),Z$(i,o)?n:r(i.parentNode)}return e?r(e):n}function Mv(e){const[t]=Ls(e,1);return t!=null?t:null}function Mu(e){return!Es||!e?null:wi(e)?e:Du(e)?Ou(e)||e===Si(e).scrollingElement?window:Eo(e)?e:null:null}function Lv(e){return wi(e)?e.scrollX:e.scrollLeft}function Bv(e){return wi(e)?e.scrollY:e.scrollTop}function Lu(e){return{x:Lv(e),y:Bv(e)}}var kt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(kt||(kt={}));function $v(e){return!Es||!e?!1:e===document.scrollingElement}function Fv(e){const t={x:0,y:0},n=$v(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:l,maxScroll:r,minScroll:t}}const tF={x:.2,y:.2};function nF(e,t,n,r,i){let{top:o,left:a,right:l,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=tF);const{isTop:u,isBottom:f,isLeft:d,isRight:p}=Fv(e),g={x:0,y:0},v={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+m.height?(g.y=kt.Backward,v.y=r*Math.abs((t.top+m.height-o)/m.height)):!f&&c>=t.bottom-m.height&&(g.y=kt.Forward,v.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!p&&l>=t.right-m.width?(g.x=kt.Forward,v.x=r*Math.abs((t.right-m.width-l)/m.width)):!d&&a<=t.left+m.width&&(g.x=kt.Backward,v.x=r*Math.abs((t.left+m.width-a)/m.width)),{direction:g,speed:v}}function rF(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Nv(e){return e.reduce((t,n)=>Ii(t,Lu(n)),mn)}function iF(e){return e.reduce((t,n)=>t+Lv(n),0)}function oF(e){return e.reduce((t,n)=>t+Bv(n),0)}function zv(e,t){if(t===void 0&&(t=Ai),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);Mv(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const aF=[["x",["left","right"],iF],["y",["top","bottom"],oF]];class Bu{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ls(n),i=Nv(r);this.rect=B({},t),this.width=t.width,this.height=t.height;for(const[o,a,l]of aF)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=l(r),f=i[o]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Oo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function sF(e){const{EventTarget:t}=Ft(e);return e instanceof t?e:Si(e)}function $u(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(_i(n,2)+_i(r,2))>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var un;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(un||(un={}));function jv(e){e.preventDefault()}function lF(e){e.stopPropagation()}var Re;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Re||(Re={}));const Uv={start:[Re.Space,Re.Enter],cancel:[Re.Esc],end:[Re.Space,Re.Enter,Re.Tab]},cF=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Re.Right:return Q(B({},n),{x:n.x+25});case Re.Left:return Q(B({},n),{x:n.x-25});case Re.Down:return Q(B({},n),{y:n.y+25});case Re.Up:return Q(B({},n),{y:n.y-25})}};class Bs{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Oo(Si(n)),this.windowListeners=new Oo(Ft(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(un.Resize,this.handleCancel),this.windowListeners.add(un.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(un.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&zv(r),n(mn)}handleKeyDown(t){if(Ds(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=Uv,coordinateGetter:a=cF,scrollBehavior:l="smooth"}=i,{code:c}=t;if(o.end.includes(c)){this.handleEnd(t);return}if(o.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:mn;this.referenceCoordinates||(this.referenceCoordinates=f);const d=a(t,{active:n,context:r.current,currentCoordinates:f});if(d){const p=Do(d,f),g={x:0,y:0},{scrollableAncestors:v}=r.current;for(const m of v){const b=t.code,{isTop:C,isRight:w,isLeft:x,isBottom:I,maxScroll:S,minScroll:A}=Fv(m),E=rF(m),k={x:Math.min(b===Re.Right?E.right-E.width/2:E.right,Math.max(b===Re.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(b===Re.Down?E.bottom-E.height/2:E.bottom,Math.max(b===Re.Down?E.top:E.top+E.height/2,d.y))},F=b===Re.Right&&!w||b===Re.Left&&!x,W=b===Re.Down&&!I||b===Re.Up&&!C;if(F&&k.x!==d.x){const O=m.scrollLeft+p.x,T=b===Re.Right&&O<=S.x||b===Re.Left&&O>=A.x;if(T&&!p.y){m.scrollTo({left:O,behavior:l});return}T?g.x=m.scrollLeft-O:g.x=b===Re.Right?m.scrollLeft-S.x:m.scrollLeft-A.x,g.x&&m.scrollBy({left:-g.x,behavior:l});break}else if(W&&k.y!==d.y){const O=m.scrollTop+p.y,T=b===Re.Down&&O<=S.y||b===Re.Up&&O>=A.y;if(T&&!p.x){m.scrollTo({top:O,behavior:l});return}T?g.y=m.scrollTop-O:g.y=b===Re.Down?m.scrollTop-S.y:m.scrollTop-A.y,g.y&&m.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Ii(Do(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Bs.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Uv,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const l=o.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Vv(e){return!!(e&&"distance"in e)}function Hv(e){return!!(e&&"delay"in e)}class Fu{constructor(t,n,r){var i;r===void 0&&(r=sF(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=Si(a),this.documentListeners=new Oo(this.document),this.listeners=new Oo(r),this.windowListeners=new Oo(Ft(a)),this.initialCoordinates=(i=Os(o))!=null?i:mn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(un.Resize,this.handleCancel),this.windowListeners.add(un.DragStart,jv),this.windowListeners.add(un.VisibilityChange,this.handleCancel),this.windowListeners.add(un.ContextMenu,jv),this.documentListeners.add(un.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Hv(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Vv(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(un.Click,lF,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(un.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:l}}=o;if(!i)return;const c=(n=Os(t))!=null?n:mn,u=Do(i,c);if(!r&&l){if(Vv(l)){if(l.tolerance!=null&&$u(u,l.tolerance))return this.handleCancel();if($u(u,l.distance))return this.handleStart()}if(Hv(l)&&$u(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Re.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const uF={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class $s extends Fu{constructor(t){const{event:n}=t,r=Si(n.target);super(t,uF,r)}}$s.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const dF={move:{name:"mousemove"},end:{name:"mouseup"}};var Nu;(function(e){e[e.RightClick=2]="RightClick"})(Nu||(Nu={}));class fF extends Fu{constructor(t){super(t,dF,Si(t.event.target))}}fF.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Nu.RightClick?!1:(r==null||r({event:n}),!0)}}];const zu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class hF extends Fu{constructor(t){super(t,zu)}static setup(){return window.addEventListener(zu.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(zu.move.name,t)};function t(){}}}hF.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Ro;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ro||(Ro={}));var Fs;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Fs||(Fs={}));function pF(e){let{acceleration:t,activator:n=Ro.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:l=Fs.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:p}=e;const g=mF({delta:d,disabled:!o}),[v,m]=E$(),b=y.useRef({x:0,y:0}),C=y.useRef({x:0,y:0}),w=y.useMemo(()=>{switch(n){case Ro.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ro.DraggableRect:return i}},[n,i,c]),x=y.useRef(null),I=y.useCallback(()=>{const A=x.current;if(!A)return;const E=b.current.x*C.current.x,k=b.current.y*C.current.y;A.scrollBy(E,k)},[]),S=y.useMemo(()=>l===Fs.TreeOrder?[...u].reverse():u,[l,u]);y.useEffect(()=>{if(!o||!u.length||!w){m();return}for(const A of S){if((r==null?void 0:r(A))===!1)continue;const E=u.indexOf(A),k=f[E];if(!k)continue;const{direction:F,speed:W}=nF(A,k,w,t,p);for(const O of["x","y"])g[O][F[O]]||(W[O]=0,F[O]=0);if(W.x>0||W.y>0){m(),x.current=A,v(I,a),b.current=W,C.current=F;return}}b.current={x:0,y:0},C.current={x:0,y:0},m()},[t,I,r,m,o,a,JSON.stringify(w),JSON.stringify(g),v,u,S,f,JSON.stringify(p)])}const gF={x:{[kt.Backward]:!1,[kt.Forward]:!1},y:{[kt.Backward]:!1,[kt.Forward]:!1}};function mF(e){let{delta:t,disabled:n}=e;const r=Ps(t);return _o(i=>{if(n||!r||!i)return gF;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[kt.Backward]:i.x[kt.Backward]||o.x===-1,[kt.Forward]:i.x[kt.Forward]||o.x===1},y:{[kt.Backward]:i.y[kt.Backward]||o.y===-1,[kt.Forward]:i.y[kt.Forward]||o.y===1}}},[n,t,r])}function vF(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return _o(i=>{var o;return t==null?null:(o=r!=null?r:i)!=null?o:null},[r,t])}function bF(e,t){return y.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var Mo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Mo||(Mo={}));var ju;(function(e){e.Optimized="optimized"})(ju||(ju={}));const Wv=new Map;function yF(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=y.useState(null),{frequency:l,measure:c,strategy:u}=i,f=y.useRef(e),d=b(),p=ko(d),g=y.useCallback(function(C){C===void 0&&(C=[]),!p.current&&a(w=>w===null?C:w.concat(C.filter(x=>!w.includes(x))))},[p]),v=y.useRef(null),m=_o(C=>{if(d&&!n)return Wv;if(!C||C===Wv||f.current!==e||o!=null){const w=new Map;for(let x of e){if(!x)continue;if(o&&o.length>0&&!o.includes(x.id)&&x.rect.current){w.set(x.id,x.rect.current);continue}const I=x.node.current,S=I?new Bu(c(I),I):null;x.rect.current=S,S&&w.set(x.id,S)}return w}return C},[e,o,n,d,c]);return y.useEffect(()=>{f.current=e},[e]),y.useEffect(()=>{d||g()},[n,d]),y.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),y.useEffect(()=>{d||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{g(),v.current=null},l))},[l,d,g,...r]),{droppableRects:m,measureDroppableContainers:g,measuringScheduled:o!=null};function b(){switch(u){case Mo.Always:return!1;case Mo.BeforeDragging:return n;default:return!n}}}function Uu(e,t){return _o(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function xF(e,t){return Uu(e,t)}function CF(e){let{callback:t,disabled:n}=e;const r=ks(t),i=y.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Ns(e){let{callback:t,disabled:n}=e;const r=ks(t),i=y.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return y.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function wF(e){return new Bu(Ai(e),e)}function Gv(e,t,n){t===void 0&&(t=wF);const[r,i]=y.useState(null);function o(){i(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c!=null?c:n)!=null?u:null}const f=t(e);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const a=CF({callback(c){if(e)for(const u of c){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){o();break}}}}),l=Ns({callback:o});return gn(()=>{o(),e?(l==null||l.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),a==null||a.disconnect())},[e]),r}function SF(e){const t=Uu(e);return Dv(e,t)}const Yv=[];function IF(e){const t=y.useRef(e),n=_o(r=>e?r&&r!==Yv&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ls(e):Yv,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function AF(e){const[t,n]=y.useState(null),r=y.useRef(e),i=y.useCallback(o=>{const a=Mu(o.target);a&&n(l=>l?(l.set(a,Lu(a)),new Map(l)):null)},[]);return y.useEffect(()=>{const o=r.current;if(e!==o){a(o);const l=e.map(c=>{const u=Mu(c);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,Lu(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{a(e),a(o)};function a(l){l.forEach(c=>{const u=Mu(c);u==null||u.removeEventListener("scroll",i)})}},[i,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>Ii(o,a),mn):Nv(e):mn,[e,t])}function Kv(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const r=e!==mn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Do(e,n.current):mn}function TF(e){y.useEffect(()=>{if(!Es)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function EF(e,t){return y.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function qv(e){return y.useMemo(()=>e?X$(e):null,[e])}const Qv=[];function kF(e,t){t===void 0&&(t=Ai);const[n]=e,r=qv(n?Ft(n):null),[i,o]=y.useState(Qv);function a(){o(()=>e.length?e.map(c=>$v(c)?r:new Bu(t(c),c)):Qv)}const l=Ns({callback:a});return gn(()=>{l==null||l.disconnect(),a(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),i}function Jv(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Eo(t)?t:e}function _F(e){let{measure:t}=e;const[n,r]=y.useState(null),i=y.useCallback(u=>{for(const{target:f}of u)if(Eo(f)){r(d=>{const p=t(f);return d?Q(B({},d),{width:p.width,height:p.height}):p});break}},[t]),o=Ns({callback:i}),a=y.useCallback(u=>{const f=Jv(u);o==null||o.disconnect(),f&&(o==null||o.observe(f)),r(f?t(f):null)},[t,o]),[l,c]=_s(a);return y.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const PF=[{sensor:$s,options:{}},{sensor:Bs,options:{}}],DF={current:{}},zs={draggable:{measure:Rv},droppable:{measure:Rv,strategy:Mo.WhileDragging,frequency:ju.Optimized},dragOverlay:{measure:Ai}};class Lo extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const OF={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Lo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Rs},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:zs,measureDroppableContainers:Rs,windowRect:null,measuringScheduled:!1},Xv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Rs,draggableNodes:new Map,over:null,measureDroppableContainers:Rs},Bo=y.createContext(Xv),Zv=y.createContext(OF);function RF(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Lo}}}function MF(e,t){switch(t.type){case wt.DragStart:return Q(B({},e),{draggable:Q(B({},e.draggable),{initialCoordinates:t.initialCoordinates,active:t.active})});case wt.DragMove:return e.draggable.active==null?e:Q(B({},e),{draggable:Q(B({},e.draggable),{translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}})});case wt.DragEnd:case wt.DragCancel:return Q(B({},e),{draggable:Q(B({},e.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case wt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Lo(e.droppable.containers);return i.set(r,n),Q(B({},e),{droppable:Q(B({},e.droppable),{containers:i})})}case wt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new Lo(e.droppable.containers);return a.set(n,Q(B({},o),{disabled:i})),Q(B({},e),{droppable:Q(B({},e.droppable),{containers:a})})}case wt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Lo(e.droppable.containers);return o.delete(n),Q(B({},e),{droppable:Q(B({},e.droppable),{containers:o})})}default:return e}}function LF(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=y.useContext(Bo),o=Ps(r),a=Ps(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!Ds(o)||document.activeElement===o.target)return;const l=i.get(a);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const d=P$(f);if(d){d.focus();break}}})}},[r,t,i,a,o]),null}function eb(e,t){let i=t,{transform:n}=i,r=Qe(i,["transform"]);return e!=null&&e.length?e.reduce((o,a)=>a(B({transform:o},r)),n):n}function BF(e){return y.useMemo(()=>({draggable:B(B({},zs.draggable),e==null?void 0:e.draggable),droppable:B(B({},zs.droppable),e==null?void 0:e.droppable),dragOverlay:B(B({},zs.dragOverlay),e==null?void 0:e.dragOverlay)}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function $F(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=y.useRef(!1),{x:a,y:l}=typeof i=="boolean"?{x:i,y:i}:i;gn(()=>{if(!a&&!l||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=Dv(f,r);if(a||(d.x=0),l||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=Mv(u);p&&p.scrollBy({top:d.y,left:d.x})}},[t,a,l,r,n])}const js=y.createContext(Q(B({},mn),{scaleX:1,scaleY:1}));var dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(dr||(dr={}));const tb=y.memo(function(t){var n,r,i,o;let Gt=t,{id:a,accessibility:l,autoScroll:c=!0,children:u,sensors:f=PF,collisionDetection:d=G$,measuring:p,modifiers:g}=Gt,v=Qe(Gt,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const m=y.useReducer(MF,void 0,RF),[b,C]=m,[w,x]=B$(),[I,S]=y.useState(dr.Uninitialized),A=I===dr.Initialized,{draggable:{active:E,nodes:k,translate:F},droppable:{containers:W}}=b,O=E!=null?k.get(E):null,T=y.useRef({initial:null,translated:null}),N=y.useMemo(()=>{var bt;return E!=null?{id:E,data:(bt=O==null?void 0:O.data)!=null?bt:DF,rect:T}:null},[E,O]),H=y.useRef(null),[j,$]=y.useState(null),[M,V]=y.useState(null),Y=ko(v,Object.values(v)),X=Po("DndDescribedBy",a),D=y.useMemo(()=>W.getEnabled(),[W]),L=BF(p),{droppableRects:U,measureDroppableContainers:G,measuringScheduled:oe}=yF(D,{dragging:A,dependencies:[F.x,F.y],config:L.droppable}),ce=vF(k,E),se=y.useMemo(()=>M?Os(M):null,[M]),Z=Wt(),te=xF(ce,L.draggable.measure);$F({activeNode:E!=null?k.get(E):null,config:Z.layoutShiftCompensation,initialRect:te,measure:L.draggable.measure});const ne=Gv(ce,L.draggable.measure,te),de=Gv(ce?ce.parentElement:null),ve=y.useRef({activatorEvent:null,active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Fe=W.getNodeFor((n=ve.current.over)==null?void 0:n.id),st=_F({measure:L.dragOverlay.measure}),Je=(r=st.nodeRef.current)!=null?r:ce,vt=A?(i=st.rect)!=null?i:ne:null,he=!!(st.nodeRef.current&&st.rect),ge=SF(he?null:ne),xe=qv(Je?Ft(Je):null),ke=IF(A?Fe!=null?Fe:ce:null),Ye=kF(ke),Oe=eb(g,{transform:{x:F.x-ge.x,y:F.y-ge.y,scaleX:1,scaleY:1},activatorEvent:M,active:N,activeNodeRect:ne,containerNodeRect:de,draggingNodeRect:vt,over:ve.current.over,overlayNodeRect:st.rect,scrollableAncestors:ke,scrollableAncestorRects:Ye,windowRect:xe}),Pe=se?Ii(se,F):null,St=AF(ke),It=Kv(St),Mt=Kv(St,[ne]),_t=Ii(Oe,It),Nt=vt?q$(vt,Oe):null,kn=N&&Nt?d({active:N,collisionRect:Nt,droppableRects:U,droppableContainers:D,pointerCoordinates:Pe}):null,Ei=Pv(kn,"id"),[dn,Mr]=y.useState(null),$o=he?Oe:Ii(Oe,Mt),Fo=Y$($o,(o=dn==null?void 0:dn.rect)!=null?o:null,ne),Ne=y.useRef(null),hr=y.useCallback((bt,P)=>{let{sensor:z,options:q}=P;if(H.current==null)return;const ee=k.get(H.current);if(!ee)return;const ae=bt.nativeEvent,ue=new z({active:H.current,activeNode:ee,event:ae,options:q,context:ve,onAbort(fe){if(!k.get(fe))return;const{onDragAbort:pe}=Y.current,ie={id:fe};pe==null||pe(ie),w({type:"onDragAbort",event:ie})},onPending(fe,Se,pe,ie){if(!k.get(fe))return;const{onDragPending:Lt}=Y.current,lt={id:fe,constraint:Se,initialCoordinates:pe,offset:ie};Lt==null||Lt(lt),w({type:"onDragPending",event:lt})},onStart(fe){const Se=H.current;if(Se==null)return;const pe=k.get(Se);if(!pe)return;const{onDragStart:ie}=Y.current,Ae={activatorEvent:ae,active:{id:Se,data:pe.data,rect:T}};yt.unstable_batchedUpdates(()=>{ie==null||ie(Ae),S(dr.Initializing),C({type:wt.DragStart,initialCoordinates:fe,active:Se}),w({type:"onDragStart",event:Ae}),$(Ne.current),V(ae)})},onMove(fe){C({type:wt.DragMove,coordinates:fe})},onEnd:Ce(wt.DragEnd),onCancel:Ce(wt.DragCancel)});Ne.current=ue;function Ce(fe){return function(){return _(this,null,function*(){const{active:pe,collisions:ie,over:Ae,scrollAdjustedTranslate:Lt}=ve.current;let lt=null;if(pe&&Lt){const{cancelDrop:vn}=Y.current;lt={activatorEvent:ae,active:pe,collisions:ie,delta:Lt,over:Ae},fe===wt.DragEnd&&typeof vn=="function"&&(yield Promise.resolve(vn(lt)))&&(fe=wt.DragCancel)}H.current=null,yt.unstable_batchedUpdates(()=>{C({type:fe}),S(dr.Uninitialized),Mr(null),$(null),V(null),Ne.current=null;const vn=fe===wt.DragEnd?"onDragEnd":"onDragCancel";if(lt){const _n=Y.current[vn];_n==null||_n(lt),w({type:vn,event:lt})}})})}}},[k]),Lr=y.useCallback((bt,P)=>(z,q)=>{const ee=z.nativeEvent,ae=k.get(q);if(H.current!==null||!ae||ee.dndKit||ee.defaultPrevented)return;const ue={active:ae};bt(z,P.options,ue)===!0&&(ee.dndKit={capturedBy:P.sensor},H.current=q,hr(z,P))},[k,hr]),ki=bF(f,Lr);TF(f),gn(()=>{ne&&I===dr.Initializing&&S(dr.Initialized)},[ne,I]),y.useEffect(()=>{const{onDragMove:bt}=Y.current,{active:P,activatorEvent:z,collisions:q,over:ee}=ve.current;if(!P||!z)return;const ae={active:P,activatorEvent:z,collisions:q,delta:{x:_t.x,y:_t.y},over:ee};yt.unstable_batchedUpdates(()=>{bt==null||bt(ae),w({type:"onDragMove",event:ae})})},[_t.x,_t.y]),y.useEffect(()=>{const{active:bt,activatorEvent:P,collisions:z,droppableContainers:q,scrollAdjustedTranslate:ee}=ve.current;if(!bt||H.current==null||!P||!ee)return;const{onDragOver:ae}=Y.current,ue=q.get(Ei),Ce=ue&&ue.rect.current?{id:ue.id,rect:ue.rect.current,data:ue.data,disabled:ue.disabled}:null,fe={active:bt,activatorEvent:P,collisions:z,delta:{x:ee.x,y:ee.y},over:Ce};yt.unstable_batchedUpdates(()=>{Mr(Ce),ae==null||ae(fe),w({type:"onDragOver",event:fe})})},[Ei]),gn(()=>{ve.current={activatorEvent:M,active:N,activeNode:ce,collisionRect:Nt,collisions:kn,droppableRects:U,draggableNodes:k,draggingNode:Je,draggingNodeRect:vt,droppableContainers:W,over:dn,scrollableAncestors:ke,scrollAdjustedTranslate:_t},T.current={initial:vt,translated:Nt}},[N,ce,kn,Nt,k,Je,vt,U,W,dn,ke,_t]),pF(Q(B({},Z),{delta:F,draggingRect:Nt,pointerCoordinates:Pe,scrollableAncestors:ke,scrollableAncestorRects:Ye}));const pr=y.useMemo(()=>({active:N,activeNode:ce,activeNodeRect:ne,activatorEvent:M,collisions:kn,containerNodeRect:de,dragOverlay:st,draggableNodes:k,droppableContainers:W,droppableRects:U,over:dn,measureDroppableContainers:G,scrollableAncestors:ke,scrollableAncestorRects:Ye,measuringConfiguration:L,measuringScheduled:oe,windowRect:xe}),[N,ce,ne,M,kn,de,st,k,W,U,dn,G,ke,Ye,L,oe,xe]),gr=y.useMemo(()=>({activatorEvent:M,activators:ki,active:N,activeNodeRect:ne,ariaDescribedById:{draggable:X},dispatch:C,draggableNodes:k,over:dn,measureDroppableContainers:G}),[M,ki,N,ne,C,X,k,dn,G]);return y.createElement(Ev.Provider,{value:x},y.createElement(Bo.Provider,{value:gr},y.createElement(Zv.Provider,{value:pr},y.createElement(js.Provider,{value:Fo},u)),y.createElement(LF,{disabled:(l==null?void 0:l.restoreFocus)===!1})),y.createElement(N$,Q(B({},l),{hiddenTextDescribedById:X})));function Wt(){const bt=(j==null?void 0:j.autoScrollEnabled)===!1,P=typeof c=="object"?c.enabled===!1:c===!1,z=A&&!bt&&!P;return typeof c=="object"?Q(B({},c),{enabled:z}):{enabled:z}}}),FF=y.createContext(null),nb="button",NF="Draggable";function zF(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=Po(NF),{activators:a,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:p}=y.useContext(Bo),{role:g=nb,roleDescription:v="draggable",tabIndex:m=0}=i!=null?i:{},b=(c==null?void 0:c.id)===t,C=y.useContext(b?js:FF),[w,x]=_s(),[I,S]=_s(),A=EF(a,t),E=ko(n);gn(()=>(d.set(t,{id:t,key:o,node:w,activatorNode:I,data:E}),()=>{const F=d.get(t);F&&F.key===o&&d.delete(t)}),[d,t]);const k=y.useMemo(()=>({role:g,tabIndex:m,"aria-disabled":r,"aria-pressed":b&&g===nb?!0:void 0,"aria-roledescription":v,"aria-describedby":f.draggable}),[r,g,m,b,v,f.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:k,isDragging:b,listeners:r?void 0:A,node:w,over:p,setNodeRef:x,setActivatorNodeRef:S,transform:C}}function rb(){return y.useContext(Zv)}const jF="Droppable",UF={timeout:25};function VF(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=Po(jF),{active:a,dispatch:l,over:c,measureDroppableContainers:u}=y.useContext(Bo),f=y.useRef({disabled:n}),d=y.useRef(!1),p=y.useRef(null),g=y.useRef(null),{disabled:v,updateMeasurementsFor:m,timeout:b}=B(B({},UF),i),C=ko(m!=null?m:r),w=y.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(C.current)?C.current:[C.current]),g.current=null},b)},[b]),x=Ns({callback:w,disabled:v||!a}),I=y.useCallback((k,F)=>{x&&(F&&(x.unobserve(F),d.current=!1),k&&x.observe(k))},[x]),[S,A]=_s(I),E=ko(t);return y.useEffect(()=>{!x||!S.current||(x.disconnect(),d.current=!1,x.observe(S.current))},[S,x]),y.useEffect(()=>(l({type:wt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:p,data:E}}),()=>l({type:wt.UnregisterDroppable,key:o,id:r})),[r]),y.useEffect(()=>{n!==f.current.disabled&&(l({type:wt.SetDroppableDisabled,id:r,key:o,disabled:n}),f.current.disabled=n)},[r,o,n,l]),{active:a,rect:p,isOver:(c==null?void 0:c.id)===r,node:S,over:c,setNodeRef:A}}function HF(e){let{animation:t,children:n}=e;const[r,i]=y.useState(null),[o,a]=y.useState(null),l=Ps(n);return!n&&!r&&l&&i(l),gn(()=>{if(!o)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),y.createElement(y.Fragment,null,n,r?y.cloneElement(r,{ref:a}):null)}const WF={x:0,y:0,scaleX:1,scaleY:1};function GF(e){let{children:t}=e;return y.createElement(Bo.Provider,{value:Xv},y.createElement(js.Provider,{value:WF},t))}const YF={position:"fixed",touchAction:"none"},KF=e=>Ds(e)?"transform 250ms ease":void 0,qF=y.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:l,style:c,transform:u,transition:f=KF}=e;if(!l)return null;const d=i?u:Q(B({},u),{scaleX:1,scaleY:1}),p=B(Q(B({},YF),{width:l.width,height:l.height,top:l.top,left:l.left,transform:Kn.Transform.toString(d),transformOrigin:i&&r?j$(r,l):void 0,transition:typeof f=="function"?f(r):f}),c);return y.createElement(n,{className:a,style:p,ref:t},o)}),ib=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[l,c]of Object.entries(o.active))c!==void 0&&(i[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,c));if(o!=null&&o.dragOverlay)for(const[l,c]of Object.entries(o.dragOverlay))c!==void 0&&r.node.style.setProperty(l,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[c,u]of Object.entries(i))n.node.style.setProperty(c,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},QF={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Kn.Transform.toString(t)},{transform:Kn.Transform.toString(n)}]},sideEffects:ib({styles:{active:{opacity:"0"}}})};function JF(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return ks((o,a)=>{if(t===null)return;const l=n.get(o);if(!l)return;const c=l.node.current;if(!c)return;const u=Jv(a);if(!u)return;const{transform:f}=Ft(a).getComputedStyle(a),d=Ov(f);if(!d)return;const p=typeof t=="function"?t:XF(t);return zv(c,i.draggable.measure),p({active:{id:o,data:l.data,node:c,rect:i.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function XF(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}=B(B({},QF),e);return o=>{let w=o,{active:a,dragOverlay:l,transform:c}=w,u=Qe(w,["active","dragOverlay","transform"]);if(!t)return;const f={x:l.rect.left-a.rect.left,y:l.rect.top-a.rect.top},d={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/l.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/l.rect.height:1},p=B({x:c.x-f.x,y:c.y-f.y},d),g=i(Q(B({},u),{active:a,dragOverlay:l,transform:{initial:c,final:p}})),[v]=g,m=g[g.length-1];if(JSON.stringify(v)===JSON.stringify(m))return;const b=r==null?void 0:r(B({active:a,dragOverlay:l},u)),C=l.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(x=>{C.onfinish=()=>{b==null||b(),x()}})}}let ob=0;function ZF(e){return y.useMemo(()=>{if(e!=null)return ob++,ob},[e])}const eN=y.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:l="div",className:c,zIndex:u=999}=e;const{activatorEvent:f,active:d,activeNodeRect:p,containerNodeRect:g,draggableNodes:v,droppableContainers:m,dragOverlay:b,over:C,measuringConfiguration:w,scrollableAncestors:x,scrollableAncestorRects:I,windowRect:S}=rb(),A=y.useContext(js),E=ZF(d==null?void 0:d.id),k=eb(a,{activatorEvent:f,active:d,activeNodeRect:p,containerNodeRect:g,draggingNodeRect:b.rect,over:C,overlayNodeRect:b.rect,scrollableAncestors:x,scrollableAncestorRects:I,transform:A,windowRect:S}),F=Uu(p),W=JF({config:r,draggableNodes:v,droppableContainers:m,measuringConfiguration:w}),O=F?b.setRef:void 0;return y.createElement(GF,null,y.createElement(HF,{animation:W},d&&E?y.createElement(qF,{key:E,id:d.id,ref:O,as:l,activatorEvent:f,adjustScale:t,className:c,transition:o,rect:F,style:B({zIndex:u},i),transform:k},n):null))});function Us(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function tN(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Vs(e){return e!==null&&e>=0}function nN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function rN(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ab=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=Us(t,r,n),a=t[i],l=o[i];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}},sb="Sortable",lb=y.createContext({activeIndex:-1,containerId:sb,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ab,disabled:{draggable:!1,droppable:!1}});function cb(e){let{children:t,id:n,items:r,strategy:i=ab,disabled:o=!1}=e;const{active:a,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:f}=rb(),d=Po(sb,n),p=l.rect!==null,g=y.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),v=a!=null,m=a?g.indexOf(a.id):-1,b=u?g.indexOf(u.id):-1,C=y.useRef(g),w=!nN(g,C.current),x=b!==-1&&m===-1||w,I=rN(o);gn(()=>{w&&v&&f(g)},[w,g,v,f]),y.useEffect(()=>{C.current=g},[g]);const S=y.useMemo(()=>({activeIndex:m,containerId:d,disabled:I,disableTransforms:x,items:g,overIndex:b,useDragOverlay:p,sortedRects:tN(g,c),strategy:i}),[m,d,I.draggable,I.droppable,x,g,b,c,p,i]);return y.createElement(lb.Provider,{value:S},t)}const iN=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Us(n,r,i).indexOf(t)},oN=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==o&&i===a?!1:n?!0:a!==i&&t===c},aN={duration:200,easing:"ease"},ub="transform",sN=Kn.Transition.toString({property:ub,duration:0,easing:"linear"}),lN={roleDescription:"sortable"};function cN(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,a]=y.useState(null),l=y.useRef(n);return gn(()=>{if(!t&&n!==l.current&&r.current){const c=i.current;if(c){const u=Ai(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&a(f)}}n!==l.current&&(l.current=n)},[t,n,r,i]),y.useEffect(()=>{o&&a(null)},[o]),o}function db(e){let{animateLayoutChanges:t=oN,attributes:n,disabled:r,data:i,getNewIndex:o=iN,id:a,strategy:l,resizeObserverConfig:c,transition:u=aN}=e;const{items:f,containerId:d,activeIndex:p,disabled:g,disableTransforms:v,sortedRects:m,overIndex:b,useDragOverlay:C,strategy:w}=y.useContext(lb),x=uN(r,g),I=f.indexOf(a),S=y.useMemo(()=>B({sortable:{containerId:d,index:I,items:f}},i),[d,i,I,f]),A=y.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:E,node:k,isOver:F,setNodeRef:W}=VF({id:a,data:S,disabled:x.droppable,resizeObserverConfig:B({updateMeasurementsFor:A},c)}),{active:O,activatorEvent:T,activeNodeRect:N,attributes:H,setNodeRef:j,listeners:$,isDragging:M,over:V,setActivatorNodeRef:Y,transform:X}=zF({id:a,data:S,attributes:B(B({},lN),n),disabled:x.draggable}),D=T$(W,j),L=!!O,U=L&&!v&&Vs(p)&&Vs(b),G=!C&&M,oe=G&&U?X:null,ce=l!=null?l:w,se=U?oe!=null?oe:ce({rects:m,activeNodeRect:N,activeIndex:p,overIndex:b,index:I}):null,Z=Vs(p)&&Vs(b)?o({id:a,items:f,activeIndex:p,overIndex:b}):I,te=O==null?void 0:O.id,ne=y.useRef({activeId:te,items:f,newIndex:Z,containerId:d}),de=f!==ne.current.items,ve=t({active:O,containerId:d,isDragging:M,isSorting:L,id:a,index:I,items:f,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:u,wasDragging:ne.current.activeId!=null}),Fe=cN({disabled:!ve,index:I,node:k,rect:E});return y.useEffect(()=>{L&&ne.current.newIndex!==Z&&(ne.current.newIndex=Z),d!==ne.current.containerId&&(ne.current.containerId=d),f!==ne.current.items&&(ne.current.items=f)},[L,Z,d,f]),y.useEffect(()=>{if(te===ne.current.activeId)return;if(te!=null&&ne.current.activeId==null){ne.current.activeId=te;return}const Je=setTimeout(()=>{ne.current.activeId=te},50);return()=>clearTimeout(Je)},[te]),{active:O,activeIndex:p,attributes:H,data:S,rect:E,index:I,newIndex:Z,items:f,isOver:F,isSorting:L,isDragging:M,listeners:$,node:k,overIndex:b,over:V,setNodeRef:D,setActivatorNodeRef:Y,setDroppableNodeRef:W,setDraggableNodeRef:j,transform:Fe!=null?Fe:se,transition:st()};function st(){if(Fe||de&&ne.current.newIndex===I)return sN;if(!(G&&!Ds(T)||!u)&&(L||ve))return Kn.Transition.toString(Q(B({},u),{property:ub}))}}function uN(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Hs(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const dN=[Re.Down,Re.Right,Re.Up,Re.Left],fb=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:a,scrollableAncestors:l}}=t;if(dN.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];o.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=i.get(d.id);if(p)switch(e.code){case Re.Down:r.top<p.top&&c.push(d);break;case Re.Up:r.top>p.top&&c.push(d);break;case Re.Left:r.left>p.left&&c.push(d);break;case Re.Right:r.left<p.left&&c.push(d);break}});const u=H$({active:n,collisionRect:r,droppableRects:i,droppableContainers:c,pointerCoordinates:null});let f=Pv(u,"id");if(f===(a==null?void 0:a.id)&&u.length>1&&(f=u[1].id),f!=null){const d=o.get(n.id),p=o.get(f),g=p?i.get(p.id):null,v=p==null?void 0:p.node.current;if(v&&g&&d&&p){const b=Ls(v).some((A,E)=>l[E]!==A),C=hb(d,p),w=fN(d,p),x=b||!C?{x:0,y:0}:{x:w?r.width-g.width:0,y:w?r.height-g.height:0},I={x:g.left,y:g.top};return x.x&&x.y?I:Do(I,x)}}}};function hb(e,t){return!Hs(e)||!Hs(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function fN(e,t){return!Hs(e)||!Hs(t)||!hb(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const pb=Be(s.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Ws=y.createContext({attributes:{},listeners:void 0,ref(){}}),hN=()=>{const{attributes:e,listeners:t,ref:n}=y.useContext(Ws);return s.jsx(h.Button,Q(B(B({sx:{backgroundColor:"transparent",color:"#919eab",width:"10px",":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}},e),t),{ref:n,children:s.jsx(pb,{})}))},gb=({children:e,id:t,tooltipTitle:n,removeItem:r,useDraggable:i=!0,variant:o="plain"})=>{const{attributes:a,isDragging:l,listeners:c,setNodeRef:u,setActivatorNodeRef:f,transform:d,transition:p}=db({id:t}),g=y.useMemo(()=>({attributes:a,listeners:c,ref:f}),[a,c,f]),v={opacity:l?.6:void 0,transform:Kn.Translate.toString(d),transition:p};return s.jsx(Ws.Provider,{value:g,children:s.jsx(h.ListItem,{variant:o,ref:u,style:v,startAction:i?s.jsx(hN,{}):s.jsx(s.Fragment,{}),endAction:i?s.jsx(h.Tooltip,{title:n,children:s.jsx(h.Button,{variant:"outlined",color:"danger",onClick:r,sx:{ml:"auto",p:.5},size:"sm",children:s.jsx(_e.Remove,{})})}):s.jsx(s.Fragment,{}),sx:{p:2,borderRadius:"sm"},children:e})})},pN={sideEffects:ib({styles:{active:{opacity:"0.6"}}})},mb=({children:e})=>s.jsx(eN,{dropAnimation:pN,children:e}),gN=({entities:e=[],labels:t,disabled:n,setEntities:r,removeItem:i})=>{const[o,a]=y.useState(null),l=y.useMemo(()=>e.find(u=>u.id===(o==null?void 0:o.id)),[o,e]),c=kv(Ms($s),Ms(Bs,{coordinateGetter:fb}));return s.jsxs(tb,{sensors:c,onDragStart:({active:u})=>{a(u)},onDragEnd:({active:u,over:f})=>{if(f&&u.id!==(f==null?void 0:f.id)){const d=e.findIndex(({id:g})=>g===u.id),p=e.findIndex(({id:g})=>g===f.id);r(Us(e,d,p))}a(null)},onDragCancel:()=>{a(null)},children:[s.jsx(cb,{items:e,children:s.jsx(h.List,{sx:{gap:"10px",padding:0},children:e.map(u=>s.jsxs(gb,{id:u.id,variant:"outlined",removeItem:()=>i(u.id),tooltipTitle:t.removeEntity,useDraggable:!n,children:[s.jsx(h.Typography,{ml:n?0:2.5,children:u.title||u.name}),u.type&&s.jsx(h.Chip,{color:RB(u.type),sx:{marginLeft:2,marginRight:4},children:MB(u.type)})]},`sortable-item-${u.id}`))})}),s.jsx(mb,{children:l?s.jsx(s.Fragment,{children:e.map(u=>s.jsx(gb,{id:u.id,useDraggable:!1,removeItem:()=>{},tooltipTitle:t.removeEntity},`sortable-overlay-item-${u.id}`))}):s.jsx(s.Fragment,{})})]})},mN=({labels:e,value:t,options:n,size:r="sm",disabled:i=!1,sx:o={},onChange:a})=>s.jsxs(h.FormControl,{size:r,disabled:i,children:[s.jsx(h.FormLabel,{children:e.itemsPerPage}),s.jsx(h.Select,{value:t,size:r,onChange:a,sx:Q(B({},o),{minHeight:"37px"}),children:n.map((l,c)=>s.jsx(h.Option,{value:l,children:l},`items-per-page-${l}-${c}`))})]}),vN=(e,t)=>{const[n,r]=y.useState(null),{sdk:i}=We(),o=()=>_(this,null,function*(){let l=[];if(!e){r(l);return}try{switch(e){case"top_x":l=(yield i.topX.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"match_quiz":l=(yield i.matchQuiz.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"template":l=(yield i.loyalty.getTemplates(void 0,!0)).data.map(C=>({id:C.id,name:C.name,status:C.status,type:e,relationship:"relatedTo"}));break;case"classic_quiz":l=(yield i.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"personality_quiz":l=(yield i.miniGames.getPersonalityQuizzes({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"either_or":l=(yield i.miniGames.getEitherOrs({limit:50},!1,!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"poll":l=(yield i.voting.getPolls({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"bracket":l=(yield i.bracketGame.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break;case"standing":l=(yield i.standingGame.getGames({limit:50},!0)).data.map(C=>({id:C.id,name:C.title,status:C.status,type:e,relationship:"relatedTo"}));break}}catch(c){console.error(c),r(l),t();return}r(l)});return y.useEffect(()=>(o(),()=>r(null)),[e]),n},bN=({status:e})=>{let t="neutral";switch(e){case"DYNAMIC":t="primary";break;case"CUSTOM":t="success";break;case"OPEN":t="primary";break;case"LIVE":t="primary";break;case"CANCELED":t="warning";break;case"SETTLED":t="success";break;case"INACTIVE":t="danger";break;case"ACTIVE":t="success";break;case"EXPIRED":t="neutral";break}return s.jsx(h.Chip,{color:t,variant:"solid",size:"sm",children:e})},yN=Be(s.jsx("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond"),xN=Be(s.jsx("path",{d:"m21.58 16.09-1.09-7.66C20.21 6.46 18.52 5 16.53 5H7.47C5.48 5 3.79 6.46 3.51 8.43l-1.09 7.66C2.2 17.63 3.39 19 4.94 19c.68 0 1.32-.27 1.8-.75L9 16h6l2.25 2.25c.48.48 1.13.75 1.8.75 1.56 0 2.75-1.37 2.53-2.91M11 11H9v2H8v-2H6v-1h2V8h1v2h2zm4-1c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"SportsEsports"),CN=Be(s.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),wN=Be(s.jsx("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows"),SN=Be(s.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Poll"),IN=e=>{switch(e.entityType){case"top_x":return s.jsx(h.Tooltip,{title:"Top X",children:s.jsx(yN,{})});case"match_quiz":return s.jsx(h.Tooltip,{title:"Match Quiz",children:s.jsx(xN,{})});case"template":return s.jsx(h.Tooltip,{title:"Leaderboard Templates",children:s.jsx(_e.EmojiEvents,{})});case"classic_quiz":return s.jsx(h.Tooltip,{title:"Classic Quiz",children:s.jsx(CN,{})});case"either_or":return s.jsx(h.Tooltip,{title:"Either/Or",children:s.jsx(wN,{})});case"poll":return s.jsx(h.Tooltip,{title:"Poll",children:s.jsx(SN,{})});case"bracket":return s.jsx(h.Tooltip,{title:"Custom Bracket Game",children:s.jsx(_e.EmojiEvents,{})});case"standing":return s.jsx(h.Tooltip,{title:"Custom Standings Game",children:s.jsx(_e.EmojiEvents,{})});default:return null}},vb=({entity:e,deleteLabel:t,onDelete:n})=>s.jsx(s.Fragment,{children:s.jsx(h.Card,{sx:{p:2,mb:2},children:s.jsx(h.CardContent,{children:s.jsxs(h.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"space-between"},children:[s.jsx(h.Typography,{fontSize:"sm",startDecorator:s.jsx(IN,{entityType:e.type}),children:e.name}),s.jsx(h.Box,{display:{xs:"none",md:"block"},children:s.jsx(bN,{status:e.status})}),s.jsx(h.Box,{children:s.jsx(h.Tooltip,{title:t,children:s.jsx(h.IconButton,{onClick:()=>n(e.id,e.relationship),color:"danger",size:"sm",children:s.jsx(_e.Delete,{})})})})]})})})}),AN=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=new Map;t.forEach(l=>{if(a.has(l.entity_type)){const c=a.get(l.entity_type);a.set(l.entity_type,[...c,[l.entity_id,l.entity_relationship]])}else a.set(l.entity_type,[[l.entity_id,l.entity_relationship]])});try{for(const[l,c]of a)switch(l){case"top_x":const u=c.map(([O])=>O),f=yield e.topX.getGames({limit:u.length,gameIds:u},!0);o=[...o,...f.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"match_quiz":const d=c.map(([O])=>O),p=yield e.matchQuiz.getGames({limit:d.length,gameIds:d},!0);o=[...o,...p.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"template":const g=c.map(([O])=>O),v=yield e.loyalty.getTemplates(void 0,!0);o=[...o,...v.data.filter(O=>g.includes(O.id)).map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"classic_quiz":const m=c.map(([O])=>O),b=yield e.miniGames.getClassicQuizzes({limit:m.length,classicQuizIds:m},!1,!0);o=[...o,...b.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"personality_quiz":const C=c.map(([O])=>O),w=yield e.miniGames.getPersonalityQuizzes({limit:C.length,personalityQuizIds:C},!1,!0);o=[...o,...w.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"either_or":const x=c.map(([O])=>O),I=yield e.miniGames.getEitherOrs({limit:x.length,eitherOrIds:x},!1,!0);o=[...o,...I.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"poll":const S=c.map(([O])=>O),A=yield e.voting.getPolls({limit:S.length,pollIds:S},!0);o=[...o,...A.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"bracket":const E=c.map(([O])=>O),k=yield e.bracketGame.getGames({limit:E.length,gameIds:E},!0);o=[...o,...k.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;case"standing":const F=c.map(([O])=>O),W=yield e.standingGame.getGames({limit:F.length,gameIds:F},!0);o=[...o,...W.data.map(O=>{var N;const T=((N=c.find(([H])=>H===O.id))==null?void 0:N[1])||"relatedTo";return{id:O.id,name:O.title,status:O.status,type:l,relationship:T}})];break;default:}}catch(l){console.error("Error loading related entities",l),n(o),r()}n(o)}),TN=["top_x","match_quiz","template","classic_quiz","personality_quiz","poll","either_or","bracket","standing"],EN=["relatedTo","blocks","blockedBy","bonusPointsGame","nextInSeries","previousInSeries"],kN=new Map().set("template","Leaderboard Templates").set("classic_quiz","Classic Quiz").set("personality_quiz","Personality Quiz").set("either_or","Either/Or").set("match_quiz","Match Quiz").set("top_x","Top X").set("bracket","Custom Bracket Game").set("standing","Custom Standing Game").set("poll","Poll"),bb=new Map().set("relatedTo","Related to").set("blocks","Blocks").set("blockedBy","Blocked by").set("nextInSeries","Next in series").set("previousInSeries","Previous in series").set("bonusPointsGame","Bonus points game"),_N=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState(""),[l,c]=y.useState(null),[u,f]=y.useState("relatedTo"),[d,p]=y.useState(!1),g=()=>p(!d),v=vN(l,g),{sdk:m}=We();y.useEffect(()=>(e.length>0&&AN(m,e,i,g),()=>{i([]),a(""),c(null),f("relatedTo")}),[]);const b=()=>{if(e.some(E=>E.entity_id===o&&E.entity_relationship===u)){a("");return}const S=[...e,{entity_id:o,entity_type:l,entity_relationship:u}],A=(v==null?void 0:v.filter(E=>E.id===o).map(E=>({id:E.id,name:E.name,type:l,status:E.status,relationship:u})))||[];i([...r,...A]),t(S),a("")},C=(I,S)=>{const A=e.filter(k=>!(k.entity_id===I&&k.entity_relationship===S)),E=r.filter(k=>!(k.id===I&&k.relationship===S));i(E),t(A)},w=r.reduce((I,S)=>{const A=S.relationship;return I[A]||(I[A]=[]),I[A].push(S),I},{}),x=Object.keys(w).sort();return s.jsxs(s.Fragment,{children:[x.map(I=>s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:s.jsx(h.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:bb.get(I)||"Unknown relationship"})}),w[I].map((S,A)=>s.jsx(vb,{entity:S,deleteLabel:n.delete,onDelete:C},`related-entity-relationship-${S.id}-${A}`))]},`relationship-group-${I}`)),s.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.type}),s.jsx(h.Select,{value:l,size:"sm",name:"entity_type",onChange:(I,S)=>c(S),sx:{minHeight:"37px"},children:TN.map(I=>s.jsx(h.Option,{value:I,children:kN.get(I)},`entity-type-option-${I}`))})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.relationship}),s.jsx(h.Select,{value:u,size:"sm",name:"entity_relationship",onChange:(I,S)=>f(S),sx:{minHeight:"37px"},children:EN.map(I=>s.jsx(h.Option,{value:I,children:bb.get(I)},`entity-relationship-option-${I}`))})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.entity}),s.jsx(h.Select,{value:o,size:"sm",name:"entity_id",onChange:(I,S)=>a(S),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!v&&s.jsx(h.CircularProgress,{size:"sm"}),children:v&&v.map(I=>s.jsx(h.Option,{value:I.id,children:I.name},`entity--${I.id}`))})]}),s.jsx(h.Button,{startDecorator:s.jsx(_e.Add,{}),disabled:!o||!l,onClick:b,sx:{mb:1},children:n.add})]}),s.jsx(Ge,{showToast:d,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:g})]})},PN=(e,t,n,r)=>_(this,null,function*(){let o=[];const a=t.filter(l=>l.entity_type==="classic_quiz"&&l.entity_relationship==="bonusPointsGame").map(l=>[l.entity_id,l.entity_relationship]);if(a.length===0){n([]);return}try{const l=a.map(([u])=>u);o=(yield e.miniGames.getClassicQuizzes({limit:l.length,classicQuizIds:l},!1,!0)).data.map(u=>{var d;const f=((d=a.find(([p])=>p===u.id))==null?void 0:d[1])||"bonusPointsGame";return{id:u.id,name:u.title,status:u.status,type:"classic_quiz",relationship:f}})}catch(l){console.error("Error loading related entities",l),n(o),r()}n(o)}),DN=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=y.useState([]),[o,a]=y.useState(""),[l,c]=y.useState(null),[u,f]=y.useState(!1),d=()=>f(!u),{sdk:p}=We();y.useEffect(()=>(e.length>0&&PN(p,e,i,d),()=>{i([]),a("")}),[]),y.useEffect(()=>(_(this,null,function*(){try{const w=(yield p.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(x=>({id:x.id,name:x.title,status:x.status,type:"classic_quiz",relationship:"bonusPointsGame"}));c(w)}catch(C){console.error(C),c([]),d()}}),()=>c(null)),[]);const g=()=>{if(e.some(w=>w.entity_id===o&&w.entity_relationship==="bonusPointsGame")){a("");return}const b=[...e,{entity_id:o,entity_type:"classic_quiz",entity_relationship:"bonusPointsGame"}],C=(l==null?void 0:l.filter(w=>w.id===o).map(w=>({id:w.id,name:w.name,type:"classic_quiz",status:w.status,relationship:"bonusPointsGame"})))||[];i([...r,...C]),t(b),a("")},v=(m,b)=>{const C=e.filter(x=>!(x.entity_id===m&&x.entity_relationship===b)),w=r.filter(x=>!(x.id===m&&x.relationship===b));i(w),t(C)};return s.jsxs(s.Fragment,{children:[r.length>0&&s.jsxs(h.Box,{sx:{mb:2},children:[s.jsx(h.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:s.jsx(h.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:"Bonus points game"})}),r.map((m,b)=>s.jsx(vb,{entity:m,deleteLabel:n.delete,onDelete:v},`related-entity-relationship-${m.id}-${b}`))]}),s.jsxs(h.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.type}),s.jsx(h.Input,{value:"Classic Quiz",readOnly:!0,disabled:!0,size:"sm",sx:{minHeight:"37px"}})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.relationship}),s.jsx(h.Input,{value:"Bonus Points Game",readOnly:!0,disabled:!0,size:"sm",sx:{minHeight:"37px"}})]}),s.jsxs(h.FormControl,{children:[s.jsx(h.FormLabel,{required:!0,color:"primary",children:n.entity}),s.jsx(h.Select,{value:o,size:"sm",name:"entity_id",onChange:(m,b)=>a(b),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!l&&s.jsx(h.CircularProgress,{size:"sm"}),children:l&&l.map(m=>s.jsx(h.Option,{value:m.id,children:m.name},`entity--${m.id}`))})]}),s.jsx(h.Button,{startDecorator:s.jsx(_e.Add,{}),disabled:!o,onClick:g,sx:{mb:1},children:n.add})]}),s.jsx(Ge,{showToast:u,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:d})]})},ON=e=>{const[t,n]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState("success"),[l,c]=y.useState(""),u=y.useContext(fa),f=(p,g)=>{a(p),c(g),i(!0)},d=()=>_(this,null,function*(){n(!0);const p=yield u==null?void 0:u.https.exportLeadsPerEntity(e.entityId);if(p!=null&&p.ok){const g=yield p.blob(),v=URL.createObjectURL(g),m=document.createElement("a");m.href=v,m.download=`${e.entityType}_${e.entityName}_exported_users_leads.csv`,document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(v),n(!1),f("success",e.labels.usersLeadsExportMessage)}else console.error("Failed to export all users leads: ",yield p==null?void 0:p.json()),n(!1),f("danger",e.labels.usersLeadsExportErrorMessage)});return s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{mb:2,children:[s.jsx(h.Box,{display:"flex",alignItems:"center",mb:1,children:s.jsx(h.Typography,{level:"body-lg",sx:{mx:"auto"},children:e.labels.exportUsersLeads})}),s.jsx(h.Sheet,{sx:{overflowX:"auto",minWidth:"700px"},children:s.jsxs(h.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left",width:"50%"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:e.labels.category}),s.jsx("th",{children:e.labels.action})]})}),s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx(h.Typography,{level:"body-sm",fontWeight:"600",children:e.labels.exportAllUsersLeads}),s.jsx(h.Typography,{level:"body-xs",color:"neutral",children:e.labels.exportAllUsersLeadsDescription})]}),s.jsx("td",{children:s.jsx(h.Button,{loading:t,onClick:d,children:e.labels.exportAllUsersLeads})})]})})]})})]}),s.jsx(Ge,{showToast:r,color:o,message:l,hideToast:()=>i(!1)})]})},RN=({tooltipContent:e="Drag to reorder"})=>{const{attributes:t,listeners:n,ref:r}=y.useContext(Ws);return s.jsx(h.Tooltip,{title:e,placement:"left",arrow:!0,children:s.jsx(h.IconButton,Q(B(B({variant:"plain",color:"neutral",size:"sm",sx:{color:"text.tertiary",my:"auto",mr:1,":hover":{bgcolor:"action.hover"},":active":{bgcolor:"action.selected"},transition:"all 0.2s",cursor:"grab","&:active":{cursor:"grabbing"}}},t),n),{ref:r,children:s.jsx(pb,{})}))})},yb=({id:e,useDraggable:t=!0,variant:n="outlined",item:r,tooltipContent:i})=>{const{attributes:o,isDragging:a,listeners:l,setNodeRef:c,setActivatorNodeRef:u,transform:f,transition:d}=db({id:e}),p=y.useMemo(()=>({attributes:o,listeners:l,ref:u}),[o,l,u]),g={opacity:a?.6:void 0,transform:Kn.Translate.toString(f),transition:d},v=b=>b.split(" ").map(C=>C[0]).join("").toUpperCase().substring(0,2),m=b=>r!=null&&r.color?r.color:`hsl(${b.split("").reduce((x,I)=>I.charCodeAt(0)+((x<<5)-x),0)%360}, 70%, 80%)`;return s.jsx(Ws.Provider,{value:p,children:s.jsx(h.ListItem,{variant:n,ref:c,style:g,endAction:t?s.jsx(RN,{tooltipContent:i}):null,sx:{p:0,borderRadius:"md",overflow:"hidden",transition:"all 0.2s",boxShadow:a?"md":"sm",transform:`scale(${a?1.02:1})`,border:"1px solid",borderColor:"divider"},children:s.jsxs(h.Box,{sx:{display:"flex",width:"100%",alignItems:"center",gap:2,p:0},children:[s.jsx(h.Sheet,{sx:{width:"8px",alignSelf:"stretch",bgcolor:m(r.name)}}),s.jsx(h.Avatar,{src:r.image,alt:r.name,sx:{bgcolor:m(r.name),my:2,ml:1},children:v(r.name)}),s.jsxs(h.Box,{sx:{py:2,pr:2,flexGrow:1,display:"flex",flexDirection:"column",gap:.5},children:[s.jsx(h.Typography,{level:"title-md",children:r.name}),r.description&&s.jsx(h.Typography,{level:"body-sm",sx:{color:"text.secondary",textOverflow:"ellipsis"},children:r.description}),s.jsx(h.Box,{sx:{mt:.5},children:r.type&&s.jsx(h.Chip,{variant:"soft",color:"primary",size:"sm",sx:{px:1,bgcolor:`${m(r.type)}40`},children:r.type})})]})]})})})},MN=({items:e=[],labels:t,setItems:n})=>{const[r,i]=y.useState(null),o=y.useMemo(()=>e.find(l=>l.id===(r==null?void 0:r.id)),[r,e]),a=kv(Ms($s,{activationConstraint:{distance:8}}),Ms(Bs,{coordinateGetter:fb}));return e.length===0?s.jsx(h.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",border:"1px dashed",borderColor:"divider",borderRadius:"md"},children:s.jsx(h.Typography,{level:"body-lg",color:"neutral",children:(t==null?void 0:t.noItemsToDisplay)||"No items to display"})}):s.jsxs(tb,{sensors:a,onDragStart:({active:l})=>{i(l)},onDragEnd:({active:l,over:c})=>{if(c&&l.id!==(c==null?void 0:c.id)){const u=e.findIndex(({id:d})=>d===l.id),f=e.findIndex(({id:d})=>d===c.id);n(Us(e,u,f))}i(null)},onDragCancel:()=>{i(null)},children:[s.jsx(cb,{items:e,children:s.jsx(h.List,{sx:{gap:2,maxHeight:"70vh",overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"action.focus",borderRadius:"4px"}},children:e.map(l=>s.jsx(yb,{id:l.id,variant:"outlined",item:l,tooltipContent:t==null?void 0:t.dragToReorder},`sortable-item-${l.id}`))})}),s.jsx(mb,{children:o?s.jsx(yb,{id:o.id,useDraggable:!1,item:o,tooltipContent:t.dragToReorder},`sortable-overlay-item-${o.id}`):null})]})},LN=({entityType:e,entityId:t,authRequirement:n,labels:r})=>{const i=y.useRef(null),o=y.useRef(null),[a,l]=y.useState(!1),[c,u]=y.useState(!1),[f,d]=y.useState(!1),[p,g]=y.useState(""),[v,m]=y.useState(""),[b,C]=y.useState(""),[w,x]=y.useState(null),[I,S]=y.useState(""),[A,E]=y.useState(""),[k,F]=y.useState(""),[W,O]=y.useState(null),[T,N]=y.useState([]),[H,j]=y.useState("before"),[$,M]=y.useState(!1),[V,Y]=y.useState(""),[X,D]=y.useState(""),[L,U]=y.useState("STANDARD"),[G,oe]=y.useState("left"),[ce,se]=y.useState(!0),[Z,te]=y.useState(!0),[ne,de]=y.useState(!0),[ve,Fe]=y.useState(!0),[st,Je]=y.useState(!0),[vt,he]=y.useState(!1);y.useEffect(()=>{n!=="LEAD"&&l(!1),n!=="REGISTERED"&&u(!1)},[n]);const ge=`
2476
2476
  data-content-type="${e}"`,xe=`
2477
2477
  data-content-id="${t}"`,ke=T.length>0?`
2478
2478
  data-lead-fields="${T.join(", ")}"`:"",Ye=a?`
@@ -2496,7 +2496,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2496
2496
  data-additional-cta-url="${k}"`:"",pr=f&&W?`
2497
2497
  data-additional-cta-target="${W}"`:"",gr=`<div
2498
2498
  data-component="fu-widget"${ge}${xe}${kn}${Ei}${dn}${Mr}${$o}${Fo}${Ne}${ke}${Ye}${Oe}${Pe}${St}${It}${Mt}${_t}${Nt}${hr}${Lr}${ki}${pr}
2499
- ></div>`,Gt={fullName:"Full name",firstName:"First name",lastName:"Last name",email:"Email",gender:"Gender",country:"Country",phoneCountryCode:"Phone country code",phoneNumber:"Phone number"},zt=({title:ie})=>s.jsx(h.Tooltip,{title:ie,sx:{maxWidth:300},children:s.jsx(Xt,{color:"primary"})}),bt=()=>e!=="either-or"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{mb:1.5,children:[s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.layoutTemplate}),s.jsxs(h.Select,{value:L,size:"md",name:"layout_template",onChange:fe,children:[s.jsx(h.Option,{value:"STANDARD",children:"Standard"}),s.jsx(h.Option,{value:"SPLIT",children:"Split"}),s.jsx(h.Option,{value:"OVERLAY",children:"Overlay"})]}),s.jsx(h.FormHelperText,{children:r.layoutTemplateDescription})]}),s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.imagePosition}),s.jsxs(h.Select,{value:G,size:"md",name:"image_position",disabled:L!=="STANDARD",onChange:(ie,Ae)=>oe(Ae),children:[s.jsx(h.Option,{value:"left",children:"Left"}),s.jsx(h.Option,{value:"right",children:"Right"})]}),s.jsx(h.FormHelperText,{children:r.imagePositionDescription})]})]}),P=()=>e==="classic-quiz"||e==="personality-quiz"?s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:ce,label:r.showAnswerExplanations,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{se(ie)}}),s.jsx(h.Tooltip,{title:r.showAnswerExplanationsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}):e==="match-quiz"||e==="event-game"?s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:Z,label:r.showPredictionDetails||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{te(ie)}}),s.jsx(h.Tooltip,{title:r.showPredictionDetailsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:ne,label:r.showCountdown||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{de(ie)}}),s.jsx(h.Tooltip,{title:r.showCountdownTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:st,label:r.showPoints||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{Je(ie)}}),s.jsx(h.Tooltip,{title:r.showPointsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),e==="match-quiz"&&s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:ve,label:r.showTeamLabels||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{Fe(ie)}}),s.jsx(h.Tooltip,{title:r.showTeamLabelsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]})]}):s.jsx(s.Fragment,{}),z=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(pn,{defaultValue:a,label:r.configureLeads,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="LEAD",onChange:ie=>{ie===!1&&(N([]),j("before")),l(ie)}}),n!=="LEAD"&&s.jsx(h.Tooltip,{title:r.configureLeadsDisabledMessage,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),q=()=>!a||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Or,{label:"",values:T,allValues:Object.keys(Gt),valuesMap:Gt,onChange:ie=>N(ie)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.leadPosition}),s.jsxs(h.Select,{value:H,size:"md",name:"lead_position",onChange:(ie,Ae)=>j(Ae==="before"?"before":"after"),children:[s.jsx(h.Option,{value:"before",children:"Before"}),s.jsx(h.Option,{value:"after",children:"After"})]})]}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.Checkbox,{label:r.syncWithProfile,checked:vt,onChange:ie=>he(ie.target.checked)}),s.jsx(h.FormHelperText,{children:r.syncWithProfileDescription})]})]}),ee=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(pn,{defaultValue:c,label:r.configureSignIn,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="REGISTERED",onChange:ie=>{ie===!1&&(g(""),m("")),u(ie)}}),n!=="REGISTERED"&&s.jsx(h.Tooltip,{title:r.configureSignInDisabledMessage,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),ae=()=>!c||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Ot,{label:r.signInLabel,placeholder:"",defaultValue:"",value:p,required:!1,size:"md",endDecorator:s.jsx(zt,{title:r.signInLabelInfoMessage}),onChange:ie=>g(ie.target.value)}),s.jsx(Ot,{label:r.authenticationHandler,placeholder:"",defaultValue:v,value:"",required:!1,size:"md",endDecorator:s.jsx(zt,{title:r.authenticationHandlerInfoMessage}),onChange:ie=>m(ie.target.value)}),s.jsx(Ot,{label:r.signInUrl,placeholder:"",defaultValue:b,value:"",required:!1,size:"md",endDecorator:s.jsx(zt,{title:r.signInUrlInfoMessage}),onChange:ie=>C(ie.target.value)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.signInTarget}),s.jsxs(h.Box,{display:"flex",alignItems:"center",gap:1,children:[s.jsxs(h.Select,Q(B({action:i,value:w,size:"md",name:"signin_cta_target",onChange:(ie,Ae)=>x(Ae),sx:{flex:1}},w&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:ie=>{ie.stopPropagation()},onClick:()=>{var ie;x(null),(ie=i.current)==null||ie.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(As,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"_blank",children:"Opens URL in a new tab"}),s.jsx(h.Option,{value:"_self",children:"Opens URL in the same tab"})]})),s.jsx(zt,{title:r.signInTargetInfoMessage})]})]})]}),ue=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsx(pn,{sx:{label:{mb:1.5}},defaultValue:$,label:r.addCampaignInfo,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{ie===!1&&(Y(""),D("")),M(ie)}}),Ce=()=>!$||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Ot,{label:r.id,placeholder:"",defaultValue:V,required:!1,size:"md",endDecorator:s.jsx(zt,{title:r.campaignIdInfoMessage}),onChange:ie=>Y(ie.target.value)}),s.jsx(Ot,{label:r.name,placeholder:"",defaultValue:X,required:!1,size:"md",endDecorator:s.jsx(zt,{title:r.campaignNameInfoMessage}),onChange:ie=>D(ie.target.value)})]}),fe=(ie,Ae)=>{U(Ae),oe(Ae!=="STANDARD"?null:"left")},Se=()=>s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(pn,{defaultValue:f,label:r.configureAdditionalCta,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{ie===!1&&(S(""),E("")),d(ie)}}),s.jsx(h.Tooltip,{title:r.configureAdditionalCtaTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),pe=()=>f?s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Ot,{label:r.additionalCtaLabel,placeholder:"",defaultValue:"",value:I,required:!1,size:"md",endDecorator:s.jsx(zt,{title:r.additionalCtaLabelInfoMessage}),onChange:ie=>S(ie.target.value)}),s.jsx(Ot,{label:r.additionalCtaHandler,placeholder:"",defaultValue:A,value:"",required:!1,size:"md",endDecorator:s.jsx(zt,{title:r.additionalCtaHandlerInfoMessage}),onChange:ie=>E(ie.target.value)}),s.jsx(Ot,{label:r.additionalCtaUrl,placeholder:"",defaultValue:k,value:"",required:!1,size:"md",endDecorator:s.jsx(zt,{title:r.additionalCtaUrlInfoMessage}),onChange:ie=>F(ie.target.value)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.additionalCtaTarget}),s.jsxs(h.Box,{display:"flex",alignItems:"center",gap:1,children:[s.jsxs(h.Select,Q(B({action:o,value:W,size:"md",name:"additional_cta_target",onChange:(ie,Ae)=>O(Ae),sx:{flex:1}},W&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:ie=>{ie.stopPropagation()},onClick:()=>{var ie;O(null),(ie=o.current)==null||ie.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(As,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"_blank",children:"Opens the provided URL in a new tab"}),s.jsx(h.Option,{value:"_self",children:"Opens the provided URL in the same tab"})]})),s.jsx(zt,{title:r.additionalCtaTargetInfoMessage})]})]})]}):s.jsx(s.Fragment,{});return s.jsxs(h.Box,{mt:1,children:[bt(),P(),z(),q(),ee(),ae(),ue(),Ce(),Se(),pe(),s.jsxs(h.Box,{position:"relative",mb:1.5,children:[s.jsx(h.Textarea,{value:gr,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:ie=>ie.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),s.jsx(h.Tooltip,{title:r.copyToClipboard,children:s.jsx(h.Button,{onClick:()=>{navigator.clipboard.writeText(gr)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})})]}),s.jsx(h.Alert,{variant:"outlined",color:"primary",startDecorator:s.jsx(Xt,{}),sx:{mb:1.5,width:"fit-content"},children:s.jsxs(h.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[r.divElementTextInfo,s.jsx(h.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},BN=["load-more","limited"],$N={"load-more":"Load more",limited:"Limited"},FN=({entityId:e,labels:t})=>{const[n,r]=y.useState(!1),[i,o]=y.useState(""),[a,l]=y.useState(""),[c,u]=y.useState(""),[f,d]=y.useState(10),[p,g]=y.useState(2),[v,m]=y.useState("load-more"),b=`
2499
+ ></div>`,Wt={fullName:"Full name",firstName:"First name",lastName:"Last name",email:"Email",gender:"Gender",country:"Country",phoneCountryCode:"Phone country code",phoneNumber:"Phone number"},Gt=({title:ie})=>s.jsx(h.Tooltip,{title:ie,sx:{maxWidth:300},children:s.jsx(Xt,{color:"primary"})}),bt=()=>e!=="either-or"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{mb:1.5,children:[s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.layoutTemplate}),s.jsxs(h.Select,{value:L,size:"md",name:"layout_template",onChange:fe,children:[s.jsx(h.Option,{value:"STANDARD",children:"Standard"}),s.jsx(h.Option,{value:"SPLIT",children:"Split"}),s.jsx(h.Option,{value:"OVERLAY",children:"Overlay"})]}),s.jsx(h.FormHelperText,{children:r.layoutTemplateDescription})]}),s.jsxs(h.FormControl,{sx:{mb:1.5},children:[s.jsx(h.FormLabel,{color:"primary",children:r.imagePosition}),s.jsxs(h.Select,{value:G,size:"md",name:"image_position",disabled:L!=="STANDARD",onChange:(ie,Ae)=>oe(Ae),children:[s.jsx(h.Option,{value:"left",children:"Left"}),s.jsx(h.Option,{value:"right",children:"Right"})]}),s.jsx(h.FormHelperText,{children:r.imagePositionDescription})]})]}),P=()=>e==="classic-quiz"||e==="personality-quiz"?s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:ce,label:r.showAnswerExplanations,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{se(ie)}}),s.jsx(h.Tooltip,{title:r.showAnswerExplanationsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}):e==="match-quiz"||e==="event-game"?s.jsxs(s.Fragment,{children:[s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:Z,label:r.showPredictionDetails||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{te(ie)}}),s.jsx(h.Tooltip,{title:r.showPredictionDetailsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:ne,label:r.showCountdown||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{de(ie)}}),s.jsx(h.Tooltip,{title:r.showCountdownTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:st,label:r.showPoints||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{Je(ie)}}),s.jsx(h.Tooltip,{title:r.showPointsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),e==="match-quiz"&&s.jsxs(h.Box,{display:"flex",alignItems:"center",mb:1.5,children:[s.jsx(pn,{defaultValue:ve,label:r.showTeamLabels||"",labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{Fe(ie)}}),s.jsx(h.Tooltip,{title:r.showTeamLabelsTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]})]}):s.jsx(s.Fragment,{}),z=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(pn,{defaultValue:a,label:r.configureLeads,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="LEAD",onChange:ie=>{ie===!1&&(N([]),j("before")),l(ie)}}),n!=="LEAD"&&s.jsx(h.Tooltip,{title:r.configureLeadsDisabledMessage,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),q=()=>!a||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Or,{label:"",values:T,allValues:Object.keys(Wt),valuesMap:Wt,onChange:ie=>N(ie)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.leadPosition}),s.jsxs(h.Select,{value:H,size:"md",name:"lead_position",onChange:(ie,Ae)=>j(Ae==="before"?"before":"after"),children:[s.jsx(h.Option,{value:"before",children:"Before"}),s.jsx(h.Option,{value:"after",children:"After"})]})]}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.Checkbox,{label:r.syncWithProfile,checked:vt,onChange:ie=>he(ie.target.checked)}),s.jsx(h.FormHelperText,{children:r.syncWithProfileDescription})]})]}),ee=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(pn,{defaultValue:c,label:r.configureSignIn,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="REGISTERED",onChange:ie=>{ie===!1&&(g(""),m("")),u(ie)}}),n!=="REGISTERED"&&s.jsx(h.Tooltip,{title:r.configureSignInDisabledMessage,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),ae=()=>!c||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Ot,{label:r.signInLabel,placeholder:"",defaultValue:"",value:p,required:!1,size:"md",endDecorator:s.jsx(Gt,{title:r.signInLabelInfoMessage}),onChange:ie=>g(ie.target.value)}),s.jsx(Ot,{label:r.authenticationHandler,placeholder:"",defaultValue:v,value:"",required:!1,size:"md",endDecorator:s.jsx(Gt,{title:r.authenticationHandlerInfoMessage}),onChange:ie=>m(ie.target.value)}),s.jsx(Ot,{label:r.signInUrl,placeholder:"",defaultValue:b,value:"",required:!1,size:"md",endDecorator:s.jsx(Gt,{title:r.signInUrlInfoMessage}),onChange:ie=>C(ie.target.value)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.signInTarget}),s.jsxs(h.Select,Q(B({action:i,value:w,size:"md",name:"signin_cta_target",onChange:(ie,Ae)=>x(Ae),sx:{flex:1}},w&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:ie=>{ie.stopPropagation()},onClick:()=>{var ie;x(null),(ie=i.current)==null||ie.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(As,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"_blank",children:"Opens URL in a new tab"}),s.jsx(h.Option,{value:"_self",children:"Opens URL in the same tab"})]}))]})]}),ue=()=>e==="event-game"?s.jsx(s.Fragment,{}):s.jsx(pn,{sx:{label:{mb:1.5}},defaultValue:$,label:r.addCampaignInfo,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{ie===!1&&(Y(""),D("")),M(ie)}}),Ce=()=>!$||e==="event-game"?s.jsx(s.Fragment,{}):s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Ot,{label:r.id,placeholder:"",defaultValue:V,required:!1,size:"md",endDecorator:s.jsx(Gt,{title:r.campaignIdInfoMessage}),onChange:ie=>Y(ie.target.value)}),s.jsx(Ot,{label:r.name,placeholder:"",defaultValue:X,required:!1,size:"md",endDecorator:s.jsx(Gt,{title:r.campaignNameInfoMessage}),onChange:ie=>D(ie.target.value)})]}),fe=(ie,Ae)=>{U(Ae),oe(Ae!=="STANDARD"?null:"left")},Se=()=>s.jsxs(h.Box,{display:"flex",mb:1.5,alignItems:"center",children:[s.jsx(pn,{defaultValue:f,label:r.configureAdditionalCta,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:ie=>{ie===!1&&(S(""),E("")),d(ie)}}),s.jsx(h.Tooltip,{title:r.configureAdditionalCtaTooltip,sx:{ml:1,maxWidth:300},children:s.jsx(Xt,{color:"primary",fontSize:"small"})})]}),pe=()=>f?s.jsxs(h.Card,{sx:{mb:1.5},children:[s.jsx(Ot,{label:r.additionalCtaLabel,placeholder:"",defaultValue:"",value:I,required:!1,size:"md",endDecorator:s.jsx(Gt,{title:r.additionalCtaLabelInfoMessage}),onChange:ie=>S(ie.target.value)}),s.jsx(Ot,{label:r.additionalCtaHandler,placeholder:"",defaultValue:A,value:"",required:!1,size:"md",endDecorator:s.jsx(Gt,{title:r.additionalCtaHandlerInfoMessage}),onChange:ie=>E(ie.target.value)}),s.jsx(Ot,{label:r.additionalCtaUrl,placeholder:"",defaultValue:k,value:"",required:!1,size:"md",endDecorator:s.jsx(Gt,{title:r.additionalCtaUrlInfoMessage}),onChange:ie=>F(ie.target.value)}),s.jsxs(h.FormControl,{sx:{mb:2},children:[s.jsx(h.FormLabel,{color:"primary",children:r.additionalCtaTarget}),s.jsxs(h.Box,{display:"flex",alignItems:"center",gap:1,children:[s.jsxs(h.Select,Q(B({action:o,value:W,size:"md",name:"additional_cta_target",onChange:(ie,Ae)=>O(Ae),sx:{flex:1}},W&&{endDecorator:s.jsx(h.IconButton,{variant:"plain",color:"neutral",onMouseDown:ie=>{ie.stopPropagation()},onClick:()=>{var ie;O(null),(ie=o.current)==null||ie.focusVisible()},sx:{width:"18px",height:"18px"},children:s.jsx(As,{})}),indicator:null}),{children:[s.jsx(h.Option,{value:"_blank",children:"Opens the provided URL in a new tab"}),s.jsx(h.Option,{value:"_self",children:"Opens the provided URL in the same tab"})]})),s.jsx(Gt,{title:r.additionalCtaTargetInfoMessage})]})]})]}):s.jsx(s.Fragment,{});return s.jsxs(h.Box,{mt:1,children:[bt(),P(),z(),q(),ee(),ae(),ue(),Ce(),Se(),pe(),s.jsxs(h.Box,{position:"relative",mb:1.5,children:[s.jsx(h.Textarea,{value:gr,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:ie=>ie.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),s.jsx(h.Tooltip,{title:r.copyToClipboard,children:s.jsx(h.Button,{onClick:()=>{navigator.clipboard.writeText(gr)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:s.jsx(_e.ContentCopy,{})})})]}),s.jsx(h.Alert,{variant:"outlined",color:"primary",startDecorator:s.jsx(Xt,{}),sx:{mb:1.5,width:"fit-content"},children:s.jsxs(h.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[r.divElementTextInfo,s.jsx(h.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},BN=["load-more","limited"],$N={"load-more":"Load more",limited:"Limited"},FN=({entityId:e,labels:t})=>{const[n,r]=y.useState(!1),[i,o]=y.useState(""),[a,l]=y.useState(""),[c,u]=y.useState(""),[f,d]=y.useState(10),[p,g]=y.useState(2),[v,m]=y.useState("load-more"),b=`
2500
2500
  data-content-id="${e}"`,C=i?`
2501
2501
  data-classic-quiz-url="${i}"`:"",w=a?`
2502
2502
  data-either-or-url="${a}"`:"",x=c?`