ode-explorer 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ Error generating stack: `+ot.message+`
|
|
|
47
47
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(et){return et instanceof this?et:new this(et)}static concat(et,...rt){const st=new this(et);return rt.forEach(nt=>st.set(nt)),st}static accessor(et){const st=(this[$internals]=this[$internals]={accessors:{}}).accessors,nt=this.prototype;function ot(at){const lt=normalizeHeader(at);st[lt]||(buildAccessors(nt,at),st[lt]=!0)}return utils$4.isArray(et)?et.forEach(ot):ot(et),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$4.reduceDescriptors(AxiosHeaders$1.prototype,({value:tt},et)=>{let rt=et[0].toUpperCase()+et.slice(1);return{get:()=>tt,set(st){this[rt]=st}}});utils$4.freezeMethods(AxiosHeaders$1);function transformData(tt,et){const rt=this||defaults$4,st=et||rt,nt=AxiosHeaders$1.from(st.headers);let ot=st.data;return utils$4.forEach(tt,function(lt){ot=lt.call(rt,ot,nt.normalize(),et?et.status:void 0)}),nt.normalize(),ot}function isCancel$1(tt){return!!(tt&&tt.__CANCEL__)}function CanceledError$1(tt,et,rt){AxiosError$1.call(this,tt??"canceled",AxiosError$1.ERR_CANCELED,et,rt),this.name="CanceledError"}utils$4.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(tt,et,rt){const st=rt.config.validateStatus;!rt.status||!st||st(rt.status)?tt(rt):et(new AxiosError$1("Request failed with status code "+rt.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(rt.status/100)-4],rt.config,rt.request,rt))}function parseProtocol(tt){const et=/^([-+\w]{1,25})(:?\/\/|:)/.exec(tt);return et&&et[1]||""}function speedometer(tt,et){tt=tt||10;const rt=new Array(tt),st=new Array(tt);let nt=0,ot=0,at;return et=et!==void 0?et:1e3,function(ut){const ct=Date.now(),dt=st[ot];at||(at=ct),rt[nt]=ut,st[nt]=ct;let ht=ot,ft=0;for(;ht!==nt;)ft+=rt[ht++],ht=ht%tt;if(nt=(nt+1)%tt,nt===ot&&(ot=(ot+1)%tt),ct-at<et)return;const xt=dt&&ct-dt;return xt?Math.round(ft*1e3/xt):void 0}}function throttle(tt,et){let rt=0,st=1e3/et,nt,ot;const at=(ct,dt=Date.now())=>{rt=dt,nt=null,ot&&(clearTimeout(ot),ot=null),tt(...ct)};return[(...ct)=>{const dt=Date.now(),ht=dt-rt;ht>=st?at(ct,dt):(nt=ct,ot||(ot=setTimeout(()=>{ot=null,at(nt)},st-ht)))},()=>nt&&at(nt)]}const progressEventReducer=(tt,et,rt=3)=>{let st=0;const nt=speedometer(50,250);return throttle(ot=>{const at=ot.loaded,lt=ot.lengthComputable?ot.total:void 0,ut=at-st,ct=nt(ut),dt=at<=lt;st=at;const ht={loaded:at,total:lt,progress:lt?at/lt:void 0,bytes:ut,rate:ct||void 0,estimated:ct&<&&dt?(lt-at)/ct:void 0,event:ot,lengthComputable:lt!=null,[et?"download":"upload"]:!0};tt(ht)},rt)},progressEventDecorator=(tt,et)=>{const rt=tt!=null;return[st=>et[0]({lengthComputable:rt,total:tt,loaded:st}),et[1]]},asyncDecorator=tt=>(...et)=>utils$4.asap(()=>tt(...et)),isURLSameOrigin=platform.hasStandardBrowserEnv?((tt,et)=>rt=>(rt=new URL(rt,platform.origin),tt.protocol===rt.protocol&&tt.host===rt.host&&(et||tt.port===rt.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(tt,et,rt,st,nt,ot){const at=[tt+"="+encodeURIComponent(et)];utils$4.isNumber(rt)&&at.push("expires="+new Date(rt).toGMTString()),utils$4.isString(st)&&at.push("path="+st),utils$4.isString(nt)&&at.push("domain="+nt),ot===!0&&at.push("secure"),document.cookie=at.join("; ")},read(tt){const et=document.cookie.match(new RegExp("(^|;\\s*)("+tt+")=([^;]*)"));return et?decodeURIComponent(et[3]):null},remove(tt){this.write(tt,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(tt){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(tt)}function combineURLs(tt,et){return et?tt.replace(/\/?\/$/,"")+"/"+et.replace(/^\/+/,""):tt}function buildFullPath(tt,et,rt){let st=!isAbsoluteURL(et);return tt&&(st||rt==!1)?combineURLs(tt,et):et}const headersToObject=tt=>tt instanceof AxiosHeaders$1?{...tt}:tt;function mergeConfig$1(tt,et){et=et||{};const rt={};function st(ct,dt,ht,ft){return utils$4.isPlainObject(ct)&&utils$4.isPlainObject(dt)?utils$4.merge.call({caseless:ft},ct,dt):utils$4.isPlainObject(dt)?utils$4.merge({},dt):utils$4.isArray(dt)?dt.slice():dt}function nt(ct,dt,ht,ft){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return st(void 0,ct,ht,ft)}else return st(ct,dt,ht,ft)}function ot(ct,dt){if(!utils$4.isUndefined(dt))return st(void 0,dt)}function at(ct,dt){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return st(void 0,ct)}else return st(void 0,dt)}function lt(ct,dt,ht){if(ht in et)return st(ct,dt);if(ht in tt)return st(void 0,ct)}const ut={url:ot,method:ot,data:ot,baseURL:at,transformRequest:at,transformResponse:at,paramsSerializer:at,timeout:at,timeoutMessage:at,withCredentials:at,withXSRFToken:at,adapter:at,responseType:at,xsrfCookieName:at,xsrfHeaderName:at,onUploadProgress:at,onDownloadProgress:at,decompress:at,maxContentLength:at,maxBodyLength:at,beforeRedirect:at,transport:at,httpAgent:at,httpsAgent:at,cancelToken:at,socketPath:at,responseEncoding:at,validateStatus:lt,headers:(ct,dt,ht)=>nt(headersToObject(ct),headersToObject(dt),ht,!0)};return utils$4.forEach(Object.keys({...tt,...et}),function(dt){const ht=ut[dt]||nt,ft=ht(tt[dt],et[dt],dt);utils$4.isUndefined(ft)&&ht!==lt||(rt[dt]=ft)}),rt}const resolveConfig=tt=>{const et=mergeConfig$1({},tt);let{data:rt,withXSRFToken:st,xsrfHeaderName:nt,xsrfCookieName:ot,headers:at,auth:lt}=et;if(et.headers=at=AxiosHeaders$1.from(at),et.url=buildURL(buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls),tt.params,tt.paramsSerializer),lt&&at.set("Authorization","Basic "+btoa((lt.username||"")+":"+(lt.password?unescape(encodeURIComponent(lt.password)):""))),utils$4.isFormData(rt)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)at.setContentType(void 0);else if(utils$4.isFunction(rt.getHeaders)){const ut=rt.getHeaders(),ct=["content-type","content-length"];Object.entries(ut).forEach(([dt,ht])=>{ct.includes(dt.toLowerCase())&&at.set(dt,ht)})}}if(platform.hasStandardBrowserEnv&&(st&&utils$4.isFunction(st)&&(st=st(et)),st||st!==!1&&isURLSameOrigin(et.url))){const ut=nt&&ot&&cookies.read(ot);ut&&at.set(nt,ut)}return et},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(tt){return new Promise(function(rt,st){const nt=resolveConfig(tt);let ot=nt.data;const at=AxiosHeaders$1.from(nt.headers).normalize();let{responseType:lt,onUploadProgress:ut,onDownloadProgress:ct}=nt,dt,ht,ft,xt,vt;function yt(){xt&&xt(),vt&&vt(),nt.cancelToken&&nt.cancelToken.unsubscribe(dt),nt.signal&&nt.signal.removeEventListener("abort",dt)}let Et=new XMLHttpRequest;Et.open(nt.method.toUpperCase(),nt.url,!0),Et.timeout=nt.timeout;function bt(){if(!Et)return;const St=AxiosHeaders$1.from("getAllResponseHeaders"in Et&&Et.getAllResponseHeaders()),Ct={data:!lt||lt==="text"||lt==="json"?Et.responseText:Et.response,status:Et.status,statusText:Et.statusText,headers:St,config:tt,request:Et};settle(function(jt){rt(jt),yt()},function(jt){st(jt),yt()},Ct),Et=null}"onloadend"in Et?Et.onloadend=bt:Et.onreadystatechange=function(){!Et||Et.readyState!==4||Et.status===0&&!(Et.responseURL&&Et.responseURL.indexOf("file:")===0)||setTimeout(bt)},Et.onabort=function(){Et&&(st(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,tt,Et)),Et=null)},Et.onerror=function(Rt){const Ct=Rt&&Rt.message?Rt.message:"Network Error",It=new AxiosError$1(Ct,AxiosError$1.ERR_NETWORK,tt,Et);It.event=Rt||null,st(It),Et=null},Et.ontimeout=function(){let Rt=nt.timeout?"timeout of "+nt.timeout+"ms exceeded":"timeout exceeded";const Ct=nt.transitional||transitionalDefaults;nt.timeoutErrorMessage&&(Rt=nt.timeoutErrorMessage),st(new AxiosError$1(Rt,Ct.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,tt,Et)),Et=null},ot===void 0&&at.setContentType(null),"setRequestHeader"in Et&&utils$4.forEach(at.toJSON(),function(Rt,Ct){Et.setRequestHeader(Ct,Rt)}),utils$4.isUndefined(nt.withCredentials)||(Et.withCredentials=!!nt.withCredentials),lt&<!=="json"&&(Et.responseType=nt.responseType),ct&&([ft,vt]=progressEventReducer(ct,!0),Et.addEventListener("progress",ft)),ut&&Et.upload&&([ht,xt]=progressEventReducer(ut),Et.upload.addEventListener("progress",ht),Et.upload.addEventListener("loadend",xt)),(nt.cancelToken||nt.signal)&&(dt=St=>{Et&&(st(!St||St.type?new CanceledError$1(null,tt,Et):St),Et.abort(),Et=null)},nt.cancelToken&&nt.cancelToken.subscribe(dt),nt.signal&&(nt.signal.aborted?dt():nt.signal.addEventListener("abort",dt)));const wt=parseProtocol(nt.url);if(wt&&platform.protocols.indexOf(wt)===-1){st(new AxiosError$1("Unsupported protocol "+wt+":",AxiosError$1.ERR_BAD_REQUEST,tt));return}Et.send(ot||null)})},composeSignals=(tt,et)=>{const{length:rt}=tt=tt?tt.filter(Boolean):[];if(et||rt){let st=new AbortController,nt;const ot=function(ct){if(!nt){nt=!0,lt();const dt=ct instanceof Error?ct:this.reason;st.abort(dt instanceof AxiosError$1?dt:new CanceledError$1(dt instanceof Error?dt.message:dt))}};let at=et&&setTimeout(()=>{at=null,ot(new AxiosError$1(`timeout ${et} of ms exceeded`,AxiosError$1.ETIMEDOUT))},et);const lt=()=>{tt&&(at&&clearTimeout(at),at=null,tt.forEach(ct=>{ct.unsubscribe?ct.unsubscribe(ot):ct.removeEventListener("abort",ot)}),tt=null)};tt.forEach(ct=>ct.addEventListener("abort",ot));const{signal:ut}=st;return ut.unsubscribe=()=>utils$4.asap(lt),ut}},streamChunk=function*(tt,et){let rt=tt.byteLength;if(rt<et){yield tt;return}let st=0,nt;for(;st<rt;)nt=st+et,yield tt.slice(st,nt),st=nt},readBytes=async function*(tt,et){for await(const rt of readStream(tt))yield*streamChunk(rt,et)},readStream=async function*(tt){if(tt[Symbol.asyncIterator]){yield*tt;return}const et=tt.getReader();try{for(;;){const{done:rt,value:st}=await et.read();if(rt)break;yield st}}finally{await et.cancel()}},trackStream=(tt,et,rt,st)=>{const nt=readBytes(tt,et);let ot=0,at,lt=ut=>{at||(at=!0,st&&st(ut))};return new ReadableStream({async pull(ut){try{const{done:ct,value:dt}=await nt.next();if(ct){lt(),ut.close();return}let ht=dt.byteLength;if(rt){let ft=ot+=ht;rt(ft)}ut.enqueue(new Uint8Array(dt))}catch(ct){throw lt(ct),ct}},cancel(ut){return lt(ut),nt.return()}},{highWaterMark:2})},DEFAULT_CHUNK_SIZE=64*1024,{isFunction:isFunction$1}=utils$4,globalFetchAPI=(({Request:tt,Response:et})=>({Request:tt,Response:et}))(utils$4.global),{ReadableStream:ReadableStream$1,TextEncoder}=utils$4.global,test=(tt,...et)=>{try{return!!tt(...et)}catch{return!1}},factory=tt=>{tt=utils$4.merge.call({skipUndefined:!0},globalFetchAPI,tt);const{fetch:et,Request:rt,Response:st}=tt,nt=et?isFunction$1(et):typeof fetch=="function",ot=isFunction$1(rt),at=isFunction$1(st);if(!nt)return!1;const lt=nt&&isFunction$1(ReadableStream$1),ut=nt&&(typeof TextEncoder=="function"?(vt=>yt=>vt.encode(yt))(new TextEncoder):async vt=>new Uint8Array(await new rt(vt).arrayBuffer())),ct=ot&<&&test(()=>{let vt=!1;const yt=new rt(platform.origin,{body:new ReadableStream$1,method:"POST",get duplex(){return vt=!0,"half"}}).headers.has("Content-Type");return vt&&!yt}),dt=at&<&&test(()=>utils$4.isReadableStream(new st("").body)),ht={stream:dt&&(vt=>vt.body)};nt&&["text","arrayBuffer","blob","formData","stream"].forEach(vt=>{!ht[vt]&&(ht[vt]=(yt,Et)=>{let bt=yt&&yt[vt];if(bt)return bt.call(yt);throw new AxiosError$1(`Response type '${vt}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,Et)})});const ft=async vt=>{if(vt==null)return 0;if(utils$4.isBlob(vt))return vt.size;if(utils$4.isSpecCompliantForm(vt))return(await new rt(platform.origin,{method:"POST",body:vt}).arrayBuffer()).byteLength;if(utils$4.isArrayBufferView(vt)||utils$4.isArrayBuffer(vt))return vt.byteLength;if(utils$4.isURLSearchParams(vt)&&(vt=vt+""),utils$4.isString(vt))return(await ut(vt)).byteLength},xt=async(vt,yt)=>{const Et=utils$4.toFiniteNumber(vt.getContentLength());return Et??ft(yt)};return async vt=>{let{url:yt,method:Et,data:bt,signal:wt,cancelToken:St,timeout:Rt,onDownloadProgress:Ct,onUploadProgress:It,responseType:jt,headers:Pt,withCredentials:Ot="same-origin",fetchOptions:Ut}=resolveConfig(vt),Nt=et||fetch;jt=jt?(jt+"").toLowerCase():"text";let Ht=composeSignals([wt,St&&St.toAbortSignal()],Rt),Lt=null;const kt=Ht&&Ht.unsubscribe&&(()=>{Ht.unsubscribe()});let $t;try{if(It&&ct&&Et!=="get"&&Et!=="head"&&($t=await xt(Pt,bt))!==0){let qt=new rt(yt,{method:"POST",body:bt,duplex:"half"}),Qt;if(utils$4.isFormData(bt)&&(Qt=qt.headers.get("content-type"))&&Pt.setContentType(Qt),qt.body){const[Yt,tr]=progressEventDecorator($t,progressEventReducer(asyncDecorator(It)));bt=trackStream(qt.body,DEFAULT_CHUNK_SIZE,Yt,tr)}}utils$4.isString(Ot)||(Ot=Ot?"include":"omit");const Ft=ot&&"credentials"in rt.prototype,Gt={...Ut,signal:Ht,method:Et.toUpperCase(),headers:Pt.normalize().toJSON(),body:bt,duplex:"half",credentials:Ft?Ot:void 0};Lt=ot&&new rt(yt,Gt);let Mt=await(ot?Nt(Lt,Ut):Nt(yt,Gt));const Vt=dt&&(jt==="stream"||jt==="response");if(dt&&(Ct||Vt&&kt)){const qt={};["status","statusText","headers"].forEach(lr=>{qt[lr]=Mt[lr]});const Qt=utils$4.toFiniteNumber(Mt.headers.get("content-length")),[Yt,tr]=Ct&&progressEventDecorator(Qt,progressEventReducer(asyncDecorator(Ct),!0))||[];Mt=new st(trackStream(Mt.body,DEFAULT_CHUNK_SIZE,Yt,()=>{tr&&tr(),kt&&kt()}),qt)}jt=jt||"text";let Bt=await ht[utils$4.findKey(ht,jt)||"text"](Mt,vt);return!Vt&&kt&&kt(),await new Promise((qt,Qt)=>{settle(qt,Qt,{data:Bt,headers:AxiosHeaders$1.from(Mt.headers),status:Mt.status,statusText:Mt.statusText,config:vt,request:Lt})})}catch(Ft){throw kt&&kt(),Ft&&Ft.name==="TypeError"&&/Load failed|fetch/i.test(Ft.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,vt,Lt),{cause:Ft.cause||Ft}):AxiosError$1.from(Ft,Ft&&Ft.code,vt,Lt)}}},seedCache=new Map,getFetch=tt=>{let et=tt?tt.env:{};const{fetch:rt,Request:st,Response:nt}=et,ot=[st,nt,rt];let at=ot.length,lt=at,ut,ct,dt=seedCache;for(;lt--;)ut=ot[lt],ct=dt.get(ut),ct===void 0&&dt.set(ut,ct=lt?new Map:factory(et)),dt=ct;return ct};getFetch();const knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:{get:getFetch}};utils$4.forEach(knownAdapters,(tt,et)=>{if(tt){try{Object.defineProperty(tt,"name",{value:et})}catch{}Object.defineProperty(tt,"adapterName",{value:et})}});const renderReason=tt=>`- ${tt}`,isResolvedHandle=tt=>utils$4.isFunction(tt)||tt===null||tt===!1,adapters={getAdapter:(tt,et)=>{tt=utils$4.isArray(tt)?tt:[tt];const{length:rt}=tt;let st,nt;const ot={};for(let at=0;at<rt;at++){st=tt[at];let lt;if(nt=st,!isResolvedHandle(st)&&(nt=knownAdapters[(lt=String(st)).toLowerCase()],nt===void 0))throw new AxiosError$1(`Unknown adapter '${lt}'`);if(nt&&(utils$4.isFunction(nt)||(nt=nt.get(et))))break;ot[lt||"#"+at]=nt}if(!nt){const at=Object.entries(ot).map(([ut,ct])=>`adapter ${ut} `+(ct===!1?"is not supported by the environment":"is not available in the build"));let lt=rt?at.length>1?`since :
|
|
48
48
|
`+at.map(renderReason).join(`
|
|
49
49
|
`):" "+renderReason(at[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+lt,"ERR_NOT_SUPPORT")}return nt},adapters:knownAdapters};function throwIfCancellationRequested(tt){if(tt.cancelToken&&tt.cancelToken.throwIfRequested(),tt.signal&&tt.signal.aborted)throw new CanceledError$1(null,tt)}function dispatchRequest(tt){return throwIfCancellationRequested(tt),tt.headers=AxiosHeaders$1.from(tt.headers),tt.data=transformData.call(tt,tt.transformRequest),["post","put","patch"].indexOf(tt.method)!==-1&&tt.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(tt.adapter||defaults$4.adapter,tt)(tt).then(function(st){return throwIfCancellationRequested(tt),st.data=transformData.call(tt,tt.transformResponse,st),st.headers=AxiosHeaders$1.from(st.headers),st},function(st){return isCancel$1(st)||(throwIfCancellationRequested(tt),st&&st.response&&(st.response.data=transformData.call(tt,tt.transformResponse,st.response),st.response.headers=AxiosHeaders$1.from(st.response.headers))),Promise.reject(st)})}const VERSION$1="1.12.2",validators$1={};["object","boolean","number","function","string","symbol"].forEach((tt,et)=>{validators$1[tt]=function(st){return typeof st===tt||"a"+(et<1?"n ":" ")+tt}});const deprecatedWarnings={};validators$1.transitional=function(et,rt,st){function nt(ot,at){return"[Axios v"+VERSION$1+"] Transitional option '"+ot+"'"+at+(st?". "+st:"")}return(ot,at,lt)=>{if(et===!1)throw new AxiosError$1(nt(at," has been removed"+(rt?" in "+rt:"")),AxiosError$1.ERR_DEPRECATED);return rt&&!deprecatedWarnings[at]&&(deprecatedWarnings[at]=!0,console.warn(nt(at," has been deprecated since v"+rt+" and will be removed in the near future"))),et?et(ot,at,lt):!0}};validators$1.spelling=function(et){return(rt,st)=>(console.warn(`${st} is likely a misspelling of ${et}`),!0)};function assertOptions(tt,et,rt){if(typeof tt!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const st=Object.keys(tt);let nt=st.length;for(;nt-- >0;){const ot=st[nt],at=et[ot];if(at){const lt=tt[ot],ut=lt===void 0||at(lt,ot,tt);if(ut!==!0)throw new AxiosError$1("option "+ot+" must be "+ut,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(rt!==!0)throw new AxiosError$1("Unknown option "+ot,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(et){this.defaults=et||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(et,rt){try{return await this._request(et,rt)}catch(st){if(st instanceof Error){let nt={};Error.captureStackTrace?Error.captureStackTrace(nt):nt=new Error;const ot=nt.stack?nt.stack.replace(/^.+\n/,""):"";try{st.stack?ot&&!String(st.stack).endsWith(ot.replace(/^.+\n.+\n/,""))&&(st.stack+=`
|
|
50
|
-
`+ot):st.stack=ot}catch{}}throw st}}_request(et,rt){typeof et=="string"?(rt=rt||{},rt.url=et):rt=et||{},rt=mergeConfig$1(this.defaults,rt);const{transitional:st,paramsSerializer:nt,headers:ot}=rt;st!==void 0&&validator.assertOptions(st,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),nt!=null&&(utils$4.isFunction(nt)?rt.paramsSerializer={serialize:nt}:validator.assertOptions(nt,{encode:validators.function,serialize:validators.function},!0)),rt.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?rt.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:rt.allowAbsoluteUrls=!0),validator.assertOptions(rt,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),rt.method=(rt.method||this.defaults.method||"get").toLowerCase();let at=ot&&utils$4.merge(ot.common,ot[rt.method]);ot&&utils$4.forEach(["delete","get","head","post","put","patch","common"],vt=>{delete ot[vt]}),rt.headers=AxiosHeaders$1.concat(at,ot);const lt=[];let ut=!0;this.interceptors.request.forEach(function(yt){typeof yt.runWhen=="function"&&yt.runWhen(rt)===!1||(ut=ut&&yt.synchronous,lt.unshift(yt.fulfilled,yt.rejected))});const ct=[];this.interceptors.response.forEach(function(yt){ct.push(yt.fulfilled,yt.rejected)});let dt,ht=0,ft;if(!ut){const vt=[dispatchRequest.bind(this),void 0];for(vt.unshift(...lt),vt.push(...ct),ft=vt.length,dt=Promise.resolve(rt);ht<ft;)dt=dt.then(vt[ht++],vt[ht++]);return dt}ft=lt.length;let xt=rt;for(;ht<ft;){const vt=lt[ht++],yt=lt[ht++];try{xt=vt(xt)}catch(Et){yt.call(this,Et);break}}try{dt=dispatchRequest.call(this,xt)}catch(vt){return Promise.reject(vt)}for(ht=0,ft=ct.length;ht<ft;)dt=dt.then(ct[ht++],ct[ht++]);return dt}getUri(et){et=mergeConfig$1(this.defaults,et);const rt=buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls);return buildURL(rt,et.params,et.paramsSerializer)}};utils$4.forEach(["delete","get","head","options"],function(et){Axios$1.prototype[et]=function(rt,st){return this.request(mergeConfig$1(st||{},{method:et,url:rt,data:(st||{}).data}))}});utils$4.forEach(["post","put","patch"],function(et){function rt(st){return function(ot,at,lt){return this.request(mergeConfig$1(lt||{},{method:et,headers:st?{"Content-Type":"multipart/form-data"}:{},url:ot,data:at}))}}Axios$1.prototype[et]=rt(),Axios$1.prototype[et+"Form"]=rt(!0)});let CancelToken$1=class rm{constructor(et){if(typeof et!="function")throw new TypeError("executor must be a function.");let rt;this.promise=new Promise(function(ot){rt=ot});const st=this;this.promise.then(nt=>{if(!st._listeners)return;let ot=st._listeners.length;for(;ot-- >0;)st._listeners[ot](nt);st._listeners=null}),this.promise.then=nt=>{let ot;const at=new Promise(lt=>{st.subscribe(lt),ot=lt}).then(nt);return at.cancel=function(){st.unsubscribe(ot)},at},et(function(ot,at,lt){st.reason||(st.reason=new CanceledError$1(ot,at,lt),rt(st.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(et){if(this.reason){et(this.reason);return}this._listeners?this._listeners.push(et):this._listeners=[et]}unsubscribe(et){if(!this._listeners)return;const rt=this._listeners.indexOf(et);rt!==-1&&this._listeners.splice(rt,1)}toAbortSignal(){const et=new AbortController,rt=st=>{et.abort(st)};return this.subscribe(rt),et.signal.unsubscribe=()=>this.unsubscribe(rt),et.signal}static source(){let et;return{token:new rm(function(nt){et=nt}),cancel:et}}};function spread$1(tt){return function(rt){return tt.apply(null,rt)}}function isAxiosError$1(tt){return utils$4.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([tt,et])=>{HttpStatusCode$1[et]=tt});function createInstance(tt){const et=new Axios$1(tt),rt=bind$3(Axios$1.prototype.request,et);return utils$4.extend(rt,Axios$1.prototype,et,{allOwnKeys:!0}),utils$4.extend(rt,et,null,{allOwnKeys:!0}),rt.create=function(nt){return createInstance(mergeConfig$1(tt,nt))},rt}const axios=createInstance(defaults$4);axios.Axios=Axios$1;axios.CanceledError=CanceledError$1;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel$1;axios.VERSION=VERSION$1;axios.toFormData=toFormData$1;axios.AxiosError=AxiosError$1;axios.Cancel=axios.CanceledError;axios.all=function(et){return Promise.all(et)};axios.spread=spread$1;axios.isAxiosError=isAxiosError$1;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=tt=>formDataToJSON(utils$4.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function m$3(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$2=(tt,et)=>{if(tt==0)return"0 octets";const rt=1e3,st=et,nt=["octets","Ko","Mo","Go"],ot=Math.floor(Math.log(tt)/Math.log(rt));return parseFloat((tt/Math.pow(rt,ot)).toFixed(st))+" "+nt[ot]};let s$3=class{static isLocalURL(et){return et.length>0&&et.charAt(0)==="/"}static startWithHttp(et){return/^https?:\/\//gi.test(et)}static toCounter(et){return et>999?`${Number(et/1e3).toFixed(1)} k`:""+et}static generateVirtualId(){return"xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16))}};const s$2=(tt,et)=>{const rt="virtualID";if(!Object.hasOwnProperty.apply(tt,[rt])){const st=et??`${s$3.generateVirtualId()}#${tt.size}`;Object.defineProperty(tt,rt,{value:st,writable:!1})}return tt[rt]};let p$3=class{static changeDimension(et,rt,st,nt){return st>nt&&(et=Math.round(et*nt/st),st=nt),et>rt&&(st=Math.round(st*rt/et),et=rt),{height:et,width:st}}static renameFileNameExtension(et,rt){const st=et.split(".");return st.pop(),st.join(".")+"."+rt}static resizeImage(et,rt,st,nt,ot="jpeg",at=80){const lt=at/100,ut=document.createElement("canvas"),ct=`image/${ot}`;let dt=et.width,ht=et.height;const ft=this.changeDimension(ht,nt,dt,st);dt=ft.width,ht=ft.height;const xt=ut.getContext("2d");return xt&&(ut.width=dt,ut.height=ht,xt.fillStyle="white",xt.fillRect(0,0,ut.width,ut.height),xt.imageSmoothingEnabled&&xt.imageSmoothingQuality&&(xt.imageSmoothingQuality="high"),xt.drawImage(et,0,0,dt,ht)),new Promise((vt,yt)=>{ut.toBlob(Et=>{Et?vt(new File([Et],rt,{type:ct,lastModified:new Date().getTime()})):yt()},ct,lt)})}static async resizeImageFile(et,rt=1440,st=1440,nt=80){if(!et)throw Error("Image resizer: file not found!");if(!et.type||!et.type.startsWith("image/"))throw Error("Image resizer: the file given is not an image.");const ot="jpeg";return new Promise(at=>{const lt=new Image;lt.setAttribute("style","max-width: none;"),lt.src=URL.createObjectURL(et),lt.onload=async()=>{const ut=await this.resizeImage(lt,this.renameFileNameExtension(et.name,ot),rt,st,ot,nt);at(ut)},lt.onerror=ut=>{throw Error("Image Loading Error: "+ut)}})}};const e$3={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};var p$2=Object.defineProperty,d$2=(tt,et,rt)=>et in tt?p$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$5=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$3=class{constructor(){n$5(this,"wordExtensions",new Set),n$5(this,"excelExtensions",new Set),n$5(this,"pptExtensions",new Set),n$5(this,"fileExtensionMap",new Map),n$5(this,"csvContentType",new Set),n$5(this,"csvExtensions",new Set),n$5(this,"txtExtensions",new Set),n$5(this,"mdExtensions",new Set),n$5(this,"PDF","application/pdf"),n$5(this,"OCTET_STREAM","application/octet-stream"),this.txtExtensions.add("txt"),this.mdExtensions.add("md"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.fileExtensionMap.set("md","text/markdown"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(et){return this.fileExtensionMap.has(et)?this.fileExtensionMap.get(et)??null:null}getExtensionForContentType(et){for(const rt of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(rt)||"").toLowerCase()==(et||"").toLowerCase())return rt;return null}isWordLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.wordExtensions.has(st):et==this.OCTET_STREAM&&rt?this.wordExtensions.has(rt):!1}isExcelLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.excelExtensions.has(st):et==this.OCTET_STREAM&&rt?this.excelExtensions.has(rt):!1}isCsvLike(et,rt){return this.csvContentType.has(et)?!0:et==this.OCTET_STREAM&&rt?this.csvExtensions.has(rt):!1}isPowerpointLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.pptExtensions.has(st):et==this.OCTET_STREAM&&rt?this.pptExtensions.has(rt):!1}isTxtLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.txtExtensions.has(st):et==this.OCTET_STREAM&&rt?this.txtExtensions.has(rt):!1}isMdLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.mdExtensions.has(st):et==this.OCTET_STREAM&&rt?this.mdExtensions.has(rt):!1}};n$5(o$3,"INSTANCE",new o$3);let a$2=o$3;const n$4=tt=>{if(tt>0){let et=Math.floor(tt/1e3),rt=Math.floor(et/60);return et=et%60,rt=rt%60,e$2(rt)+":"+e$2(et)}return"00:00"},e$2=tt=>tt.toString().padStart(2,"0"),o$2=()=>MediaRecorder.isTypeSupported?["video/webm;codecs=vp9",'video/mp4; codecs="avc1.424028, mp4a.40.2"',"video/webm;codecs=vp8,opus","video/webm"].find(tt=>MediaRecorder.isTypeSupported(tt)?!0:(console.error(`${tt} is not Supported`),!1))||"video/ogg":"video/webm;codecs=vp8,opus";var v$2=Object.defineProperty,T$1=(tt,et,rt)=>et in tt?v$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$3=(tt,et,rt)=>T$1(tt,typeof et!="symbol"?et+"":et,rt);const ERROR_CODE={SUCCESS:"0000",UNKNOWN:"0010",NOT_INITIALIZED:"0020",NOT_SUPPORTED:"0030",APP_NOT_FOUND:"0040",AGENT_NOT_FOUND:"0050",TRANSPORT_ERROR:"0060",TIME_OUT:"0070",MALFORMED_DATA:"0080",NOT_LOGGED_IN:"0090"},APP$4={VIDEO:"video"};class Subscription{constructor(et,rt){n$3(this,"revoke"),this._channel=et,this.revoke=this.setReceiver(st=>rt==null?void 0:rt(st.data))}setReceiver(et){var rt;return(rt=this._channel)==null||rt.addEventListener("message",et),()=>{this._channel&&(this._channel.removeEventListener("message",et),this._channel.close(),delete this._channel)}}}class Subject{constructor(){n$3(this,"publishChannels",new Map)}getChannelName(et){return"Subject:"+et}getPublishChannel(et){const rt=this.getChannelName(et);let st=this.publishChannels.get(rt);return st||(st=this.newChannel(et),this.publishChannels.set(rt,st)),st}newChannel(et){const rt=this.getChannelName(et),st=new BroadcastChannel(rt);return st.addEventListener("messageerror",nt=>console.log(nt.data)),st}publish(et,rt){typeof et=="string"&&this.getPublishChannel(et).postMessage(rt)}subscribe(et,rt){if(typeof et=="string"){const st=this.newChannel(et);return new Subscription(st,rt)}else return new Subscription}}const ASYNC_DATA_NAME={SESSION_READY:"sessionReady",LANG_READY:"langReady",SKIN_READY:"skinReady",OVERRIDE_READY:"overrideReady",APPCONF_READY:"appConfReady"};class Promisified{constructor(){n$3(this,"_resolution"),n$3(this,"_rejection"),n$3(this,"_promise",new Promise((et,rt)=>{this._resolution=et,this._rejection=rt}))}get promise(){return this._promise}resolve(et){this._resolution&&this._resolution(et)}reject(et){this._rejection&&this._rejection(et)}}class NotifyFramework{constructor(){n$3(this,"promises",{}),n$3(this,"subject",new Subject)}asyncData(et){return typeof this.promises[et]>"u"&&(this.promises[et]=new Promisified),this.promises[et]}onSessionReady(){return this.asyncData(ASYNC_DATA_NAME.SESSION_READY)}onLangReady(){return this.asyncData(ASYNC_DATA_NAME.LANG_READY)}onSkinReady(){return this.asyncData(ASYNC_DATA_NAME.SKIN_READY)}onOverridesReady(){return this.asyncData(ASYNC_DATA_NAME.OVERRIDE_READY)}onAppConfReady(){return this.asyncData(ASYNC_DATA_NAME.APPCONF_READY)}promisify(){return new Promisified}events(){return this.subject}}const notify=new NotifyFramework,loadedScripts$1={};class Http{constructor(et){n$3(this,"axios"),n$3(this,"_latestResponse"),this.axios=axios.create(et)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);return et.headers&&(rt.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams)),rt}else return this.axios.defaults}toCdnUrl(et){const rt=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((rt==null?void 0:rt.length)>0&&et!=="/conf/public"){const st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}return et}mapAxiosError(et,rt){return et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!rt||rt.disableNotifications,this._latestResponse}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}get(et,rt){return this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}post(et,rt,st){return this.axios.post(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}postFile(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"],this.axios.post(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}postJson(et,rt,st){const nt=this.toAxiosConfig();return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.post(et,rt,this.toAxiosConfig(st)).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}put(et,rt,st){return this.axios.put(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}putJson(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.put(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}delete(et,rt){return this.axios.delete(et,this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}deleteJson(et,rt){return this.axios.delete(et,{data:rt}).then(st=>this.mapAxiosResponse(st)).catch(st=>this.mapAxiosError(st))}getScript(et,rt,st){const nt=st??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${nt.split(".")[0]}={};${at};return ${nt};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts$1[et]?Promise.resolve():this.getScript(et,rt).then(st=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){n$3(this,"_http",new Http)}get http(){return this._http}newHttpInstance(et){return new Http(et)}}const transport=new TransportFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}const http$2=transport.http;class Session{constructor(){n$3(this,"_me",null),n$3(this,"_currentLanguage",""),n$3(this,"_notLoggedIn",!0),n$3(this,"_description"),n$3(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let et=this.description.photo;return(!et||et==="no-avatar.jpg"||et==="no-avatar.svg")&&(et=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),et}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(et=>{if(http$2.isResponseError()||typeof et=="string")throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(et),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(et=>(this.setCurrentLanguage(et),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(et=>{if(et===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(et)})}setCurrentModel(et){this._me=et,this._notLoggedIn=!(et&&et.sessionMetadata&&et.sessionMetadata.userId)}hasWorkflow(et){var rt;return et===void 0||((rt=this._me)==null?void 0:rt.authorizedActions.findIndex(st=>st.name===et))!==-1}hasRight(et,rt){if(rt==="owner")return et.owner&&et.owner.userId===this._me.userId;const st=rt.right||rt,nt=et.shared.filter(at=>(this._me.groupsIds||[]).indexOf(at.groupId)!==-1||at.userId===this._me.userId).find(at=>at[st]||at.manager)!==void 0,ot=rt.workflow?this.hasWorkflow(rt.workflow):!0;return nt&&ot}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(et=>(this._description&&(this._description.quota=et.quota,this._description.storage=et.storage),et)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(et){this._currentLanguage=et,notify.onLangReady().resolve(et)}loadDefaultLanguage(){return http$2.get("/locale").then(et=>et.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(et=>(et[0].status==="ok"&&et[0].result&&et[0].result.length>0?this._description=et[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,et[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(et=>et.result).then(et=>this._profile=et[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(et=>{try{return JSON.parse(et.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(et){return http$2.put("/directory/user/mailstate",{email:et})}tryEmailValidation(et){return http$2.post("/directory/user/mailstate",{key:et})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(et){return http$2.put("/directory/user/mobilestate",{mobile:et})}tryMobileValidation(et){return http$2.post("/directory/user/mobilestate",{key:et})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(et){return http$2.post("/auth/user/mfa/code",{key:et})}}class SessionFramework{constructor(){n$3(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),transport.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){n$3(this,"_conf"),n$3(this,"_loaded"),n$3(this,"skinName",""),n$3(this,"themeName",""),n$3(this,"skin","raw"),n$3(this,"themeUrl","/assets/themes/raw/default/"),n$3(this,"templateOverrides",{}),n$3(this,"portalTemplate","/assets/themes/raw/portal.html"),n$3(this,"basePath",""),n$3(this,"logoutCallback",""),n$3(this,"skins",[]),n$3(this,"is1D",!1),n$3(this,"is2D",!1),n$3(this,"_onSkinReady",notify.onSkinReady()),n$3(this,"_onOverrideReady",notify.onOverridesReady())}initialize(et){return notify.onSessionReady().promise.then(()=>this.load(et))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(et){return this._conf=this._conf??await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:et??this.version}},"exports.conf"),this._conf}load(et){return et=et??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(et):this.loadConnected(et)).then(async()=>{var rt,st;const nt=await this.listSkins();this.is1D=((rt=nt.find(ot=>ot.child===this.skin))==null?void 0:rt.parent)==="panda",this.is2D=((st=nt.find(ot=>ot.child===this.skin))==null?void 0:st.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((rt,st)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(nt=>{this.skin=nt.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${nt.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${nt.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(ot=>{this.templateOverrides=ot,this._onOverrideReady.resolve(ot),rt()}).catch(ot=>{if(transport.http.latestResponse.status===404)rt();else throw ot})}).catch(nt=>{this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt),st()})})}loadConnected(et){return new Promise((rt,st)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(nt=>{this.templateOverrides=nt,this._onOverrideReady.resolve(nt),rt()}).catch(nt=>{if(transport.http.latestResponse.status===404)rt(),this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt);else throw nt})})})}async loadDefaultTheme(et){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:et}}).then(rt=>{this.skinName=rt.skinName,this.themeName=rt.themeName,this.themeUrl=rt.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=rt.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(et){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+et._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(et=>{const rt=et.overriding.find(st=>st.child===this.skin);return rt!=null&&rt.group?this.skins=this.skins.concat(et.overriding.filter(st=>st.group===rt.group)):this.skins=this.skins.concat(et.overriding),this.skins})}async getHelpPath(){const et=(await this.listSkins()).find(rt=>rt.child===this.skin);return(et==null?void 0:et.help)??"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(et,rt){et=et??"";let st=bundle$1[et]===void 0?et:bundle$1[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et){return this.loadBundlePromise(session.session.currentLanguage,et)}addBundle(et,rt){this.loadBundle(session.session.currentLanguage,et,rt)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises$1[rt]}loadBundle(et,rt,st){const nt=promises$1[rt];if(nt)st&&nt.then(st).catch(st);else{const ot=new Promisified;promises$1[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),transport.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle$1,lt),typeof st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle$1[rt]!="string"&&(bundle$1[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap$1.length;rt++)et=et.replace(defaultDiacriticsRemovalMap$1[rt].letters,defaultDiacriticsRemovalMap$1[rt].base);return et}}class UserPreferences{constructor(){n$3(this,"data",{})}get(et){return this.data[et]}load(et,rt){return transport.http.get("/userbook/preference/"+et).then(st=>{try{return JSON.parse(st.preference)}catch{return rt??{}}}).then(st=>(this.data[et]=st??{},st))}update(et,rt){return rt!==void 0&&(this.data[et]=rt),this}save(et){return transport.http.putJson("/userbook/preference/"+et,this.data[et])}}class User{constructor(){n$3(this,"_me",null),n$3(this,"_keepOpenOnLogout",!1),n$3(this,"_preferences",new UserPreferences),n$3(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(et){return this.loadPublicConf(),notify.onSessionReady().promise.then(rt=>{rt&&this.setCurrentModel(rt)})}setCurrentModel(et){this._me=et,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(et=>(this._keepOpenOnLogout=(et==null?void 0:et.keepOpenOnLogout)||!1,et))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(et=>{et.preference||(et.preference=null);const rt=JSON.parse(et.preference);let st;if(rt&&rt.length&&typeof rt.concat=="function"){this._bookmarkedApps=rt,st={bookmarks:rt.map(at=>at.name),applications:[]},transport.http.putJson("/userbook/preference/apps",st);return}else st=rt;st||(st={bookmarks:[],applications:[]});let nt=!0;const ot=[];st.bookmarks.forEach((at,lt)=>{const ut=this._me.apps.find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);this._bookmarkedApps.push(ct)}else ot.push(at),nt=!1}),ot.forEach(at=>{const lt=st.bookmarks.indexOf(at);lt!==-1&&st.bookmarks.splice(lt,1)}),nt||transport.http.putJson("/userbook/preference/apps",st)})}loadAppPrefs(et){return this.preferences.load(et,{})}saveAppPrefs(et){return this.preferences.save(et)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(et=>et["default-domain"])}saveLanguage(et){return this.preferences.update("language",{"default-domain":et}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){n$3(this,"_publicConf",{}),n$3(this,"_currentApp"),n$3(this,"_appConf",{})}get currentApp(){return this._currentApp??null}setCurrentApp(et){return this._currentApp=et,this}async initialize(et,rt=!1){rt||this.setCurrentApp(et),await Promise.all([this.getPublicConf(et),this.loadI18n(et)])}async getPublicConf(et){return this._publicConf[et]||(this._publicConf[et]=await http$1.get(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[et]}async getWebAppConf(et){let rt;return this._appConf[et]||(await http$1.get("/applications-list")).apps.forEach(st=>{if(st!=null&&st.prefix){const nt=st.prefix.replace("/","");this._appConf[nt]=st}else st!=null&&st.name&&st.name.toLowerCase()==et&&(rt=st)}),this._appConf[et]??rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){n$3(this,"_status","void"),n$3(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(et){return this.parametersWithCheck(et,!0)}async parametersWithCheck(et,rt){return this.initialize().promise.then(st=>!rt||st.type===et||st.type==="multiple"?st[et]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async et=>{var rt;if(!et||!et[0]||!et[0].type)throw ERROR_CODE.MALFORMED_DATA;et[1]&&et[1].active&&(et[0].xiti=await this.initializeXiti(et[1])),(rt=this._params)==null||rt.resolve(et[0]),this._status="ready"}).catch(et=>{var rt;throw this._status="failed",(rt=this._params)==null||rt.reject(),et})),this._params}async initializeXiti(et){if(!et.structureMap||!configure.Platform.apps.currentApp)return;const rt=await notify.onSessionReady().promise,st=session.session.description;let nt;for(const ct of rt.structures){const dt=et.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:et.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st.profiles&&st.profiles.length>0?ut[st.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){n$3(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),n$3(this,"School",{}),n$3(this,"User",new User)}async initialize(et,rt){if(!et){const nt=ct=>(ct<10?"0":"")+ct.toFixed(0),ot=new Date,at=ot.getFullYear(),lt=ot.getMonth()+1,ut=ot.getDate();et=`${at}${nt(lt)}${nt(ut)}`}const st=et;this.Platform.deploymentTag=et,typeof rt=="string"&&rt.length>0&&(this.Platform.cdnDomain=rt),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(st),notify.onSessionReady().promise.then(nt=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(st)])}}const configure=new ConfigurationFramework;transport==null||transport.http;var _$2;(_$2=session==null?void 0:session.session)==null||_$2.user;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",TRANSPORT:"transport",WEB_DATA:"webDataPipeline"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",ERROR_OCCURED:"error",DATA_TRACKED:"track"};class ServiceRegistry extends Map{register({application:et,resourceType:rt},st){this.set(`${et}:main`,st),this.set(`${et}:${rt}`,st)}findService(et,rt){return this.lookupService(et,rt)}findMainService({application:et},rt){return this.lookupService({application:et,resourceType:"main"},rt)}isRegistered({application:et,resourceType:rt}){return this.get(`${et}:${rt}`)!==void 0}lookupService({application:et,resourceType:rt},st){const nt=this.get(`${et}:${rt}`);if(nt===void 0)throw`Service not found: ${et}:${rt}`;return nt(st)}}const m$2=class{constructor(et){n$3(this,"checkHttpResponse",rt=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return rt}),this.context=et}get http(){return this.context.http()}async copy(et){const rt=await this.http.post("/archive/duplicate",{application:et.application,resourceId:et.resourceId});return this.checkHttpResponse(rt)}async publish(et){const rt=new FormData;return rt.append("title",et.title),rt.append("cover",et.cover),rt.append("coverName",et.cover.name),rt.append("coverType",et.cover.type),rt.append("teacherAvatar",et.teacherAvatar),rt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),rt.append("teacherAvatarType",et.teacherAvatar.type),rt.append("language",et.language),et.activityType.forEach(st=>{rt.append("activityType[]",st)}),et.subjectArea.forEach(st=>{rt.append("subjectArea[]",st)}),et.age.forEach(st=>{rt.append("age[]",st.toString())}),rt.append("description",et.description),et.keyWords.split(",").forEach(st=>{rt.append("keyWords[]",st.trim())}),rt.append("licence",et.licence),rt.append("pdfUri",`${window.location.origin}${this.getPrintUrl(et.resourceEntId)}`),rt.append("application",et.application?et.application:""),rt.append("resourceId",et.resourceId),rt.append("teacherSchool",et.userStructureName),await this.http.post("/appregistry/library/resource",rt,{headers:{"Content-Type":"multipart/form-data"}})}async createContext(et){const rt=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchContext(et){const rt=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchResource(et){const rt=await this.http.get(`/explorer/resources/${et.id}`,{queryParams:this.getResourceParams(et)});return this.checkHttpResponse(rt)}async createFolder(et){const rt=await this.http.post("/explorer/folders",this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async updateFolder(et){const rt=await this.http.put(`/explorer/folders/${et.folderId}`,this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async moveToFolder(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const st=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(st)}async listSubfolders(et){const rt=await this.http.get(`/explorer/folders/${et}`);return this.checkHttpResponse(rt)}async deleteAll(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const st=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(st)}async trashAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/trash",rt);return this.checkHttpResponse(nt)}async restoreAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/restore",rt);return this.checkHttpResponse(nt)}async mapAssetIdToIds({application:et,assetIds:rt}){const st=await this.searchContext({application:et,pagination:{startIdx:0,pageSize:rt.length+1},types:[],filters:{},asset_id:rt});return rt.map(nt=>{const ot=st.resources.find(at=>at.assetId===nt);if(ot===void 0)throw"explorer.assetid.notfound";return ot.id})}async getThumbnailPath(et){if(typeof et>"u")return et;if(typeof et=="string")if(et.startsWith("blob:")){const rt=await fetch(et).then(st=>st.blob());return`/workspace/document/${(await this.context.workspace().saveFile(rt,{visibility:"protected",application:this.getApplication()}))._id}`}else return et;else return`/workspace/document/${(await this.context.workspace().saveFile(et,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(et){const rt={application:et.application,start_idx:et.pagination.startIdx,page_size:et.pagination.pageSize,trashed:et.trashed};if(et.types.length>0&&(rt.resource_type=et.types[0]),et.orders&&Object.entries(et.orders).length){const[[st,nt]]=Object.entries(et.orders);rt.order_by=`${st}:${nt}`}return et.filters&&Object.assign(rt,et.filters),typeof et.search=="string"&&(rt.search=et.search),typeof et.asset_id<"u"&&(rt.asset_id=[...et.asset_id]),typeof et.id<"u"&&(rt.id=et.id),rt}getResourceParams(et){return{application:et.application}}createFolderToBodyParams(et){return{application:et.application,resourceType:et.type,parentId:et.parentId,name:et.name}}moveToBodyParams(et){return{application:et.application,resourceType:this.getResourceType(),resourceIds:et.resourceIds,folderIds:et.folderIds}}};n$3(m$2,"registry",new ServiceRegistry),n$3(m$2,"register",m$2.registry.register.bind(m$2.registry)),n$3(m$2,"findService",m$2.registry.findService.bind(m$2.registry)),n$3(m$2,"findMainService",m$2.registry.findMainService.bind(m$2.registry)),n$3(m$2,"isRegistered",m$2.registry.isRegistered.bind(m$2.registry));let ResourceService=m$2;const APP$3="scrapbook",RESOURCE$3="scrapbook";class ScrapbookResourceService extends ResourceService{create(et){throw new Error("Method not implemented.")}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/scrapbook/${et.entId}`,{trashed:et.trashed?1:0,title:et.name,icon:rt,subTitle:et.description});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$3}getApplication(){return APP$3}getFormUrl(et){return et?`/scrapbook?folderid=${et}#/create-scrapbook/`:"/scrapbook#/create-scrapbook/"}getViewUrl(et){return`/scrapbook#/view-scrapbook/${et}`}getPrintUrl(et){return`/scrapbook/print#/print-scrapbook/${et}`}getEditUrl(et){return`/scrapbook#/edit-scrapbook/${et}`}getExportUrl(et){return`/scrapbook/exportHtml/${et}`}}ResourceService.register({application:RESOURCE$3,resourceType:RESOURCE$3},tt=>new ScrapbookResourceService(tt));const APP$2="homeworks",RESOURCE$2="homeworks";class HomeworksResourceService extends ResourceService{async create(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.post("/homeworks",{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats,folder:et.folder});return this.checkHttpResponse(st),{thumbnail:rt,entId:st._id}}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/homeworks/${et.entId}`,{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$2}getApplication(){return APP$2}getFormUrl(et){return et?`/homeworks?folderid=${et}#/create-homeworks/`:"/homeworks#/create-homeworks/"}getViewUrl(et){return`/homeworks#/view-homeworks/${et}`}getPrintUrl(et){return`/homeworks/print#/print-homeworks/${et}`}getEditUrl(et){return`/homeworks#/edit-homeworks/${et}`}getExportUrl(){throw new Error("Export not implemented.")}}ResourceService.register({application:RESOURCE$2,resourceType:RESOURCE$2},tt=>new HomeworksResourceService(tt));const APP$1="timelinegenerator",RESOURCE$1="timelinegenerator";class TimelineGeneratorResourceService extends ResourceService{async create(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",st=await this.http.post("/timelinegenerator/timelines",{headline:et.name,text:et.description,icon:rt,type:"default",folder:et.folder});return this.checkHttpResponse(st),st}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/timelinegenerator/timeline/${et.entId}`,{headline:et.name,text:et.description,icon:rt,trashed:!!et.trashed,_id:et.entId,type:"default"});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$1}getApplication(){return APP$1}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/timelinegenerator#/view/${et}`}getPrintUrl(et){return`/timelinegenerator/print#/print/${et}`}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$1,resourceType:RESOURCE$1},tt=>new TimelineGeneratorResourceService(tt));const APP$5="collaborativeeditor",RESOURCE$4="collaborativeeditor";class CollaborativeEditorResourceService extends ResourceService{async create(et){const{name:rt,description:st,thumbnail:nt,folder:ot}=et,at=nt?await this.getThumbnailPath(nt):"",lt=await this.http.post("/collaborativeeditor",{name:rt,description:st,thumbnail:at,folder:ot});return this.checkHttpResponse(lt),lt}async update(et){const{name:rt,description:st,thumbnail:nt,entId:ot}=et,at=await this.getThumbnailPath(nt),lt=await this.http.put(`/collaborativeeditor/${ot}`,{name:rt,description:st,thumbnail:at});return this.checkHttpResponse(lt),{thumbnail:at,entId:ot}}getResourceType(){return RESOURCE$4}getApplication(){return APP$5}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/collaborativeeditor#/view/${et}`}getPrintUrl(){throw new Error("Method not implemented.")}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$4,resourceType:RESOURCE$4},tt=>new CollaborativeEditorResourceService(tt));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,rt,st){if(mutexPromise[et]!==void 0&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const nt=rt();mutexPromise[et]=nt;const ot=await nt;return st(ot)&&(globalCache[et]=ot),ot}catch(nt){throw console.error(`Failed to retrieve value for: ${et}`,nt),nt}}clearCache(et){if(et)delete globalCache[et];else for(const rt in globalCache)globalCache.hasOwnProperty(rt)&&delete globalCache[rt]}async httpGet(et,rt){return this.fromCacheIfPossible(et,async()=>{const st=await this.http.get(et,rt),nt={...this.http.latestResponse};return{value:st,response:nt}},({response:st})=>!(st.status<200||st.status>=300))}async httpGetJson(et,rt){const{response:st,value:nt}=await this.httpGet(et,rt);if(st.status<200||st.status>=300)throw`Bad http status (${st.status}) for url: ${et}`;return nt}}class ConfService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get cdnDomain(){return configure.Platform.cdnDomain}get notify(){return this.context.notify()}async getConf(et){const[rt,st]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[nt,ot]=await Promise.all([this.getTheme({conf:rt,publicTheme:st===void 0}),this.getWebAppConf({app:et,applications:st??[]})]),at={app:et,applications:st??[],conf:rt,currentApp:ot,theme:nt};return this.notify.onAppConfReady().resolve(at),at}async getPublicConf(et){const{response:rt,value:st}=await this.cache.httpGet(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.APP_NOT_FOUND;return st}getCdnUrl(){}async savePreference(et,rt){this.http.putJson(`/userbook/preference/${et}`,rt)}async getPreference(et){const rt=await this.http.get(`/userbook/preference/${et}`);return this.http.isResponseError()||typeof rt=="string"?{}:JSON.parse(rt.preference)}async getThemeConf(et){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:et}},"exports.conf")}async getApplicationsList(){const et=await this.http.get("/applications-list");if(!(this.http.isResponseError()||typeof et=="string"))return et.apps}async getWebAppConf({app:et,applications:rt}){return rt.find(st=>{if(st!=null&&st.prefix)return(st==null?void 0:st.prefix.replace("/",""))===et})}async getTheme({version:et,conf:rt,publicTheme:st}){var nt;const ot=await this.http.get("/theme"),at=(nt=rt==null?void 0:rt.overriding)==null?void 0:nt.find(ft=>st?ft.parent==="theme-open-ent"&&ft.bootstrapVersion==="ode-bootstrap-neo":ft.child===(ot==null?void 0:ot.themeName)),lt=st?"default":(ot==null?void 0:ot.skinName)||(at==null?void 0:at.skins[0]),ut=(ot==null?void 0:ot.skin)||`/assets/themes/${at==null?void 0:at.child}/skins/${lt}/`,ct=at==null?void 0:at.skins,dt=at==null?void 0:at.bootstrapVersion.split("-").slice(-1)[0],ht=(at==null?void 0:at.parent)==="panda";return{basePath:`${this.cdnDomain}${ut}../../`,bootstrapVersion:dt,is1d:ht,logoutCallback:(ot==null?void 0:ot.logoutCallback)||"",skin:at==null?void 0:at.child,skinName:lt,skins:ct,themeName:at==null?void 0:at.child,themeUrl:ut,npmTheme:(at==null?void 0:at.npmTheme)??void 0}}async getLogoutCallback(et){const{response:rt,value:st}=await this.cache.httpGet("/theme",{queryParams:{_:et}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return st.logoutCallback}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,rt,st="100x100"){return rt==="user"?`/userbook/avatar/${et}?thumbnail=${st}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(et,rt){return rt==="user"?`/userbook/annuaire#/${et}`:`/userbook/annuaire#/group-view/${et}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:et,name:rt})=>({id:et,displayName:rt,members:[]}))}async getBookMarkById(et){const{groups:rt,id:st,name:nt,users:ot}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:st,displayName:nt,groups:rt.map(({name:at,id:lt,nbUsers:ut})=>({nbUsers:ut,displayName:at,id:lt})),users:ot.map(({displayName:at,id:lt,profile:ut})=>({profile:ut,displayName:at,firstName:"",lastName:"",login:"",id:lt}))}}async saveBookmarks(et,{bookmarks:rt,groups:st,users:nt}){this.cache.clearCache("/directory/sharebookmark/all");const ot=nt.map(ht=>typeof ht=="string"?ht:ht.id),at=st.map(ht=>typeof ht=="string"?ht:ht.id),lt=rt.map(async ht=>{if(typeof ht=="string"){const{displayName:ft,groups:xt,id:vt,users:yt}=await this.getBookMarkById(ht),Et=yt.map(wt=>wt.id),bt=xt.map(wt=>wt.id);return{displayName:ft,id:vt,members:[...bt,...Et]}}else return Promise.resolve(ht)}),ut=(await Promise.all(lt)).map(ht=>ht.members).reduce((ht,ft)=>[...ht,...ft],[]),ct={name:et,members:[...ot,...at,...ut]},{id:dt}=await this.http.postJson("/directory/sharebookmark",ct);return{id:dt,displayName:et,members:ct.members}}}const loadedScripts={};class HttpService{constructor(et,rt){n$3(this,"axios"),n$3(this,"baseUrl"),n$3(this,"headers",{}),n$3(this,"_latestResponse"),this.context=et,this.axios=axios.create(rt)}fixBaseUrl(et){return et.startsWith("http://")||et.startsWith("https://")?et:this.baseUrl?this.baseUrl.endsWith("/")||et.startsWith("/")?`${this.baseUrl}${et}`:`${this.baseUrl}/${et}`:et}useBaseUrl(et){return this.baseUrl=et,this}useHeaders(et){return this.headers=et,this}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);et.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams));const st=rt.headers??{};return rt.headers={...st,...this.headers},rt}else return this.axios.defaults}toCdnUrl(et){et=this.fixBaseUrl(et);const rt=this.context.conf().getCdnUrl()||"";if(rt.length>0&&et!=="/conf/public"){const st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}return et}mapAxiosError(et,rt){et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN};const{status:st,statusText:nt,headers:ot,data:at}=this._latestResponse;return rt!=null&&rt.disableNotifications||notify.events().publish(LAYER_NAME.TRANSPORT,{name:EVENT_NAME.ERROR_OCCURED,data:{params:rt,response:{status:st,statusText:nt,headers:ot},payload:at}}),at}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}async get(et,rt){try{const st=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async post(et,rt,st){try{const nt=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async postFile(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async postJson(et,rt,st){const nt=this.toAxiosConfig();nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async put(et,rt,st){try{const nt=await this.axios.put(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.put(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.put(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async patch(et,rt,st){try{const nt=await this.axios.patch(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.patch(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.patch(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async delete(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async deleteJson(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),{data:rt});return this.mapAxiosResponse(st)}catch(st){throw this.mapAxiosError(st)}}getScript(et,rt,st){const nt=st??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${nt.split(".")[0]}={};${at};return ${nt};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts[et]?Promise.resolve():this.getScript(et,rt).then(st=>{loadedScripts[et]=!0})}}class RightService{constructor(et){this.context=et}get session(){return this.context.session()}parseResourceRight(et){const rt=et.split(":");if(rt.length===2){if(rt[0]==="creator")return{id:rt[1],right:"creator",type:"creator"}}else return rt.length===3?{id:rt[1],right:rt[2],type:rt[0]}:void 0}parseResourceRights(et){return et.map(rt=>this.parseResourceRight(rt)).filter(rt=>rt!==void 0)}hasResourceRight({id:et,groupIds:rt},st,nt){const ot=nt.map(at=>typeof at=="string"?this.parseResourceRight(at):at).filter(at=>at!==void 0);for(const at of ot)if(at.id===et&&at.type==="creator"||at.id===et&&at.type==="user"&&at.right===st||rt.includes(at.id)&&at.type==="group"&&at.right===st)return!0;return!1}async sessionHasResourceRight(et,rt){try{const st=await this.session.getUser();return!!st&&this.hasResourceRight({groupIds:st.groupsIds,id:st.userId},et,rt)}catch(st){return console.error(`Unexpected error ${st} in sessionHasResourceRight()`),!1}}async sessionHasAtLeastOneResourceRight(et,rt){for(const st of et)if(await this.sessionHasResourceRight(st,rt))return!0;return!1}async sessionHasResourceRightForEachList(et,rt){let st=0;for(const nt of rt)await this.sessionHasResourceRight(et,nt)&&st++;return st===rt.length}async sessionHasAtLeastOneResourceRightForEachList(et,rt){for(const st of et){let nt=0;for(const ot of rt)await this.sessionHasResourceRight(st,ot)&&nt++;if(nt===rt.length)return!0}return!1}hasWorkflowRight(et,rt){return rt.findIndex(st=>st===et)!==-1}async sessionHasWorkflowRight(et){try{const rt=await this.session.getUser();return!!rt&&this.hasWorkflowRight(et,rt.authorizedActions.map(st=>st.name))}catch(rt){return console.error(`Unexpected error ${rt} in sessionHasWorkflowRight()`),!1}}async sessionHasWorkflowRights(et){const rt={};try{const st=await this.session.getUser();for(const nt of et)rt[nt]=!!st&&this.hasWorkflowRight(nt,st.authorizedActions.map(ot=>ot.name))}catch(st){console.error(`Unexpected error ${st} in sessionHasWorkflowRights()`);for(const nt of et)rt[nt]=!1}return rt}}class SessionService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get conf(){return this.context.conf()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const et=await this.getUser(),[rt,st,nt,ot,at]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:st,currentLanguage:rt,userDescription:nt,userProfile:ot,bookmarkedApps:at}}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),this.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}async logout(){const et=await this.conf.getLogoutCallback();return this.http.get("/auth/logout?callback="+et).finally(()=>{})}async latestQuotaAndUsage(et){const rt={quota:0,storage:0};if(!et)return rt;try{return await this.http.get(`/workspace/quota/user/${et==null?void 0:et.userId}`)}catch(st){return console.error(st),rt}}async getCurrentLanguage(et){const rt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let st;return rt?st=await this.loadUserLanguage():st=await this.loadDefaultLanguage(),st}catch(st){console.error(st)}}async loadUserLanguage(){try{const et=await this.http.get("/userbook/preference/language");return JSON.parse(et.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:et,value:rt}=await this.cache.httpGet("/auth/oauth2/userinfo");if(!(et.status<200||et.status>=300)&&typeof rt=="object")return rt;throw ERROR_CODE.NOT_LOGGED_IN}hasWorkflow({workflowName:et,user:rt}){return et===void 0||(rt==null?void 0:rt.authorizedActions.findIndex(st=>st.name===et))!==-1}async loadDescription(et){if(!et)return{};try{const[rt,st]=await Promise.all([this.getUserProfile({options:{requestName:"refreshAvatar"}}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...st,profiles:rt}}catch(rt){return console.error(rt),{}}}async getBookmarks(et){if(!et)return[];const rt=await this.http.get("/userbook/preference/apps");rt.preference||(rt.preference=null);const st=JSON.parse(rt.preference);let nt;nt=st,nt||(nt={bookmarks:[],applications:[]});const ot=[];return nt.bookmarks.forEach((at,lt)=>{const ut=((et==null?void 0:et.apps)||[]).find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);ot.push(ct)}}),ot}async getUserProfile(et={}){var rt,st;const{options:nt={},params:ot={}}=et,at=new URLSearchParams(ot).toString(),lt=`/userbook/api/person${at?`?${at}`:""}`,{response:ut,value:ct}=await this.cache.httpGet(lt,nt);return ut.status<200||ut.status>=300||typeof ct=="string"?["Guest"]:((st=(rt=ct==null?void 0:ct.result)==null?void 0:rt[0])==null?void 0:st.type)||["Guest"]}async isAdml(){const et=await this.getUser();return(et==null?void 0:et.functions.ADMIN_LOCAL)!==void 0}async getWebApp(et){const rt=await this.getUser();return rt==null?void 0:rt.apps.find(st=>{var nt;return st!=null&&st.prefix?(st==null?void 0:st.prefix.replace("/",""))===et||!1:st!=null&&st.address&&((nt=st.address)==null?void 0:nt.split("/")[1])===et||!1})}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(et){this.context=et}get http(){return this.context.http()}async getIdiom(et,rt){await Promise.all([this.addBundlePromise(et,"/i18n"),this.addBundlePromise(et,`/${rt}/i18n`)])}translate(et,rt){et=et??"";let st=bundle[et]===void 0?et:bundle[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et,rt){return this.loadBundlePromise(et,rt)}addBundle(et,rt,st){this.loadBundle(et,rt,st)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises[rt]}loadBundle(et,rt,st){const nt=promises[rt];if(nt)st&&nt.then(st).catch(st);else{const ot=new Promisified;promises[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),this.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle,lt),typeof st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle[rt]!="string"&&(bundle[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class StringUtils{static removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class ShareService{constructor(et){this.context=et}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(et,rt,st){const nt=StringUtils.removeAccents(st).toLowerCase(),ot=await this.cache.httpGetJson(`/${et}/share/json/${rt}?search=${st}`),at=ot.users.visibles.filter(({username:ut,firstName:ct,lastName:dt,login:ht})=>{const ft=StringUtils.removeAccents(dt||"").toLowerCase(),xt=StringUtils.removeAccents(ct||"").toLowerCase(),vt=StringUtils.removeAccents(ut||"").toLowerCase(),yt=StringUtils.removeAccents(ht||"").toLowerCase();return vt.includes(nt)||xt.includes(nt)||ft.includes(nt)||yt.includes(nt)}).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"user"),displayName:ut.username,id:ut.id,profile:ut.profile,type:"user"})),lt=ot.groups.visibles.filter(({name:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"group"),displayName:ut.name,id:ut.id,type:"group",structureName:ut.structureName}));return[...(await this.directory.getBookMarks()).filter(({displayName:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:ut.displayName,id:ut.id,type:"sharebookmark"})),...at,...lt]}async getShareMapping(et){const rt=await this.cache.httpGetJson(`/${et}/rights/sharing`);for(const st of Object.keys(rt))if(st.includes(".")){const nt=st.split(".")[1],ot=rt[st];delete rt[st],rt[nt]=ot}return rt}getActionsAvailableFor({id:et,type:rt},st,nt){const ot=(rt==="user"?st.users.checked[et]:st.groups.checked[et])||[],at=Object.keys(nt),lt=[];for(const ut of at)nt[ut].filter(ct=>ot.includes(ct)).length>0&<.push(ut);return lt}async getRightsForResource(et,rt){const st=await this.directory.getBookMarks(),nt=`/${et}/share/json/${rt}?search=`,ot=await this.cache.httpGetJson(nt),at=await this.getShareMapping(et),lt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),ut=Object.keys(ot.users.checked).map(xt=>ot.users.visibles.find(vt=>vt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const vt=this.getActionsAvailableFor({id:xt.id,type:"user"},ot,at);return{id:xt.id,type:"user",displayName:xt.username,profile:xt.profile,avatarUrl:this.directory.getAvatarUrl(xt.id,"user"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"user"),actions:vt.map(yt=>{const Et=lt[yt];return{displayName:yt,id:yt,priority:Et.priority}})}}).sort((xt,vt)=>(xt.displayName||"").localeCompare(vt.displayName)),ct=Object.keys(ot.groups.checked).map(xt=>ot.groups.visibles.find(vt=>vt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const vt=this.getActionsAvailableFor({id:xt.id,type:"group"},ot,at);return{id:xt.id,type:"group",displayName:xt.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(xt.id,"group"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"group"),actions:vt.map(yt=>{const Et=lt[yt];return{displayName:yt,id:yt,priority:Et.priority}})}}).sort((xt,vt)=>(xt.displayName||"").localeCompare(vt.displayName)),dt=[...ut,...ct],ht=ot.groups.visibles.map(({groupDisplayName:xt,id:vt,name:yt,labels:Et})=>({labels:Et,displayName:xt||yt,id:vt})),ft=ot.users.visibles.map(({id:xt,profile:vt,username:yt,firstName:Et,lastName:bt,login:wt})=>({displayName:yt,firstName:Et,lastName:bt,login:wt,profile:vt,id:xt}));return{rights:dt,visibleBookmarks:st,visibleGroups:ht,visibleUsers:ft}}async saveRights(et,rt,st){const nt=await this.getShareMapping(et),ot={bookmarks:{},groups:{},users:{}};for(const lt of st){const ut=lt.actions.map(dt=>nt[dt.id]).reduce((dt,ht)=>Array.isArray(ht)?[...dt,...ht]:dt,[]),ct=[...new Set(ut)];ct.length>0&&(lt.type==="user"?ot.users[lt.id]=ct:lt.type==="group"?ot.groups[lt.id]=ct:ot.bookmarks[lt.id]=ct)}const at=`/${et}/share/resource/${rt}`;return this.cache.clearCache(`/${et}/share/json/${rt}?search=`),await this.http.putJson(at,ot)}async getActionsForApp(et){const rt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),st=await this.getShareMapping(et);return Object.keys(rt).map(nt=>{const ot=rt[nt];return{displayName:nt,id:nt,priority:ot.priority,requires:ot.requires}}).filter(nt=>{var ot;return((ot=st[nt.id])==null?void 0:ot.length)>0}).sort((nt,ot)=>nt.priority-ot.priority)}}const defaultMappers={csv:function({type:tt,extension:et}){return a$2.INSTANCE.isCsvLike(tt,et)},doc:function({type:tt,extension:et}){return a$2.INSTANCE.isWordLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("wordprocessing")!==-1},xls:function({type:tt,extension:et}){return a$2.INSTANCE.isExcelLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("spreadsheet")!==-1||tt.indexOf("ms-excel")!==-1},img:function({type:tt}){return tt.indexOf("image")!==-1},pdf:function({type:tt}){return tt.indexOf("pdf")!==-1||tt==="application/x-download"},ppt:function({type:tt,extension:et}){return a$2.INSTANCE.isPowerpointLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("presentation")!==-1||tt.indexOf("powerpoint")!==-1},txt:function({type:tt,extension:et}){return a$2.INSTANCE.isTxtLike(tt,et)},md:function({type:tt,extension:et}){return a$2.INSTANCE.isMdLike(tt,et)},video:function({type:tt}){return tt.indexOf("video")!==-1},audio:function({type:tt}){return tt.indexOf("audio")!==-1},zip:function({type:tt}){return tt.indexOf("zip")!==-1||tt.indexOf("rar")!==-1||tt.indexOf("tar")!==-1||tt.indexOf("7z")!==-1}},R$1=class sm{static getRole(et){var rt,st;return sm.role((rt=et.metadata)==null?void 0:rt["content-type"],!1,(st=et.metadata)==null?void 0:st.extension)}static role(et,rt=!1,st){if(st&&(st=st.trim()),!et)return"unknown";this.roleMappers||console.warn("[DocumentHelper.role] should not have empty roles",this);const nt={type:et,previewRole:rt,extension:st};for(const ot of this.roleMappers){const at=ot(nt);if(at)return at}return"unknown"}};n$3(R$1,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=R$1;class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}extractMetadata(et){const rt=et.name||"",st=rt.split("."),nt=et.type||"application/octet-stream",ot=st.length>1?st[st.length-1]:"",at={"content-type":nt,filename:rt,size:et.size,extension:ot,role:DocumentHelper.role(nt,!1,ot)},lt=rt.replace("."+at.extension,""),ut=at.extension?lt+"."+at.extension:lt;return{basename:lt,fullname:ut,metadata:at}}async saveFile(et,rt){const{fullname:st,metadata:nt}=this.extractMetadata(et),ot=new FormData;ot.append("file",et,st);const at=[];((rt==null?void 0:rt.visibility)==="public"||(rt==null?void 0:rt.visibility)==="protected")&&at.push(`${rt.visibility}=true`),rt!=null&&rt.application&&at.push(`application=${rt.application}`),nt.role==="img"&&at.push("quality=1"),rt!=null&&rt.parentId&&at.push(`parentId=${rt.parentId}`);const lt=await this.http.postFile(`/workspace/document?${at.join("&")}`,ot);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return lt}async updateFile(et,rt,st){const{fullname:nt,metadata:ot}=this.extractMetadata(rt),at=new FormData;at.append("file",rt,nt);const lt=[];ot.role==="img"&<.push("quality=1"),st!=null&&st.alt&<.push(`alt=${st.alt}`),st!=null&&st.legend&<.push(`legend=${st.legend}`),st!=null&&st.name&<.push(`name=${st.name}`);const ut=await this.http.putFile(`/workspace/document/${et}?${lt.join("&")}`,at);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return ut}async deleteFile(et){const rt=et.map(st=>st._id);if(rt.length==0)Promise.resolve(null);else if(await this.http.deleteJson("/workspace/documents",{ids:rt}),this.http.isResponseError())throw this.http.latestResponse.statusText}async acceptDocuments(et){const rt=await this.context.session().getUser();return st=>st.deleted&&st.trasher?(rt==null?void 0:rt.userId)==st.trasher:!0}async searchDocuments(et){const rt=et.filter!=="external"||et.parentId?await this.http.get("/workspace/documents",{queryParams:{...et,_:new Date().getTime()}}):[],st=await this.acceptDocuments(et);return rt.filter(st)}async listDocuments(et,rt){return this.searchDocuments({filter:et,parentId:rt,includeall:!0})}async transferDocuments(et,rt,st="protected"){const nt=[];if(et.forEach(ot=>{(st==="public"&&!ot.public||!ot.public&&!ot.protected)&&nt.push(ot)}),nt.length>0){const ot=await this.http.post("/workspace/documents/transfer",{application:rt,visibility:st,ids:nt.map(at=>at._id)});if(this.http.isResponseError())throw this.http.latestResponse.statusText;return nt.forEach((at,lt)=>{const ut=et.findIndex(ct=>ct._id===at._id);0<=ut&&ut<et.length&&(et[ut]=ot[lt])}),et.filter(at=>!!at)}return et}getThumbnailUrl(et,rt=0,st=0){var nt,ot;const at=rt>0||st>0?`${rt}x${st}`:"120x120";if(typeof et=="string")return et.includes("data:image")||et.includes("thumbnail")?et:`${et}${et.includes("?")?"&":"?"}thumbnail=${at}`;{const lt=`/workspace/${et.public?"pub/":""}document/${et._id}?thumbnail=`,ut=et.thumbnails;if((ot=(nt=et.metadata)==null?void 0:nt["content-type"])!=null&&ot.includes("video")){const ct=ut&&Object.keys(ut).length>0?Object.keys(ut)[0]:null;return ct?lt+ct:null}else return lt+at}}listFolder(et,rt=!1,st,nt){const ot={filter:et,hierarchical:rt,parentId:st,directShared:nt};return this.http.get("/workspace/folders/list",{queryParams:ot})}listOwnerFolders(et,rt){return this.listFolder("owner",et,rt)}listSharedFolders(et,rt){return this.listFolder("shared",et,rt,!0)}createFolder(et,rt){const st=new FormData;return st.append("name",et),rt&&st.append("parentFolderId",rt),this.http.postFile("/workspace/folder",st)}}let ATTag;class AnalyticsService{constructor(tt){this.context=tt}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(tt,et){const[rt]=await Promise.all([this.getXitiConfig(et.name.toLowerCase()),this.loadXitiScript()]);if(!rt||!ATInternet)return;let st=rt.LIBELLE_SERVICE.default||null;for(const nt in rt.LIBELLE_SERVICE)if(nt!=="default"&&tt.indexOf(nt)>=0){st=rt.LIBELLE_SERVICE[nt];break}ATTag=new ATInternet.Tracker.Tag({site:rt.STRUCT_ID}),ATTag.setProps({SERVICE:st,TYPE:rt.TYPE,OUTIL:rt.OUTIL,UAI:rt.STRUCT_UAI,PROJET:rt.PROJET,EXPLOITANT:rt.EXPLOITANT,PLATEFORME:rt.PLATFORME,PROFIL:rt.PROFILE},!0),ATTag.identifiedVisitor.set({id:rt.ID_PERSO,category:rt.PROFILE}),ATTag.page.set({name:(et==null?void 0:et.prefix)==="userbook"?"directory":et==null?void 0:et.prefix,chapter1:"",chapter2:"",chapter3:"",level2:rt.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(tt){const[et,rt]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(et!=null&&et.type))throw ERROR_CODE.MALFORMED_DATA;return rt!=null&&rt.active&&(et.xiti=await this.getXitiTrackingParams(rt,tt)),et.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(tt,et){if(!tt.structureMap||!et)return;const rt=await this.session.getUser(),st=await this.session.getUserProfile();let nt;if(!(rt!=null&&rt.structures))return;for(const ct of rt.structures){const dt=tt.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:tt.ID_PROJET,EXPLOITANT:tt.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:tt.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st&&st.length>0?ut[st[0]]??"":""}}}const b$1=class X0{constructor(et){this.context=et}get http(){return this.context.http()}get conf(){return this.context.conf()}async getVideoConf(){var et;const rt=await this.conf.getPublicConf(APP$4.VIDEO);return{maxWeight:(rt==null?void 0:rt["max-videosize-mbytes"])??X0.MAX_WEIGHT,maxDuration:(rt==null?void 0:rt["max-videoduration-minutes"])??X0.MAX_DURATION,acceptVideoUploadExtensions:((et=rt==null?void 0:rt["accept-videoupload-extensions"])==null?void 0:et.map(st=>st.toUpperCase()))??[]}}async upload({data:et,appCode:rt,captation:st,duration:nt}){if(!et.file)throw new Error("Invalid video file.");if(!et.filename)throw new Error("Invalid video filename");const ot=`${et.browser.name} ${et.browser.version}`,at=new FormData;at.append("device",et.device||""),at.append("browser",ot),at.append("url",et.url),at.append("app",rt),at.append("file",et.file,et.filename),at.append("weight",""+et.file.size),at.append("captation",""+st);let lt=`/video/encode?captation=${st}`;nt&&(lt+=`&duration=${nt}`);const ut=await this.http.post(lt,at,{headers:{"Content-Type":"multipart/form-data"}});if(ut.state=="running"){let ct=0,dt=1;do{const ht=dt+ct;await new Promise(xt=>setTimeout(xt,ht*1e3)),ct=dt,dt=Math.min(8,ht);const ft=await this.http.get(`/video/status/${ut.processid}`);if(ft.state=="succeed")return ft.videoworkspaceid&&ft.videosize&&this.context.data().trackVideoSave(ft.videoworkspaceid,Math.round(nt),ft.videosize,st,et.url,ot,et.device),ft;if(ft.state=="error")break}while(!0)}throw new Error("Video cannot be uploaded.")}};n$3(b$1,"MAX_WEIGHT",50),n$3(b$1,"MAX_DURATION",3);let VideoService=b$1;class EmbedderService{constructor(et){this.context=et}get http(){return this.context.http()}async getDefault(){return this.http.get("/infra/embed/default")}async getCustom(){return this.http.get("/infra/embed/custom")}getProviderFromUrl(et,rt){for(const st of et)if(this.isUrlFromProvider(rt,st))return st}urlIsFromPattern(et,rt){const st=new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)","g"),nt=new RegExp("{[^}]*}","g");let ot=!0;const at=rt.match(st)||[],lt=[];return(rt.match(nt)||[]).forEach((ut,ct)=>{ut.includes("ignore")||lt.push(at[ct])}),lt.forEach(ut=>{if(!et.includes(ut)){ot=!1;return}}),ot}isUrlFromProvider(et,rt){typeof rt.url=="string"&&(rt.url=[rt.url]);for(const st of rt.url)if(this.urlIsFromPattern(et,st))return!0;return!1}getEmbedCodeForProvider(et,rt){for(const st of et.url)if(this.urlIsFromPattern(rt,st)){const nt=new RegExp("{[a-zA-Z0-9_.]+}","g"),ot=st.match(nt)||[];let at=et.embed;for(const lt of ot){let ut=st.split(lt)[0];const ct=ut.split("}");ct.length>1&&(ut=ct[ct.length-1]);let dt=rt.split(ut)[1];if(!dt)continue;const ht=st.split(lt)[1].split("{")[0];ht&&(dt=dt.split(ht)[0]);const ft=new RegExp("\\"+lt.replace(/}/,"\\}"),"g");at=at.replace(ft,dt)}return at}return""}}class AbstractBehaviourService{constructor(et){n$3(this,"_cache"),this.context=et,this._cache=new CacheService(this.context)}getApplication(){return this.APP}getResourceType(){return this.RESOURCE}httpGet(et,rt){return this._cache.httpGetJson(et,rt)}dataToResource({modified:et,...rt}){const st=typeof et=="string"?et:et!=null&&et.$date?""+et.$date:"";return{application:this.RESOURCE,name:rt.title,creatorId:rt.owner,creatorName:rt.ownerName,thumbnail:rt.icon,assetId:rt._id,modifiedAt:st,shared:rt.shared,path:rt.path}}}class ActualitesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","actualites"),n$3(this,"RESOURCE","actualites")}async loadResources(){return(await this.httpGet("/actualites/linker/infos")).map(et=>{let rt;return et.thread_icon?rt=et.thread_icon+"?thumbnail=48x48":rt="/img/icons/glyphicons_036_file.png",this.dataToResource({title:et.title+" ["+et.thread_title+"]",ownerName:et.username,owner:et.owner,icon:rt,path:"/actualites#/view/thread/"+et.thread_id+"/info/"+et._id,_id:`${et.thread_id}#${et._id}`,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class BlogBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","blog"),n$3(this,"RESOURCE","blog")}loadResources(){return new Promise(async(et,rt)=>{try{const st=await this.httpGet("/blog/linker"),nt=[];st.forEach(ot=>{ot.thumbnail?ot.thumbnail=ot.thumbnail+"?thumbnail=48x48":ot.thumbnail="/img/illustrations/blog.svg";const at=ot.fetchPosts.map(lt=>this.dataToResource({owner:ot.author.userId,ownerName:ot.author.username,title:lt.title+" ["+ot.title+"]",_id:`${ot._id}#${lt._id}`,icon:ot.thumbnail,path:`/blog/id/${ot._id}/post/${lt._id}`,shared:!!(ot.shared&&ot.shared.length>=0),modified:ot.modified}));nt.push(...at)}),et(nt)}catch(st){rt(st)}})}}class CollaborativewallBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","collaborativewall"),n$3(this,"RESOURCE","collaborativewall")}async loadResources(){return(await this.httpGet("/collaborativewall/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.icon?et.icon:"/img/illustrations/collaborative-wall-default.png",path:"/collaborativewall#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class CommunityBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","community"),n$3(this,"RESOURCE","community")}async loadResources(){return(await this.httpGet("/community/listallpages")).map(et=>{let rt;return typeof et.thumbnail>"u"||et.thumbnail===""?rt="/img/icons/glyphicons_036_file.png":rt=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:et.name,icon:rt,path:"/community#/view/"+et.id,_id:et.id,owner:"",ownerName:"",shared:!!(et.shared&&et.shared.length>=0),modified:et.name})})}}class ExercizerBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","exercizer"),n$3(this,"RESOURCE","exercizer")}async loadResources(){return(await this.httpGet("/exercizer/subjects-scheduled")).map(et=>{const rt=et.picture?et.picture+"?thumbnail=48x48":"/img/illustrations/exercizer.svg";let st,nt=!1;const ot=JSON.parse(et.scheduled_at);return ot.groupList.length>0?(nt=!0,st=ot.groupList[0].name):ot.userList.length>0?(nt=!0,st=ot.userList[0].name):st="",ot.groupList.length+ot.userList.length>1&&(st+="..."),this.dataToResource({title:et.title,owner:et.owner,ownerName:st,icon:rt,path:"/exercizer#/linker/"+et.id,_id:""+et.id,shared:nt,modified:et.modified})})}}class FormulaireBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","formulaire"),n$3(this,"RESOURCE","formulaire")}async loadResources(){return(await this.httpGet("/formulaire/forms/linker")).map(et=>(et.picture||(et.picture="/formulaire/public/img/logo.svg"),this.dataToResource({_id:""+et.id,icon:et.picture,title:et.title,ownerName:et.owner_name,owner:et.owner_id,path:et.is_public?`${window.location.origin}/formulaire-public#/form/${et.public_key}`:`${window.location.origin}/formulaire#/form/${et.id}/${et.rgpd?"rgpd":"new"}`,shared:!!(et.shared&&et.shared.length>=0),modified:""+et.date_modification})))}}class ForumBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","forum"),n$3(this,"RESOURCE","forum")}async loadResources(){return(await this.httpGet("/forum/categories")).map(et=>this.dataToResource({_id:et._id,title:et.name,icon:et.icon||"/img/illustrations/forum.svg",path:"/forum#/view/"+et._id,ownerName:et.owner.displayName,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class HomeworksBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","homeworks"),n$3(this,"RESOURCE","homeworks")}async loadResources(){return(await this.httpGet("/homeworks/list")).filter(et=>et.owner&&et.trashed===0).map(et=>this.dataToResource({title:et.title,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/homeworks.svg",path:"/homeworks#/view-homeworks/"+et._id,_id:""+et._id,shared:typeof et.shared<"u",modified:et.modified}))}}class MagnetoBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","magneto"),n$3(this,"RESOURCE","magneto")}async loadResources(){const{all:et}=await this.httpGet("/magneto/boards/editable");return et.map(rt=>this.dataToResource({_id:rt._id,title:rt.title,icon:rt.imageUrl,owner:rt.ownerId,ownerName:rt.ownerName,path:`/magneto#/board/${rt._id}/view`,shared:!!(rt.shared&&rt.shared.length>=0),modified:""+rt.modificationDate}))}}class MindmapBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","mindmap"),n$3(this,"RESOURCE","mindmap")}async loadResources(){return(await this.httpGet("/mindmap/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/mindmap-default.png",path:"/mindmap#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class PagesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","pages"),n$3(this,"RESOURCE","pages")}async loadResources(){const et=await this.httpGet("/pages/list/all"),rt=[];return et.forEach(st=>{var nt;const ot=st.thumbnail?st.thumbnail+"?thumbnail=48x48":"/img/illustrations/pages.svg";rt.push(this.dataToResource({title:st.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id,_id:st._id,shared:typeof st.shared<"u",modified:st.modified})),(nt=st.pages)==null||nt.forEach(at=>{rt.push(this.dataToResource({title:at.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id+"/"+at.titleLink,_id:st._id+"/"+at.titleLink,shared:typeof st.shared<"u",modified:st.modified}))})}),rt}}class PollBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","poll"),n$3(this,"RESOURCE","poll")}async loadResources(){return(await this.httpGet("/poll/list/all")).map(et=>{const rt=et.icon?et.icon+"?thumbnail=48x48":"/img/icons/glyphicons_036_file.png";return this.dataToResource({title:et.question,ownerName:et.owner.displayName,icon:rt,path:"/poll#/view/"+et._id,_id:et._id,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class ScrapbookBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","scrapbook"),n$3(this,"RESOURCE","scrapbook")}async loadResources(){return(await this.httpGet("/scrapbook/list/all")).map(et=>{const rt=et.icon||"/img/illustrations/scrapbook.svg";return this.dataToResource({title:et.name,owner:et.owner.userId,ownerName:et.owner.displayName,icon:rt,path:"/scrapbook#/view-scrapbook/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class TimelinegeneratorBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","timelinegenerator"),n$3(this,"RESOURCE","timelinegenerator")}loadResources(){return new Promise(async(et,rt)=>{try{const st=(await this.httpGet("/timelinegenerator/timelines")).map(nt=>{const ot=nt.icon||"/img/illustrations/timeline-default.png";return this.dataToResource({title:nt.headline,ownerName:nt.owner.displayName,owner:nt.owner.userId,icon:ot,path:"/timelinegenerator#/view/"+nt._id,_id:nt._id,shared:typeof nt.shared<"u",modified:nt.modified})});et(st)}catch(st){rt(st)}})}}class WikiBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","wiki"),n$3(this,"RESOURCE","wiki")}async loadResources(){return(await this.httpGet("/wiki/listallpages?visible=true")).map(et=>et.pages.map(rt=>{let st;return typeof et.thumbnail>"u"||et.thumbnail===""?st="/img/icons/glyphicons_036_file.png":st=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:rt.title+" ["+et.title+"]",ownerName:et.owner.displayName,owner:et.owner.userId,icon:st,path:"/wiki#/view/"+et._id+"/"+rt._id,_id:`${et._id}#${rt._id}`,shared:typeof et.shared<"u",modified:rt.modified})})).flat()}}class WorkspaceBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","workspace"),n$3(this,"RESOURCE","workspace")}loadResources({search:et,asset_id:rt}){return new Promise(async(st,nt)=>{try{let ot="/workspace/documents?filter=all&hierarchical=true";rt&&rt.length?ot+=`&search=${et}`:et&&et.length&&(ot+=`&search=${et}`);const at=(await this.httpGet(ot)).filter(lt=>!lt.deleted).map(lt=>{const ut=lt.metadata["content-type"]&<.metadata["content-type"].indexOf("image")!==-1?`/workspace/document/${lt._id}?thumbnail=120x120`:"/img/icons/unknown-large.png";return this.dataToResource({title:lt.name,ownerName:lt.ownerName,owner:lt.owner,icon:ut,path:`/workspace/document/${lt._id}`,_id:lt._id,shared:!!(lt.shared&<.shared.length>=0),modified:lt.modified})});st(at)}catch(ot){nt(ot)}})}}const w$3=class{static async initialize(et,rt){const st=et.http();if(!this.resourceProducingApps.length){this.resourceProducingApps=[rt,"workspace"];try{const[nt,ot]=await Promise.all([st.get("/resources-applications"),et.session().getUser()]);ot!=null&&ot.apps&&nt!=null&&nt.length&&(this.resourceProducingApps=nt.filter(at=>ot.apps.some(lt=>lt.address.includes(at))))}catch(nt){console.warn("Failed to load resource-producing apps:",nt)}}return this.resourceProducingApps}static registerCustomBehaviour(et,rt,st){this.registry.register({application:et,resourceType:rt},st)}static async registerBehaviours(et){this.resourceProducingApps.forEach(rt=>{const st={application:et,resourceType:rt};this.registry.register(st,nt=>this.serviceFor(nt,et,rt))})}static serviceFor(et,rt,st){let nt;switch(st){case"timelinegenerator":nt=new TimelinegeneratorBehaviour(et);break;case"workspace":nt=new WorkspaceBehaviour(et);break;case"blog":nt=new BlogBehaviour(et);break;case"actualites":nt=new ActualitesBehaviour(et);break;case"wiki":nt=new WikiBehaviour(et);break;case"pages":nt=new PagesBehaviour(et);break;case"poll":nt=new PollBehaviour(et);break;case"community":nt=new CommunityBehaviour(et);break;case"mindmap":nt=new MindmapBehaviour(et);break;case"forum":nt=new ForumBehaviour(et);break;case"homeworks":nt=new HomeworksBehaviour(et);break;case"scrapbook":nt=new ScrapbookBehaviour(et);break;case"collaborativewall":nt=new CollaborativewallBehaviour(et);break;case"exercizer":nt=new ExercizerBehaviour(et);break;case"formulaire":nt=new FormulaireBehaviour(et);break;case"magneto":nt=new MagnetoBehaviour(et);break;default:throw ERROR_CODE.NOT_SUPPORTED}return nt.APP=rt,nt}};n$3(w$3,"registry",new ServiceRegistry),n$3(w$3,"findBehaviour",w$3.registry.findService.bind(w$3.registry)),n$3(w$3,"hasBehaviour",w$3.registry.isRegistered.bind(w$3.registry)),n$3(w$3,"resourceProducingApps",[]);let SnipletsService=w$3;const SEND_ALL="*";class WebBroker{constructor(et){n$3(this,"subscription"),this.odeServices=et}get http(){return this.odeServices.http()}get events(){return this.odeServices.notify().events()}dispatchEvent(et,rt){rt.findIndex(st=>SEND_ALL===st||et.data["event-type"]===st)>=0&&this.http.post("/infra/event/web/store",et.data,{disableNotifications:!0})}initialize(et){if(et===void 0||et.send===void 0||et.send.length>0){const rt=(et==null?void 0:et.send)??[SEND_ALL];this.subscription=this.events.subscribe(LAYER_NAME.WEB_DATA,st=>this.dispatchEvent(st,rt))}return this}destroy(){this.subscription&&(this.subscription.revoke(),delete this.subscription)}}class DataService{constructor(et){n$3(this,"_webBroker"),n$3(this,"app"),n$3(this,"user"),n$3(this,"profile"),this.odeServices=et}get conf(){return this.odeServices.conf()}get notify(){return this.odeServices.notify()}async initialize(){try{const{app:et}=await this.notify.onAppConfReady().promise;this.app=et,this.user=await this.odeServices.session().getUser(),this.profile=await this.odeServices.session().getUserProfile();const{["data-service"]:rt}=await this.conf.getPublicConf(et);this._webBroker=new WebBroker(this.odeServices).initialize(rt==null?void 0:rt.web)}catch{console.log("DataService not initialized, usage data unavailable.")}}predestroy(){this._webBroker&&(this._webBroker.destroy(),delete this._webBroker)}trackWebEvent(et){this.notify.events().publish(LAYER_NAME.WEB_DATA,{name:EVENT_NAME.DATA_TRACKED,data:et})}addUserInfos(et){return this.user&&(et.userId=this.user.userId,et.structure=this.user.structureNames[0]),this.profile&&(et.profil=this.profile[0]),et}trackVideoSave(et,rt,st,nt,ot,at,lt){const ut=this.addUserInfos({"event-type":"VIDEO_SAVE",module:this.app||"video",video_id:et,browser:at,duration:Math.round(rt),weight:st,source:nt?"CAPTURED":"UPLOADED",url:ot});lt&&(ut.device_type=lt),this.trackWebEvent(ut)}trackVideoRead(et,rt,st,nt,ot){const at=this.addUserInfos({"event-type":"VIDEO_READ",module:"video",video_id:et,browser:nt,source:rt?"CAPTURED":"UPLOADED",url:st});this.app&&(at["override-module"]=this.app),ot&&(at.device_type=ot),this.trackWebEvent(at)}trackSpeechAndText(et){const rt=this.addUserInfos({"event-type":"SPEECH_AND_TEXT",function:et});this.app&&(rt.module=this.app),this.trackWebEvent(rt)}trackAccessLibraryFromExplorer(){const et=this.addUserInfos({"event-type":"ACCESS_LIBRARY_FROM_EXPLORER"});this.app&&(et.module=this.app),this.trackWebEvent(et)}}class ReactionsService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get http(){return this.context.http()}async loadAvailableReactions(){try{const{"reaction-types":et}=await this.context.conf().getPublicConf("audience");return Array.isArray(et)?et:void 0}catch{console.error("Audience configuration not found");return}}async loadReactionSummaries(et){const rt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt.reactionsByResource}async loadReactionDetails(et,rt,st){const nt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}/${et}?page=${rt}&size=${st}`);return this.http.isResponseError()?void 0:nt}async deleteReaction(et){await this.http.delete(`/audience/reactions/${this.module}/${this.resourceType}/${et}`)}async updateReaction(et,rt){await this.http.putJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}async createReaction(et,rt){await this.http.postJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}}class ViewsService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get http(){return this.context.http()}async getCounters(et){const rt=await this.http.get(`/audience/views/count/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt}async getDetails(et){const rt=await this.http.get(`/audience/views/details/${this.module}/${this.resourceType}/${et}`);return this.http.isResponseError()?void 0:rt}trigger(et){return this.http.post(`/audience/views/${this.module}/${this.resourceType}/${et}`)}}class AudienceService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get views(){return new ViewsService(this.context,this.module,this.resourceType)}get reactions(){return new ReactionsService(this.context,this.module,this.resourceType)}}class OdeServices{constructor(){n$3(this,"_analytics"),n$3(this,"_cache"),n$3(this,"_conf"),n$3(this,"_data"),n$3(this,"_directory"),n$3(this,"_http"),n$3(this,"_idiom"),n$3(this,"_notify"),n$3(this,"_rights"),n$3(this,"_session"),n$3(this,"_share"),n$3(this,"_video"),n$3(this,"_workspace"),n$3(this,"_embedder"),this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._data=new DataService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._notify=NotifyFrameworkFactory.instance(),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._video=new VideoService(this),this._workspace=new WorkspaceService(this),this._embedder=new EmbedderService(this)}initialize(){return this._data.initialize(),this}analytics(){return this._analytics}audience(et,rt){return new AudienceService(this,et,rt)}cache(){return this._cache}conf(){return this._conf}data(){return this._data}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}notify(){return this._notify}resource(et,rt){return rt?ResourceService.findService({application:et,resourceType:rt},this):ResourceService.findMainService({application:et},this)}behaviour(et,rt){return SnipletsService.findBehaviour({application:et,resourceType:rt},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}video(){return this._video}workspace(){return this._workspace}embedder(){return this._embedder}}const ACTION={OPEN:"open",MANAGE:"manage",UPD_PROPS:"properties",DELETE:"delete",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PUBLISH:"publish"},FOLDER={BIN:"bin",DEFAULT:"default"},SORT_ORDER={DESC:"desc"},odeServices=new OdeServices().initialize(),WIDGET_POSITION={LEFT:"left",RIGHT:"right"},isActionAvailable=(tt,et)=>{const rt=et==null?void 0:et.filter(st=>st.id===tt&&st.available);return rt&&rt.length>0},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140};class WidgetFramework{constructor(){n$3(this,"_initialized"),n$3(this,"_widgets",[]),n$3(this,"_userPrefs",{})}initialize(et,rt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(st=>{var nt;st&&st.widgets?(st.widgets.forEach(ot=>{this._widgets.push(new Widget(ot))}),this.loadUserPrefs().then(()=>{var ot;(ot=this._initialized)==null||ot.resolve()}).catch(ot=>{var at;(at=this._initialized)==null||at.reject()})):(nt=this._initialized)==null||nt.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(et){return this._widgets.find(rt=>rt.platformConf.name===et)}lookupDefaultPosition(et){return defaultWidgetPosition[et]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(et=>this.applyUserPrefs(et))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().publish(LAYER_NAME.WIDGETS,{name:EVENT_NAME.USERPREF_CHANGED})})}async applyUserPrefs(et){this._userPrefs=et??this._userPrefs;const rt=configure.Platform.theme,st=[];rt.listSkins().then(nt=>{var ot;const at=((ot=nt.find(ut=>ut.child===rt.skin))==null?void 0:ot.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((ut,ct)=>{const dt=ut.platformConf.name;return at.indexOf(dt)!==-1?!1:(this._userPrefs[dt]||(this._userPrefs[dt]={index:defaultWidgetOrder[dt]??999,show:!0,position:ut.platformConf.position}),ut.platformConf.mandatory&&(this._userPrefs[dt].show=!0,this._userPrefs[dt].index=defaultWidgetOrder[dt]??999),ut.platformConf.i18n&&st.push(ut.platformConf.i18n),ut.applyUserPref(this._userPrefs[dt]),!0)});const lt=new Idiom;this._widgets=this._widgets.sort((ut,ct)=>{const dt=lt.translate(`timeline.settings.${ut.platformConf.name}`).toLowerCase(),ht=lt.translate(`timeline.settings.${ct.platformConf.name}`).toLowerCase();return dt<ht?-1:dt>ht?1:0})})}}class Widget{constructor(et){n$3(this,"_schoolConf",{}),n$3(this,"_userPref"),this._platformConf=et,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(et){this._userPref=et,this._userPref.position=this._userPref.position??widgets.lookupDefaultPosition(this._platformConf.name)??"left"}}const widgets=new WidgetFramework,SvgIconFolder=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.057 5.5A.057.057 0 0 0 3 5.557v13.03h18V7.875h-8.697a1 1 0 0 1-1-1c0-.759-.615-1.374-1.374-1.374zM1 5.557C1 4.42 1.92 3.5 3.057 3.5h6.872c1.515 0 2.797.999 3.223 2.374H21a2 2 0 0 1 2 2v10.714a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2z",clipRule:"evenodd"})]}),SvgIconRafterDown=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.012 7.871a1.5 1.5 0 0 1 2.117.141L12 14.722l5.871-6.71a1.5 1.5 0 1 1 2.258 1.976l-7 8a1.5 1.5 0 0 1-2.258 0l-7-8a1.5 1.5 0 0 1 .141-2.117",clipRule:"evenodd"})]}),TreeNode=({node:tt,showIcon:et,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt,handleItemAction:ut})=>{const ct=st.has(tt.id),dt=nt==null?void 0:nt.current.has(tt.id),ht=rt===tt.id,ft=ot===tt.id,xt={action:clsx("action-container d-flex align-items-center gap-8 px-2",{"drag-focus":ft,"py-4":!tt.section}),arrow:clsx({"py-4":!tt.section,"py-8":tt.section,invisible:!Array.isArray(tt.children)||tt.children.length===0}),button:clsx("flex-fill d-flex align-items-center text-truncate gap-8",{"py-8":tt.section})},vt=tt.section?16:12,{t:yt}=useTranslation(),{setNodeRef:Et}=useDroppable({id:reactExports.useId(),data:{id:tt.id,name:tt.name,isTreeview:!0,accepts:["folder","resource"]}}),bt=Pt=>at==null?void 0:at(Pt),wt=Pt=>lt==null?void 0:lt(Pt),St=Pt=>ut==null?void 0:ut(Pt),Rt=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),at==null||at(tt.id))},Ct=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),lt==null||lt(tt.id))},It=Pt=>jsxRuntimeExports.jsx(Pt?SvgIconRafterDown:SvgIconRafterRight,{title:yt("foldUnfold"),width:vt,height:vt}),jt=()=>{var Pt;const Ot=!((Pt=nt==null?void 0:nt.current)!=null&&Pt.has(tt.id)),Ut=Array.isArray(tt.children)&&tt.children.length>0;return dt||Ot&&Ut};return jsxRuntimeExports.jsx("li",{ref:Et,id:`treeitem-${tt.id}`,role:"treeitem","aria-selected":ht&&ht,"aria-expanded":ct&&ct,children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:xt.action,children:[jsxRuntimeExports.jsx("div",{className:xt.arrow,tabIndex:0,role:"button",onClick:()=>wt(tt.id),onKeyDown:Ct,"aria-label":yt("foldUnfold"),children:jt()&&It(ct)}),jsxRuntimeExports.jsxs("div",{tabIndex:0,role:"button",className:xt.button,onClick:()=>bt(tt.id),onKeyDown:Rt,children:[tt.section&&et&&jsxRuntimeExports.jsx(SvgIconFolder,{title:yt("folder"),width:20,height:20}),jsxRuntimeExports.jsx("span",{className:"text-truncate",children:tt.name})]}),tt.section&&ut&&jsxRuntimeExports.jsx("button",{className:"tree-btn mx-8",onClick:()=>St(tt.id),children:jsxRuntimeExports.jsx(SvgIconPlus,{height:16,width:16})})]}),Array.isArray(tt.children)&&!!tt.children.length&&ct&&jsxRuntimeExports.jsx("ul",{role:"group",children:tt.children.map(Pt=>jsxRuntimeExports.jsx(TreeNode,{node:Pt,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt},Pt.id))})]})},tt.id)};var __defProp=Object.defineProperty,__defNormalProp=(tt,et,rt)=>et in tt?__defProp(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,__publicField=(tt,et,rt)=>__defNormalProp(tt,typeof et!="symbol"?et+"":et,rt);function findTreeNode(tt,et){if(et(tt))return tt;if(Array.isArray(tt.children))for(const rt of tt.children){const st=findTreeNode(rt,et);if(st)return st}}function findNodeById(tt,et){if(Array.isArray(tt))for(const rt of tt){const st=findNodeById(rt,et);if(st)return st}else{if(tt.id===et)return tt;if(tt.children)for(const rt of tt.children){const st=findNodeById(rt,et);if(st)return st}}}function addNode(tt,{parentId:et,newFolder:rt}){return modifyNode(tt,st=>{var nt;if(st.id===et){const ot=[...((nt=st.folder)==null?void 0:nt.ancestors)||[]],at=arrayUnique([...ot,st.id]);return{...st,children:[...st.children||[],new TreeNodeFolderWrapper({...rt,ancestors:at})]}}else return st})}function arrayUnique(tt){return tt.filter((et,rt)=>tt.indexOf(et)===rt)}function deleteNode(tt,{folders:et}){return modifyNode(tt,rt=>{if(!et.includes(rt.id))return rt})}const findParentNode=(tt,et)=>{if(tt.children)for(const rt of tt.children){if(rt.id===et)return tt;const st=findParentNode(rt,et);if(st)return st}};function getAncestors(tt,et){var rt;const st=findNodeById(tt,et);return(rt=st==null?void 0:st.folder)!=null&&rt.ancestors?[...(st==null?void 0:st.folder.ancestors)||[],et]:et===FOLDER.BIN?[FOLDER.BIN]:[FOLDER.DEFAULT]}function modifyNode(tt,et){return doModify(tt,et)||tt}function doModify(tt,et,rt){var st;const nt=et(tt,rt);if((st=nt==null?void 0:nt.children)!=null&&st.length){const ot=[];for(const at of(nt==null?void 0:nt.children)||[]){const lt=doModify(at,et,nt);lt&&ot.push(lt)}return{...nt,children:ot}}return nt}function moveNode(tt,{destinationId:et,folders:rt}){return modifyNode(tt,(st,nt)=>{var ot,at;if(et===st.id){const lt=[...((ot=st.folder)==null?void 0:ot.ancestors)||[]],ut=arrayUnique([...lt,st.id]),ct=[...st.children||[]],dt=((at=st.children)==null?void 0:at.map(ht=>ht.id))||[];for(const ht of rt)if(!dt.includes(ht)){const ft=findNodeById(st,ht);ft&&ct.push({...ft,folder:{...ft==null?void 0:ft.folder,ancestors:ut}})}return{...st,children:ct}}else return rt.includes(st.id)&&et!==(nt==null?void 0:nt.id)?void 0:st})}const wrapTreeNode=(tt,et,rt)=>modifyNode(tt,st=>(st.id===rt&&(st.children=et==null?void 0:et.map(nt=>new TreeNodeFolderWrapper(nt))),st));function updateNode(tt,{folderId:et,newFolder:rt}){return modifyNode(tt,st=>st.id===et?new TreeNodeFolderWrapper(rt):st)}function findPathById(tt,et){let rt=[];function st(ot,at){if(ot.id===et)return rt=at.concat(ot.id),!0;if(ot.children){for(const lt of ot.children)if(st(lt,at.concat(ot.id)))return!0}return!1}function nt(ot){if(Array.isArray(ot)){for(const at of ot)if(st(at,[]))break}else st(ot,[])}return nt(tt),rt}class TreeNodeFolderWrapper{constructor(et){__publicField(this,"id"),__publicField(this,"name"),__publicField(this,"childNumber"),__publicField(this,"section",!1),__publicField(this,"children",[]),this.folder=et,this.id=et.id,this.name=et.name,this.childNumber=et.childNumber}}const useTreeView=({data:tt,ref:et,externalSelectedNodeId:rt,draggedNode:st,allExpandedNodes:nt,onTreeItemUnfold:ot,onTreeItemFold:at,onTreeItemClick:lt})=>{const[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(new Set),ft=reactExports.useRef(new Set),[xt,vt]=reactExports.useState(void 0),yt=ut??rt;function Et(Nt){var Ht;Array.isArray(Nt)?Nt.forEach(Lt=>{const kt=new Set(ft.current);Nt.filter(({id:$t})=>$t!==Lt.id).some($t=>$t.children&&$t.children.length>0)&&kt.add(Lt.id),Lt.children&&Lt.children.length>0&&Lt.children.forEach($t=>{var Ft;const Gt=(Ft=Lt.children)==null?void 0:Ft.filter(({id:Mt})=>Mt!==$t.id);Gt!=null&&Gt.some(Mt=>Mt.children&&Mt.children.length>0)&&kt.add($t.id),Et($t)})}):(Ht=Nt.children)==null||Ht.forEach(Lt=>{var kt;const $t=new Set(ft.current),Ft=(kt=Nt.children)==null?void 0:kt.filter(Gt=>Gt.id!==Lt.id);Ft!=null&&Ft.some(Gt=>Gt.children&&Gt.children.length>0)&&($t.add(Lt.id),ft.current=$t),Et(Lt)})}const bt=Nt=>{const Ht=new Set("");tt&&Array.isArray(tt)&&Nt&&(tt.forEach(Lt=>{Ht.add(Lt.id)}),ht(Ht))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{st!=null&&st.isOver&&st.isTreeview?(st.overId&&Ut(st.overId),vt(st.overId)):vt(void 0)},[st]);const wt=reactExports.useMemo(()=>({unselectAll(){ct(void 0)},select(Nt){Pt(Nt)},allExpandedNodes(){bt(nt)}}),[]);reactExports.useImperativeHandle(et,()=>wt,[wt]),reactExports.useEffect(()=>{bt(nt)},[]),reactExports.useEffect(()=>{rt&&!nt?(St(rt),ct(rt)):ct(void 0)},[rt]);const St=Nt=>{if(!findNodeById(tt,yt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ht=>ot==null?void 0:ot(Ht));return}Rt(Nt)},Rt=Nt=>{const Ht=new Set(dt),Lt=findPathById(tt,Nt),kt=Array.from(Ht);Lt.forEach($t=>{const Ft=kt.indexOf($t);Ft>-1&&kt.splice(Ft,1),kt.push($t)}),Ht.clear(),kt.forEach($t=>Ht.add($t)),Ht.forEach($t=>ot==null?void 0:ot($t)),ht(Ht)},Ct=Nt=>{const Ht=new Set(dt);Ht.delete(Nt),Ht.forEach(Lt=>at==null?void 0:at(Lt)),ht(Ht)},It=Nt=>{dt.has(Nt)?Ct(Nt):Rt(Nt)},jt=Nt=>{yt!==Nt&&ct(Nt)},Pt=Nt=>{jt(Nt),Rt(Nt),lt==null||lt(Nt)},Ot=Nt=>{It(Nt)},Ut=Nt=>{findNodeById(tt,rt)&&Rt(Nt)};return{selectedNodeId:yt,expandedNodes:dt,siblingsNodes:ft,draggedNodeId:xt,handleItemClick:Pt,handleFoldUnfold:Ot}},TreeView=reactExports.forwardRef((tt,et)=>{const{data:rt,onTreeItemClick:st,onTreeItemUnfold:nt,onTreeItemFold:ot,onTreeItemAction:at,draggedNode:lt,showIcon:ut=!0,allExpandedNodes:ct=!1,selectedNodeId:dt}=tt,{selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:vt,handleItemClick:yt,handleFoldUnfold:Et}=useTreeView({data:rt,ref:et,externalSelectedNodeId:dt,draggedNode:lt,allExpandedNodes:ct,onTreeItemClick:st,onTreeItemFold:ot,onTreeItemUnfold:nt});return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:Array.isArray(rt)?rt.map(bt=>jsxRuntimeExports.jsx(TreeNode,{node:bt,showIcon:ut,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:vt,handleItemClick:yt,handleToggleNode:Et,handleItemAction:at},bt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,showIcon:ut,draggedNodeId:vt,handleItemClick:yt,handleToggleNode:Et})})})}),VisuallyHidden=reactExports.forwardRef(({children:tt},et)=>jsxRuntimeExports.jsx("span",{className:"visually-hidden",ref:et,children:tt})),EdificeClientContext=reactExports.createContext(null);function useEdificeClient(){const tt=reactExports.useContext(EdificeClientContext);if(!tt)throw new Error("Cannot be used outside of EdificeClientProvider");return tt}function useBookmark(){var tt;const{sessionQuery:et}=useEdificeClient(),rt=new Set;return(tt=et==null?void 0:et.data)==null?void 0:tt.bookmarkedApps.filter(st=>{const nt=rt.has(st.displayName);return rt.add(st.displayName),!nt})}function useDebounce(tt,et){const[rt,st]=reactExports.useState(tt);return reactExports.useEffect(()=>{const nt=setTimeout(()=>{st(tt)},et);return()=>{clearTimeout(nt)}},[tt,et]),rt}function useHover$1(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=reactExports.useCallback(()=>{et(!0)},[]),nt=reactExports.useCallback(()=>{et(!1)},[]);return[reactExports.useCallback(at=>{var lt;((lt=rt.current)==null?void 0:lt.nodeType)===Node.ELEMENT_NODE&&(rt.current.removeEventListener("mouseenter",st),rt.current.removeEventListener("mouseleave",nt)),(at==null?void 0:at.nodeType)===Node.ELEMENT_NODE&&(at.addEventListener("mouseenter",st),at.addEventListener("mouseleave",nt)),rt.current=at},[st,nt]),tt]}function useMediaQuery(tt){const et=reactExports.useCallback(nt=>{const ot=window.matchMedia(tt);return ot.addEventListener("change",nt),()=>{ot.removeEventListener("change",nt)}},[tt]),rt=()=>window.matchMedia(tt).matches,st=()=>{throw Error("useMediaQuery is a client-only hook")};return reactExports.useSyncExternalStore(et,rt,st)}function useToggle$1(tt){const[et,rt]=reactExports.useState(()=>tt),st=reactExports.useCallback(nt=>rt(typeof nt=="boolean"?nt:ot=>!ot),[]);return[et,st]}function useBreakpoint(){return{xs:useMediaQuery("only screen and (min-width: 0)"),sm:useMediaQuery("only screen and (min-width: 375px)"),md:useMediaQuery("only screen and (min-width: 768px)"),lg:useMediaQuery("only screen and (min-width: 1024px)"),xl:useMediaQuery("only screen and (min-width: 1280px)"),xxl:useMediaQuery("only screen and (min-width: 1400px)")}}var uaParser={exports:{}};(function(tt,et){(function(rt,st){var nt="1.0.41",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",ft="model",xt="name",vt="type",yt="vendor",Et="version",bt="architecture",wt="console",St="mobile",Rt="tablet",Ct="smarttv",It="wearable",jt="embedded",Pt=500,Ot="Amazon",Ut="Apple",Nt="ASUS",Ht="BlackBerry",Lt="Browser",kt="Chrome",$t="Edge",Ft="Firefox",Gt="Google",Mt="Honor",Vt="Huawei",Bt="Lenovo",qt="LG",Qt="Microsoft",Yt="Motorola",tr="Nvidia",lr="OnePlus",ur="Opera",mr="OPPO",yr="Samsung",or="Sharp",hr="Sony",pr="Xiaomi",_r="Zebra",Ar="Facebook",Hr="Chromium OS",Ur="Mac OS",os=" Browser",Gs=function(Ir,Br){var kr={};for(var Wr in Ir)Br[Wr]&&Br[Wr].length%2===0?kr[Wr]=Br[Wr].concat(Ir[Wr]):kr[Wr]=Ir[Wr];return kr},Es=function(Ir){for(var Br={},kr=0;kr<Ir.length;kr++)Br[Ir[kr].toUpperCase()]=Ir[kr];return Br},Ws=function(Ir,Br){return typeof Ir===dt?Xt(Br).indexOf(Xt(Ir))!==-1:!1},Xt=function(Ir){return Ir.toLowerCase()},er=function(Ir){return typeof Ir===dt?Ir.replace(/[^\d\.]/g,ot).split(".")[0]:st},sr=function(Ir,Br){if(typeof Ir===dt)return Ir=Ir.replace(/^\s\s*/,ot),typeof Br===ut?Ir:Ir.substring(0,Pt)},br=function(Ir,Br){for(var kr=0,Wr,bs,ps,zr,$r,Ls;kr<Br.length&&!$r;){var Zo=Br[kr],Pl=Br[kr+1];for(Wr=bs=0;Wr<Zo.length&&!$r&&Zo[Wr];)if($r=Zo[Wr++].exec(Ir),$r)for(ps=0;ps<Pl.length;ps++)Ls=$r[++bs],zr=Pl[ps],typeof zr===ct&&zr.length>0?zr.length===2?typeof zr[1]==lt?this[zr[0]]=zr[1].call(this,Ls):this[zr[0]]=zr[1]:zr.length===3?typeof zr[1]===lt&&!(zr[1].exec&&zr[1].test)?this[zr[0]]=Ls?zr[1].call(this,Ls,zr[2]):st:this[zr[0]]=Ls?Ls.replace(zr[1],zr[2]):st:zr.length===4&&(this[zr[0]]=Ls?zr[3].call(this,Ls.replace(zr[1],zr[2])):st):this[zr]=Ls||st;kr+=2}},gr=function(Ir,Br){for(var kr in Br)if(typeof Br[kr]===ct&&Br[kr].length>0){for(var Wr=0;Wr<Br[kr].length;Wr++)if(Ws(Br[kr][Wr],Ir))return kr===at?st:kr}else if(Ws(Br[kr],Ir))return kr===at?st:kr;return Br.hasOwnProperty("*")?Br["*"]:Ir},vr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Tr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Lr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[Et,[xt,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[Et,[xt,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[xt,Et],[/opios[\/ ]+([\w\.]+)/i],[Et,[xt,ur+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,ur+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,ur]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[Et,[xt,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[Et,[xt,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[xt,Et],[/quark(?:pc)?\/([-\w\.]+)/i],[Et,[xt,"Quark"]],[/\bddg\/([\w\.]+)/i],[Et,[xt,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[Et,[xt,"UC"+Lt]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[Et,[xt,"WeChat"]],[/konqueror\/([\w\.]+)/i],[Et,[xt,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[Et,[xt,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[Et,[xt,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[Et,[xt,"Smart Lenovo "+Lt]],[/(avast|avg)\/([\w\.]+)/i],[[xt,/(.+)/,"$1 Secure "+Lt],Et],[/\bfocus\/([\w\.]+)/i],[Et,[xt,Ft+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,ur+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,ur+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+os]],[/fxios\/([\w\.-]+)/i],[Et,[xt,Ft]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+os],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,yr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[Et,[xt,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[xt,"Sogou Mobile"],Et],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[xt,Et],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[xt],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[Et,xt],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[xt,Ar],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[xt,Et],[/\bgsa\/([\w\.]+) .*safari\//i],[Et,[xt,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[Et,[xt,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[Et,[xt,kt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[xt,kt+" WebView"],Et],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Et,[xt,"Android "+Lt]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[xt,Et],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[Et,[xt,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[Et,xt],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[xt,[Et,gr,vr]],[/(webkit|khtml)\/([\w\.]+)/i],[xt,Et],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[xt,"Netscape"],Et],[/(wolvic|librewolf)\/([\w\.]+)/i],[xt,Et],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[Et,[xt,Ft+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[bt,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[bt,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[bt,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[bt,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[bt,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[bt,/ower/,ot,Xt]],[/ sun4\w[;\)]/i],[[bt,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[bt,Xt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[ft,[yt,yr],[vt,Rt]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[ft,[yt,yr],[vt,St]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[ft,[yt,Ut],[vt,St]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[ft,[yt,Ut],[vt,Rt]],[/(macintosh);/i],[ft,[yt,Ut]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[ft,[yt,or],[vt,St]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[ft,[yt,Mt],[vt,Rt]],[/honor([-\w ]+)[;\)]/i],[ft,[yt,Mt],[vt,St]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[ft,[yt,Vt],[vt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[ft,[yt,Vt],[vt,St]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[ft,/_/g," "],[yt,pr],[vt,Rt]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[ft,/_/g," "],[yt,pr],[vt,St]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[ft,[yt,mr],[vt,St]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[ft,[yt,gr,{OnePlus:["304","403","203"],"*":mr}],[vt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[ft,[yt,"Vivo"],[vt,St]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[ft,[yt,"Realme"],[vt,St]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[ft,[yt,Yt],[vt,St]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[ft,[yt,Yt],[vt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[ft,[yt,qt],[vt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[ft,[yt,qt],[vt,St]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[ft,[yt,Bt],[vt,Rt]],[/(nokia) (t[12][01])/i],[yt,ft,[vt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[ft,/_/g," "],[vt,St],[yt,"Nokia"]],[/(pixel (c|tablet))\b/i],[ft,[yt,Gt],[vt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[ft,[yt,Gt],[vt,St]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[ft,[yt,hr],[vt,St]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[ft,"Xperia Tablet"],[yt,hr],[vt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[ft,[yt,lr],[vt,St]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[ft,[yt,Ot],[vt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[ft,/(.+)/g,"Fire Phone $1"],[yt,Ot],[vt,St]],[/(playbook);[-\w\),; ]+(rim)/i],[ft,yt,[vt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[ft,[yt,Ht],[vt,St]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[ft,[yt,Nt],[vt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[ft,[yt,Nt],[vt,St]],[/(nexus 9)/i],[ft,[yt,"HTC"],[vt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[yt,[ft,/_/g," "],[vt,St]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[ft,[yt,"TCL"],[vt,Rt]],[/(itel) ((\w+))/i],[[yt,Xt],ft,[vt,gr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[ft,[yt,"Acer"],[vt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[ft,[yt,"Meizu"],[vt,St]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[ft,[yt,"Ulefone"],[vt,St]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[ft,[yt,"Energizer"],[vt,St]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[ft,[yt,"Cat"],[vt,St]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[ft,[yt,"Smartfren"],[vt,St]],[/droid.+; (a(?:015|06[35]|142p?))/i],[ft,[yt,"Nothing"],[vt,St]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[ft,[yt,"Archos"],[vt,Rt]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[ft,[yt,"Archos"],[vt,St]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[yt,ft,[vt,Rt]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[yt,ft,[vt,St]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[yt,ft,[vt,Rt]],[/(surface duo)/i],[ft,[yt,Qt],[vt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[ft,[yt,"Fairphone"],[vt,St]],[/(u304aa)/i],[ft,[yt,"AT&T"],[vt,St]],[/\bsie-(\w*)/i],[ft,[yt,"Siemens"],[vt,St]],[/\b(rct\w+) b/i],[ft,[yt,"RCA"],[vt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[ft,[yt,"Dell"],[vt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[ft,[yt,"Verizon"],[vt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[ft,[yt,"Barnes & Noble"],[vt,Rt]],[/\b(tm\d{3}\w+) b/i],[ft,[yt,"NuVision"],[vt,Rt]],[/\b(k88) b/i],[ft,[yt,"ZTE"],[vt,Rt]],[/\b(nx\d{3}j) b/i],[ft,[yt,"ZTE"],[vt,St]],[/\b(gen\d{3}) b.+49h/i],[ft,[yt,"Swiss"],[vt,St]],[/\b(zur\d{3}) b/i],[ft,[yt,"Swiss"],[vt,Rt]],[/\b((zeki)?tb.*\b) b/i],[ft,[yt,"Zeki"],[vt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[yt,"Dragon Touch"],ft,[vt,Rt]],[/\b(ns-?\w{0,9}) b/i],[ft,[yt,"Insignia"],[vt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[ft,[yt,"NextBook"],[vt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[yt,"Voice"],ft,[vt,St]],[/\b(lvtel\-)?(v1[12]) b/i],[[yt,"LvTel"],ft,[vt,St]],[/\b(ph-1) /i],[ft,[yt,"Essential"],[vt,St]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[ft,[yt,"Envizen"],[vt,Rt]],[/\b(trio[-\w\. ]+) b/i],[ft,[yt,"MachSpeed"],[vt,Rt]],[/\btu_(1491) b/i],[ft,[yt,"Rotor"],[vt,Rt]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[ft,[yt,tr],[vt,Rt]],[/(sprint) (\w+)/i],[yt,ft,[vt,St]],[/(kin\.[onetw]{3})/i],[[ft,/\./g," "],[yt,Qt],[vt,St]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[ft,[yt,_r],[vt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[ft,[yt,_r],[vt,St]],[/smart-tv.+(samsung)/i],[yt,[vt,Ct]],[/hbbtv.+maple;(\d+)/i],[[ft,/^/,"SmartTV"],[yt,yr],[vt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[yt,qt],[vt,Ct]],[/(apple) ?tv/i],[yt,[ft,Ut+" TV"],[vt,Ct]],[/crkey/i],[[ft,kt+"cast"],[yt,Gt],[vt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[ft,[yt,Ot],[vt,Ct]],[/(shield \w+ tv)/i],[ft,[yt,tr],[vt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[ft,[yt,or],[vt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[ft,[yt,hr],[vt,Ct]],[/(mi(tv|box)-?\w+) bui/i],[ft,[yt,pr],[vt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[yt,ft,[vt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[yt,sr],[ft,sr],[vt,Ct]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[ft,[vt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[vt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[yt,ft,[vt,wt]],[/droid.+; (shield)( bui|\))/i],[ft,[yt,tr],[vt,wt]],[/(playstation \w+)/i],[ft,[yt,hr],[vt,wt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[ft,[yt,Qt],[vt,wt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[ft,[yt,yr],[vt,It]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[yt,ft,[vt,It]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[ft,[yt,mr],[vt,It]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[ft,[yt,Ut],[vt,It]],[/(opwwe\d{3})/i],[ft,[yt,lr],[vt,It]],[/(moto 360)/i],[ft,[yt,Yt],[vt,It]],[/(smartwatch 3)/i],[ft,[yt,hr],[vt,It]],[/(g watch r)/i],[ft,[yt,qt],[vt,It]],[/droid.+; (wt63?0{2,3})\)/i],[ft,[yt,_r],[vt,It]],[/droid.+; (glass) \d/i],[ft,[yt,Gt],[vt,It]],[/(pico) (4|neo3(?: link|pro)?)/i],[yt,ft,[vt,It]],[/; (quest( \d| pro)?)/i],[ft,[yt,Ar],[vt,It]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[yt,[vt,jt]],[/(aeobc)\b/i],[ft,[yt,Ot],[vt,jt]],[/(homepod).+mac os/i],[ft,[yt,Ut],[vt,jt]],[/windows iot/i],[[vt,jt]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[ft,[vt,St]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[ft,[vt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[vt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[vt,St]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[ft,[yt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,$t+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[xt,Et],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[Et,[xt,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[xt,Et],[/ladybird\//i],[[xt,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,gr,Tr]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,gr,Tr],[xt,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[Et,/_/g,"."],[xt,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[xt,Ur],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(ubuntu) ([\w\.]+) like android/i],[[xt,/(.+)/,"$1 Touch"],Et],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ht]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,Ft+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[Et,[xt,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[Et,[xt,"watchOS"]],[/crkey\/([\d\.]+)/i],[Et,[xt,kt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[xt,Hr],Et],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[xt,Et],[/(sunos) ?([\w\.\d]*)/i],[[xt,"Solaris"],Et],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[xt,Et]]},Dr=function(Ir,Br){if(typeof Ir===ct&&(Br=Ir,Ir=st),!(this instanceof Dr))return new Dr(Ir,Br).getResult();var kr=typeof rt!==ut&&rt.navigator?rt.navigator:st,Wr=Ir||(kr&&kr.userAgent?kr.userAgent:ot),bs=kr&&kr.userAgentData?kr.userAgentData:st,ps=Br?Gs(Lr,Br):Lr,zr=kr&&kr.userAgent==Wr;return this.getBrowser=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.browser),$r[ht]=er($r[Et]),zr&&kr&&kr.brave&&typeof kr.brave.isBrave==lt&&($r[xt]="Brave"),$r},this.getCPU=function(){var $r={};return $r[bt]=st,br.call($r,Wr,ps.cpu),$r},this.getDevice=function(){var $r={};return $r[yt]=st,$r[ft]=st,$r[vt]=st,br.call($r,Wr,ps.device),zr&&!$r[vt]&&bs&&bs.mobile&&($r[vt]=St),zr&&$r[ft]=="Macintosh"&&kr&&typeof kr.standalone!==ut&&kr.maxTouchPoints&&kr.maxTouchPoints>2&&($r[ft]="iPad",$r[vt]=Rt),$r},this.getEngine=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.engine),$r},this.getOS=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.os),zr&&!$r[xt]&&bs&&bs.platform&&bs.platform!="Unknown"&&($r[xt]=bs.platform.replace(/chrome os/i,Hr).replace(/macos/i,Ur)),$r},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Wr},this.setUA=function($r){return Wr=typeof $r===dt&&$r.length>Pt?sr($r,Pt):$r,this},this.setUA(Wr),this};Dr.VERSION=nt,Dr.BROWSER=Es([xt,Et,ht]),Dr.CPU=Es([bt]),Dr.DEVICE=Es([ft,yt,vt,wt,St,Ct,Rt,It,jt]),Dr.ENGINE=Dr.OS=Es([xt,Et]),tt.exports&&(et=tt.exports=Dr),et.UAParser=Dr;var Zr=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(Zr&&!Zr.ua){var ks=new Dr;Zr.ua=ks.getResult(),Zr.ua.get=function(){return ks.getUA()},Zr.ua.set=function(Ir){ks.setUA(Ir);var Br=ks.getResult();for(var kr in Br)Zr.ua[kr]=Br[kr]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);function useBrowserInfo(tt){var et,rt,st;const nt=new UAParser(tt),ot=nt.getOS(),at=nt.getDevice(),lt=nt.getBrowser(),ut=((et=at.model)==null?void 0:et.indexOf("iPhone"))!=-1,ct=((rt=at.model)==null?void 0:rt.indexOf("iPod"))!=-1,dt=((st=at.model)==null?void 0:st.indexOf("iPad"))!=-1;return{os:ot,device:at,browser:lt,isIphone:ut,isIpod:ct,isIpad:dt}}function useHasWorkflow(tt){const[et,rt]=reactExports.useState();return reactExports.useEffect(()=>{(async()=>{let st;typeof tt=="string"?st=await odeServices.rights().sessionHasWorkflowRight(tt):st=await odeServices.rights().sessionHasWorkflowRights(tt),rt(st)})()},[tt]),et}function useCantoo(){const tt=useHasWorkflow("org.entcore.portal.controllers.PortalController|optionalFeatureCantoo");return reactExports.useEffect(()=>{tt&&!document.getElementById("cantoo-edifice-script")&&(async()=>{const et=await odeServices.http().get("/optionalFeature/cantoo");if(et&&et.scriptPath){const rt=document.createElement("script");rt.id="cantoo-edifice-script",rt.src=et.scriptPath,rt.async=!0,document.body.appendChild(rt)}})()},[tt]),null}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(tt){return this.listeners.add(tt),this.onSubscribe(),()=>{this.listeners.delete(tt),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$1(){}function functionalUpdate(tt,et){return typeof tt=="function"?tt(et):tt}function isValidTimeout(tt){return typeof tt=="number"&&tt>=0&&tt!==1/0}function timeUntilStale(tt,et){return Math.max(tt+(et||0)-Date.now(),0)}function resolveStaleTime(tt,et){return typeof tt=="function"?tt(et):tt}function resolveEnabled(tt,et){return typeof tt=="function"?tt(et):tt}function matchQuery(tt,et){const{type:rt="all",exact:st,fetchStatus:nt,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(st){if(et.queryHash!==hashQueryKeyByOptions(at,et.options))return!1}else if(!partialMatchKey(et.queryKey,at))return!1}if(rt!=="all"){const ut=et.isActive();if(rt==="active"&&!ut||rt==="inactive"&&ut)return!1}return!(typeof lt=="boolean"&&et.isStale()!==lt||nt&&nt!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:st,predicate:nt,mutationKey:ot}=tt;if(ot){if(!et.options.mutationKey)return!1;if(rt){if(hashKey(et.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(et.options.mutationKey,ot))return!1}return!(st&&et.state.status!==st||nt&&!nt(et))}function hashQueryKeyByOptions(tt,et){return((et==null?void 0:et.queryKeyHashFn)||hashKey)(tt)}function hashKey(tt){return JSON.stringify(tt,(et,rt)=>isPlainObject$1(rt)?Object.keys(rt).sort().reduce((st,nt)=>(st[nt]=rt[nt],st),{}):rt)}function partialMatchKey(tt,et){return tt===et?!0:typeof tt!=typeof et?!1:tt&&et&&typeof tt=="object"&&typeof et=="object"?!Object.keys(et).some(rt=>!partialMatchKey(tt[rt],et[rt])):!1}function replaceEqualDeep(tt,et){if(tt===et)return tt;const rt=isPlainArray(tt)&&isPlainArray(et);if(rt||isPlainObject$1(tt)&&isPlainObject$1(et)){const st=rt?tt:Object.keys(tt),nt=st.length,ot=rt?et:Object.keys(et),at=ot.length,lt=rt?[]:{};let ut=0;for(let ct=0;ct<at;ct++){const dt=rt?ct:ot[ct];(!rt&&st.includes(dt)||rt)&&tt[dt]===void 0&&et[dt]===void 0?(lt[dt]=void 0,ut++):(lt[dt]=replaceEqualDeep(tt[dt],et[dt]),lt[dt]===tt[dt]&&tt[dt]!==void 0&&ut++)}return nt===at&&ut===nt?tt:lt}return et}function shallowEqualObjects(tt,et){if(!et||Object.keys(tt).length!==Object.keys(et).length)return!1;for(const rt in tt)if(tt[rt]!==et[rt])return!1;return!0}function isPlainArray(tt){return Array.isArray(tt)&&tt.length===Object.keys(tt).length}function isPlainObject$1(tt){if(!hasObjectPrototype(tt))return!1;const et=tt.constructor;if(et===void 0)return!0;const rt=et.prototype;return!(!hasObjectPrototype(rt)||!rt.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(tt)!==Object.prototype)}function hasObjectPrototype(tt){return Object.prototype.toString.call(tt)==="[object Object]"}function sleep(tt){return new Promise(et=>{setTimeout(et,tt)})}function replaceData(tt,et,rt){return typeof rt.structuralSharing=="function"?rt.structuralSharing(tt,et):rt.structuralSharing!==!1?replaceEqualDeep(tt,et):et}function addToEnd(tt,et,rt=0){const st=[...tt,et];return rt&&st.length>rt?st.slice(1):st}function addToStart(tt,et,rt=0){const st=[et,...tt];return rt&&st.length>rt?st.slice(0,-1):st}var skipToken=Symbol();function ensureQueryFn(tt,et){return!tt.queryFn&&(et!=null&&et.initialPromise)?()=>et.initialPromise:!tt.queryFn||tt.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${tt.queryHash}'`)):tt.queryFn}var wl,Ho,Zl,Wp,FocusManager=(Wp=class extends Subscribable{constructor(){super();Or(this,wl);Or(this,Ho);Or(this,Zl);Sr(this,Zl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Ho)||this.setEventListener(Kt(this,Zl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Ho))==null||et.call(this),Sr(this,Ho,void 0))}setEventListener(et){var rt;Sr(this,Zl,et),(rt=Kt(this,Ho))==null||rt.call(this),Sr(this,Ho,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,wl)!==et&&(Sr(this,wl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,wl)=="boolean"?Kt(this,wl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},wl=new WeakMap,Ho=new WeakMap,Zl=new WeakMap,Wp),focusManager=new FocusManager,Jl,Vo,eu,qp,OnlineManager=(qp=class extends Subscribable{constructor(){super();Or(this,Jl,!0);Or(this,Vo);Or(this,eu);Sr(this,eu,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),st=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",st,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",st)}}})}onSubscribe(){Kt(this,Vo)||this.setEventListener(Kt(this,eu))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Vo))==null||et.call(this),Sr(this,Vo,void 0))}setEventListener(et){var rt;Sr(this,eu,et),(rt=Kt(this,Vo))==null||rt.call(this),Sr(this,Vo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Jl)!==et&&(Sr(this,Jl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Jl)}},Jl=new WeakMap,Vo=new WeakMap,eu=new WeakMap,qp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((nt,ot)=>{tt=nt,et=ot});rt.status="pending",rt.catch(()=>{});function st(nt){Object.assign(rt,nt),delete rt.resolve,delete rt.reject}return rt.resolve=nt=>{st({status:"fulfilled",value:nt}),tt(nt)},rt.reject=nt=>{st({status:"rejected",reason:nt}),et(nt)},rt}function defaultRetryDelay(tt){return Math.min(1e3*2**tt,3e4)}function canFetch(tt){return(tt??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(tt){super("CancelledError"),this.revert=tt==null?void 0:tt.revert,this.silent=tt==null?void 0:tt.silent}};function isCancelledError(tt){return tt instanceof CancelledError}function createRetryer(tt){let et=!1,rt=0,st=!1,nt;const ot=pendingThenable(),at=yt=>{var Et;st||(ft(new CancelledError(yt)),(Et=tt.abort)==null||Et.call(tt))},lt=()=>{et=!0},ut=()=>{et=!1},ct=()=>focusManager.isFocused()&&(tt.networkMode==="always"||onlineManager.isOnline())&&tt.canRun(),dt=()=>canFetch(tt.networkMode)&&tt.canRun(),ht=yt=>{var Et;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,yt),nt==null||nt(),ot.resolve(yt))},ft=yt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,yt),nt==null||nt(),ot.reject(yt))},xt=()=>new Promise(yt=>{var Et;nt=bt=>{(st||ct())&&yt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var yt;nt=void 0,st||(yt=tt.onContinue)==null||yt.call(tt)}),vt=()=>{if(st)return;let yt;const Et=rt===0?tt.initialPromise:void 0;try{yt=Et??tt.fn()}catch(bt){yt=Promise.reject(bt)}Promise.resolve(yt).then(ht).catch(bt=>{var It;if(st)return;const wt=tt.retry??(isServer?0:3),St=tt.retryDelay??defaultRetryDelay,Rt=typeof St=="function"?St(rt,bt):St,Ct=wt===!0||typeof wt=="number"&&rt<wt||typeof wt=="function"&&wt(rt,bt);if(et||!Ct){ft(bt);return}rt++,(It=tt.onFail)==null||It.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(bt):vt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?vt():xt().then(vt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},st=lt=>{lt()},nt=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):nt(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&nt(()=>{st(()=>{lt.forEach(ut=>{rt(ut)})})})};return{batch:lt=>{let ut;et++;try{ut=lt()}finally{et--,et||at()}return ut},batchCalls:lt=>(...ut)=>{ot(()=>{lt(...ut)})},schedule:ot,setNotifyFunction:lt=>{rt=lt},setBatchNotifyFunction:lt=>{st=lt},setScheduler:lt=>{nt=lt}}}var notifyManager=createNotifyManager(),Sl,Xp,Removable=(Xp=class{constructor(){Or(this,Sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Sr(this,Sl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,Sl)&&(clearTimeout(Kt(this,Sl)),Sr(this,Sl,void 0))}},Sl=new WeakMap,Xp),tu,ru,qn,js,Lu,_l,eo,Co,Yp,Query=(Yp=class extends Removable{constructor(et){super();Or(this,eo);Or(this,tu);Or(this,ru);Or(this,qn);Or(this,js);Or(this,Lu);Or(this,_l);Sr(this,_l,!1),Sr(this,Lu,et.defaultOptions),this.setOptions(et.options),this.observers=[],Sr(this,qn,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Sr(this,tu,getDefaultState$1(this.options)),this.state=et.state??Kt(this,tu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,js))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Lu),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,qn).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Fr(this,eo,Co).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Fr(this,eo,Co).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,js))==null?void 0:st.promise;return(nt=Kt(this,js))==null||nt.cancel(et),rt?rt.then(noop$1).catch(noop$1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,tu))}isActive(){return this.observers.some(et=>resolveEnabled(et.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(et=>et.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(et=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,et)}onFocus(){var rt;const et=this.observers.find(st=>st.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,qn).notify({type:"observerAdded",query:this,observer:et}))}removeObserver(et){this.observers.includes(et)&&(this.observers=this.observers.filter(rt=>rt!==et),this.observers.length||(Kt(this,js)&&(Kt(this,_l)?Kt(this,js).cancel({revert:!0}):Kt(this,js).cancelRetry()),this.scheduleGc()),Kt(this,qn).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fr(this,eo,Co).call(this,{type:"invalidate"})}fetch(et,rt){var ut,ct,dt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(rt!=null&&rt.cancelRefetch))this.cancel({silent:!0});else if(Kt(this,js))return Kt(this,js).continueRetry(),Kt(this,js).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(ft=>ft.options.queryFn);ht&&this.setOptions(ht.options)}const st=new AbortController,nt=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Sr(this,_l,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Sr(this,_l,!1),this.options.persister?this.options.persister(ht,ft,this):ht(ft)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Sr(this,ru,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Fr(this,eo,Co).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,vt,yt;isCancelledError(ht)&&ht.silent||Fr(this,eo,Co).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,qn).config).onError)==null||xt.call(ft,ht,this),(yt=(vt=Kt(this,qn).config).onSettled)==null||yt.call(vt,this.state.data,ht,this)),this.scheduleGc()};return Sr(this,js,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,xt,vt,yt;if(ht===void 0){lt(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(ht)}catch(Et){lt(Et);return}(xt=(ft=Kt(this,qn).config).onSuccess)==null||xt.call(ft,ht,this),(yt=(vt=Kt(this,qn).config).onSettled)==null||yt.call(vt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Fr(this,eo,Co).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Fr(this,eo,Co).call(this,{type:"pause"})},onContinue:()=>{Fr(this,eo,Co).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,js).start()}},tu=new WeakMap,ru=new WeakMap,qn=new WeakMap,js=new WeakMap,Lu=new WeakMap,_l=new WeakMap,eo=new WeakSet,Co=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...st,fetchStatus:"paused"};case"continue":return{...st,fetchStatus:"fetching"};case"fetch":return{...st,...fetchState(st.data,this.options),fetchMeta:et.meta??null};case"success":return{...st,data:et.data,dataUpdateCount:st.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=et.error;return isCancelledError(nt)&&nt.revert&&Kt(this,ru)?{...Kt(this,ru),fetchStatus:"idle"}:{...st,error:nt,errorUpdateCount:st.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:st.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...st,isInvalidated:!0};case"setState":return{...st,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(st=>{st.onQueryUpdate()}),Kt(this,qn).notify({query:this,type:"updated",action:et})})},Yp);function fetchState(tt,et){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(et.networkMode)?"fetching":"paused",...tt===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(tt){const et=typeof tt.initialData=="function"?tt.initialData():tt.initialData,rt=et!==void 0,st=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?st??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var xo,Kp,QueryCache=(Kp=class extends Subscribable{constructor(et={}){super();Or(this,xo);this.config=et,Sr(this,xo,new Map)}build(et,rt,st){const nt=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(nt,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:nt,queryHash:ot,options:et.defaultQueryOptions(rt),state:st,defaultOptions:et.getQueryDefaults(nt)}),this.add(at)),at}add(et){Kt(this,xo).has(et.queryHash)||(Kt(this,xo).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,xo).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,xo).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,xo).get(et)}getAll(){return[...Kt(this,xo).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchQuery(rt,st))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(st=>matchQuery(et,st)):rt}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onOnline()})})}},xo=new WeakMap,Kp),vo,Os,Rl,yo,Uo,Qp,Mutation=(Qp=class extends Removable{constructor(et){super();Or(this,yo);Or(this,vo);Or(this,Os);Or(this,Rl);this.mutationId=et.mutationId,Sr(this,Os,et.mutationCache),Sr(this,vo,[]),this.state=et.state||getDefaultState(),this.setOptions(et.options),this.scheduleGc()}setOptions(et){this.options=et,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(et){Kt(this,vo).includes(et)||(Kt(this,vo).push(et),this.clearGcTimeout(),Kt(this,Os).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Sr(this,vo,Kt(this,vo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,Os).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,vo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,Os).remove(this))}continue(){var et;return((et=Kt(this,Rl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,vt,yt,Et,bt,wt,St,Rt,Ct,It,jt;Sr(this,Rl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(Pt,Ot)=>{Fr(this,yo,Uo).call(this,{type:"failed",failureCount:Pt,error:Ot})},onPause:()=>{Fr(this,yo,Uo).call(this,{type:"pause"})},onContinue:()=>{Fr(this,yo,Uo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,Os).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,Rl).canStart();try{if(!rt){Fr(this,yo,Uo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,Os).config).onMutate)==null?void 0:ot.call(nt,et,this));const Ot=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Ot!==this.state.context&&Fr(this,yo,Uo).call(this,{type:"pending",context:Ot,variables:et,isPaused:st})}const Pt=await Kt(this,Rl).start();return await((ct=(ut=Kt(this,Os).config).onSuccess)==null?void 0:ct.call(ut,Pt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,Pt,et,this.state.context)),await((xt=(ft=Kt(this,Os).config).onSettled)==null?void 0:xt.call(ft,Pt,null,this.state.variables,this.state.context,this)),await((yt=(vt=this.options).onSettled)==null?void 0:yt.call(vt,Pt,null,et,this.state.context)),Fr(this,yo,Uo).call(this,{type:"success",data:Pt}),Pt}catch(Pt){try{throw await((bt=(Et=Kt(this,Os).config).onError)==null?void 0:bt.call(Et,Pt,et,this.state.context,this)),await((St=(wt=this.options).onError)==null?void 0:St.call(wt,Pt,et,this.state.context)),await((Ct=(Rt=Kt(this,Os).config).onSettled)==null?void 0:Ct.call(Rt,void 0,Pt,this.state.variables,this.state.context,this)),await((jt=(It=this.options).onSettled)==null?void 0:jt.call(It,void 0,Pt,et,this.state.context)),Pt}finally{Fr(this,yo,Uo).call(this,{type:"error",error:Pt})}}finally{Kt(this,Os).runNext(this)}}},vo=new WeakMap,Os=new WeakMap,Rl=new WeakMap,yo=new WeakSet,Uo=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...st,isPaused:!0};case"continue":return{...st,isPaused:!1};case"pending":return{...st,context:et.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:et.isPaused,status:"pending",variables:et.variables,submittedAt:Date.now()};case"success":return{...st,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...st,data:void 0,error:et.error,failureCount:st.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,vo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,Os).notify({mutation:this,type:"updated",action:et})})},Qp);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Js,Nu,Zp,MutationCache=(Zp=class extends Subscribable{constructor(et={}){super();Or(this,Js);Or(this,Nu);this.config=et,Sr(this,Js,new Map),Sr(this,Nu,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++A1(this,Nu)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Js).get(rt)??[];st.push(et),Kt(this,Js).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Js).has(rt)){const nt=(st=Kt(this,Js).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Js).delete(rt):Kt(this,Js).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Js).get(scopeFor(et)))==null?void 0:st.find(nt=>nt.state.status==="pending");return!rt||rt===et}runNext(et){var st;const rt=(st=Kt(this,Js).get(scopeFor(et)))==null?void 0:st.find(nt=>nt!==et&&nt.state.isPaused);return(rt==null?void 0:rt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}getAll(){return[...Kt(this,Js).values()].flat()}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchMutation(rt,st))}findAll(et={}){return this.getAll().filter(rt=>matchMutation(et,rt))}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}resumePausedMutations(){const et=this.getAll().filter(rt=>rt.state.isPaused);return notifyManager.batch(()=>Promise.all(et.map(rt=>rt.continue().catch(noop$1))))}},Js=new WeakMap,Nu=new WeakMap,Zp);function scopeFor(tt){var et;return((et=tt.options.scope)==null?void 0:et.id)??String(tt.mutationId)}function infiniteQueryBehavior(tt){return{onFetch:(et,rt)=>{var dt,ht,ft,xt,vt;const st=et.options,nt=(ft=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:ft.direction,ot=((xt=et.state.data)==null?void 0:xt.pages)||[],at=((vt=et.state.data)==null?void 0:vt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let yt=!1;const Et=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?yt=!0:et.signal.addEventListener("abort",()=>{yt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),wt=async(St,Rt,Ct)=>{if(yt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const It={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(It);const jt=await bt(It),{maxPages:Pt}=et.options,Ot=Ct?addToStart:addToEnd;return{pages:Ot(St.pages,jt,Pt),pageParams:Ot(St.pageParams,Rt,Pt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},It=Rt(st,Ct);lt=await wt(Ct,It,St)}else{const St=tt??ot.length;do{const Rt=ut===0?at[0]??st.initialPageParam:getNextPageParam(st,lt);if(ut>0&&Rt==null)break;lt=await wt(lt,Rt),ut++}while(ut<St)}return lt};et.options.persister?et.fetchFn=()=>{var yt,Et;return(Et=(yt=et.options).persister)==null?void 0:Et.call(yt,ct,{queryKey:et.queryKey,meta:et.options.meta,signal:et.signal},rt)}:et.fetchFn=ct}}}function getNextPageParam(tt,{pages:et,pageParams:rt}){const st=et.length-1;return et.length>0?tt.getNextPageParam(et[st],et,rt[st],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var st;return et.length>0?(st=tt.getPreviousPageParam)==null?void 0:st.call(tt,et[0],et,rt[0],rt):void 0}function hasNextPage(tt,et){return et?getNextPageParam(tt,et)!=null:!1}function hasPreviousPage(tt,et){return!et||!tt.getPreviousPageParam?!1:getPreviousPageParam(tt,et)!=null}var us,Go,Wo,su,nu,qo,iu,ou,Jp,QueryClient=(Jp=class{constructor(tt={}){Or(this,us);Or(this,Go);Or(this,Wo);Or(this,su);Or(this,nu);Or(this,qo);Or(this,iu);Or(this,ou);Sr(this,us,tt.queryCache||new QueryCache),Sr(this,Go,tt.mutationCache||new MutationCache),Sr(this,Wo,tt.defaultOptions||{}),Sr(this,su,new Map),Sr(this,nu,new Map),Sr(this,qo,0)}mount(){A1(this,qo)._++,Kt(this,qo)===1&&(Sr(this,iu,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onFocus())})),Sr(this,ou,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onOnline())})))}unmount(){var tt,et;A1(this,qo)._--,Kt(this,qo)===0&&((tt=Kt(this,iu))==null||tt.call(this),Sr(this,iu,void 0),(et=Kt(this,ou))==null||et.call(this),Sr(this,ou,void 0))}isFetching(tt){return Kt(this,us).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Go).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,us).build(this,et),st=rt.state.data;return st===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(st))}getQueriesData(tt){return Kt(this,us).findAll(tt).map(({queryKey:et,state:rt})=>{const st=rt.data;return[et,st]})}setQueryData(tt,et,rt){const st=this.defaultQueryOptions({queryKey:tt}),nt=Kt(this,us).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,us).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,us).findAll(tt).map(({queryKey:st})=>[st,this.setQueryData(st,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,us);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,us),st={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(nt=>{nt.reset()}),this.refetchQueries(st,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},st=notifyManager.batch(()=>Kt(this,us).findAll(tt).map(nt=>nt.cancel(rt)));return Promise.all(st).then(noop$1).catch(noop$1)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,us).findAll(tt).forEach(st=>{st.invalidate()}),(tt==null?void 0:tt.refetchType)==="none")return Promise.resolve();const rt={...tt,type:(tt==null?void 0:tt.refetchType)??(tt==null?void 0:tt.type)??"active"};return this.refetchQueries(rt,et)})}refetchQueries(tt,et={}){const rt={...et,cancelRefetch:et.cancelRefetch??!0},st=notifyManager.batch(()=>Kt(this,us).findAll(tt).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$1)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(st).then(noop$1)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,us).build(this,et);return rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))?rt.fetch(et):Promise.resolve(rt.state.data)}prefetchQuery(tt){return this.fetchQuery(tt).then(noop$1).catch(noop$1)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$1).catch(noop$1)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,Go).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,us)}getMutationCache(){return Kt(this,Go)}getDefaultOptions(){return Kt(this,Wo)}setDefaultOptions(tt){Sr(this,Wo,tt)}setQueryDefaults(tt,et){Kt(this,su).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,su).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,nu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,nu).values()];let rt={};return et.forEach(st=>{partialMatchKey(tt,st.mutationKey)&&(rt={...rt,...st.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Wo).queries,...this.getQueryDefaults(tt.queryKey),...tt,_defaulted:!0};return et.queryHash||(et.queryHash=hashQueryKeyByOptions(et.queryKey,et)),et.refetchOnReconnect===void 0&&(et.refetchOnReconnect=et.networkMode!=="always"),et.throwOnError===void 0&&(et.throwOnError=!!et.suspense),!et.networkMode&&et.persister&&(et.networkMode="offlineFirst"),et.queryFn===skipToken&&(et.enabled=!1),et}defaultMutationOptions(tt){return tt!=null&&tt._defaulted?tt:{...Kt(this,Wo).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,us).clear(),Kt(this,Go).clear()}},us=new WeakMap,Go=new WeakMap,Wo=new WeakMap,su=new WeakMap,nu=new WeakMap,qo=new WeakMap,iu=new WeakMap,ou=new WeakMap,Jp),Hs,Gr,Fu,Ds,Tl,au,Xo,Eo,Bu,lu,uu,Cl,Al,Yo,cu,Qr,Iu,Y0,K0,Q0,Z0,J0,_d,e2,nm,em,QueryObserver=(em=class extends Subscribable{constructor(et,rt){super();Or(this,Qr);Or(this,Hs);Or(this,Gr);Or(this,Fu);Or(this,Ds);Or(this,Tl);Or(this,au);Or(this,Xo);Or(this,Eo);Or(this,Bu);Or(this,lu);Or(this,uu);Or(this,Cl);Or(this,Al);Or(this,Yo);Or(this,cu,new Set);this.options=rt,Sr(this,Hs,et),Sr(this,Eo,null),Sr(this,Xo,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Xo).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(rt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Kt(this,Gr).addObserver(this),shouldFetchOnMount(Kt(this,Gr),this.options)?Fr(this,Qr,Iu).call(this):this.updateResult(),Fr(this,Qr,Z0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fr(this,Qr,J0).call(this),Fr(this,Qr,_d).call(this),Kt(this,Gr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Gr);if(this.options=Kt(this,Hs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Gr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fr(this,Qr,e2).call(this),Kt(this,Gr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Hs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Gr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Gr),nt,this.options,st)&&Fr(this,Qr,Iu).call(this),this.updateResult(rt),ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||resolveStaleTime(this.options.staleTime,Kt(this,Gr))!==resolveStaleTime(st.staleTime,Kt(this,Gr)))&&Fr(this,Qr,Y0).call(this);const at=Fr(this,Qr,K0).call(this);ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||at!==Kt(this,Yo))&&Fr(this,Qr,Q0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Sr(this,Ds,st),Sr(this,au,this.options),Sr(this,Tl,Kt(this,Gr).state)),st}getCurrentResult(){return Kt(this,Ds)}trackResult(et,rt){const st={};return Object.keys(et).forEach(nt=>{Object.defineProperty(st,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),rt==null||rt(nt),et[nt])})}),st}trackProp(et){Kt(this,cu).add(et)}getCurrentQuery(){return Kt(this,Gr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Hs).defaultQueryOptions(et),st=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Fr(this,Qr,Iu).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Ds)))}createResult(et,rt){var Pt;const st=Kt(this,Gr),nt=this.options,ot=Kt(this,Ds),at=Kt(this,Tl),lt=Kt(this,au),ct=et!==st?et.state:Kt(this,Fu),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const Ot=this.hasListeners(),Ut=!Ot&&shouldFetchOnMount(et,rt),Nt=Ot&&shouldFetchOptionally(et,st,rt,nt);(Ut||Nt)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:vt,errorUpdatedAt:yt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,Bu))xt=Kt(this,lu);else try{Sr(this,Bu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Sr(this,lu,xt),Sr(this,Eo,null)}catch(Ot){Sr(this,Eo,Ot)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Ot;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Ot=ot.data;else if(Ot=typeof rt.placeholderData=="function"?rt.placeholderData((Pt=Kt(this,uu))==null?void 0:Pt.state.data,Kt(this,uu)):rt.placeholderData,rt.select&&Ot!==void 0)try{Ot=rt.select(Ot),Sr(this,Eo,null)}catch(Ut){Sr(this,Eo,Ut)}Ot!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Ot,rt),ft=!0)}Kt(this,Eo)&&(vt=Kt(this,Eo),xt=Kt(this,lu),yt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",wt=Et==="pending",St=Et==="error",Rt=wt&&bt,Ct=xt!==void 0,jt={status:Et,fetchStatus:ht.fetchStatus,isPending:wt,isSuccess:Et==="success",isError:St,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:vt,errorUpdatedAt:yt,failureCount:ht.fetchFailureCount,failureReason:ht.fetchFailureReason,errorUpdateCount:ht.errorUpdateCount,isFetched:ht.dataUpdateCount>0||ht.errorUpdateCount>0,isFetchedAfterMount:ht.dataUpdateCount>ct.dataUpdateCount||ht.errorUpdateCount>ct.errorUpdateCount,isFetching:bt,isRefetching:bt&&!wt,isLoadingError:St&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:ft,isRefetchError:St&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Xo)};if(this.options.experimental_prefetchInRender){const Ot=Ht=>{jt.status==="error"?Ht.reject(jt.error):jt.data!==void 0&&Ht.resolve(jt.data)},Ut=()=>{const Ht=Sr(this,Xo,jt.promise=pendingThenable());Ot(Ht)},Nt=Kt(this,Xo);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&Ot(Nt);break;case"fulfilled":(jt.status==="error"||jt.data!==Nt.value)&&Ut();break;case"rejected":(jt.status!=="error"||jt.error!==Nt.reason)&&Ut();break}}return jt}updateResult(et){const rt=Kt(this,Ds),st=this.createResult(Kt(this,Gr),this.options);if(Sr(this,Tl,Kt(this,Gr).state),Sr(this,au,this.options),Kt(this,Tl).data!==void 0&&Sr(this,uu,Kt(this,Gr)),shallowEqualObjects(st,rt))return;Sr(this,Ds,st);const nt={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,cu).size)return!0;const ut=new Set(lt??Kt(this,cu));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Ds)).some(ct=>{const dt=ct;return Kt(this,Ds)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Fr(this,Qr,nm).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fr(this,Qr,Z0).call(this)}},Hs=new WeakMap,Gr=new WeakMap,Fu=new WeakMap,Ds=new WeakMap,Tl=new WeakMap,au=new WeakMap,Xo=new WeakMap,Eo=new WeakMap,Bu=new WeakMap,lu=new WeakMap,uu=new WeakMap,Cl=new WeakMap,Al=new WeakMap,Yo=new WeakMap,cu=new WeakMap,Qr=new WeakSet,Iu=function(et){Fr(this,Qr,e2).call(this);let rt=Kt(this,Gr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},Y0=function(){Fr(this,Qr,J0).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Gr));if(isServer||Kt(this,Ds).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Ds).dataUpdatedAt,et)+1;Sr(this,Cl,setTimeout(()=>{Kt(this,Ds).isStale||this.updateResult()},st))},K0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Gr)):this.options.refetchInterval)??!1},Q0=function(et){Fr(this,Qr,_d).call(this),Sr(this,Yo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Gr))===!1||!isValidTimeout(Kt(this,Yo))||Kt(this,Yo)===0)&&Sr(this,Al,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Fr(this,Qr,Iu).call(this)},Kt(this,Yo)))},Z0=function(){Fr(this,Qr,Y0).call(this),Fr(this,Qr,Q0).call(this,Fr(this,Qr,K0).call(this))},J0=function(){Kt(this,Cl)&&(clearTimeout(Kt(this,Cl)),Sr(this,Cl,void 0))},_d=function(){Kt(this,Al)&&(clearInterval(Kt(this,Al)),Sr(this,Al,void 0))},e2=function(){const et=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),this.options);if(et===Kt(this,Gr))return;const rt=Kt(this,Gr);Sr(this,Gr,et),Sr(this,Fu,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},nm=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,Ds))}),Kt(this,Hs).getQueryCache().notify({query:Kt(this,Gr),type:"observerResultsUpdated"})})},em);function shouldLoadOnMount(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.state.data===void 0&&!(tt.state.status==="error"&&et.retryOnMount===!1)}function shouldFetchOnMount(tt,et){return shouldLoadOnMount(tt,et)||tt.state.data!==void 0&&shouldFetchOn(tt,et,et.refetchOnMount)}function shouldFetchOn(tt,et,rt){if(resolveEnabled(et.enabled,tt)!==!1){const st=typeof rt=="function"?rt(tt):rt;return st==="always"||st!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,st){return(tt!==et||resolveEnabled(st.enabled,tt)===!1)&&(!rt.suspense||tt.state.status!=="error")&&isStale(tt,rt)}function isStale(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.isStaleByTime(resolveStaleTime(et.staleTime,tt))}function shouldAssignObserverCurrentProperties(tt,et){return!shallowEqualObjects(tt.getCurrentResult(),et)}var InfiniteQueryObserver=class extends QueryObserver{constructor(tt,et){super(tt,et)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(tt,et){super.setOptions({...tt,behavior:infiniteQueryBehavior()},et)}getOptimisticResult(tt){return tt.behavior=infiniteQueryBehavior(),super.getOptimisticResult(tt)}fetchNextPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"backward"}}})}createResult(tt,et){var vt,yt;const{state:rt}=tt,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(yt=(vt=rt.fetchMeta)==null?void 0:vt.fetchMore)==null?void 0:yt.direction,ct=at&&ut==="forward",dt=nt&&ut==="forward",ht=at&&ut==="backward",ft=nt&&ut==="backward";return{...st,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:ft,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!ft}}},Ko,Qo,Vs,Po,jo,P1,t2,tm,MutationObserver$1=(tm=class extends Subscribable{constructor(rt,st){super();Or(this,jo);Or(this,Ko);Or(this,Qo);Or(this,Vs);Or(this,Po);Sr(this,Ko,rt),this.setOptions(st),this.bindMethods(),Fr(this,jo,P1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var nt;const st=this.options;this.options=Kt(this,Ko).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,Ko).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,Vs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,Vs))==null?void 0:nt.state.status)==="pending"&&Kt(this,Vs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,Vs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Fr(this,jo,P1).call(this),Fr(this,jo,t2).call(this,rt)}getCurrentResult(){return Kt(this,Qo)}reset(){var rt;(rt=Kt(this,Vs))==null||rt.removeObserver(this),Sr(this,Vs,void 0),Fr(this,jo,P1).call(this),Fr(this,jo,t2).call(this)}mutate(rt,st){var nt;return Sr(this,Po,st),(nt=Kt(this,Vs))==null||nt.removeObserver(this),Sr(this,Vs,Kt(this,Ko).getMutationCache().build(Kt(this,Ko),this.options)),Kt(this,Vs).addObserver(this),Kt(this,Vs).execute(rt)}},Ko=new WeakMap,Qo=new WeakMap,Vs=new WeakMap,Po=new WeakMap,jo=new WeakSet,P1=function(){var st;const rt=((st=Kt(this,Vs))==null?void 0:st.state)??getDefaultState();Sr(this,Qo,{...rt,isPending:rt.status==="pending",isSuccess:rt.status==="success",isError:rt.status==="error",isIdle:rt.status==="idle",mutate:this.mutate,reset:this.reset})},t2=function(rt){notifyManager.batch(()=>{var st,nt,ot,at,lt,ut,ct,dt;if(Kt(this,Po)&&this.hasListeners()){const ht=Kt(this,Qo).variables,ft=Kt(this,Qo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,Po)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,Po)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,Po)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,Po)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}this.listeners.forEach(ht=>{ht(Kt(this,Qo))})})},tm),QueryClientContext=reactExports.createContext(void 0),useQueryClient=tt=>{const et=reactExports.useContext(QueryClientContext);if(!et)throw new Error("No QueryClient set, use QueryClientProvider to set one");return et},QueryClientProvider=({client:tt,children:et})=>(reactExports.useEffect(()=>(tt.mount(),()=>{tt.unmount()}),[tt]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:tt,children:et})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let tt=!1;return{clearReset:()=>{tt=!1},reset:()=>{tt=!0},isReset:()=>tt}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(tt,et){return typeof tt=="function"?tt(...et):!!tt}function noop(){}var ensurePreventErrorBoundaryRetry=(tt,et)=>{(tt.suspense||tt.throwOnError||tt.experimental_prefetchInRender)&&(et.isReset()||(tt.retryOnMount=!1))},useClearResetErrorBoundary=tt=>{reactExports.useEffect(()=>{tt.clearReset()},[tt])},getHasError=({result:tt,errorResetBoundary:et,throwOnError:rt,query:st})=>tt.isError&&!et.isReset()&&!tt.isFetching&&st&&shouldThrowError(rt,[tt.error,st]),ensureSuspenseTimers=tt=>{tt.suspense&&(tt.staleTime===void 0&&(tt.staleTime=1e3),typeof tt.gcTime=="number"&&(tt.gcTime=Math.max(tt.gcTime,1e3)))},willFetch=(tt,et)=>tt.isLoading&&tt.isFetching&&!et,shouldSuspend=(tt,et)=>(tt==null?void 0:tt.suspense)&&et.isPending,fetchOptimistic=(tt,et,rt)=>et.fetchOptimistic(tt).catch(()=>{rt.clearReset()});function useBaseQuery(tt,et,rt){var dt,ht,ft,xt,vt;const st=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=st.defaultQueryOptions(tt);(ht=(dt=st.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!st.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(st,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(yt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(yt));return ut.updateResult(),Et},[ut,nt]),()=>ut.getCurrentResult(),()=>ut.getCurrentResult()),reactExports.useEffect(()=>{ut.setOptions(at,{listeners:!1})},[at,ut]),shouldSuspend(at,ct))throw fetchOptimistic(at,ut,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:at.throwOnError,query:st.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(ft=st.getDefaultOptions().queries)==null?void 0:ft._experimental_afterQuery)==null||xt.call(ft,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const yt=lt?fetchOptimistic(at,ut,ot):(vt=st.getQueryCache().get(at.queryHash))==null?void 0:vt.promise;yt==null||yt.catch(noop).finally(()=>{ut.updateResult()})}return at.notifyOnChangeProps?ct:ut.trackResult(ct)}function useQuery(tt,et){return useBaseQuery(tt,QueryObserver)}function queryOptions(tt){return tt}function useMutation(tt,et){const rt=useQueryClient(),[st]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{st.setOptions(tt)},[st,tt]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(at=>st.subscribe(notifyManager.batchCalls(at)),[st]),()=>st.getCurrentResult(),()=>st.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{st.mutate(at,lt).catch(noop)},[st]);if(nt.error&&shouldThrowError(st.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}const useConversation=()=>{const tt=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"),et=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"),[rt,st]=reactExports.useState(""),nt={unread:!0,_:new Date().getTime()},{data:ot}=useQuery({queryKey:["folder","count","inbox"],queryFn:async()=>await odeServices.http().get(tt?"/zimbra/count/INBOX":"/conversation/count/inbox",{queryParams:nt}),staleTime:5*60*1e3}),at=async()=>{const lt="/zimbra/zimbra";try{const{preference:ut}=await odeServices.http().get("/userbook/preference/zimbra"),ct=ut?JSON.parse(ut).modeExpert:!1;st(ct&&et?"/zimbra/preauth":window.location.origin+lt)}catch(ut){console.error(ut),st(window.location.origin+lt)}};return reactExports.useEffect(()=>{at()},[]),{messages:ot?ot.count:0,msgLink:rt,zimbraWorkflow:tt}};var dayjs_min={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt=1e3,st=6e4,nt=36e5,ot="millisecond",at="second",lt="minute",ut="hour",ct="day",dt="week",ht="month",ft="quarter",xt="year",vt="date",yt="Invalid Date",Et=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,bt=/\[([^\]]+)]|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,wt={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(kt){var $t=["th","st","nd","rd"],Ft=kt%100;return"["+kt+($t[(Ft-20)%10]||$t[Ft]||$t[0])+"]"}},St=function(kt,$t,Ft){var Gt=String(kt);return!Gt||Gt.length>=$t?kt:""+Array($t+1-Gt.length).join(Ft)+kt},Rt={s:St,z:function(kt){var $t=-kt.utcOffset(),Ft=Math.abs($t),Gt=Math.floor(Ft/60),Mt=Ft%60;return($t<=0?"+":"-")+St(Gt,2,"0")+":"+St(Mt,2,"0")},m:function kt($t,Ft){if($t.date()<Ft.date())return-kt(Ft,$t);var Gt=12*(Ft.year()-$t.year())+(Ft.month()-$t.month()),Mt=$t.clone().add(Gt,ht),Vt=Ft-Mt<0,Bt=$t.clone().add(Gt+(Vt?-1:1),ht);return+(-(Gt+(Ft-Mt)/(Vt?Mt-Bt:Bt-Mt))||0)},a:function(kt){return kt<0?Math.ceil(kt)||0:Math.floor(kt)},p:function(kt){return{M:ht,y:xt,w:dt,d:ct,D:vt,h:ut,m:lt,s:at,ms:ot,Q:ft}[kt]||String(kt||"").toLowerCase().replace(/s$/,"")},u:function(kt){return kt===void 0}},Ct="en",It={};It[Ct]=wt;var jt="$isDayjsObject",Pt=function(kt){return kt instanceof Ht||!(!kt||!kt[jt])},Ot=function kt($t,Ft,Gt){var Mt;if(!$t)return Ct;if(typeof $t=="string"){var Vt=$t.toLowerCase();It[Vt]&&(Mt=Vt),Ft&&(It[Vt]=Ft,Mt=Vt);var Bt=$t.split("-");if(!Mt&&Bt.length>1)return kt(Bt[0])}else{var qt=$t.name;It[qt]=$t,Mt=qt}return!Gt&&Mt&&(Ct=Mt),Mt||!Gt&&Ct},Ut=function(kt,$t){if(Pt(kt))return kt.clone();var Ft=typeof $t=="object"?$t:{};return Ft.date=kt,Ft.args=arguments,new Ht(Ft)},Nt=Rt;Nt.l=Ot,Nt.i=Pt,Nt.w=function(kt,$t){return Ut(kt,{locale:$t.$L,utc:$t.$u,x:$t.$x,$offset:$t.$offset})};var Ht=function(){function kt(Ft){this.$L=Ot(Ft.locale,null,!0),this.parse(Ft),this.$x=this.$x||Ft.x||{},this[jt]=!0}var $t=kt.prototype;return $t.parse=function(Ft){this.$d=function(Gt){var Mt=Gt.date,Vt=Gt.utc;if(Mt===null)return new Date(NaN);if(Nt.u(Mt))return new Date;if(Mt instanceof Date)return new Date(Mt);if(typeof Mt=="string"&&!/Z$/i.test(Mt)){var Bt=Mt.match(Et);if(Bt){var qt=Bt[2]-1||0,Qt=(Bt[7]||"0").substring(0,3);return Vt?new Date(Date.UTC(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)):new Date(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)}}return new Date(Mt)}(Ft),this.init()},$t.init=function(){var Ft=this.$d;this.$y=Ft.getFullYear(),this.$M=Ft.getMonth(),this.$D=Ft.getDate(),this.$W=Ft.getDay(),this.$H=Ft.getHours(),this.$m=Ft.getMinutes(),this.$s=Ft.getSeconds(),this.$ms=Ft.getMilliseconds()},$t.$utils=function(){return Nt},$t.isValid=function(){return this.$d.toString()!==yt},$t.isSame=function(Ft,Gt){var Mt=Ut(Ft);return this.startOf(Gt)<=Mt&&Mt<=this.endOf(Gt)},$t.isAfter=function(Ft,Gt){return Ut(Ft)<this.startOf(Gt)},$t.isBefore=function(Ft,Gt){return this.endOf(Gt)<Ut(Ft)},$t.$g=function(Ft,Gt,Mt){return Nt.u(Ft)?this[Gt]:this.set(Mt,Ft)},$t.unix=function(){return Math.floor(this.valueOf()/1e3)},$t.valueOf=function(){return this.$d.getTime()},$t.startOf=function(Ft,Gt){var Mt=this,Vt=!!Nt.u(Gt)||Gt,Bt=Nt.p(Ft),qt=function(or,hr){var pr=Nt.w(Mt.$u?Date.UTC(Mt.$y,hr,or):new Date(Mt.$y,hr,or),Mt);return Vt?pr:pr.endOf(ct)},Qt=function(or,hr){return Nt.w(Mt.toDate()[or].apply(Mt.toDate("s"),(Vt?[0,0,0,0]:[23,59,59,999]).slice(hr)),Mt)},Yt=this.$W,tr=this.$M,lr=this.$D,ur="set"+(this.$u?"UTC":"");switch(Bt){case xt:return Vt?qt(1,0):qt(31,11);case ht:return Vt?qt(1,tr):qt(0,tr+1);case dt:var mr=this.$locale().weekStart||0,yr=(Yt<mr?Yt+7:Yt)-mr;return qt(Vt?lr-yr:lr+(6-yr),tr);case ct:case vt:return Qt(ur+"Hours",0);case ut:return Qt(ur+"Minutes",1);case lt:return Qt(ur+"Seconds",2);case at:return Qt(ur+"Milliseconds",3);default:return this.clone()}},$t.endOf=function(Ft){return this.startOf(Ft,!1)},$t.$set=function(Ft,Gt){var Mt,Vt=Nt.p(Ft),Bt="set"+(this.$u?"UTC":""),qt=(Mt={},Mt[ct]=Bt+"Date",Mt[vt]=Bt+"Date",Mt[ht]=Bt+"Month",Mt[xt]=Bt+"FullYear",Mt[ut]=Bt+"Hours",Mt[lt]=Bt+"Minutes",Mt[at]=Bt+"Seconds",Mt[ot]=Bt+"Milliseconds",Mt)[Vt],Qt=Vt===ct?this.$D+(Gt-this.$W):Gt;if(Vt===ht||Vt===xt){var Yt=this.clone().set(vt,1);Yt.$d[qt](Qt),Yt.init(),this.$d=Yt.set(vt,Math.min(this.$D,Yt.daysInMonth())).$d}else qt&&this.$d[qt](Qt);return this.init(),this},$t.set=function(Ft,Gt){return this.clone().$set(Ft,Gt)},$t.get=function(Ft){return this[Nt.p(Ft)]()},$t.add=function(Ft,Gt){var Mt,Vt=this;Ft=Number(Ft);var Bt=Nt.p(Gt),qt=function(tr){var lr=Ut(Vt);return Nt.w(lr.date(lr.date()+Math.round(tr*Ft)),Vt)};if(Bt===ht)return this.set(ht,this.$M+Ft);if(Bt===xt)return this.set(xt,this.$y+Ft);if(Bt===ct)return qt(1);if(Bt===dt)return qt(7);var Qt=(Mt={},Mt[lt]=st,Mt[ut]=nt,Mt[at]=rt,Mt)[Bt]||1,Yt=this.$d.getTime()+Ft*Qt;return Nt.w(Yt,this)},$t.subtract=function(Ft,Gt){return this.add(-1*Ft,Gt)},$t.format=function(Ft){var Gt=this,Mt=this.$locale();if(!this.isValid())return Mt.invalidDate||yt;var Vt=Ft||"YYYY-MM-DDTHH:mm:ssZ",Bt=Nt.z(this),qt=this.$H,Qt=this.$m,Yt=this.$M,tr=Mt.weekdays,lr=Mt.months,ur=Mt.meridiem,mr=function(hr,pr,_r,Ar){return hr&&(hr[pr]||hr(Gt,Vt))||_r[pr].slice(0,Ar)},yr=function(hr){return Nt.s(qt%12||12,hr,"0")},or=ur||function(hr,pr,_r){var Ar=hr<12?"AM":"PM";return _r?Ar.toLowerCase():Ar};return Vt.replace(bt,function(hr,pr){return pr||function(_r){switch(_r){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Nt.s(Gt.$y,4,"0");case"M":return Yt+1;case"MM":return Nt.s(Yt+1,2,"0");case"MMM":return mr(Mt.monthsShort,Yt,lr,3);case"MMMM":return mr(lr,Yt);case"D":return Gt.$D;case"DD":return Nt.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return mr(Mt.weekdaysMin,Gt.$W,tr,2);case"ddd":return mr(Mt.weekdaysShort,Gt.$W,tr,3);case"dddd":return tr[Gt.$W];case"H":return String(qt);case"HH":return Nt.s(qt,2,"0");case"h":return yr(1);case"hh":return yr(2);case"a":return or(qt,Qt,!0);case"A":return or(qt,Qt,!1);case"m":return String(Qt);case"mm":return Nt.s(Qt,2,"0");case"s":return String(Gt.$s);case"ss":return Nt.s(Gt.$s,2,"0");case"SSS":return Nt.s(Gt.$ms,3,"0");case"Z":return Bt}return null}(hr)||Bt.replace(":","")})},$t.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$t.diff=function(Ft,Gt,Mt){var Vt,Bt=this,qt=Nt.p(Gt),Qt=Ut(Ft),Yt=(Qt.utcOffset()-this.utcOffset())*st,tr=this-Qt,lr=function(){return Nt.m(Bt,Qt)};switch(qt){case xt:Vt=lr()/12;break;case ht:Vt=lr();break;case ft:Vt=lr()/3;break;case dt:Vt=(tr-Yt)/6048e5;break;case ct:Vt=(tr-Yt)/864e5;break;case ut:Vt=tr/nt;break;case lt:Vt=tr/st;break;case at:Vt=tr/rt;break;default:Vt=tr}return Mt?Vt:Nt.a(Vt)},$t.daysInMonth=function(){return this.endOf(ht).$D},$t.$locale=function(){return It[this.$L]},$t.locale=function(Ft,Gt){if(!Ft)return this.$L;var Mt=this.clone(),Vt=Ot(Ft,Gt,!0);return Vt&&(Mt.$L=Vt),Mt},$t.clone=function(){return Nt.w(this.$d,this)},$t.toDate=function(){return new Date(this.valueOf())},$t.toJSON=function(){return this.isValid()?this.toISOString():null},$t.toISOString=function(){return this.$d.toISOString()},$t.toString=function(){return this.$d.toUTCString()},kt}(),Lt=Ht.prototype;return Ut.prototype=Lt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",vt]].forEach(function(kt){Lt[kt[1]]=function($t){return this.$g($t,kt[0],kt[1])}}),Ut.extend=function(kt,$t){return kt.$i||(kt($t,Ht,Ut),kt.$i=!0),Ut},Ut.locale=Ot,Ut.isDayjs=Pt,Ut.unix=function(kt){return Ut(1e3*kt)},Ut.en=It[Ct],Ut.Ls=It,Ut.p={},Ut})})(dayjs_min);var dayjs_minExports=dayjs_min.exports;const dayjs=getDefaultExportFromCjs(dayjs_minExports);var customParseFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},st=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,nt=/\d\d/,ot=/\d\d?/,at=/\d*[^-_:/,()\s\d]+/,lt={},ut=function(yt){return(yt=+yt)+(yt>68?1900:2e3)},ct=function(yt){return function(Et){this[yt]=+Et}},dt=[/[+-]\d\d:?(\d\d)?|Z/,function(yt){(this.zone||(this.zone={})).offset=function(Et){if(!Et||Et==="Z")return 0;var bt=Et.match(/([+-]|\d\d)/g),wt=60*bt[1]+(+bt[2]||0);return wt===0?0:bt[0]==="+"?-wt:wt}(yt)}],ht=function(yt){var Et=lt[yt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},ft=function(yt,Et){var bt,wt=lt.meridiem;if(wt){for(var St=1;St<=24;St+=1)if(yt.indexOf(wt(St,0,Et))>-1){bt=St>12;break}}else bt=yt===(Et?"pm":"PM");return bt},xt={A:[at,function(yt){this.afternoon=ft(yt,!1)}],a:[at,function(yt){this.afternoon=ft(yt,!0)}],S:[/\d/,function(yt){this.milliseconds=100*+yt}],SS:[nt,function(yt){this.milliseconds=10*+yt}],SSS:[/\d{3}/,function(yt){this.milliseconds=+yt}],s:[ot,ct("seconds")],ss:[ot,ct("seconds")],m:[ot,ct("minutes")],mm:[ot,ct("minutes")],H:[ot,ct("hours")],h:[ot,ct("hours")],HH:[ot,ct("hours")],hh:[ot,ct("hours")],D:[ot,ct("day")],DD:[nt,ct("day")],Do:[at,function(yt){var Et=lt.ordinal,bt=yt.match(/\d+/);if(this.day=bt[0],Et)for(var wt=1;wt<=31;wt+=1)Et(wt).replace(/\[|\]/g,"")===yt&&(this.day=wt)}],M:[ot,ct("month")],MM:[nt,ct("month")],MMM:[at,function(yt){var Et=ht("months"),bt=(ht("monthsShort")||Et.map(function(wt){return wt.slice(0,3)})).indexOf(yt)+1;if(bt<1)throw new Error;this.month=bt%12||bt}],MMMM:[at,function(yt){var Et=ht("months").indexOf(yt)+1;if(Et<1)throw new Error;this.month=Et%12||Et}],Y:[/[+-]?\d+/,ct("year")],YY:[nt,function(yt){this.year=ut(yt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function vt(yt){var Et,bt;Et=yt,bt=lt&<.formats;for(var wt=(yt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Ot,Ut,Nt){var Ht=Nt&&Nt.toUpperCase();return Ut||bt[Nt]||rt[Nt]||bt[Ht].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Lt,kt,$t){return kt||$t.slice(1)})})).match(st),St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt],It=xt[Ct],jt=It&&It[0],Pt=It&&It[1];wt[Rt]=Pt?{regex:jt,parser:Pt}:Ct.replace(/^\[|\]$/g,"")}return function(Ot){for(var Ut={},Nt=0,Ht=0;Nt<St;Nt+=1){var Lt=wt[Nt];if(typeof Lt=="string")Ht+=Lt.length;else{var kt=Lt.regex,$t=Lt.parser,Ft=Ot.slice(Ht),Gt=kt.exec(Ft)[0];$t.call(Ut,Gt),Ot=Ot.replace(Gt,"")}}return function(Mt){var Vt=Mt.afternoon;if(Vt!==void 0){var Bt=Mt.hours;Vt?Bt<12&&(Mt.hours+=12):Bt===12&&(Mt.hours=0),delete Mt.afternoon}}(Ut),Ut}}return function(yt,Et,bt){bt.p.customParseFormat=!0,yt&&yt.parseTwoDigitYear&&(ut=yt.parseTwoDigitYear);var wt=Et.prototype,St=wt.parse;wt.parse=function(Rt){var Ct=Rt.date,It=Rt.utc,jt=Rt.args;this.$u=It;var Pt=jt[1];if(typeof Pt=="string"){var Ot=jt[2]===!0,Ut=jt[3]===!0,Nt=Ot||Ut,Ht=jt[2];Ut&&(Ht=jt[2]),lt=this.$locale(),!Ot&&Ht&&(lt=bt.Ls[Ht]),this.$d=function(Ft,Gt,Mt){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*Ft);var Vt=vt(Gt)(Ft),Bt=Vt.year,qt=Vt.month,Qt=Vt.day,Yt=Vt.hours,tr=Vt.minutes,lr=Vt.seconds,ur=Vt.milliseconds,mr=Vt.zone,yr=new Date,or=Qt||(Bt||qt?1:yr.getDate()),hr=Bt||yr.getFullYear(),pr=0;Bt&&!qt||(pr=qt>0?qt-1:yr.getMonth());var _r=Yt||0,Ar=tr||0,Hr=lr||0,Ur=ur||0;return mr?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur+60*mr.offset*1e3)):Mt?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur)):new Date(hr,pr,or,_r,Ar,Hr,Ur)}catch{return new Date("")}}(Ct,Pt,It),this.init(),Ht&&Ht!==!0&&(this.$L=this.locale(Ht).$L),Nt&&Ct!=this.format(Pt)&&(this.$d=new Date("")),lt={}}else if(Pt instanceof Array)for(var Lt=Pt.length,kt=1;kt<=Lt;kt+=1){jt[1]=Pt[kt-1];var $t=bt.apply(this,jt);if($t.isValid()){this.$d=$t.$d,this.$L=$t.$L,this.init();break}kt===Lt&&(this.$d=new Date(""))}else St.call(this,Rt)}}})})(customParseFormat$1);var customParseFormatExports=customParseFormat$1.exports;const customParseFormat=getDefaultExportFromCjs(customParseFormatExports);var localizedFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(st,nt,ot){var at=nt.prototype,lt=at.format;ot.en.formats=rt,at.format=function(ut){ut===void 0&&(ut="YYYY-MM-DDTHH:mm:ssZ");var ct=this.$locale().formats,dt=function(ht,ft){return ht.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(xt,vt,yt){var Et=yt&&yt.toUpperCase();return vt||ft[yt]||rt[yt]||ft[Et].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(bt,wt,St){return wt||St.slice(1)})})}(ut,ct===void 0?{}:ct);return lt.call(this,dt)}}})})(localizedFormat$1);var localizedFormatExports=localizedFormat$1.exports;const localizedFormat=getDefaultExportFromCjs(localizedFormatExports);var relativeTime$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){return function(rt,st,nt){rt=rt||{};var ot=st.prototype,at={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function lt(ct,dt,ht,ft){return ot.fromToBase(ct,dt,ht,ft)}nt.en.relativeTime=at,ot.fromToBase=function(ct,dt,ht,ft,xt){for(var vt,yt,Et,bt=ht.$locale().relativeTime||at,wt=rt.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt];Ct.d&&(vt=ft?nt(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var It=(rt.rounding||Math.round)(Math.abs(vt));if(Et=vt>0,It<=Ct.r||!Ct.r){It<=1&&Rt>0&&(Ct=wt[Rt-1]);var jt=bt[Ct.l];xt&&(It=xt(""+It)),yt=typeof jt=="string"?jt.replace("%d",It):jt(It,dt,Ct.l,Et);break}}if(dt)return yt;var Pt=Et?bt.future:bt.past;return typeof Pt=="function"?Pt(yt):Pt.replace("%s",yt)},ot.to=function(ct,dt){return lt(ct,dt,this,!0)},ot.from=function(ct,dt){return lt(ct,dt,this)};var ut=function(ct){return ct.$u?nt.utc():nt()};ot.toNow=function(ct){return this.to(ut(this),ct)},ot.fromNow=function(ct){return this.from(ut(this),ct)}}})})(relativeTime$1);var relativeTimeExports=relativeTime$1.exports;const relativeTime=getDefaultExportFromCjs(relativeTimeExports);var de$2={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(ut){return ut&&typeof ut=="object"&&"default"in ut?ut:{default:ut}}var nt=st(rt),ot={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function at(ut,ct,dt){var ht=ot[dt];return Array.isArray(ht)&&(ht=ht[ct?0:1]),ht.replace("%d",ut)}var lt={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(ut){return ut+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:at,m:at,mm:at,h:at,hh:at,d:at,dd:at,M:at,MM:at,y:at,yy:at}};return nt.default.locale(lt,null,!0),lt})})(de$2);var es={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(at){return at+"º"}};return nt.default.locale(ot,null,!0),ot})})(es);var fr={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(at){return""+at+(at===1?"er":"")}};return nt.default.locale(ot,null,!0),ot})})(fr);var it={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(at){return at+"º"}};return nt.default.locale(ot,null,!0),ot})})(it);var pt={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(at){return at+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return nt.default.locale(ot,null,!0),ot})})(pt);dayjs.extend(relativeTime);dayjs.extend(customParseFormat);dayjs.extend(localizedFormat);function useDate(){const{currentLanguage:tt}=useEdificeClient(),{t:et}=useTranslation(),rt=reactExports.useCallback((lt,ut)=>{if(lt.length<11)return dayjs(lt,["YYYY-MM-DD"],ut);if(lt.split("").findIndex(ct=>"0">ct||ct>"9")<0)return dayjs(Number.parseInt(lt)).locale(tt);{let ct=dayjs(lt).locale(tt);return ct.isValid()||(ct=dayjs(lt,["YYYY-MM-DD HH:mm:ss.SSS"]).locale(tt)),ct}},[tt]),st=reactExports.useCallback(lt=>{let ut=dayjs();try{return typeof lt>"u"?void 0:(typeof lt=="string"?ut=rt(lt):typeof lt=="number"?ut=dayjs(lt).locale(tt):typeof lt.$date=="number"?ut=dayjs(new Date(lt.$date)).locale(tt):typeof lt.$date=="string"&&(ut=rt(lt.$date)),ut)}catch(ct){console.error(ct)}return ut},[tt,rt]),nt=reactExports.useCallback(lt=>{const ut=st(lt);if(!(ut!=null&&ut.isValid()))return"";const ct=dayjs();return ut.isSame(ct,"date")?ut.fromNow():ut.isSame(ct.subtract(1,"day"),"date")?et("date.format.yesterday"):ct.diff(ut,"days")<=7?ut.format(et("date.format.currentWeek")):ut.isSame(ct,"year")?ut.format(et("date.format.currentYear")):ut.format(et("date.format.previousYear"))},[tt,rt]),ot=reactExports.useCallback(lt=>{const ut=st(lt);return ut!=null&&ut.isValid()?ut.fromNow():""},[tt,rt]),at=reactExports.useCallback((lt,ut="short")=>{const ct=st(lt);let dt="";switch(ut){case"short":dt="L";break;case"long":dt="LL";break;case"abbr":dt="ll";break;default:dt=ut}return ct!=null&&ct.isValid()?ct.locale(tt).format(dt):""},[tt,rt]);return{fromNow:ot,formatDate:at,formatTimeAgo:nt}}function useHover(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=()=>{et(!0)},nt=()=>{et(!1)};return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return ot.addEventListener("mouseover",st),ot.addEventListener("mouseout",nt),()=>{ot.removeEventListener("mouseover",st),ot.removeEventListener("mouseout",nt)}},[rt]),[rt,tt]}let e$1={data:""},t$1=tt=>{if(typeof window=="object"){let et=(tt?tt.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return et.nonce=window.__nonce__,et.parentNode||(tt||document.head).appendChild(et),et.firstChild}return tt||e$1},l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$2=/\n+/g,o$1=(tt,et)=>{let rt="",st="",nt="";for(let ot in tt){let at=tt[ot];ot[0]=="@"?ot[1]=="i"?rt=ot+" "+at+";":st+=ot[1]=="f"?o$1(at,ot):ot+"{"+o$1(at,ot[1]=="k"?"":et)+"}":typeof at=="object"?st+=o$1(at,et?et.replace(/([^,])+/g,lt=>ot.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,ut=>/&/.test(ut)?ut.replace(/&/g,lt):lt?lt+" "+ut:ut)):ot):at!=null&&(ot=/^--/.test(ot)?ot:ot.replace(/[A-Z]/g,"-$&").toLowerCase(),nt+=o$1.p?o$1.p(ot,at):ot+":"+at+";")}return rt+(et&&nt?et+"{"+nt+"}":nt)+st},c$1={},s$1=tt=>{if(typeof tt=="object"){let et="";for(let rt in tt)et+=rt+s$1(tt[rt]);return et}return tt},i$2=(tt,et,rt,st,nt)=>{let ot=s$1(tt),at=c$1[ot]||(c$1[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$1[at]){let ut=ot!==tt?tt:(ct=>{let dt,ht,ft=[{}];for(;dt=l$1.exec(ct.replace(a$1,""));)dt[4]?ft.shift():dt[3]?(ht=dt[3].replace(n$2," ").trim(),ft.unshift(ft[0][ht]=ft[0][ht]||{})):ft[0][dt[1]]=dt[2].replace(n$2," ").trim();return ft[0]})(tt);c$1[at]=o$1(nt?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$1.g?c$1.g:null;return rt&&(c$1.g=c$1[at]),((ut,ct,dt,ht)=>{ht?ct.data=ct.data.replace(ht,ut):ct.data.indexOf(ut)===-1&&(ct.data=dt?ut+ct.data:ct.data+ut)})(c$1[at],et,st,lt),at},p$1=(tt,et,rt)=>tt.reduce((st,nt,ot)=>{let at=et[ot];if(at&&at.call){let lt=at(rt),ut=lt&<.props&<.props.className||/^go/.test(lt)&<at=ut?"."+ut:lt&&typeof lt=="object"?lt.props?"":o$1(lt,""):lt===!1?"":lt}return st+nt+(at??"")},"");function u$1(tt){let et=this||{},rt=tt.call?tt(et.p):tt;return i$2(rt.unshift?rt.raw?p$1(rt,[].slice.call(arguments,1),et.p):rt.reduce((st,nt)=>Object.assign(st,nt&&nt.call?nt(et.p):nt),{}):rt,t$1(et.target),et.g,et.o,et.k)}let d$1,f$2,g$1;u$1.bind({g:1});let h$2=u$1.bind({k:1});function m$1(tt,et,rt,st){o$1.p=et,d$1=tt,f$2=rt,g$1=st}function w$2(tt,et){let rt=this||{};return function(){let st=arguments;function nt(ot,at){let lt=Object.assign({},ot),ut=lt.className||nt.className;rt.p=Object.assign({theme:f$2&&f$2()},lt),rt.o=/ *go\d+/.test(ut),lt.className=u$1.apply(rt,st)+(ut?" "+ut:"");let ct=tt;return tt[0]&&(ct=lt.as||tt,delete lt.as),g$1&&ct[0]&&g$1(lt),d$1(ct,lt)}return et?et(nt):nt}}var Z$1=tt=>typeof tt=="function",h$1=(tt,et)=>Z$1(tt)?tt(et):tt,W$2=(()=>{let tt=0;return()=>(++tt).toString()})(),E$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),re$1=20,k$2="default",H$3=(tt,et)=>{let{toastLimit:rt}=tt.settings;switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,rt)};case 1:return{...tt,toasts:tt.toasts.map(at=>at.id===et.toast.id?{...at,...et.toast}:at)};case 2:let{toast:st}=et;return H$3(tt,{type:tt.toasts.find(at=>at.id===st.id)?1:0,toast:st});case 3:let{toastId:nt}=et;return{...tt,toasts:tt.toasts.map(at=>at.id===nt||nt===void 0?{...at,dismissed:!0,visible:!1}:at)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(at=>at.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let ot=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(at=>({...at,pauseDuration:at.pauseDuration+ot}))}}},v$1=[],j$2={toasts:[],pausedAt:void 0,settings:{toastLimit:re$1}},f$1={},Y$1=(tt,et=k$2)=>{f$1[et]=H$3(f$1[et]||j$2,tt),v$1.forEach(([rt,st])=>{rt===et&&st(f$1[et])})},_$1=tt=>Object.keys(f$1).forEach(et=>Y$1(tt,et)),Q$1=tt=>Object.keys(f$1).find(et=>f$1[et].toasts.some(rt=>rt.id===tt)),S$1=(tt=k$2)=>et=>{Y$1(et,tt)},se$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},V$1=(tt={},et=k$2)=>{let[rt,st]=reactExports.useState(f$1[et]||j$2),nt=reactExports.useRef(f$1[et]);reactExports.useEffect(()=>(nt.current!==f$1[et]&&st(f$1[et]),v$1.push([et,st]),()=>{let at=v$1.findIndex(([lt])=>lt===et);at>-1&&v$1.splice(at,1)}),[et]);let ot=rt.toasts.map(at=>{var lt,ut,ct;return{...tt,...tt[at.type],...at,removeDelay:at.removeDelay||((lt=tt[at.type])==null?void 0:lt.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:at.duration||((ut=tt[at.type])==null?void 0:ut.duration)||(tt==null?void 0:tt.duration)||se$1[at.type],style:{...tt.style,...(ct=tt[at.type])==null?void 0:ct.style,...at.style}}});return{...rt,toasts:ot}},ie$1=(tt,et="blank",rt)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:et,ariaProps:{role:"status","aria-live":"polite"},message:tt,pauseDuration:0,...rt,id:(rt==null?void 0:rt.id)||W$2()}),P$1=tt=>(et,rt)=>{let st=ie$1(et,tt,rt);return S$1(st.toasterId||Q$1(st.id))({type:2,toast:st}),st.id},n$1=(tt,et)=>P$1("blank")(tt,et);n$1.error=P$1("error");n$1.success=P$1("success");n$1.loading=P$1("loading");n$1.custom=P$1("custom");n$1.dismiss=(tt,et)=>{let rt={type:3,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.dismissAll=tt=>n$1.dismiss(void 0,tt);n$1.remove=(tt,et)=>{let rt={type:4,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.removeAll=tt=>n$1.remove(void 0,tt);n$1.promise=(tt,et,rt)=>{let st=n$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(nt=>{let ot=et.success?h$1(et.success,nt):void 0;return ot?n$1.success(ot,{id:st,...rt,...rt==null?void 0:rt.success}):n$1.dismiss(st),nt}).catch(nt=>{let ot=et.error?h$1(et.error,nt):void 0;ot?n$1.error(ot,{id:st,...rt,...rt==null?void 0:rt.error}):n$1.dismiss(st)}),tt};var ce$1=1e3,w$1=(tt,et="default")=>{let{toasts:rt,pausedAt:st}=V$1(tt,et),nt=reactExports.useRef(new Map).current,ot=reactExports.useCallback((ht,ft=ce$1)=>{if(nt.has(ht))return;let xt=setTimeout(()=>{nt.delete(ht),at({type:4,toastId:ht})},ft);nt.set(ht,xt)},[]);reactExports.useEffect(()=>{if(st)return;let ht=Date.now(),ft=rt.map(xt=>{if(xt.duration===1/0)return;let vt=(xt.duration||0)+xt.pauseDuration-(ht-xt.createdAt);if(vt<0){xt.visible&&n$1.dismiss(xt.id);return}return setTimeout(()=>n$1.dismiss(xt.id,et),vt)});return()=>{ft.forEach(xt=>xt&&clearTimeout(xt))}},[rt,st,et]);let at=reactExports.useCallback(S$1(et),[et]),lt=reactExports.useCallback(()=>{at({type:5,time:Date.now()})},[at]),ut=reactExports.useCallback((ht,ft)=>{at({type:1,toast:{id:ht,height:ft}})},[at]),ct=reactExports.useCallback(()=>{st&&at({type:6,time:Date.now()})},[st,at]),dt=reactExports.useCallback((ht,ft)=>{let{reverseOrder:xt=!1,gutter:vt=8,defaultPosition:yt}=ft||{},Et=rt.filter(St=>(St.position||yt)===(ht.position||yt)&&St.height),bt=Et.findIndex(St=>St.id===ht.id),wt=Et.filter((St,Rt)=>Rt<bt&&St.visible).length;return Et.filter(St=>St.visible).slice(...xt?[wt+1]:[0,wt]).reduce((St,Rt)=>St+(Rt.height||0)+vt,0)},[rt]);return reactExports.useEffect(()=>{rt.forEach(ht=>{if(ht.dismissed)ot(ht.id,ht.removeDelay);else{let ft=nt.get(ht.id);ft&&(clearTimeout(ft),nt.delete(ht.id))}})},[rt,ot]),{toasts:rt,handlers:{updateHeight:ut,startPause:lt,endPause:ct,calculateOffset:dt}}},de$1=h$2`
|
|
50
|
+
`+ot):st.stack=ot}catch{}}throw st}}_request(et,rt){typeof et=="string"?(rt=rt||{},rt.url=et):rt=et||{},rt=mergeConfig$1(this.defaults,rt);const{transitional:st,paramsSerializer:nt,headers:ot}=rt;st!==void 0&&validator.assertOptions(st,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),nt!=null&&(utils$4.isFunction(nt)?rt.paramsSerializer={serialize:nt}:validator.assertOptions(nt,{encode:validators.function,serialize:validators.function},!0)),rt.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?rt.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:rt.allowAbsoluteUrls=!0),validator.assertOptions(rt,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),rt.method=(rt.method||this.defaults.method||"get").toLowerCase();let at=ot&&utils$4.merge(ot.common,ot[rt.method]);ot&&utils$4.forEach(["delete","get","head","post","put","patch","common"],vt=>{delete ot[vt]}),rt.headers=AxiosHeaders$1.concat(at,ot);const lt=[];let ut=!0;this.interceptors.request.forEach(function(yt){typeof yt.runWhen=="function"&&yt.runWhen(rt)===!1||(ut=ut&&yt.synchronous,lt.unshift(yt.fulfilled,yt.rejected))});const ct=[];this.interceptors.response.forEach(function(yt){ct.push(yt.fulfilled,yt.rejected)});let dt,ht=0,ft;if(!ut){const vt=[dispatchRequest.bind(this),void 0];for(vt.unshift(...lt),vt.push(...ct),ft=vt.length,dt=Promise.resolve(rt);ht<ft;)dt=dt.then(vt[ht++],vt[ht++]);return dt}ft=lt.length;let xt=rt;for(;ht<ft;){const vt=lt[ht++],yt=lt[ht++];try{xt=vt(xt)}catch(Et){yt.call(this,Et);break}}try{dt=dispatchRequest.call(this,xt)}catch(vt){return Promise.reject(vt)}for(ht=0,ft=ct.length;ht<ft;)dt=dt.then(ct[ht++],ct[ht++]);return dt}getUri(et){et=mergeConfig$1(this.defaults,et);const rt=buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls);return buildURL(rt,et.params,et.paramsSerializer)}};utils$4.forEach(["delete","get","head","options"],function(et){Axios$1.prototype[et]=function(rt,st){return this.request(mergeConfig$1(st||{},{method:et,url:rt,data:(st||{}).data}))}});utils$4.forEach(["post","put","patch"],function(et){function rt(st){return function(ot,at,lt){return this.request(mergeConfig$1(lt||{},{method:et,headers:st?{"Content-Type":"multipart/form-data"}:{},url:ot,data:at}))}}Axios$1.prototype[et]=rt(),Axios$1.prototype[et+"Form"]=rt(!0)});let CancelToken$1=class rm{constructor(et){if(typeof et!="function")throw new TypeError("executor must be a function.");let rt;this.promise=new Promise(function(ot){rt=ot});const st=this;this.promise.then(nt=>{if(!st._listeners)return;let ot=st._listeners.length;for(;ot-- >0;)st._listeners[ot](nt);st._listeners=null}),this.promise.then=nt=>{let ot;const at=new Promise(lt=>{st.subscribe(lt),ot=lt}).then(nt);return at.cancel=function(){st.unsubscribe(ot)},at},et(function(ot,at,lt){st.reason||(st.reason=new CanceledError$1(ot,at,lt),rt(st.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(et){if(this.reason){et(this.reason);return}this._listeners?this._listeners.push(et):this._listeners=[et]}unsubscribe(et){if(!this._listeners)return;const rt=this._listeners.indexOf(et);rt!==-1&&this._listeners.splice(rt,1)}toAbortSignal(){const et=new AbortController,rt=st=>{et.abort(st)};return this.subscribe(rt),et.signal.unsubscribe=()=>this.unsubscribe(rt),et.signal}static source(){let et;return{token:new rm(function(nt){et=nt}),cancel:et}}};function spread$1(tt){return function(rt){return tt.apply(null,rt)}}function isAxiosError$1(tt){return utils$4.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode$1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode$1).forEach(([tt,et])=>{HttpStatusCode$1[et]=tt});function createInstance(tt){const et=new Axios$1(tt),rt=bind$3(Axios$1.prototype.request,et);return utils$4.extend(rt,Axios$1.prototype,et,{allOwnKeys:!0}),utils$4.extend(rt,et,null,{allOwnKeys:!0}),rt.create=function(nt){return createInstance(mergeConfig$1(tt,nt))},rt}const axios=createInstance(defaults$4);axios.Axios=Axios$1;axios.CanceledError=CanceledError$1;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel$1;axios.VERSION=VERSION$1;axios.toFormData=toFormData$1;axios.AxiosError=AxiosError$1;axios.Cancel=axios.CanceledError;axios.all=function(et){return Promise.all(et)};axios.spread=spread$1;axios.isAxiosError=isAxiosError$1;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=tt=>formDataToJSON(utils$4.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function m$3(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$2=(tt,et)=>{if(tt==0)return"0 octets";const rt=1e3,st=et,nt=["octets","Ko","Mo","Go"],ot=Math.floor(Math.log(tt)/Math.log(rt));return parseFloat((tt/Math.pow(rt,ot)).toFixed(st))+" "+nt[ot]};let s$3=class{static isLocalURL(et){return et.length>0&&et.charAt(0)==="/"}static startWithHttp(et){return/^https?:\/\//gi.test(et)}static toCounter(et){return et>999?`${Number(et/1e3).toFixed(1)} k`:""+et}static generateVirtualId(){return"xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16))}};const s$2=(tt,et)=>{const rt="virtualID";if(!Object.hasOwnProperty.apply(tt,[rt])){const st=et??`${s$3.generateVirtualId()}#${tt.size}`;Object.defineProperty(tt,rt,{value:st,writable:!1})}return tt[rt]};let p$3=class{static changeDimension(et,rt,st,nt){return st>nt&&(et=Math.round(et*nt/st),st=nt),et>rt&&(st=Math.round(st*rt/et),et=rt),{height:et,width:st}}static renameFileNameExtension(et,rt){const st=et.split(".");return st.pop(),st.join(".")+"."+rt}static resizeImage(et,rt,st,nt,ot="jpeg",at=80){const lt=at/100,ut=document.createElement("canvas"),ct=`image/${ot}`;let dt=et.width,ht=et.height;const ft=this.changeDimension(ht,nt,dt,st);dt=ft.width,ht=ft.height;const xt=ut.getContext("2d");return xt&&(ut.width=dt,ut.height=ht,xt.fillStyle="white",xt.fillRect(0,0,ut.width,ut.height),xt.imageSmoothingEnabled&&xt.imageSmoothingQuality&&(xt.imageSmoothingQuality="high"),xt.drawImage(et,0,0,dt,ht)),new Promise((vt,yt)=>{ut.toBlob(Et=>{Et?vt(new File([Et],rt,{type:ct,lastModified:new Date().getTime()})):yt()},ct,lt)})}static async resizeImageFile(et,rt=1440,st=1440,nt=80){if(!et)throw Error("Image resizer: file not found!");if(!et.type||!et.type.startsWith("image/"))throw Error("Image resizer: the file given is not an image.");const ot="jpeg";return new Promise(at=>{const lt=new Image;lt.setAttribute("style","max-width: none;"),lt.src=URL.createObjectURL(et),lt.onload=async()=>{const ut=await this.resizeImage(lt,this.renameFileNameExtension(et.name,ot),rt,st,ot,nt);at(ut)},lt.onerror=ut=>{throw Error("Image Loading Error: "+ut)}})}};const e$3={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};var p$2=Object.defineProperty,d$2=(tt,et,rt)=>et in tt?p$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$5=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$3=class{constructor(){n$5(this,"wordExtensions",new Set),n$5(this,"excelExtensions",new Set),n$5(this,"pptExtensions",new Set),n$5(this,"fileExtensionMap",new Map),n$5(this,"csvContentType",new Set),n$5(this,"csvExtensions",new Set),n$5(this,"txtExtensions",new Set),n$5(this,"mdExtensions",new Set),n$5(this,"PDF","application/pdf"),n$5(this,"OCTET_STREAM","application/octet-stream"),this.txtExtensions.add("txt"),this.mdExtensions.add("md"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.fileExtensionMap.set("md","text/markdown"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(et){return this.fileExtensionMap.has(et)?this.fileExtensionMap.get(et)??null:null}getExtensionForContentType(et){for(const rt of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(rt)||"").toLowerCase()==(et||"").toLowerCase())return rt;return null}isWordLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.wordExtensions.has(st):et==this.OCTET_STREAM&&rt?this.wordExtensions.has(rt):!1}isExcelLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.excelExtensions.has(st):et==this.OCTET_STREAM&&rt?this.excelExtensions.has(rt):!1}isCsvLike(et,rt){return this.csvContentType.has(et)?!0:et==this.OCTET_STREAM&&rt?this.csvExtensions.has(rt):!1}isPowerpointLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.pptExtensions.has(st):et==this.OCTET_STREAM&&rt?this.pptExtensions.has(rt):!1}isTxtLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.txtExtensions.has(st):et==this.OCTET_STREAM&&rt?this.txtExtensions.has(rt):!1}isMdLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.mdExtensions.has(st):et==this.OCTET_STREAM&&rt?this.mdExtensions.has(rt):!1}};n$5(o$3,"INSTANCE",new o$3);let a$2=o$3;const n$4=tt=>{if(tt>0){let et=Math.floor(tt/1e3),rt=Math.floor(et/60);return et=et%60,rt=rt%60,e$2(rt)+":"+e$2(et)}return"00:00"},e$2=tt=>tt.toString().padStart(2,"0"),o$2=()=>MediaRecorder.isTypeSupported?["video/webm;codecs=vp9",'video/mp4; codecs="avc1.424028, mp4a.40.2"',"video/webm;codecs=vp8,opus","video/webm"].find(tt=>MediaRecorder.isTypeSupported(tt)?!0:(console.error(`${tt} is not Supported`),!1))||"video/ogg":"video/webm;codecs=vp8,opus";var v$2=Object.defineProperty,T$1=(tt,et,rt)=>et in tt?v$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$3=(tt,et,rt)=>T$1(tt,typeof et!="symbol"?et+"":et,rt);const ERROR_CODE={SUCCESS:"0000",UNKNOWN:"0010",NOT_INITIALIZED:"0020",NOT_SUPPORTED:"0030",APP_NOT_FOUND:"0040",AGENT_NOT_FOUND:"0050",TRANSPORT_ERROR:"0060",TIME_OUT:"0070",MALFORMED_DATA:"0080",NOT_LOGGED_IN:"0090"},APP$4={VIDEO:"video"};class Observable{constructor(){n$3(this,"listeners",[])}revokeHandler(et){this.listeners=this.listeners.filter(rt=>rt!==et)}addEventListener(et){return this.listeners.push(et),{revoke:()=>{this.revokeHandler(et)}}}postMessage(et){this.listeners.forEach(rt=>rt(et))}get subscriberCount(){return this.listeners.length}}class Subject{constructor(){n$3(this,"observables",new Map)}getSubjectName(et){return"Subject:"+et}getObservable(et){const rt=this.getSubjectName(et);let st=this.observables.get(rt);return st||(st=new Observable,this.observables.set(rt,st)),st}publish(et,rt){typeof et=="string"&&this.getObservable(et).postMessage(rt)}subscribe(et,rt){return typeof et=="string"?this.getObservable(et).addEventListener(rt):{revoke:()=>{}}}getSubscriberCountFor(et){return this.getObservable(et).subscriberCount}}const ASYNC_DATA_NAME={SESSION_READY:"sessionReady",LANG_READY:"langReady",SKIN_READY:"skinReady",OVERRIDE_READY:"overrideReady",APPCONF_READY:"appConfReady"};class Promisified{constructor(){n$3(this,"_resolution"),n$3(this,"_rejection"),n$3(this,"_promise",new Promise((et,rt)=>{this._resolution=et,this._rejection=rt}))}get promise(){return this._promise}resolve(et){this._resolution&&this._resolution(et)}reject(et){this._rejection&&this._rejection(et)}}class NotifyFramework{constructor(){n$3(this,"promises",{}),n$3(this,"subject",new Subject)}asyncData(et){return typeof this.promises[et]>"u"&&(this.promises[et]=new Promisified),this.promises[et]}onSessionReady(){return this.asyncData(ASYNC_DATA_NAME.SESSION_READY)}onLangReady(){return this.asyncData(ASYNC_DATA_NAME.LANG_READY)}onSkinReady(){return this.asyncData(ASYNC_DATA_NAME.SKIN_READY)}onOverridesReady(){return this.asyncData(ASYNC_DATA_NAME.OVERRIDE_READY)}onAppConfReady(){return this.asyncData(ASYNC_DATA_NAME.APPCONF_READY)}promisify(){return new Promisified}events(){return this.subject}}const notify=new NotifyFramework,loadedScripts$1={};class Http{constructor(et){n$3(this,"axios"),n$3(this,"_latestResponse"),this.axios=axios.create(et)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);return et.headers&&(rt.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams)),rt}else return this.axios.defaults}toCdnUrl(et){const rt=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((rt==null?void 0:rt.length)>0&&et!=="/conf/public"){const st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}return et}mapAxiosError(et,rt){return et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!rt||rt.disableNotifications,this._latestResponse}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}get(et,rt){return this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}post(et,rt,st){return this.axios.post(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}postFile(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"],this.axios.post(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}postJson(et,rt,st){const nt=this.toAxiosConfig();return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.post(et,rt,this.toAxiosConfig(st)).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}put(et,rt,st){return this.axios.put(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}putJson(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.put(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}delete(et,rt){return this.axios.delete(et,this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}deleteJson(et,rt){return this.axios.delete(et,{data:rt}).then(st=>this.mapAxiosResponse(st)).catch(st=>this.mapAxiosError(st))}getScript(et,rt,st){const nt=st??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${nt.split(".")[0]}={};${at};return ${nt};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts$1[et]?Promise.resolve():this.getScript(et,rt).then(st=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){n$3(this,"_http",new Http)}get http(){return this._http}newHttpInstance(et){return new Http(et)}}const transport=new TransportFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}const http$2=transport.http;class Session{constructor(){n$3(this,"_me",null),n$3(this,"_currentLanguage",""),n$3(this,"_notLoggedIn",!0),n$3(this,"_description"),n$3(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let et=this.description.photo;return(!et||et==="no-avatar.jpg"||et==="no-avatar.svg")&&(et=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),et}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(et=>{if(http$2.isResponseError()||typeof et=="string")throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(et),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(et=>(this.setCurrentLanguage(et),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(et=>{if(et===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(et)})}setCurrentModel(et){this._me=et,this._notLoggedIn=!(et&&et.sessionMetadata&&et.sessionMetadata.userId)}hasWorkflow(et){var rt;return et===void 0||((rt=this._me)==null?void 0:rt.authorizedActions.findIndex(st=>st.name===et))!==-1}hasRight(et,rt){if(rt==="owner")return et.owner&&et.owner.userId===this._me.userId;const st=rt.right||rt,nt=et.shared.filter(at=>(this._me.groupsIds||[]).indexOf(at.groupId)!==-1||at.userId===this._me.userId).find(at=>at[st]||at.manager)!==void 0,ot=rt.workflow?this.hasWorkflow(rt.workflow):!0;return nt&&ot}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(et=>(this._description&&(this._description.quota=et.quota,this._description.storage=et.storage),et)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(et){this._currentLanguage=et,notify.onLangReady().resolve(et)}loadDefaultLanguage(){return http$2.get("/locale").then(et=>et.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(et=>(et[0].status==="ok"&&et[0].result&&et[0].result.length>0?this._description=et[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,et[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(et=>et.result).then(et=>this._profile=et[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(et=>{try{return JSON.parse(et.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(et){return http$2.put("/directory/user/mailstate",{email:et})}tryEmailValidation(et){return http$2.post("/directory/user/mailstate",{key:et})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(et){return http$2.put("/directory/user/mobilestate",{mobile:et})}tryMobileValidation(et){return http$2.post("/directory/user/mobilestate",{key:et})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(et){return http$2.post("/auth/user/mfa/code",{key:et})}}class SessionFramework{constructor(){n$3(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),transport.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){n$3(this,"_conf"),n$3(this,"_loaded"),n$3(this,"skinName",""),n$3(this,"themeName",""),n$3(this,"skin","raw"),n$3(this,"themeUrl","/assets/themes/raw/default/"),n$3(this,"templateOverrides",{}),n$3(this,"portalTemplate","/assets/themes/raw/portal.html"),n$3(this,"basePath",""),n$3(this,"logoutCallback",""),n$3(this,"skins",[]),n$3(this,"is1D",!1),n$3(this,"is2D",!1),n$3(this,"_onSkinReady",notify.onSkinReady()),n$3(this,"_onOverrideReady",notify.onOverridesReady())}initialize(et){return notify.onSessionReady().promise.then(()=>this.load(et))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(et){return this._conf=this._conf??await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:et??this.version}},"exports.conf"),this._conf}load(et){return et=et??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(et):this.loadConnected(et)).then(async()=>{var rt,st;const nt=await this.listSkins();this.is1D=((rt=nt.find(ot=>ot.child===this.skin))==null?void 0:rt.parent)==="panda",this.is2D=((st=nt.find(ot=>ot.child===this.skin))==null?void 0:st.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((rt,st)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(nt=>{this.skin=nt.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${nt.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${nt.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(ot=>{this.templateOverrides=ot,this._onOverrideReady.resolve(ot),rt()}).catch(ot=>{if(transport.http.latestResponse.status===404)rt();else throw ot})}).catch(nt=>{this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt),st()})})}loadConnected(et){return new Promise((rt,st)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(nt=>{this.templateOverrides=nt,this._onOverrideReady.resolve(nt),rt()}).catch(nt=>{if(transport.http.latestResponse.status===404)rt(),this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt);else throw nt})})})}async loadDefaultTheme(et){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:et}}).then(rt=>{this.skinName=rt.skinName,this.themeName=rt.themeName,this.themeUrl=rt.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=rt.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(et){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+et._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(et=>{const rt=et.overriding.find(st=>st.child===this.skin);return rt!=null&&rt.group?this.skins=this.skins.concat(et.overriding.filter(st=>st.group===rt.group)):this.skins=this.skins.concat(et.overriding),this.skins})}async getHelpPath(){const et=(await this.listSkins()).find(rt=>rt.child===this.skin);return(et==null?void 0:et.help)??"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(et,rt){et=et??"";let st=bundle$1[et]===void 0?et:bundle$1[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et){return this.loadBundlePromise(session.session.currentLanguage,et)}addBundle(et,rt){this.loadBundle(session.session.currentLanguage,et,rt)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises$1[rt]}loadBundle(et,rt,st){const nt=promises$1[rt];if(nt)st&&nt.then(st).catch(st);else{const ot=new Promisified;promises$1[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),transport.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle$1,lt),typeof st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle$1[rt]!="string"&&(bundle$1[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap$1.length;rt++)et=et.replace(defaultDiacriticsRemovalMap$1[rt].letters,defaultDiacriticsRemovalMap$1[rt].base);return et}}class UserPreferences{constructor(){n$3(this,"data",{})}get(et){return this.data[et]}load(et,rt){return transport.http.get("/userbook/preference/"+et).then(st=>{try{return JSON.parse(st.preference)}catch{return rt??{}}}).then(st=>(this.data[et]=st??{},st))}update(et,rt){return rt!==void 0&&(this.data[et]=rt),this}save(et){return transport.http.putJson("/userbook/preference/"+et,this.data[et])}}class User{constructor(){n$3(this,"_me",null),n$3(this,"_keepOpenOnLogout",!1),n$3(this,"_preferences",new UserPreferences),n$3(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(et){return this.loadPublicConf(),notify.onSessionReady().promise.then(rt=>{rt&&this.setCurrentModel(rt)})}setCurrentModel(et){this._me=et,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(et=>(this._keepOpenOnLogout=(et==null?void 0:et.keepOpenOnLogout)||!1,et))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(et=>{et.preference||(et.preference=null);const rt=JSON.parse(et.preference);let st;if(rt&&rt.length&&typeof rt.concat=="function"){this._bookmarkedApps=rt,st={bookmarks:rt.map(at=>at.name),applications:[]},transport.http.putJson("/userbook/preference/apps",st);return}else st=rt;st||(st={bookmarks:[],applications:[]});let nt=!0;const ot=[];st.bookmarks.forEach((at,lt)=>{const ut=this._me.apps.find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);this._bookmarkedApps.push(ct)}else ot.push(at),nt=!1}),ot.forEach(at=>{const lt=st.bookmarks.indexOf(at);lt!==-1&&st.bookmarks.splice(lt,1)}),nt||transport.http.putJson("/userbook/preference/apps",st)})}loadAppPrefs(et){return this.preferences.load(et,{})}saveAppPrefs(et){return this.preferences.save(et)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(et=>et["default-domain"])}saveLanguage(et){return this.preferences.update("language",{"default-domain":et}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){n$3(this,"_publicConf",{}),n$3(this,"_currentApp"),n$3(this,"_appConf",{})}get currentApp(){return this._currentApp??null}setCurrentApp(et){return this._currentApp=et,this}async initialize(et,rt=!1){rt||this.setCurrentApp(et),await Promise.all([this.getPublicConf(et),this.loadI18n(et)])}async getPublicConf(et){return this._publicConf[et]||(this._publicConf[et]=await http$1.get(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[et]}async getWebAppConf(et){let rt;return this._appConf[et]||(await http$1.get("/applications-list")).apps.forEach(st=>{if(st!=null&&st.prefix){const nt=st.prefix.replace("/","");this._appConf[nt]=st}else st!=null&&st.name&&st.name.toLowerCase()==et&&(rt=st)}),this._appConf[et]??rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){n$3(this,"_status","void"),n$3(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(et){return this.parametersWithCheck(et,!0)}async parametersWithCheck(et,rt){return this.initialize().promise.then(st=>!rt||st.type===et||st.type==="multiple"?st[et]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async et=>{var rt;if(!et||!et[0]||!et[0].type)throw ERROR_CODE.MALFORMED_DATA;et[1]&&et[1].active&&(et[0].xiti=await this.initializeXiti(et[1])),(rt=this._params)==null||rt.resolve(et[0]),this._status="ready"}).catch(et=>{var rt;throw this._status="failed",(rt=this._params)==null||rt.reject(),et})),this._params}async initializeXiti(et){if(!et.structureMap||!configure.Platform.apps.currentApp)return;const rt=await notify.onSessionReady().promise,st=session.session.description;let nt;for(const ct of rt.structures){const dt=et.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:et.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st.profiles&&st.profiles.length>0?ut[st.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){n$3(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),n$3(this,"School",{}),n$3(this,"User",new User)}async initialize(et,rt){if(!et){const nt=ct=>(ct<10?"0":"")+ct.toFixed(0),ot=new Date,at=ot.getFullYear(),lt=ot.getMonth()+1,ut=ot.getDate();et=`${at}${nt(lt)}${nt(ut)}`}const st=et;this.Platform.deploymentTag=et,typeof rt=="string"&&rt.length>0&&(this.Platform.cdnDomain=rt),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(st),notify.onSessionReady().promise.then(nt=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(st)])}}const configure=new ConfigurationFramework;transport==null||transport.http;var _$2;(_$2=session==null?void 0:session.session)==null||_$2.user;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",TRANSPORT:"transport",WEB_DATA:"webDataPipeline"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",ERROR_OCCURED:"error",DATA_TRACKED:"track"};class ServiceRegistry extends Map{register({application:et,resourceType:rt},st){this.set(`${et}:main`,st),this.set(`${et}:${rt}`,st)}findService(et,rt){return this.lookupService(et,rt)}findMainService({application:et},rt){return this.lookupService({application:et,resourceType:"main"},rt)}isRegistered({application:et,resourceType:rt}){return this.get(`${et}:${rt}`)!==void 0}lookupService({application:et,resourceType:rt},st){const nt=this.get(`${et}:${rt}`);if(nt===void 0)throw`Service not found: ${et}:${rt}`;return nt(st)}}const m$2=class{constructor(et){n$3(this,"checkHttpResponse",rt=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return rt}),this.context=et}get http(){return this.context.http()}async copy(et){const rt=await this.http.post("/archive/duplicate",{application:et.application,resourceId:et.resourceId});return this.checkHttpResponse(rt)}async publish(et){const rt=new FormData;return rt.append("title",et.title),rt.append("cover",et.cover),rt.append("coverName",et.cover.name),rt.append("coverType",et.cover.type),rt.append("teacherAvatar",et.teacherAvatar),rt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),rt.append("teacherAvatarType",et.teacherAvatar.type),rt.append("language",et.language),et.activityType.forEach(st=>{rt.append("activityType[]",st)}),et.subjectArea.forEach(st=>{rt.append("subjectArea[]",st)}),et.age.forEach(st=>{rt.append("age[]",st.toString())}),rt.append("description",et.description),et.keyWords.split(",").forEach(st=>{rt.append("keyWords[]",st.trim())}),rt.append("licence",et.licence),rt.append("pdfUri",`${window.location.origin}${this.getPrintUrl(et.resourceEntId)}`),rt.append("application",et.application?et.application:""),rt.append("resourceId",et.resourceId),rt.append("teacherSchool",et.userStructureName),await this.http.post("/appregistry/library/resource",rt,{headers:{"Content-Type":"multipart/form-data"}})}async createContext(et){const rt=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchContext(et){const rt=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchResource(et){const rt=await this.http.get(`/explorer/resources/${et.id}`,{queryParams:this.getResourceParams(et)});return this.checkHttpResponse(rt)}async createFolder(et){const rt=await this.http.post("/explorer/folders",this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async updateFolder(et){const rt=await this.http.put(`/explorer/folders/${et.folderId}`,this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async moveToFolder(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const st=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(st)}async listSubfolders(et){const rt=await this.http.get(`/explorer/folders/${et}`);return this.checkHttpResponse(rt)}async deleteAll(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const st=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(st)}async trashAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/trash",rt);return this.checkHttpResponse(nt)}async restoreAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/restore",rt);return this.checkHttpResponse(nt)}async mapAssetIdToIds({application:et,assetIds:rt}){const st=await this.searchContext({application:et,pagination:{startIdx:0,pageSize:rt.length+1},types:[],filters:{},asset_id:rt});return rt.map(nt=>{const ot=st.resources.find(at=>at.assetId===nt);if(ot===void 0)throw"explorer.assetid.notfound";return ot.id})}async getThumbnailPath(et){if(typeof et>"u")return et;if(typeof et=="string")if(et.startsWith("blob:")){const rt=await fetch(et).then(st=>st.blob());return`/workspace/document/${(await this.context.workspace().saveFile(rt,{visibility:"protected",application:this.getApplication()}))._id}`}else return et;else return`/workspace/document/${(await this.context.workspace().saveFile(et,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(et){const rt={application:et.application,start_idx:et.pagination.startIdx,page_size:et.pagination.pageSize,trashed:et.trashed};if(et.types.length>0&&(rt.resource_type=et.types[0]),et.orders&&Object.entries(et.orders).length){const[[st,nt]]=Object.entries(et.orders);rt.order_by=`${st}:${nt}`}return et.filters&&Object.assign(rt,et.filters),typeof et.search=="string"&&(rt.search=et.search),typeof et.asset_id<"u"&&(rt.asset_id=[...et.asset_id]),typeof et.id<"u"&&(rt.id=et.id),rt}getResourceParams(et){return{application:et.application}}createFolderToBodyParams(et){return{application:et.application,resourceType:et.type,parentId:et.parentId,name:et.name}}moveToBodyParams(et){return{application:et.application,resourceType:this.getResourceType(),resourceIds:et.resourceIds,folderIds:et.folderIds}}};n$3(m$2,"registry",new ServiceRegistry),n$3(m$2,"register",m$2.registry.register.bind(m$2.registry)),n$3(m$2,"findService",m$2.registry.findService.bind(m$2.registry)),n$3(m$2,"findMainService",m$2.registry.findMainService.bind(m$2.registry)),n$3(m$2,"isRegistered",m$2.registry.isRegistered.bind(m$2.registry));let ResourceService=m$2;const APP$3="scrapbook",RESOURCE$3="scrapbook";class ScrapbookResourceService extends ResourceService{create(et){throw new Error("Method not implemented.")}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/scrapbook/${et.entId}`,{trashed:et.trashed?1:0,title:et.name,icon:rt,subTitle:et.description});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$3}getApplication(){return APP$3}getFormUrl(et){return et?`/scrapbook?folderid=${et}#/create-scrapbook/`:"/scrapbook#/create-scrapbook/"}getViewUrl(et){return`/scrapbook#/view-scrapbook/${et}`}getPrintUrl(et){return`/scrapbook/print#/print-scrapbook/${et}`}getEditUrl(et){return`/scrapbook#/edit-scrapbook/${et}`}getExportUrl(et){return`/scrapbook/exportHtml/${et}`}}ResourceService.register({application:RESOURCE$3,resourceType:RESOURCE$3},tt=>new ScrapbookResourceService(tt));const APP$2="homeworks",RESOURCE$2="homeworks";class HomeworksResourceService extends ResourceService{async create(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.post("/homeworks",{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats,folder:et.folder});return this.checkHttpResponse(st),{thumbnail:rt,entId:st._id}}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/homeworks/${et.entId}`,{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$2}getApplication(){return APP$2}getFormUrl(et){return et?`/homeworks?folderid=${et}#/create-homeworks/`:"/homeworks#/create-homeworks/"}getViewUrl(et){return`/homeworks#/view-homeworks/${et}`}getPrintUrl(et){return`/homeworks/print#/print-homeworks/${et}`}getEditUrl(et){return`/homeworks#/edit-homeworks/${et}`}getExportUrl(){throw new Error("Export not implemented.")}}ResourceService.register({application:RESOURCE$2,resourceType:RESOURCE$2},tt=>new HomeworksResourceService(tt));const APP$1="timelinegenerator",RESOURCE$1="timelinegenerator";class TimelineGeneratorResourceService extends ResourceService{async create(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",st=await this.http.post("/timelinegenerator/timelines",{headline:et.name,text:et.description,icon:rt,type:"default",folder:et.folder});return this.checkHttpResponse(st),st}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/timelinegenerator/timeline/${et.entId}`,{headline:et.name,text:et.description,icon:rt,trashed:!!et.trashed,_id:et.entId,type:"default"});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$1}getApplication(){return APP$1}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/timelinegenerator#/view/${et}`}getPrintUrl(et){return`/timelinegenerator/print#/print/${et}`}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$1,resourceType:RESOURCE$1},tt=>new TimelineGeneratorResourceService(tt));const APP$5="collaborativeeditor",RESOURCE$4="collaborativeeditor";class CollaborativeEditorResourceService extends ResourceService{async create(et){const{name:rt,description:st,thumbnail:nt,folder:ot}=et,at=nt?await this.getThumbnailPath(nt):"",lt=await this.http.post("/collaborativeeditor",{name:rt,description:st,thumbnail:at,folder:ot});return this.checkHttpResponse(lt),lt}async update(et){const{name:rt,description:st,thumbnail:nt,entId:ot}=et,at=await this.getThumbnailPath(nt),lt=await this.http.put(`/collaborativeeditor/${ot}`,{name:rt,description:st,thumbnail:at});return this.checkHttpResponse(lt),{thumbnail:at,entId:ot}}getResourceType(){return RESOURCE$4}getApplication(){return APP$5}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/collaborativeeditor#/view/${et}`}getPrintUrl(){throw new Error("Method not implemented.")}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$4,resourceType:RESOURCE$4},tt=>new CollaborativeEditorResourceService(tt));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,rt,st){if(mutexPromise[et]!==void 0&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const nt=rt();mutexPromise[et]=nt;const ot=await nt;return st(ot)&&(globalCache[et]=ot),ot}catch(nt){throw console.error(`Failed to retrieve value for: ${et}`,nt),nt}}clearCache(et){if(et)delete globalCache[et];else for(const rt in globalCache)globalCache.hasOwnProperty(rt)&&delete globalCache[rt]}async httpGet(et,rt){return this.fromCacheIfPossible(et,async()=>{const st=await this.http.get(et,rt),nt={...this.http.latestResponse};return{value:st,response:nt}},({response:st})=>!(st.status<200||st.status>=300))}async httpGetJson(et,rt){const{response:st,value:nt}=await this.httpGet(et,rt);if(st.status<200||st.status>=300)throw`Bad http status (${st.status}) for url: ${et}`;return nt}}class ConfService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get cdnDomain(){return configure.Platform.cdnDomain}get notify(){return this.context.notify()}async getConf(et){const[rt,st]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[nt,ot]=await Promise.all([this.getTheme({conf:rt,publicTheme:st===void 0}),this.getWebAppConf({app:et,applications:st??[]})]),at={app:et,applications:st??[],conf:rt,currentApp:ot,theme:nt};return this.notify.onAppConfReady().resolve(at),at}async getPublicConf(et){const{response:rt,value:st}=await this.cache.httpGet(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.APP_NOT_FOUND;return st}getCdnUrl(){}async savePreference(et,rt){this.http.putJson(`/userbook/preference/${et}`,rt)}async getPreference(et){const rt=await this.http.get(`/userbook/preference/${et}`);return this.http.isResponseError()||typeof rt=="string"?{}:JSON.parse(rt.preference)}async getThemeConf(et){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:et}},"exports.conf")}async getApplicationsList(){const et=await this.http.get("/applications-list");if(!(this.http.isResponseError()||typeof et=="string"))return et.apps}async getWebAppConf({app:et,applications:rt}){return rt.find(st=>{if(st!=null&&st.prefix)return(st==null?void 0:st.prefix.replace("/",""))===et})}async getTheme({version:et,conf:rt,publicTheme:st}){var nt;const ot=await this.http.get("/theme"),at=(nt=rt==null?void 0:rt.overriding)==null?void 0:nt.find(ft=>st?ft.parent==="theme-open-ent"&&ft.bootstrapVersion==="ode-bootstrap-neo":ft.child===(ot==null?void 0:ot.themeName)),lt=st?"default":(ot==null?void 0:ot.skinName)||(at==null?void 0:at.skins[0]),ut=(ot==null?void 0:ot.skin)||`/assets/themes/${at==null?void 0:at.child}/skins/${lt}/`,ct=at==null?void 0:at.skins,dt=at==null?void 0:at.bootstrapVersion.split("-").slice(-1)[0],ht=(at==null?void 0:at.parent)==="panda";return{basePath:`${this.cdnDomain}${ut}../../`,bootstrapVersion:dt,is1d:ht,logoutCallback:(ot==null?void 0:ot.logoutCallback)||"",skin:at==null?void 0:at.child,skinName:lt,skins:ct,themeName:at==null?void 0:at.child,themeUrl:ut,npmTheme:(at==null?void 0:at.npmTheme)??void 0}}async getLogoutCallback(et){const{response:rt,value:st}=await this.cache.httpGet("/theme",{queryParams:{_:et}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return st.logoutCallback}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,rt,st="100x100"){return rt==="user"?`/userbook/avatar/${et}?thumbnail=${st}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(et,rt){return rt==="user"?`/userbook/annuaire#/${et}`:`/userbook/annuaire#/group-view/${et}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:et,name:rt})=>({id:et,displayName:rt,members:[]}))}async getBookMarkById(et){const{groups:rt,id:st,name:nt,users:ot}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:st,displayName:nt,groups:rt.map(({name:at,id:lt,nbUsers:ut})=>({nbUsers:ut,displayName:at,id:lt})),users:ot.map(({displayName:at,id:lt,profile:ut})=>({profile:ut,displayName:at,firstName:"",lastName:"",login:"",id:lt}))}}async saveBookmarks(et,{bookmarks:rt,groups:st,users:nt}){this.cache.clearCache("/directory/sharebookmark/all");const ot=nt.map(ht=>typeof ht=="string"?ht:ht.id),at=st.map(ht=>typeof ht=="string"?ht:ht.id),lt=rt.map(async ht=>{if(typeof ht=="string"){const{displayName:ft,groups:xt,id:vt,users:yt}=await this.getBookMarkById(ht),Et=yt.map(wt=>wt.id),bt=xt.map(wt=>wt.id);return{displayName:ft,id:vt,members:[...bt,...Et]}}else return Promise.resolve(ht)}),ut=(await Promise.all(lt)).map(ht=>ht.members).reduce((ht,ft)=>[...ht,...ft],[]),ct={name:et,members:[...ot,...at,...ut]},{id:dt}=await this.http.postJson("/directory/sharebookmark",ct);return{id:dt,displayName:et,members:ct.members}}}const loadedScripts={};class HttpService{constructor(et,rt){n$3(this,"axios"),n$3(this,"baseUrl"),n$3(this,"headers",{}),n$3(this,"_latestResponse"),this.context=et,this.axios=axios.create(rt)}fixBaseUrl(et){return et.startsWith("http://")||et.startsWith("https://")?et:this.baseUrl?this.baseUrl.endsWith("/")||et.startsWith("/")?`${this.baseUrl}${et}`:`${this.baseUrl}/${et}`:et}useBaseUrl(et){return this.baseUrl=et,this}useHeaders(et){return this.headers=et,this}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);et.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams));const st=rt.headers??{};return rt.headers={...st,...this.headers},rt}else return this.axios.defaults}toCdnUrl(et){et=this.fixBaseUrl(et);const rt=this.context.conf().getCdnUrl()||"";if(rt.length>0&&et!=="/conf/public"){const st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}return et}mapAxiosError(et,rt){et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN};const{status:st,statusText:nt,headers:ot,data:at}=this._latestResponse;return rt!=null&&rt.disableNotifications||notify.events().publish(LAYER_NAME.TRANSPORT,{name:EVENT_NAME.ERROR_OCCURED,data:{params:rt,response:{status:st,statusText:nt,headers:ot},payload:at}}),at}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}async get(et,rt){try{const st=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async post(et,rt,st){try{const nt=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async postFile(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async postJson(et,rt,st){const nt=this.toAxiosConfig();nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async put(et,rt,st){try{const nt=await this.axios.put(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.put(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.put(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async patch(et,rt,st){try{const nt=await this.axios.patch(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.patch(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.patch(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async delete(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async deleteJson(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),{data:rt});return this.mapAxiosResponse(st)}catch(st){throw this.mapAxiosError(st)}}getScript(et,rt,st){const nt=st??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${nt.split(".")[0]}={};${at};return ${nt};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts[et]?Promise.resolve():this.getScript(et,rt).then(st=>{loadedScripts[et]=!0})}}class RightService{constructor(et){this.context=et}get session(){return this.context.session()}parseResourceRight(et){const rt=et.split(":");if(rt.length===2){if(rt[0]==="creator")return{id:rt[1],right:"creator",type:"creator"}}else return rt.length===3?{id:rt[1],right:rt[2],type:rt[0]}:void 0}parseResourceRights(et){return et.map(rt=>this.parseResourceRight(rt)).filter(rt=>rt!==void 0)}hasResourceRight({id:et,groupIds:rt},st,nt){const ot=nt.map(at=>typeof at=="string"?this.parseResourceRight(at):at).filter(at=>at!==void 0);for(const at of ot)if(at.id===et&&at.type==="creator"||at.id===et&&at.type==="user"&&at.right===st||rt.includes(at.id)&&at.type==="group"&&at.right===st)return!0;return!1}async sessionHasResourceRight(et,rt){try{const st=await this.session.getUser();return!!st&&this.hasResourceRight({groupIds:st.groupsIds,id:st.userId},et,rt)}catch(st){return console.error(`Unexpected error ${st} in sessionHasResourceRight()`),!1}}async sessionHasAtLeastOneResourceRight(et,rt){for(const st of et)if(await this.sessionHasResourceRight(st,rt))return!0;return!1}async sessionHasResourceRightForEachList(et,rt){let st=0;for(const nt of rt)await this.sessionHasResourceRight(et,nt)&&st++;return st===rt.length}async sessionHasAtLeastOneResourceRightForEachList(et,rt){for(const st of et){let nt=0;for(const ot of rt)await this.sessionHasResourceRight(st,ot)&&nt++;if(nt===rt.length)return!0}return!1}hasWorkflowRight(et,rt){return rt.findIndex(st=>st===et)!==-1}async sessionHasWorkflowRight(et){try{const rt=await this.session.getUser();return!!rt&&this.hasWorkflowRight(et,rt.authorizedActions.map(st=>st.name))}catch(rt){return console.error(`Unexpected error ${rt} in sessionHasWorkflowRight()`),!1}}async sessionHasWorkflowRights(et){const rt={};try{const st=await this.session.getUser();for(const nt of et)rt[nt]=!!st&&this.hasWorkflowRight(nt,st.authorizedActions.map(ot=>ot.name))}catch(st){console.error(`Unexpected error ${st} in sessionHasWorkflowRights()`);for(const nt of et)rt[nt]=!1}return rt}}class SessionService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get conf(){return this.context.conf()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const et=await this.getUser(),[rt,st,nt,ot,at]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:st,currentLanguage:rt,userDescription:nt,userProfile:ot,bookmarkedApps:at}}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),this.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}async logout(){const et=await this.conf.getLogoutCallback();return this.http.get("/auth/logout?callback="+et).finally(()=>{})}async latestQuotaAndUsage(et){const rt={quota:0,storage:0};if(!et)return rt;try{return await this.http.get(`/workspace/quota/user/${et==null?void 0:et.userId}`)}catch(st){return console.error(st),rt}}async getCurrentLanguage(et){const rt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let st;return rt?st=await this.loadUserLanguage():st=await this.loadDefaultLanguage(),st}catch(st){console.error(st)}}async loadUserLanguage(){try{const et=await this.http.get("/userbook/preference/language");return JSON.parse(et.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:et,value:rt}=await this.cache.httpGet("/auth/oauth2/userinfo");if(!(et.status<200||et.status>=300)&&typeof rt=="object")return rt;throw ERROR_CODE.NOT_LOGGED_IN}hasWorkflow({workflowName:et,user:rt}){return et===void 0||(rt==null?void 0:rt.authorizedActions.findIndex(st=>st.name===et))!==-1}async loadDescription(et){if(!et)return{};try{const[rt,st]=await Promise.all([this.getUserProfile({options:{requestName:"refreshAvatar"}}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...st,profiles:rt}}catch(rt){return console.error(rt),{}}}async getBookmarks(et){if(!et)return[];const rt=await this.http.get("/userbook/preference/apps");rt.preference||(rt.preference=null);const st=JSON.parse(rt.preference);let nt;nt=st,nt||(nt={bookmarks:[],applications:[]});const ot=[];return nt.bookmarks.forEach((at,lt)=>{const ut=((et==null?void 0:et.apps)||[]).find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);ot.push(ct)}}),ot}async getUserProfile(et={}){var rt,st;const{options:nt={},params:ot={}}=et,at=new URLSearchParams(ot).toString(),lt=`/userbook/api/person${at?`?${at}`:""}`,{response:ut,value:ct}=await this.cache.httpGet(lt,nt);return ut.status<200||ut.status>=300||typeof ct=="string"?["Guest"]:((st=(rt=ct==null?void 0:ct.result)==null?void 0:rt[0])==null?void 0:st.type)||["Guest"]}async isAdml(){const et=await this.getUser();return(et==null?void 0:et.functions.ADMIN_LOCAL)!==void 0}async getWebApp(et){const rt=await this.getUser();return rt==null?void 0:rt.apps.find(st=>{var nt;return st!=null&&st.prefix?(st==null?void 0:st.prefix.replace("/",""))===et||!1:st!=null&&st.address&&((nt=st.address)==null?void 0:nt.split("/")[1])===et||!1})}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(et){this.context=et}get http(){return this.context.http()}async getIdiom(et,rt){await Promise.all([this.addBundlePromise(et,"/i18n"),this.addBundlePromise(et,`/${rt}/i18n`)])}translate(et,rt){et=et??"";let st=bundle[et]===void 0?et:bundle[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et,rt){return this.loadBundlePromise(et,rt)}addBundle(et,rt,st){this.loadBundle(et,rt,st)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises[rt]}loadBundle(et,rt,st){const nt=promises[rt];if(nt)st&&nt.then(st).catch(st);else{const ot=new Promisified;promises[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),this.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle,lt),typeof st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle[rt]!="string"&&(bundle[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class StringUtils{static removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class ShareService{constructor(et){this.context=et}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(et,rt,st){const nt=StringUtils.removeAccents(st).toLowerCase(),ot=await this.cache.httpGetJson(`/${et}/share/json/${rt}?search=${st}`),at=ot.users.visibles.filter(({username:ut,firstName:ct,lastName:dt,login:ht})=>{const ft=StringUtils.removeAccents(dt||"").toLowerCase(),xt=StringUtils.removeAccents(ct||"").toLowerCase(),vt=StringUtils.removeAccents(ut||"").toLowerCase(),yt=StringUtils.removeAccents(ht||"").toLowerCase();return vt.includes(nt)||xt.includes(nt)||ft.includes(nt)||yt.includes(nt)}).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"user"),displayName:ut.username,id:ut.id,profile:ut.profile,type:"user"})),lt=ot.groups.visibles.filter(({name:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"group"),displayName:ut.name,id:ut.id,type:"group",structureName:ut.structureName}));return[...(await this.directory.getBookMarks()).filter(({displayName:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:ut.displayName,id:ut.id,type:"sharebookmark"})),...at,...lt]}async getShareMapping(et){const rt=await this.cache.httpGetJson(`/${et}/rights/sharing`);for(const st of Object.keys(rt))if(st.includes(".")){const nt=st.split(".")[1],ot=rt[st];delete rt[st],rt[nt]=ot}return rt}getActionsAvailableFor({id:et,type:rt},st,nt){const ot=(rt==="user"?st.users.checked[et]:st.groups.checked[et])||[],at=Object.keys(nt),lt=[];for(const ut of at)nt[ut].filter(ct=>ot.includes(ct)).length>0&<.push(ut);return lt}async getRightsForResource(et,rt){const st=await this.directory.getBookMarks(),nt=`/${et}/share/json/${rt}?search=`,ot=await this.cache.httpGetJson(nt),at=await this.getShareMapping(et),lt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),ut=Object.keys(ot.users.checked).map(xt=>ot.users.visibles.find(vt=>vt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const vt=this.getActionsAvailableFor({id:xt.id,type:"user"},ot,at);return{id:xt.id,type:"user",displayName:xt.username,profile:xt.profile,avatarUrl:this.directory.getAvatarUrl(xt.id,"user"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"user"),actions:vt.map(yt=>{const Et=lt[yt];return{displayName:yt,id:yt,priority:Et.priority}})}}).sort((xt,vt)=>(xt.displayName||"").localeCompare(vt.displayName)),ct=Object.keys(ot.groups.checked).map(xt=>ot.groups.visibles.find(vt=>vt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const vt=this.getActionsAvailableFor({id:xt.id,type:"group"},ot,at);return{id:xt.id,type:"group",displayName:xt.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(xt.id,"group"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"group"),actions:vt.map(yt=>{const Et=lt[yt];return{displayName:yt,id:yt,priority:Et.priority}})}}).sort((xt,vt)=>(xt.displayName||"").localeCompare(vt.displayName)),dt=[...ut,...ct],ht=ot.groups.visibles.map(({groupDisplayName:xt,id:vt,name:yt,labels:Et})=>({labels:Et,displayName:xt||yt,id:vt})),ft=ot.users.visibles.map(({id:xt,profile:vt,username:yt,firstName:Et,lastName:bt,login:wt})=>({displayName:yt,firstName:Et,lastName:bt,login:wt,profile:vt,id:xt}));return{rights:dt,visibleBookmarks:st,visibleGroups:ht,visibleUsers:ft}}async saveRights(et,rt,st){const nt=await this.getShareMapping(et),ot={bookmarks:{},groups:{},users:{}};for(const lt of st){const ut=lt.actions.map(dt=>nt[dt.id]).reduce((dt,ht)=>Array.isArray(ht)?[...dt,...ht]:dt,[]),ct=[...new Set(ut)];ct.length>0&&(lt.type==="user"?ot.users[lt.id]=ct:lt.type==="group"?ot.groups[lt.id]=ct:ot.bookmarks[lt.id]=ct)}const at=`/${et}/share/resource/${rt}`;return this.cache.clearCache(`/${et}/share/json/${rt}?search=`),await this.http.putJson(at,ot)}async getActionsForApp(et){const rt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),st=await this.getShareMapping(et);return Object.keys(rt).map(nt=>{const ot=rt[nt];return{displayName:nt,id:nt,priority:ot.priority,requires:ot.requires}}).filter(nt=>{var ot;return((ot=st[nt.id])==null?void 0:ot.length)>0}).sort((nt,ot)=>nt.priority-ot.priority)}}const defaultMappers={csv:function({type:tt,extension:et}){return a$2.INSTANCE.isCsvLike(tt,et)},doc:function({type:tt,extension:et}){return a$2.INSTANCE.isWordLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("wordprocessing")!==-1},xls:function({type:tt,extension:et}){return a$2.INSTANCE.isExcelLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("spreadsheet")!==-1||tt.indexOf("ms-excel")!==-1},img:function({type:tt}){return tt.indexOf("image")!==-1},pdf:function({type:tt}){return tt.indexOf("pdf")!==-1||tt==="application/x-download"},ppt:function({type:tt,extension:et}){return a$2.INSTANCE.isPowerpointLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("presentation")!==-1||tt.indexOf("powerpoint")!==-1},txt:function({type:tt,extension:et}){return a$2.INSTANCE.isTxtLike(tt,et)},md:function({type:tt,extension:et}){return a$2.INSTANCE.isMdLike(tt,et)},video:function({type:tt}){return tt.indexOf("video")!==-1},audio:function({type:tt}){return tt.indexOf("audio")!==-1},zip:function({type:tt}){return tt.indexOf("zip")!==-1||tt.indexOf("rar")!==-1||tt.indexOf("tar")!==-1||tt.indexOf("7z")!==-1}},R$1=class sm{static getRole(et){var rt,st;return sm.role((rt=et.metadata)==null?void 0:rt["content-type"],!1,(st=et.metadata)==null?void 0:st.extension)}static role(et,rt=!1,st){if(st&&(st=st.trim()),!et)return"unknown";this.roleMappers||console.warn("[DocumentHelper.role] should not have empty roles",this);const nt={type:et,previewRole:rt,extension:st};for(const ot of this.roleMappers){const at=ot(nt);if(at)return at}return"unknown"}};n$3(R$1,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=R$1;class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}extractMetadata(et){const rt=et.name||"",st=rt.split("."),nt=et.type||"application/octet-stream",ot=st.length>1?st[st.length-1]:"",at={"content-type":nt,filename:rt,size:et.size,extension:ot,role:DocumentHelper.role(nt,!1,ot)},lt=rt.replace("."+at.extension,""),ut=at.extension?lt+"."+at.extension:lt;return{basename:lt,fullname:ut,metadata:at}}async saveFile(et,rt){const{fullname:st,metadata:nt}=this.extractMetadata(et),ot=new FormData;ot.append("file",et,st);const at=[];((rt==null?void 0:rt.visibility)==="public"||(rt==null?void 0:rt.visibility)==="protected")&&at.push(`${rt.visibility}=true`),rt!=null&&rt.application&&at.push(`application=${rt.application}`),nt.role==="img"&&at.push("quality=1"),rt!=null&&rt.parentId&&at.push(`parentId=${rt.parentId}`);const lt=await this.http.postFile(`/workspace/document?${at.join("&")}`,ot);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return lt}async updateFile(et,rt,st){const{fullname:nt,metadata:ot}=this.extractMetadata(rt),at=new FormData;at.append("file",rt,nt);const lt=[];ot.role==="img"&<.push("quality=1"),st!=null&&st.alt&<.push(`alt=${st.alt}`),st!=null&&st.legend&<.push(`legend=${st.legend}`),st!=null&&st.name&<.push(`name=${st.name}`);const ut=await this.http.putFile(`/workspace/document/${et}?${lt.join("&")}`,at);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return ut}async deleteFile(et){const rt=et.map(st=>st._id);if(rt.length==0)Promise.resolve(null);else if(await this.http.deleteJson("/workspace/documents",{ids:rt}),this.http.isResponseError())throw this.http.latestResponse.statusText}async acceptDocuments(et){const rt=await this.context.session().getUser();return st=>st.deleted&&st.trasher?(rt==null?void 0:rt.userId)==st.trasher:!0}async searchDocuments(et){const rt=et.filter!=="external"||et.parentId?await this.http.get("/workspace/documents",{queryParams:{...et,_:new Date().getTime()}}):[],st=await this.acceptDocuments(et);return rt.filter(st)}async listDocuments(et,rt){return this.searchDocuments({filter:et,parentId:rt,includeall:!0})}async transferDocuments(et,rt,st="protected"){const nt=[];if(et.forEach(ot=>{(st==="public"&&!ot.public||!ot.public&&!ot.protected)&&nt.push(ot)}),nt.length>0){const ot=await this.http.post("/workspace/documents/transfer",{application:rt,visibility:st,ids:nt.map(at=>at._id)});if(this.http.isResponseError())throw this.http.latestResponse.statusText;return nt.forEach((at,lt)=>{const ut=et.findIndex(ct=>ct._id===at._id);0<=ut&&ut<et.length&&(et[ut]=ot[lt])}),et.filter(at=>!!at)}return et}getThumbnailUrl(et,rt=0,st=0){var nt,ot;const at=rt>0||st>0?`${rt}x${st}`:"120x120";if(typeof et=="string")return et.includes("data:image")||et.includes("thumbnail")?et:`${et}${et.includes("?")?"&":"?"}thumbnail=${at}`;{const lt=`/workspace/${et.public?"pub/":""}document/${et._id}?thumbnail=`,ut=et.thumbnails;if((ot=(nt=et.metadata)==null?void 0:nt["content-type"])!=null&&ot.includes("video")){const ct=ut&&Object.keys(ut).length>0?Object.keys(ut)[0]:null;return ct?lt+ct:null}else return lt+at}}listFolder(et,rt=!1,st,nt){const ot={filter:et,hierarchical:rt,parentId:st,directShared:nt};return this.http.get("/workspace/folders/list",{queryParams:ot})}listOwnerFolders(et,rt){return this.listFolder("owner",et,rt)}listSharedFolders(et,rt){return this.listFolder("shared",et,rt,!0)}createFolder(et,rt){const st=new FormData;return st.append("name",et),rt&&st.append("parentFolderId",rt),this.http.postFile("/workspace/folder",st)}}let ATTag;class AnalyticsService{constructor(tt){this.context=tt}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(tt,et){const[rt]=await Promise.all([this.getXitiConfig(et.name.toLowerCase()),this.loadXitiScript()]);if(!rt||!ATInternet)return;let st=rt.LIBELLE_SERVICE.default||null;for(const nt in rt.LIBELLE_SERVICE)if(nt!=="default"&&tt.indexOf(nt)>=0){st=rt.LIBELLE_SERVICE[nt];break}ATTag=new ATInternet.Tracker.Tag({site:rt.STRUCT_ID}),ATTag.setProps({SERVICE:st,TYPE:rt.TYPE,OUTIL:rt.OUTIL,UAI:rt.STRUCT_UAI,PROJET:rt.PROJET,EXPLOITANT:rt.EXPLOITANT,PLATEFORME:rt.PLATFORME,PROFIL:rt.PROFILE},!0),ATTag.identifiedVisitor.set({id:rt.ID_PERSO,category:rt.PROFILE}),ATTag.page.set({name:(et==null?void 0:et.prefix)==="userbook"?"directory":et==null?void 0:et.prefix,chapter1:"",chapter2:"",chapter3:"",level2:rt.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(tt){const[et,rt]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(et!=null&&et.type))throw ERROR_CODE.MALFORMED_DATA;return rt!=null&&rt.active&&(et.xiti=await this.getXitiTrackingParams(rt,tt)),et.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(tt,et){if(!tt.structureMap||!et)return;const rt=await this.session.getUser(),st=await this.session.getUserProfile();let nt;if(!(rt!=null&&rt.structures))return;for(const ct of rt.structures){const dt=tt.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:tt.ID_PROJET,EXPLOITANT:tt.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:tt.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st&&st.length>0?ut[st[0]]??"":""}}}const w$3=class X0{constructor(et){this.context=et}get http(){return this.context.http()}get conf(){return this.context.conf()}async getVideoConf(){var et;const rt=await this.conf.getPublicConf(APP$4.VIDEO);return{maxWeight:(rt==null?void 0:rt["max-videosize-mbytes"])??X0.MAX_WEIGHT,maxDuration:(rt==null?void 0:rt["max-videoduration-minutes"])??X0.MAX_DURATION,acceptVideoUploadExtensions:((et=rt==null?void 0:rt["accept-videoupload-extensions"])==null?void 0:et.map(st=>st.toUpperCase()))??[]}}async upload({data:et,appCode:rt,captation:st,duration:nt}){if(!et.file)throw new Error("Invalid video file.");if(!et.filename)throw new Error("Invalid video filename");const ot=`${et.browser.name} ${et.browser.version}`,at=new FormData;at.append("device",et.device||""),at.append("browser",ot),at.append("url",et.url),at.append("app",rt),at.append("file",et.file,et.filename),at.append("weight",""+et.file.size),at.append("captation",""+st);let lt=`/video/encode?captation=${st}`;nt&&(lt+=`&duration=${nt}`);const ut=await this.http.post(lt,at,{headers:{"Content-Type":"multipart/form-data"}});if(ut.state=="running"){let ct=0,dt=1;do{const ht=dt+ct;await new Promise(xt=>setTimeout(xt,ht*1e3)),ct=dt,dt=Math.min(8,ht);const ft=await this.http.get(`/video/status/${ut.processid}`);if(ft.state=="succeed")return ft.videoworkspaceid&&ft.videosize&&this.context.data().trackVideoSave(ft.videoworkspaceid,Math.round(nt),ft.videosize,st,et.url,ot,et.device),ft;if(ft.state=="error")break}while(!0)}throw new Error("Video cannot be uploaded.")}};n$3(w$3,"MAX_WEIGHT",50),n$3(w$3,"MAX_DURATION",3);let VideoService=w$3;class EmbedderService{constructor(et){this.context=et}get http(){return this.context.http()}async getDefault(){return this.http.get("/infra/embed/default")}async getCustom(){return this.http.get("/infra/embed/custom")}getProviderFromUrl(et,rt){for(const st of et)if(this.isUrlFromProvider(rt,st))return st}urlIsFromPattern(et,rt){const st=new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)","g"),nt=new RegExp("{[^}]*}","g");let ot=!0;const at=rt.match(st)||[],lt=[];return(rt.match(nt)||[]).forEach((ut,ct)=>{ut.includes("ignore")||lt.push(at[ct])}),lt.forEach(ut=>{if(!et.includes(ut)){ot=!1;return}}),ot}isUrlFromProvider(et,rt){typeof rt.url=="string"&&(rt.url=[rt.url]);for(const st of rt.url)if(this.urlIsFromPattern(et,st))return!0;return!1}getEmbedCodeForProvider(et,rt){for(const st of et.url)if(this.urlIsFromPattern(rt,st)){const nt=new RegExp("{[a-zA-Z0-9_.]+}","g"),ot=st.match(nt)||[];let at=et.embed;for(const lt of ot){let ut=st.split(lt)[0];const ct=ut.split("}");ct.length>1&&(ut=ct[ct.length-1]);let dt=rt.split(ut)[1];if(!dt)continue;const ht=st.split(lt)[1].split("{")[0];ht&&(dt=dt.split(ht)[0]);const ft=new RegExp("\\"+lt.replace(/}/,"\\}"),"g");at=at.replace(ft,dt)}return at}return""}}class AbstractBehaviourService{constructor(et){n$3(this,"_cache"),this.context=et,this._cache=new CacheService(this.context)}getApplication(){return this.APP}getResourceType(){return this.RESOURCE}httpGet(et,rt){return this._cache.httpGetJson(et,rt)}dataToResource({modified:et,...rt}){const st=typeof et=="string"?et:et!=null&&et.$date?""+et.$date:"";return{application:this.RESOURCE,name:rt.title,creatorId:rt.owner,creatorName:rt.ownerName,thumbnail:rt.icon,assetId:rt._id,modifiedAt:st,shared:rt.shared,path:rt.path}}}class ActualitesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","actualites"),n$3(this,"RESOURCE","actualites")}async loadResources(){return(await this.httpGet("/actualites/linker/infos")).map(et=>{let rt;return et.thread_icon?rt=et.thread_icon+"?thumbnail=48x48":rt="/img/icons/glyphicons_036_file.png",this.dataToResource({title:et.title+" ["+et.thread_title+"]",ownerName:et.username,owner:et.owner,icon:rt,path:"/actualites#/view/thread/"+et.thread_id+"/info/"+et._id,_id:`${et.thread_id}#${et._id}`,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class BlogBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","blog"),n$3(this,"RESOURCE","blog")}loadResources(){return new Promise(async(et,rt)=>{try{const st=await this.httpGet("/blog/linker"),nt=[];st.forEach(ot=>{ot.thumbnail?ot.thumbnail=ot.thumbnail+"?thumbnail=48x48":ot.thumbnail="/img/illustrations/blog.svg";const at=ot.fetchPosts.map(lt=>this.dataToResource({owner:ot.author.userId,ownerName:ot.author.username,title:lt.title+" ["+ot.title+"]",_id:`${ot._id}#${lt._id}`,icon:ot.thumbnail,path:`/blog/id/${ot._id}/post/${lt._id}`,shared:!!(ot.shared&&ot.shared.length>=0),modified:ot.modified}));nt.push(...at)}),et(nt)}catch(st){rt(st)}})}}class CollaborativewallBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","collaborativewall"),n$3(this,"RESOURCE","collaborativewall")}async loadResources(){return(await this.httpGet("/collaborativewall/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.icon?et.icon:"/img/illustrations/collaborative-wall-default.png",path:"/collaborativewall#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class CommunityBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","community"),n$3(this,"RESOURCE","community")}async loadResources(){return(await this.httpGet("/community/listallpages")).map(et=>{let rt;return typeof et.thumbnail>"u"||et.thumbnail===""?rt="/img/icons/glyphicons_036_file.png":rt=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:et.name,icon:rt,path:"/community#/view/"+et.id,_id:et.id,owner:"",ownerName:"",shared:!!(et.shared&&et.shared.length>=0),modified:et.name})})}}class ExercizerBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","exercizer"),n$3(this,"RESOURCE","exercizer")}async loadResources(){return(await this.httpGet("/exercizer/subjects-scheduled")).map(et=>{const rt=et.picture?et.picture+"?thumbnail=48x48":"/img/illustrations/exercizer.svg";let st,nt=!1;const ot=JSON.parse(et.scheduled_at);return ot.groupList.length>0?(nt=!0,st=ot.groupList[0].name):ot.userList.length>0?(nt=!0,st=ot.userList[0].name):st="",ot.groupList.length+ot.userList.length>1&&(st+="..."),this.dataToResource({title:et.title,owner:et.owner,ownerName:st,icon:rt,path:"/exercizer#/linker/"+et.id,_id:""+et.id,shared:nt,modified:et.modified})})}}class FormulaireBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","formulaire"),n$3(this,"RESOURCE","formulaire")}async loadResources(){return(await this.httpGet("/formulaire/forms/linker")).map(et=>(et.picture||(et.picture="/formulaire/public/img/logo.svg"),this.dataToResource({_id:""+et.id,icon:et.picture,title:et.title,ownerName:et.owner_name,owner:et.owner_id,path:et.is_public?`${window.location.origin}/formulaire-public#/form/${et.public_key}`:`${window.location.origin}/formulaire#/form/${et.id}/${et.rgpd?"rgpd":"new"}`,shared:!!(et.shared&&et.shared.length>=0),modified:""+et.date_modification})))}}class ForumBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","forum"),n$3(this,"RESOURCE","forum")}async loadResources(){return(await this.httpGet("/forum/categories")).map(et=>this.dataToResource({_id:et._id,title:et.name,icon:et.icon||"/img/illustrations/forum.svg",path:"/forum#/view/"+et._id,ownerName:et.owner.displayName,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class HomeworksBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","homeworks"),n$3(this,"RESOURCE","homeworks")}async loadResources(){return(await this.httpGet("/homeworks/list")).filter(et=>et.owner&&et.trashed===0).map(et=>this.dataToResource({title:et.title,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/homeworks.svg",path:"/homeworks#/view-homeworks/"+et._id,_id:""+et._id,shared:typeof et.shared<"u",modified:et.modified}))}}class MagnetoBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","magneto"),n$3(this,"RESOURCE","magneto")}async loadResources(){const{all:et}=await this.httpGet("/magneto/boards/editable");return et.map(rt=>this.dataToResource({_id:rt._id,title:rt.title,icon:rt.imageUrl,owner:rt.ownerId,ownerName:rt.ownerName,path:`/magneto#/board/${rt._id}/view`,shared:!!(rt.shared&&rt.shared.length>=0),modified:""+rt.modificationDate}))}}class MindmapBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","mindmap"),n$3(this,"RESOURCE","mindmap")}async loadResources(){return(await this.httpGet("/mindmap/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/mindmap-default.png",path:"/mindmap#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class PagesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","pages"),n$3(this,"RESOURCE","pages")}async loadResources(){const et=await this.httpGet("/pages/list/all"),rt=[];return et.forEach(st=>{var nt;const ot=st.thumbnail?st.thumbnail+"?thumbnail=48x48":"/img/illustrations/pages.svg";rt.push(this.dataToResource({title:st.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id,_id:st._id,shared:typeof st.shared<"u",modified:st.modified})),(nt=st.pages)==null||nt.forEach(at=>{rt.push(this.dataToResource({title:at.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id+"/"+at.titleLink,_id:st._id+"/"+at.titleLink,shared:typeof st.shared<"u",modified:st.modified}))})}),rt}}class PollBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","poll"),n$3(this,"RESOURCE","poll")}async loadResources(){return(await this.httpGet("/poll/list/all")).map(et=>{const rt=et.icon?et.icon+"?thumbnail=48x48":"/img/icons/glyphicons_036_file.png";return this.dataToResource({title:et.question,ownerName:et.owner.displayName,icon:rt,path:"/poll#/view/"+et._id,_id:et._id,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class ScrapbookBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","scrapbook"),n$3(this,"RESOURCE","scrapbook")}async loadResources(){return(await this.httpGet("/scrapbook/list/all")).map(et=>{const rt=et.icon||"/img/illustrations/scrapbook.svg";return this.dataToResource({title:et.name,owner:et.owner.userId,ownerName:et.owner.displayName,icon:rt,path:"/scrapbook#/view-scrapbook/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class TimelinegeneratorBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","timelinegenerator"),n$3(this,"RESOURCE","timelinegenerator")}loadResources(){return new Promise(async(et,rt)=>{try{const st=(await this.httpGet("/timelinegenerator/timelines")).map(nt=>{const ot=nt.icon||"/img/illustrations/timeline-default.png";return this.dataToResource({title:nt.headline,ownerName:nt.owner.displayName,owner:nt.owner.userId,icon:ot,path:"/timelinegenerator#/view/"+nt._id,_id:nt._id,shared:typeof nt.shared<"u",modified:nt.modified})});et(st)}catch(st){rt(st)}})}}class WikiBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","wiki"),n$3(this,"RESOURCE","wiki")}async loadResources(){return(await this.httpGet("/wiki/listallpages?visible=true")).map(et=>et.pages.map(rt=>{let st;return typeof et.thumbnail>"u"||et.thumbnail===""?st="/img/icons/glyphicons_036_file.png":st=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:rt.title+" ["+et.title+"]",ownerName:et.owner.displayName,owner:et.owner.userId,icon:st,path:"/wiki#/view/"+et._id+"/"+rt._id,_id:`${et._id}#${rt._id}`,shared:typeof et.shared<"u",modified:rt.modified})})).flat()}}class WorkspaceBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$3(this,"APP","workspace"),n$3(this,"RESOURCE","workspace")}loadResources({search:et,asset_id:rt}){return new Promise(async(st,nt)=>{try{let ot="/workspace/documents?filter=all&hierarchical=true";rt&&rt.length?ot+=`&search=${et}`:et&&et.length&&(ot+=`&search=${et}`);const at=(await this.httpGet(ot)).filter(lt=>!lt.deleted).map(lt=>{const ut=lt.metadata["content-type"]&<.metadata["content-type"].indexOf("image")!==-1?`/workspace/document/${lt._id}?thumbnail=120x120`:"/img/icons/unknown-large.png";return this.dataToResource({title:lt.name,ownerName:lt.ownerName,owner:lt.owner,icon:ut,path:`/workspace/document/${lt._id}`,_id:lt._id,shared:!!(lt.shared&<.shared.length>=0),modified:lt.modified})});st(at)}catch(ot){nt(ot)}})}}const b$1=class{static async initialize(et,rt){const st=et.http();if(!this.resourceProducingApps.length){this.resourceProducingApps=[rt,"workspace"];try{const[nt,ot]=await Promise.all([st.get("/resources-applications"),et.session().getUser()]);ot!=null&&ot.apps&&nt!=null&&nt.length&&(this.resourceProducingApps=nt.filter(at=>ot.apps.some(lt=>lt.address.includes(at))))}catch(nt){console.warn("Failed to load resource-producing apps:",nt)}}return this.resourceProducingApps}static registerCustomBehaviour(et,rt,st){this.registry.register({application:et,resourceType:rt},st)}static async registerBehaviours(et){this.resourceProducingApps.forEach(rt=>{const st={application:et,resourceType:rt};this.registry.register(st,nt=>this.serviceFor(nt,et,rt))})}static serviceFor(et,rt,st){let nt;switch(st){case"timelinegenerator":nt=new TimelinegeneratorBehaviour(et);break;case"workspace":nt=new WorkspaceBehaviour(et);break;case"blog":nt=new BlogBehaviour(et);break;case"actualites":nt=new ActualitesBehaviour(et);break;case"wiki":nt=new WikiBehaviour(et);break;case"pages":nt=new PagesBehaviour(et);break;case"poll":nt=new PollBehaviour(et);break;case"community":nt=new CommunityBehaviour(et);break;case"mindmap":nt=new MindmapBehaviour(et);break;case"forum":nt=new ForumBehaviour(et);break;case"homeworks":nt=new HomeworksBehaviour(et);break;case"scrapbook":nt=new ScrapbookBehaviour(et);break;case"collaborativewall":nt=new CollaborativewallBehaviour(et);break;case"exercizer":nt=new ExercizerBehaviour(et);break;case"formulaire":nt=new FormulaireBehaviour(et);break;case"magneto":nt=new MagnetoBehaviour(et);break;default:throw ERROR_CODE.NOT_SUPPORTED}return nt.APP=rt,nt}};n$3(b$1,"registry",new ServiceRegistry),n$3(b$1,"findBehaviour",b$1.registry.findService.bind(b$1.registry)),n$3(b$1,"hasBehaviour",b$1.registry.isRegistered.bind(b$1.registry)),n$3(b$1,"resourceProducingApps",[]);let SnipletsService=b$1;const SEND_ALL="*";class WebBroker{constructor(et){n$3(this,"subscription"),this.odeServices=et}get http(){return this.odeServices.http()}get events(){return this.odeServices.notify().events()}dispatchEvent(et,rt){rt.findIndex(st=>SEND_ALL===st||et.data["event-type"]===st)>=0&&this.http.post("/infra/event/web/store",et.data,{disableNotifications:!0})}initialize(et){if(et===void 0||et.send===void 0||et.send.length>0){const rt=(et==null?void 0:et.send)??[SEND_ALL];this.subscription=this.events.subscribe(LAYER_NAME.WEB_DATA,st=>this.dispatchEvent(st,rt))}return this}destroy(){this.subscription&&(this.subscription.revoke(),delete this.subscription)}}class DataService{constructor(et){n$3(this,"_webBroker"),n$3(this,"app"),n$3(this,"user"),n$3(this,"profile"),this.odeServices=et}get conf(){return this.odeServices.conf()}get notify(){return this.odeServices.notify()}async initialize(){try{const{app:et}=await this.notify.onAppConfReady().promise;this.app=et,this.user=await this.odeServices.session().getUser(),this.profile=await this.odeServices.session().getUserProfile();const{["data-service"]:rt}=await this.conf.getPublicConf(et);this._webBroker=new WebBroker(this.odeServices).initialize(rt==null?void 0:rt.web)}catch{console.log("DataService not initialized, usage data unavailable.")}}predestroy(){this._webBroker&&(this._webBroker.destroy(),delete this._webBroker)}trackWebEvent(et){this.notify.events().publish(LAYER_NAME.WEB_DATA,{name:EVENT_NAME.DATA_TRACKED,data:et})}addUserInfos(et){return this.user&&(et.userId=this.user.userId,et.structure=this.user.structureNames[0]),this.profile&&(et.profil=this.profile[0]),et}trackVideoSave(et,rt,st,nt,ot,at,lt){const ut=this.addUserInfos({"event-type":"VIDEO_SAVE",module:this.app||"video",video_id:et,browser:at,duration:Math.round(rt),weight:st,source:nt?"CAPTURED":"UPLOADED",url:ot});lt&&(ut.device_type=lt),this.trackWebEvent(ut)}trackVideoRead(et,rt,st,nt,ot){const at=this.addUserInfos({"event-type":"VIDEO_READ",module:"video",video_id:et,browser:nt,source:rt?"CAPTURED":"UPLOADED",url:st});this.app&&(at["override-module"]=this.app),ot&&(at.device_type=ot),this.trackWebEvent(at)}trackSpeechAndText(et){const rt=this.addUserInfos({"event-type":"SPEECH_AND_TEXT",function:et});this.app&&(rt.module=this.app),this.trackWebEvent(rt)}trackAccessLibraryFromExplorer(){const et=this.addUserInfos({"event-type":"ACCESS_LIBRARY_FROM_EXPLORER"});this.app&&(et.module=this.app),this.trackWebEvent(et)}}class ReactionsService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get http(){return this.context.http()}async loadAvailableReactions(){try{const{"reaction-types":et}=await this.context.conf().getPublicConf("audience");return Array.isArray(et)?et:void 0}catch{console.error("Audience configuration not found");return}}async loadReactionSummaries(et){const rt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt.reactionsByResource}async loadReactionDetails(et,rt,st){const nt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}/${et}?page=${rt}&size=${st}`);return this.http.isResponseError()?void 0:nt}async deleteReaction(et){await this.http.delete(`/audience/reactions/${this.module}/${this.resourceType}/${et}`)}async updateReaction(et,rt){await this.http.putJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}async createReaction(et,rt){await this.http.postJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}}class ViewsService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get http(){return this.context.http()}async getCounters(et){const rt=await this.http.get(`/audience/views/count/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt}async getDetails(et){const rt=await this.http.get(`/audience/views/details/${this.module}/${this.resourceType}/${et}`);return this.http.isResponseError()?void 0:rt}trigger(et){return this.http.post(`/audience/views/${this.module}/${this.resourceType}/${et}`)}}class AudienceService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get views(){return new ViewsService(this.context,this.module,this.resourceType)}get reactions(){return new ReactionsService(this.context,this.module,this.resourceType)}}class OdeServices{constructor(){n$3(this,"_analytics"),n$3(this,"_cache"),n$3(this,"_conf"),n$3(this,"_data"),n$3(this,"_directory"),n$3(this,"_http"),n$3(this,"_idiom"),n$3(this,"_notify"),n$3(this,"_rights"),n$3(this,"_session"),n$3(this,"_share"),n$3(this,"_video"),n$3(this,"_workspace"),n$3(this,"_embedder"),this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._data=new DataService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._notify=NotifyFrameworkFactory.instance(),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._video=new VideoService(this),this._workspace=new WorkspaceService(this),this._embedder=new EmbedderService(this)}initialize(){return this._data.initialize(),this}analytics(){return this._analytics}audience(et,rt){return new AudienceService(this,et,rt)}cache(){return this._cache}conf(){return this._conf}data(){return this._data}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}notify(){return this._notify}resource(et,rt){return rt?ResourceService.findService({application:et,resourceType:rt},this):ResourceService.findMainService({application:et},this)}behaviour(et,rt){return SnipletsService.findBehaviour({application:et,resourceType:rt},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}video(){return this._video}workspace(){return this._workspace}embedder(){return this._embedder}}const ACTION={OPEN:"open",MANAGE:"manage",UPD_PROPS:"properties",DELETE:"delete",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PUBLISH:"publish"},FOLDER={BIN:"bin",DEFAULT:"default"},SORT_ORDER={DESC:"desc"},odeServices=new OdeServices().initialize(),WIDGET_POSITION={LEFT:"left",RIGHT:"right"},isActionAvailable=(tt,et)=>{const rt=et==null?void 0:et.filter(st=>st.id===tt&&st.available);return rt&&rt.length>0},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140};class WidgetFramework{constructor(){n$3(this,"_initialized"),n$3(this,"_widgets",[]),n$3(this,"_userPrefs",{})}initialize(et,rt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(st=>{var nt;st&&st.widgets?(st.widgets.forEach(ot=>{this._widgets.push(new Widget(ot))}),this.loadUserPrefs().then(()=>{var ot;(ot=this._initialized)==null||ot.resolve()}).catch(ot=>{var at;(at=this._initialized)==null||at.reject()})):(nt=this._initialized)==null||nt.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(et){return this._widgets.find(rt=>rt.platformConf.name===et)}lookupDefaultPosition(et){return defaultWidgetPosition[et]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(et=>this.applyUserPrefs(et))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().publish(LAYER_NAME.WIDGETS,{name:EVENT_NAME.USERPREF_CHANGED})})}async applyUserPrefs(et){this._userPrefs=et??this._userPrefs;const rt=configure.Platform.theme,st=[];rt.listSkins().then(nt=>{var ot;const at=((ot=nt.find(ut=>ut.child===rt.skin))==null?void 0:ot.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((ut,ct)=>{const dt=ut.platformConf.name;return at.indexOf(dt)!==-1?!1:(this._userPrefs[dt]||(this._userPrefs[dt]={index:defaultWidgetOrder[dt]??999,show:!0,position:ut.platformConf.position}),ut.platformConf.mandatory&&(this._userPrefs[dt].show=!0,this._userPrefs[dt].index=defaultWidgetOrder[dt]??999),ut.platformConf.i18n&&st.push(ut.platformConf.i18n),ut.applyUserPref(this._userPrefs[dt]),!0)});const lt=new Idiom;this._widgets=this._widgets.sort((ut,ct)=>{const dt=lt.translate(`timeline.settings.${ut.platformConf.name}`).toLowerCase(),ht=lt.translate(`timeline.settings.${ct.platformConf.name}`).toLowerCase();return dt<ht?-1:dt>ht?1:0})})}}class Widget{constructor(et){n$3(this,"_schoolConf",{}),n$3(this,"_userPref"),this._platformConf=et,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(et){this._userPref=et,this._userPref.position=this._userPref.position??widgets.lookupDefaultPosition(this._platformConf.name)??"left"}}const widgets=new WidgetFramework,SvgIconFolder=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.057 5.5A.057.057 0 0 0 3 5.557v13.03h18V7.875h-8.697a1 1 0 0 1-1-1c0-.759-.615-1.374-1.374-1.374zM1 5.557C1 4.42 1.92 3.5 3.057 3.5h6.872c1.515 0 2.797.999 3.223 2.374H21a2 2 0 0 1 2 2v10.714a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2z",clipRule:"evenodd"})]}),SvgIconRafterDown=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.012 7.871a1.5 1.5 0 0 1 2.117.141L12 14.722l5.871-6.71a1.5 1.5 0 1 1 2.258 1.976l-7 8a1.5 1.5 0 0 1-2.258 0l-7-8a1.5 1.5 0 0 1 .141-2.117",clipRule:"evenodd"})]}),TreeNode=({node:tt,showIcon:et,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt,handleItemAction:ut})=>{const ct=st.has(tt.id),dt=nt==null?void 0:nt.current.has(tt.id),ht=rt===tt.id,ft=ot===tt.id,xt={action:clsx("action-container d-flex align-items-center gap-8 px-2",{"drag-focus":ft,"py-4":!tt.section}),arrow:clsx({"py-4":!tt.section,"py-8":tt.section,invisible:!Array.isArray(tt.children)||tt.children.length===0}),button:clsx("flex-fill d-flex align-items-center text-truncate gap-8",{"py-8":tt.section})},vt=tt.section?16:12,{t:yt}=useTranslation(),{setNodeRef:Et}=useDroppable({id:reactExports.useId(),data:{id:tt.id,name:tt.name,isTreeview:!0,accepts:["folder","resource"]}}),bt=Pt=>at==null?void 0:at(Pt),wt=Pt=>lt==null?void 0:lt(Pt),St=Pt=>ut==null?void 0:ut(Pt),Rt=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),at==null||at(tt.id))},Ct=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),lt==null||lt(tt.id))},It=Pt=>jsxRuntimeExports.jsx(Pt?SvgIconRafterDown:SvgIconRafterRight,{title:yt("foldUnfold"),width:vt,height:vt}),jt=()=>{var Pt;const Ot=!((Pt=nt==null?void 0:nt.current)!=null&&Pt.has(tt.id)),Ut=Array.isArray(tt.children)&&tt.children.length>0;return dt||Ot&&Ut};return jsxRuntimeExports.jsx("li",{ref:Et,id:`treeitem-${tt.id}`,role:"treeitem","aria-selected":ht&&ht,"aria-expanded":ct&&ct,children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:xt.action,children:[jsxRuntimeExports.jsx("div",{className:xt.arrow,tabIndex:0,role:"button",onClick:()=>wt(tt.id),onKeyDown:Ct,"aria-label":yt("foldUnfold"),children:jt()&&It(ct)}),jsxRuntimeExports.jsxs("div",{tabIndex:0,role:"button",className:xt.button,onClick:()=>bt(tt.id),onKeyDown:Rt,children:[tt.section&&et&&jsxRuntimeExports.jsx(SvgIconFolder,{title:yt("folder"),width:20,height:20}),jsxRuntimeExports.jsx("span",{className:"text-truncate",children:tt.name})]}),tt.section&&ut&&jsxRuntimeExports.jsx("button",{className:"tree-btn mx-8",onClick:()=>St(tt.id),children:jsxRuntimeExports.jsx(SvgIconPlus,{height:16,width:16})})]}),Array.isArray(tt.children)&&!!tt.children.length&&ct&&jsxRuntimeExports.jsx("ul",{role:"group",children:tt.children.map(Pt=>jsxRuntimeExports.jsx(TreeNode,{node:Pt,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt},Pt.id))})]})},tt.id)};var __defProp=Object.defineProperty,__defNormalProp=(tt,et,rt)=>et in tt?__defProp(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,__publicField=(tt,et,rt)=>__defNormalProp(tt,typeof et!="symbol"?et+"":et,rt);function findTreeNode(tt,et){if(et(tt))return tt;if(Array.isArray(tt.children))for(const rt of tt.children){const st=findTreeNode(rt,et);if(st)return st}}function findNodeById(tt,et){if(Array.isArray(tt))for(const rt of tt){const st=findNodeById(rt,et);if(st)return st}else{if(tt.id===et)return tt;if(tt.children)for(const rt of tt.children){const st=findNodeById(rt,et);if(st)return st}}}function addNode(tt,{parentId:et,newFolder:rt}){return modifyNode(tt,st=>{var nt;if(st.id===et){const ot=[...((nt=st.folder)==null?void 0:nt.ancestors)||[]],at=arrayUnique([...ot,st.id]);return{...st,children:[...st.children||[],new TreeNodeFolderWrapper({...rt,ancestors:at})]}}else return st})}function arrayUnique(tt){return tt.filter((et,rt)=>tt.indexOf(et)===rt)}function deleteNode(tt,{folders:et}){return modifyNode(tt,rt=>{if(!et.includes(rt.id))return rt})}const findParentNode=(tt,et)=>{if(tt.children)for(const rt of tt.children){if(rt.id===et)return tt;const st=findParentNode(rt,et);if(st)return st}};function getAncestors(tt,et){var rt;const st=findNodeById(tt,et);return(rt=st==null?void 0:st.folder)!=null&&rt.ancestors?[...(st==null?void 0:st.folder.ancestors)||[],et]:et===FOLDER.BIN?[FOLDER.BIN]:[FOLDER.DEFAULT]}function modifyNode(tt,et){return doModify(tt,et)||tt}function doModify(tt,et,rt){var st;const nt=et(tt,rt);if((st=nt==null?void 0:nt.children)!=null&&st.length){const ot=[];for(const at of(nt==null?void 0:nt.children)||[]){const lt=doModify(at,et,nt);lt&&ot.push(lt)}return{...nt,children:ot}}return nt}function moveNode(tt,{destinationId:et,folders:rt}){return modifyNode(tt,(st,nt)=>{var ot,at;if(et===st.id){const lt=[...((ot=st.folder)==null?void 0:ot.ancestors)||[]],ut=arrayUnique([...lt,st.id]),ct=[...st.children||[]],dt=((at=st.children)==null?void 0:at.map(ht=>ht.id))||[];for(const ht of rt)if(!dt.includes(ht)){const ft=findNodeById(st,ht);ft&&ct.push({...ft,folder:{...ft==null?void 0:ft.folder,ancestors:ut}})}return{...st,children:ct}}else return rt.includes(st.id)&&et!==(nt==null?void 0:nt.id)?void 0:st})}const wrapTreeNode=(tt,et,rt)=>modifyNode(tt,st=>(st.id===rt&&(st.children=et==null?void 0:et.map(nt=>new TreeNodeFolderWrapper(nt))),st));function updateNode(tt,{folderId:et,newFolder:rt}){return modifyNode(tt,st=>st.id===et?new TreeNodeFolderWrapper(rt):st)}function findPathById(tt,et){let rt=[];function st(ot,at){if(ot.id===et)return rt=at.concat(ot.id),!0;if(ot.children){for(const lt of ot.children)if(st(lt,at.concat(ot.id)))return!0}return!1}function nt(ot){if(Array.isArray(ot)){for(const at of ot)if(st(at,[]))break}else st(ot,[])}return nt(tt),rt}class TreeNodeFolderWrapper{constructor(et){__publicField(this,"id"),__publicField(this,"name"),__publicField(this,"childNumber"),__publicField(this,"section",!1),__publicField(this,"children",[]),this.folder=et,this.id=et.id,this.name=et.name,this.childNumber=et.childNumber}}const useTreeView=({data:tt,ref:et,externalSelectedNodeId:rt,draggedNode:st,allExpandedNodes:nt,onTreeItemUnfold:ot,onTreeItemFold:at,onTreeItemClick:lt})=>{const[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(new Set),ft=reactExports.useRef(new Set),[xt,vt]=reactExports.useState(void 0),yt=ut??rt;function Et(Nt){var Ht;Array.isArray(Nt)?Nt.forEach(Lt=>{const kt=new Set(ft.current);Nt.filter(({id:$t})=>$t!==Lt.id).some($t=>$t.children&&$t.children.length>0)&&kt.add(Lt.id),Lt.children&&Lt.children.length>0&&Lt.children.forEach($t=>{var Ft;const Gt=(Ft=Lt.children)==null?void 0:Ft.filter(({id:Mt})=>Mt!==$t.id);Gt!=null&&Gt.some(Mt=>Mt.children&&Mt.children.length>0)&&kt.add($t.id),Et($t)})}):(Ht=Nt.children)==null||Ht.forEach(Lt=>{var kt;const $t=new Set(ft.current),Ft=(kt=Nt.children)==null?void 0:kt.filter(Gt=>Gt.id!==Lt.id);Ft!=null&&Ft.some(Gt=>Gt.children&&Gt.children.length>0)&&($t.add(Lt.id),ft.current=$t),Et(Lt)})}const bt=Nt=>{const Ht=new Set("");tt&&Array.isArray(tt)&&Nt&&(tt.forEach(Lt=>{Ht.add(Lt.id)}),ht(Ht))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{st!=null&&st.isOver&&st.isTreeview?(st.overId&&Ut(st.overId),vt(st.overId)):vt(void 0)},[st]);const wt=reactExports.useMemo(()=>({unselectAll(){ct(void 0)},select(Nt){Pt(Nt)},allExpandedNodes(){bt(nt)}}),[]);reactExports.useImperativeHandle(et,()=>wt,[wt]),reactExports.useEffect(()=>{bt(nt)},[]),reactExports.useEffect(()=>{rt&&!nt?(St(rt),ct(rt)):ct(void 0)},[rt]);const St=Nt=>{if(!findNodeById(tt,yt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ht=>ot==null?void 0:ot(Ht));return}Rt(Nt)},Rt=Nt=>{const Ht=new Set(dt),Lt=findPathById(tt,Nt),kt=Array.from(Ht);Lt.forEach($t=>{const Ft=kt.indexOf($t);Ft>-1&&kt.splice(Ft,1),kt.push($t)}),Ht.clear(),kt.forEach($t=>Ht.add($t)),Ht.forEach($t=>ot==null?void 0:ot($t)),ht(Ht)},Ct=Nt=>{const Ht=new Set(dt);Ht.delete(Nt),Ht.forEach(Lt=>at==null?void 0:at(Lt)),ht(Ht)},It=Nt=>{dt.has(Nt)?Ct(Nt):Rt(Nt)},jt=Nt=>{yt!==Nt&&ct(Nt)},Pt=Nt=>{jt(Nt),Rt(Nt),lt==null||lt(Nt)},Ot=Nt=>{It(Nt)},Ut=Nt=>{findNodeById(tt,rt)&&Rt(Nt)};return{selectedNodeId:yt,expandedNodes:dt,siblingsNodes:ft,draggedNodeId:xt,handleItemClick:Pt,handleFoldUnfold:Ot}},TreeView=reactExports.forwardRef((tt,et)=>{const{data:rt,onTreeItemClick:st,onTreeItemUnfold:nt,onTreeItemFold:ot,onTreeItemAction:at,draggedNode:lt,showIcon:ut=!0,allExpandedNodes:ct=!1,selectedNodeId:dt}=tt,{selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:vt,handleItemClick:yt,handleFoldUnfold:Et}=useTreeView({data:rt,ref:et,externalSelectedNodeId:dt,draggedNode:lt,allExpandedNodes:ct,onTreeItemClick:st,onTreeItemFold:ot,onTreeItemUnfold:nt});return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:Array.isArray(rt)?rt.map(bt=>jsxRuntimeExports.jsx(TreeNode,{node:bt,showIcon:ut,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:vt,handleItemClick:yt,handleToggleNode:Et,handleItemAction:at},bt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,showIcon:ut,draggedNodeId:vt,handleItemClick:yt,handleToggleNode:Et})})})}),VisuallyHidden=reactExports.forwardRef(({children:tt},et)=>jsxRuntimeExports.jsx("span",{className:"visually-hidden",ref:et,children:tt})),EdificeClientContext=reactExports.createContext(null);function useEdificeClient(){const tt=reactExports.useContext(EdificeClientContext);if(!tt)throw new Error("Cannot be used outside of EdificeClientProvider");return tt}function useBookmark(){var tt;const{sessionQuery:et}=useEdificeClient(),rt=new Set;return(tt=et==null?void 0:et.data)==null?void 0:tt.bookmarkedApps.filter(st=>{const nt=rt.has(st.displayName);return rt.add(st.displayName),!nt})}function useDebounce(tt,et){const[rt,st]=reactExports.useState(tt);return reactExports.useEffect(()=>{const nt=setTimeout(()=>{st(tt)},et);return()=>{clearTimeout(nt)}},[tt,et]),rt}function useHover$1(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=reactExports.useCallback(()=>{et(!0)},[]),nt=reactExports.useCallback(()=>{et(!1)},[]);return[reactExports.useCallback(at=>{var lt;((lt=rt.current)==null?void 0:lt.nodeType)===Node.ELEMENT_NODE&&(rt.current.removeEventListener("mouseenter",st),rt.current.removeEventListener("mouseleave",nt)),(at==null?void 0:at.nodeType)===Node.ELEMENT_NODE&&(at.addEventListener("mouseenter",st),at.addEventListener("mouseleave",nt)),rt.current=at},[st,nt]),tt]}function useMediaQuery(tt){const et=reactExports.useCallback(nt=>{const ot=window.matchMedia(tt);return ot.addEventListener("change",nt),()=>{ot.removeEventListener("change",nt)}},[tt]),rt=()=>window.matchMedia(tt).matches,st=()=>{throw Error("useMediaQuery is a client-only hook")};return reactExports.useSyncExternalStore(et,rt,st)}function useToggle$1(tt){const[et,rt]=reactExports.useState(()=>tt),st=reactExports.useCallback(nt=>rt(typeof nt=="boolean"?nt:ot=>!ot),[]);return[et,st]}function useBreakpoint(){return{xs:useMediaQuery("only screen and (min-width: 0)"),sm:useMediaQuery("only screen and (min-width: 375px)"),md:useMediaQuery("only screen and (min-width: 768px)"),lg:useMediaQuery("only screen and (min-width: 1024px)"),xl:useMediaQuery("only screen and (min-width: 1280px)"),xxl:useMediaQuery("only screen and (min-width: 1400px)")}}var uaParser={exports:{}};(function(tt,et){(function(rt,st){var nt="1.0.41",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",ft="model",xt="name",vt="type",yt="vendor",Et="version",bt="architecture",wt="console",St="mobile",Rt="tablet",Ct="smarttv",It="wearable",jt="embedded",Pt=500,Ot="Amazon",Ut="Apple",Nt="ASUS",Ht="BlackBerry",Lt="Browser",kt="Chrome",$t="Edge",Ft="Firefox",Gt="Google",Mt="Honor",Vt="Huawei",Bt="Lenovo",qt="LG",Qt="Microsoft",Yt="Motorola",tr="Nvidia",lr="OnePlus",ur="Opera",mr="OPPO",yr="Samsung",or="Sharp",hr="Sony",pr="Xiaomi",_r="Zebra",Ar="Facebook",Hr="Chromium OS",Ur="Mac OS",os=" Browser",Gs=function(Ir,Br){var kr={};for(var Wr in Ir)Br[Wr]&&Br[Wr].length%2===0?kr[Wr]=Br[Wr].concat(Ir[Wr]):kr[Wr]=Ir[Wr];return kr},Es=function(Ir){for(var Br={},kr=0;kr<Ir.length;kr++)Br[Ir[kr].toUpperCase()]=Ir[kr];return Br},Ws=function(Ir,Br){return typeof Ir===dt?Xt(Br).indexOf(Xt(Ir))!==-1:!1},Xt=function(Ir){return Ir.toLowerCase()},er=function(Ir){return typeof Ir===dt?Ir.replace(/[^\d\.]/g,ot).split(".")[0]:st},sr=function(Ir,Br){if(typeof Ir===dt)return Ir=Ir.replace(/^\s\s*/,ot),typeof Br===ut?Ir:Ir.substring(0,Pt)},br=function(Ir,Br){for(var kr=0,Wr,bs,ps,zr,$r,Ls;kr<Br.length&&!$r;){var Zo=Br[kr],Pl=Br[kr+1];for(Wr=bs=0;Wr<Zo.length&&!$r&&Zo[Wr];)if($r=Zo[Wr++].exec(Ir),$r)for(ps=0;ps<Pl.length;ps++)Ls=$r[++bs],zr=Pl[ps],typeof zr===ct&&zr.length>0?zr.length===2?typeof zr[1]==lt?this[zr[0]]=zr[1].call(this,Ls):this[zr[0]]=zr[1]:zr.length===3?typeof zr[1]===lt&&!(zr[1].exec&&zr[1].test)?this[zr[0]]=Ls?zr[1].call(this,Ls,zr[2]):st:this[zr[0]]=Ls?Ls.replace(zr[1],zr[2]):st:zr.length===4&&(this[zr[0]]=Ls?zr[3].call(this,Ls.replace(zr[1],zr[2])):st):this[zr]=Ls||st;kr+=2}},gr=function(Ir,Br){for(var kr in Br)if(typeof Br[kr]===ct&&Br[kr].length>0){for(var Wr=0;Wr<Br[kr].length;Wr++)if(Ws(Br[kr][Wr],Ir))return kr===at?st:kr}else if(Ws(Br[kr],Ir))return kr===at?st:kr;return Br.hasOwnProperty("*")?Br["*"]:Ir},vr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Tr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Lr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[Et,[xt,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[Et,[xt,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[xt,Et],[/opios[\/ ]+([\w\.]+)/i],[Et,[xt,ur+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,ur+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,ur]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[Et,[xt,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[Et,[xt,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[xt,Et],[/quark(?:pc)?\/([-\w\.]+)/i],[Et,[xt,"Quark"]],[/\bddg\/([\w\.]+)/i],[Et,[xt,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[Et,[xt,"UC"+Lt]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[Et,[xt,"WeChat"]],[/konqueror\/([\w\.]+)/i],[Et,[xt,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[Et,[xt,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[Et,[xt,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[Et,[xt,"Smart Lenovo "+Lt]],[/(avast|avg)\/([\w\.]+)/i],[[xt,/(.+)/,"$1 Secure "+Lt],Et],[/\bfocus\/([\w\.]+)/i],[Et,[xt,Ft+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,ur+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,ur+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+os]],[/fxios\/([\w\.-]+)/i],[Et,[xt,Ft]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+os],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,yr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[Et,[xt,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[xt,"Sogou Mobile"],Et],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[xt,Et],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[xt],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[Et,xt],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[xt,Ar],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[xt,Et],[/\bgsa\/([\w\.]+) .*safari\//i],[Et,[xt,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[Et,[xt,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[Et,[xt,kt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[xt,kt+" WebView"],Et],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Et,[xt,"Android "+Lt]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[xt,Et],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[Et,[xt,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[Et,xt],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[xt,[Et,gr,vr]],[/(webkit|khtml)\/([\w\.]+)/i],[xt,Et],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[xt,"Netscape"],Et],[/(wolvic|librewolf)\/([\w\.]+)/i],[xt,Et],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[Et,[xt,Ft+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[bt,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[bt,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[bt,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[bt,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[bt,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[bt,/ower/,ot,Xt]],[/ sun4\w[;\)]/i],[[bt,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[bt,Xt]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[ft,[yt,yr],[vt,Rt]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[ft,[yt,yr],[vt,St]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[ft,[yt,Ut],[vt,St]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[ft,[yt,Ut],[vt,Rt]],[/(macintosh);/i],[ft,[yt,Ut]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[ft,[yt,or],[vt,St]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[ft,[yt,Mt],[vt,Rt]],[/honor([-\w ]+)[;\)]/i],[ft,[yt,Mt],[vt,St]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[ft,[yt,Vt],[vt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[ft,[yt,Vt],[vt,St]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[ft,/_/g," "],[yt,pr],[vt,Rt]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[ft,/_/g," "],[yt,pr],[vt,St]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[ft,[yt,mr],[vt,St]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[ft,[yt,gr,{OnePlus:["304","403","203"],"*":mr}],[vt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[ft,[yt,"Vivo"],[vt,St]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[ft,[yt,"Realme"],[vt,St]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[ft,[yt,Yt],[vt,St]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[ft,[yt,Yt],[vt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[ft,[yt,qt],[vt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[ft,[yt,qt],[vt,St]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[ft,[yt,Bt],[vt,Rt]],[/(nokia) (t[12][01])/i],[yt,ft,[vt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[ft,/_/g," "],[vt,St],[yt,"Nokia"]],[/(pixel (c|tablet))\b/i],[ft,[yt,Gt],[vt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[ft,[yt,Gt],[vt,St]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[ft,[yt,hr],[vt,St]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[ft,"Xperia Tablet"],[yt,hr],[vt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[ft,[yt,lr],[vt,St]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[ft,[yt,Ot],[vt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[ft,/(.+)/g,"Fire Phone $1"],[yt,Ot],[vt,St]],[/(playbook);[-\w\),; ]+(rim)/i],[ft,yt,[vt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[ft,[yt,Ht],[vt,St]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[ft,[yt,Nt],[vt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[ft,[yt,Nt],[vt,St]],[/(nexus 9)/i],[ft,[yt,"HTC"],[vt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[yt,[ft,/_/g," "],[vt,St]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[ft,[yt,"TCL"],[vt,Rt]],[/(itel) ((\w+))/i],[[yt,Xt],ft,[vt,gr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[ft,[yt,"Acer"],[vt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[ft,[yt,"Meizu"],[vt,St]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[ft,[yt,"Ulefone"],[vt,St]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[ft,[yt,"Energizer"],[vt,St]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[ft,[yt,"Cat"],[vt,St]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[ft,[yt,"Smartfren"],[vt,St]],[/droid.+; (a(?:015|06[35]|142p?))/i],[ft,[yt,"Nothing"],[vt,St]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[ft,[yt,"Archos"],[vt,Rt]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[ft,[yt,"Archos"],[vt,St]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[yt,ft,[vt,Rt]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[yt,ft,[vt,St]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[yt,ft,[vt,Rt]],[/(surface duo)/i],[ft,[yt,Qt],[vt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[ft,[yt,"Fairphone"],[vt,St]],[/(u304aa)/i],[ft,[yt,"AT&T"],[vt,St]],[/\bsie-(\w*)/i],[ft,[yt,"Siemens"],[vt,St]],[/\b(rct\w+) b/i],[ft,[yt,"RCA"],[vt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[ft,[yt,"Dell"],[vt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[ft,[yt,"Verizon"],[vt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[ft,[yt,"Barnes & Noble"],[vt,Rt]],[/\b(tm\d{3}\w+) b/i],[ft,[yt,"NuVision"],[vt,Rt]],[/\b(k88) b/i],[ft,[yt,"ZTE"],[vt,Rt]],[/\b(nx\d{3}j) b/i],[ft,[yt,"ZTE"],[vt,St]],[/\b(gen\d{3}) b.+49h/i],[ft,[yt,"Swiss"],[vt,St]],[/\b(zur\d{3}) b/i],[ft,[yt,"Swiss"],[vt,Rt]],[/\b((zeki)?tb.*\b) b/i],[ft,[yt,"Zeki"],[vt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[yt,"Dragon Touch"],ft,[vt,Rt]],[/\b(ns-?\w{0,9}) b/i],[ft,[yt,"Insignia"],[vt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[ft,[yt,"NextBook"],[vt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[yt,"Voice"],ft,[vt,St]],[/\b(lvtel\-)?(v1[12]) b/i],[[yt,"LvTel"],ft,[vt,St]],[/\b(ph-1) /i],[ft,[yt,"Essential"],[vt,St]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[ft,[yt,"Envizen"],[vt,Rt]],[/\b(trio[-\w\. ]+) b/i],[ft,[yt,"MachSpeed"],[vt,Rt]],[/\btu_(1491) b/i],[ft,[yt,"Rotor"],[vt,Rt]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[ft,[yt,tr],[vt,Rt]],[/(sprint) (\w+)/i],[yt,ft,[vt,St]],[/(kin\.[onetw]{3})/i],[[ft,/\./g," "],[yt,Qt],[vt,St]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[ft,[yt,_r],[vt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[ft,[yt,_r],[vt,St]],[/smart-tv.+(samsung)/i],[yt,[vt,Ct]],[/hbbtv.+maple;(\d+)/i],[[ft,/^/,"SmartTV"],[yt,yr],[vt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[yt,qt],[vt,Ct]],[/(apple) ?tv/i],[yt,[ft,Ut+" TV"],[vt,Ct]],[/crkey/i],[[ft,kt+"cast"],[yt,Gt],[vt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[ft,[yt,Ot],[vt,Ct]],[/(shield \w+ tv)/i],[ft,[yt,tr],[vt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[ft,[yt,or],[vt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[ft,[yt,hr],[vt,Ct]],[/(mi(tv|box)-?\w+) bui/i],[ft,[yt,pr],[vt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[yt,ft,[vt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[yt,sr],[ft,sr],[vt,Ct]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[ft,[vt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[vt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[yt,ft,[vt,wt]],[/droid.+; (shield)( bui|\))/i],[ft,[yt,tr],[vt,wt]],[/(playstation \w+)/i],[ft,[yt,hr],[vt,wt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[ft,[yt,Qt],[vt,wt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[ft,[yt,yr],[vt,It]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[yt,ft,[vt,It]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[ft,[yt,mr],[vt,It]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[ft,[yt,Ut],[vt,It]],[/(opwwe\d{3})/i],[ft,[yt,lr],[vt,It]],[/(moto 360)/i],[ft,[yt,Yt],[vt,It]],[/(smartwatch 3)/i],[ft,[yt,hr],[vt,It]],[/(g watch r)/i],[ft,[yt,qt],[vt,It]],[/droid.+; (wt63?0{2,3})\)/i],[ft,[yt,_r],[vt,It]],[/droid.+; (glass) \d/i],[ft,[yt,Gt],[vt,It]],[/(pico) (4|neo3(?: link|pro)?)/i],[yt,ft,[vt,It]],[/; (quest( \d| pro)?)/i],[ft,[yt,Ar],[vt,It]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[yt,[vt,jt]],[/(aeobc)\b/i],[ft,[yt,Ot],[vt,jt]],[/(homepod).+mac os/i],[ft,[yt,Ut],[vt,jt]],[/windows iot/i],[[vt,jt]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[ft,[vt,St]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[ft,[vt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[vt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[vt,St]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[ft,[yt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,$t+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[xt,Et],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[Et,[xt,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[xt,Et],[/ladybird\//i],[[xt,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,gr,Tr]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,gr,Tr],[xt,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[Et,/_/g,"."],[xt,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[xt,Ur],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(ubuntu) ([\w\.]+) like android/i],[[xt,/(.+)/,"$1 Touch"],Et],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ht]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,Ft+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[Et,[xt,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[Et,[xt,"watchOS"]],[/crkey\/([\d\.]+)/i],[Et,[xt,kt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[xt,Hr],Et],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[xt,Et],[/(sunos) ?([\w\.\d]*)/i],[[xt,"Solaris"],Et],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[xt,Et]]},Dr=function(Ir,Br){if(typeof Ir===ct&&(Br=Ir,Ir=st),!(this instanceof Dr))return new Dr(Ir,Br).getResult();var kr=typeof rt!==ut&&rt.navigator?rt.navigator:st,Wr=Ir||(kr&&kr.userAgent?kr.userAgent:ot),bs=kr&&kr.userAgentData?kr.userAgentData:st,ps=Br?Gs(Lr,Br):Lr,zr=kr&&kr.userAgent==Wr;return this.getBrowser=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.browser),$r[ht]=er($r[Et]),zr&&kr&&kr.brave&&typeof kr.brave.isBrave==lt&&($r[xt]="Brave"),$r},this.getCPU=function(){var $r={};return $r[bt]=st,br.call($r,Wr,ps.cpu),$r},this.getDevice=function(){var $r={};return $r[yt]=st,$r[ft]=st,$r[vt]=st,br.call($r,Wr,ps.device),zr&&!$r[vt]&&bs&&bs.mobile&&($r[vt]=St),zr&&$r[ft]=="Macintosh"&&kr&&typeof kr.standalone!==ut&&kr.maxTouchPoints&&kr.maxTouchPoints>2&&($r[ft]="iPad",$r[vt]=Rt),$r},this.getEngine=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.engine),$r},this.getOS=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.os),zr&&!$r[xt]&&bs&&bs.platform&&bs.platform!="Unknown"&&($r[xt]=bs.platform.replace(/chrome os/i,Hr).replace(/macos/i,Ur)),$r},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Wr},this.setUA=function($r){return Wr=typeof $r===dt&&$r.length>Pt?sr($r,Pt):$r,this},this.setUA(Wr),this};Dr.VERSION=nt,Dr.BROWSER=Es([xt,Et,ht]),Dr.CPU=Es([bt]),Dr.DEVICE=Es([ft,yt,vt,wt,St,Ct,Rt,It,jt]),Dr.ENGINE=Dr.OS=Es([xt,Et]),tt.exports&&(et=tt.exports=Dr),et.UAParser=Dr;var Zr=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(Zr&&!Zr.ua){var ks=new Dr;Zr.ua=ks.getResult(),Zr.ua.get=function(){return ks.getUA()},Zr.ua.set=function(Ir){ks.setUA(Ir);var Br=ks.getResult();for(var kr in Br)Zr.ua[kr]=Br[kr]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);function useBrowserInfo(tt){var et,rt,st;const nt=new UAParser(tt),ot=nt.getOS(),at=nt.getDevice(),lt=nt.getBrowser(),ut=((et=at.model)==null?void 0:et.indexOf("iPhone"))!=-1,ct=((rt=at.model)==null?void 0:rt.indexOf("iPod"))!=-1,dt=((st=at.model)==null?void 0:st.indexOf("iPad"))!=-1;return{os:ot,device:at,browser:lt,isIphone:ut,isIpod:ct,isIpad:dt}}function useHasWorkflow(tt){const[et,rt]=reactExports.useState();return reactExports.useEffect(()=>{(async()=>{let st;typeof tt=="string"?st=await odeServices.rights().sessionHasWorkflowRight(tt):st=await odeServices.rights().sessionHasWorkflowRights(tt),rt(st)})()},[tt]),et}function useCantoo(){const tt=useHasWorkflow("org.entcore.portal.controllers.PortalController|optionalFeatureCantoo");return reactExports.useEffect(()=>{tt&&!document.getElementById("cantoo-edifice-script")&&(async()=>{const et=await odeServices.http().get("/optionalFeature/cantoo");if(et&&et.scriptPath){const rt=document.createElement("script");rt.id="cantoo-edifice-script",rt.src=et.scriptPath,rt.async=!0,document.body.appendChild(rt)}})()},[tt]),null}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(tt){return this.listeners.add(tt),this.onSubscribe(),()=>{this.listeners.delete(tt),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$1(){}function functionalUpdate(tt,et){return typeof tt=="function"?tt(et):tt}function isValidTimeout(tt){return typeof tt=="number"&&tt>=0&&tt!==1/0}function timeUntilStale(tt,et){return Math.max(tt+(et||0)-Date.now(),0)}function resolveStaleTime(tt,et){return typeof tt=="function"?tt(et):tt}function resolveEnabled(tt,et){return typeof tt=="function"?tt(et):tt}function matchQuery(tt,et){const{type:rt="all",exact:st,fetchStatus:nt,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(st){if(et.queryHash!==hashQueryKeyByOptions(at,et.options))return!1}else if(!partialMatchKey(et.queryKey,at))return!1}if(rt!=="all"){const ut=et.isActive();if(rt==="active"&&!ut||rt==="inactive"&&ut)return!1}return!(typeof lt=="boolean"&&et.isStale()!==lt||nt&&nt!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:st,predicate:nt,mutationKey:ot}=tt;if(ot){if(!et.options.mutationKey)return!1;if(rt){if(hashKey(et.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(et.options.mutationKey,ot))return!1}return!(st&&et.state.status!==st||nt&&!nt(et))}function hashQueryKeyByOptions(tt,et){return((et==null?void 0:et.queryKeyHashFn)||hashKey)(tt)}function hashKey(tt){return JSON.stringify(tt,(et,rt)=>isPlainObject$1(rt)?Object.keys(rt).sort().reduce((st,nt)=>(st[nt]=rt[nt],st),{}):rt)}function partialMatchKey(tt,et){return tt===et?!0:typeof tt!=typeof et?!1:tt&&et&&typeof tt=="object"&&typeof et=="object"?!Object.keys(et).some(rt=>!partialMatchKey(tt[rt],et[rt])):!1}function replaceEqualDeep(tt,et){if(tt===et)return tt;const rt=isPlainArray(tt)&&isPlainArray(et);if(rt||isPlainObject$1(tt)&&isPlainObject$1(et)){const st=rt?tt:Object.keys(tt),nt=st.length,ot=rt?et:Object.keys(et),at=ot.length,lt=rt?[]:{};let ut=0;for(let ct=0;ct<at;ct++){const dt=rt?ct:ot[ct];(!rt&&st.includes(dt)||rt)&&tt[dt]===void 0&&et[dt]===void 0?(lt[dt]=void 0,ut++):(lt[dt]=replaceEqualDeep(tt[dt],et[dt]),lt[dt]===tt[dt]&&tt[dt]!==void 0&&ut++)}return nt===at&&ut===nt?tt:lt}return et}function shallowEqualObjects(tt,et){if(!et||Object.keys(tt).length!==Object.keys(et).length)return!1;for(const rt in tt)if(tt[rt]!==et[rt])return!1;return!0}function isPlainArray(tt){return Array.isArray(tt)&&tt.length===Object.keys(tt).length}function isPlainObject$1(tt){if(!hasObjectPrototype(tt))return!1;const et=tt.constructor;if(et===void 0)return!0;const rt=et.prototype;return!(!hasObjectPrototype(rt)||!rt.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(tt)!==Object.prototype)}function hasObjectPrototype(tt){return Object.prototype.toString.call(tt)==="[object Object]"}function sleep(tt){return new Promise(et=>{setTimeout(et,tt)})}function replaceData(tt,et,rt){return typeof rt.structuralSharing=="function"?rt.structuralSharing(tt,et):rt.structuralSharing!==!1?replaceEqualDeep(tt,et):et}function addToEnd(tt,et,rt=0){const st=[...tt,et];return rt&&st.length>rt?st.slice(1):st}function addToStart(tt,et,rt=0){const st=[et,...tt];return rt&&st.length>rt?st.slice(0,-1):st}var skipToken=Symbol();function ensureQueryFn(tt,et){return!tt.queryFn&&(et!=null&&et.initialPromise)?()=>et.initialPromise:!tt.queryFn||tt.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${tt.queryHash}'`)):tt.queryFn}var wl,Ho,Zl,Wp,FocusManager=(Wp=class extends Subscribable{constructor(){super();Or(this,wl);Or(this,Ho);Or(this,Zl);Sr(this,Zl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Ho)||this.setEventListener(Kt(this,Zl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Ho))==null||et.call(this),Sr(this,Ho,void 0))}setEventListener(et){var rt;Sr(this,Zl,et),(rt=Kt(this,Ho))==null||rt.call(this),Sr(this,Ho,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,wl)!==et&&(Sr(this,wl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,wl)=="boolean"?Kt(this,wl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},wl=new WeakMap,Ho=new WeakMap,Zl=new WeakMap,Wp),focusManager=new FocusManager,Jl,Vo,eu,qp,OnlineManager=(qp=class extends Subscribable{constructor(){super();Or(this,Jl,!0);Or(this,Vo);Or(this,eu);Sr(this,eu,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),st=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",st,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",st)}}})}onSubscribe(){Kt(this,Vo)||this.setEventListener(Kt(this,eu))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Vo))==null||et.call(this),Sr(this,Vo,void 0))}setEventListener(et){var rt;Sr(this,eu,et),(rt=Kt(this,Vo))==null||rt.call(this),Sr(this,Vo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Jl)!==et&&(Sr(this,Jl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Jl)}},Jl=new WeakMap,Vo=new WeakMap,eu=new WeakMap,qp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((nt,ot)=>{tt=nt,et=ot});rt.status="pending",rt.catch(()=>{});function st(nt){Object.assign(rt,nt),delete rt.resolve,delete rt.reject}return rt.resolve=nt=>{st({status:"fulfilled",value:nt}),tt(nt)},rt.reject=nt=>{st({status:"rejected",reason:nt}),et(nt)},rt}function defaultRetryDelay(tt){return Math.min(1e3*2**tt,3e4)}function canFetch(tt){return(tt??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(tt){super("CancelledError"),this.revert=tt==null?void 0:tt.revert,this.silent=tt==null?void 0:tt.silent}};function isCancelledError(tt){return tt instanceof CancelledError}function createRetryer(tt){let et=!1,rt=0,st=!1,nt;const ot=pendingThenable(),at=yt=>{var Et;st||(ft(new CancelledError(yt)),(Et=tt.abort)==null||Et.call(tt))},lt=()=>{et=!0},ut=()=>{et=!1},ct=()=>focusManager.isFocused()&&(tt.networkMode==="always"||onlineManager.isOnline())&&tt.canRun(),dt=()=>canFetch(tt.networkMode)&&tt.canRun(),ht=yt=>{var Et;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,yt),nt==null||nt(),ot.resolve(yt))},ft=yt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,yt),nt==null||nt(),ot.reject(yt))},xt=()=>new Promise(yt=>{var Et;nt=bt=>{(st||ct())&&yt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var yt;nt=void 0,st||(yt=tt.onContinue)==null||yt.call(tt)}),vt=()=>{if(st)return;let yt;const Et=rt===0?tt.initialPromise:void 0;try{yt=Et??tt.fn()}catch(bt){yt=Promise.reject(bt)}Promise.resolve(yt).then(ht).catch(bt=>{var It;if(st)return;const wt=tt.retry??(isServer?0:3),St=tt.retryDelay??defaultRetryDelay,Rt=typeof St=="function"?St(rt,bt):St,Ct=wt===!0||typeof wt=="number"&&rt<wt||typeof wt=="function"&&wt(rt,bt);if(et||!Ct){ft(bt);return}rt++,(It=tt.onFail)==null||It.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(bt):vt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?vt():xt().then(vt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},st=lt=>{lt()},nt=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):nt(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&nt(()=>{st(()=>{lt.forEach(ut=>{rt(ut)})})})};return{batch:lt=>{let ut;et++;try{ut=lt()}finally{et--,et||at()}return ut},batchCalls:lt=>(...ut)=>{ot(()=>{lt(...ut)})},schedule:ot,setNotifyFunction:lt=>{rt=lt},setBatchNotifyFunction:lt=>{st=lt},setScheduler:lt=>{nt=lt}}}var notifyManager=createNotifyManager(),Sl,Xp,Removable=(Xp=class{constructor(){Or(this,Sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Sr(this,Sl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,Sl)&&(clearTimeout(Kt(this,Sl)),Sr(this,Sl,void 0))}},Sl=new WeakMap,Xp),tu,ru,qn,js,Lu,_l,eo,Co,Yp,Query=(Yp=class extends Removable{constructor(et){super();Or(this,eo);Or(this,tu);Or(this,ru);Or(this,qn);Or(this,js);Or(this,Lu);Or(this,_l);Sr(this,_l,!1),Sr(this,Lu,et.defaultOptions),this.setOptions(et.options),this.observers=[],Sr(this,qn,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Sr(this,tu,getDefaultState$1(this.options)),this.state=et.state??Kt(this,tu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,js))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Lu),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,qn).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Fr(this,eo,Co).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Fr(this,eo,Co).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,js))==null?void 0:st.promise;return(nt=Kt(this,js))==null||nt.cancel(et),rt?rt.then(noop$1).catch(noop$1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,tu))}isActive(){return this.observers.some(et=>resolveEnabled(et.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(et=>et.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(et=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,et)}onFocus(){var rt;const et=this.observers.find(st=>st.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,qn).notify({type:"observerAdded",query:this,observer:et}))}removeObserver(et){this.observers.includes(et)&&(this.observers=this.observers.filter(rt=>rt!==et),this.observers.length||(Kt(this,js)&&(Kt(this,_l)?Kt(this,js).cancel({revert:!0}):Kt(this,js).cancelRetry()),this.scheduleGc()),Kt(this,qn).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fr(this,eo,Co).call(this,{type:"invalidate"})}fetch(et,rt){var ut,ct,dt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(rt!=null&&rt.cancelRefetch))this.cancel({silent:!0});else if(Kt(this,js))return Kt(this,js).continueRetry(),Kt(this,js).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(ft=>ft.options.queryFn);ht&&this.setOptions(ht.options)}const st=new AbortController,nt=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Sr(this,_l,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Sr(this,_l,!1),this.options.persister?this.options.persister(ht,ft,this):ht(ft)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Sr(this,ru,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Fr(this,eo,Co).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,vt,yt;isCancelledError(ht)&&ht.silent||Fr(this,eo,Co).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,qn).config).onError)==null||xt.call(ft,ht,this),(yt=(vt=Kt(this,qn).config).onSettled)==null||yt.call(vt,this.state.data,ht,this)),this.scheduleGc()};return Sr(this,js,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,xt,vt,yt;if(ht===void 0){lt(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(ht)}catch(Et){lt(Et);return}(xt=(ft=Kt(this,qn).config).onSuccess)==null||xt.call(ft,ht,this),(yt=(vt=Kt(this,qn).config).onSettled)==null||yt.call(vt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Fr(this,eo,Co).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Fr(this,eo,Co).call(this,{type:"pause"})},onContinue:()=>{Fr(this,eo,Co).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,js).start()}},tu=new WeakMap,ru=new WeakMap,qn=new WeakMap,js=new WeakMap,Lu=new WeakMap,_l=new WeakMap,eo=new WeakSet,Co=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...st,fetchStatus:"paused"};case"continue":return{...st,fetchStatus:"fetching"};case"fetch":return{...st,...fetchState(st.data,this.options),fetchMeta:et.meta??null};case"success":return{...st,data:et.data,dataUpdateCount:st.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=et.error;return isCancelledError(nt)&&nt.revert&&Kt(this,ru)?{...Kt(this,ru),fetchStatus:"idle"}:{...st,error:nt,errorUpdateCount:st.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:st.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...st,isInvalidated:!0};case"setState":return{...st,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(st=>{st.onQueryUpdate()}),Kt(this,qn).notify({query:this,type:"updated",action:et})})},Yp);function fetchState(tt,et){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(et.networkMode)?"fetching":"paused",...tt===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(tt){const et=typeof tt.initialData=="function"?tt.initialData():tt.initialData,rt=et!==void 0,st=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?st??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var xo,Kp,QueryCache=(Kp=class extends Subscribable{constructor(et={}){super();Or(this,xo);this.config=et,Sr(this,xo,new Map)}build(et,rt,st){const nt=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(nt,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:nt,queryHash:ot,options:et.defaultQueryOptions(rt),state:st,defaultOptions:et.getQueryDefaults(nt)}),this.add(at)),at}add(et){Kt(this,xo).has(et.queryHash)||(Kt(this,xo).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,xo).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,xo).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,xo).get(et)}getAll(){return[...Kt(this,xo).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchQuery(rt,st))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(st=>matchQuery(et,st)):rt}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onOnline()})})}},xo=new WeakMap,Kp),vo,Os,Rl,yo,Uo,Qp,Mutation=(Qp=class extends Removable{constructor(et){super();Or(this,yo);Or(this,vo);Or(this,Os);Or(this,Rl);this.mutationId=et.mutationId,Sr(this,Os,et.mutationCache),Sr(this,vo,[]),this.state=et.state||getDefaultState(),this.setOptions(et.options),this.scheduleGc()}setOptions(et){this.options=et,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(et){Kt(this,vo).includes(et)||(Kt(this,vo).push(et),this.clearGcTimeout(),Kt(this,Os).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Sr(this,vo,Kt(this,vo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,Os).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,vo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,Os).remove(this))}continue(){var et;return((et=Kt(this,Rl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,vt,yt,Et,bt,wt,St,Rt,Ct,It,jt;Sr(this,Rl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(Pt,Ot)=>{Fr(this,yo,Uo).call(this,{type:"failed",failureCount:Pt,error:Ot})},onPause:()=>{Fr(this,yo,Uo).call(this,{type:"pause"})},onContinue:()=>{Fr(this,yo,Uo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,Os).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,Rl).canStart();try{if(!rt){Fr(this,yo,Uo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,Os).config).onMutate)==null?void 0:ot.call(nt,et,this));const Ot=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Ot!==this.state.context&&Fr(this,yo,Uo).call(this,{type:"pending",context:Ot,variables:et,isPaused:st})}const Pt=await Kt(this,Rl).start();return await((ct=(ut=Kt(this,Os).config).onSuccess)==null?void 0:ct.call(ut,Pt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,Pt,et,this.state.context)),await((xt=(ft=Kt(this,Os).config).onSettled)==null?void 0:xt.call(ft,Pt,null,this.state.variables,this.state.context,this)),await((yt=(vt=this.options).onSettled)==null?void 0:yt.call(vt,Pt,null,et,this.state.context)),Fr(this,yo,Uo).call(this,{type:"success",data:Pt}),Pt}catch(Pt){try{throw await((bt=(Et=Kt(this,Os).config).onError)==null?void 0:bt.call(Et,Pt,et,this.state.context,this)),await((St=(wt=this.options).onError)==null?void 0:St.call(wt,Pt,et,this.state.context)),await((Ct=(Rt=Kt(this,Os).config).onSettled)==null?void 0:Ct.call(Rt,void 0,Pt,this.state.variables,this.state.context,this)),await((jt=(It=this.options).onSettled)==null?void 0:jt.call(It,void 0,Pt,et,this.state.context)),Pt}finally{Fr(this,yo,Uo).call(this,{type:"error",error:Pt})}}finally{Kt(this,Os).runNext(this)}}},vo=new WeakMap,Os=new WeakMap,Rl=new WeakMap,yo=new WeakSet,Uo=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...st,isPaused:!0};case"continue":return{...st,isPaused:!1};case"pending":return{...st,context:et.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:et.isPaused,status:"pending",variables:et.variables,submittedAt:Date.now()};case"success":return{...st,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...st,data:void 0,error:et.error,failureCount:st.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,vo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,Os).notify({mutation:this,type:"updated",action:et})})},Qp);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Js,Nu,Zp,MutationCache=(Zp=class extends Subscribable{constructor(et={}){super();Or(this,Js);Or(this,Nu);this.config=et,Sr(this,Js,new Map),Sr(this,Nu,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++A1(this,Nu)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Js).get(rt)??[];st.push(et),Kt(this,Js).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Js).has(rt)){const nt=(st=Kt(this,Js).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Js).delete(rt):Kt(this,Js).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Js).get(scopeFor(et)))==null?void 0:st.find(nt=>nt.state.status==="pending");return!rt||rt===et}runNext(et){var st;const rt=(st=Kt(this,Js).get(scopeFor(et)))==null?void 0:st.find(nt=>nt!==et&&nt.state.isPaused);return(rt==null?void 0:rt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}getAll(){return[...Kt(this,Js).values()].flat()}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchMutation(rt,st))}findAll(et={}){return this.getAll().filter(rt=>matchMutation(et,rt))}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}resumePausedMutations(){const et=this.getAll().filter(rt=>rt.state.isPaused);return notifyManager.batch(()=>Promise.all(et.map(rt=>rt.continue().catch(noop$1))))}},Js=new WeakMap,Nu=new WeakMap,Zp);function scopeFor(tt){var et;return((et=tt.options.scope)==null?void 0:et.id)??String(tt.mutationId)}function infiniteQueryBehavior(tt){return{onFetch:(et,rt)=>{var dt,ht,ft,xt,vt;const st=et.options,nt=(ft=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:ft.direction,ot=((xt=et.state.data)==null?void 0:xt.pages)||[],at=((vt=et.state.data)==null?void 0:vt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let yt=!1;const Et=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?yt=!0:et.signal.addEventListener("abort",()=>{yt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),wt=async(St,Rt,Ct)=>{if(yt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const It={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(It);const jt=await bt(It),{maxPages:Pt}=et.options,Ot=Ct?addToStart:addToEnd;return{pages:Ot(St.pages,jt,Pt),pageParams:Ot(St.pageParams,Rt,Pt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},It=Rt(st,Ct);lt=await wt(Ct,It,St)}else{const St=tt??ot.length;do{const Rt=ut===0?at[0]??st.initialPageParam:getNextPageParam(st,lt);if(ut>0&&Rt==null)break;lt=await wt(lt,Rt),ut++}while(ut<St)}return lt};et.options.persister?et.fetchFn=()=>{var yt,Et;return(Et=(yt=et.options).persister)==null?void 0:Et.call(yt,ct,{queryKey:et.queryKey,meta:et.options.meta,signal:et.signal},rt)}:et.fetchFn=ct}}}function getNextPageParam(tt,{pages:et,pageParams:rt}){const st=et.length-1;return et.length>0?tt.getNextPageParam(et[st],et,rt[st],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var st;return et.length>0?(st=tt.getPreviousPageParam)==null?void 0:st.call(tt,et[0],et,rt[0],rt):void 0}function hasNextPage(tt,et){return et?getNextPageParam(tt,et)!=null:!1}function hasPreviousPage(tt,et){return!et||!tt.getPreviousPageParam?!1:getPreviousPageParam(tt,et)!=null}var us,Go,Wo,su,nu,qo,iu,ou,Jp,QueryClient=(Jp=class{constructor(tt={}){Or(this,us);Or(this,Go);Or(this,Wo);Or(this,su);Or(this,nu);Or(this,qo);Or(this,iu);Or(this,ou);Sr(this,us,tt.queryCache||new QueryCache),Sr(this,Go,tt.mutationCache||new MutationCache),Sr(this,Wo,tt.defaultOptions||{}),Sr(this,su,new Map),Sr(this,nu,new Map),Sr(this,qo,0)}mount(){A1(this,qo)._++,Kt(this,qo)===1&&(Sr(this,iu,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onFocus())})),Sr(this,ou,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onOnline())})))}unmount(){var tt,et;A1(this,qo)._--,Kt(this,qo)===0&&((tt=Kt(this,iu))==null||tt.call(this),Sr(this,iu,void 0),(et=Kt(this,ou))==null||et.call(this),Sr(this,ou,void 0))}isFetching(tt){return Kt(this,us).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Go).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,us).build(this,et),st=rt.state.data;return st===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(st))}getQueriesData(tt){return Kt(this,us).findAll(tt).map(({queryKey:et,state:rt})=>{const st=rt.data;return[et,st]})}setQueryData(tt,et,rt){const st=this.defaultQueryOptions({queryKey:tt}),nt=Kt(this,us).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,us).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,us).findAll(tt).map(({queryKey:st})=>[st,this.setQueryData(st,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,us);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,us),st={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(nt=>{nt.reset()}),this.refetchQueries(st,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},st=notifyManager.batch(()=>Kt(this,us).findAll(tt).map(nt=>nt.cancel(rt)));return Promise.all(st).then(noop$1).catch(noop$1)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,us).findAll(tt).forEach(st=>{st.invalidate()}),(tt==null?void 0:tt.refetchType)==="none")return Promise.resolve();const rt={...tt,type:(tt==null?void 0:tt.refetchType)??(tt==null?void 0:tt.type)??"active"};return this.refetchQueries(rt,et)})}refetchQueries(tt,et={}){const rt={...et,cancelRefetch:et.cancelRefetch??!0},st=notifyManager.batch(()=>Kt(this,us).findAll(tt).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$1)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(st).then(noop$1)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,us).build(this,et);return rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))?rt.fetch(et):Promise.resolve(rt.state.data)}prefetchQuery(tt){return this.fetchQuery(tt).then(noop$1).catch(noop$1)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$1).catch(noop$1)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,Go).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,us)}getMutationCache(){return Kt(this,Go)}getDefaultOptions(){return Kt(this,Wo)}setDefaultOptions(tt){Sr(this,Wo,tt)}setQueryDefaults(tt,et){Kt(this,su).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,su).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,nu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,nu).values()];let rt={};return et.forEach(st=>{partialMatchKey(tt,st.mutationKey)&&(rt={...rt,...st.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Wo).queries,...this.getQueryDefaults(tt.queryKey),...tt,_defaulted:!0};return et.queryHash||(et.queryHash=hashQueryKeyByOptions(et.queryKey,et)),et.refetchOnReconnect===void 0&&(et.refetchOnReconnect=et.networkMode!=="always"),et.throwOnError===void 0&&(et.throwOnError=!!et.suspense),!et.networkMode&&et.persister&&(et.networkMode="offlineFirst"),et.queryFn===skipToken&&(et.enabled=!1),et}defaultMutationOptions(tt){return tt!=null&&tt._defaulted?tt:{...Kt(this,Wo).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,us).clear(),Kt(this,Go).clear()}},us=new WeakMap,Go=new WeakMap,Wo=new WeakMap,su=new WeakMap,nu=new WeakMap,qo=new WeakMap,iu=new WeakMap,ou=new WeakMap,Jp),Hs,Gr,Fu,Ds,Tl,au,Xo,Eo,Bu,lu,uu,Cl,Al,Yo,cu,Qr,Iu,Y0,K0,Q0,Z0,J0,_d,e2,nm,em,QueryObserver=(em=class extends Subscribable{constructor(et,rt){super();Or(this,Qr);Or(this,Hs);Or(this,Gr);Or(this,Fu);Or(this,Ds);Or(this,Tl);Or(this,au);Or(this,Xo);Or(this,Eo);Or(this,Bu);Or(this,lu);Or(this,uu);Or(this,Cl);Or(this,Al);Or(this,Yo);Or(this,cu,new Set);this.options=rt,Sr(this,Hs,et),Sr(this,Eo,null),Sr(this,Xo,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Xo).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(rt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Kt(this,Gr).addObserver(this),shouldFetchOnMount(Kt(this,Gr),this.options)?Fr(this,Qr,Iu).call(this):this.updateResult(),Fr(this,Qr,Z0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fr(this,Qr,J0).call(this),Fr(this,Qr,_d).call(this),Kt(this,Gr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Gr);if(this.options=Kt(this,Hs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Gr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fr(this,Qr,e2).call(this),Kt(this,Gr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Hs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Gr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Gr),nt,this.options,st)&&Fr(this,Qr,Iu).call(this),this.updateResult(rt),ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||resolveStaleTime(this.options.staleTime,Kt(this,Gr))!==resolveStaleTime(st.staleTime,Kt(this,Gr)))&&Fr(this,Qr,Y0).call(this);const at=Fr(this,Qr,K0).call(this);ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||at!==Kt(this,Yo))&&Fr(this,Qr,Q0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Sr(this,Ds,st),Sr(this,au,this.options),Sr(this,Tl,Kt(this,Gr).state)),st}getCurrentResult(){return Kt(this,Ds)}trackResult(et,rt){const st={};return Object.keys(et).forEach(nt=>{Object.defineProperty(st,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),rt==null||rt(nt),et[nt])})}),st}trackProp(et){Kt(this,cu).add(et)}getCurrentQuery(){return Kt(this,Gr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Hs).defaultQueryOptions(et),st=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Fr(this,Qr,Iu).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Ds)))}createResult(et,rt){var Pt;const st=Kt(this,Gr),nt=this.options,ot=Kt(this,Ds),at=Kt(this,Tl),lt=Kt(this,au),ct=et!==st?et.state:Kt(this,Fu),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const Ot=this.hasListeners(),Ut=!Ot&&shouldFetchOnMount(et,rt),Nt=Ot&&shouldFetchOptionally(et,st,rt,nt);(Ut||Nt)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:vt,errorUpdatedAt:yt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,Bu))xt=Kt(this,lu);else try{Sr(this,Bu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Sr(this,lu,xt),Sr(this,Eo,null)}catch(Ot){Sr(this,Eo,Ot)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Ot;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Ot=ot.data;else if(Ot=typeof rt.placeholderData=="function"?rt.placeholderData((Pt=Kt(this,uu))==null?void 0:Pt.state.data,Kt(this,uu)):rt.placeholderData,rt.select&&Ot!==void 0)try{Ot=rt.select(Ot),Sr(this,Eo,null)}catch(Ut){Sr(this,Eo,Ut)}Ot!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Ot,rt),ft=!0)}Kt(this,Eo)&&(vt=Kt(this,Eo),xt=Kt(this,lu),yt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",wt=Et==="pending",St=Et==="error",Rt=wt&&bt,Ct=xt!==void 0,jt={status:Et,fetchStatus:ht.fetchStatus,isPending:wt,isSuccess:Et==="success",isError:St,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:vt,errorUpdatedAt:yt,failureCount:ht.fetchFailureCount,failureReason:ht.fetchFailureReason,errorUpdateCount:ht.errorUpdateCount,isFetched:ht.dataUpdateCount>0||ht.errorUpdateCount>0,isFetchedAfterMount:ht.dataUpdateCount>ct.dataUpdateCount||ht.errorUpdateCount>ct.errorUpdateCount,isFetching:bt,isRefetching:bt&&!wt,isLoadingError:St&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:ft,isRefetchError:St&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Xo)};if(this.options.experimental_prefetchInRender){const Ot=Ht=>{jt.status==="error"?Ht.reject(jt.error):jt.data!==void 0&&Ht.resolve(jt.data)},Ut=()=>{const Ht=Sr(this,Xo,jt.promise=pendingThenable());Ot(Ht)},Nt=Kt(this,Xo);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&Ot(Nt);break;case"fulfilled":(jt.status==="error"||jt.data!==Nt.value)&&Ut();break;case"rejected":(jt.status!=="error"||jt.error!==Nt.reason)&&Ut();break}}return jt}updateResult(et){const rt=Kt(this,Ds),st=this.createResult(Kt(this,Gr),this.options);if(Sr(this,Tl,Kt(this,Gr).state),Sr(this,au,this.options),Kt(this,Tl).data!==void 0&&Sr(this,uu,Kt(this,Gr)),shallowEqualObjects(st,rt))return;Sr(this,Ds,st);const nt={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,cu).size)return!0;const ut=new Set(lt??Kt(this,cu));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Ds)).some(ct=>{const dt=ct;return Kt(this,Ds)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Fr(this,Qr,nm).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fr(this,Qr,Z0).call(this)}},Hs=new WeakMap,Gr=new WeakMap,Fu=new WeakMap,Ds=new WeakMap,Tl=new WeakMap,au=new WeakMap,Xo=new WeakMap,Eo=new WeakMap,Bu=new WeakMap,lu=new WeakMap,uu=new WeakMap,Cl=new WeakMap,Al=new WeakMap,Yo=new WeakMap,cu=new WeakMap,Qr=new WeakSet,Iu=function(et){Fr(this,Qr,e2).call(this);let rt=Kt(this,Gr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},Y0=function(){Fr(this,Qr,J0).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Gr));if(isServer||Kt(this,Ds).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Ds).dataUpdatedAt,et)+1;Sr(this,Cl,setTimeout(()=>{Kt(this,Ds).isStale||this.updateResult()},st))},K0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Gr)):this.options.refetchInterval)??!1},Q0=function(et){Fr(this,Qr,_d).call(this),Sr(this,Yo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Gr))===!1||!isValidTimeout(Kt(this,Yo))||Kt(this,Yo)===0)&&Sr(this,Al,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Fr(this,Qr,Iu).call(this)},Kt(this,Yo)))},Z0=function(){Fr(this,Qr,Y0).call(this),Fr(this,Qr,Q0).call(this,Fr(this,Qr,K0).call(this))},J0=function(){Kt(this,Cl)&&(clearTimeout(Kt(this,Cl)),Sr(this,Cl,void 0))},_d=function(){Kt(this,Al)&&(clearInterval(Kt(this,Al)),Sr(this,Al,void 0))},e2=function(){const et=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),this.options);if(et===Kt(this,Gr))return;const rt=Kt(this,Gr);Sr(this,Gr,et),Sr(this,Fu,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},nm=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,Ds))}),Kt(this,Hs).getQueryCache().notify({query:Kt(this,Gr),type:"observerResultsUpdated"})})},em);function shouldLoadOnMount(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.state.data===void 0&&!(tt.state.status==="error"&&et.retryOnMount===!1)}function shouldFetchOnMount(tt,et){return shouldLoadOnMount(tt,et)||tt.state.data!==void 0&&shouldFetchOn(tt,et,et.refetchOnMount)}function shouldFetchOn(tt,et,rt){if(resolveEnabled(et.enabled,tt)!==!1){const st=typeof rt=="function"?rt(tt):rt;return st==="always"||st!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,st){return(tt!==et||resolveEnabled(st.enabled,tt)===!1)&&(!rt.suspense||tt.state.status!=="error")&&isStale(tt,rt)}function isStale(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.isStaleByTime(resolveStaleTime(et.staleTime,tt))}function shouldAssignObserverCurrentProperties(tt,et){return!shallowEqualObjects(tt.getCurrentResult(),et)}var InfiniteQueryObserver=class extends QueryObserver{constructor(tt,et){super(tt,et)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(tt,et){super.setOptions({...tt,behavior:infiniteQueryBehavior()},et)}getOptimisticResult(tt){return tt.behavior=infiniteQueryBehavior(),super.getOptimisticResult(tt)}fetchNextPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"backward"}}})}createResult(tt,et){var vt,yt;const{state:rt}=tt,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(yt=(vt=rt.fetchMeta)==null?void 0:vt.fetchMore)==null?void 0:yt.direction,ct=at&&ut==="forward",dt=nt&&ut==="forward",ht=at&&ut==="backward",ft=nt&&ut==="backward";return{...st,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:ft,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!ft}}},Ko,Qo,Vs,Po,jo,P1,t2,tm,MutationObserver$1=(tm=class extends Subscribable{constructor(rt,st){super();Or(this,jo);Or(this,Ko);Or(this,Qo);Or(this,Vs);Or(this,Po);Sr(this,Ko,rt),this.setOptions(st),this.bindMethods(),Fr(this,jo,P1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var nt;const st=this.options;this.options=Kt(this,Ko).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,Ko).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,Vs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,Vs))==null?void 0:nt.state.status)==="pending"&&Kt(this,Vs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,Vs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Fr(this,jo,P1).call(this),Fr(this,jo,t2).call(this,rt)}getCurrentResult(){return Kt(this,Qo)}reset(){var rt;(rt=Kt(this,Vs))==null||rt.removeObserver(this),Sr(this,Vs,void 0),Fr(this,jo,P1).call(this),Fr(this,jo,t2).call(this)}mutate(rt,st){var nt;return Sr(this,Po,st),(nt=Kt(this,Vs))==null||nt.removeObserver(this),Sr(this,Vs,Kt(this,Ko).getMutationCache().build(Kt(this,Ko),this.options)),Kt(this,Vs).addObserver(this),Kt(this,Vs).execute(rt)}},Ko=new WeakMap,Qo=new WeakMap,Vs=new WeakMap,Po=new WeakMap,jo=new WeakSet,P1=function(){var st;const rt=((st=Kt(this,Vs))==null?void 0:st.state)??getDefaultState();Sr(this,Qo,{...rt,isPending:rt.status==="pending",isSuccess:rt.status==="success",isError:rt.status==="error",isIdle:rt.status==="idle",mutate:this.mutate,reset:this.reset})},t2=function(rt){notifyManager.batch(()=>{var st,nt,ot,at,lt,ut,ct,dt;if(Kt(this,Po)&&this.hasListeners()){const ht=Kt(this,Qo).variables,ft=Kt(this,Qo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,Po)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,Po)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,Po)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,Po)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}this.listeners.forEach(ht=>{ht(Kt(this,Qo))})})},tm),QueryClientContext=reactExports.createContext(void 0),useQueryClient=tt=>{const et=reactExports.useContext(QueryClientContext);if(!et)throw new Error("No QueryClient set, use QueryClientProvider to set one");return et},QueryClientProvider=({client:tt,children:et})=>(reactExports.useEffect(()=>(tt.mount(),()=>{tt.unmount()}),[tt]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:tt,children:et})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let tt=!1;return{clearReset:()=>{tt=!1},reset:()=>{tt=!0},isReset:()=>tt}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(tt,et){return typeof tt=="function"?tt(...et):!!tt}function noop(){}var ensurePreventErrorBoundaryRetry=(tt,et)=>{(tt.suspense||tt.throwOnError||tt.experimental_prefetchInRender)&&(et.isReset()||(tt.retryOnMount=!1))},useClearResetErrorBoundary=tt=>{reactExports.useEffect(()=>{tt.clearReset()},[tt])},getHasError=({result:tt,errorResetBoundary:et,throwOnError:rt,query:st})=>tt.isError&&!et.isReset()&&!tt.isFetching&&st&&shouldThrowError(rt,[tt.error,st]),ensureSuspenseTimers=tt=>{tt.suspense&&(tt.staleTime===void 0&&(tt.staleTime=1e3),typeof tt.gcTime=="number"&&(tt.gcTime=Math.max(tt.gcTime,1e3)))},willFetch=(tt,et)=>tt.isLoading&&tt.isFetching&&!et,shouldSuspend=(tt,et)=>(tt==null?void 0:tt.suspense)&&et.isPending,fetchOptimistic=(tt,et,rt)=>et.fetchOptimistic(tt).catch(()=>{rt.clearReset()});function useBaseQuery(tt,et,rt){var dt,ht,ft,xt,vt;const st=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=st.defaultQueryOptions(tt);(ht=(dt=st.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!st.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(st,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(yt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(yt));return ut.updateResult(),Et},[ut,nt]),()=>ut.getCurrentResult(),()=>ut.getCurrentResult()),reactExports.useEffect(()=>{ut.setOptions(at,{listeners:!1})},[at,ut]),shouldSuspend(at,ct))throw fetchOptimistic(at,ut,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:at.throwOnError,query:st.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(ft=st.getDefaultOptions().queries)==null?void 0:ft._experimental_afterQuery)==null||xt.call(ft,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const yt=lt?fetchOptimistic(at,ut,ot):(vt=st.getQueryCache().get(at.queryHash))==null?void 0:vt.promise;yt==null||yt.catch(noop).finally(()=>{ut.updateResult()})}return at.notifyOnChangeProps?ct:ut.trackResult(ct)}function useQuery(tt,et){return useBaseQuery(tt,QueryObserver)}function queryOptions(tt){return tt}function useMutation(tt,et){const rt=useQueryClient(),[st]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{st.setOptions(tt)},[st,tt]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(at=>st.subscribe(notifyManager.batchCalls(at)),[st]),()=>st.getCurrentResult(),()=>st.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{st.mutate(at,lt).catch(noop)},[st]);if(nt.error&&shouldThrowError(st.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}const useConversation=()=>{const tt=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"),et=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"),[rt,st]=reactExports.useState(""),nt={unread:!0,_:new Date().getTime()},{data:ot}=useQuery({queryKey:["folder","count","inbox"],queryFn:async()=>await odeServices.http().get(tt?"/zimbra/count/INBOX":"/conversation/count/inbox",{queryParams:nt}),staleTime:5*60*1e3}),at=async()=>{const lt="/zimbra/zimbra";try{const{preference:ut}=await odeServices.http().get("/userbook/preference/zimbra"),ct=ut?JSON.parse(ut).modeExpert:!1;st(ct&&et?"/zimbra/preauth":window.location.origin+lt)}catch(ut){console.error(ut),st(window.location.origin+lt)}};return reactExports.useEffect(()=>{at()},[]),{messages:ot?ot.count:0,msgLink:rt,zimbraWorkflow:tt}};var dayjs_min={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt=1e3,st=6e4,nt=36e5,ot="millisecond",at="second",lt="minute",ut="hour",ct="day",dt="week",ht="month",ft="quarter",xt="year",vt="date",yt="Invalid Date",Et=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,bt=/\[([^\]]+)]|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,wt={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(kt){var $t=["th","st","nd","rd"],Ft=kt%100;return"["+kt+($t[(Ft-20)%10]||$t[Ft]||$t[0])+"]"}},St=function(kt,$t,Ft){var Gt=String(kt);return!Gt||Gt.length>=$t?kt:""+Array($t+1-Gt.length).join(Ft)+kt},Rt={s:St,z:function(kt){var $t=-kt.utcOffset(),Ft=Math.abs($t),Gt=Math.floor(Ft/60),Mt=Ft%60;return($t<=0?"+":"-")+St(Gt,2,"0")+":"+St(Mt,2,"0")},m:function kt($t,Ft){if($t.date()<Ft.date())return-kt(Ft,$t);var Gt=12*(Ft.year()-$t.year())+(Ft.month()-$t.month()),Mt=$t.clone().add(Gt,ht),Vt=Ft-Mt<0,Bt=$t.clone().add(Gt+(Vt?-1:1),ht);return+(-(Gt+(Ft-Mt)/(Vt?Mt-Bt:Bt-Mt))||0)},a:function(kt){return kt<0?Math.ceil(kt)||0:Math.floor(kt)},p:function(kt){return{M:ht,y:xt,w:dt,d:ct,D:vt,h:ut,m:lt,s:at,ms:ot,Q:ft}[kt]||String(kt||"").toLowerCase().replace(/s$/,"")},u:function(kt){return kt===void 0}},Ct="en",It={};It[Ct]=wt;var jt="$isDayjsObject",Pt=function(kt){return kt instanceof Ht||!(!kt||!kt[jt])},Ot=function kt($t,Ft,Gt){var Mt;if(!$t)return Ct;if(typeof $t=="string"){var Vt=$t.toLowerCase();It[Vt]&&(Mt=Vt),Ft&&(It[Vt]=Ft,Mt=Vt);var Bt=$t.split("-");if(!Mt&&Bt.length>1)return kt(Bt[0])}else{var qt=$t.name;It[qt]=$t,Mt=qt}return!Gt&&Mt&&(Ct=Mt),Mt||!Gt&&Ct},Ut=function(kt,$t){if(Pt(kt))return kt.clone();var Ft=typeof $t=="object"?$t:{};return Ft.date=kt,Ft.args=arguments,new Ht(Ft)},Nt=Rt;Nt.l=Ot,Nt.i=Pt,Nt.w=function(kt,$t){return Ut(kt,{locale:$t.$L,utc:$t.$u,x:$t.$x,$offset:$t.$offset})};var Ht=function(){function kt(Ft){this.$L=Ot(Ft.locale,null,!0),this.parse(Ft),this.$x=this.$x||Ft.x||{},this[jt]=!0}var $t=kt.prototype;return $t.parse=function(Ft){this.$d=function(Gt){var Mt=Gt.date,Vt=Gt.utc;if(Mt===null)return new Date(NaN);if(Nt.u(Mt))return new Date;if(Mt instanceof Date)return new Date(Mt);if(typeof Mt=="string"&&!/Z$/i.test(Mt)){var Bt=Mt.match(Et);if(Bt){var qt=Bt[2]-1||0,Qt=(Bt[7]||"0").substring(0,3);return Vt?new Date(Date.UTC(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)):new Date(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)}}return new Date(Mt)}(Ft),this.init()},$t.init=function(){var Ft=this.$d;this.$y=Ft.getFullYear(),this.$M=Ft.getMonth(),this.$D=Ft.getDate(),this.$W=Ft.getDay(),this.$H=Ft.getHours(),this.$m=Ft.getMinutes(),this.$s=Ft.getSeconds(),this.$ms=Ft.getMilliseconds()},$t.$utils=function(){return Nt},$t.isValid=function(){return this.$d.toString()!==yt},$t.isSame=function(Ft,Gt){var Mt=Ut(Ft);return this.startOf(Gt)<=Mt&&Mt<=this.endOf(Gt)},$t.isAfter=function(Ft,Gt){return Ut(Ft)<this.startOf(Gt)},$t.isBefore=function(Ft,Gt){return this.endOf(Gt)<Ut(Ft)},$t.$g=function(Ft,Gt,Mt){return Nt.u(Ft)?this[Gt]:this.set(Mt,Ft)},$t.unix=function(){return Math.floor(this.valueOf()/1e3)},$t.valueOf=function(){return this.$d.getTime()},$t.startOf=function(Ft,Gt){var Mt=this,Vt=!!Nt.u(Gt)||Gt,Bt=Nt.p(Ft),qt=function(or,hr){var pr=Nt.w(Mt.$u?Date.UTC(Mt.$y,hr,or):new Date(Mt.$y,hr,or),Mt);return Vt?pr:pr.endOf(ct)},Qt=function(or,hr){return Nt.w(Mt.toDate()[or].apply(Mt.toDate("s"),(Vt?[0,0,0,0]:[23,59,59,999]).slice(hr)),Mt)},Yt=this.$W,tr=this.$M,lr=this.$D,ur="set"+(this.$u?"UTC":"");switch(Bt){case xt:return Vt?qt(1,0):qt(31,11);case ht:return Vt?qt(1,tr):qt(0,tr+1);case dt:var mr=this.$locale().weekStart||0,yr=(Yt<mr?Yt+7:Yt)-mr;return qt(Vt?lr-yr:lr+(6-yr),tr);case ct:case vt:return Qt(ur+"Hours",0);case ut:return Qt(ur+"Minutes",1);case lt:return Qt(ur+"Seconds",2);case at:return Qt(ur+"Milliseconds",3);default:return this.clone()}},$t.endOf=function(Ft){return this.startOf(Ft,!1)},$t.$set=function(Ft,Gt){var Mt,Vt=Nt.p(Ft),Bt="set"+(this.$u?"UTC":""),qt=(Mt={},Mt[ct]=Bt+"Date",Mt[vt]=Bt+"Date",Mt[ht]=Bt+"Month",Mt[xt]=Bt+"FullYear",Mt[ut]=Bt+"Hours",Mt[lt]=Bt+"Minutes",Mt[at]=Bt+"Seconds",Mt[ot]=Bt+"Milliseconds",Mt)[Vt],Qt=Vt===ct?this.$D+(Gt-this.$W):Gt;if(Vt===ht||Vt===xt){var Yt=this.clone().set(vt,1);Yt.$d[qt](Qt),Yt.init(),this.$d=Yt.set(vt,Math.min(this.$D,Yt.daysInMonth())).$d}else qt&&this.$d[qt](Qt);return this.init(),this},$t.set=function(Ft,Gt){return this.clone().$set(Ft,Gt)},$t.get=function(Ft){return this[Nt.p(Ft)]()},$t.add=function(Ft,Gt){var Mt,Vt=this;Ft=Number(Ft);var Bt=Nt.p(Gt),qt=function(tr){var lr=Ut(Vt);return Nt.w(lr.date(lr.date()+Math.round(tr*Ft)),Vt)};if(Bt===ht)return this.set(ht,this.$M+Ft);if(Bt===xt)return this.set(xt,this.$y+Ft);if(Bt===ct)return qt(1);if(Bt===dt)return qt(7);var Qt=(Mt={},Mt[lt]=st,Mt[ut]=nt,Mt[at]=rt,Mt)[Bt]||1,Yt=this.$d.getTime()+Ft*Qt;return Nt.w(Yt,this)},$t.subtract=function(Ft,Gt){return this.add(-1*Ft,Gt)},$t.format=function(Ft){var Gt=this,Mt=this.$locale();if(!this.isValid())return Mt.invalidDate||yt;var Vt=Ft||"YYYY-MM-DDTHH:mm:ssZ",Bt=Nt.z(this),qt=this.$H,Qt=this.$m,Yt=this.$M,tr=Mt.weekdays,lr=Mt.months,ur=Mt.meridiem,mr=function(hr,pr,_r,Ar){return hr&&(hr[pr]||hr(Gt,Vt))||_r[pr].slice(0,Ar)},yr=function(hr){return Nt.s(qt%12||12,hr,"0")},or=ur||function(hr,pr,_r){var Ar=hr<12?"AM":"PM";return _r?Ar.toLowerCase():Ar};return Vt.replace(bt,function(hr,pr){return pr||function(_r){switch(_r){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Nt.s(Gt.$y,4,"0");case"M":return Yt+1;case"MM":return Nt.s(Yt+1,2,"0");case"MMM":return mr(Mt.monthsShort,Yt,lr,3);case"MMMM":return mr(lr,Yt);case"D":return Gt.$D;case"DD":return Nt.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return mr(Mt.weekdaysMin,Gt.$W,tr,2);case"ddd":return mr(Mt.weekdaysShort,Gt.$W,tr,3);case"dddd":return tr[Gt.$W];case"H":return String(qt);case"HH":return Nt.s(qt,2,"0");case"h":return yr(1);case"hh":return yr(2);case"a":return or(qt,Qt,!0);case"A":return or(qt,Qt,!1);case"m":return String(Qt);case"mm":return Nt.s(Qt,2,"0");case"s":return String(Gt.$s);case"ss":return Nt.s(Gt.$s,2,"0");case"SSS":return Nt.s(Gt.$ms,3,"0");case"Z":return Bt}return null}(hr)||Bt.replace(":","")})},$t.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$t.diff=function(Ft,Gt,Mt){var Vt,Bt=this,qt=Nt.p(Gt),Qt=Ut(Ft),Yt=(Qt.utcOffset()-this.utcOffset())*st,tr=this-Qt,lr=function(){return Nt.m(Bt,Qt)};switch(qt){case xt:Vt=lr()/12;break;case ht:Vt=lr();break;case ft:Vt=lr()/3;break;case dt:Vt=(tr-Yt)/6048e5;break;case ct:Vt=(tr-Yt)/864e5;break;case ut:Vt=tr/nt;break;case lt:Vt=tr/st;break;case at:Vt=tr/rt;break;default:Vt=tr}return Mt?Vt:Nt.a(Vt)},$t.daysInMonth=function(){return this.endOf(ht).$D},$t.$locale=function(){return It[this.$L]},$t.locale=function(Ft,Gt){if(!Ft)return this.$L;var Mt=this.clone(),Vt=Ot(Ft,Gt,!0);return Vt&&(Mt.$L=Vt),Mt},$t.clone=function(){return Nt.w(this.$d,this)},$t.toDate=function(){return new Date(this.valueOf())},$t.toJSON=function(){return this.isValid()?this.toISOString():null},$t.toISOString=function(){return this.$d.toISOString()},$t.toString=function(){return this.$d.toUTCString()},kt}(),Lt=Ht.prototype;return Ut.prototype=Lt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",vt]].forEach(function(kt){Lt[kt[1]]=function($t){return this.$g($t,kt[0],kt[1])}}),Ut.extend=function(kt,$t){return kt.$i||(kt($t,Ht,Ut),kt.$i=!0),Ut},Ut.locale=Ot,Ut.isDayjs=Pt,Ut.unix=function(kt){return Ut(1e3*kt)},Ut.en=It[Ct],Ut.Ls=It,Ut.p={},Ut})})(dayjs_min);var dayjs_minExports=dayjs_min.exports;const dayjs=getDefaultExportFromCjs(dayjs_minExports);var customParseFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},st=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,nt=/\d\d/,ot=/\d\d?/,at=/\d*[^-_:/,()\s\d]+/,lt={},ut=function(yt){return(yt=+yt)+(yt>68?1900:2e3)},ct=function(yt){return function(Et){this[yt]=+Et}},dt=[/[+-]\d\d:?(\d\d)?|Z/,function(yt){(this.zone||(this.zone={})).offset=function(Et){if(!Et||Et==="Z")return 0;var bt=Et.match(/([+-]|\d\d)/g),wt=60*bt[1]+(+bt[2]||0);return wt===0?0:bt[0]==="+"?-wt:wt}(yt)}],ht=function(yt){var Et=lt[yt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},ft=function(yt,Et){var bt,wt=lt.meridiem;if(wt){for(var St=1;St<=24;St+=1)if(yt.indexOf(wt(St,0,Et))>-1){bt=St>12;break}}else bt=yt===(Et?"pm":"PM");return bt},xt={A:[at,function(yt){this.afternoon=ft(yt,!1)}],a:[at,function(yt){this.afternoon=ft(yt,!0)}],S:[/\d/,function(yt){this.milliseconds=100*+yt}],SS:[nt,function(yt){this.milliseconds=10*+yt}],SSS:[/\d{3}/,function(yt){this.milliseconds=+yt}],s:[ot,ct("seconds")],ss:[ot,ct("seconds")],m:[ot,ct("minutes")],mm:[ot,ct("minutes")],H:[ot,ct("hours")],h:[ot,ct("hours")],HH:[ot,ct("hours")],hh:[ot,ct("hours")],D:[ot,ct("day")],DD:[nt,ct("day")],Do:[at,function(yt){var Et=lt.ordinal,bt=yt.match(/\d+/);if(this.day=bt[0],Et)for(var wt=1;wt<=31;wt+=1)Et(wt).replace(/\[|\]/g,"")===yt&&(this.day=wt)}],M:[ot,ct("month")],MM:[nt,ct("month")],MMM:[at,function(yt){var Et=ht("months"),bt=(ht("monthsShort")||Et.map(function(wt){return wt.slice(0,3)})).indexOf(yt)+1;if(bt<1)throw new Error;this.month=bt%12||bt}],MMMM:[at,function(yt){var Et=ht("months").indexOf(yt)+1;if(Et<1)throw new Error;this.month=Et%12||Et}],Y:[/[+-]?\d+/,ct("year")],YY:[nt,function(yt){this.year=ut(yt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function vt(yt){var Et,bt;Et=yt,bt=lt&<.formats;for(var wt=(yt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Ot,Ut,Nt){var Ht=Nt&&Nt.toUpperCase();return Ut||bt[Nt]||rt[Nt]||bt[Ht].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Lt,kt,$t){return kt||$t.slice(1)})})).match(st),St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt],It=xt[Ct],jt=It&&It[0],Pt=It&&It[1];wt[Rt]=Pt?{regex:jt,parser:Pt}:Ct.replace(/^\[|\]$/g,"")}return function(Ot){for(var Ut={},Nt=0,Ht=0;Nt<St;Nt+=1){var Lt=wt[Nt];if(typeof Lt=="string")Ht+=Lt.length;else{var kt=Lt.regex,$t=Lt.parser,Ft=Ot.slice(Ht),Gt=kt.exec(Ft)[0];$t.call(Ut,Gt),Ot=Ot.replace(Gt,"")}}return function(Mt){var Vt=Mt.afternoon;if(Vt!==void 0){var Bt=Mt.hours;Vt?Bt<12&&(Mt.hours+=12):Bt===12&&(Mt.hours=0),delete Mt.afternoon}}(Ut),Ut}}return function(yt,Et,bt){bt.p.customParseFormat=!0,yt&&yt.parseTwoDigitYear&&(ut=yt.parseTwoDigitYear);var wt=Et.prototype,St=wt.parse;wt.parse=function(Rt){var Ct=Rt.date,It=Rt.utc,jt=Rt.args;this.$u=It;var Pt=jt[1];if(typeof Pt=="string"){var Ot=jt[2]===!0,Ut=jt[3]===!0,Nt=Ot||Ut,Ht=jt[2];Ut&&(Ht=jt[2]),lt=this.$locale(),!Ot&&Ht&&(lt=bt.Ls[Ht]),this.$d=function(Ft,Gt,Mt){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*Ft);var Vt=vt(Gt)(Ft),Bt=Vt.year,qt=Vt.month,Qt=Vt.day,Yt=Vt.hours,tr=Vt.minutes,lr=Vt.seconds,ur=Vt.milliseconds,mr=Vt.zone,yr=new Date,or=Qt||(Bt||qt?1:yr.getDate()),hr=Bt||yr.getFullYear(),pr=0;Bt&&!qt||(pr=qt>0?qt-1:yr.getMonth());var _r=Yt||0,Ar=tr||0,Hr=lr||0,Ur=ur||0;return mr?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur+60*mr.offset*1e3)):Mt?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur)):new Date(hr,pr,or,_r,Ar,Hr,Ur)}catch{return new Date("")}}(Ct,Pt,It),this.init(),Ht&&Ht!==!0&&(this.$L=this.locale(Ht).$L),Nt&&Ct!=this.format(Pt)&&(this.$d=new Date("")),lt={}}else if(Pt instanceof Array)for(var Lt=Pt.length,kt=1;kt<=Lt;kt+=1){jt[1]=Pt[kt-1];var $t=bt.apply(this,jt);if($t.isValid()){this.$d=$t.$d,this.$L=$t.$L,this.init();break}kt===Lt&&(this.$d=new Date(""))}else St.call(this,Rt)}}})})(customParseFormat$1);var customParseFormatExports=customParseFormat$1.exports;const customParseFormat=getDefaultExportFromCjs(customParseFormatExports);var localizedFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(st,nt,ot){var at=nt.prototype,lt=at.format;ot.en.formats=rt,at.format=function(ut){ut===void 0&&(ut="YYYY-MM-DDTHH:mm:ssZ");var ct=this.$locale().formats,dt=function(ht,ft){return ht.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(xt,vt,yt){var Et=yt&&yt.toUpperCase();return vt||ft[yt]||rt[yt]||ft[Et].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(bt,wt,St){return wt||St.slice(1)})})}(ut,ct===void 0?{}:ct);return lt.call(this,dt)}}})})(localizedFormat$1);var localizedFormatExports=localizedFormat$1.exports;const localizedFormat=getDefaultExportFromCjs(localizedFormatExports);var relativeTime$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){return function(rt,st,nt){rt=rt||{};var ot=st.prototype,at={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function lt(ct,dt,ht,ft){return ot.fromToBase(ct,dt,ht,ft)}nt.en.relativeTime=at,ot.fromToBase=function(ct,dt,ht,ft,xt){for(var vt,yt,Et,bt=ht.$locale().relativeTime||at,wt=rt.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt];Ct.d&&(vt=ft?nt(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var It=(rt.rounding||Math.round)(Math.abs(vt));if(Et=vt>0,It<=Ct.r||!Ct.r){It<=1&&Rt>0&&(Ct=wt[Rt-1]);var jt=bt[Ct.l];xt&&(It=xt(""+It)),yt=typeof jt=="string"?jt.replace("%d",It):jt(It,dt,Ct.l,Et);break}}if(dt)return yt;var Pt=Et?bt.future:bt.past;return typeof Pt=="function"?Pt(yt):Pt.replace("%s",yt)},ot.to=function(ct,dt){return lt(ct,dt,this,!0)},ot.from=function(ct,dt){return lt(ct,dt,this)};var ut=function(ct){return ct.$u?nt.utc():nt()};ot.toNow=function(ct){return this.to(ut(this),ct)},ot.fromNow=function(ct){return this.from(ut(this),ct)}}})})(relativeTime$1);var relativeTimeExports=relativeTime$1.exports;const relativeTime=getDefaultExportFromCjs(relativeTimeExports);var de$2={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(ut){return ut&&typeof ut=="object"&&"default"in ut?ut:{default:ut}}var nt=st(rt),ot={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function at(ut,ct,dt){var ht=ot[dt];return Array.isArray(ht)&&(ht=ht[ct?0:1]),ht.replace("%d",ut)}var lt={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(ut){return ut+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:at,m:at,mm:at,h:at,hh:at,d:at,dd:at,M:at,MM:at,y:at,yy:at}};return nt.default.locale(lt,null,!0),lt})})(de$2);var es={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(at){return at+"º"}};return nt.default.locale(ot,null,!0),ot})})(es);var fr={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(at){return""+at+(at===1?"er":"")}};return nt.default.locale(ot,null,!0),ot})})(fr);var it={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(at){return at+"º"}};return nt.default.locale(ot,null,!0),ot})})(it);var pt={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(at){return at+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return nt.default.locale(ot,null,!0),ot})})(pt);dayjs.extend(relativeTime);dayjs.extend(customParseFormat);dayjs.extend(localizedFormat);function useDate(){const{currentLanguage:tt}=useEdificeClient(),{t:et}=useTranslation(),rt=reactExports.useCallback((lt,ut)=>{if(lt.length<11)return dayjs(lt,["YYYY-MM-DD"],ut);if(lt.split("").findIndex(ct=>"0">ct||ct>"9")<0)return dayjs(Number.parseInt(lt)).locale(tt);{let ct=dayjs(lt).locale(tt);return ct.isValid()||(ct=dayjs(lt,["YYYY-MM-DD HH:mm:ss.SSS"]).locale(tt)),ct}},[tt]),st=reactExports.useCallback(lt=>{let ut=dayjs();try{return typeof lt>"u"?void 0:(typeof lt=="string"?ut=rt(lt):typeof lt=="number"?ut=dayjs(lt).locale(tt):typeof lt.$date=="number"?ut=dayjs(new Date(lt.$date)).locale(tt):typeof lt.$date=="string"&&(ut=rt(lt.$date)),ut)}catch(ct){console.error(ct)}return ut},[tt,rt]),nt=reactExports.useCallback(lt=>{const ut=st(lt);if(!(ut!=null&&ut.isValid()))return"";const ct=dayjs();return ut.isSame(ct,"date")?ut.fromNow():ut.isSame(ct.subtract(1,"day"),"date")?et("date.format.yesterday"):ct.diff(ut,"days")<=7?ut.format(et("date.format.currentWeek")):ut.isSame(ct,"year")?ut.format(et("date.format.currentYear")):ut.format(et("date.format.previousYear"))},[tt,rt]),ot=reactExports.useCallback(lt=>{const ut=st(lt);return ut!=null&&ut.isValid()?ut.fromNow():""},[tt,rt]),at=reactExports.useCallback((lt,ut="short")=>{const ct=st(lt);let dt="";switch(ut){case"short":dt="L";break;case"long":dt="LL";break;case"abbr":dt="ll";break;default:dt=ut}return ct!=null&&ct.isValid()?ct.locale(tt).format(dt):""},[tt,rt]);return{fromNow:ot,formatDate:at,formatTimeAgo:nt}}function useHover(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=()=>{et(!0)},nt=()=>{et(!1)};return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return ot.addEventListener("mouseover",st),ot.addEventListener("mouseout",nt),()=>{ot.removeEventListener("mouseover",st),ot.removeEventListener("mouseout",nt)}},[rt]),[rt,tt]}let e$1={data:""},t$1=tt=>{if(typeof window=="object"){let et=(tt?tt.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return et.nonce=window.__nonce__,et.parentNode||(tt||document.head).appendChild(et),et.firstChild}return tt||e$1},l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$2=/\n+/g,o$1=(tt,et)=>{let rt="",st="",nt="";for(let ot in tt){let at=tt[ot];ot[0]=="@"?ot[1]=="i"?rt=ot+" "+at+";":st+=ot[1]=="f"?o$1(at,ot):ot+"{"+o$1(at,ot[1]=="k"?"":et)+"}":typeof at=="object"?st+=o$1(at,et?et.replace(/([^,])+/g,lt=>ot.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,ut=>/&/.test(ut)?ut.replace(/&/g,lt):lt?lt+" "+ut:ut)):ot):at!=null&&(ot=/^--/.test(ot)?ot:ot.replace(/[A-Z]/g,"-$&").toLowerCase(),nt+=o$1.p?o$1.p(ot,at):ot+":"+at+";")}return rt+(et&&nt?et+"{"+nt+"}":nt)+st},c$1={},s$1=tt=>{if(typeof tt=="object"){let et="";for(let rt in tt)et+=rt+s$1(tt[rt]);return et}return tt},i$2=(tt,et,rt,st,nt)=>{let ot=s$1(tt),at=c$1[ot]||(c$1[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$1[at]){let ut=ot!==tt?tt:(ct=>{let dt,ht,ft=[{}];for(;dt=l$1.exec(ct.replace(a$1,""));)dt[4]?ft.shift():dt[3]?(ht=dt[3].replace(n$2," ").trim(),ft.unshift(ft[0][ht]=ft[0][ht]||{})):ft[0][dt[1]]=dt[2].replace(n$2," ").trim();return ft[0]})(tt);c$1[at]=o$1(nt?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$1.g?c$1.g:null;return rt&&(c$1.g=c$1[at]),((ut,ct,dt,ht)=>{ht?ct.data=ct.data.replace(ht,ut):ct.data.indexOf(ut)===-1&&(ct.data=dt?ut+ct.data:ct.data+ut)})(c$1[at],et,st,lt),at},p$1=(tt,et,rt)=>tt.reduce((st,nt,ot)=>{let at=et[ot];if(at&&at.call){let lt=at(rt),ut=lt&<.props&<.props.className||/^go/.test(lt)&<at=ut?"."+ut:lt&&typeof lt=="object"?lt.props?"":o$1(lt,""):lt===!1?"":lt}return st+nt+(at??"")},"");function u$1(tt){let et=this||{},rt=tt.call?tt(et.p):tt;return i$2(rt.unshift?rt.raw?p$1(rt,[].slice.call(arguments,1),et.p):rt.reduce((st,nt)=>Object.assign(st,nt&&nt.call?nt(et.p):nt),{}):rt,t$1(et.target),et.g,et.o,et.k)}let d$1,f$2,g$1;u$1.bind({g:1});let h$2=u$1.bind({k:1});function m$1(tt,et,rt,st){o$1.p=et,d$1=tt,f$2=rt,g$1=st}function w$2(tt,et){let rt=this||{};return function(){let st=arguments;function nt(ot,at){let lt=Object.assign({},ot),ut=lt.className||nt.className;rt.p=Object.assign({theme:f$2&&f$2()},lt),rt.o=/ *go\d+/.test(ut),lt.className=u$1.apply(rt,st)+(ut?" "+ut:"");let ct=tt;return tt[0]&&(ct=lt.as||tt,delete lt.as),g$1&&ct[0]&&g$1(lt),d$1(ct,lt)}return et?et(nt):nt}}var Z$1=tt=>typeof tt=="function",h$1=(tt,et)=>Z$1(tt)?tt(et):tt,W$2=(()=>{let tt=0;return()=>(++tt).toString()})(),E$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),re$1=20,k$2="default",H$3=(tt,et)=>{let{toastLimit:rt}=tt.settings;switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,rt)};case 1:return{...tt,toasts:tt.toasts.map(at=>at.id===et.toast.id?{...at,...et.toast}:at)};case 2:let{toast:st}=et;return H$3(tt,{type:tt.toasts.find(at=>at.id===st.id)?1:0,toast:st});case 3:let{toastId:nt}=et;return{...tt,toasts:tt.toasts.map(at=>at.id===nt||nt===void 0?{...at,dismissed:!0,visible:!1}:at)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(at=>at.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let ot=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(at=>({...at,pauseDuration:at.pauseDuration+ot}))}}},v$1=[],j$2={toasts:[],pausedAt:void 0,settings:{toastLimit:re$1}},f$1={},Y$1=(tt,et=k$2)=>{f$1[et]=H$3(f$1[et]||j$2,tt),v$1.forEach(([rt,st])=>{rt===et&&st(f$1[et])})},_$1=tt=>Object.keys(f$1).forEach(et=>Y$1(tt,et)),Q$1=tt=>Object.keys(f$1).find(et=>f$1[et].toasts.some(rt=>rt.id===tt)),S$1=(tt=k$2)=>et=>{Y$1(et,tt)},se$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},V$1=(tt={},et=k$2)=>{let[rt,st]=reactExports.useState(f$1[et]||j$2),nt=reactExports.useRef(f$1[et]);reactExports.useEffect(()=>(nt.current!==f$1[et]&&st(f$1[et]),v$1.push([et,st]),()=>{let at=v$1.findIndex(([lt])=>lt===et);at>-1&&v$1.splice(at,1)}),[et]);let ot=rt.toasts.map(at=>{var lt,ut,ct;return{...tt,...tt[at.type],...at,removeDelay:at.removeDelay||((lt=tt[at.type])==null?void 0:lt.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:at.duration||((ut=tt[at.type])==null?void 0:ut.duration)||(tt==null?void 0:tt.duration)||se$1[at.type],style:{...tt.style,...(ct=tt[at.type])==null?void 0:ct.style,...at.style}}});return{...rt,toasts:ot}},ie$1=(tt,et="blank",rt)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:et,ariaProps:{role:"status","aria-live":"polite"},message:tt,pauseDuration:0,...rt,id:(rt==null?void 0:rt.id)||W$2()}),P$1=tt=>(et,rt)=>{let st=ie$1(et,tt,rt);return S$1(st.toasterId||Q$1(st.id))({type:2,toast:st}),st.id},n$1=(tt,et)=>P$1("blank")(tt,et);n$1.error=P$1("error");n$1.success=P$1("success");n$1.loading=P$1("loading");n$1.custom=P$1("custom");n$1.dismiss=(tt,et)=>{let rt={type:3,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.dismissAll=tt=>n$1.dismiss(void 0,tt);n$1.remove=(tt,et)=>{let rt={type:4,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.removeAll=tt=>n$1.remove(void 0,tt);n$1.promise=(tt,et,rt)=>{let st=n$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(nt=>{let ot=et.success?h$1(et.success,nt):void 0;return ot?n$1.success(ot,{id:st,...rt,...rt==null?void 0:rt.success}):n$1.dismiss(st),nt}).catch(nt=>{let ot=et.error?h$1(et.error,nt):void 0;ot?n$1.error(ot,{id:st,...rt,...rt==null?void 0:rt.error}):n$1.dismiss(st)}),tt};var ce$1=1e3,w$1=(tt,et="default")=>{let{toasts:rt,pausedAt:st}=V$1(tt,et),nt=reactExports.useRef(new Map).current,ot=reactExports.useCallback((ht,ft=ce$1)=>{if(nt.has(ht))return;let xt=setTimeout(()=>{nt.delete(ht),at({type:4,toastId:ht})},ft);nt.set(ht,xt)},[]);reactExports.useEffect(()=>{if(st)return;let ht=Date.now(),ft=rt.map(xt=>{if(xt.duration===1/0)return;let vt=(xt.duration||0)+xt.pauseDuration-(ht-xt.createdAt);if(vt<0){xt.visible&&n$1.dismiss(xt.id);return}return setTimeout(()=>n$1.dismiss(xt.id,et),vt)});return()=>{ft.forEach(xt=>xt&&clearTimeout(xt))}},[rt,st,et]);let at=reactExports.useCallback(S$1(et),[et]),lt=reactExports.useCallback(()=>{at({type:5,time:Date.now()})},[at]),ut=reactExports.useCallback((ht,ft)=>{at({type:1,toast:{id:ht,height:ft}})},[at]),ct=reactExports.useCallback(()=>{st&&at({type:6,time:Date.now()})},[st,at]),dt=reactExports.useCallback((ht,ft)=>{let{reverseOrder:xt=!1,gutter:vt=8,defaultPosition:yt}=ft||{},Et=rt.filter(St=>(St.position||yt)===(ht.position||yt)&&St.height),bt=Et.findIndex(St=>St.id===ht.id),wt=Et.filter((St,Rt)=>Rt<bt&&St.visible).length;return Et.filter(St=>St.visible).slice(...xt?[wt+1]:[0,wt]).reduce((St,Rt)=>St+(Rt.height||0)+vt,0)},[rt]);return reactExports.useEffect(()=>{rt.forEach(ht=>{if(ht.dismissed)ot(ht.id,ht.removeDelay);else{let ft=nt.get(ht.id);ft&&(clearTimeout(ft),nt.delete(ht.id))}})},[rt,ot]),{toasts:rt,handlers:{updateHeight:ut,startPause:lt,endPause:ct,calculateOffset:dt}}},de$1=h$2`
|
|
51
51
|
from {
|
|
52
52
|
transform: scale(0) rotate(45deg);
|
|
53
53
|
opacity: 0;
|
|
@@ -223,7 +223,7 @@ to {
|
|
|
223
223
|
> * {
|
|
224
224
|
pointer-events: auto;
|
|
225
225
|
}
|
|
226
|
-
`,D$1=16,Fe$1=({reverseOrder:tt,position:et="top-center",toastOptions:rt,gutter:st,children:nt,toasterId:ot,containerStyle:at,containerClassName:lt})=>{let{toasts:ut,handlers:ct}=w$1(rt,ot);return reactExports.createElement("div",{"data-rht-toaster":ot||"",style:{position:"fixed",zIndex:9999,top:D$1,left:D$1,right:D$1,bottom:D$1,pointerEvents:"none",...at},className:lt,onMouseEnter:ct.startPause,onMouseLeave:ct.endPause},ut.map(dt=>{let ht=dt.position||et,ft=ct.calculateOffset(dt,{reverseOrder:tt,gutter:st,defaultPosition:et}),xt=Me$1(ht,ft);return reactExports.createElement(we$1,{id:dt.id,key:dt.id,onHeightUpdate:ct.updateHeight,className:dt.visible?Ce$1:"",style:xt},dt.type==="custom"?h$1(dt.message,dt):nt?nt(dt):reactExports.createElement(N$2,{toast:dt,position:ht}))}))},zt=n$1;const DEFAULT_POSITION="top-right";function useToast(){return{success:(tt,et)=>zt.custom(jsxRuntimeExports.jsx(Alert,{type:"success",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),error:(tt,et)=>zt.custom(jsxRuntimeExports.jsx(Alert,{type:"danger",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),info:(tt,et)=>zt.custom(jsxRuntimeExports.jsx(Alert,{type:"info",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),warning:(tt,et)=>zt.custom(jsxRuntimeExports.jsx(Alert,{type:"warning",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),loading:zt.loading,dismiss:tt=>zt.dismiss(tt),remove:tt=>zt.remove(tt)}}const useHttpErrorToast=tt=>{const et=reactExports.useRef(),rt=useToast(),{t:st}=useTranslation();return reactExports.useEffect(()=>{const nt=odeServices.notify().events().subscribe(LAYER_NAME.TRANSPORT,ot=>{var at;if(!(ot!=null&&ot.data))return;const{response:lt}=ot.data,ut=((at=ot.data.payload)==null?void 0:at.error)||([400,401,403,404,408,413,500,504].includes(lt==null?void 0:lt.status)?`e${ot.data.response.status}`:void 0)||(lt==null?void 0:lt.statusText);typeof ut=="string"&&(et.current=st(ut),rt.error(React$4.createElement("div",{children:[et.current]}),tt))});return()=>nt.revoke()},[st,rt]),et.current};function useIsAdml(){const[tt,et]=reactExports.useState(!1);reactExports.useEffect(()=>{rt()},[]);const rt=reactExports.useCallback(async()=>{const st=await odeServices.session().isAdml();et(st)},[]);return{isAdml:tt}}const useLibraryUrl=tt=>{var et;const{user:rt,appCode:st}=useEdificeClient(),nt=e$3[st],ot=rt==null?void 0:rt.apps.find(dt=>dt.isExternal&&dt.address.includes("library"));if(!ot)return null;const at=(et=ot.address)==null?void 0:et.split("?");if(!at||at.length<2)return null;let lt=at[0];lt.endsWith("/")||(lt=`${lt}/`);const ut=at==null?void 0:at[1],ct=`application%5B0%5D=${nt}&page=1&sort_field=views&sort_order=desc`;return`${lt}search/?${ut}&${ct}`},useWorkspaceFile=()=>({createOrUpdate:async({alt:tt,uri:et,blob:rt,legend:st,parentId:nt,application:ot,visibility:at})=>{const lt=/\/workspace\/document\/([0-9a-fA-F-]+)/,ut=(et??"").match(lt);if(ut&&ut.length===2){const ct=ut[1],dt=await odeServices.workspace().searchDocuments({filter:"all",id:ct,limit:1}),ht=dt.length?dt[0].name:void 0;await odeServices.workspace().updateFile(ct,rt,{alt:tt,legend:st,name:ht});const ft=(await odeServices.workspace().searchDocuments({filter:"all",id:ct,limit:1}))[0];return{file:ft,src:`/workspace/${ft.public?"pub/":""}document/${ct}`}}else{const ct=await odeServices.workspace().saveFile(rt,{application:ot,parentId:nt,visibility:at});return`/workspace/${ct.public?"pub/":""}document/${ct._id}`}},create:async(tt,et)=>await odeServices.workspace().saveFile(tt,et),remove:async tt=>!tt||Array.isArray(tt)&&tt.length===0?Promise.resolve():await odeServices.workspace().deleteFile(Array.isArray(tt)?tt:[tt])}),useMediaLibrary=()=>{const tt=reactExports.useRef(null),[et,rt]=reactExports.useState(),{remove:st}=useWorkspaceFile();return{ref:tt,libraryMedia:et,setLibraryMedia:rt,onCancel:async nt=>{var ot,at;(ot=tt.current)!=null&&ot.type&&nt&&nt.length>0&&await st(nt),(at=tt.current)==null||at.hide()},onSuccess:nt=>{var ot,at,lt,ut;let ct;switch((ot=tt.current)==null?void 0:ot.type){case"video":{if(typeof nt=="object")ct=nt[0];else{const dt=new DOMParser().parseFromString(nt,"text/html").body.firstChild,ht=dt==null?void 0:dt.getAttribute("src");(at=tt.current)==null||at.hide(),ct=ht}break}case"embedder":{const dt=new DOMParser().parseFromString(nt,"text/html").body.firstChild,ht=dt==null?void 0:dt.getAttribute("src");(lt=tt.current)==null||lt.hide(),ct=ht;break}case"audio":{nt.length===void 0?ct=nt:ct=nt[0];break}case"hyperlink":{ct=nt;break}case"image":{ct=`/workspace/document/${nt[0]._id}`;break}default:ct=nt[0]}(ut=tt.current)==null||ut.hide(),rt(ct)},onTabChange:async(nt,ot)=>{var at;(at=tt.current)!=null&&at.type&&ot&&ot.length>0&&await st(ot)}}};function useScrollToTop(){const tt=document.querySelector("html");return()=>{tt&&tt.scrollIntoView()}}function useToggle(tt=!1){const[et,rt]=reactExports.useState(tt),st=reactExports.useCallback(()=>{rt(nt=>!nt)},[]);return[et,st]}const EdificeThemeContext=reactExports.createContext(null);function useEdificeTheme(){const tt=reactExports.useContext(EdificeThemeContext);if(!tt)throw new Error("Cannot be used outside of EdificeThemeProvider");return tt}function useUser(){const{user:tt,userDescription:et}=useEdificeClient(),{theme:rt}=useEdificeTheme();function st(){let nt=et==null?void 0:et.picture;return(!nt||nt==="no-avatar.jpg"||nt==="no-avatar.svg")&&(nt=`${rt==null?void 0:rt.basePath}/img/illustrations/no-avatar.svg`),nt}return{user:tt,avatar:st(),userDescription:et}}const useUpload=(tt,et="media-library")=>{const[rt,st]=reactExports.useState({}),{browser:nt,device:ot}=useBrowserInfo(navigator.userAgent),{create:at}=useWorkspaceFile(),{t:lt}=useTranslation(),ut=reactExports.useCallback(Et=>rt[s$2(Et)],[rt]),ct=(Et,bt)=>{st(wt=>{const St=s$2(Et);return{...wt,[St]:bt}})},dt=Et=>{st(bt=>{const wt=s$2(Et),{[wt]:St,...Rt}=bt;return Rt})},ht=()=>{const Et=new Date;return`${Et.getFullYear()}-${String(Et.getMonth()+1).padStart(2,"0")}-${String(Et.getDate()).padStart(2,"0")} ${String(Et.getHours()).padStart(2,"0")}h${String(Et.getMinutes()).padStart(2,"0")} `+lt("bbm.video.recorder.defaultName")};async function ft(Et,bt){ct(Et,"loading");try{let wt;return et==="media-library"&&Et.type.includes("video")?wt=await vt(Et,{filename:Et.name,...bt}):wt=await at(Et,{application:et,visibility:tt}),ct(Et,"success"),wt}catch(wt){return console.error(wt),ct(Et,"error"),null}}async function xt(Et,bt){ct(Et,"loading");try{let wt;if(Et.type.includes("video"))wt=await vt(Et,bt);else throw new Error(ERROR_CODE.NOT_SUPPORTED);return ct(Et,"success"),wt}catch(wt){return console.error(wt),ct(Et,"error"),null}}const vt=async(Et,bt)=>{const wt={data:{device:ot.type,browser:{name:nt.name,version:nt.version},url:window.location.hostname,file:Et,filename:ht()??"filename",weight:Et.size},appCode:et,captation:!(Et instanceof File),duration:(bt==null?void 0:bt.duration)??0},St=await odeServices.video().upload(wt);if(St.state==="succeed")return{_id:St.videoworkspaceid,file:St.videoid,name:wt.data.filename,eType:"file",eParent:"",children:[],created:new Date,_shared:[],_isShared:!1,owner:{userId:"",displayName:""}};throw St.state==="error"?new Error(St.code||"Error while uploading video"):new Error("Video encoding is still running")};function yt(Et,bt,wt){return s$2(bt,s$2(Et)),ft(bt,wt)}return{getUploadStatus:ut,setUploadStatus:ct,clearUploadStatus:dt,uploadFile:ft,uploadAlternateFile:yt,uploadBlob:xt}},useUploadFiles=({handleOnChange:tt,visibility:et,application:rt})=>{const[st,nt]=reactExports.useState([]),[ot,at]=reactExports.useState(void 0),{files:lt,deleteFile:ut,replaceFileAt:ct,inputRef:dt}=useDropzoneContext(),{remove:ht,createOrUpdate:ft}=useWorkspaceFile(),{getUploadStatus:xt,setUploadStatus:vt,clearUploadStatus:yt,uploadFile:Et,uploadAlternateFile:bt}=useUpload(et,rt),wt=reactExports.useCallback(()=>{dt.current&&(dt.current.value="")},[dt]),St=reactExports.useCallback(Pt=>{Pt.forEach(async(Ot,Ut)=>{if(Ot==null)return;let Nt,Ht;if(Ot.type.startsWith("image"))try{Ht=await p$3.resizeImageFile(Ot),Nt=await bt(Ot,Ht),ct(Ut,Ht)}catch(Lt){console.error(Lt)}!Nt&&!Ht&&(Nt=await Et(Ot)),Nt?nt(Lt=>[...Lt,Nt]):wt()})},[bt,Et,ct]);reactExports.useEffect(()=>{let Pt=0;const Ot=lt.map(Ut=>{if(Pt>=5)return null;const Nt=xt(Ut);return Nt==="loading"&&Pt++,Nt?null:Ut});Ot.forEach(Ut=>Ut&&vt(Ut,"idle")),St(Ot)},[lt,st,xt,vt,St]),reactExports.useEffect(()=>{const Pt=Rt(lt,st);tt(Pt)},[st]);const Rt=(Pt,Ot)=>{const Ut=Pt.reduce((Nt,Ht,Lt)=>(Nt[Ht.name]=Lt,Nt),{});return Ot.sort((Nt,Ht)=>Ut[Nt.name]-Ut[Ht.name])};async function Ct(Pt){const Ot=st.find(Ut=>Ut.name===Pt.name);Ot&&(await ht(Ot),yt(Pt),nt(Ut=>Ut.filter(Nt=>Nt.name!==(Ot==null?void 0:Ot.name)))),ut(Pt),wt()}async function It({blob:Pt,legend:Ot,altText:Ut}){if(ot)try{const Nt=await ft({blob:Pt,legend:Ot,alt:Ut,uri:jt(ot)});Nt&&typeof Nt=="object"&&nt(Ht=>Ht.map(Lt=>Lt._id===Nt.file._id?{...Nt.file,title:Ot,alt:Ut}:Lt))}finally{at(void 0)}}const jt=(Pt,Ot)=>{const Ut=`/workspace/${Pt!=null&&Pt.public?"pub/":""}document/${Pt==null?void 0:Pt._id}`;return Pt?Ot?m$3(Ut):Ut:""};return{files:lt,getUploadStatus:xt,clearUploadStatus:yt,uploadedFiles:st,editingImage:ot,setEditingImage:at,getUrl:jt,updateImage:It,uploadFile:Et,removeFile:Ct}};function useWorkspaceSearch(tt,et,rt,st){const nt=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|listDocuments"),ot=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|listFolders");function at(dt,ht){switch(ht.type){case"update":{const ft=findNodeById(dt,ht.folderId);return ft&&(ft.children=ht.subfolders.map(xt=>({id:xt._id||"",name:xt.name})),ft.files=ht.files),{...dt}}default:throw Error("[useWorkspaceSearch] Unknown action type: "+ht.type)}}const[lt,ut]=reactExports.useReducer(at,{id:tt,name:et,section:!0}),ct=reactExports.useCallback(async dt=>{if(nt&&ot){const ht=dt===tt?"":dt,ft=await odeServices.workspace().listDocuments(rt,ht),xt=[],vt=[];ft.filter(yt=>{if(!st||yt.eType==="folder")return!0;const Et=DocumentHelper.getRole(yt);return typeof st=="string"?st===Et:Array.isArray(st)?st.findIndex(bt=>bt===Et)>=0:!1}).forEach(yt=>{yt.eType==="folder"?xt.push(yt):vt.push(yt)}),ut({folderId:dt,subfolders:xt,files:vt,type:"update"})}},[nt,ot,tt,rt,st]);return{root:lt,loadContent:ct}}function useXitiTrackPageLoad(){const[tt,et]=reactExports.useState("pending"),{currentApp:rt}=useEdificeClient();reactExports.useEffect(()=>{st()},[]);const st=async()=>{if(!rt){et("[Xiti] Error, currentApp is not defined.");return}try{await odeServices.analytics().trackPageLoad(window.location.pathname,rt),console.info(`[Xiti] Success tracking page ${window.location.pathname}`),et(`[Xiti] Success tracking page ${window.location.pathname}`)}catch(nt){console.error("[Xiti] Error Tracking Page Load",nt),et(`[Xiti] Error Tracking Page Load: ${nt}`)}};return{xitiStatus:tt}}function useZendeskGuide(){const{currentLanguage:tt}=useEdificeClient(),{userDescription:et}=useUser(),{isAdml:rt}=useIsAdml(),{theme:st}=useEdificeTheme(),nt=window.innerWidth<=768,ot=useHasWorkflow("net.atos.entng.support.controllers.DisplayController|view"),[at,lt]=reactExports.useState(""),[ut,ct]=reactExports.useState(void 0),dt=()=>{const ht=at.split("/");let ft="",xt="";if(ut!=null&&ut.labels&&Object.keys(ut==null?void 0:ut.labels).length>0&&ht.length>1){for(let vt=1;vt<ht.length;vt++)ht[vt].length>0&&ht[vt].match(/\d/)==null&&(ft.length===0?ft=ht[vt]:ft=ft+"/"+ht[vt]);ut!=null&&ut.labels&&Object.prototype.hasOwnProperty.call(ut==null?void 0:ut.labels,ft)?xt=ut==null?void 0:ut.labels[ft]:ut!=null&&ut.default&&String(ut.default).length>0&&(xt=ut==null?void 0:ut.default)}else ut!=null&&ut.default&&String(ut==null?void 0:ut.default).length>0&&(xt=ut==null?void 0:ut.default);if(ht.includes("collaborativewall")&&ht.includes("id")&&nt&&window.zE("webWidget","hide"),xt.includes("${adml}")&&(rt?xt=xt.replace("${adml}","adml"):xt=xt.replace("/${adml}","")),xt.includes("${profile}")){const vt=et==null?void 0:et.profiles;xt=xt.replace("${profile}",vt[0].toLowerCase())}xt.includes("${theme")&&(st!=null&&st.is1d?xt=xt.replace("${theme}","1D"):xt=xt.replace("${theme}","2D")),window.zE("webWidget","helpCenter:setSuggestions",{labels:[xt]})};return reactExports.useEffect(()=>{window.location.pathname!==at&<(window.location.pathname),!(ut===void 0||Object.keys(ut).length===0)&&dt()},[window.location.pathname,ut]),reactExports.useEffect(()=>{document.getElementById("ze-snippet")||ot===void 0||(async()=>{const ht=await odeServices.http().get("/zendeskGuide/config");if(ht&&ht.key&&ht.key!==""){const ft=document.createElement("script");ft.id="ze-snippet",ft.src=`https://static.zdassets.com/ekr/snippet.js?key=${ht.key}`,document.body.appendChild(ft).onload=()=>{tt==="es"?window.zE(function(){window.zE.setLocale("es-419")}):window.zE(function(){window.zE.setLocale("fr")}),Object.keys(ht.module).length>0&&ct(ht.module),window.zE("webWidget","show"),window.zE("webWidget","updateSettings",{webWidget:{color:{theme:ht.color||"#ffc400"},zIndex:3,launcher:{mobile:{labelVisible:!0}},contactForm:{suppress:!ot},helpCenter:{messageButton:{"*":"Assistance ENT","es-419":"Asistencia ENT"},originalArticleButton:ht.articleRedirectButton??!0}}}),window.addEventListener("scroll",()=>{window.zE("webWidget","updateSettings",{webWidget:{launcher:{mobile:{labelVisible:window.scrollY<=5}}}})}),window.zE("webWidget:on","open",function(){ot&&window.zE("webWidget","updateSettings",{webWidget:{contactForm:{suppress:!1}}})}),window.zE("webWidget:on","userEvent",function(xt){const vt=xt.category,yt=xt.action,Et=xt.properties;yt==="Contact Form Shown"&&vt==="Zendesk Web Widget"&&Et&&Et.name==="contact-form"&&ot&&(window.zE("webWidget","updateSettings",{webWidget:{contactForm:{suppress:!0}}}),window.zE("webWidget","close"),window.open("/support","_blank"))})}}})()},[ot]),null}function isObject$3(tt){return tt!==null&&typeof tt=="object"&&"constructor"in tt&&tt.constructor===Object}function extend$2(tt,et){tt===void 0&&(tt={}),et===void 0&&(et={}),Object.keys(et).forEach(rt=>{typeof tt[rt]>"u"?tt[rt]=et[rt]:isObject$3(et[rt])&&isObject$3(tt[rt])&&Object.keys(et[rt]).length>0&&extend$2(tt[rt],et[rt])})}const ssrDocument={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function getDocument(){const tt=typeof document<"u"?document:{};return extend$2(tt,ssrDocument),tt}const ssrWindow={document:ssrDocument,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function tt(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(tt){return typeof setTimeout>"u"?(tt(),null):setTimeout(tt,0)},cancelAnimationFrame(tt){typeof setTimeout>"u"||clearTimeout(tt)}};function getWindow(){const tt=typeof window<"u"?window:{};return extend$2(tt,ssrWindow),tt}function deleteProps(tt){const et=tt;Object.keys(et).forEach(rt=>{try{et[rt]=null}catch{}try{delete et[rt]}catch{}})}function nextTick(tt,et){return et===void 0&&(et=0),setTimeout(tt,et)}function now(){return Date.now()}function getComputedStyle$1(tt){const et=getWindow();let rt;return et.getComputedStyle&&(rt=et.getComputedStyle(tt,null)),!rt&&tt.currentStyle&&(rt=tt.currentStyle),rt||(rt=tt.style),rt}function getTranslate(tt,et){et===void 0&&(et="x");const rt=getWindow();let st,nt,ot;const at=getComputedStyle$1(tt);return rt.WebKitCSSMatrix?(nt=at.transform||at.webkitTransform,nt.split(",").length>6&&(nt=nt.split(", ").map(lt=>lt.replace(",",".")).join(", ")),ot=new rt.WebKitCSSMatrix(nt==="none"?"":nt)):(ot=at.MozTransform||at.OTransform||at.MsTransform||at.msTransform||at.transform||at.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),st=ot.toString().split(",")),et==="x"&&(rt.WebKitCSSMatrix?nt=ot.m41:st.length===16?nt=parseFloat(st[12]):nt=parseFloat(st[4])),et==="y"&&(rt.WebKitCSSMatrix?nt=ot.m42:st.length===16?nt=parseFloat(st[13]):nt=parseFloat(st[5])),nt||0}function isObject$2(tt){return typeof tt=="object"&&tt!==null&&tt.constructor&&Object.prototype.toString.call(tt).slice(8,-1)==="Object"}function isNode(tt){return typeof window<"u"&&typeof window.HTMLElement<"u"?tt instanceof HTMLElement:tt&&(tt.nodeType===1||tt.nodeType===11)}function extend$1(){const tt=Object(arguments.length<=0?void 0:arguments[0]),et=["__proto__","constructor","prototype"];for(let rt=1;rt<arguments.length;rt+=1){const st=rt<0||arguments.length<=rt?void 0:arguments[rt];if(st!=null&&!isNode(st)){const nt=Object.keys(Object(st)).filter(ot=>et.indexOf(ot)<0);for(let ot=0,at=nt.length;ot<at;ot+=1){const lt=nt[ot],ut=Object.getOwnPropertyDescriptor(st,lt);ut!==void 0&&ut.enumerable&&(isObject$2(tt[lt])&&isObject$2(st[lt])?st[lt].__swiper__?tt[lt]=st[lt]:extend$1(tt[lt],st[lt]):!isObject$2(tt[lt])&&isObject$2(st[lt])?(tt[lt]={},st[lt].__swiper__?tt[lt]=st[lt]:extend$1(tt[lt],st[lt])):tt[lt]=st[lt])}}}return tt}function setCSSProperty(tt,et,rt){tt.style.setProperty(et,rt)}function animateCSSModeScroll(tt){let{swiper:et,targetPosition:rt,side:st}=tt;const nt=getWindow(),ot=-et.translate;let at=null,lt;const ut=et.params.speed;et.wrapperEl.style.scrollSnapType="none",nt.cancelAnimationFrame(et.cssModeFrameID);const ct=rt>ot?"next":"prev",dt=(ft,xt)=>ct==="next"&&ft>=xt||ct==="prev"&&ft<=xt,ht=()=>{lt=new Date().getTime(),at===null&&(at=lt);const ft=Math.max(Math.min((lt-at)/ut,1),0),xt=.5-Math.cos(ft*Math.PI)/2;let vt=ot+xt*(rt-ot);if(dt(vt,rt)&&(vt=rt),et.wrapperEl.scrollTo({[st]:vt}),dt(vt,rt)){et.wrapperEl.style.overflow="hidden",et.wrapperEl.style.scrollSnapType="",setTimeout(()=>{et.wrapperEl.style.overflow="",et.wrapperEl.scrollTo({[st]:vt})}),nt.cancelAnimationFrame(et.cssModeFrameID);return}et.cssModeFrameID=nt.requestAnimationFrame(ht)};ht()}function elementChildren(tt,et){return et===void 0&&(et=""),[...tt.children].filter(rt=>rt.matches(et))}function createElement(tt,et){et===void 0&&(et=[]);const rt=document.createElement(tt);return rt.classList.add(...Array.isArray(et)?et:[et]),rt}function elementPrevAll(tt,et){const rt=[];for(;tt.previousElementSibling;){const st=tt.previousElementSibling;et?st.matches(et)&&rt.push(st):rt.push(st),tt=st}return rt}function elementNextAll(tt,et){const rt=[];for(;tt.nextElementSibling;){const st=tt.nextElementSibling;et?st.matches(et)&&rt.push(st):rt.push(st),tt=st}return rt}function elementStyle(tt,et){return getWindow().getComputedStyle(tt,null).getPropertyValue(et)}function elementIndex(tt){let et=tt,rt;if(et){for(rt=0;(et=et.previousSibling)!==null;)et.nodeType===1&&(rt+=1);return rt}}function elementParents(tt,et){const rt=[];let st=tt.parentElement;for(;st;)et?st.matches(et)&&rt.push(st):rt.push(st),st=st.parentElement;return rt}function elementOuterSize(tt,et,rt){const st=getWindow();return tt[et==="width"?"offsetWidth":"offsetHeight"]+parseFloat(st.getComputedStyle(tt,null).getPropertyValue(et==="width"?"margin-right":"margin-top"))+parseFloat(st.getComputedStyle(tt,null).getPropertyValue(et==="width"?"margin-left":"margin-bottom"))}function createElementIfNotDefined(tt,et,rt,st){return tt.params.createElements&&Object.keys(st).forEach(nt=>{if(!rt[nt]&&rt.auto===!0){let ot=elementChildren(tt.el,`.${st[nt]}`)[0];ot||(ot=createElement("div",st[nt]),ot.className=st[nt],tt.el.append(ot)),rt[nt]=ot,et[nt]=ot}}),rt}function classesToSelector(tt){return tt===void 0&&(tt=""),`.${tt.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function Pagination(tt){let{swiper:et,extendParams:rt,on:st,emit:nt}=tt;const ot="swiper-pagination";rt({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:wt=>wt,formatFractionTotal:wt=>wt,bulletClass:`${ot}-bullet`,bulletActiveClass:`${ot}-bullet-active`,modifierClass:`${ot}-`,currentClass:`${ot}-current`,totalClass:`${ot}-total`,hiddenClass:`${ot}-hidden`,progressbarFillClass:`${ot}-progressbar-fill`,progressbarOppositeClass:`${ot}-progressbar-opposite`,clickableClass:`${ot}-clickable`,lockClass:`${ot}-lock`,horizontalClass:`${ot}-horizontal`,verticalClass:`${ot}-vertical`,paginationDisabledClass:`${ot}-disabled`}}),et.pagination={el:null,bullets:[]};let at,lt=0;const ut=wt=>(Array.isArray(wt)?wt:[wt]).filter(St=>!!St);function ct(){return!et.params.pagination.el||!et.pagination.el||Array.isArray(et.pagination.el)&&et.pagination.el.length===0}function dt(wt,St){const{bulletActiveClass:Rt}=et.params.pagination;wt&&(wt=wt[`${St==="prev"?"previous":"next"}ElementSibling`],wt&&(wt.classList.add(`${Rt}-${St}`),wt=wt[`${St==="prev"?"previous":"next"}ElementSibling`],wt&&wt.classList.add(`${Rt}-${St}-${St}`)))}function ht(wt){const St=wt.target.closest(classesToSelector(et.params.pagination.bulletClass));if(!St)return;wt.preventDefault();const Rt=elementIndex(St)*et.params.slidesPerGroup;if(et.params.loop){if(et.realIndex===Rt)return;const Ct=et.realIndex,It=et.getSlideIndexByData(Rt),jt=et.getSlideIndexByData(et.realIndex),Pt=Ot=>{const Ut=et.activeIndex;et.loopFix({direction:Ot,activeSlideIndex:It,slideTo:!1});const Nt=et.activeIndex;Ut===Nt&&et.slideToLoop(Ct,0,!1,!0)};if(It>et.slides.length-et.loopedSlides)Pt(It>jt?"next":"prev");else if(et.params.centeredSlides){const Ot=et.params.slidesPerView==="auto"?et.slidesPerViewDynamic():Math.ceil(parseFloat(et.params.slidesPerView,10));It<Math.floor(Ot/2)&&Pt("prev")}et.slideToLoop(Rt)}else et.slideTo(Rt)}function ft(){const wt=et.rtl,St=et.params.pagination;if(ct())return;let Rt=et.pagination.el;Rt=ut(Rt);let Ct,It;const jt=et.virtual&&et.params.virtual.enabled?et.virtual.slides.length:et.slides.length,Pt=et.params.loop?Math.ceil(jt/et.params.slidesPerGroup):et.snapGrid.length;if(et.params.loop?(It=et.previousRealIndex||0,Ct=et.params.slidesPerGroup>1?Math.floor(et.realIndex/et.params.slidesPerGroup):et.realIndex):typeof et.snapIndex<"u"?(Ct=et.snapIndex,It=et.previousSnapIndex):(It=et.previousIndex||0,Ct=et.activeIndex||0),St.type==="bullets"&&et.pagination.bullets&&et.pagination.bullets.length>0){const Ot=et.pagination.bullets;let Ut,Nt,Ht;if(St.dynamicBullets&&(at=elementOuterSize(Ot[0],et.isHorizontal()?"width":"height"),Rt.forEach(Lt=>{Lt.style[et.isHorizontal()?"width":"height"]=`${at*(St.dynamicMainBullets+4)}px`}),St.dynamicMainBullets>1&&It!==void 0&&(lt+=Ct-(It||0),lt>St.dynamicMainBullets-1?lt=St.dynamicMainBullets-1:lt<0&&(lt=0)),Ut=Math.max(Ct-lt,0),Nt=Ut+(Math.min(Ot.length,St.dynamicMainBullets)-1),Ht=(Nt+Ut)/2),Ot.forEach(Lt=>{const kt=[...["","-next","-next-next","-prev","-prev-prev","-main"].map($t=>`${St.bulletActiveClass}${$t}`)].map($t=>typeof $t=="string"&&$t.includes(" ")?$t.split(" "):$t).flat();Lt.classList.remove(...kt)}),Rt.length>1)Ot.forEach(Lt=>{const kt=elementIndex(Lt);kt===Ct?Lt.classList.add(...St.bulletActiveClass.split(" ")):et.isElement&&Lt.setAttribute("part","bullet"),St.dynamicBullets&&(kt>=Ut&&kt<=Nt&&Lt.classList.add(...`${St.bulletActiveClass}-main`.split(" ")),kt===Ut&&dt(Lt,"prev"),kt===Nt&&dt(Lt,"next"))});else{const Lt=Ot[Ct];if(Lt&&Lt.classList.add(...St.bulletActiveClass.split(" ")),et.isElement&&Ot.forEach((kt,$t)=>{kt.setAttribute("part",$t===Ct?"bullet-active":"bullet")}),St.dynamicBullets){const kt=Ot[Ut],$t=Ot[Nt];for(let Ft=Ut;Ft<=Nt;Ft+=1)Ot[Ft]&&Ot[Ft].classList.add(...`${St.bulletActiveClass}-main`.split(" "));dt(kt,"prev"),dt($t,"next")}}if(St.dynamicBullets){const Lt=Math.min(Ot.length,St.dynamicMainBullets+4),kt=(at*Lt-at)/2-Ht*at,$t=wt?"right":"left";Ot.forEach(Ft=>{Ft.style[et.isHorizontal()?$t:"top"]=`${kt}px`})}}Rt.forEach((Ot,Ut)=>{if(St.type==="fraction"&&(Ot.querySelectorAll(classesToSelector(St.currentClass)).forEach(Nt=>{Nt.textContent=St.formatFractionCurrent(Ct+1)}),Ot.querySelectorAll(classesToSelector(St.totalClass)).forEach(Nt=>{Nt.textContent=St.formatFractionTotal(Pt)})),St.type==="progressbar"){let Nt;St.progressbarOpposite?Nt=et.isHorizontal()?"vertical":"horizontal":Nt=et.isHorizontal()?"horizontal":"vertical";const Ht=(Ct+1)/Pt;let Lt=1,kt=1;Nt==="horizontal"?Lt=Ht:kt=Ht,Ot.querySelectorAll(classesToSelector(St.progressbarFillClass)).forEach($t=>{$t.style.transform=`translate3d(0,0,0) scaleX(${Lt}) scaleY(${kt})`,$t.style.transitionDuration=`${et.params.speed}ms`})}St.type==="custom"&&St.renderCustom?(Ot.innerHTML=St.renderCustom(et,Ct+1,Pt),Ut===0&&nt("paginationRender",Ot)):(Ut===0&&nt("paginationRender",Ot),nt("paginationUpdate",Ot)),et.params.watchOverflow&&et.enabled&&Ot.classList[et.isLocked?"add":"remove"](St.lockClass)})}function xt(){const wt=et.params.pagination;if(ct())return;const St=et.virtual&&et.params.virtual.enabled?et.virtual.slides.length:et.slides.length;let Rt=et.pagination.el;Rt=ut(Rt);let Ct="";if(wt.type==="bullets"){let It=et.params.loop?Math.ceil(St/et.params.slidesPerGroup):et.snapGrid.length;et.params.freeMode&&et.params.freeMode.enabled&&It>St&&(It=St);for(let jt=0;jt<It;jt+=1)wt.renderBullet?Ct+=wt.renderBullet.call(et,jt,wt.bulletClass):Ct+=`<${wt.bulletElement} ${et.isElement?'part="bullet"':""} class="${wt.bulletClass}"></${wt.bulletElement}>`}wt.type==="fraction"&&(wt.renderFraction?Ct=wt.renderFraction.call(et,wt.currentClass,wt.totalClass):Ct=`<span class="${wt.currentClass}"></span> / <span class="${wt.totalClass}"></span>`),wt.type==="progressbar"&&(wt.renderProgressbar?Ct=wt.renderProgressbar.call(et,wt.progressbarFillClass):Ct=`<span class="${wt.progressbarFillClass}"></span>`),et.pagination.bullets=[],Rt.forEach(It=>{wt.type!=="custom"&&(It.innerHTML=Ct||""),wt.type==="bullets"&&et.pagination.bullets.push(...It.querySelectorAll(classesToSelector(wt.bulletClass)))}),wt.type!=="custom"&&nt("paginationRender",Rt[0])}function vt(){et.params.pagination=createElementIfNotDefined(et,et.originalParams.pagination,et.params.pagination,{el:"swiper-pagination"});const wt=et.params.pagination;if(!wt.el)return;let St;typeof wt.el=="string"&&et.isElement&&(St=et.el.querySelector(wt.el)),!St&&typeof wt.el=="string"&&(St=[...document.querySelectorAll(wt.el)]),St||(St=wt.el),!(!St||St.length===0)&&(et.params.uniqueNavElements&&typeof wt.el=="string"&&Array.isArray(St)&&St.length>1&&(St=[...et.el.querySelectorAll(wt.el)],St.length>1&&(St=St.filter(Rt=>elementParents(Rt,".swiper")[0]===et.el)[0])),Array.isArray(St)&&St.length===1&&(St=St[0]),Object.assign(et.pagination,{el:St}),St=ut(St),St.forEach(Rt=>{wt.type==="bullets"&&wt.clickable&&Rt.classList.add(...(wt.clickableClass||"").split(" ")),Rt.classList.add(wt.modifierClass+wt.type),Rt.classList.add(et.isHorizontal()?wt.horizontalClass:wt.verticalClass),wt.type==="bullets"&&wt.dynamicBullets&&(Rt.classList.add(`${wt.modifierClass}${wt.type}-dynamic`),lt=0,wt.dynamicMainBullets<1&&(wt.dynamicMainBullets=1)),wt.type==="progressbar"&&wt.progressbarOpposite&&Rt.classList.add(wt.progressbarOppositeClass),wt.clickable&&Rt.addEventListener("click",ht),et.enabled||Rt.classList.add(wt.lockClass)}))}function yt(){const wt=et.params.pagination;if(ct())return;let St=et.pagination.el;St&&(St=ut(St),St.forEach(Rt=>{Rt.classList.remove(wt.hiddenClass),Rt.classList.remove(wt.modifierClass+wt.type),Rt.classList.remove(et.isHorizontal()?wt.horizontalClass:wt.verticalClass),wt.clickable&&(Rt.classList.remove(...(wt.clickableClass||"").split(" ")),Rt.removeEventListener("click",ht))})),et.pagination.bullets&&et.pagination.bullets.forEach(Rt=>Rt.classList.remove(...wt.bulletActiveClass.split(" ")))}st("changeDirection",()=>{if(!et.pagination||!et.pagination.el)return;const wt=et.params.pagination;let{el:St}=et.pagination;St=ut(St),St.forEach(Rt=>{Rt.classList.remove(wt.horizontalClass,wt.verticalClass),Rt.classList.add(et.isHorizontal()?wt.horizontalClass:wt.verticalClass)})}),st("init",()=>{et.params.pagination.enabled===!1?bt():(vt(),xt(),ft())}),st("activeIndexChange",()=>{typeof et.snapIndex>"u"&&ft()}),st("snapIndexChange",()=>{ft()}),st("snapGridLengthChange",()=>{xt(),ft()}),st("destroy",()=>{yt()}),st("enable disable",()=>{let{el:wt}=et.pagination;wt&&(wt=ut(wt),wt.forEach(St=>St.classList[et.enabled?"remove":"add"](et.params.pagination.lockClass)))}),st("lock unlock",()=>{ft()}),st("click",(wt,St)=>{const Rt=St.target,Ct=ut(et.pagination.el);if(et.params.pagination.el&&et.params.pagination.hideOnClick&&Ct&&Ct.length>0&&!Rt.classList.contains(et.params.pagination.bulletClass)){if(et.navigation&&(et.navigation.nextEl&&Rt===et.navigation.nextEl||et.navigation.prevEl&&Rt===et.navigation.prevEl))return;const It=Ct[0].classList.contains(et.params.pagination.hiddenClass);nt(It===!0?"paginationShow":"paginationHide"),Ct.forEach(jt=>jt.classList.toggle(et.params.pagination.hiddenClass))}});const Et=()=>{et.el.classList.remove(et.params.pagination.paginationDisabledClass);let{el:wt}=et.pagination;wt&&(wt=ut(wt),wt.forEach(St=>St.classList.remove(et.params.pagination.paginationDisabledClass))),vt(),xt(),ft()},bt=()=>{et.el.classList.add(et.params.pagination.paginationDisabledClass);let{el:wt}=et.pagination;wt&&(wt=ut(wt),wt.forEach(St=>St.classList.add(et.params.pagination.paginationDisabledClass))),yt()};Object.assign(et.pagination,{enable:Et,disable:bt,render:xt,update:ft,init:vt,destroy:yt})}let support;function calcSupport(){const tt=getWindow(),et=getDocument();return{smoothScroll:et.documentElement&&et.documentElement.style&&"scrollBehavior"in et.documentElement.style,touch:!!("ontouchstart"in tt||tt.DocumentTouch&&et instanceof tt.DocumentTouch)}}function getSupport(){return support||(support=calcSupport()),support}let deviceCached;function calcDevice(tt){let{userAgent:et}=tt===void 0?{}:tt;const rt=getSupport(),st=getWindow(),nt=st.navigator.platform,ot=et||st.navigator.userAgent,at={ios:!1,android:!1},lt=st.screen.width,ut=st.screen.height,ct=ot.match(/(Android);?[\s\/]+([\d.]+)?/);let dt=ot.match(/(iPad).*OS\s([\d_]+)/);const ht=ot.match(/(iPod)(.*OS\s([\d_]+))?/),ft=!dt&&ot.match(/(iPhone\sOS|iOS)\s([\d_]+)/),xt=nt==="Win32";let vt=nt==="MacIntel";const yt=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!dt&&vt&&rt.touch&&yt.indexOf(`${lt}x${ut}`)>=0&&(dt=ot.match(/(Version)\/([\d.]+)/),dt||(dt=[0,1,"13_0_0"]),vt=!1),ct&&!xt&&(at.os="android",at.android=!0),(dt||ft||ht)&&(at.os="ios",at.ios=!0),at}function getDevice(tt){return tt===void 0&&(tt={}),deviceCached||(deviceCached=calcDevice(tt)),deviceCached}let browser;function calcBrowser(){const tt=getWindow();let et=!1;function rt(){const st=tt.navigator.userAgent.toLowerCase();return st.indexOf("safari")>=0&&st.indexOf("chrome")<0&&st.indexOf("android")<0}if(rt()){const st=String(tt.navigator.userAgent);if(st.includes("Version/")){const[nt,ot]=st.split("Version/")[1].split(" ")[0].split(".").map(at=>Number(at));et=nt<16||nt===16&&ot<2}}return{isSafari:et||rt(),needPerspectiveFix:et,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(tt.navigator.userAgent)}}function getBrowser(){return browser||(browser=calcBrowser()),browser}function Resize(tt){let{swiper:et,on:rt,emit:st}=tt;const nt=getWindow();let ot=null,at=null;const lt=()=>{!et||et.destroyed||!et.initialized||(st("beforeResize"),st("resize"))},ut=()=>{!et||et.destroyed||!et.initialized||(ot=new ResizeObserver(ht=>{at=nt.requestAnimationFrame(()=>{const{width:ft,height:xt}=et;let vt=ft,yt=xt;ht.forEach(Et=>{let{contentBoxSize:bt,contentRect:wt,target:St}=Et;St&&St!==et.el||(vt=wt?wt.width:(bt[0]||bt).inlineSize,yt=wt?wt.height:(bt[0]||bt).blockSize)}),(vt!==ft||yt!==xt)&<()})}),ot.observe(et.el))},ct=()=>{at&&nt.cancelAnimationFrame(at),ot&&ot.unobserve&&et.el&&(ot.unobserve(et.el),ot=null)},dt=()=>{!et||et.destroyed||!et.initialized||st("orientationchange")};rt("init",()=>{if(et.params.resizeObserver&&typeof nt.ResizeObserver<"u"){ut();return}nt.addEventListener("resize",lt),nt.addEventListener("orientationchange",dt)}),rt("destroy",()=>{ct(),nt.removeEventListener("resize",lt),nt.removeEventListener("orientationchange",dt)})}function Observer(tt){let{swiper:et,extendParams:rt,on:st,emit:nt}=tt;const ot=[],at=getWindow(),lt=function(dt,ht){ht===void 0&&(ht={});const ft=at.MutationObserver||at.WebkitMutationObserver,xt=new ft(vt=>{if(et.__preventObserver__)return;if(vt.length===1){nt("observerUpdate",vt[0]);return}const yt=function(){nt("observerUpdate",vt[0])};at.requestAnimationFrame?at.requestAnimationFrame(yt):at.setTimeout(yt,0)});xt.observe(dt,{attributes:typeof ht.attributes>"u"?!0:ht.attributes,childList:typeof ht.childList>"u"?!0:ht.childList,characterData:typeof ht.characterData>"u"?!0:ht.characterData}),ot.push(xt)},ut=()=>{if(et.params.observer){if(et.params.observeParents){const dt=elementParents(et.hostEl);for(let ht=0;ht<dt.length;ht+=1)lt(dt[ht])}lt(et.hostEl,{childList:et.params.observeSlideChildren}),lt(et.wrapperEl,{attributes:!1})}},ct=()=>{ot.forEach(dt=>{dt.disconnect()}),ot.splice(0,ot.length)};rt({observer:!1,observeParents:!1,observeSlideChildren:!1}),st("init",ut),st("destroy",ct)}var eventsEmitter={on(tt,et,rt){const st=this;if(!st.eventsListeners||st.destroyed||typeof et!="function")return st;const nt=rt?"unshift":"push";return tt.split(" ").forEach(ot=>{st.eventsListeners[ot]||(st.eventsListeners[ot]=[]),st.eventsListeners[ot][nt](et)}),st},once(tt,et,rt){const st=this;if(!st.eventsListeners||st.destroyed||typeof et!="function")return st;function nt(){st.off(tt,nt),nt.__emitterProxy&&delete nt.__emitterProxy;for(var ot=arguments.length,at=new Array(ot),lt=0;lt<ot;lt++)at[lt]=arguments[lt];et.apply(st,at)}return nt.__emitterProxy=et,st.on(tt,nt,rt)},onAny(tt,et){const rt=this;if(!rt.eventsListeners||rt.destroyed||typeof tt!="function")return rt;const st=et?"unshift":"push";return rt.eventsAnyListeners.indexOf(tt)<0&&rt.eventsAnyListeners[st](tt),rt},offAny(tt){const et=this;if(!et.eventsListeners||et.destroyed||!et.eventsAnyListeners)return et;const rt=et.eventsAnyListeners.indexOf(tt);return rt>=0&&et.eventsAnyListeners.splice(rt,1),et},off(tt,et){const rt=this;return!rt.eventsListeners||rt.destroyed||!rt.eventsListeners||tt.split(" ").forEach(st=>{typeof et>"u"?rt.eventsListeners[st]=[]:rt.eventsListeners[st]&&rt.eventsListeners[st].forEach((nt,ot)=>{(nt===et||nt.__emitterProxy&&nt.__emitterProxy===et)&&rt.eventsListeners[st].splice(ot,1)})}),rt},emit(){const tt=this;if(!tt.eventsListeners||tt.destroyed||!tt.eventsListeners)return tt;let et,rt,st;for(var nt=arguments.length,ot=new Array(nt),at=0;at<nt;at++)ot[at]=arguments[at];return typeof ot[0]=="string"||Array.isArray(ot[0])?(et=ot[0],rt=ot.slice(1,ot.length),st=tt):(et=ot[0].events,rt=ot[0].data,st=ot[0].context||tt),rt.unshift(st),(Array.isArray(et)?et:et.split(" ")).forEach(ut=>{tt.eventsAnyListeners&&tt.eventsAnyListeners.length&&tt.eventsAnyListeners.forEach(ct=>{ct.apply(st,[ut,...rt])}),tt.eventsListeners&&tt.eventsListeners[ut]&&tt.eventsListeners[ut].forEach(ct=>{ct.apply(st,rt)})}),tt}};function updateSize(){const tt=this;let et,rt;const st=tt.el;typeof tt.params.width<"u"&&tt.params.width!==null?et=tt.params.width:et=st.clientWidth,typeof tt.params.height<"u"&&tt.params.height!==null?rt=tt.params.height:rt=st.clientHeight,!(et===0&&tt.isHorizontal()||rt===0&&tt.isVertical())&&(et=et-parseInt(elementStyle(st,"padding-left")||0,10)-parseInt(elementStyle(st,"padding-right")||0,10),rt=rt-parseInt(elementStyle(st,"padding-top")||0,10)-parseInt(elementStyle(st,"padding-bottom")||0,10),Number.isNaN(et)&&(et=0),Number.isNaN(rt)&&(rt=0),Object.assign(tt,{width:et,height:rt,size:tt.isHorizontal()?et:rt}))}function updateSlides(){const tt=this;function et(Nt){return tt.isHorizontal()?Nt:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[Nt]}function rt(Nt,Ht){return parseFloat(Nt.getPropertyValue(et(Ht))||0)}const st=tt.params,{wrapperEl:nt,slidesEl:ot,size:at,rtlTranslate:lt,wrongRTL:ut}=tt,ct=tt.virtual&&st.virtual.enabled,dt=ct?tt.virtual.slides.length:tt.slides.length,ht=elementChildren(ot,`.${tt.params.slideClass}, swiper-slide`),ft=ct?tt.virtual.slides.length:ht.length;let xt=[];const vt=[],yt=[];let Et=st.slidesOffsetBefore;typeof Et=="function"&&(Et=st.slidesOffsetBefore.call(tt));let bt=st.slidesOffsetAfter;typeof bt=="function"&&(bt=st.slidesOffsetAfter.call(tt));const wt=tt.snapGrid.length,St=tt.slidesGrid.length;let Rt=st.spaceBetween,Ct=-Et,It=0,jt=0;if(typeof at>"u")return;typeof Rt=="string"&&Rt.indexOf("%")>=0?Rt=parseFloat(Rt.replace("%",""))/100*at:typeof Rt=="string"&&(Rt=parseFloat(Rt)),tt.virtualSize=-Rt,ht.forEach(Nt=>{lt?Nt.style.marginLeft="":Nt.style.marginRight="",Nt.style.marginBottom="",Nt.style.marginTop=""}),st.centeredSlides&&st.cssMode&&(setCSSProperty(nt,"--swiper-centered-offset-before",""),setCSSProperty(nt,"--swiper-centered-offset-after",""));const Pt=st.grid&&st.grid.rows>1&&tt.grid;Pt&&tt.grid.initSlides(ft);let Ot;const Ut=st.slidesPerView==="auto"&&st.breakpoints&&Object.keys(st.breakpoints).filter(Nt=>typeof st.breakpoints[Nt].slidesPerView<"u").length>0;for(let Nt=0;Nt<ft;Nt+=1){Ot=0;let Ht;if(ht[Nt]&&(Ht=ht[Nt]),Pt&&tt.grid.updateSlide(Nt,Ht,ft,et),!(ht[Nt]&&elementStyle(Ht,"display")==="none")){if(st.slidesPerView==="auto"){Ut&&(ht[Nt].style[et("width")]="");const Lt=getComputedStyle(Ht),kt=Ht.style.transform,$t=Ht.style.webkitTransform;if(kt&&(Ht.style.transform="none"),$t&&(Ht.style.webkitTransform="none"),st.roundLengths)Ot=tt.isHorizontal()?elementOuterSize(Ht,"width"):elementOuterSize(Ht,"height");else{const Ft=rt(Lt,"width"),Gt=rt(Lt,"padding-left"),Mt=rt(Lt,"padding-right"),Vt=rt(Lt,"margin-left"),Bt=rt(Lt,"margin-right"),qt=Lt.getPropertyValue("box-sizing");if(qt&&qt==="border-box")Ot=Ft+Vt+Bt;else{const{clientWidth:Qt,offsetWidth:Yt}=Ht;Ot=Ft+Gt+Mt+Vt+Bt+(Yt-Qt)}}kt&&(Ht.style.transform=kt),$t&&(Ht.style.webkitTransform=$t),st.roundLengths&&(Ot=Math.floor(Ot))}else Ot=(at-(st.slidesPerView-1)*Rt)/st.slidesPerView,st.roundLengths&&(Ot=Math.floor(Ot)),ht[Nt]&&(ht[Nt].style[et("width")]=`${Ot}px`);ht[Nt]&&(ht[Nt].swiperSlideSize=Ot),yt.push(Ot),st.centeredSlides?(Ct=Ct+Ot/2+It/2+Rt,It===0&&Nt!==0&&(Ct=Ct-at/2-Rt),Nt===0&&(Ct=Ct-at/2-Rt),Math.abs(Ct)<1/1e3&&(Ct=0),st.roundLengths&&(Ct=Math.floor(Ct)),jt%st.slidesPerGroup===0&&xt.push(Ct),vt.push(Ct)):(st.roundLengths&&(Ct=Math.floor(Ct)),(jt-Math.min(tt.params.slidesPerGroupSkip,jt))%tt.params.slidesPerGroup===0&&xt.push(Ct),vt.push(Ct),Ct=Ct+Ot+Rt),tt.virtualSize+=Ot+Rt,It=Ot,jt+=1}}if(tt.virtualSize=Math.max(tt.virtualSize,at)+bt,lt&&ut&&(st.effect==="slide"||st.effect==="coverflow")&&(nt.style.width=`${tt.virtualSize+Rt}px`),st.setWrapperSize&&(nt.style[et("width")]=`${tt.virtualSize+Rt}px`),Pt&&tt.grid.updateWrapperSize(Ot,xt,et),!st.centeredSlides){const Nt=[];for(let Ht=0;Ht<xt.length;Ht+=1){let Lt=xt[Ht];st.roundLengths&&(Lt=Math.floor(Lt)),xt[Ht]<=tt.virtualSize-at&&Nt.push(Lt)}xt=Nt,Math.floor(tt.virtualSize-at)-Math.floor(xt[xt.length-1])>1&&xt.push(tt.virtualSize-at)}if(ct&&st.loop){const Nt=yt[0]+Rt;if(st.slidesPerGroup>1){const Ht=Math.ceil((tt.virtual.slidesBefore+tt.virtual.slidesAfter)/st.slidesPerGroup),Lt=Nt*st.slidesPerGroup;for(let kt=0;kt<Ht;kt+=1)xt.push(xt[xt.length-1]+Lt)}for(let Ht=0;Ht<tt.virtual.slidesBefore+tt.virtual.slidesAfter;Ht+=1)st.slidesPerGroup===1&&xt.push(xt[xt.length-1]+Nt),vt.push(vt[vt.length-1]+Nt),tt.virtualSize+=Nt}if(xt.length===0&&(xt=[0]),Rt!==0){const Nt=tt.isHorizontal()&<?"marginLeft":et("marginRight");ht.filter((Ht,Lt)=>!st.cssMode||st.loop?!0:Lt!==ht.length-1).forEach(Ht=>{Ht.style[Nt]=`${Rt}px`})}if(st.centeredSlides&&st.centeredSlidesBounds){let Nt=0;yt.forEach(Lt=>{Nt+=Lt+(Rt||0)}),Nt-=Rt;const Ht=Nt-at;xt=xt.map(Lt=>Lt<=0?-Et:Lt>Ht?Ht+bt:Lt)}if(st.centerInsufficientSlides){let Nt=0;if(yt.forEach(Ht=>{Nt+=Ht+(Rt||0)}),Nt-=Rt,Nt<at){const Ht=(at-Nt)/2;xt.forEach((Lt,kt)=>{xt[kt]=Lt-Ht}),vt.forEach((Lt,kt)=>{vt[kt]=Lt+Ht})}}if(Object.assign(tt,{slides:ht,snapGrid:xt,slidesGrid:vt,slidesSizesGrid:yt}),st.centeredSlides&&st.cssMode&&!st.centeredSlidesBounds){setCSSProperty(nt,"--swiper-centered-offset-before",`${-xt[0]}px`),setCSSProperty(nt,"--swiper-centered-offset-after",`${tt.size/2-yt[yt.length-1]/2}px`);const Nt=-tt.snapGrid[0],Ht=-tt.slidesGrid[0];tt.snapGrid=tt.snapGrid.map(Lt=>Lt+Nt),tt.slidesGrid=tt.slidesGrid.map(Lt=>Lt+Ht)}if(ft!==dt&&tt.emit("slidesLengthChange"),xt.length!==wt&&(tt.params.watchOverflow&&tt.checkOverflow(),tt.emit("snapGridLengthChange")),vt.length!==St&&tt.emit("slidesGridLengthChange"),st.watchSlidesProgress&&tt.updateSlidesOffset(),!ct&&!st.cssMode&&(st.effect==="slide"||st.effect==="fade")){const Nt=`${st.containerModifierClass}backface-hidden`,Ht=tt.el.classList.contains(Nt);ft<=st.maxBackfaceHiddenSlides?Ht||tt.el.classList.add(Nt):Ht&&tt.el.classList.remove(Nt)}}function updateAutoHeight(tt){const et=this,rt=[],st=et.virtual&&et.params.virtual.enabled;let nt=0,ot;typeof tt=="number"?et.setTransition(tt):tt===!0&&et.setTransition(et.params.speed);const at=lt=>st?et.slides[et.getSlideIndexByData(lt)]:et.slides[lt];if(et.params.slidesPerView!=="auto"&&et.params.slidesPerView>1)if(et.params.centeredSlides)(et.visibleSlides||[]).forEach(lt=>{rt.push(lt)});else for(ot=0;ot<Math.ceil(et.params.slidesPerView);ot+=1){const lt=et.activeIndex+ot;if(lt>et.slides.length&&!st)break;rt.push(at(lt))}else rt.push(at(et.activeIndex));for(ot=0;ot<rt.length;ot+=1)if(typeof rt[ot]<"u"){const lt=rt[ot].offsetHeight;nt=lt>nt?lt:nt}(nt||nt===0)&&(et.wrapperEl.style.height=`${nt}px`)}function updateSlidesOffset(){const tt=this,et=tt.slides,rt=tt.isElement?tt.isHorizontal()?tt.wrapperEl.offsetLeft:tt.wrapperEl.offsetTop:0;for(let st=0;st<et.length;st+=1)et[st].swiperSlideOffset=(tt.isHorizontal()?et[st].offsetLeft:et[st].offsetTop)-rt-tt.cssOverflowAdjustment()}function updateSlidesProgress(tt){tt===void 0&&(tt=this&&this.translate||0);const et=this,rt=et.params,{slides:st,rtlTranslate:nt,snapGrid:ot}=et;if(st.length===0)return;typeof st[0].swiperSlideOffset>"u"&&et.updateSlidesOffset();let at=-tt;nt&&(at=tt),st.forEach(ut=>{ut.classList.remove(rt.slideVisibleClass)}),et.visibleSlidesIndexes=[],et.visibleSlides=[];let lt=rt.spaceBetween;typeof lt=="string"&<.indexOf("%")>=0?lt=parseFloat(lt.replace("%",""))/100*et.size:typeof lt=="string"&&(lt=parseFloat(lt));for(let ut=0;ut<st.length;ut+=1){const ct=st[ut];let dt=ct.swiperSlideOffset;rt.cssMode&&rt.centeredSlides&&(dt-=st[0].swiperSlideOffset);const ht=(at+(rt.centeredSlides?et.minTranslate():0)-dt)/(ct.swiperSlideSize+lt),ft=(at-ot[0]+(rt.centeredSlides?et.minTranslate():0)-dt)/(ct.swiperSlideSize+lt),xt=-(at-dt),vt=xt+et.slidesSizesGrid[ut];(xt>=0&&xt<et.size-1||vt>1&&vt<=et.size||xt<=0&&vt>=et.size)&&(et.visibleSlides.push(ct),et.visibleSlidesIndexes.push(ut),st[ut].classList.add(rt.slideVisibleClass)),ct.progress=nt?-ht:ht,ct.originalProgress=nt?-ft:ft}}function updateProgress(tt){const et=this;if(typeof tt>"u"){const dt=et.rtlTranslate?-1:1;tt=et&&et.translate&&et.translate*dt||0}const rt=et.params,st=et.maxTranslate()-et.minTranslate();let{progress:nt,isBeginning:ot,isEnd:at,progressLoop:lt}=et;const ut=ot,ct=at;if(st===0)nt=0,ot=!0,at=!0;else{nt=(tt-et.minTranslate())/st;const dt=Math.abs(tt-et.minTranslate())<1,ht=Math.abs(tt-et.maxTranslate())<1;ot=dt||nt<=0,at=ht||nt>=1,dt&&(nt=0),ht&&(nt=1)}if(rt.loop){const dt=et.getSlideIndexByData(0),ht=et.getSlideIndexByData(et.slides.length-1),ft=et.slidesGrid[dt],xt=et.slidesGrid[ht],vt=et.slidesGrid[et.slidesGrid.length-1],yt=Math.abs(tt);yt>=ft?lt=(yt-ft)/vt:lt=(yt+vt-xt)/vt,lt>1&&(lt-=1)}Object.assign(et,{progress:nt,progressLoop:lt,isBeginning:ot,isEnd:at}),(rt.watchSlidesProgress||rt.centeredSlides&&rt.autoHeight)&&et.updateSlidesProgress(tt),ot&&!ut&&et.emit("reachBeginning toEdge"),at&&!ct&&et.emit("reachEnd toEdge"),(ut&&!ot||ct&&!at)&&et.emit("fromEdge"),et.emit("progress",nt)}function updateSlidesClasses(){const tt=this,{slides:et,params:rt,slidesEl:st,activeIndex:nt}=tt,ot=tt.virtual&&rt.virtual.enabled,at=ut=>elementChildren(st,`.${rt.slideClass}${ut}, swiper-slide${ut}`)[0];et.forEach(ut=>{ut.classList.remove(rt.slideActiveClass,rt.slideNextClass,rt.slidePrevClass)});let lt;if(ot)if(rt.loop){let ut=nt-tt.virtual.slidesBefore;ut<0&&(ut=tt.virtual.slides.length+ut),ut>=tt.virtual.slides.length&&(ut-=tt.virtual.slides.length),lt=at(`[data-swiper-slide-index="${ut}"]`)}else lt=at(`[data-swiper-slide-index="${nt}"]`);else lt=et[nt];if(lt){lt.classList.add(rt.slideActiveClass);let ut=elementNextAll(lt,`.${rt.slideClass}, swiper-slide`)[0];rt.loop&&!ut&&(ut=et[0]),ut&&ut.classList.add(rt.slideNextClass);let ct=elementPrevAll(lt,`.${rt.slideClass}, swiper-slide`)[0];rt.loop&&!ct===0&&(ct=et[et.length-1]),ct&&ct.classList.add(rt.slidePrevClass)}tt.emitSlidesClasses()}const processLazyPreloader=(tt,et)=>{if(!tt||tt.destroyed||!tt.params)return;const rt=()=>tt.isElement?"swiper-slide":`.${tt.params.slideClass}`,st=et.closest(rt());if(st){let nt=st.querySelector(`.${tt.params.lazyPreloaderClass}`);!nt&&tt.isElement&&(st.shadowRoot?nt=st.shadowRoot.querySelector(`.${tt.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{st.shadowRoot&&(nt=st.shadowRoot.querySelector(`.${tt.params.lazyPreloaderClass}`),nt&&nt.remove())})),nt&&nt.remove()}},unlazy=(tt,et)=>{if(!tt.slides[et])return;const rt=tt.slides[et].querySelector('[loading="lazy"]');rt&&rt.removeAttribute("loading")},preload=tt=>{if(!tt||tt.destroyed||!tt.params)return;let et=tt.params.lazyPreloadPrevNext;const rt=tt.slides.length;if(!rt||!et||et<0)return;et=Math.min(et,rt);const st=tt.params.slidesPerView==="auto"?tt.slidesPerViewDynamic():Math.ceil(tt.params.slidesPerView),nt=tt.activeIndex;if(tt.params.grid&&tt.params.grid.rows>1){const at=nt,lt=[at-et];lt.push(...Array.from({length:et}).map((ut,ct)=>at+st+ct)),tt.slides.forEach((ut,ct)=>{lt.includes(ut.column)&&unlazy(tt,ct)});return}const ot=nt+st-1;if(tt.params.rewind||tt.params.loop)for(let at=nt-et;at<=ot+et;at+=1){const lt=(at%rt+rt)%rt;(lt<nt||lt>ot)&&unlazy(tt,lt)}else for(let at=Math.max(nt-et,0);at<=Math.min(ot+et,rt-1);at+=1)at!==nt&&(at>ot||at<nt)&&unlazy(tt,at)};function getActiveIndexByTranslate(tt){const{slidesGrid:et,params:rt}=tt,st=tt.rtlTranslate?tt.translate:-tt.translate;let nt;for(let ot=0;ot<et.length;ot+=1)typeof et[ot+1]<"u"?st>=et[ot]&&st<et[ot+1]-(et[ot+1]-et[ot])/2?nt=ot:st>=et[ot]&&st<et[ot+1]&&(nt=ot+1):st>=et[ot]&&(nt=ot);return rt.normalizeSlideIndex&&(nt<0||typeof nt>"u")&&(nt=0),nt}function updateActiveIndex(tt){const et=this,rt=et.rtlTranslate?et.translate:-et.translate,{snapGrid:st,params:nt,activeIndex:ot,realIndex:at,snapIndex:lt}=et;let ut=tt,ct;const dt=ft=>{let xt=ft-et.virtual.slidesBefore;return xt<0&&(xt=et.virtual.slides.length+xt),xt>=et.virtual.slides.length&&(xt-=et.virtual.slides.length),xt};if(typeof ut>"u"&&(ut=getActiveIndexByTranslate(et)),st.indexOf(rt)>=0)ct=st.indexOf(rt);else{const ft=Math.min(nt.slidesPerGroupSkip,ut);ct=ft+Math.floor((ut-ft)/nt.slidesPerGroup)}if(ct>=st.length&&(ct=st.length-1),ut===ot){ct!==lt&&(et.snapIndex=ct,et.emit("snapIndexChange")),et.params.loop&&et.virtual&&et.params.virtual.enabled&&(et.realIndex=dt(ut));return}let ht;et.virtual&&nt.virtual.enabled&&nt.loop?ht=dt(ut):et.slides[ut]?ht=parseInt(et.slides[ut].getAttribute("data-swiper-slide-index")||ut,10):ht=ut,Object.assign(et,{previousSnapIndex:lt,snapIndex:ct,previousRealIndex:at,realIndex:ht,previousIndex:ot,activeIndex:ut}),et.initialized&&preload(et),et.emit("activeIndexChange"),et.emit("snapIndexChange"),(et.initialized||et.params.runCallbacksOnInit)&&(at!==ht&&et.emit("realIndexChange"),et.emit("slideChange"))}function updateClickedSlide(tt,et){const rt=this,st=rt.params;let nt=tt.closest(`.${st.slideClass}, swiper-slide`);!nt&&rt.isElement&&et&&et.length>1&&et.includes(tt)&&[...et.slice(et.indexOf(tt)+1,et.length)].forEach(lt=>{!nt&<.matches&<.matches(`.${st.slideClass}, swiper-slide`)&&(nt=lt)});let ot=!1,at;if(nt){for(let lt=0;lt<rt.slides.length;lt+=1)if(rt.slides[lt]===nt){ot=!0,at=lt;break}}if(nt&&ot)rt.clickedSlide=nt,rt.virtual&&rt.params.virtual.enabled?rt.clickedIndex=parseInt(nt.getAttribute("data-swiper-slide-index"),10):rt.clickedIndex=at;else{rt.clickedSlide=void 0,rt.clickedIndex=void 0;return}st.slideToClickedSlide&&rt.clickedIndex!==void 0&&rt.clickedIndex!==rt.activeIndex&&rt.slideToClickedSlide()}var update={updateSize,updateSlides,updateAutoHeight,updateSlidesOffset,updateSlidesProgress,updateProgress,updateSlidesClasses,updateActiveIndex,updateClickedSlide};function getSwiperTranslate(tt){tt===void 0&&(tt=this.isHorizontal()?"x":"y");const et=this,{params:rt,rtlTranslate:st,translate:nt,wrapperEl:ot}=et;if(rt.virtualTranslate)return st?-nt:nt;if(rt.cssMode)return nt;let at=getTranslate(ot,tt);return at+=et.cssOverflowAdjustment(),st&&(at=-at),at||0}function setTranslate(tt,et){const rt=this,{rtlTranslate:st,params:nt,wrapperEl:ot,progress:at}=rt;let lt=0,ut=0;const ct=0;rt.isHorizontal()?lt=st?-tt:tt:ut=tt,nt.roundLengths&&(lt=Math.floor(lt),ut=Math.floor(ut)),rt.previousTranslate=rt.translate,rt.translate=rt.isHorizontal()?lt:ut,nt.cssMode?ot[rt.isHorizontal()?"scrollLeft":"scrollTop"]=rt.isHorizontal()?-lt:-ut:nt.virtualTranslate||(rt.isHorizontal()?lt-=rt.cssOverflowAdjustment():ut-=rt.cssOverflowAdjustment(),ot.style.transform=`translate3d(${lt}px, ${ut}px, ${ct}px)`);let dt;const ht=rt.maxTranslate()-rt.minTranslate();ht===0?dt=0:dt=(tt-rt.minTranslate())/ht,dt!==at&&rt.updateProgress(tt),rt.emit("setTranslate",rt.translate,et)}function minTranslate(){return-this.snapGrid[0]}function maxTranslate(){return-this.snapGrid[this.snapGrid.length-1]}function translateTo(tt,et,rt,st,nt){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),st===void 0&&(st=!0);const ot=this,{params:at,wrapperEl:lt}=ot;if(ot.animating&&at.preventInteractionOnTransition)return!1;const ut=ot.minTranslate(),ct=ot.maxTranslate();let dt;if(st&&tt>ut?dt=ut:st&&tt<ct?dt=ct:dt=tt,ot.updateProgress(dt),at.cssMode){const ht=ot.isHorizontal();if(et===0)lt[ht?"scrollLeft":"scrollTop"]=-dt;else{if(!ot.support.smoothScroll)return animateCSSModeScroll({swiper:ot,targetPosition:-dt,side:ht?"left":"top"}),!0;lt.scrollTo({[ht?"left":"top"]:-dt,behavior:"smooth"})}return!0}return et===0?(ot.setTransition(0),ot.setTranslate(dt),rt&&(ot.emit("beforeTransitionStart",et,nt),ot.emit("transitionEnd"))):(ot.setTransition(et),ot.setTranslate(dt),rt&&(ot.emit("beforeTransitionStart",et,nt),ot.emit("transitionStart")),ot.animating||(ot.animating=!0,ot.onTranslateToWrapperTransitionEnd||(ot.onTranslateToWrapperTransitionEnd=function(ft){!ot||ot.destroyed||ft.target===this&&(ot.wrapperEl.removeEventListener("transitionend",ot.onTranslateToWrapperTransitionEnd),ot.onTranslateToWrapperTransitionEnd=null,delete ot.onTranslateToWrapperTransitionEnd,rt&&ot.emit("transitionEnd"))}),ot.wrapperEl.addEventListener("transitionend",ot.onTranslateToWrapperTransitionEnd))),!0}var translate={getTranslate:getSwiperTranslate,setTranslate,minTranslate,maxTranslate,translateTo};function setTransition(tt,et){const rt=this;rt.params.cssMode||(rt.wrapperEl.style.transitionDuration=`${tt}ms`,rt.wrapperEl.style.transitionDelay=tt===0?"0ms":""),rt.emit("setTransition",tt,et)}function transitionEmit(tt){let{swiper:et,runCallbacks:rt,direction:st,step:nt}=tt;const{activeIndex:ot,previousIndex:at}=et;let lt=st;if(lt||(ot>at?lt="next":ot<at?lt="prev":lt="reset"),et.emit(`transition${nt}`),rt&&ot!==at){if(lt==="reset"){et.emit(`slideResetTransition${nt}`);return}et.emit(`slideChangeTransition${nt}`),lt==="next"?et.emit(`slideNextTransition${nt}`):et.emit(`slidePrevTransition${nt}`)}}function transitionStart(tt,et){tt===void 0&&(tt=!0);const rt=this,{params:st}=rt;st.cssMode||(st.autoHeight&&rt.updateAutoHeight(),transitionEmit({swiper:rt,runCallbacks:tt,direction:et,step:"Start"}))}function transitionEnd(tt,et){tt===void 0&&(tt=!0);const rt=this,{params:st}=rt;rt.animating=!1,!st.cssMode&&(rt.setTransition(0),transitionEmit({swiper:rt,runCallbacks:tt,direction:et,step:"End"}))}var transition={setTransition,transitionStart,transitionEnd};function slideTo(tt,et,rt,st,nt){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),typeof tt=="string"&&(tt=parseInt(tt,10));const ot=this;let at=tt;at<0&&(at=0);const{params:lt,snapGrid:ut,slidesGrid:ct,previousIndex:dt,activeIndex:ht,rtlTranslate:ft,wrapperEl:xt,enabled:vt}=ot;if(ot.animating&<.preventInteractionOnTransition||!vt&&!st&&!nt)return!1;const yt=Math.min(ot.params.slidesPerGroupSkip,at);let Et=yt+Math.floor((at-yt)/ot.params.slidesPerGroup);Et>=ut.length&&(Et=ut.length-1);const bt=-ut[Et];if(lt.normalizeSlideIndex)for(let St=0;St<ct.length;St+=1){const Rt=-Math.floor(bt*100),Ct=Math.floor(ct[St]*100),It=Math.floor(ct[St+1]*100);typeof ct[St+1]<"u"?Rt>=Ct&&Rt<It-(It-Ct)/2?at=St:Rt>=Ct&&Rt<It&&(at=St+1):Rt>=Ct&&(at=St)}if(ot.initialized&&at!==ht&&(!ot.allowSlideNext&&(ft?bt>ot.translate&&bt>ot.minTranslate():bt<ot.translate&&bt<ot.minTranslate())||!ot.allowSlidePrev&&bt>ot.translate&&bt>ot.maxTranslate()&&(ht||0)!==at))return!1;at!==(dt||0)&&rt&&ot.emit("beforeSlideChangeStart"),ot.updateProgress(bt);let wt;if(at>ht?wt="next":at<ht?wt="prev":wt="reset",ft&&-bt===ot.translate||!ft&&bt===ot.translate)return ot.updateActiveIndex(at),lt.autoHeight&&ot.updateAutoHeight(),ot.updateSlidesClasses(),lt.effect!=="slide"&&ot.setTranslate(bt),wt!=="reset"&&(ot.transitionStart(rt,wt),ot.transitionEnd(rt,wt)),!1;if(lt.cssMode){const St=ot.isHorizontal(),Rt=ft?bt:-bt;if(et===0){const Ct=ot.virtual&&ot.params.virtual.enabled;Ct&&(ot.wrapperEl.style.scrollSnapType="none",ot._immediateVirtual=!0),Ct&&!ot._cssModeVirtualInitialSet&&ot.params.initialSlide>0?(ot._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{xt[St?"scrollLeft":"scrollTop"]=Rt})):xt[St?"scrollLeft":"scrollTop"]=Rt,Ct&&requestAnimationFrame(()=>{ot.wrapperEl.style.scrollSnapType="",ot._immediateVirtual=!1})}else{if(!ot.support.smoothScroll)return animateCSSModeScroll({swiper:ot,targetPosition:Rt,side:St?"left":"top"}),!0;xt.scrollTo({[St?"left":"top"]:Rt,behavior:"smooth"})}return!0}return ot.setTransition(et),ot.setTranslate(bt),ot.updateActiveIndex(at),ot.updateSlidesClasses(),ot.emit("beforeTransitionStart",et,st),ot.transitionStart(rt,wt),et===0?ot.transitionEnd(rt,wt):ot.animating||(ot.animating=!0,ot.onSlideToWrapperTransitionEnd||(ot.onSlideToWrapperTransitionEnd=function(Rt){!ot||ot.destroyed||Rt.target===this&&(ot.wrapperEl.removeEventListener("transitionend",ot.onSlideToWrapperTransitionEnd),ot.onSlideToWrapperTransitionEnd=null,delete ot.onSlideToWrapperTransitionEnd,ot.transitionEnd(rt,wt))}),ot.wrapperEl.addEventListener("transitionend",ot.onSlideToWrapperTransitionEnd)),!0}function slideToLoop(tt,et,rt,st){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),typeof tt=="string"&&(tt=parseInt(tt,10));const nt=this;let ot=tt;return nt.params.loop&&(nt.virtual&&nt.params.virtual.enabled?ot=ot+nt.virtual.slidesBefore:ot=nt.getSlideIndexByData(ot)),nt.slideTo(ot,et,rt,st)}function slideNext(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const st=this,{enabled:nt,params:ot,animating:at}=st;if(!nt)return st;let lt=ot.slidesPerGroup;ot.slidesPerView==="auto"&&ot.slidesPerGroup===1&&ot.slidesPerGroupAuto&&(lt=Math.max(st.slidesPerViewDynamic("current",!0),1));const ut=st.activeIndex<ot.slidesPerGroupSkip?1:lt,ct=st.virtual&&ot.virtual.enabled;if(ot.loop){if(at&&!ct&&ot.loopPreventsSliding)return!1;if(st.loopFix({direction:"next"}),st._clientLeft=st.wrapperEl.clientLeft,st.activeIndex===st.slides.length-1&&ot.cssMode)return requestAnimationFrame(()=>{st.slideTo(st.activeIndex+ut,tt,et,rt)}),!0}return ot.rewind&&st.isEnd?st.slideTo(0,tt,et,rt):st.slideTo(st.activeIndex+ut,tt,et,rt)}function slidePrev(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const st=this,{params:nt,snapGrid:ot,slidesGrid:at,rtlTranslate:lt,enabled:ut,animating:ct}=st;if(!ut)return st;const dt=st.virtual&&nt.virtual.enabled;if(nt.loop){if(ct&&!dt&&nt.loopPreventsSliding)return!1;st.loopFix({direction:"prev"}),st._clientLeft=st.wrapperEl.clientLeft}const ht=lt?st.translate:-st.translate;function ft(bt){return bt<0?-Math.floor(Math.abs(bt)):Math.floor(bt)}const xt=ft(ht),vt=ot.map(bt=>ft(bt));let yt=ot[vt.indexOf(xt)-1];if(typeof yt>"u"&&nt.cssMode){let bt;ot.forEach((wt,St)=>{xt>=wt&&(bt=St)}),typeof bt<"u"&&(yt=ot[bt>0?bt-1:bt])}let Et=0;if(typeof yt<"u"&&(Et=at.indexOf(yt),Et<0&&(Et=st.activeIndex-1),nt.slidesPerView==="auto"&&nt.slidesPerGroup===1&&nt.slidesPerGroupAuto&&(Et=Et-st.slidesPerViewDynamic("previous",!0)+1,Et=Math.max(Et,0))),nt.rewind&&st.isBeginning){const bt=st.params.virtual&&st.params.virtual.enabled&&st.virtual?st.virtual.slides.length-1:st.slides.length-1;return st.slideTo(bt,tt,et,rt)}else if(nt.loop&&st.activeIndex===0&&nt.cssMode)return requestAnimationFrame(()=>{st.slideTo(Et,tt,et,rt)}),!0;return st.slideTo(Et,tt,et,rt)}function slideReset(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const st=this;return st.slideTo(st.activeIndex,tt,et,rt)}function slideToClosest(tt,et,rt,st){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0),st===void 0&&(st=.5);const nt=this;let ot=nt.activeIndex;const at=Math.min(nt.params.slidesPerGroupSkip,ot),lt=at+Math.floor((ot-at)/nt.params.slidesPerGroup),ut=nt.rtlTranslate?nt.translate:-nt.translate;if(ut>=nt.snapGrid[lt]){const ct=nt.snapGrid[lt],dt=nt.snapGrid[lt+1];ut-ct>(dt-ct)*st&&(ot+=nt.params.slidesPerGroup)}else{const ct=nt.snapGrid[lt-1],dt=nt.snapGrid[lt];ut-ct<=(dt-ct)*st&&(ot-=nt.params.slidesPerGroup)}return ot=Math.max(ot,0),ot=Math.min(ot,nt.slidesGrid.length-1),nt.slideTo(ot,tt,et,rt)}function slideToClickedSlide(){const tt=this,{params:et,slidesEl:rt}=tt,st=et.slidesPerView==="auto"?tt.slidesPerViewDynamic():et.slidesPerView;let nt=tt.clickedIndex,ot;const at=tt.isElement?"swiper-slide":`.${et.slideClass}`;if(et.loop){if(tt.animating)return;ot=parseInt(tt.clickedSlide.getAttribute("data-swiper-slide-index"),10),et.centeredSlides?nt<tt.loopedSlides-st/2||nt>tt.slides.length-tt.loopedSlides+st/2?(tt.loopFix(),nt=tt.getSlideIndex(elementChildren(rt,`${at}[data-swiper-slide-index="${ot}"]`)[0]),nextTick(()=>{tt.slideTo(nt)})):tt.slideTo(nt):nt>tt.slides.length-st?(tt.loopFix(),nt=tt.getSlideIndex(elementChildren(rt,`${at}[data-swiper-slide-index="${ot}"]`)[0]),nextTick(()=>{tt.slideTo(nt)})):tt.slideTo(nt)}else tt.slideTo(nt)}var slide={slideTo,slideToLoop,slideNext,slidePrev,slideReset,slideToClosest,slideToClickedSlide};function loopCreate(tt){const et=this,{params:rt,slidesEl:st}=et;if(!rt.loop||et.virtual&&et.params.virtual.enabled)return;elementChildren(st,`.${rt.slideClass}, swiper-slide`).forEach((ot,at)=>{ot.setAttribute("data-swiper-slide-index",at)}),et.loopFix({slideRealIndex:tt,direction:rt.centeredSlides?void 0:"next"})}function loopFix(tt){let{slideRealIndex:et,slideTo:rt=!0,direction:st,setTranslate:nt,activeSlideIndex:ot,byController:at,byMousewheel:lt}=tt===void 0?{}:tt;const ut=this;if(!ut.params.loop)return;ut.emit("beforeLoopFix");const{slides:ct,allowSlidePrev:dt,allowSlideNext:ht,slidesEl:ft,params:xt}=ut;if(ut.allowSlidePrev=!0,ut.allowSlideNext=!0,ut.virtual&&xt.virtual.enabled){rt&&(!xt.centeredSlides&&ut.snapIndex===0?ut.slideTo(ut.virtual.slides.length,0,!1,!0):xt.centeredSlides&&ut.snapIndex<xt.slidesPerView?ut.slideTo(ut.virtual.slides.length+ut.snapIndex,0,!1,!0):ut.snapIndex===ut.snapGrid.length-1&&ut.slideTo(ut.virtual.slidesBefore,0,!1,!0)),ut.allowSlidePrev=dt,ut.allowSlideNext=ht,ut.emit("loopFix");return}const vt=xt.slidesPerView==="auto"?ut.slidesPerViewDynamic():Math.ceil(parseFloat(xt.slidesPerView,10));let yt=xt.loopedSlides||vt;yt%xt.slidesPerGroup!==0&&(yt+=xt.slidesPerGroup-yt%xt.slidesPerGroup),ut.loopedSlides=yt;const Et=[],bt=[];let wt=ut.activeIndex;typeof ot>"u"?ot=ut.getSlideIndex(ut.slides.filter(jt=>jt.classList.contains(xt.slideActiveClass))[0]):wt=ot;const St=st==="next"||!st,Rt=st==="prev"||!st;let Ct=0,It=0;if(ot<yt){Ct=Math.max(yt-ot,xt.slidesPerGroup);for(let jt=0;jt<yt-ot;jt+=1){const Pt=jt-Math.floor(jt/ct.length)*ct.length;Et.push(ct.length-Pt-1)}}else if(ot>ut.slides.length-yt*2){It=Math.max(ot-(ut.slides.length-yt*2),xt.slidesPerGroup);for(let jt=0;jt<It;jt+=1){const Pt=jt-Math.floor(jt/ct.length)*ct.length;bt.push(Pt)}}if(Rt&&Et.forEach(jt=>{ut.slides[jt].swiperLoopMoveDOM=!0,ft.prepend(ut.slides[jt]),ut.slides[jt].swiperLoopMoveDOM=!1}),St&&bt.forEach(jt=>{ut.slides[jt].swiperLoopMoveDOM=!0,ft.append(ut.slides[jt]),ut.slides[jt].swiperLoopMoveDOM=!1}),ut.recalcSlides(),xt.slidesPerView==="auto"&&ut.updateSlides(),xt.watchSlidesProgress&&ut.updateSlidesOffset(),rt){if(Et.length>0&&Rt)if(typeof et>"u"){const jt=ut.slidesGrid[wt],Ot=ut.slidesGrid[wt+Ct]-jt;lt?ut.setTranslate(ut.translate-Ot):(ut.slideTo(wt+Ct,0,!1,!0),nt&&(ut.touches[ut.isHorizontal()?"startX":"startY"]+=Ot,ut.touchEventsData.currentTranslate=ut.translate))}else nt&&(ut.slideToLoop(et,0,!1,!0),ut.touchEventsData.currentTranslate=ut.translate);else if(bt.length>0&&St)if(typeof et>"u"){const jt=ut.slidesGrid[wt],Ot=ut.slidesGrid[wt-It]-jt;lt?ut.setTranslate(ut.translate-Ot):(ut.slideTo(wt-It,0,!1,!0),nt&&(ut.touches[ut.isHorizontal()?"startX":"startY"]+=Ot,ut.touchEventsData.currentTranslate=ut.translate))}else ut.slideToLoop(et,0,!1,!0)}if(ut.allowSlidePrev=dt,ut.allowSlideNext=ht,ut.controller&&ut.controller.control&&!at){const jt={slideRealIndex:et,direction:st,setTranslate:nt,activeSlideIndex:ot,byController:!0};Array.isArray(ut.controller.control)?ut.controller.control.forEach(Pt=>{!Pt.destroyed&&Pt.params.loop&&Pt.loopFix({...jt,slideTo:Pt.params.slidesPerView===xt.slidesPerView?rt:!1})}):ut.controller.control instanceof ut.constructor&&ut.controller.control.params.loop&&ut.controller.control.loopFix({...jt,slideTo:ut.controller.control.params.slidesPerView===xt.slidesPerView?rt:!1})}ut.emit("loopFix")}function loopDestroy(){const tt=this,{params:et,slidesEl:rt}=tt;if(!et.loop||tt.virtual&&tt.params.virtual.enabled)return;tt.recalcSlides();const st=[];tt.slides.forEach(nt=>{const ot=typeof nt.swiperSlideIndex>"u"?nt.getAttribute("data-swiper-slide-index")*1:nt.swiperSlideIndex;st[ot]=nt}),tt.slides.forEach(nt=>{nt.removeAttribute("data-swiper-slide-index")}),st.forEach(nt=>{rt.append(nt)}),tt.recalcSlides(),tt.slideTo(tt.realIndex,0)}var loop={loopCreate,loopFix,loopDestroy};function setGrabCursor(tt){const et=this;if(!et.params.simulateTouch||et.params.watchOverflow&&et.isLocked||et.params.cssMode)return;const rt=et.params.touchEventsTarget==="container"?et.el:et.wrapperEl;et.isElement&&(et.__preventObserver__=!0),rt.style.cursor="move",rt.style.cursor=tt?"grabbing":"grab",et.isElement&&requestAnimationFrame(()=>{et.__preventObserver__=!1})}function unsetGrabCursor(){const tt=this;tt.params.watchOverflow&&tt.isLocked||tt.params.cssMode||(tt.isElement&&(tt.__preventObserver__=!0),tt[tt.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",tt.isElement&&requestAnimationFrame(()=>{tt.__preventObserver__=!1}))}var grabCursor={setGrabCursor,unsetGrabCursor};function closestElement(tt,et){et===void 0&&(et=this);function rt(st){if(!st||st===getDocument()||st===getWindow())return null;st.assignedSlot&&(st=st.assignedSlot);const nt=st.closest(tt);return!nt&&!st.getRootNode?null:nt||rt(st.getRootNode().host)}return rt(et)}function onTouchStart(tt){const et=this,rt=getDocument(),st=getWindow(),nt=et.touchEventsData;nt.evCache.push(tt);const{params:ot,touches:at,enabled:lt}=et;if(!lt||!ot.simulateTouch&&tt.pointerType==="mouse"||et.animating&&ot.preventInteractionOnTransition)return;!et.animating&&ot.cssMode&&ot.loop&&et.loopFix();let ut=tt;ut.originalEvent&&(ut=ut.originalEvent);let ct=ut.target;if(ot.touchEventsTarget==="wrapper"&&!et.wrapperEl.contains(ct)||"which"in ut&&ut.which===3||"button"in ut&&ut.button>0||nt.isTouched&&nt.isMoved)return;const dt=!!ot.noSwipingClass&&ot.noSwipingClass!=="",ht=tt.composedPath?tt.composedPath():tt.path;dt&&ut.target&&ut.target.shadowRoot&&ht&&(ct=ht[0]);const ft=ot.noSwipingSelector?ot.noSwipingSelector:`.${ot.noSwipingClass}`,xt=!!(ut.target&&ut.target.shadowRoot);if(ot.noSwiping&&(xt?closestElement(ft,ct):ct.closest(ft))){et.allowClick=!0;return}if(ot.swipeHandler&&!ct.closest(ot.swipeHandler))return;at.currentX=ut.pageX,at.currentY=ut.pageY;const vt=at.currentX,yt=at.currentY,Et=ot.edgeSwipeDetection||ot.iOSEdgeSwipeDetection,bt=ot.edgeSwipeThreshold||ot.iOSEdgeSwipeThreshold;if(Et&&(vt<=bt||vt>=st.innerWidth-bt))if(Et==="prevent")tt.preventDefault();else return;Object.assign(nt,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),at.startX=vt,at.startY=yt,nt.touchStartTime=now(),et.allowClick=!0,et.updateSize(),et.swipeDirection=void 0,ot.threshold>0&&(nt.allowThresholdMove=!1);let wt=!0;ct.matches(nt.focusableElements)&&(wt=!1,ct.nodeName==="SELECT"&&(nt.isTouched=!1)),rt.activeElement&&rt.activeElement.matches(nt.focusableElements)&&rt.activeElement!==ct&&rt.activeElement.blur();const St=wt&&et.allowTouchMove&&ot.touchStartPreventDefault;(ot.touchStartForcePreventDefault||St)&&!ct.isContentEditable&&ut.preventDefault(),ot.freeMode&&ot.freeMode.enabled&&et.freeMode&&et.animating&&!ot.cssMode&&et.freeMode.onTouchStart(),et.emit("touchStart",ut)}function onTouchMove(tt){const et=getDocument(),rt=this,st=rt.touchEventsData,{params:nt,touches:ot,rtlTranslate:at,enabled:lt}=rt;if(!lt||!nt.simulateTouch&&tt.pointerType==="mouse")return;let ut=tt;if(ut.originalEvent&&(ut=ut.originalEvent),!st.isTouched){st.startMoving&&st.isScrolling&&rt.emit("touchMoveOpposite",ut);return}const ct=st.evCache.findIndex(jt=>jt.pointerId===ut.pointerId);ct>=0&&(st.evCache[ct]=ut);const dt=st.evCache.length>1?st.evCache[0]:ut,ht=dt.pageX,ft=dt.pageY;if(ut.preventedByNestedSwiper){ot.startX=ht,ot.startY=ft;return}if(!rt.allowTouchMove){ut.target.matches(st.focusableElements)||(rt.allowClick=!1),st.isTouched&&(Object.assign(ot,{startX:ht,startY:ft,prevX:rt.touches.currentX,prevY:rt.touches.currentY,currentX:ht,currentY:ft}),st.touchStartTime=now());return}if(nt.touchReleaseOnEdges&&!nt.loop){if(rt.isVertical()){if(ft<ot.startY&&rt.translate<=rt.maxTranslate()||ft>ot.startY&&rt.translate>=rt.minTranslate()){st.isTouched=!1,st.isMoved=!1;return}}else if(ht<ot.startX&&rt.translate<=rt.maxTranslate()||ht>ot.startX&&rt.translate>=rt.minTranslate())return}if(et.activeElement&&ut.target===et.activeElement&&ut.target.matches(st.focusableElements)){st.isMoved=!0,rt.allowClick=!1;return}if(st.allowTouchCallbacks&&rt.emit("touchMove",ut),ut.targetTouches&&ut.targetTouches.length>1)return;ot.currentX=ht,ot.currentY=ft;const xt=ot.currentX-ot.startX,vt=ot.currentY-ot.startY;if(rt.params.threshold&&Math.sqrt(xt**2+vt**2)<rt.params.threshold)return;if(typeof st.isScrolling>"u"){let jt;rt.isHorizontal()&&ot.currentY===ot.startY||rt.isVertical()&&ot.currentX===ot.startX?st.isScrolling=!1:xt*xt+vt*vt>=25&&(jt=Math.atan2(Math.abs(vt),Math.abs(xt))*180/Math.PI,st.isScrolling=rt.isHorizontal()?jt>nt.touchAngle:90-jt>nt.touchAngle)}if(st.isScrolling&&rt.emit("touchMoveOpposite",ut),typeof st.startMoving>"u"&&(ot.currentX!==ot.startX||ot.currentY!==ot.startY)&&(st.startMoving=!0),st.isScrolling||rt.zoom&&rt.params.zoom&&rt.params.zoom.enabled&&st.evCache.length>1){st.isTouched=!1;return}if(!st.startMoving)return;rt.allowClick=!1,!nt.cssMode&&ut.cancelable&&ut.preventDefault(),nt.touchMoveStopPropagation&&!nt.nested&&ut.stopPropagation();let yt=rt.isHorizontal()?xt:vt,Et=rt.isHorizontal()?ot.currentX-ot.previousX:ot.currentY-ot.previousY;nt.oneWayMovement&&(yt=Math.abs(yt)*(at?1:-1),Et=Math.abs(Et)*(at?1:-1)),ot.diff=yt,yt*=nt.touchRatio,at&&(yt=-yt,Et=-Et);const bt=rt.touchesDirection;rt.swipeDirection=yt>0?"prev":"next",rt.touchesDirection=Et>0?"prev":"next";const wt=rt.params.loop&&!nt.cssMode,St=rt.swipeDirection==="next"&&rt.allowSlideNext||rt.swipeDirection==="prev"&&rt.allowSlidePrev;if(!st.isMoved){if(wt&&St&&rt.loopFix({direction:rt.swipeDirection}),st.startTranslate=rt.getTranslate(),rt.setTransition(0),rt.animating){const jt=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});rt.wrapperEl.dispatchEvent(jt)}st.allowMomentumBounce=!1,nt.grabCursor&&(rt.allowSlideNext===!0||rt.allowSlidePrev===!0)&&rt.setGrabCursor(!0),rt.emit("sliderFirstMove",ut)}let Rt;st.isMoved&&bt!==rt.touchesDirection&&wt&&St&&Math.abs(yt)>=1&&(rt.loopFix({direction:rt.swipeDirection,setTranslate:!0}),Rt=!0),rt.emit("sliderMove",ut),st.isMoved=!0,st.currentTranslate=yt+st.startTranslate;let Ct=!0,It=nt.resistanceRatio;if(nt.touchReleaseOnEdges&&(It=0),yt>0?(wt&&St&&!Rt&&st.currentTranslate>(nt.centeredSlides?rt.minTranslate()-rt.size/2:rt.minTranslate())&&rt.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),st.currentTranslate>rt.minTranslate()&&(Ct=!1,nt.resistance&&(st.currentTranslate=rt.minTranslate()-1+(-rt.minTranslate()+st.startTranslate+yt)**It))):yt<0&&(wt&&St&&!Rt&&st.currentTranslate<(nt.centeredSlides?rt.maxTranslate()+rt.size/2:rt.maxTranslate())&&rt.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:rt.slides.length-(nt.slidesPerView==="auto"?rt.slidesPerViewDynamic():Math.ceil(parseFloat(nt.slidesPerView,10)))}),st.currentTranslate<rt.maxTranslate()&&(Ct=!1,nt.resistance&&(st.currentTranslate=rt.maxTranslate()+1-(rt.maxTranslate()-st.startTranslate-yt)**It))),Ct&&(ut.preventedByNestedSwiper=!0),!rt.allowSlideNext&&rt.swipeDirection==="next"&&st.currentTranslate<st.startTranslate&&(st.currentTranslate=st.startTranslate),!rt.allowSlidePrev&&rt.swipeDirection==="prev"&&st.currentTranslate>st.startTranslate&&(st.currentTranslate=st.startTranslate),!rt.allowSlidePrev&&!rt.allowSlideNext&&(st.currentTranslate=st.startTranslate),nt.threshold>0)if(Math.abs(yt)>nt.threshold||st.allowThresholdMove){if(!st.allowThresholdMove){st.allowThresholdMove=!0,ot.startX=ot.currentX,ot.startY=ot.currentY,st.currentTranslate=st.startTranslate,ot.diff=rt.isHorizontal()?ot.currentX-ot.startX:ot.currentY-ot.startY;return}}else{st.currentTranslate=st.startTranslate;return}!nt.followFinger||nt.cssMode||((nt.freeMode&&nt.freeMode.enabled&&rt.freeMode||nt.watchSlidesProgress)&&(rt.updateActiveIndex(),rt.updateSlidesClasses()),nt.freeMode&&nt.freeMode.enabled&&rt.freeMode&&rt.freeMode.onTouchMove(),rt.updateProgress(st.currentTranslate),rt.setTranslate(st.currentTranslate))}function onTouchEnd(tt){const et=this,rt=et.touchEventsData,st=rt.evCache.findIndex(St=>St.pointerId===tt.pointerId);if(st>=0&&rt.evCache.splice(st,1),["pointercancel","pointerout","pointerleave","contextmenu"].includes(tt.type)&&!(["pointercancel","contextmenu"].includes(tt.type)&&(et.browser.isSafari||et.browser.isWebView)))return;const{params:nt,touches:ot,rtlTranslate:at,slidesGrid:lt,enabled:ut}=et;if(!ut||!nt.simulateTouch&&tt.pointerType==="mouse")return;let ct=tt;if(ct.originalEvent&&(ct=ct.originalEvent),rt.allowTouchCallbacks&&et.emit("touchEnd",ct),rt.allowTouchCallbacks=!1,!rt.isTouched){rt.isMoved&&nt.grabCursor&&et.setGrabCursor(!1),rt.isMoved=!1,rt.startMoving=!1;return}nt.grabCursor&&rt.isMoved&&rt.isTouched&&(et.allowSlideNext===!0||et.allowSlidePrev===!0)&&et.setGrabCursor(!1);const dt=now(),ht=dt-rt.touchStartTime;if(et.allowClick){const St=ct.path||ct.composedPath&&ct.composedPath();et.updateClickedSlide(St&&St[0]||ct.target,St),et.emit("tap click",ct),ht<300&&dt-rt.lastClickTime<300&&et.emit("doubleTap doubleClick",ct)}if(rt.lastClickTime=now(),nextTick(()=>{et.destroyed||(et.allowClick=!0)}),!rt.isTouched||!rt.isMoved||!et.swipeDirection||ot.diff===0||rt.currentTranslate===rt.startTranslate){rt.isTouched=!1,rt.isMoved=!1,rt.startMoving=!1;return}rt.isTouched=!1,rt.isMoved=!1,rt.startMoving=!1;let ft;if(nt.followFinger?ft=at?et.translate:-et.translate:ft=-rt.currentTranslate,nt.cssMode)return;if(nt.freeMode&&nt.freeMode.enabled){et.freeMode.onTouchEnd({currentPos:ft});return}let xt=0,vt=et.slidesSizesGrid[0];for(let St=0;St<lt.length;St+=St<nt.slidesPerGroupSkip?1:nt.slidesPerGroup){const Rt=St<nt.slidesPerGroupSkip-1?1:nt.slidesPerGroup;typeof lt[St+Rt]<"u"?ft>=lt[St]&&ft<lt[St+Rt]&&(xt=St,vt=lt[St+Rt]-lt[St]):ft>=lt[St]&&(xt=St,vt=lt[lt.length-1]-lt[lt.length-2])}let yt=null,Et=null;nt.rewind&&(et.isBeginning?Et=nt.virtual&&nt.virtual.enabled&&et.virtual?et.virtual.slides.length-1:et.slides.length-1:et.isEnd&&(yt=0));const bt=(ft-lt[xt])/vt,wt=xt<nt.slidesPerGroupSkip-1?1:nt.slidesPerGroup;if(ht>nt.longSwipesMs){if(!nt.longSwipes){et.slideTo(et.activeIndex);return}et.swipeDirection==="next"&&(bt>=nt.longSwipesRatio?et.slideTo(nt.rewind&&et.isEnd?yt:xt+wt):et.slideTo(xt)),et.swipeDirection==="prev"&&(bt>1-nt.longSwipesRatio?et.slideTo(xt+wt):Et!==null&&bt<0&&Math.abs(bt)>nt.longSwipesRatio?et.slideTo(Et):et.slideTo(xt))}else{if(!nt.shortSwipes){et.slideTo(et.activeIndex);return}et.navigation&&(ct.target===et.navigation.nextEl||ct.target===et.navigation.prevEl)?ct.target===et.navigation.nextEl?et.slideTo(xt+wt):et.slideTo(xt):(et.swipeDirection==="next"&&et.slideTo(yt!==null?yt:xt+wt),et.swipeDirection==="prev"&&et.slideTo(Et!==null?Et:xt))}}function onResize(){const tt=this,{params:et,el:rt}=tt;if(rt&&rt.offsetWidth===0)return;et.breakpoints&&tt.setBreakpoint();const{allowSlideNext:st,allowSlidePrev:nt,snapGrid:ot}=tt,at=tt.virtual&&tt.params.virtual.enabled;tt.allowSlideNext=!0,tt.allowSlidePrev=!0,tt.updateSize(),tt.updateSlides(),tt.updateSlidesClasses();const lt=at&&et.loop;(et.slidesPerView==="auto"||et.slidesPerView>1)&&tt.isEnd&&!tt.isBeginning&&!tt.params.centeredSlides&&!lt?tt.slideTo(tt.slides.length-1,0,!1,!0):tt.params.loop&&!at?tt.slideToLoop(tt.realIndex,0,!1,!0):tt.slideTo(tt.activeIndex,0,!1,!0),tt.autoplay&&tt.autoplay.running&&tt.autoplay.paused&&(clearTimeout(tt.autoplay.resizeTimeout),tt.autoplay.resizeTimeout=setTimeout(()=>{tt.autoplay&&tt.autoplay.running&&tt.autoplay.paused&&tt.autoplay.resume()},500)),tt.allowSlidePrev=nt,tt.allowSlideNext=st,tt.params.watchOverflow&&ot!==tt.snapGrid&&tt.checkOverflow()}function onClick(tt){const et=this;et.enabled&&(et.allowClick||(et.params.preventClicks&&tt.preventDefault(),et.params.preventClicksPropagation&&et.animating&&(tt.stopPropagation(),tt.stopImmediatePropagation())))}function onScroll(){const tt=this,{wrapperEl:et,rtlTranslate:rt,enabled:st}=tt;if(!st)return;tt.previousTranslate=tt.translate,tt.isHorizontal()?tt.translate=-et.scrollLeft:tt.translate=-et.scrollTop,tt.translate===0&&(tt.translate=0),tt.updateActiveIndex(),tt.updateSlidesClasses();let nt;const ot=tt.maxTranslate()-tt.minTranslate();ot===0?nt=0:nt=(tt.translate-tt.minTranslate())/ot,nt!==tt.progress&&tt.updateProgress(rt?-tt.translate:tt.translate),tt.emit("setTranslate",tt.translate,!1)}function onLoad(tt){const et=this;processLazyPreloader(et,tt.target),!(et.params.cssMode||et.params.slidesPerView!=="auto"&&!et.params.autoHeight)&&et.update()}let dummyEventAttached=!1;function dummyEventListener(){}const events=(tt,et)=>{const rt=getDocument(),{params:st,el:nt,wrapperEl:ot,device:at}=tt,lt=!!st.nested,ut=et==="on"?"addEventListener":"removeEventListener",ct=et;nt[ut]("pointerdown",tt.onTouchStart,{passive:!1}),rt[ut]("pointermove",tt.onTouchMove,{passive:!1,capture:lt}),rt[ut]("pointerup",tt.onTouchEnd,{passive:!0}),rt[ut]("pointercancel",tt.onTouchEnd,{passive:!0}),rt[ut]("pointerout",tt.onTouchEnd,{passive:!0}),rt[ut]("pointerleave",tt.onTouchEnd,{passive:!0}),rt[ut]("contextmenu",tt.onTouchEnd,{passive:!0}),(st.preventClicks||st.preventClicksPropagation)&&nt[ut]("click",tt.onClick,!0),st.cssMode&&ot[ut]("scroll",tt.onScroll),st.updateOnWindowResize?tt[ct](at.ios||at.android?"resize orientationchange observerUpdate":"resize observerUpdate",onResize,!0):tt[ct]("observerUpdate",onResize,!0),nt[ut]("load",tt.onLoad,{capture:!0})};function attachEvents(){const tt=this,et=getDocument(),{params:rt}=tt;tt.onTouchStart=onTouchStart.bind(tt),tt.onTouchMove=onTouchMove.bind(tt),tt.onTouchEnd=onTouchEnd.bind(tt),rt.cssMode&&(tt.onScroll=onScroll.bind(tt)),tt.onClick=onClick.bind(tt),tt.onLoad=onLoad.bind(tt),dummyEventAttached||(et.addEventListener("touchstart",dummyEventListener),dummyEventAttached=!0),events(tt,"on")}function detachEvents(){events(this,"off")}var events$1={attachEvents,detachEvents};const isGridEnabled=(tt,et)=>tt.grid&&et.grid&&et.grid.rows>1;function setBreakpoint(){const tt=this,{realIndex:et,initialized:rt,params:st,el:nt}=tt,ot=st.breakpoints;if(!ot||ot&&Object.keys(ot).length===0)return;const at=tt.getBreakpoint(ot,tt.params.breakpointsBase,tt.el);if(!at||tt.currentBreakpoint===at)return;const ut=(at in ot?ot[at]:void 0)||tt.originalParams,ct=isGridEnabled(tt,st),dt=isGridEnabled(tt,ut),ht=st.enabled;ct&&!dt?(nt.classList.remove(`${st.containerModifierClass}grid`,`${st.containerModifierClass}grid-column`),tt.emitContainerClasses()):!ct&&dt&&(nt.classList.add(`${st.containerModifierClass}grid`),(ut.grid.fill&&ut.grid.fill==="column"||!ut.grid.fill&&st.grid.fill==="column")&&nt.classList.add(`${st.containerModifierClass}grid-column`),tt.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(bt=>{if(typeof ut[bt]>"u")return;const wt=st[bt]&&st[bt].enabled,St=ut[bt]&&ut[bt].enabled;wt&&!St&&tt[bt].disable(),!wt&&St&&tt[bt].enable()});const ft=ut.direction&&ut.direction!==st.direction,xt=st.loop&&(ut.slidesPerView!==st.slidesPerView||ft),vt=st.loop;ft&&rt&&tt.changeDirection(),extend$1(tt.params,ut);const yt=tt.params.enabled,Et=tt.params.loop;Object.assign(tt,{allowTouchMove:tt.params.allowTouchMove,allowSlideNext:tt.params.allowSlideNext,allowSlidePrev:tt.params.allowSlidePrev}),ht&&!yt?tt.disable():!ht&&yt&&tt.enable(),tt.currentBreakpoint=at,tt.emit("_beforeBreakpoint",ut),rt&&(xt?(tt.loopDestroy(),tt.loopCreate(et),tt.updateSlides()):!vt&&Et?(tt.loopCreate(et),tt.updateSlides()):vt&&!Et&&tt.loopDestroy()),tt.emit("breakpoint",ut)}function getBreakpoint(tt,et,rt){if(et===void 0&&(et="window"),!tt||et==="container"&&!rt)return;let st=!1;const nt=getWindow(),ot=et==="window"?nt.innerHeight:rt.clientHeight,at=Object.keys(tt).map(lt=>{if(typeof lt=="string"&<.indexOf("@")===0){const ut=parseFloat(lt.substr(1));return{value:ot*ut,point:lt}}return{value:lt,point:lt}});at.sort((lt,ut)=>parseInt(lt.value,10)-parseInt(ut.value,10));for(let lt=0;lt<at.length;lt+=1){const{point:ut,value:ct}=at[lt];et==="window"?nt.matchMedia(`(min-width: ${ct}px)`).matches&&(st=ut):ct<=rt.clientWidth&&(st=ut)}return st||"max"}var breakpoints={setBreakpoint,getBreakpoint};function prepareClasses(tt,et){const rt=[];return tt.forEach(st=>{typeof st=="object"?Object.keys(st).forEach(nt=>{st[nt]&&rt.push(et+nt)}):typeof st=="string"&&rt.push(et+st)}),rt}function addClasses(){const tt=this,{classNames:et,params:rt,rtl:st,el:nt,device:ot}=tt,at=prepareClasses(["initialized",rt.direction,{"free-mode":tt.params.freeMode&&rt.freeMode.enabled},{autoheight:rt.autoHeight},{rtl:st},{grid:rt.grid&&rt.grid.rows>1},{"grid-column":rt.grid&&rt.grid.rows>1&&rt.grid.fill==="column"},{android:ot.android},{ios:ot.ios},{"css-mode":rt.cssMode},{centered:rt.cssMode&&rt.centeredSlides},{"watch-progress":rt.watchSlidesProgress}],rt.containerModifierClass);et.push(...at),nt.classList.add(...et),tt.emitContainerClasses()}function removeClasses(){const tt=this,{el:et,classNames:rt}=tt;et.classList.remove(...rt),tt.emitContainerClasses()}var classes={addClasses,removeClasses};function checkOverflow(){const tt=this,{isLocked:et,params:rt}=tt,{slidesOffsetBefore:st}=rt;if(st){const nt=tt.slides.length-1,ot=tt.slidesGrid[nt]+tt.slidesSizesGrid[nt]+st*2;tt.isLocked=tt.size>ot}else tt.isLocked=tt.snapGrid.length===1;rt.allowSlideNext===!0&&(tt.allowSlideNext=!tt.isLocked),rt.allowSlidePrev===!0&&(tt.allowSlidePrev=!tt.isLocked),et&&et!==tt.isLocked&&(tt.isEnd=!1),et!==tt.isLocked&&tt.emit(tt.isLocked?"lock":"unlock")}var checkOverflow$1={checkOverflow},defaults$3={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function moduleExtendParams(tt,et){return function(st){st===void 0&&(st={});const nt=Object.keys(st)[0],ot=st[nt];if(typeof ot!="object"||ot===null){extend$1(et,st);return}if(tt[nt]===!0&&(tt[nt]={enabled:!0}),nt==="navigation"&&tt[nt]&&tt[nt].enabled&&!tt[nt].prevEl&&!tt[nt].nextEl&&(tt[nt].auto=!0),["pagination","scrollbar"].indexOf(nt)>=0&&tt[nt]&&tt[nt].enabled&&!tt[nt].el&&(tt[nt].auto=!0),!(nt in tt&&"enabled"in ot)){extend$1(et,st);return}typeof tt[nt]=="object"&&!("enabled"in tt[nt])&&(tt[nt].enabled=!0),tt[nt]||(tt[nt]={enabled:!1}),extend$1(et,st)}}const prototypes={eventsEmitter,update,translate,transition,slide,loop,grabCursor,events:events$1,breakpoints,checkOverflow:checkOverflow$1,classes},extendedDefaults={};let Swiper$1=class Ao{constructor(){let et,rt;for(var st=arguments.length,nt=new Array(st),ot=0;ot<st;ot++)nt[ot]=arguments[ot];nt.length===1&&nt[0].constructor&&Object.prototype.toString.call(nt[0]).slice(8,-1)==="Object"?rt=nt[0]:[et,rt]=nt,rt||(rt={}),rt=extend$1({},rt),et&&!rt.el&&(rt.el=et);const at=getDocument();if(rt.el&&typeof rt.el=="string"&&at.querySelectorAll(rt.el).length>1){const dt=[];return at.querySelectorAll(rt.el).forEach(ht=>{const ft=extend$1({},rt,{el:ht});dt.push(new Ao(ft))}),dt}const lt=this;lt.__swiper__=!0,lt.support=getSupport(),lt.device=getDevice({userAgent:rt.userAgent}),lt.browser=getBrowser(),lt.eventsListeners={},lt.eventsAnyListeners=[],lt.modules=[...lt.__modules__],rt.modules&&Array.isArray(rt.modules)&<.modules.push(...rt.modules);const ut={};lt.modules.forEach(dt=>{dt({params:rt,swiper:lt,extendParams:moduleExtendParams(rt,ut),on:lt.on.bind(lt),once:lt.once.bind(lt),off:lt.off.bind(lt),emit:lt.emit.bind(lt)})});const ct=extend$1({},defaults$3,ut);return lt.params=extend$1({},ct,extendedDefaults,rt),lt.originalParams=extend$1({},lt.params),lt.passedParams=extend$1({},rt),lt.params&<.params.on&&Object.keys(lt.params.on).forEach(dt=>{lt.on(dt,lt.params.on[dt])}),lt.params&<.params.onAny&<.onAny(lt.params.onAny),Object.assign(lt,{enabled:lt.params.enabled,el:et,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return lt.params.direction==="horizontal"},isVertical(){return lt.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:lt.params.allowSlideNext,allowSlidePrev:lt.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:lt.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:lt.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),lt.emit("_swiper"),lt.params.init&<.init(),lt}getSlideIndex(et){const{slidesEl:rt,params:st}=this,nt=elementChildren(rt,`.${st.slideClass}, swiper-slide`),ot=elementIndex(nt[0]);return elementIndex(et)-ot}getSlideIndexByData(et){return this.getSlideIndex(this.slides.filter(rt=>rt.getAttribute("data-swiper-slide-index")*1===et)[0])}recalcSlides(){const et=this,{slidesEl:rt,params:st}=et;et.slides=elementChildren(rt,`.${st.slideClass}, swiper-slide`)}enable(){const et=this;et.enabled||(et.enabled=!0,et.params.grabCursor&&et.setGrabCursor(),et.emit("enable"))}disable(){const et=this;et.enabled&&(et.enabled=!1,et.params.grabCursor&&et.unsetGrabCursor(),et.emit("disable"))}setProgress(et,rt){const st=this;et=Math.min(Math.max(et,0),1);const nt=st.minTranslate(),at=(st.maxTranslate()-nt)*et+nt;st.translateTo(at,typeof rt>"u"?0:rt),st.updateActiveIndex(),st.updateSlidesClasses()}emitContainerClasses(){const et=this;if(!et.params._emitClasses||!et.el)return;const rt=et.el.className.split(" ").filter(st=>st.indexOf("swiper")===0||st.indexOf(et.params.containerModifierClass)===0);et.emit("_containerClasses",rt.join(" "))}getSlideClasses(et){const rt=this;return rt.destroyed?"":et.className.split(" ").filter(st=>st.indexOf("swiper-slide")===0||st.indexOf(rt.params.slideClass)===0).join(" ")}emitSlidesClasses(){const et=this;if(!et.params._emitClasses||!et.el)return;const rt=[];et.slides.forEach(st=>{const nt=et.getSlideClasses(st);rt.push({slideEl:st,classNames:nt}),et.emit("_slideClass",st,nt)}),et.emit("_slideClasses",rt)}slidesPerViewDynamic(et,rt){et===void 0&&(et="current"),rt===void 0&&(rt=!1);const st=this,{params:nt,slides:ot,slidesGrid:at,slidesSizesGrid:lt,size:ut,activeIndex:ct}=st;let dt=1;if(typeof nt.slidesPerView=="number")return nt.slidesPerView;if(nt.centeredSlides){let ht=ot[ct]?ot[ct].swiperSlideSize:0,ft;for(let xt=ct+1;xt<ot.length;xt+=1)ot[xt]&&!ft&&(ht+=ot[xt].swiperSlideSize,dt+=1,ht>ut&&(ft=!0));for(let xt=ct-1;xt>=0;xt-=1)ot[xt]&&!ft&&(ht+=ot[xt].swiperSlideSize,dt+=1,ht>ut&&(ft=!0))}else if(et==="current")for(let ht=ct+1;ht<ot.length;ht+=1)(rt?at[ht]+lt[ht]-at[ct]<ut:at[ht]-at[ct]<ut)&&(dt+=1);else for(let ht=ct-1;ht>=0;ht-=1)at[ct]-at[ht]<ut&&(dt+=1);return dt}update(){const et=this;if(!et||et.destroyed)return;const{snapGrid:rt,params:st}=et;st.breakpoints&&et.setBreakpoint(),[...et.el.querySelectorAll('[loading="lazy"]')].forEach(at=>{at.complete&&processLazyPreloader(et,at)}),et.updateSize(),et.updateSlides(),et.updateProgress(),et.updateSlidesClasses();function nt(){const at=et.rtlTranslate?et.translate*-1:et.translate,lt=Math.min(Math.max(at,et.maxTranslate()),et.minTranslate());et.setTranslate(lt),et.updateActiveIndex(),et.updateSlidesClasses()}let ot;if(st.freeMode&&st.freeMode.enabled&&!st.cssMode)nt(),st.autoHeight&&et.updateAutoHeight();else{if((st.slidesPerView==="auto"||st.slidesPerView>1)&&et.isEnd&&!st.centeredSlides){const at=et.virtual&&st.virtual.enabled?et.virtual.slides:et.slides;ot=et.slideTo(at.length-1,0,!1,!0)}else ot=et.slideTo(et.activeIndex,0,!1,!0);ot||nt()}st.watchOverflow&&rt!==et.snapGrid&&et.checkOverflow(),et.emit("update")}changeDirection(et,rt){rt===void 0&&(rt=!0);const st=this,nt=st.params.direction;return et||(et=nt==="horizontal"?"vertical":"horizontal"),et===nt||et!=="horizontal"&&et!=="vertical"||(st.el.classList.remove(`${st.params.containerModifierClass}${nt}`),st.el.classList.add(`${st.params.containerModifierClass}${et}`),st.emitContainerClasses(),st.params.direction=et,st.slides.forEach(ot=>{et==="vertical"?ot.style.width="":ot.style.height=""}),st.emit("changeDirection"),rt&&st.update()),st}changeLanguageDirection(et){const rt=this;rt.rtl&&et==="rtl"||!rt.rtl&&et==="ltr"||(rt.rtl=et==="rtl",rt.rtlTranslate=rt.params.direction==="horizontal"&&rt.rtl,rt.rtl?(rt.el.classList.add(`${rt.params.containerModifierClass}rtl`),rt.el.dir="rtl"):(rt.el.classList.remove(`${rt.params.containerModifierClass}rtl`),rt.el.dir="ltr"),rt.update())}mount(et){const rt=this;if(rt.mounted)return!0;let st=et||rt.params.el;if(typeof st=="string"&&(st=document.querySelector(st)),!st)return!1;st.swiper=rt,st.parentNode&&st.parentNode.host&&st.parentNode.host.nodeName==="SWIPER-CONTAINER"&&(rt.isElement=!0);const nt=()=>`.${(rt.params.wrapperClass||"").trim().split(" ").join(".")}`;let at=st&&st.shadowRoot&&st.shadowRoot.querySelector?st.shadowRoot.querySelector(nt()):elementChildren(st,nt())[0];return!at&&rt.params.createElements&&(at=createElement("div",rt.params.wrapperClass),st.append(at),elementChildren(st,`.${rt.params.slideClass}`).forEach(lt=>{at.append(lt)})),Object.assign(rt,{el:st,wrapperEl:at,slidesEl:rt.isElement&&!st.parentNode.host.slideSlots?st.parentNode.host:at,hostEl:rt.isElement?st.parentNode.host:st,mounted:!0,rtl:st.dir.toLowerCase()==="rtl"||elementStyle(st,"direction")==="rtl",rtlTranslate:rt.params.direction==="horizontal"&&(st.dir.toLowerCase()==="rtl"||elementStyle(st,"direction")==="rtl"),wrongRTL:elementStyle(at,"display")==="-webkit-box"}),!0}init(et){const rt=this;if(rt.initialized||rt.mount(et)===!1)return rt;rt.emit("beforeInit"),rt.params.breakpoints&&rt.setBreakpoint(),rt.addClasses(),rt.updateSize(),rt.updateSlides(),rt.params.watchOverflow&&rt.checkOverflow(),rt.params.grabCursor&&rt.enabled&&rt.setGrabCursor(),rt.params.loop&&rt.virtual&&rt.params.virtual.enabled?rt.slideTo(rt.params.initialSlide+rt.virtual.slidesBefore,0,rt.params.runCallbacksOnInit,!1,!0):rt.slideTo(rt.params.initialSlide,0,rt.params.runCallbacksOnInit,!1,!0),rt.params.loop&&rt.loopCreate(),rt.attachEvents();const nt=[...rt.el.querySelectorAll('[loading="lazy"]')];return rt.isElement&&nt.push(...rt.hostEl.querySelectorAll('[loading="lazy"]')),nt.forEach(ot=>{ot.complete?processLazyPreloader(rt,ot):ot.addEventListener("load",at=>{processLazyPreloader(rt,at.target)})}),preload(rt),rt.initialized=!0,preload(rt),rt.emit("init"),rt.emit("afterInit"),rt}destroy(et,rt){et===void 0&&(et=!0),rt===void 0&&(rt=!0);const st=this,{params:nt,el:ot,wrapperEl:at,slides:lt}=st;return typeof st.params>"u"||st.destroyed||(st.emit("beforeDestroy"),st.initialized=!1,st.detachEvents(),nt.loop&&st.loopDestroy(),rt&&(st.removeClasses(),ot.removeAttribute("style"),at.removeAttribute("style"),lt&<.length&<.forEach(ut=>{ut.classList.remove(nt.slideVisibleClass,nt.slideActiveClass,nt.slideNextClass,nt.slidePrevClass),ut.removeAttribute("style"),ut.removeAttribute("data-swiper-slide-index")})),st.emit("destroy"),Object.keys(st.eventsListeners).forEach(ut=>{st.off(ut)}),et!==!1&&(st.el.swiper=null,deleteProps(st)),st.destroyed=!0),null}static extendDefaults(et){extend$1(extendedDefaults,et)}static get extendedDefaults(){return extendedDefaults}static get defaults(){return defaults$3}static installModule(et){Ao.prototype.__modules__||(Ao.prototype.__modules__=[]);const rt=Ao.prototype.__modules__;typeof et=="function"&&rt.indexOf(et)<0&&rt.push(et)}static use(et){return Array.isArray(et)?(et.forEach(rt=>Ao.installModule(rt)),Ao):(Ao.installModule(et),Ao)}};Object.keys(prototypes).forEach(tt=>{Object.keys(prototypes[tt]).forEach(et=>{Swiper$1.prototype[et]=prototypes[tt][et]})});Swiper$1.use([Resize,Observer]);const paramsList=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopedSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideNextClass","slidePrevClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function isObject$1(tt){return typeof tt=="object"&&tt!==null&&tt.constructor&&Object.prototype.toString.call(tt).slice(8,-1)==="Object"&&!tt.__swiper__}function extend(tt,et){const rt=["__proto__","constructor","prototype"];Object.keys(et).filter(st=>rt.indexOf(st)<0).forEach(st=>{typeof tt[st]>"u"?tt[st]=et[st]:isObject$1(et[st])&&isObject$1(tt[st])&&Object.keys(et[st]).length>0?et[st].__swiper__?tt[st]=et[st]:extend(tt[st],et[st]):tt[st]=et[st]})}function needsNavigation(tt){return tt===void 0&&(tt={}),tt.navigation&&typeof tt.navigation.nextEl>"u"&&typeof tt.navigation.prevEl>"u"}function needsPagination(tt){return tt===void 0&&(tt={}),tt.pagination&&typeof tt.pagination.el>"u"}function needsScrollbar(tt){return tt===void 0&&(tt={}),tt.scrollbar&&typeof tt.scrollbar.el>"u"}function uniqueClasses(tt){tt===void 0&&(tt="");const et=tt.split(" ").map(st=>st.trim()).filter(st=>!!st),rt=[];return et.forEach(st=>{rt.indexOf(st)<0&&rt.push(st)}),rt.join(" ")}function wrapperClass(tt){return tt===void 0&&(tt=""),tt?tt.includes("swiper-wrapper")?tt:`swiper-wrapper ${tt}`:"swiper-wrapper"}function updateSwiper(tt){let{swiper:et,slides:rt,passedParams:st,changedParams:nt,nextEl:ot,prevEl:at,scrollbarEl:lt,paginationEl:ut}=tt;const ct=nt.filter(Ot=>Ot!=="children"&&Ot!=="direction"&&Ot!=="wrapperClass"),{params:dt,pagination:ht,navigation:ft,scrollbar:xt,virtual:vt,thumbs:yt}=et;let Et,bt,wt,St,Rt,Ct,It,jt;nt.includes("thumbs")&&st.thumbs&&st.thumbs.swiper&&dt.thumbs&&!dt.thumbs.swiper&&(Et=!0),nt.includes("controller")&&st.controller&&st.controller.control&&dt.controller&&!dt.controller.control&&(bt=!0),nt.includes("pagination")&&st.pagination&&(st.pagination.el||ut)&&(dt.pagination||dt.pagination===!1)&&ht&&!ht.el&&(wt=!0),nt.includes("scrollbar")&&st.scrollbar&&(st.scrollbar.el||lt)&&(dt.scrollbar||dt.scrollbar===!1)&&xt&&!xt.el&&(St=!0),nt.includes("navigation")&&st.navigation&&(st.navigation.prevEl||at)&&(st.navigation.nextEl||ot)&&(dt.navigation||dt.navigation===!1)&&ft&&!ft.prevEl&&!ft.nextEl&&(Rt=!0);const Pt=Ot=>{et[Ot]&&(et[Ot].destroy(),Ot==="navigation"?(et.isElement&&(et[Ot].prevEl.remove(),et[Ot].nextEl.remove()),dt[Ot].prevEl=void 0,dt[Ot].nextEl=void 0,et[Ot].prevEl=void 0,et[Ot].nextEl=void 0):(et.isElement&&et[Ot].el.remove(),dt[Ot].el=void 0,et[Ot].el=void 0))};nt.includes("loop")&&et.isElement&&(dt.loop&&!st.loop?Ct=!0:!dt.loop&&st.loop?It=!0:jt=!0),ct.forEach(Ot=>{if(isObject$1(dt[Ot])&&isObject$1(st[Ot]))extend(dt[Ot],st[Ot]),(Ot==="navigation"||Ot==="pagination"||Ot==="scrollbar")&&"enabled"in st[Ot]&&!st[Ot].enabled&&Pt(Ot);else{const Ut=st[Ot];(Ut===!0||Ut===!1)&&(Ot==="navigation"||Ot==="pagination"||Ot==="scrollbar")?Ut===!1&&Pt(Ot):dt[Ot]=st[Ot]}}),ct.includes("controller")&&!bt&&et.controller&&et.controller.control&&dt.controller&&dt.controller.control&&(et.controller.control=dt.controller.control),nt.includes("children")&&rt&&vt&&dt.virtual.enabled&&(vt.slides=rt,vt.update(!0)),nt.includes("children")&&rt&&dt.loop&&(jt=!0),Et&&yt.init()&&yt.update(!0),bt&&(et.controller.control=dt.controller.control),wt&&(et.isElement&&(!ut||typeof ut=="string")&&(ut=document.createElement("div"),ut.classList.add("swiper-pagination"),ut.part.add("pagination"),et.el.appendChild(ut)),ut&&(dt.pagination.el=ut),ht.init(),ht.render(),ht.update()),St&&(et.isElement&&(!lt||typeof lt=="string")&&(lt=document.createElement("div"),lt.classList.add("swiper-scrollbar"),lt.part.add("scrollbar"),et.el.appendChild(lt)),lt&&(dt.scrollbar.el=lt),xt.init(),xt.updateSize(),xt.setTranslate()),Rt&&(et.isElement&&((!ot||typeof ot=="string")&&(ot=document.createElement("div"),ot.classList.add("swiper-button-next"),ot.innerHTML=et.hostEl.constructor.nextButtonSvg,ot.part.add("button-next"),et.el.appendChild(ot)),(!at||typeof at=="string")&&(at=document.createElement("div"),at.classList.add("swiper-button-prev"),at.innerHTML=et.hostEl.constructor.prevButtonSvg,at.part.add("button-prev"),et.el.appendChild(at))),ot&&(dt.navigation.nextEl=ot),at&&(dt.navigation.prevEl=at),ft.init(),ft.update()),nt.includes("allowSlideNext")&&(et.allowSlideNext=st.allowSlideNext),nt.includes("allowSlidePrev")&&(et.allowSlidePrev=st.allowSlidePrev),nt.includes("direction")&&et.changeDirection(st.direction,!1),(Ct||jt)&&et.loopDestroy(),(It||jt)&&et.loopCreate(),et.update()}function getParams(tt,et){tt===void 0&&(tt={}),et===void 0&&(et=!0);const rt={on:{}},st={},nt={};extend(rt,defaults$3),rt._emitClasses=!0,rt.init=!1;const ot={},at=paramsList.map(ut=>ut.replace(/_/,"")),lt=Object.assign({},tt);return Object.keys(lt).forEach(ut=>{typeof tt[ut]>"u"||(at.indexOf(ut)>=0?isObject$1(tt[ut])?(rt[ut]={},nt[ut]={},extend(rt[ut],tt[ut]),extend(nt[ut],tt[ut])):(rt[ut]=tt[ut],nt[ut]=tt[ut]):ut.search(/on[A-Z]/)===0&&typeof tt[ut]=="function"?et?st[`${ut[2].toLowerCase()}${ut.substr(3)}`]=tt[ut]:rt.on[`${ut[2].toLowerCase()}${ut.substr(3)}`]=tt[ut]:ot[ut]=tt[ut])}),["navigation","pagination","scrollbar"].forEach(ut=>{rt[ut]===!0&&(rt[ut]={}),rt[ut]===!1&&delete rt[ut]}),{params:rt,passedParams:nt,rest:ot,events:st}}function mountSwiper(tt,et){let{el:rt,nextEl:st,prevEl:nt,paginationEl:ot,scrollbarEl:at,swiper:lt}=tt;needsNavigation(et)&&st&&nt&&(lt.params.navigation.nextEl=st,lt.originalParams.navigation.nextEl=st,lt.params.navigation.prevEl=nt,lt.originalParams.navigation.prevEl=nt),needsPagination(et)&&ot&&(lt.params.pagination.el=ot,lt.originalParams.pagination.el=ot),needsScrollbar(et)&&at&&(lt.params.scrollbar.el=at,lt.originalParams.scrollbar.el=at),lt.init(rt)}function getChangedParams(tt,et,rt,st,nt){const ot=[];if(!et)return ot;const at=ut=>{ot.indexOf(ut)<0&&ot.push(ut)};if(rt&&st){const ut=st.map(nt),ct=rt.map(nt);ut.join("")!==ct.join("")&&at("children"),st.length!==rt.length&&at("children")}return paramsList.filter(ut=>ut[0]==="_").map(ut=>ut.replace(/_/,"")).forEach(ut=>{if(ut in tt&&ut in et)if(isObject$1(tt[ut])&&isObject$1(et[ut])){const ct=Object.keys(tt[ut]),dt=Object.keys(et[ut]);ct.length!==dt.length?at(ut):(ct.forEach(ht=>{tt[ut][ht]!==et[ut][ht]&&at(ut)}),dt.forEach(ht=>{tt[ut][ht]!==et[ut][ht]&&at(ut)}))}else tt[ut]!==et[ut]&&at(ut)}),ot}const updateOnVirtualData=tt=>{!tt||tt.destroyed||!tt.params.virtual||tt.params.virtual&&!tt.params.virtual.enabled||(tt.updateSlides(),tt.updateProgress(),tt.updateSlidesClasses(),tt.parallax&&tt.params.parallax&&tt.params.parallax.enabled&&tt.parallax.setTranslate())};function _extends(){return _extends=Object.assign?Object.assign.bind():function(tt){for(var et=1;et<arguments.length;et++){var rt=arguments[et];for(var st in rt)Object.prototype.hasOwnProperty.call(rt,st)&&(tt[st]=rt[st])}return tt},_extends.apply(this,arguments)}function isChildSwiperSlide(tt){return tt.type&&tt.type.displayName&&tt.type.displayName.includes("SwiperSlide")}function processChildren(tt){const et=[];return React$4.Children.toArray(tt).forEach(rt=>{isChildSwiperSlide(rt)?et.push(rt):rt.props&&rt.props.children&&processChildren(rt.props.children).forEach(st=>et.push(st))}),et}function getChildren(tt){const et=[],rt={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return React$4.Children.toArray(tt).forEach(st=>{if(isChildSwiperSlide(st))et.push(st);else if(st.props&&st.props.slot&&rt[st.props.slot])rt[st.props.slot].push(st);else if(st.props&&st.props.children){const nt=processChildren(st.props.children);nt.length>0?nt.forEach(ot=>et.push(ot)):rt["container-end"].push(st)}else rt["container-end"].push(st)}),{slides:et,slots:rt}}function renderVirtual(tt,et,rt){if(!rt)return null;const st=dt=>{let ht=dt;return dt<0?ht=et.length+dt:ht>=et.length&&(ht=ht-et.length),ht},nt=tt.isHorizontal()?{[tt.rtlTranslate?"right":"left"]:`${rt.offset}px`}:{top:`${rt.offset}px`},{from:ot,to:at}=rt,lt=tt.params.loop?-et.length:0,ut=tt.params.loop?et.length*2:et.length,ct=[];for(let dt=lt;dt<ut;dt+=1)dt>=ot&&dt<=at&&ct.push(et[st(dt)]);return ct.map((dt,ht)=>React$4.cloneElement(dt,{swiper:tt,style:nt,key:`slide-${ht}`}))}function useIsomorphicLayoutEffect$1(tt,et){return typeof window>"u"?reactExports.useEffect(tt,et):reactExports.useLayoutEffect(tt,et)}const SwiperSlideContext=reactExports.createContext(null),SwiperContext=reactExports.createContext(null),Swiper=reactExports.forwardRef(function(tt,et){let{className:rt,tag:st="div",wrapperTag:nt="div",children:ot,onSwiper:at,...lt}=tt===void 0?{}:tt,ut=!1;const[ct,dt]=reactExports.useState("swiper"),[ht,ft]=reactExports.useState(null),[xt,vt]=reactExports.useState(!1),yt=reactExports.useRef(!1),Et=reactExports.useRef(null),bt=reactExports.useRef(null),wt=reactExports.useRef(null),St=reactExports.useRef(null),Rt=reactExports.useRef(null),Ct=reactExports.useRef(null),It=reactExports.useRef(null),jt=reactExports.useRef(null),{params:Pt,passedParams:Ot,rest:Ut,events:Nt}=getParams(lt),{slides:Ht,slots:Lt}=getChildren(ot),kt=()=>{vt(!xt)};Object.assign(Pt.on,{_containerClasses(Vt,Bt){dt(Bt)}});const $t=()=>{Object.assign(Pt.on,Nt),ut=!0;const Vt={...Pt};if(delete Vt.wrapperClass,bt.current=new Swiper$1(Vt),bt.current.virtual&&bt.current.params.virtual.enabled){bt.current.virtual.slides=Ht;const Bt={cache:!1,slides:Ht,renderExternal:ft,renderExternalUpdate:!1};extend(bt.current.params.virtual,Bt),extend(bt.current.originalParams.virtual,Bt)}};Et.current||$t(),bt.current&&bt.current.on("_beforeBreakpoint",kt);const Ft=()=>{ut||!Nt||!bt.current||Object.keys(Nt).forEach(Vt=>{bt.current.on(Vt,Nt[Vt])})},Gt=()=>{!Nt||!bt.current||Object.keys(Nt).forEach(Vt=>{bt.current.off(Vt,Nt[Vt])})};reactExports.useEffect(()=>()=>{bt.current&&bt.current.off("_beforeBreakpoint",kt)}),reactExports.useEffect(()=>{!yt.current&&bt.current&&(bt.current.emitSlidesClasses(),yt.current=!0)}),useIsomorphicLayoutEffect$1(()=>{if(et&&(et.current=Et.current),!!Et.current)return bt.current.destroyed&&$t(),mountSwiper({el:Et.current,nextEl:Rt.current,prevEl:Ct.current,paginationEl:It.current,scrollbarEl:jt.current,swiper:bt.current},Pt),at&&at(bt.current),()=>{bt.current&&!bt.current.destroyed&&bt.current.destroy(!0,!1)}},[]),useIsomorphicLayoutEffect$1(()=>{Ft();const Vt=getChangedParams(Ot,wt.current,Ht,St.current,Bt=>Bt.key);return wt.current=Ot,St.current=Ht,Vt.length&&bt.current&&!bt.current.destroyed&&updateSwiper({swiper:bt.current,slides:Ht,passedParams:Ot,changedParams:Vt,nextEl:Rt.current,prevEl:Ct.current,scrollbarEl:jt.current,paginationEl:It.current}),()=>{Gt()}}),useIsomorphicLayoutEffect$1(()=>{updateOnVirtualData(bt.current)},[ht]);function Mt(){return Pt.virtual?renderVirtual(bt.current,Ht,ht):Ht.map((Vt,Bt)=>React$4.cloneElement(Vt,{swiper:bt.current,swiperSlideIndex:Bt}))}return React$4.createElement(st,_extends({ref:Et,className:uniqueClasses(`${ct}${rt?` ${rt}`:""}`)},Ut),React$4.createElement(SwiperContext.Provider,{value:bt.current},Lt["container-start"],React$4.createElement(nt,{className:wrapperClass(Pt.wrapperClass)},Lt["wrapper-start"],Mt(),Lt["wrapper-end"]),needsNavigation(Pt)&&React$4.createElement(React$4.Fragment,null,React$4.createElement("div",{ref:Ct,className:"swiper-button-prev"}),React$4.createElement("div",{ref:Rt,className:"swiper-button-next"})),needsScrollbar(Pt)&&React$4.createElement("div",{ref:jt,className:"swiper-scrollbar"}),needsPagination(Pt)&&React$4.createElement("div",{ref:It,className:"swiper-pagination"}),Lt["container-end"]))});Swiper.displayName="Swiper";const SwiperSlide=reactExports.forwardRef(function(tt,et){let{tag:rt="div",children:st,className:nt="",swiper:ot,zoom:at,lazy:lt,virtualIndex:ut,swiperSlideIndex:ct,...dt}=tt===void 0?{}:tt;const ht=reactExports.useRef(null),[ft,xt]=reactExports.useState("swiper-slide"),[vt,yt]=reactExports.useState(!1);function Et(Rt,Ct,It){Ct===ht.current&&xt(It)}useIsomorphicLayoutEffect$1(()=>{if(typeof ct<"u"&&(ht.current.swiperSlideIndex=ct),et&&(et.current=ht.current),!(!ht.current||!ot)){if(ot.destroyed){ft!=="swiper-slide"&&xt("swiper-slide");return}return ot.on("_slideClass",Et),()=>{ot&&ot.off("_slideClass",Et)}}}),useIsomorphicLayoutEffect$1(()=>{ot&&ht.current&&!ot.destroyed&&xt(ot.getSlideClasses(ht.current))},[ot]);const bt={isActive:ft.indexOf("swiper-slide-active")>=0,isVisible:ft.indexOf("swiper-slide-visible")>=0,isPrev:ft.indexOf("swiper-slide-prev")>=0,isNext:ft.indexOf("swiper-slide-next")>=0},wt=()=>typeof st=="function"?st(bt):st,St=()=>{yt(!0)};return React$4.createElement(rt,_extends({ref:ht,className:uniqueClasses(`${ft}${nt?` ${nt}`:""}`),"data-swiper-slide-index":ut,onLoad:St},dt),at&&React$4.createElement(SwiperSlideContext.Provider,{value:bt},React$4.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof at=="number"?at:void 0},wt(),lt&&!vt&&React$4.createElement("div",{className:"swiper-lazy-preloader"}))),!at&&React$4.createElement(SwiperSlideContext.Provider,{value:bt},wt(),lt&&!vt&&React$4.createElement("div",{className:"swiper-lazy-preloader"})))});SwiperSlide.displayName="SwiperSlide";const getOnboardingTrash=async tt=>await odeServices.conf().getPreference(tt),saveOnboardingTrash=async tt=>await odeServices.conf().savePreference(tt,JSON.stringify({key:!1})),useOnboardingModal=tt=>{const[et,rt]=reactExports.useState(!1),[st,nt]=reactExports.useState(!1);return reactExports.useEffect(()=>{(async()=>{const ot=await getOnboardingTrash(tt);if(ot){const{key:at}=ot;at===!0&&rt(!0),nt(at);return}nt(!0),rt(!0)})()},[tt]),{isOpen:et,setIsOpen:rt,isOnboarding:st,handleSavePreference:async()=>{await saveOnboardingTrash(tt),rt(!1),nt(!1)}}},OnboardingModal$2=reactExports.forwardRef(({id:tt,items:et,modalOptions:rt={},isOnboardingChange:st},nt)=>{var ot;const[at,lt]=reactExports.useState(),[ut,ct]=reactExports.useState(0),{isOpen:dt,isOnboarding:ht,setIsOpen:ft,handleSavePreference:xt}=useOnboardingModal(tt);reactExports.useImperativeHandle(nt,()=>({setIsOpen:ft,handleSavePreference:xt})),reactExports.useEffect(()=>{st&&st(ht)},[ht,st]),reactExports.useEffect(()=>{const It=document.createElement("link");return It.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",It.rel="stylesheet",It.type="text/css",document.head.appendChild(It),()=>{document.head.removeChild(It)}},[]);const{t:vt}=useTranslation(),{title:yt,prevText:Et,closeText:bt,nextText:wt}=rt,St=(at==null?void 0:at.activeIndex)!=null&&(ot=et[at==null?void 0:at.activeIndex])!=null&&ot.title?et[at.activeIndex].title:yt,Rt=()=>{xt(),ct(0)},Ct=()=>{ft(!1),ct(0)};return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"onboarding-modal",size:"md",isOpen:dt,focusId:"nextButtonId",onModalClose:Ct,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Ct,centered:!0,children:vt(St||"explorer.modal.onboarding.trash.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx(Swiper,{modules:[Pagination],onSwiper:It=>{lt(It)},onSlideChange:It=>{ct(It.progress)},pagination:{clickable:!0},children:et.map((It,jt)=>jsxRuntimeExports.jsxs(SwiperSlide,{children:[jsxRuntimeExports.jsx(Image$1,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:It.src,alt:vt(It.alt)}),jsxRuntimeExports.jsx("p",{className:"text-center",dangerouslySetInnerHTML:{__html:vt(It.text)}})]},jt))})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:Ct,children:vt("explorer.modal.onboarding.trash.later")}),ut>0&&jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"outline",onClick:()=>at.slidePrev(),children:vt(Et||"explorer.modal.onboarding.trash.prev")}),ut<1&&jsxRuntimeExports.jsx(Button,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>at.slideNext(),children:vt(wt||"explorer.modal.onboarding.trash.next")}),ut===1&&jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",onClick:()=>{ht?Rt():Ct()},children:vt(bt||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")||document.body)});var isCheckBoxInput=tt=>tt.type==="checkbox",isDateObject=tt=>tt instanceof Date,isNullOrUndefined=tt=>tt==null;const isObjectType=tt=>typeof tt=="object";var isObject=tt=>!isNullOrUndefined(tt)&&!Array.isArray(tt)&&isObjectType(tt)&&!isDateObject(tt),getEventValue=tt=>isObject(tt)&&tt.target?isCheckBoxInput(tt.target)?tt.target.checked:tt.target.value:tt,getNodeParentName=tt=>tt.substring(0,tt.search(/\.\d+(\.|$)/))||tt,isNameInFieldArray=(tt,et)=>tt.has(getNodeParentName(et)),isPlainObject=tt=>{const et=tt.constructor&&tt.constructor.prototype;return isObject(et)&&et.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(tt){let et;const rt=Array.isArray(tt),st=typeof FileList<"u"?tt instanceof FileList:!1;if(tt instanceof Date)et=new Date(tt);else if(!(isWeb&&(tt instanceof Blob||st))&&(rt||isObject(tt)))if(et=rt?[]:Object.create(Object.getPrototypeOf(tt)),!rt&&!isPlainObject(tt))et=tt;else for(const nt in tt)tt.hasOwnProperty(nt)&&(et[nt]=cloneObject(tt[nt]));else return tt;return et}var isKey=tt=>/^\w*$/.test(tt),isUndefined=tt=>tt===void 0,compact$1=tt=>Array.isArray(tt)?tt.filter(Boolean):[],stringToPath$1=tt=>compact$1(tt.replace(/["|']|\]/g,"").split(/\.|\[/)),get$1=(tt,et,rt)=>{if(!et||!isObject(tt))return rt;const st=(isKey(et)?[et]:stringToPath$1(et)).reduce((nt,ot)=>isNullOrUndefined(nt)?nt:nt[ot],tt);return isUndefined(st)||st===tt?isUndefined(tt[et])?rt:tt[et]:st},isBoolean$1=tt=>typeof tt=="boolean",set=(tt,et,rt)=>{let st=-1;const nt=isKey(et)?[et]:stringToPath$1(et),ot=nt.length,at=ot-1;for(;++st<ot;){const lt=nt[st];let ut=rt;if(st!==at){const ct=tt[lt];ut=isObject(ct)||Array.isArray(ct)?ct:isNaN(+nt[st+1])?{}:[]}if(lt==="__proto__"||lt==="constructor"||lt==="prototype")return;tt[lt]=ut,tt=tt[lt]}};const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React$4.createContext(null);HookFormContext.displayName="HookFormContext";const useFormContext=()=>React$4.useContext(HookFormContext);var getProxyFormState=(tt,et,rt,st=!0)=>{const nt={defaultValues:et._defaultValues};for(const ot in tt)Object.defineProperty(nt,ot,{get:()=>{const at=ot;return et._proxyFormState[at]!==VALIDATION_MODE.all&&(et._proxyFormState[at]=!st||VALIDATION_MODE.all),rt&&(rt[at]=!0),tt[at]}});return nt};const useIsomorphicLayoutEffect=typeof window<"u"?React$4.useLayoutEffect:React$4.useEffect;function useFormState(tt){const et=useFormContext(),{control:rt=et.control,disabled:st,name:nt,exact:ot}=tt||{},[at,lt]=React$4.useState(rt._formState),ut=React$4.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return useIsomorphicLayoutEffect(()=>rt._subscribe({name:nt,formState:ut.current,exact:ot,callback:ct=>{!st&<({...rt._formState,...ct})}}),[nt,st,ot]),React$4.useEffect(()=>{ut.current.isValid&&rt._setValid(!0)},[rt]),React$4.useMemo(()=>getProxyFormState(at,rt,ut.current,!1),[at,rt])}var isString$1=tt=>typeof tt=="string",generateWatchOutput=(tt,et,rt,st,nt)=>isString$1(tt)?(st&&et.watch.add(tt),get$1(rt,tt,nt)):Array.isArray(tt)?tt.map(ot=>(st&&et.watch.add(ot),get$1(rt,ot))):(st&&(et.watchAll=!0),rt),isPrimitive=tt=>isNullOrUndefined(tt)||!isObjectType(tt);function deepEqual(tt,et,rt=new WeakSet){if(isPrimitive(tt)||isPrimitive(et))return tt===et;if(isDateObject(tt)&&isDateObject(et))return tt.getTime()===et.getTime();const st=Object.keys(tt),nt=Object.keys(et);if(st.length!==nt.length)return!1;if(rt.has(tt)||rt.has(et))return!0;rt.add(tt),rt.add(et);for(const ot of st){const at=tt[ot];if(!nt.includes(ot))return!1;if(ot!=="ref"){const lt=et[ot];if(isDateObject(at)&&isDateObject(lt)||isObject(at)&&isObject(lt)||Array.isArray(at)&&Array.isArray(lt)?!deepEqual(at,lt,rt):at!==lt)return!1}}return!0}function useWatch(tt){const et=useFormContext(),{control:rt=et.control,name:st,defaultValue:nt,disabled:ot,exact:at,compute:lt}=tt||{},ut=React$4.useRef(nt),ct=React$4.useRef(lt),dt=React$4.useRef(void 0);ct.current=lt;const ht=React$4.useMemo(()=>rt._getWatch(st,ut.current),[rt,st]),[ft,xt]=React$4.useState(ct.current?ct.current(ht):ht);return useIsomorphicLayoutEffect(()=>rt._subscribe({name:st,formState:{values:!0},exact:at,callback:vt=>{if(!ot){const yt=generateWatchOutput(st,rt._names,vt.values||rt._formValues,!1,ut.current);if(ct.current){const Et=ct.current(yt);deepEqual(Et,dt.current)||(xt(Et),dt.current=Et)}else xt(yt)}}}),[rt,ot,st,at]),React$4.useEffect(()=>rt._removeUnmounted()),ft}function useController(tt){const et=useFormContext(),{name:rt,disabled:st,control:nt=et.control,shouldUnregister:ot,defaultValue:at}=tt,lt=isNameInFieldArray(nt._names.array,rt),ut=React$4.useMemo(()=>get$1(nt._formValues,rt,get$1(nt._defaultValues,rt,at)),[nt,rt,at]),ct=useWatch({control:nt,name:rt,defaultValue:ut,exact:!0}),dt=useFormState({control:nt,name:rt,exact:!0}),ht=React$4.useRef(tt),ft=React$4.useRef(void 0),xt=React$4.useRef(nt.register(rt,{...tt.rules,value:ct,...isBoolean$1(tt.disabled)?{disabled:tt.disabled}:{}}));ht.current=tt;const vt=React$4.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get$1(dt.errors,rt)},isDirty:{enumerable:!0,get:()=>!!get$1(dt.dirtyFields,rt)},isTouched:{enumerable:!0,get:()=>!!get$1(dt.touchedFields,rt)},isValidating:{enumerable:!0,get:()=>!!get$1(dt.validatingFields,rt)},error:{enumerable:!0,get:()=>get$1(dt.errors,rt)}}),[dt,rt]),yt=React$4.useCallback(St=>xt.current.onChange({target:{value:getEventValue(St),name:rt},type:EVENTS.CHANGE}),[rt]),Et=React$4.useCallback(()=>xt.current.onBlur({target:{value:get$1(nt._formValues,rt),name:rt},type:EVENTS.BLUR}),[rt,nt._formValues]),bt=React$4.useCallback(St=>{const Rt=get$1(nt._fields,rt);Rt&&St&&(Rt._f.ref={focus:()=>St.focus&&St.focus(),select:()=>St.select&&St.select(),setCustomValidity:Ct=>St.setCustomValidity(Ct),reportValidity:()=>St.reportValidity()})},[nt._fields,rt]),wt=React$4.useMemo(()=>({name:rt,value:ct,...isBoolean$1(st)||dt.disabled?{disabled:dt.disabled||st}:{},onChange:yt,onBlur:Et,ref:bt}),[rt,st,dt.disabled,yt,Et,bt,ct]);return React$4.useEffect(()=>{const St=nt._options.shouldUnregister||ot,Rt=ft.current;Rt&&Rt!==rt&&!lt&&nt.unregister(Rt),nt.register(rt,{...ht.current.rules,...isBoolean$1(ht.current.disabled)?{disabled:ht.current.disabled}:{}});const Ct=(It,jt)=>{const Pt=get$1(nt._fields,It);Pt&&Pt._f&&(Pt._f.mount=jt)};if(Ct(rt,!0),St){const It=cloneObject(get$1(nt._options.defaultValues,rt,ht.current.defaultValue));set(nt._defaultValues,rt,It),isUndefined(get$1(nt._formValues,rt))&&set(nt._formValues,rt,It)}return!lt&&nt.register(rt),ft.current=rt,()=>{(lt?St&&!nt._state.action:St)?nt.unregister(rt):Ct(rt,!1)}},[rt,nt,lt,ot]),React$4.useEffect(()=>{nt._setDisabledField({disabled:st,name:rt})},[st,rt,nt]),React$4.useMemo(()=>({field:wt,formState:dt,fieldState:vt}),[wt,dt,vt])}const Controller=tt=>tt.render(useController(tt));var appendErrors=(tt,et,rt,st,nt)=>et?{...rt[tt],types:{...rt[tt]&&rt[tt].types?rt[tt].types:{},[st]:nt||!0}}:{},convertToArrayPayload=tt=>Array.isArray(tt)?tt:[tt],createSubject=()=>{let tt=[];return{get observers(){return tt},next:nt=>{for(const ot of tt)ot.next&&ot.next(nt)},subscribe:nt=>(tt.push(nt),{unsubscribe:()=>{tt=tt.filter(ot=>ot!==nt)}}),unsubscribe:()=>{tt=[]}}};function extractFormValues(tt,et){const rt={};for(const st in tt)if(tt.hasOwnProperty(st)){const nt=tt[st],ot=et[st];if(nt&&isObject(nt)&&ot){const at=extractFormValues(nt,ot);isObject(at)&&(rt[st]=at)}else tt[st]&&(rt[st]=ot)}return rt}var isEmptyObject=tt=>isObject(tt)&&!Object.keys(tt).length,isFileInput=tt=>tt.type==="file",isFunction=tt=>typeof tt=="function",isHTMLElement=tt=>{if(!isWeb)return!1;const et=tt?tt.ownerDocument:0;return tt instanceof(et&&et.defaultView?et.defaultView.HTMLElement:HTMLElement)},isMultipleSelect=tt=>tt.type==="select-multiple",isRadioInput=tt=>tt.type==="radio",isRadioOrCheckbox=tt=>isRadioInput(tt)||isCheckBoxInput(tt),live=tt=>isHTMLElement(tt)&&tt.isConnected;function baseGet(tt,et){const rt=et.slice(0,-1).length;let st=0;for(;st<rt;)tt=isUndefined(tt)?st++:tt[et[st++]];return tt}function isEmptyArray(tt){for(const et in tt)if(tt.hasOwnProperty(et)&&!isUndefined(tt[et]))return!1;return!0}function unset(tt,et){const rt=Array.isArray(et)?et:isKey(et)?[et]:stringToPath$1(et),st=rt.length===1?tt:baseGet(tt,rt),nt=rt.length-1,ot=rt[nt];return st&&delete st[ot],nt!==0&&(isObject(st)&&isEmptyObject(st)||Array.isArray(st)&&isEmptyArray(st))&&unset(tt,rt.slice(0,-1)),tt}var objectHasFunction=tt=>{for(const et in tt)if(isFunction(tt[et]))return!0;return!1};function isTraversable(tt){return Array.isArray(tt)||isObject(tt)&&!objectHasFunction(tt)}function markFieldsDirty(tt,et={}){for(const rt in tt)isTraversable(tt[rt])?(et[rt]=Array.isArray(tt[rt])?[]:{},markFieldsDirty(tt[rt],et[rt])):isNullOrUndefined(tt[rt])||(et[rt]=!0);return et}function getDirtyFields(tt,et,rt){rt||(rt=markFieldsDirty(et));for(const st in tt)isTraversable(tt[st])?isUndefined(et)||isPrimitive(rt[st])?rt[st]=markFieldsDirty(tt[st],Array.isArray(tt[st])?[]:{}):getDirtyFields(tt[st],isNullOrUndefined(et)?{}:et[st],rt[st]):rt[st]=!deepEqual(tt[st],et[st]);return rt}const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=tt=>{if(Array.isArray(tt)){if(tt.length>1){const et=tt.filter(rt=>rt&&rt.checked&&!rt.disabled).map(rt=>rt.value);return{value:et,isValid:!!et.length}}return tt[0].checked&&!tt[0].disabled?tt[0].attributes&&!isUndefined(tt[0].attributes.value)?isUndefined(tt[0].value)||tt[0].value===""?validResult:{value:tt[0].value,isValid:!0}:validResult:defaultResult}return defaultResult},getFieldValueAs=(tt,{valueAsNumber:et,valueAsDate:rt,setValueAs:st})=>isUndefined(tt)?tt:et?tt===""?NaN:tt&&+tt:rt&&isString$1(tt)?new Date(tt):st?st(tt):tt;const defaultReturn={isValid:!1,value:null};var getRadioValue=tt=>Array.isArray(tt)?tt.reduce((et,rt)=>rt&&rt.checked&&!rt.disabled?{isValid:!0,value:rt.value}:et,defaultReturn):defaultReturn;function getFieldValue(tt){const et=tt.ref;return isFileInput(et)?et.files:isRadioInput(et)?getRadioValue(tt.refs).value:isMultipleSelect(et)?[...et.selectedOptions].map(({value:rt})=>rt):isCheckBoxInput(et)?getCheckboxValue(tt.refs).value:getFieldValueAs(isUndefined(et.value)?tt.ref.value:et.value,tt)}var getResolverOptions=(tt,et,rt,st)=>{const nt={};for(const ot of tt){const at=get$1(et,ot);at&&set(nt,ot,at._f)}return{criteriaMode:rt,names:[...tt],fields:nt,shouldUseNativeValidation:st}},isRegex=tt=>tt instanceof RegExp,getRuleValue=tt=>isUndefined(tt)?tt:isRegex(tt)?tt.source:isObject(tt)?isRegex(tt.value)?tt.value.source:tt.value:tt,getValidationModes=tt=>({isOnSubmit:!tt||tt===VALIDATION_MODE.onSubmit,isOnBlur:tt===VALIDATION_MODE.onBlur,isOnChange:tt===VALIDATION_MODE.onChange,isOnAll:tt===VALIDATION_MODE.all,isOnTouch:tt===VALIDATION_MODE.onTouched});const ASYNC_FUNCTION="AsyncFunction";var hasPromiseValidation=tt=>!!tt&&!!tt.validate&&!!(isFunction(tt.validate)&&tt.validate.constructor.name===ASYNC_FUNCTION||isObject(tt.validate)&&Object.values(tt.validate).find(et=>et.constructor.name===ASYNC_FUNCTION)),hasValidation=tt=>tt.mount&&(tt.required||tt.min||tt.max||tt.maxLength||tt.minLength||tt.pattern||tt.validate),isWatched=(tt,et,rt)=>!rt&&(et.watchAll||et.watch.has(tt)||[...et.watch].some(st=>tt.startsWith(st)&&/^\.\w+/.test(tt.slice(st.length))));const iterateFieldsByAction=(tt,et,rt,st)=>{for(const nt of rt||Object.keys(tt)){const ot=get$1(tt,nt);if(ot){const{_f:at,...lt}=ot;if(at){if(at.refs&&at.refs[0]&&et(at.refs[0],nt)&&!st)return!0;if(at.ref&&et(at.ref,at.name)&&!st)return!0;if(iterateFieldsByAction(lt,et))break}else if(isObject(lt)&&iterateFieldsByAction(lt,et))break}}};function schemaErrorLookup(tt,et,rt){const st=get$1(tt,rt);if(st||isKey(rt))return{error:st,name:rt};const nt=rt.split(".");for(;nt.length;){const ot=nt.join("."),at=get$1(et,ot),lt=get$1(tt,ot);if(at&&!Array.isArray(at)&&rt!==ot)return{name:rt};if(lt&<.type)return{name:ot,error:lt};if(lt&<.root&<.root.type)return{name:`${ot}.root`,error:lt.root};nt.pop()}return{name:rt}}var shouldRenderFormState=(tt,et,rt,st)=>{rt(tt);const{name:nt,...ot}=tt;return isEmptyObject(ot)||Object.keys(ot).length>=Object.keys(et).length||Object.keys(ot).find(at=>et[at]===(!st||VALIDATION_MODE.all))},shouldSubscribeByName=(tt,et,rt)=>!tt||!et||tt===et||convertToArrayPayload(tt).some(st=>st&&(rt?st===et:st.startsWith(et)||et.startsWith(st))),skipValidation=(tt,et,rt,st,nt)=>nt.isOnAll?!1:!rt&&nt.isOnTouch?!(et||tt):(rt?st.isOnBlur:nt.isOnBlur)?!tt:(rt?st.isOnChange:nt.isOnChange)?tt:!0,unsetEmptyArray=(tt,et)=>!compact$1(get$1(tt,et)).length&&unset(tt,et),updateFieldArrayRootError=(tt,et,rt)=>{const st=convertToArrayPayload(get$1(tt,rt));return set(st,"root",et[rt]),set(tt,rt,st),tt};function getValidateError(tt,et,rt="validate"){if(isString$1(tt)||Array.isArray(tt)&&tt.every(isString$1)||isBoolean$1(tt)&&!tt)return{type:rt,message:isString$1(tt)?tt:"",ref:et}}var getValueAndMessage=tt=>isObject(tt)&&!isRegex(tt)?tt:{value:tt,message:""},validateField=async(tt,et,rt,st,nt,ot)=>{const{ref:at,refs:lt,required:ut,maxLength:ct,minLength:dt,min:ht,max:ft,pattern:xt,validate:vt,name:yt,valueAsNumber:Et,mount:bt}=tt._f,wt=get$1(rt,yt);if(!bt||et.has(yt))return{};const St=lt?lt[0]:at,Rt=Ht=>{nt&&St.reportValidity&&(St.setCustomValidity(isBoolean$1(Ht)?"":Ht||""),St.reportValidity())},Ct={},It=isRadioInput(at),jt=isCheckBoxInput(at),Pt=It||jt,Ot=(Et||isFileInput(at))&&isUndefined(at.value)&&isUndefined(wt)||isHTMLElement(at)&&at.value===""||wt===""||Array.isArray(wt)&&!wt.length,Ut=appendErrors.bind(null,yt,st,Ct),Nt=(Ht,Lt,kt,$t=INPUT_VALIDATION_RULES.maxLength,Ft=INPUT_VALIDATION_RULES.minLength)=>{const Gt=Ht?Lt:kt;Ct[yt]={type:Ht?$t:Ft,message:Gt,ref:at,...Ut(Ht?$t:Ft,Gt)}};if(ot?!Array.isArray(wt)||!wt.length:ut&&(!Pt&&(Ot||isNullOrUndefined(wt))||isBoolean$1(wt)&&!wt||jt&&!getCheckboxValue(lt).isValid||It&&!getRadioValue(lt).isValid)){const{value:Ht,message:Lt}=isString$1(ut)?{value:!!ut,message:ut}:getValueAndMessage(ut);if(Ht&&(Ct[yt]={type:INPUT_VALIDATION_RULES.required,message:Lt,ref:St,...Ut(INPUT_VALIDATION_RULES.required,Lt)},!st))return Rt(Lt),Ct}if(!Ot&&(!isNullOrUndefined(ht)||!isNullOrUndefined(ft))){let Ht,Lt;const kt=getValueAndMessage(ft),$t=getValueAndMessage(ht);if(!isNullOrUndefined(wt)&&!isNaN(wt)){const Ft=at.valueAsNumber||wt&&+wt;isNullOrUndefined(kt.value)||(Ht=Ft>kt.value),isNullOrUndefined($t.value)||(Lt=Ft<$t.value)}else{const Ft=at.valueAsDate||new Date(wt),Gt=Bt=>new Date(new Date().toDateString()+" "+Bt),Mt=at.type=="time",Vt=at.type=="week";isString$1(kt.value)&&wt&&(Ht=Mt?Gt(wt)>Gt(kt.value):Vt?wt>kt.value:Ft>new Date(kt.value)),isString$1($t.value)&&wt&&(Lt=Mt?Gt(wt)<Gt($t.value):Vt?wt<$t.value:Ft<new Date($t.value))}if((Ht||Lt)&&(Nt(!!Ht,kt.message,$t.message,INPUT_VALIDATION_RULES.max,INPUT_VALIDATION_RULES.min),!st))return Rt(Ct[yt].message),Ct}if((ct||dt)&&!Ot&&(isString$1(wt)||ot&&Array.isArray(wt))){const Ht=getValueAndMessage(ct),Lt=getValueAndMessage(dt),kt=!isNullOrUndefined(Ht.value)&&wt.length>+Ht.value,$t=!isNullOrUndefined(Lt.value)&&wt.length<+Lt.value;if((kt||$t)&&(Nt(kt,Ht.message,Lt.message),!st))return Rt(Ct[yt].message),Ct}if(xt&&!Ot&&isString$1(wt)){const{value:Ht,message:Lt}=getValueAndMessage(xt);if(isRegex(Ht)&&!wt.match(Ht)&&(Ct[yt]={type:INPUT_VALIDATION_RULES.pattern,message:Lt,ref:at,...Ut(INPUT_VALIDATION_RULES.pattern,Lt)},!st))return Rt(Lt),Ct}if(vt){if(isFunction(vt)){const Ht=await vt(wt,rt),Lt=getValidateError(Ht,St);if(Lt&&(Ct[yt]={...Lt,...Ut(INPUT_VALIDATION_RULES.validate,Lt.message)},!st))return Rt(Lt.message),Ct}else if(isObject(vt)){let Ht={};for(const Lt in vt){if(!isEmptyObject(Ht)&&!st)break;const kt=getValidateError(await vt[Lt](wt,rt),St,Lt);kt&&(Ht={...kt,...Ut(Lt,kt.message)},Rt(kt.message),st&&(Ct[yt]=Ht))}if(!isEmptyObject(Ht)&&(Ct[yt]={ref:St,...Ht},!st))return Ct}}return Rt(!0),Ct};const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(tt={}){let et={...defaultOptions,...tt},rt={submitCount:0,isDirty:!1,isReady:!1,isLoading:isFunction(et.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:et.errors||{},disabled:et.disabled||!1},st={},nt=isObject(et.defaultValues)||isObject(et.values)?cloneObject(et.defaultValues||et.values)||{}:{},ot=et.shouldUnregister?{}:cloneObject(nt),at={action:!1,mount:!1,watch:!1},lt={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},ut,ct=0;const dt={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let ht={...dt};const ft={array:createSubject(),state:createSubject()},xt=et.criteriaMode===VALIDATION_MODE.all,vt=Xt=>er=>{clearTimeout(ct),ct=setTimeout(Xt,er)},yt=async Xt=>{if(!et.disabled&&(dt.isValid||ht.isValid||Xt)){const er=et.resolver?isEmptyObject((await jt()).errors):await Ot(st,!0);er!==rt.isValid&&ft.state.next({isValid:er})}},Et=(Xt,er)=>{!et.disabled&&(dt.isValidating||dt.validatingFields||ht.isValidating||ht.validatingFields)&&((Xt||Array.from(lt.mount)).forEach(sr=>{sr&&(er?set(rt.validatingFields,sr,er):unset(rt.validatingFields,sr))}),ft.state.next({validatingFields:rt.validatingFields,isValidating:!isEmptyObject(rt.validatingFields)}))},bt=(Xt,er=[],sr,br,gr=!0,vr=!0)=>{if(br&&sr&&!et.disabled){if(at.action=!0,vr&&Array.isArray(get$1(st,Xt))){const Tr=sr(get$1(st,Xt),br.argA,br.argB);gr&&set(st,Xt,Tr)}if(vr&&Array.isArray(get$1(rt.errors,Xt))){const Tr=sr(get$1(rt.errors,Xt),br.argA,br.argB);gr&&set(rt.errors,Xt,Tr),unsetEmptyArray(rt.errors,Xt)}if((dt.touchedFields||ht.touchedFields)&&vr&&Array.isArray(get$1(rt.touchedFields,Xt))){const Tr=sr(get$1(rt.touchedFields,Xt),br.argA,br.argB);gr&&set(rt.touchedFields,Xt,Tr)}(dt.dirtyFields||ht.dirtyFields)&&(rt.dirtyFields=getDirtyFields(nt,ot)),ft.state.next({name:Xt,isDirty:Nt(Xt,er),dirtyFields:rt.dirtyFields,errors:rt.errors,isValid:rt.isValid})}else set(ot,Xt,er)},wt=(Xt,er)=>{set(rt.errors,Xt,er),ft.state.next({errors:rt.errors})},St=Xt=>{rt.errors=Xt,ft.state.next({errors:rt.errors,isValid:!1})},Rt=(Xt,er,sr,br)=>{const gr=get$1(st,Xt);if(gr){const vr=get$1(ot,Xt,isUndefined(sr)?get$1(nt,Xt):sr);isUndefined(vr)||br&&br.defaultChecked||er?set(ot,Xt,er?vr:getFieldValue(gr._f)):kt(Xt,vr),at.mount&&yt()}},Ct=(Xt,er,sr,br,gr)=>{let vr=!1,Tr=!1;const Lr={name:Xt};if(!et.disabled){if(!sr||br){(dt.isDirty||ht.isDirty)&&(Tr=rt.isDirty,rt.isDirty=Lr.isDirty=Nt(),vr=Tr!==Lr.isDirty);const Dr=deepEqual(get$1(nt,Xt),er);Tr=!!get$1(rt.dirtyFields,Xt),Dr?unset(rt.dirtyFields,Xt):set(rt.dirtyFields,Xt,!0),Lr.dirtyFields=rt.dirtyFields,vr=vr||(dt.dirtyFields||ht.dirtyFields)&&Tr!==!Dr}if(sr){const Dr=get$1(rt.touchedFields,Xt);Dr||(set(rt.touchedFields,Xt,sr),Lr.touchedFields=rt.touchedFields,vr=vr||(dt.touchedFields||ht.touchedFields)&&Dr!==sr)}vr&&gr&&ft.state.next(Lr)}return vr?Lr:{}},It=(Xt,er,sr,br)=>{const gr=get$1(rt.errors,Xt),vr=(dt.isValid||ht.isValid)&&isBoolean$1(er)&&rt.isValid!==er;if(et.delayError&&sr?(ut=vt(()=>wt(Xt,sr)),ut(et.delayError)):(clearTimeout(ct),ut=null,sr?set(rt.errors,Xt,sr):unset(rt.errors,Xt)),(sr?!deepEqual(gr,sr):gr)||!isEmptyObject(br)||vr){const Tr={...br,...vr&&isBoolean$1(er)?{isValid:er}:{},errors:rt.errors,name:Xt};rt={...rt,...Tr},ft.state.next(Tr)}},jt=async Xt=>{Et(Xt,!0);const er=await et.resolver(ot,et.context,getResolverOptions(Xt||lt.mount,st,et.criteriaMode,et.shouldUseNativeValidation));return Et(Xt),er},Pt=async Xt=>{const{errors:er}=await jt(Xt);if(Xt)for(const sr of Xt){const br=get$1(er,sr);br?set(rt.errors,sr,br):unset(rt.errors,sr)}else rt.errors=er;return er},Ot=async(Xt,er,sr={valid:!0})=>{for(const br in Xt){const gr=Xt[br];if(gr){const{_f:vr,...Tr}=gr;if(vr){const Lr=lt.array.has(vr.name),Dr=gr._f&&hasPromiseValidation(gr._f);Dr&&dt.validatingFields&&Et([vr.name],!0);const Zr=await validateField(gr,lt.disabled,ot,xt,et.shouldUseNativeValidation&&!er,Lr);if(Dr&&dt.validatingFields&&Et([vr.name]),Zr[vr.name]&&(sr.valid=!1,er))break;!er&&(get$1(Zr,vr.name)?Lr?updateFieldArrayRootError(rt.errors,Zr,vr.name):set(rt.errors,vr.name,Zr[vr.name]):unset(rt.errors,vr.name))}!isEmptyObject(Tr)&&await Ot(Tr,er,sr)}}return sr.valid},Ut=()=>{for(const Xt of lt.unMount){const er=get$1(st,Xt);er&&(er._f.refs?er._f.refs.every(sr=>!live(sr)):!live(er._f.ref))&&mr(Xt)}lt.unMount=new Set},Nt=(Xt,er)=>!et.disabled&&(Xt&&er&&set(ot,Xt,er),!deepEqual(Bt(),nt)),Ht=(Xt,er,sr)=>generateWatchOutput(Xt,lt,{...at.mount?ot:isUndefined(er)?nt:isString$1(Xt)?{[Xt]:er}:er},sr,er),Lt=Xt=>compact$1(get$1(at.mount?ot:nt,Xt,et.shouldUnregister?get$1(nt,Xt,[]):[])),kt=(Xt,er,sr={})=>{const br=get$1(st,Xt);let gr=er;if(br){const vr=br._f;vr&&(!vr.disabled&&set(ot,Xt,getFieldValueAs(er,vr)),gr=isHTMLElement(vr.ref)&&isNullOrUndefined(er)?"":er,isMultipleSelect(vr.ref)?[...vr.ref.options].forEach(Tr=>Tr.selected=gr.includes(Tr.value)):vr.refs?isCheckBoxInput(vr.ref)?vr.refs.forEach(Tr=>{(!Tr.defaultChecked||!Tr.disabled)&&(Array.isArray(gr)?Tr.checked=!!gr.find(Lr=>Lr===Tr.value):Tr.checked=gr===Tr.value||!!gr)}):vr.refs.forEach(Tr=>Tr.checked=Tr.value===gr):isFileInput(vr.ref)?vr.ref.value="":(vr.ref.value=gr,vr.ref.type||ft.state.next({name:Xt,values:cloneObject(ot)})))}(sr.shouldDirty||sr.shouldTouch)&&Ct(Xt,gr,sr.shouldTouch,sr.shouldDirty,!0),sr.shouldValidate&&Vt(Xt)},$t=(Xt,er,sr)=>{for(const br in er){if(!er.hasOwnProperty(br))return;const gr=er[br],vr=Xt+"."+br,Tr=get$1(st,vr);(lt.array.has(Xt)||isObject(gr)||Tr&&!Tr._f)&&!isDateObject(gr)?$t(vr,gr,sr):kt(vr,gr,sr)}},Ft=(Xt,er,sr={})=>{const br=get$1(st,Xt),gr=lt.array.has(Xt),vr=cloneObject(er);set(ot,Xt,vr),gr?(ft.array.next({name:Xt,values:cloneObject(ot)}),(dt.isDirty||dt.dirtyFields||ht.isDirty||ht.dirtyFields)&&sr.shouldDirty&&ft.state.next({name:Xt,dirtyFields:getDirtyFields(nt,ot),isDirty:Nt(Xt,vr)})):br&&!br._f&&!isNullOrUndefined(vr)?$t(Xt,vr,sr):kt(Xt,vr,sr),isWatched(Xt,lt)&&ft.state.next({...rt,name:Xt}),ft.state.next({name:at.mount?Xt:void 0,values:cloneObject(ot)})},Gt=async Xt=>{at.mount=!0;const er=Xt.target;let sr=er.name,br=!0;const gr=get$1(st,sr),vr=Dr=>{br=Number.isNaN(Dr)||isDateObject(Dr)&&isNaN(Dr.getTime())||deepEqual(Dr,get$1(ot,sr,Dr))},Tr=getValidationModes(et.mode),Lr=getValidationModes(et.reValidateMode);if(gr){let Dr,Zr;const ks=er.type?getFieldValue(gr._f):getEventValue(Xt),Ir=Xt.type===EVENTS.BLUR||Xt.type===EVENTS.FOCUS_OUT,Br=!hasValidation(gr._f)&&!et.resolver&&!get$1(rt.errors,sr)&&!gr._f.deps||skipValidation(Ir,get$1(rt.touchedFields,sr),rt.isSubmitted,Lr,Tr),kr=isWatched(sr,lt,Ir);set(ot,sr,ks),Ir?(!er||!er.readOnly)&&(gr._f.onBlur&&gr._f.onBlur(Xt),ut&&ut(0)):gr._f.onChange&&gr._f.onChange(Xt);const Wr=Ct(sr,ks,Ir),bs=!isEmptyObject(Wr)||kr;if(!Ir&&ft.state.next({name:sr,type:Xt.type,values:cloneObject(ot)}),Br)return(dt.isValid||ht.isValid)&&(et.mode==="onBlur"?Ir&&yt():Ir||yt()),bs&&ft.state.next({name:sr,...kr?{}:Wr});if(!Ir&&kr&&ft.state.next({...rt}),et.resolver){const{errors:ps}=await jt([sr]);if(vr(ks),br){const zr=schemaErrorLookup(rt.errors,st,sr),$r=schemaErrorLookup(ps,st,zr.name||sr);Dr=$r.error,sr=$r.name,Zr=isEmptyObject(ps)}}else Et([sr],!0),Dr=(await validateField(gr,lt.disabled,ot,xt,et.shouldUseNativeValidation))[sr],Et([sr]),vr(ks),br&&(Dr?Zr=!1:(dt.isValid||ht.isValid)&&(Zr=await Ot(st,!0)));br&&(gr._f.deps&&(!Array.isArray(gr._f.deps)||gr._f.deps.length>0)&&Vt(gr._f.deps),It(sr,Zr,Dr,Wr))}},Mt=(Xt,er)=>{if(get$1(rt.errors,er)&&Xt.focus)return Xt.focus(),1},Vt=async(Xt,er={})=>{let sr,br;const gr=convertToArrayPayload(Xt);if(et.resolver){const vr=await Pt(isUndefined(Xt)?Xt:gr);sr=isEmptyObject(vr),br=Xt?!gr.some(Tr=>get$1(vr,Tr)):sr}else Xt?(br=(await Promise.all(gr.map(async vr=>{const Tr=get$1(st,vr);return await Ot(Tr&&Tr._f?{[vr]:Tr}:Tr)}))).every(Boolean),!(!br&&!rt.isValid)&&yt()):br=sr=await Ot(st);return ft.state.next({...!isString$1(Xt)||(dt.isValid||ht.isValid)&&sr!==rt.isValid?{}:{name:Xt},...et.resolver||!Xt?{isValid:sr}:{},errors:rt.errors}),er.shouldFocus&&!br&&iterateFieldsByAction(st,Mt,Xt?gr:lt.mount),br},Bt=(Xt,er)=>{let sr={...at.mount?ot:nt};return er&&(sr=extractFormValues(er.dirtyFields?rt.dirtyFields:rt.touchedFields,sr)),isUndefined(Xt)?sr:isString$1(Xt)?get$1(sr,Xt):Xt.map(br=>get$1(sr,br))},qt=(Xt,er)=>({invalid:!!get$1((er||rt).errors,Xt),isDirty:!!get$1((er||rt).dirtyFields,Xt),error:get$1((er||rt).errors,Xt),isValidating:!!get$1(rt.validatingFields,Xt),isTouched:!!get$1((er||rt).touchedFields,Xt)}),Qt=Xt=>{Xt&&convertToArrayPayload(Xt).forEach(er=>unset(rt.errors,er)),ft.state.next({errors:Xt?rt.errors:{}})},Yt=(Xt,er,sr)=>{const br=(get$1(st,Xt,{_f:{}})._f||{}).ref,gr=get$1(rt.errors,Xt)||{},{ref:vr,message:Tr,type:Lr,...Dr}=gr;set(rt.errors,Xt,{...Dr,...er,ref:br}),ft.state.next({name:Xt,errors:rt.errors,isValid:!1}),sr&&sr.shouldFocus&&br&&br.focus&&br.focus()},tr=(Xt,er)=>isFunction(Xt)?ft.state.subscribe({next:sr=>"values"in sr&&Xt(Ht(void 0,er),sr)}):Ht(Xt,er,!0),lr=Xt=>ft.state.subscribe({next:er=>{shouldSubscribeByName(Xt.name,er.name,Xt.exact)&&shouldRenderFormState(er,Xt.formState||dt,Gs,Xt.reRenderRoot)&&Xt.callback({values:{...ot},...rt,...er,defaultValues:nt})}}).unsubscribe,ur=Xt=>(at.mount=!0,ht={...ht,...Xt.formState},lr({...Xt,formState:ht})),mr=(Xt,er={})=>{for(const sr of Xt?convertToArrayPayload(Xt):lt.mount)lt.mount.delete(sr),lt.array.delete(sr),er.keepValue||(unset(st,sr),unset(ot,sr)),!er.keepError&&unset(rt.errors,sr),!er.keepDirty&&unset(rt.dirtyFields,sr),!er.keepTouched&&unset(rt.touchedFields,sr),!er.keepIsValidating&&unset(rt.validatingFields,sr),!et.shouldUnregister&&!er.keepDefaultValue&&unset(nt,sr);ft.state.next({values:cloneObject(ot)}),ft.state.next({...rt,...er.keepDirty?{isDirty:Nt()}:{}}),!er.keepIsValid&&yt()},yr=({disabled:Xt,name:er})=>{(isBoolean$1(Xt)&&at.mount||Xt||lt.disabled.has(er))&&(Xt?lt.disabled.add(er):lt.disabled.delete(er))},or=(Xt,er={})=>{let sr=get$1(st,Xt);const br=isBoolean$1(er.disabled)||isBoolean$1(et.disabled);return set(st,Xt,{...sr||{},_f:{...sr&&sr._f?sr._f:{ref:{name:Xt}},name:Xt,mount:!0,...er}}),lt.mount.add(Xt),sr?yr({disabled:isBoolean$1(er.disabled)?er.disabled:et.disabled,name:Xt}):Rt(Xt,!0,er.value),{...br?{disabled:er.disabled||et.disabled}:{},...et.progressive?{required:!!er.required,min:getRuleValue(er.min),max:getRuleValue(er.max),minLength:getRuleValue(er.minLength),maxLength:getRuleValue(er.maxLength),pattern:getRuleValue(er.pattern)}:{},name:Xt,onChange:Gt,onBlur:Gt,ref:gr=>{if(gr){or(Xt,er),sr=get$1(st,Xt);const vr=isUndefined(gr.value)&&gr.querySelectorAll&&gr.querySelectorAll("input,select,textarea")[0]||gr,Tr=isRadioOrCheckbox(vr),Lr=sr._f.refs||[];if(Tr?Lr.find(Dr=>Dr===vr):vr===sr._f.ref)return;set(st,Xt,{_f:{...sr._f,...Tr?{refs:[...Lr.filter(live),vr,...Array.isArray(get$1(nt,Xt))?[{}]:[]],ref:{type:vr.type,name:Xt}}:{ref:vr}}}),Rt(Xt,!1,void 0,vr)}else sr=get$1(st,Xt,{}),sr._f&&(sr._f.mount=!1),(et.shouldUnregister||er.shouldUnregister)&&!(isNameInFieldArray(lt.array,Xt)&&at.action)&<.unMount.add(Xt)}}},hr=()=>et.shouldFocusError&&iterateFieldsByAction(st,Mt,lt.mount),pr=Xt=>{isBoolean$1(Xt)&&(ft.state.next({disabled:Xt}),iterateFieldsByAction(st,(er,sr)=>{const br=get$1(st,sr);br&&(er.disabled=br._f.disabled||Xt,Array.isArray(br._f.refs)&&br._f.refs.forEach(gr=>{gr.disabled=br._f.disabled||Xt}))},0,!1))},_r=(Xt,er)=>async sr=>{let br;sr&&(sr.preventDefault&&sr.preventDefault(),sr.persist&&sr.persist());let gr=cloneObject(ot);if(ft.state.next({isSubmitting:!0}),et.resolver){const{errors:vr,values:Tr}=await jt();rt.errors=vr,gr=cloneObject(Tr)}else await Ot(st);if(lt.disabled.size)for(const vr of lt.disabled)unset(gr,vr);if(unset(rt.errors,"root"),isEmptyObject(rt.errors)){ft.state.next({errors:{}});try{await Xt(gr,sr)}catch(vr){br=vr}}else er&&await er({...rt.errors},sr),hr(),setTimeout(hr);if(ft.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(rt.errors)&&!br,submitCount:rt.submitCount+1,errors:rt.errors}),br)throw br},Ar=(Xt,er={})=>{get$1(st,Xt)&&(isUndefined(er.defaultValue)?Ft(Xt,cloneObject(get$1(nt,Xt))):(Ft(Xt,er.defaultValue),set(nt,Xt,cloneObject(er.defaultValue))),er.keepTouched||unset(rt.touchedFields,Xt),er.keepDirty||(unset(rt.dirtyFields,Xt),rt.isDirty=er.defaultValue?Nt(Xt,cloneObject(get$1(nt,Xt))):Nt()),er.keepError||(unset(rt.errors,Xt),dt.isValid&&yt()),ft.state.next({...rt}))},Hr=(Xt,er={})=>{const sr=Xt?cloneObject(Xt):nt,br=cloneObject(sr),gr=isEmptyObject(Xt),vr=gr?nt:br;if(er.keepDefaultValues||(nt=sr),!er.keepValues){if(er.keepDirtyValues){const Tr=new Set([...lt.mount,...Object.keys(getDirtyFields(nt,ot))]);for(const Lr of Array.from(Tr))get$1(rt.dirtyFields,Lr)?set(vr,Lr,get$1(ot,Lr)):Ft(Lr,get$1(vr,Lr))}else{if(isWeb&&isUndefined(Xt))for(const Tr of lt.mount){const Lr=get$1(st,Tr);if(Lr&&Lr._f){const Dr=Array.isArray(Lr._f.refs)?Lr._f.refs[0]:Lr._f.ref;if(isHTMLElement(Dr)){const Zr=Dr.closest("form");if(Zr){Zr.reset();break}}}}if(er.keepFieldsRef)for(const Tr of lt.mount)Ft(Tr,get$1(vr,Tr));else st={}}ot=et.shouldUnregister?er.keepDefaultValues?cloneObject(nt):{}:cloneObject(vr),ft.array.next({values:{...vr}}),ft.state.next({values:{...vr}})}lt={mount:er.keepDirtyValues?lt.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},at.mount=!dt.isValid||!!er.keepIsValid||!!er.keepDirtyValues,at.watch=!!et.shouldUnregister,ft.state.next({submitCount:er.keepSubmitCount?rt.submitCount:0,isDirty:gr?!1:er.keepDirty?rt.isDirty:!!(er.keepDefaultValues&&!deepEqual(Xt,nt)),isSubmitted:er.keepIsSubmitted?rt.isSubmitted:!1,dirtyFields:gr?{}:er.keepDirtyValues?er.keepDefaultValues&&ot?getDirtyFields(nt,ot):rt.dirtyFields:er.keepDefaultValues&&Xt?getDirtyFields(nt,Xt):er.keepDirty?rt.dirtyFields:{},touchedFields:er.keepTouched?rt.touchedFields:{},errors:er.keepErrors?rt.errors:{},isSubmitSuccessful:er.keepIsSubmitSuccessful?rt.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:nt})},Ur=(Xt,er)=>Hr(isFunction(Xt)?Xt(ot):Xt,er),os=(Xt,er={})=>{const sr=get$1(st,Xt),br=sr&&sr._f;if(br){const gr=br.refs?br.refs[0]:br.ref;gr.focus&&(gr.focus(),er.shouldSelect&&isFunction(gr.select)&&gr.select())}},Gs=Xt=>{rt={...rt,...Xt}},Ws={control:{register:or,unregister:mr,getFieldState:qt,handleSubmit:_r,setError:Yt,_subscribe:lr,_runSchema:jt,_focusError:hr,_getWatch:Ht,_getDirty:Nt,_setValid:yt,_setFieldArray:bt,_setDisabledField:yr,_setErrors:St,_getFieldArray:Lt,_reset:Hr,_resetDefaultValues:()=>isFunction(et.defaultValues)&&et.defaultValues().then(Xt=>{Ur(Xt,et.resetOptions),ft.state.next({isLoading:!1})}),_removeUnmounted:Ut,_disableForm:pr,_subjects:ft,_proxyFormState:dt,get _fields(){return st},get _formValues(){return ot},get _state(){return at},set _state(Xt){at=Xt},get _defaultValues(){return nt},get _names(){return lt},set _names(Xt){lt=Xt},get _formState(){return rt},get _options(){return et},set _options(Xt){et={...et,...Xt}}},subscribe:ur,trigger:Vt,register:or,handleSubmit:_r,watch:tr,setValue:Ft,getValues:Bt,reset:Ur,resetField:Ar,clearErrors:Qt,unregister:mr,setError:Yt,setFocus:os,getFieldState:qt};return{...Ws,formControl:Ws}}function useForm(tt={}){const et=React$4.useRef(void 0),rt=React$4.useRef(void 0),[st,nt]=React$4.useState({isDirty:!1,isValidating:!1,isLoading:isFunction(tt.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:tt.errors||{},disabled:tt.disabled||!1,isReady:!1,defaultValues:isFunction(tt.defaultValues)?void 0:tt.defaultValues});if(!et.current)if(tt.formControl)et.current={...tt.formControl,formState:st},tt.defaultValues&&!isFunction(tt.defaultValues)&&tt.formControl.reset(tt.defaultValues,tt.resetOptions);else{const{formControl:at,...lt}=createFormControl(tt);et.current={...lt,formState:st}}const ot=et.current.control;return ot._options=tt,useIsomorphicLayoutEffect(()=>{const at=ot._subscribe({formState:ot._proxyFormState,callback:()=>nt({...ot._formState}),reRenderRoot:!0});return nt(lt=>({...lt,isReady:!0})),ot._formState.isReady=!0,at},[ot]),React$4.useEffect(()=>ot._disableForm(tt.disabled),[ot,tt.disabled]),React$4.useEffect(()=>{tt.mode&&(ot._options.mode=tt.mode),tt.reValidateMode&&(ot._options.reValidateMode=tt.reValidateMode)},[ot,tt.mode,tt.reValidateMode]),React$4.useEffect(()=>{tt.errors&&(ot._setErrors(tt.errors),ot._focusError())},[ot,tt.errors]),React$4.useEffect(()=>{tt.shouldUnregister&&ot._subjects.state.next({values:ot._getWatch()})},[ot,tt.shouldUnregister]),React$4.useEffect(()=>{if(ot._proxyFormState.isDirty){const at=ot._getDirty();at!==st.isDirty&&ot._subjects.state.next({isDirty:at})}},[ot,st.isDirty]),React$4.useEffect(()=>{tt.values&&!deepEqual(tt.values,rt.current)?(ot._reset(tt.values,{keepFieldsRef:!0,...ot._options.resetOptions}),rt.current=tt.values,nt(at=>({...at}))):ot._resetDefaultValues()},[ot,tt.values]),React$4.useEffect(()=>{ot._state.mount||(ot._setValid(),ot._state.mount=!0),ot._state.watch&&(ot._state.watch=!1,ot._subjects.state.next({...ot._formState})),ot._removeUnmounted()}),et.current.formState=getProxyFormState(st,ot),et.current}const useActivitiesOptions=()=>{const{t:tt}=useTranslation();return[{value:"bpr.activityType.classroomActivity",label:tt("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:tt("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:tt("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:tt("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:tt("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:tt("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:tt("bpr.activityType.courseElement")},{value:"bpr.other",label:tt("bpr.other")}]},ActivitiesDropdown=({control:tt,selectedActivities:et,selectActivities:rt})=>{const st=useActivitiesOptions(),{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"col d-flex",children:jsxRuntimeExports.jsx(Controller,{name:"activityType",control:tt,rules:{required:!0},render:({field:{onChange:ot}})=>jsxRuntimeExports.jsxs(Dropdown,{block:!0,overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"md",label:nt("bpr.form.publication.type"),badgeContent:et==null?void 0:et.length}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:st.map((at,lt)=>jsxRuntimeExports.jsx(Dropdown.CheckboxItem,{value:at.value,model:et,onChange:()=>{rt(at.value),ot(at.value)},children:at.label},lt))})]})})})},ageOptions=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],AgeSelect=({name:tt,control:et,placeholderOption:rt,validate:st})=>jsxRuntimeExports.jsx(Controller,{name:tt,control:et,rules:{required:!0,validate:st},render:({field:{onChange:nt}})=>jsxRuntimeExports.jsx(Select,{block:!0,size:"md",onValueChange:nt,options:ageOptions,"aria-required":!0,placeholderOption:rt})}),useLanguageOptions=()=>{const{t:tt}=useTranslation();return[{value:"de_DE",label:tt("de_DE")},{value:"en_EN",label:tt("en_EN")},{value:"ar_DZ",label:tt("ar_DZ")},{value:"es_ES",label:tt("es_ES")},{value:"fr_FR",label:tt("fr_FR")},{value:"it_IT",label:tt("it_IT")},{value:"ja_JP",label:tt("ja_JP")},{value:"zh_CN",label:tt("zh_CN")},{value:"pt_PT",label:tt("pt_PT")},{value:"ru_RU",label:tt("ru_RU")},{value:"bpr.other",label:tt("bpr.other")}]},defaultSelectLanguageOption="bpr.form.publication.language",LangSelect=({control:tt})=>{const et=useLanguageOptions();return jsxRuntimeExports.jsx("div",{className:"col",children:jsxRuntimeExports.jsx(Controller,{name:"language",control:tt,rules:{required:!0},render:({field:{onChange:rt}})=>jsxRuntimeExports.jsx(Select,{block:!0,size:"md",onValueChange:rt,options:et,"aria-required":!0,placeholderOption:defaultSelectLanguageOption})})})},creativeCommons="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAYCAYAAACsnTAAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAubSURBVHgB7Vh3UNVnFj2P/kAQURGNsa2GKKIOCjGzIEUhqElsY40m9lgiGksmWUfjTNZel8ggblSIxjUxujbEiiiwoiiixoqVJtKkCQg82O9c9r0AeaiTP3ZmZ3NnmAHed9/v+84999zz/TRvvvnmlo6dO04xMTExw/95VLyoyEm6lDRW4+XjpZszP8gE/4XQ6XQoeFYAXbVO/m7atCksLS1fK7eqqgqFhYXyHaYmprCzs4O5hflr5VZUVKCosAjVNdUw0ZjArqkdLCwsjO7voxHjtpsphpigpgbQaIwuys3JxS/J13H9+i/qQM/k/81bNEdXl27o5dZLftcYya0bZWVluJ58DSeOnUBxYTHMzMxlg9bWWri/4wHfAb6wtLJsNPda8lVEHY5C6fMymJubyyFtmlgjcHAg3Pr0hoWlhdHc8vJynI8/j7iYWJSXlssZK6sqpBg+/X3k2XVzeY7q6moTMw00RgEpLi7GrohduBCfoDZTClNTU3To0EEqdvvmbcSqB9k3s4enjxfGfDTGKPKyMXWoiL+Hq4Ndw7Rp0zBgwAA0a9YMz58/R0JCAtavX4/LiZcQtGAubO1s6+WWqD2EBociMz0T8+bNg4eHhzCkqKgIZ8+exYYNGxB7NhYzg2ahSZMm9XLJqg2r1uNZ3jMsWrQI7u7usLW1RUFBAY4fP46wsDBcTbqK6Z99qopkZgCFYVJj5CCpjx5j9TerEBt9Dp5/9sShQ4cEpHv37uHRo0dyoH379sG1uyuO/PMwVny9XOhpLMK/i0Budi4OHjyIFStWoHPnzti6dStatmyJhQsXIjExEVYWVli/cp0CsNyQR4YQEF2lDjExMbK2X79+yMrKgpubG5YsWSK5leWVCAvZgsrKSkMuW/Tb9cFwsHfAjRs3MH/+fHh6eqJHjx7w8fHBypUrER0djccPH2NrSJgwr26YoAFJnpeUIGRTCDLSMrBlyxYcOHAAH3zwAbRarWGNlZUVhg8fjmPHjmHVqlXIzMjExjUbUKiqUDcSExJx6UIiQkJC8O6778r/0tPTcebMGQGY0bZtW+zatQu6Kp2wTx8xp84oBl3G4sWL0aZNG2nlU6dOYe7cuYiKikJOTo4AvGPHDuRk5SL+XLwhN/5cHFAN7N69W1jJ9X379kWnTp0EWD7f1dUVP/74I5IvJyPlTkoDUOpQpUZpS/h34cjLzcOaNWswefLkemA0DGtra3z++eey8ZS7KTh+9IThM7bZ8aPHMHToUKkSqUnqEgACQebcvn1b1vJwZALXcw9lpWWiBS1atMCcOXMwduxYqfaHH34oB1u+fDlu3rwpub169cJH48bhRNQJ6oGwLfpktKxv166dMGXKlCmyV7bvixcvMGbMGFy+fFlaaurUqTgeeaw+KHWJ8uDefanW4MGDBZBXCSiDWsKNe/fzxsF9B5CV+UT+Tx3KSM/AyJEjDWtJ/dDQUJw+fRo7d+6UVtQHaZ39NBs52Tl4pgSdwOzdu1d6v0Sxd/PmzTKpRo8eLXri5eVlyCVYZHhxUTGys7NhrbWWAzOCg4ORl5cne2Txtm3bJsCQYQxvb29kPckSDTKAoicKUT594rSIDpPZIlTvPXv2yN/ff/+9bI4MOHr0KJYuXSobZTtws+xxUjzubJzh+9gSZMHrBIXS3t5etKFCbZoMZtu8//77AiL1IzAwUJhJdvCwmZmZkss9c0xT96h3LCaZwfj4448xadIkAZ1B9pH9+oI4OjrKEFEe5VdQZByrHwLwWAkse00/ZUi76dOnq3F83QDCunXrMGHCBCQnJ4vmfPXVVyKKzs7OUEYQ9xXbKitqRc/UzBSpqamGh3EU8mCMrl27omPHjobPSktLZaqQeZaqIHQKBXU0qmfPnti4caOA4+DgIBOFgsu2416ojQRWq7WSFtQLL5/JXD3rWVjut1WrVvJ3fn6+nJXAMk9A1j9Ub6ycuzgLchQyiiwrRUF68OCBbMbFxUUqRWqnpaX9ZyNaUXAnJycUFBUoL1Ap8/+Ntm+IdgQEBMgzWrduLfSnQJO2BFIfnAZkJ30P6W1hZSEA9OnTR1jH0c2Jx5wnT57gk08+EfHmWOY0c3RyrDVl6rlFJUUy7rt06SJF+eKLL3D37l0MGzYMmzZtkvONUzrEOHfuHJo5NENT+6a/MkUQpGlRoFTrqgUx/vCQ/CGFGRQ40pvVJAXZMmwNAsGgqeKhXpTXUp/09fb1xk8//YRbt27hZZGRkSHa4R/oLwwhyN5+PiL2rCT/R7FlG3A8L1u2TD4jkwk6/Yd/YICs43M9+npg7dq1yM3Nhb+/P4KCgoTVLAQnD/PZTpyA1Dg/fz/J/Y1PMVOHamLXRASHleIoI8VPnjwpFZoxY4agTLQpdJwirMDMmTOFjmw/boKGjgAxvHz7oVOXP8nmySoGgSXT9GDy0F9++SUKiwoRMOg9A1Ce/TyhtdFiyJAhAhpbk3uYNWuWVJmspZ4RKIcWDnBzdzPkDhk+FCXPSzB79mwpIqcV2cXicB8U3ZSUFAGa+3Nz712vSKYdOrRf5tHXXZC6oaw8NYGL2XO9e/fG+fPnBRj9SKMjvXPnjrTW06dPpQqk6cOHD7F69Wq49OiOPu/0MTzgbZe3kaTGX/DfggUssovA8pAUUOpTxpMMzJgzE46tHA15ZuZm6K02Gxsbh3/8sBu1t5EamSo8IKcXXW6VrgrTZk8XM6gPtpBzN2ccPRKFiPAIKQTZb2NjI0By8rCgNrY2mDl3lkGU+f0/7/k5WaMoXjN73mxpIRqm0G9D5XAUMgYZwBHZvHlzg5WnMLHC+gsdRY3rORG+/uvX6ObqUg95jueLCRcReShSOdQqsfNyQVNa4ePvi/4B/cW+GwtWOl5NtDNqb3yOnW2tzTc1N4Vvfz+hvtbauJfKz8tHgvI79DCcTgSF4k0GvjcoEJ7envWuJ9zPmKGjwzU+fj41swgKasV28aK/ID83H3FxcSKqrxN0mqx4y1YtseSbpY2u4/dnqSpXVlDtTeHUprXh3vGqoL7Rx1QpUCmUTm2cDG36ylw1bulfmMubtVNrJ/mOhkGmjB4yKtyMc/3h/YcyPrl44tRJWLtyjThRili3bt1e+sCkpCQxejzw+InjhVlPs54K6i+LSsW2tNQ0/J5gy6SnpeP3BMFNfZxq9DP9SNYotGuInij8+LEYoCbA2egY7I7YLa1BpR40aJBYc65hEAAKFo0dL1ca5Ys//WyGaECEuibEqPz/1VCtHs4ZZLj90HMELZyLHr16qNcDt7AtbBuys7JlHFNM9eOZs//atWti29u1b4dJn07GW85vCRhbN4cJaHWDk4KiTcrSL1A/KMwcge3btxdz2BizWAyOeq7nd9CocXoxj1OQbdFYMM/X11d+56WQRfXz8xNv0vBmXCfC2VjL9H9xYXJSsjhN156uIkQEghtKOJ+Aixcv4tKlS8IS567OGDZyGMZPmiDKH6WUfteOnfWu8Pqg4aKv4NQis2gM2XLcICl75cqVxjYot3Hesukv6GiZS/2ipeeo379/f6O5vOzxMspJR0Dorw4fPixg1nXaDSL5NyrHS9W6lWsxcuwoBAwMEK/BHwZf+vCtmZWy0vooLChE5MEjOKJ+OJUaC7Zi9+7dBVD6HmoW/dD27dvxquA9hXceBl0sc+Lj42Usvyyod3ztwQshR/GCBQvEAY8aNUry9RrSMIxKPzf7g3rrFn3ytALEC93VfYg2mKNPpz7ja8kc9ZoyUY3ZhH9dMLymfFmw1SIjI2s1SLUNPcqz18hjcLrxBRFtAa8brD4vcjzwxIkTG83j3YgFYAuSNWw7ehbm8sqhv1A2jHqa0liwyvQWWnUl11VXoUy9K6VXaKgdjQU1ZeDAgQZ/QzPIDdIz1H19YCzILgafxxdFvKGPGDFCWoKu+mX5fJ/C1wrUFl4POP55J2Lb0t3SBBoJJbQaTanikRZ/hITSntB/Awop/YGn+Be4AAAAAElFTkSuQmCC",PublishModalFooter=()=>{const{t:tt}=useTranslation();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("ul",{className:"mb-12",children:[jsxRuntimeExports.jsxs("li",{children:[tt("bpr.form.publication.licence.text.1"),jsxRuntimeExports.jsx("img",{className:"ms-8 d-inline-block",src:creativeCommons,alt:"licence creative commons"})]}),jsxRuntimeExports.jsx("li",{children:tt("bpr.form.publication.licence.text.2")})]}),jsxRuntimeExports.jsx(Alert,{type:"info",className:"mb-12",children:tt("bpr.form.publication.licence.text.3")}),jsxRuntimeExports.jsx(Alert,{type:"warning",children:tt("bpr.form.publication.licence.text.4")})]})},useSubjectsOptions=()=>{const{t:tt}=useTranslation();return[{value:"bpr.subjectArea.artActivity",label:tt("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:tt("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:tt("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:tt("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:tt("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:tt("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:tt("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:tt("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:tt("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:tt("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:tt("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:tt("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:tt("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:tt("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:tt("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:tt("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:tt("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:tt("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:tt("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:tt("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:tt("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:tt("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:tt("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:tt("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:tt("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:tt("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:tt("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:tt("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:tt("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:tt("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:tt("bpr.subjectArea.technology")},{value:"bpr.subjectArea.Arabic",label:tt("bpr.subjectArea.Arabic")},{value:"bpr.subjectArea.Chinese",label:tt("bpr.subjectArea.Chinese")},{value:"bpr.subjectArea.NaturalSciences",label:tt("bpr.subjectArea.NaturalSciences")},{value:"bpr.subjectArea.SocioEmotionalEducation",label:tt("bpr.subjectArea.SocioEmotionalEducation")},{value:"bpr.other",label:tt("bpr.other")}]},SubjectsDropdown=({control:tt,selectedSubjectAreas:et,selectSubjects:rt})=>{const st=useSubjectsOptions(),{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"col d-flex",children:jsxRuntimeExports.jsx(Controller,{name:"subjectArea",control:tt,rules:{required:!0},render:({field:{onChange:ot}})=>jsxRuntimeExports.jsxs(Dropdown,{block:!0,overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"md",label:nt("bpr.form.publication.discipline"),badgeContent:et==null?void 0:et.length}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:st.map((at,lt)=>jsxRuntimeExports.jsx(Dropdown.CheckboxItem,{value:at.value,model:et,onChange:()=>{rt(at.value),ot(at.value)},children:at.label},lt))})]})})})};function ToastError({formData:tt,errorMessage:et}){const{t:rt}=useTranslation(),st=nt=>nt==null?void 0:nt.match(/^\s/);return et==="CONTENT_TOO_LARGE"?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:rt("bpr.form.publication.response.error.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.error.content_too_large")})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:rt("bpr.form.publication.response.error.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.error.content")})}),jsxRuntimeExports.jsxs("ul",{children:[st(tt==null?void 0:tt.title)&&jsxRuntimeExports.jsx("li",{className:"pt-2 pb-2",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.empty.title")})}),st(tt==null?void 0:tt.description)&&jsxRuntimeExports.jsx("li",{className:"pt-2 pb-2",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.empty.description")})})]})]})}function ToastSuccess({result:tt}){const{t:et}=useTranslation();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:et("bpr.form.publication.response.success.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24",children:et("bpr.form.publication.response.success.content.1")}),jsxRuntimeExports.jsx("p",{className:"pt-24",children:et("bpr.form.publication.response.success.content.2")}),tt.details.front_url&&jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("a",{className:"button right-magnet",href:tt.details.front_url,target:"_blank",rel:"noreferrer",children:et("bpr.form.publication.response.success.button")})})]})}function usePublishModal({onSuccess:tt,resource:et}){const{user:rt,appCode:st}=useEdificeClient(),nt=useToast(),[ot,at]=reactExports.useState((et==null?void 0:et.thumbnail)||"");reactExports.useEffect(()=>{at(et==null?void 0:et.thumbnail)},[et]);const{control:lt,register:ut,watch:ct,setValue:dt,handleSubmit:ht,formState:{errors:ft,isSubmitting:xt,isDirty:vt,isValid:yt}}=useForm({mode:"onChange"}),[Et,bt]=reactExports.useState([]),[wt,St]=reactExports.useState([]),Rt=(Ct,It,jt)=>{let Pt=[...It];const Ot=Pt.findIndex(Ut=>Ut===Ct);It.includes(Ct)?Pt=It.filter((Ut,Nt)=>Nt!==Ot):Pt=[...It,Ct],jt(Pt)};return{control:lt,cover:ot,formState:{errors:ft,isSubmitting:xt,isDirty:vt,isValid:yt},handleDeleteImage:()=>at(""),handlePublish:async Ct=>{const It=rt?rt==null?void 0:rt.userId:"";try{let jt=new Blob;typeof ot=="string"?jt=await odeServices.http().get(ot,{responseType:"blob"}):ot?jt=await odeServices.http().get(URL.createObjectURL(ot),{responseType:"blob"}):et!=null&&et.thumbnail&&(jt=await odeServices.http().get(et==null?void 0:et.thumbnail,{responseType:"blob"}));const Pt=await odeServices.http().get(`/userbook/avatar/${It}?thumbnail=48x48`,{responseType:"blob"}),Ot=await odeServices.http().get(`/directory/user/${It}/attachment-school`,{responseType:"json"}),Ut=e$3[st],Nt={activityType:Et,age:[Ct.ageMin,Ct.ageMax],application:Ut,cover:jt,description:Ct.description,keyWords:Ct.keyWords,language:Ct.language,licence:"CC-BY",resourceId:et==null?void 0:et.assetId,resourceEntId:et==null?void 0:et.assetId,subjectArea:wt,teacherAvatar:Pt,title:Ct.title,userId:It,userStructureName:Ot.name||(rt==null?void 0:rt.structureNames[0])},Ht=await odeServices.resource(st).publish(Nt);Ht.success?nt.success(jsxRuntimeExports.jsx(ToastSuccess,{result:Ht}),{duration:1e4}):Ht.message==="CONTENT_TOO_LARGE"?nt.error(jsxRuntimeExports.jsx(ToastError,{errorMessage:Ht.message})):nt.error(jsxRuntimeExports.jsx(ToastError,{formData:Ct})),tt==null||tt()}catch(jt){console.error(jt),nt.error(jsxRuntimeExports.jsx(ToastError,{formData:Ct}))}},handleSubmit:ht,handleUploadImage:Ct=>at(Ct),register:ut,selectActivities:Ct=>{Rt(Ct,Et,bt)},selectedActivities:Et,selectedSubjectAreas:wt,selectSubjects:Ct=>{Rt(Ct,wt,St)},setValue:dt,watch:ct}}const SvgIconDelete=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.461 3.689a.96.96 0 0 1 .675-.28h3.819a.955.955 0 0 1 .954.955v.954H9.182v-.954c0-.254.1-.496.28-.675m7.357.675v.954h3.818a.955.955 0 0 1 0 1.91h-.954v12.408a2.864 2.864 0 0 1-2.864 2.864H7.273a2.864 2.864 0 0 1-2.864-2.864V7.227h-.954a.955.955 0 1 1 0-1.909h3.818v-.954A2.864 2.864 0 0 1 10.136 1.5h3.819a2.864 2.864 0 0 1 2.863 2.864m-10.5 2.863v12.41a.954.954 0 0 0 .955.954h9.545a.955.955 0 0 0 .955-.955V7.227zm3.818 2.864c.528 0 .955.427.955.955v5.727a.955.955 0 1 1-1.91 0v-5.727c0-.528.428-.955.955-.955m4.773 6.682v-5.727a.955.955 0 0 0-1.909 0v5.727a.955.955 0 1 0 1.91 0",clipRule:"evenodd"})]}),SvgIconEdit=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.879 3.879A3 3 0 0 1 4 3h7a1 1 0 1 1 0 2H4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7a1 1 0 1 1 2 0v7a3 3 0 0 1-3 3H4a3 3 0 0 1-3-3V6a3 3 0 0 1 .879-2.121",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 2.879c-.297 0-.583.118-.793.328l-9.304 9.304-.529 2.115 2.115-.529 9.304-9.304A1.121 1.121 0 0 0 20 2.879m-2.207-1.086a3.121 3.121 0 0 1 4.414 4.414l-9.5 9.5a1 1 0 0 1-.464.263l-4 1a1 1 0 0 1-1.213-1.212l1-4a1 1 0 0 1 .263-.465z",clipRule:"evenodd"})]}),ImagePicker=({addButtonLabel:tt="Add image",deleteButtonLabel:et="Delete image",src:rt,className:st,mediaLibraryRef:nt,libraryMedia:ot,app:at,onUploadImage:lt,onDeleteImage:ut})=>{const[ct,dt]=reactExports.useState(rt||"");reactExports.useEffect(()=>{ot&&(dt(ot),lt(ot))},[ot]);const ht=()=>{var vt;(vt=nt.current)==null||vt.show("image")},ft=()=>{dt(""),ut()},xt=clsx("image-input",st);return jsxRuntimeExports.jsxs("div",{id:"image-input",className:xt,children:[jsxRuntimeExports.jsxs("div",{className:"image-input-actions gap-8",children:[jsxRuntimeExports.jsx(IconButton,{"aria-label":tt,color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconEdit,{}),onClick:ht,type:"button",variant:"ghost"}),jsxRuntimeExports.jsx(IconButton,{"aria-label":et,color:"danger",disabled:!ct,icon:jsxRuntimeExports.jsx(SvgIconDelete,{}),onClick:ft,type:"button",variant:"ghost"})]}),ct?jsxRuntimeExports.jsx(Avatar,{alt:"",src:ct,size:"xl"}):jsxRuntimeExports.jsx(AppIcon,{app:at,iconFit:"ratio",size:"160",variant:"rounded"})]})},useResource=(tt,et)=>{const[rt,st]=reactExports.useState(null);return reactExports.useEffect(()=>{if(et===""){console.warn("resourceId must be an assetId and not an empty string");return}(async()=>{try{const nt=await odeServices.resource(tt).searchResource({application:tt,id:et});st(nt)}catch(nt){console.error(nt)}})()},[]),rt},SvgIconApplications=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1 3c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2zm8 0H3v6h6zm4 0c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2zm8 0h-6v6h6zm-8 12c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2zm8 0h-6v6h6zM1 15c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2zm8 0H3v6h6z",clipRule:"evenodd"})]}),SvgIconCode=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M17.327 5.76a1 1 0 0 1 1.413.067l5 5.5a1 1 0 0 1 0 1.346l-5 5.5a1 1 0 1 1-1.48-1.346L21.648 12 17.26 7.173a1 1 0 0 1 .067-1.413M6.673 5.76a1 1 0 0 1 .067 1.413L2.35 12l4.389 4.827a1 1 0 0 1-1.48 1.346l-5-5.5a1 1 0 0 1 0-1.346l5-5.5a1 1 0 0 1 1.413-.067M8.979 21.609a1 1 0 0 1-.658-1.252l5.375-17.29a1 1 0 1 1 1.91.594L10.23 20.95a1 1 0 0 1-1.251.658",clipRule:"evenodd"})]}),SvgIconGlobe=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.726 3.29A9.01 9.01 0 0 0 3.055 11H7.05a16.3 16.3 0 0 1 2.676-7.71m4.548 0A16.3 16.3 0 0 1 16.95 11h3.995a9.01 9.01 0 0 0-6.67-7.71m.668 7.71A14.3 14.3 0 0 0 12 3.55 14.3 14.3 0 0 0 9.058 11zm-5.884 2h5.884A14.3 14.3 0 0 1 12 20.45 14.3 14.3 0 0 1 9.058 13M7.05 13H3.055a9.01 9.01 0 0 0 6.67 7.71A16.3 16.3 0 0 1 7.05 13m7.224 7.71A16.3 16.3 0 0 0 16.95 13h3.995a9.01 9.01 0 0 1-6.67 7.71M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1 1 5.925 1 12s4.925 11 11 11",clipRule:"evenodd"})]}),SvgIconMic=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 .5a4.07 4.07 0 0 0-2.812 1.115A3.8 3.8 0 0 0 8 4.364V12a3.8 3.8 0 0 0 1.188 2.748A4.07 4.07 0 0 0 12 15.864a4.07 4.07 0 0 0 2.812-1.116A3.8 3.8 0 0 0 16 12V4.364a3.8 3.8 0 0 0-1.188-2.749A4.07 4.07 0 0 0 12 .5m-1.43 2.562A2.07 2.07 0 0 1 12 2.5c.545 0 1.059.207 1.43.562.371.354.57.823.57 1.302V12a1.8 1.8 0 0 1-.57 1.302 2.07 2.07 0 0 1-1.43.562 2.07 2.07 0 0 1-1.43-.562A1.8 1.8 0 0 1 10 12V4.364a1.8 1.8 0 0 1 .57-1.302M6 10.091a1 1 0 0 0-2 0V12c0 2.053.855 4.011 2.36 5.448A8.13 8.13 0 0 0 11 19.622V21.5H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-1.878a8.13 8.13 0 0 0 4.64-2.174C19.145 16.011 20 14.053 20 12v-1.91a1 1 0 0 0-2 0V12c0 1.491-.62 2.932-1.74 4.001s-2.646 1.678-4.248 1.68h-.024c-1.602-.002-3.128-.611-4.247-1.68C6.62 14.931 6 13.491 6 12z",clipRule:"evenodd"})]}),SvgIconRecordVideo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-1.936l4.409 1.365A2 2 0 0 0 24 15.519V8.48a2 2 0 0 0-2.591-1.91l-4.41 1.364V6a2 2 0 0 0-2-2zm0 2h13v12H2zm15 7.97V10.03l5-1.548v7.037z",clipRule:"evenodd"})]}),SvgIconSmartphone=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zM4 4a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11 18a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1",clipRule:"evenodd"})]}),MediaLibraryContext=reactExports.createContext(null);function useMediaLibraryContext(){const tt=reactExports.useContext(MediaLibraryContext);if(!tt)throw new Error("Innertabs compound components cannot be rendered outside the MediaLibrary component");return tt}const SvgIconPause=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 2h3v16h-3zm10-2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 2h3v16h-3z",clipRule:"evenodd"})]}),SvgIconRecord=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("circle",{cx:12,cy:12,r:11,fill:"currentColor"})]}),AudioRecorderTimer=({recordState:tt,playState:et,recordTime:rt,audioTime:st,maxDuration:nt})=>jsxRuntimeExports.jsxs("div",{className:"audio-recorder-time my-16 mx-auto",children:[et==="IDLE"&&jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center",children:[tt==="PAUSED"?jsxRuntimeExports.jsx(SvgIconPause,{width:12,height:12,className:"me-8 text-danger"}):jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,className:"me-8 text-danger"}),n$4(tt!=="IDLE"?rt:0)+" / "+n$4(nt)]}),et!=="IDLE"&&jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mx-auto",children:[jsxRuntimeExports.jsx(SvgIconMic,{width:12,height:12,className:"me-8"}),n$4(st*1e3)," /",n$4(rt)]})]}),SvgIconPlayFilled=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M5 3.804c0-1.57 1.728-2.528 3.06-1.696l13.113 8.196a2 2 0 0 1 0 3.392L8.06 21.892C6.728 22.724 5 21.767 5 20.196z"})]}),SvgIconRecordPause=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M23 12c0 6.075-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1s11 4.925 11 11M10 6H8a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1m4 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconRefresh=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{clipPath:"url(#icon-refresh_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.304 21c3.015 0 5.65-1.924 6.838-4.752a.986.986 0 0 1 1.297-.53c.503.216.738.803.524 1.311C19.498 20.522 16.19 23 12.304 23c-4.644 0-8.444-3.522-9.299-8.113L1.86 17.142a.99.99 0 0 1-1.33.449 1 1 0 0 1-.417-1.348L2.51 11.52c.135-.265.376-.457.66-.527a.96.96 0 0 1 .812.169L8.1 14.297c.433.33.515.958.185 1.404a.98.98 0 0 1-1.382.212L4.93 14.41c.65 3.785 3.744 6.59 7.374 6.59m4.794-12.913a.98.98 0 0 0-1.381.211 1.01 1.01 0 0 0 .184 1.405l4.117 3.135a.96.96 0 0 0 .812.169c.284-.07.525-.262.66-.527l2.398-4.723c.252-.496.065-1.1-.418-1.348a.99.99 0 0 0-1.329.449l-1.145 2.255C20.14 4.522 16.34 1 11.696 1 7.81 1 4.505 3.478 3.037 6.97a1.004 1.004 0 0 0 .525 1.312.986.986 0 0 0 1.297-.53C6.046 4.924 8.681 3 11.697 3c3.63 0 6.724 2.805 7.374 6.59z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-refresh_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconRestart=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M17.919 3.15c1.33-.856 3.081.1 3.081 1.682v14.336c0 1.583-1.75 2.538-3.081 1.683L7 13.83V19a2 2 0 1 1-4 0V5a2 2 0 1 1 4 0v5.168z"})]}),SvgIconSave=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h1v-7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7h1a1 1 0 0 0 1-1V8.414L15.586 4H8v3h7a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1V4zm2-2H5a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V8a1 1 0 0 0-.293-.707l-5-5A1 1 0 0 0 16 2zm1 12v6h8v-6z",clipRule:"evenodd"})]});function useAudioRecorder(tt,et,rt=!1,st="protected",nt="media-library"){var ot;function at(Yt,tr){return{...Yt,...tr.updatedState}}const[{recordState:lt,playState:ut,micStream:ct,micStreamAudioSourceNode:dt,audioWorkletNode:ht,audioContext:ft,encoderWorker:xt,maxDuration:vt,recordTime:yt,isEncoding:Et},bt]=reactExports.useReducer(at,{recordState:"IDLE",isEncoding:!1,playState:"IDLE",recordTime:0,maxDuration:180}),wt=reactExports.useRef(null),St=reactExports.useRef(null),Rt=reactExports.useRef(),Ct=reactExports.useRef(),{t:It}=useTranslation(),{create:jt}=useWorkspaceFile(),Pt=128,Ot=48e3;reactExports.useEffect(()=>{const Yt=new Worker("/infra/public/js/audioEncoder.js");return bt({type:"update",updatedState:{encoderWorker:Yt}}),Yt.postMessage(["init",(ft==null?void 0:ft.sampleRate)||Ot]),()=>{Nt(),Yt.terminate()}},[]);const Ut=Yt=>{var tr,lr;const ur=Yt.data.inputs[0][0];let mr=Yt.data.inputs[0][1];(!mr||mr.filter(yr=>yr!==void 0).length===0)&&(mr=ur),(tr=Rt.current)==null||tr.push(ur),(lr=Ct.current)==null||lr.push(mr)},Nt=reactExports.useCallback(()=>{ct==null||ct.getTracks().forEach(Yt=>Yt.stop()),dt==null||dt.disconnect(),ht==null||ht.port.removeEventListener("message",Ut),ht==null||ht.port.close(),ht==null||ht.disconnect(),ft==null||ft.close()},[ft,ht,ct,dt]),Ht=async()=>{const Yt=await navigator.mediaDevices.getUserMedia({audio:!0}),tr=new AudioContext({sampleRate:Ot}),lr=tr.createMediaStreamSource(Yt);try{await tr.audioWorklet.addModule("/infra/public/js/audio-recorder-processor.js")}catch(mr){console.error(mr)}const ur=new AudioWorkletNode(tr,"audio-recorder-processor");ur.port.addEventListener("message",Ut),bt({type:"update",updatedState:{micStream:Yt,micStreamAudioSourceNode:lr,audioContext:tr,recordTime:0,audioWorkletNode:ur,recordState:"RECORDING",playState:"IDLE"}}),Ct.current=[],Rt.current=[],ur.port.start(),lr.connect(ur),ur.connect(tr.destination)},Lt=reactExports.useCallback(async()=>{St.current&&(St.current.currentTime=0,St.current.pause()),lt==="PAUSED"?(bt({type:"update",updatedState:{recordState:"RECORDING",playState:"IDLE"}}),ft==null||ft.resume(),et==null||et(void 0)):Ht()},[lt,ft,St]),kt=reactExports.useCallback(()=>{bt({type:"update",updatedState:{recordState:"PAUSED",playState:"IDLE",isEncoding:!0}}),ft==null||ft.suspend(),xt&&Rt.current&&Ct.current&&(xt.postMessage(["wav",Ct.current,Rt.current,Ct.current.length*Pt]),xt.onmessage=Yt=>{const tr=window.URL.createObjectURL(Yt.data);bt({type:"update",updatedState:{isEncoding:!1}}),St.current&&(St.current.src=tr),et&&et(tr)})},[ft,xt,et]),$t=reactExports.useCallback(()=>{var Yt;bt({type:"update",updatedState:{playState:"PLAYING"}}),((Yt=St==null?void 0:St.current)!=null&&Yt.currentTime||St.current)&&St.current.play()},[St]),Ft=reactExports.useCallback(()=>{var Yt;(Yt=St==null?void 0:St.current)==null||Yt.pause(),bt({type:"update",updatedState:{playState:"PAUSED"}})},[St]),Gt=reactExports.useCallback(()=>{Nt(),bt({type:"update",updatedState:{playState:"IDLE",recordState:"IDLE"}}),Ct.current=[],Rt.current=[],et&&et(void 0)},[Nt,et]),Mt=reactExports.useCallback(async()=>{var Yt;const tr=(Yt=wt.current)==null?void 0:Yt.value;if(!tr){console.error("Audio name is required");return}return St.current&&(St.current.pause(),St.current.currentTime=0),bt({type:"update",updatedState:{recordState:"SAVING",playState:"IDLE"}}),new Promise((lr,ur)=>{try{xt&&Rt.current&&Ct.current&&(xt.postMessage(["mp3",Ct.current,Rt.current,Ct.current.length*Pt]),xt.onmessage=async mr=>{if(mr.data instanceof Blob){const yr=new File([mr.data],tr,{type:"audio/mp3"}),or=await jt(yr,{application:nt,visibility:st});or&&tt&&tt(or),bt({type:"update",updatedState:{recordState:"SAVED"}}),lr(or)}})}catch(mr){bt({type:"update",updatedState:{playState:"IDLE",recordState:"IDLE"}}),console.error("Error while saving",mr),ur()}})},[lt,tt,Nt]),Vt=reactExports.useCallback(()=>{St!=null&&St.current&&(St.current.pause(),St.current.currentTime=0),bt({type:"update",updatedState:{playState:"IDLE"}})},[St]),Bt=reactExports.useCallback(()=>{bt({type:"update",updatedState:{playState:"PAUSED"}}),St.current&&(St.current.currentTime=0)},[St]);reactExports.useEffect(()=>{if(lt==="RECORDING"&&ft){const Yt=window.setInterval(()=>{bt({type:"update",updatedState:{recordTime:ft.currentTime}}),ft.currentTime>=vt&&(kt(),window.clearInterval(Yt))},100);return()=>window.clearInterval(Yt)}},[ft,kt,vt,lt]);const qt=It(lt==="IDLE"?"bbm.audio.record.start":"bbm.audio.record.resume"),Qt=[{type:"icon",name:"record",visibility:lt==="RECORDING"?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{}),color:"danger",disabled:lt!=="IDLE"&<!=="PAUSED"||yt>=vt,onClick:Lt,"aria-label":qt},tooltip:qt},{type:"icon",name:"recordPause",visibility:lt==="RECORDING"?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordPause,{}),color:"danger",disabled:lt!=="RECORDING",onClick:kt,"aria-label":It("bbm.audio.record.pause")},tooltip:It("bbm.audio.record.pause")},{type:"divider"},{type:"icon",name:"encoding",visibility:Et?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconLoader,{style:{animation:"loading 1s infinite"}}),disabled:!0}},{type:"icon",name:"play",visibility:Et||ut==="PLAYING"?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:lt!=="RECORDED"&<!=="PAUSED"&<!=="SAVED",onClick:$t,"aria-label":It("bbm.audio.play.start")},tooltip:It("bbm.audio.play.start")},{type:"icon",name:"playPause",visibility:!Et&&ut==="PLAYING"?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),onClick:Ft,"aria-label":It("bbm.audio.play.pause")},tooltip:It("bbm.audio.play.pause")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRestart,{}),disabled:ut!=="PLAYING"&&ut!=="PAUSED",onClick:Vt,"aria-label":It("bbm.audio.play.stop")},tooltip:It("bbm.audio.play.stop")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:lt!=="RECORDED"&<!=="PAUSED"&&ut!=="PLAYING"&&ut!=="PAUSED",onClick:Gt,"aria-label":It("bbm.audio.record.reset")},tooltip:It("bbm.audio.record.reset")},{type:"icon",name:"save",visibility:rt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:lt!=="RECORDED"&<!=="PAUSED"&&ut!=="PLAYING"&&ut!=="PAUSED"||lt==="SAVED"||!((ot=wt.current)!=null&&ot.value),onClick:Mt,"aria-label":It("bbm.audio.record.save")},tooltip:It("bbm.audio.record.save")}];return{recordState:lt,playState:ut,audioContext:ft,recordTime:yt*1e3,maxDuration:vt*1e3,audioRef:St,audioNameRef:wt,toolbarItems:Qt,handlePlayEnded:Bt,handleSave:Mt}}const Toolbar=reactExports.forwardRef(({items:tt,variant:et="default",align:rt="space",isBlock:st=!1,ariaControls:nt,className:ot,shouldHideLabelsOnMobile:at=!1},lt)=>{const[ut,ct]=reactExports.useState(0),[dt,ht]=reactExports.useState([]),[ft,xt]=reactExports.useState(),[vt,yt]=reactExports.useState(),Et=reactExports.useRef(),{lg:bt}=useBreakpoint(),wt=clsx("toolbar z-1000 bg-white",ot,{default:et==="default","no-shadow":et==="no-shadow","d-flex":st,"d-inline-flex":!st,"overflow-x-auto":st,"justify-content-start":rt==="left","justify-content-between":rt==="space","justify-content-center":rt==="center","justify-content-end":rt==="right"});reactExports.useEffect(()=>{var Pt;const Ot=(Pt=Et.current)==null?void 0:Pt.querySelectorAll("button"),Ut=[];let Nt=!1;Ot==null||Ot.forEach(Ht=>{Ht.disabled||(Nt||(xt(Ht),Nt=!0),yt(Ht),Ut.push(Ht))}),ht(Ut),ct(tt.findIndex(Ht=>(Ht.type==="button"||Ht.type==="icon")&&!Ht.props.disabled))},[tt]);const St=Pt=>{Pt.target.classList.add("focus")},Rt=Pt=>{Pt.target.classList.remove("focus")},Ct=Pt=>{var Ot,Ut;const Nt=dt.indexOf(Pt.currentTarget);switch(Pt.code){case"ArrowLeft":Pt.currentTarget===ft?vt==null||vt.focus():(Ot=dt[Nt-1])==null||Ot.focus();break;case"ArrowRight":Pt.currentTarget===vt?ft==null||ft.focus():(Ut=dt[Nt+1])==null||Ut.focus();break}},It=Pt=>{var Ot;return typeof Pt.tooltip=="string"?Pt.tooltip:(Ot=Pt.tooltip)==null?void 0:Ot.message},jt=Pt=>{var Ot;return typeof Pt.tooltip!="string"?(Ot=Pt.tooltip)==null?void 0:Ot.position:"top"};return jsxRuntimeExports.jsx("div",{ref:mergeRefs(lt,Et),className:wt,role:"toolbar","aria-label":"Text Formatting","aria-controls":nt,onFocus:St,onBlur:Rt,children:tt.map((Pt,Ot)=>{if(Pt.visibility==="hide")return null;const Ut=at&&!bt;switch(Pt.type){case"divider":return jsxRuntimeExports.jsx("div",{className:"toolbar-divider"},Pt.name??Ot);case"button":return jsxRuntimeExports.jsx(Tooltip,{message:Ut?It(Pt):void 0,placement:jt(Pt),children:reactExports.createElement(Button,{...Pt.props,children:!Ut&&Pt.props.children,"aria-label":Pt.name,key:Pt.name??Ot,color:Pt.props.color||"tertiary",variant:"ghost",size:Pt.props.size||Ut?"sm":"md",tabIndex:Ot===ut?0:-1,onKeyDown:Ct})},Pt.name??Ot);case"icon":return jsxRuntimeExports.jsx(Tooltip,{message:It(Pt),placement:jt(Pt),children:reactExports.createElement(IconButton,{...Pt.props,key:Pt.name??Ot,color:Pt.props.color?Pt.props.color:"tertiary",variant:Pt.props.variant?Pt.props.variant:"ghost",tabIndex:Ot===ut?0:-1,onKeyDown:Ct})},Pt.name??Ot);case"dropdown":return reactExports.createElement(Dropdown,{...Pt.props,key:Pt.name??Ot,extraTriggerKeyDownHandler:Ct,overflow:Pt.overflow});case"primary":return jsxRuntimeExports.jsx(Tooltip,{message:It(Pt),placement:jt(Pt),children:jsxRuntimeExports.jsx(Button,{...Pt.props,variant:"filled",color:"primary",tabIndex:Ot===ut?0:-1,onKeyDown:Ct})},Pt.name??Ot)}return null})})}),AudioRecorder=reactExports.forwardRef(({onSaveSuccess:tt,onRecordUpdated:et,hideSaveAction:rt=!1,visibility:st="protected"},nt)=>{const{recordState:ot,playState:at,recordTime:lt,audioRef:ut,audioNameRef:ct,toolbarItems:dt,maxDuration:ht,handlePlayEnded:ft,handleSave:xt}=useAudioRecorder(tt,et,rt,st,"media-library"),{t:vt}=useTranslation();function yt(){const Rt=new Date;return`${Rt.getFullYear()}-${String(Rt.getMonth()+1).padStart(2,"0")}-${String(Rt.getDate()).padStart(2,"0")} ${String(Rt.getHours()).padStart(2,"0")}h${String(Rt.getMinutes()).padStart(2,"0")} `+vt("bbm.audio.recorder.defaultName")}reactExports.useImperativeHandle(nt,()=>({save:xt}));const[Et,bt]=reactExports.useState(0),wt=clsx({"text-danger":ot==="RECORDING","text-success":at==="PLAYING"}),St=Rt=>{bt(Rt.target.currentTime)};return jsxRuntimeExports.jsxs("div",{className:"audio-recorder m-auto d-flex flex-column",children:[jsxRuntimeExports.jsx(FormControl,{id:"recordName",className:"mb-32",isRequired:!0,isReadOnly:ot==="SAVED"||ot==="SAVING",children:jsxRuntimeExports.jsx(Input,{type:"text",size:"sm",placeholder:vt("bbm.audio.recorder.name"),ref:ct,defaultValue:yt()})}),jsxRuntimeExports.jsx("div",{className:"audio-recorder-icon mx-auto",children:jsxRuntimeExports.jsx(SvgIconMic,{width:64,height:64,className:wt})}),jsxRuntimeExports.jsx(AudioRecorderTimer,{recordState:ot,playState:at,recordTime:lt,audioTime:Et,maxDuration:ht}),jsxRuntimeExports.jsx("audio",{ref:ut,onEnded:ft,onTimeUpdate:St,children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),jsxRuntimeExports.jsx(Toolbar,{items:dt})]})}),Audio=()=>{const{setResult:tt,setPreSuccess:et,visibility:rt}=useMediaLibraryContext(),st=reactExports.useRef(null);return jsxRuntimeExports.jsx(AudioRecorder,{ref:st,onRecordUpdated:nt=>{nt?(tt(nt),et(()=>st.current.save)):tt()},onSaveSuccess:nt=>{nt&&tt(nt)},hideSaveAction:!0,visibility:rt})},ExternalLinker=({link:tt,onChange:et,multiNodeSelected:rt=!1})=>{const{t:st}=useTranslation(),[nt,ot]=reactExports.useState((tt==null?void 0:tt.text)||""),[at,lt]=reactExports.useState((tt==null?void 0:tt.url)||""),[ut,ct]=useToggle(tt?tt.target==="_blank":!0);return reactExports.useEffect(()=>{rt&&tt!=null&&tt.text&&ot(tt.text.slice(0,20)+"...")},[rt,tt]),reactExports.useEffect(()=>{if(!at.length){et==null||et();return}const dt={url:at,text:rt?tt==null?void 0:tt.text:nt||at,target:ut?"_blank":void 0};!s$3.isLocalURL(at)&&!s$3.startWithHttp(at)&&(dt.url="http://"+at),et==null||et(dt)},[nt,at,ut]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill gap-24",children:[jsxRuntimeExports.jsxs(FormControl,{id:"linkText",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:st("bbm.linker.ext.text")}),jsxRuntimeExports.jsx(Input,{type:"text",placeholder:st("bbm.linker.ext.text.placeholder"),size:"md",disabled:rt,value:nt,onChange:dt=>ot(dt.target.value)})]}),jsxRuntimeExports.jsxs(FormControl,{id:"linkUrl",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:st("bbm.linker.ext.url")}),jsxRuntimeExports.jsx(Input,{type:"text",placeholder:st("bbm.linker.ext.url.placeholder"),size:"md",value:at,onChange:dt=>lt(dt.target.value)})]}),jsxRuntimeExports.jsx(Checkbox,{label:st("bbm.linker.open.tab"),onChange:()=>ct(),checked:ut})]})})},ExternalLink=({link:tt,multiNodeSelected:et=!1})=>{const{setResult:rt}=useMediaLibraryContext();return jsxRuntimeExports.jsx(ExternalLinker,{link:tt,onChange:st=>{rt(st)},multiNodeSelected:et})},Embed=({onSuccess:tt})=>{const{t:et}=useTranslation(),[rt,st]=reactExports.useState();function nt(ot){const at=ot.target.value;st(at),at!=null&&at.length?tt(at):tt()}return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill",children:[jsxRuntimeExports.jsx("div",{className:"mb-32",children:et("bbm.embed.description")}),jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconCode,{className:"me-8"}),et("bbm.embed.title")]}),jsxRuntimeExports.jsx(FormControl,{id:"iframeContent",children:jsxRuntimeExports.jsx(TextArea,{size:"md",height:"sm",placeholder:et("bbm.embed.placeholder"),onChange:nt})}),!!(rt!=null&&rt.length)&&jsxRuntimeExports.jsx("div",{className:"embed-preview mt-12",dangerouslySetInnerHTML:{__html:rt}}),!(rt!=null&&rt.length)&&jsxRuntimeExports.jsx("div",{className:"embed-preview mt-12 d-flex align-items-center justify-content-center bg-gray-300 text-black-50 rounded-3",children:jsxRuntimeExports.jsx("strong",{children:et("bbm.embed.preview")})})]})},Iframe=()=>{const{setResult:tt}=useMediaLibraryContext();return jsxRuntimeExports.jsx(Embed,{onSuccess:et=>{et=et==null?void 0:et.replace(/<p /g,"<div ").replace(/\/p>/g,"/div>"),tt(et)}})},SvgIconUsers=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-users_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M19.055 12.803a1 1 0 0 1 1.272-.618c1.128.39 2.061 1.247 2.7 2.351.64 1.106.972 2.435.973 3.782V21a1 1 0 1 1-2 0v-2.681c0-1.03-.258-2.009-.704-2.782-.448-.773-1.034-1.258-1.623-1.462a1 1 0 0 1-.618-1.272M15.187 1.384a1 1 0 0 1 1.036-.962 5.129 5.129 0 0 1 2.11 9.71 1 1 0 1 1-.896-1.788 3.129 3.129 0 0 0-1.288-5.924 1 1 0 0 1-.962-1.036M1.505 15.694C2.481 14.622 3.825 14 5.25 14h8.5c1.424 0 2.769.622 3.744 1.694.974 1.068 1.506 2.498 1.506 3.973V22a1 1 0 1 1-2 0v-2.333c0-1.001-.363-1.945-.984-2.627-.618-.679-1.436-1.04-2.266-1.04h-8.5c-.83 0-1.648.361-2.266 1.04-.621.682-.984 1.626-.984 2.627V22a1 1 0 1 1-2 0v-2.333c0-1.475.533-2.905 1.505-3.974M9.5 3a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M4 6.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-users_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),LinkerCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:st=!1,onClick:nt,className:ot})=>{const{fromNow:at}=useDate(),{fromDate:lt}=reactExports.useMemo(()=>({fromDate:at(tt.modifiedAt)}),[at,tt]);return jsxRuntimeExports.jsx(Card,{className:clsx("card-linker shadow-none",ot),isClickable:et,isSelectable:rt,isSelected:st,onClick:nt,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{className:"card-image ps-8 pe-4",children:tt.thumbnail&&tt.thumbnail.length>0?jsxRuntimeExports.jsx(Image$1,{alt:"",height:48,width:48,src:tt.thumbnail,objectFit:"cover",className:"rounded h-full",style:{aspectRatio:1/1}}):jsxRuntimeExports.jsx(AppIcon,{app:tt.application,iconFit:"ratio",size:"48",variant:"rounded"})}),jsxRuntimeExports.jsxs("div",{className:"w-75",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.creatorName})]}),jsxRuntimeExports.jsx("div",{className:"d-none d-md-block text-black-50 ps-4 pe-8",children:jsxRuntimeExports.jsx(Card.Text,{children:lt})}),tt.shared&&jsxRuntimeExports.jsx("div",{className:"ps-4 pe-8",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:"20",height:"20"})})]})})},useResourceSearch=tt=>{const[et,rt]=reactExports.useState([]);reactExports.useEffect(()=>{(async()=>(await SnipletsService.initialize(odeServices,tt),await SnipletsService.registerBehaviours(tt),rt(SnipletsService.resourceProducingApps)))()},[]);const st=reactExports.useCallback(async nt=>{const[ot]=nt.types;return await odeServices.behaviour(tt,ot).loadResources(nt)},[tt]);return{resourceApplications:et,loadResources:st}},illuOneBlog="/assets/js/ode-explorer/illu-empty-search-blog.svg",illuOneCollaborativeWall="/assets/js/ode-explorer/illu-empty-search-collaborativewall.svg",illuOneCommunity="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_149764)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M167.746%20130.552C172.704%20130.552%20176.962%20132.327%20180.519%20135.877C184.076%20139.427%20185.855%20143.677%20185.854%20148.625C185.854%20153.574%20184.076%20157.823%20180.519%20161.373C176.962%20164.923%20172.758%20166.698%20167.908%20166.698C163.057%20166.698%20158.799%20164.923%20155.135%20161.373C151.47%20157.823%20149.692%20153.52%20149.799%20148.464C149.799%20146.528%20150.23%20144.43%20151.093%20142.171L123.768%20122.484C118.487%20127.863%20112.127%20130.552%20104.69%20130.552C97.2522%20130.552%2090.8927%20127.917%2085.6111%20122.646C80.3295%20117.374%2077.6348%20110.974%2077.5271%20103.443C77.5271%20102.475%2077.6887%20101.077%2078.012%2099.2476L56.3468%2092.1477C54.6221%2093.6538%2052.6819%2094.4069%2050.5261%2094.4069C47.9391%2094.4069%2045.7833%2093.5463%2044.0587%2091.825C42.334%2090.1037%2041.4717%2087.9522%2041.4717%2085.3703C41.4717%2082.7884%2042.334%2080.6906%2044.0587%2079.0771C45.7833%2077.4635%2047.9391%2076.6028%2050.5261%2076.4952C52.6819%2076.4952%2054.5143%2077.1944%2056.0234%2078.5928C57.5325%2079.9912%2058.5564%2081.6586%2059.0953%2083.595L80.9224%2090.8565C83.1858%2086.4458%2086.4734%2082.9496%2090.785%2080.3677C95.0966%2077.7858%2099.7315%2076.4948%20104.69%2076.4948C110.295%2076.4948%20115.468%2078.1623%20120.211%2081.4971L152.386%2049.3856C150.661%2046.1582%20149.799%2043.1998%20149.799%2040.5105C149.799%2035.562%20151.577%2031.3127%20155.134%2027.7625C158.691%2024.2123%20162.949%2022.4373%20167.907%2022.4375C172.866%2022.4377%20177.069%2024.2127%20180.518%2027.7625C183.968%2031.3123%20185.746%2035.5616%20185.854%2040.5105C185.962%2045.4593%20184.183%2049.6548%20180.518%2053.0969C176.854%2056.539%20172.596%2058.314%20167.745%2058.4219C164.943%2058.4219%20161.979%2057.5075%20158.853%2055.6788L126.678%2087.9518C130.02%2092.6851%20131.69%2097.8488%20131.69%20103.443C131.69%20107.423%20130.774%20111.35%20128.942%20115.223L156.266%20134.748C159.823%20131.951%20163.65%20130.552%20167.746%20130.552V130.552Z'%20fill='%23A348C0'/%3e%3cg%20filter='url(%23filter0_d_3597_149764)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_149764'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_149764'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_149764'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_149764'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneExercizer="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_148725)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M83.4104%20149.864L112.194%20135.472V111.738L83.4104%20124.138V149.864ZM78.5673%20115.516L108.965%20102.602L78.5673%2089.5493L48.3412%20102.773L78.5673%20115.516ZM160.349%20149.864L189.167%20135.472V111.738L160.384%20124.138L160.349%20149.864ZM155.506%20115.516L185.732%20102.773L155.472%2089.7211L125.074%20102.773L155.506%20115.516ZM121.88%2093.568L150.663%2081.2028V61.3498L121.88%2073.715V93.568ZM117.037%2065.2311L150.114%2051.1141L117.037%2036.8598L83.9256%2051.1141L117.037%2065.2311ZM198.682%20104.113V135.472C198.694%20137.212%20198.231%20138.923%20197.342%20140.418C196.429%20141.946%20195.059%20143.147%20193.426%20143.853L159.8%20160.684C158.476%20161.382%20157.003%20161.746%20155.506%20161.746C154.01%20161.746%20152.536%20161.382%20151.213%20160.684L117.586%20143.853C117.379%20143.822%20117.187%20143.726%20117.037%20143.578C116.881%20143.717%20116.692%20143.812%20116.487%20143.853L82.8608%20160.684C81.5508%20161.417%2080.068%20161.784%2078.5673%20161.748C77.0983%20161.794%2075.6461%20161.425%2074.3769%20160.684L40.7504%20143.853C39.1325%20143.137%2037.7764%20141.937%2036.8691%20140.418C35.9651%20138.922%2035.4568%20137.22%2035.3921%20135.472V104.113C35.3757%20102.237%2035.9395%20100.401%2037.0064%2098.8576C38.051%2097.299%2039.55%2096.0997%2041.2999%2095.4228L73.8617%2081.4433V51.3889C73.8545%2049.5056%2074.3966%2047.6611%2075.4214%2046.0811C76.4463%2044.5011%2077.9095%2043.2541%2079.6321%2042.4928L113.259%2028.1011C114.45%2027.581%20115.737%2027.3125%20117.037%2027.3125C118.337%2027.3125%20119.623%2027.581%20120.815%2028.1011L154.442%2042.4928C156.151%2043.2379%20157.633%2044.4231%20158.735%2045.9276C159.819%2047.5145%20160.383%2049.3988%20160.349%2051.3202V81.3059L192.911%2095.2854C194.661%2095.9623%20196.16%2097.1616%20197.205%2098.7202C198.26%20100.263%20198.779%20102.109%20198.682%20103.975V104.113Z'%20fill='%23A348C0'/%3e%3cg%20filter='url(%23filter0_d_3597_148725)'%3e%3cellipse%20cx='169.707'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.011%20150.405C214.308%20149.703%20213.482%20149.21%20212.605%20148.92C220.41%20139.391%20225.098%20127.21%20225.098%20113.934C225.098%2095.9054%20216.453%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.866%2058.6953C165.678%2058.6953%20161.598%2059.1808%20157.678%2060.0649C152.634%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.366%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.634%20106.855%20114.634%20113.934C114.634%20144.442%20139.359%20169.166%20169.866%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.337%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.714%20185.775C244.113%20183.376%20244.113%20179.492%20241.714%20177.094L241.707%20177.101ZM169.859%20156.891C146.134%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.895%2090.4489C136.482%2086.4924%20139.707%2082.9924%20143.424%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.627%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_148725'%20x='108.634'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_148725'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_148725'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_148725'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneFormulaire="/assets/js/ode-explorer/illu-empty-search-formulaire.svg",illuOneForum="/assets/js/ode-explorer/illu-empty-search-forum.svg",illuOneHomeworks="/assets/js/ode-explorer/illu-empty-search-homeworks.svg",illuOneMagneto="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_149757)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M127.341%20120.329V89.4164C127.341%2077.1185%20122.455%2065.3242%20113.759%2056.6282C105.063%2047.9322%2093.2691%2043.0469%2080.9711%2043.0469C68.6731%2043.0469%2056.8789%2047.9322%2048.1829%2056.6282C39.4869%2065.3242%2034.6016%2077.1185%2034.6016%2089.4164L34.6016%20120.329H55.2103V89.4164C55.2103%2082.5842%2057.9243%2076.0319%2062.7554%2071.2008C67.5865%2066.3696%2074.1389%2063.6556%2080.9711%2063.6556C84.3541%2063.6556%2087.7039%2064.3219%2090.8294%2065.6165C93.9548%2066.9111%2096.7947%2068.8086%2099.1868%2071.2007C101.579%2073.5929%20103.476%2076.4327%20104.771%2079.5582C106.066%2082.6836%20106.732%2086.0335%20106.732%2089.4164V120.329M55.2103%20130.634H34.6016V146.09H55.2103M127.341%20130.634H106.732V146.09H127.341'%20fill='%23F1CA00'/%3e%3cpath%20d='M199.472%20120.329V89.4164C199.472%2083.3271%20198.272%2077.2974%20195.942%2071.6716C193.612%2066.0457%20190.196%2060.934%20185.89%2056.6282C181.584%2052.3224%20176.473%2048.9068%20170.847%2046.5765C165.221%2044.2463%20159.191%2043.0469%20153.102%2043.0469C140.804%2043.0469%20129.01%2047.9322%20120.314%2056.6282C111.618%2065.3242%20106.732%2077.1185%20106.732%2089.4164V120.329H127.341V89.4164C127.341%2082.5842%20130.055%2076.0319%20134.886%2071.2008C139.717%2066.3696%20146.27%2063.6556%20153.102%2063.6556C156.485%2063.6556%20159.835%2064.3219%20162.96%2065.6165C166.086%2066.9111%20168.926%2068.8086%20171.318%2071.2007C173.71%2073.5929%20175.607%2076.4327%20176.902%2079.5582C178.197%2082.6836%20178.863%2086.0335%20178.863%2089.4164V120.329M127.341%20130.634H106.732V146.09H127.341M199.472%20130.634H178.863V146.09H199.472'%20fill='%23F1CA00'/%3e%3cg%20filter='url(%23filter0_d_3597_149757)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_149757'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_149757'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_149757'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_149757'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneWiki="/assets/js/ode-explorer/illu-empty-search-wiki.svg",illuOneEmpty="/assets/js/ode-explorer/illu-empty-search.svg",illuNeoBlog="/assets/js/ode-explorer/illu-empty-search-blog2.svg",illuNeoCollaborativeWall="/assets/js/ode-explorer/illu-empty-search-collaborativewall2.svg",illuNeoCommunity="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_141038)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M167.746%20130.552C172.704%20130.552%20176.962%20132.327%20180.519%20135.877C184.076%20139.427%20185.855%20143.677%20185.854%20148.625C185.854%20153.574%20184.076%20157.823%20180.519%20161.373C176.962%20164.923%20172.758%20166.698%20167.908%20166.698C163.057%20166.698%20158.799%20164.923%20155.135%20161.373C151.47%20157.823%20149.692%20153.52%20149.799%20148.464C149.799%20146.528%20150.23%20144.43%20151.093%20142.171L123.768%20122.484C118.487%20127.863%20112.127%20130.552%20104.69%20130.552C97.2522%20130.552%2090.8927%20127.917%2085.6111%20122.646C80.3295%20117.374%2077.6348%20110.974%2077.5271%20103.443C77.5271%20102.475%2077.6887%20101.077%2078.012%2099.2476L56.3468%2092.1477C54.6221%2093.6538%2052.6819%2094.4069%2050.5261%2094.4069C47.9391%2094.4069%2045.7833%2093.5463%2044.0587%2091.825C42.334%2090.1037%2041.4717%2087.9522%2041.4717%2085.3703C41.4717%2082.7884%2042.334%2080.6906%2044.0587%2079.0771C45.7833%2077.4635%2047.9391%2076.6028%2050.5261%2076.4952C52.6819%2076.4952%2054.5143%2077.1944%2056.0234%2078.5928C57.5325%2079.9912%2058.5564%2081.6586%2059.0953%2083.595L80.9224%2090.8565C83.1858%2086.4458%2086.4734%2082.9496%2090.785%2080.3677C95.0966%2077.7858%2099.7315%2076.4948%20104.69%2076.4948C110.295%2076.4948%20115.468%2078.1623%20120.211%2081.4971L152.386%2049.3856C150.661%2046.1582%20149.799%2043.1998%20149.799%2040.5105C149.799%2035.562%20151.577%2031.3127%20155.134%2027.7625C158.691%2024.2123%20162.949%2022.4373%20167.907%2022.4375C172.866%2022.4377%20177.069%2024.2127%20180.518%2027.7625C183.968%2031.3123%20185.746%2035.5616%20185.854%2040.5105C185.962%2045.4593%20184.183%2049.6548%20180.518%2053.0969C176.854%2056.539%20172.596%2058.314%20167.745%2058.4219C164.943%2058.4219%20161.979%2057.5075%20158.853%2055.6788L126.678%2087.9518C130.02%2092.6851%20131.69%2097.8488%20131.69%20103.443C131.69%20107.423%20130.774%20111.35%20128.942%20115.223L156.266%20134.748C159.823%20131.951%20163.65%20130.552%20167.746%20130.552V130.552Z'%20fill='%23823AA1'/%3e%3cg%20filter='url(%23filter0_d_3597_141038)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_141038'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_141038'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_141038'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_141038'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoExercizer="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_148718)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M83.4104%20149.864L112.194%20135.472V111.738L83.4104%20124.138V149.864ZM78.5673%20115.516L108.965%20102.602L78.5673%2089.5493L48.3412%20102.773L78.5673%20115.516ZM160.349%20149.864L189.167%20135.472V111.738L160.384%20124.138L160.349%20149.864ZM155.506%20115.516L185.732%20102.773L155.472%2089.7211L125.074%20102.773L155.506%20115.516ZM121.88%2093.568L150.663%2081.2028V61.3498L121.88%2073.715V93.568ZM117.037%2065.2311L150.114%2051.1141L117.037%2036.8598L83.9256%2051.1141L117.037%2065.2311ZM198.682%20104.113V135.472C198.694%20137.212%20198.231%20138.923%20197.342%20140.418C196.429%20141.946%20195.059%20143.147%20193.426%20143.853L159.8%20160.684C158.476%20161.382%20157.003%20161.746%20155.506%20161.746C154.01%20161.746%20152.536%20161.382%20151.213%20160.684L117.586%20143.853C117.379%20143.822%20117.187%20143.726%20117.037%20143.578C116.881%20143.717%20116.692%20143.812%20116.487%20143.853L82.8608%20160.684C81.5508%20161.417%2080.068%20161.784%2078.5673%20161.748C77.0983%20161.794%2075.6461%20161.425%2074.3769%20160.684L40.7504%20143.853C39.1325%20143.137%2037.7764%20141.937%2036.8691%20140.418C35.9651%20138.922%2035.4568%20137.22%2035.3921%20135.472V104.113C35.3757%20102.237%2035.9395%20100.401%2037.0064%2098.8576C38.051%2097.299%2039.55%2096.0997%2041.2999%2095.4228L73.8617%2081.4433V51.3889C73.8545%2049.5056%2074.3966%2047.6611%2075.4214%2046.0811C76.4463%2044.5011%2077.9095%2043.2541%2079.6321%2042.4928L113.259%2028.1011C114.45%2027.581%20115.737%2027.3125%20117.037%2027.3125C118.337%2027.3125%20119.623%2027.581%20120.815%2028.1011L154.442%2042.4928C156.151%2043.2379%20157.633%2044.4231%20158.735%2045.9276C159.819%2047.5145%20160.383%2049.3988%20160.349%2051.3202V81.3059L192.911%2095.2854C194.661%2095.9623%20196.16%2097.1616%20197.205%2098.7202C198.26%20100.263%20198.779%20102.109%20198.682%20103.975V104.113Z'%20fill='%23823AA1'/%3e%3cg%20filter='url(%23filter0_d_3597_148718)'%3e%3cellipse%20cx='169.707'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.011%20150.405C214.308%20149.703%20213.482%20149.21%20212.605%20148.92C220.41%20139.391%20225.098%20127.21%20225.098%20113.934C225.098%2095.9054%20216.453%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.866%2058.6953C165.678%2058.6953%20161.598%2059.1808%20157.678%2060.0649C152.634%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.366%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.634%20106.855%20114.634%20113.934C114.634%20144.442%20139.359%20169.166%20169.866%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.337%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.714%20185.775C244.113%20183.376%20244.113%20179.492%20241.714%20177.094L241.707%20177.101ZM169.859%20156.891C146.134%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.895%2090.4489C136.482%2086.4924%20139.707%2082.9924%20143.424%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.627%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_148718'%20x='108.634'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_148718'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_148718'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_148718'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoFormulaire="/assets/js/ode-explorer/illu-empty-search-formulaire2.svg",illuNeoForum="/assets/js/ode-explorer/illu-empty-search-forum2.svg",illuNeoHomeworks="/assets/js/ode-explorer/illu-empty-search-homeworks2.svg",illuNeoMagneto="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_141030)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M127.341%20120.329V89.4164C127.341%2077.1185%20122.455%2065.3242%20113.759%2056.6282C105.063%2047.9322%2093.2691%2043.0469%2080.9711%2043.0469C68.6731%2043.0469%2056.8789%2047.9322%2048.1829%2056.6282C39.4869%2065.3242%2034.6016%2077.1185%2034.6016%2089.4164L34.6016%20120.329H55.2103V89.4164C55.2103%2082.5842%2057.9243%2076.0319%2062.7554%2071.2008C67.5865%2066.3696%2074.1389%2063.6556%2080.9711%2063.6556C84.3541%2063.6556%2087.7039%2064.3219%2090.8294%2065.6165C93.9548%2066.9111%2096.7947%2068.8086%2099.1868%2071.2007C101.579%2073.5929%20103.476%2076.4327%20104.771%2079.5582C106.066%2082.6836%20106.732%2086.0335%20106.732%2089.4164V120.329M55.2103%20130.634H34.6016V146.09H55.2103M127.341%20130.634H106.732V146.09H127.341'%20fill='%23ECBE30'/%3e%3cpath%20d='M199.472%20120.329V89.4164C199.472%2083.3271%20198.272%2077.2974%20195.942%2071.6716C193.612%2066.0457%20190.196%2060.934%20185.89%2056.6282C181.584%2052.3224%20176.473%2048.9068%20170.847%2046.5765C165.221%2044.2463%20159.191%2043.0469%20153.102%2043.0469C140.804%2043.0469%20129.01%2047.9322%20120.314%2056.6282C111.618%2065.3242%20106.732%2077.1185%20106.732%2089.4164V120.329H127.341V89.4164C127.341%2082.5842%20130.055%2076.0319%20134.886%2071.2008C139.717%2066.3696%20146.27%2063.6556%20153.102%2063.6556C156.485%2063.6556%20159.835%2064.3219%20162.96%2065.6165C166.086%2066.9111%20168.926%2068.8086%20171.318%2071.2007C173.71%2073.5929%20175.607%2076.4327%20176.902%2079.5582C178.197%2082.6836%20178.863%2086.0335%20178.863%2089.4164V120.329M127.341%20130.634H106.732V146.09H127.341M199.472%20130.634H178.863V146.09H199.472'%20fill='%23ECBE30'/%3e%3cg%20filter='url(%23filter0_d_3597_141030)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_141030'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_141030'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_141030'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_141030'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoWiki="/assets/js/ode-explorer/illu-empty-search-wiki2.svg",illuNeoEmpty="/assets/js/ode-explorer/illu-empty-search2.svg",emptyScreenMapping={one:{blog:illuOneBlog,wiki:illuOneWiki,empty:illuOneEmpty,"collaborative-wall":illuOneCollaborativeWall,community:illuOneCommunity,exercizer:illuOneExercizer,formulaire:illuOneFormulaire,forum:illuOneForum,homeworks:illuOneHomeworks,magneto:illuOneMagneto},neo:{blog:illuNeoBlog,wiki:illuNeoWiki,empty:illuNeoEmpty,"collaborative-wall":illuNeoCollaborativeWall,community:illuNeoCommunity,exercizer:illuNeoExercizer,formulaire:illuNeoFormulaire,forum:illuNeoForum,homeworks:illuNeoHomeworks,magneto:illuNeoMagneto}},InternalLinker=({appCode:tt,defaultAppCode:et,defaultResourceId:rt,onChange:st,onSelect:nt,multiple:ot=!0,resourceList:at,applicationList:lt,showApplicationSelector:ut=!0,resourceFilter:ct})=>{const{t:dt}=useTranslation(),{theme:ht}=useEdificeTheme(),{resourceApplications:ft,loadResources:xt}=useResourceSearch(tt),[vt,yt]=reactExports.useState(),[Et,bt]=reactExports.useState(),[wt,St]=reactExports.useState(),Rt=useDebounce(wt||"",500),[Ct,It]=reactExports.useState([]),jt=reactExports.useCallback((Mt,Vt)=>{var Bt,qt,Qt;if(!Vt)return!0;const Yt=(Vt==null?void 0:Vt.toLowerCase())||"";return((Bt=Mt.name)==null?void 0:Bt.toLowerCase().includes(Yt))||((qt=Mt.creatorName)==null?void 0:qt.toLowerCase().includes(Yt))||((Qt=Mt.description)==null?void 0:Qt.toLowerCase().includes(Yt))},[]),Pt=reactExports.useCallback(Mt=>Mt.sort((Vt,Bt)=>Vt.modifiedAt<Bt.modifiedAt?1:-1),[]),Ot=reactExports.useCallback(Mt=>{async function Vt(){if(at){let Bt=at.filter(qt=>jt(qt,Mt));ct&&(Bt=Bt.filter(ct)),It(Pt(Bt));return}else if(Et)try{let Bt=(await xt({application:Et.application,search:Mt,types:[Et.application],filters:{},pagination:{startIdx:0,pageSize:300}})).filter(qt=>jt(qt,Mt));ct&&(Bt=Bt.filter(ct)),It(Pt(Bt));return}catch{}It([])}Vt()},[xt,Et,jt,Pt,at,ct]),[Ut,Nt]=reactExports.useState([]),Ht=Mt=>{st==null||st(Mt),bt(Mt)},Lt=Mt=>{const Vt=Mt.target.value;St(Vt.toString())},kt=reactExports.useCallback(Mt=>{Ot(wt),Mt.stopPropagation(),Mt.preventDefault()},[Ot,wt]),$t=reactExports.useCallback(Mt=>Ut.findIndex(Vt=>Vt.assetId===Mt),[Ut]),Ft=reactExports.useCallback(Mt=>{Nt(ot?Vt=>[...Vt,Mt]:[Mt])},[Nt,ot]),Gt=reactExports.useCallback(Mt=>{const Vt=$t(Mt.assetId);Vt<0?Ft(Mt):Nt(Ut.filter((Bt,qt)=>qt!==Vt))},[$t,Ft,Ut]);return reactExports.useEffect(()=>{(async()=>{if(lt){yt(lt.sort((qt,Qt)=>qt.displayName.localeCompare(Qt.displayName)));return}const Mt=ft.map(qt=>odeServices.session().getWebApp(qt)),Vt=await Promise.all(Mt),Bt=ft.map((qt,Qt)=>{var Yt;let tr=((Yt=Vt[Qt])==null?void 0:Yt.displayName)??qt;return qt==="exercizer"?tr="bbm.linker.int.app.exercizer":qt==="formulaire"&&(tr="bbm.linker.int.app.forms"),{application:qt,displayName:dt(tr??qt),icon:jsxRuntimeExports.jsx(AppIcon,{app:Vt[Qt],size:"24"})}}).sort((qt,Qt)=>qt.displayName.localeCompare(Qt.displayName));yt(Bt)})()},[ft,dt,lt]),reactExports.useEffect(()=>{Ot(Rt)},[Ot,Rt]),reactExports.useEffect(()=>{nt==null||nt(Ut)},[Ut]),reactExports.useEffect(()=>{var Mt;const Vt=et??((lt==null?void 0:lt.length)===1&&((Mt=lt==null?void 0:lt[0])==null?void 0:Mt.application));if(Vt){const Bt=vt==null?void 0:vt.find(qt=>Vt===qt.application);bt(Bt),Ot("")}},[vt,et]),reactExports.useEffect(()=>{if(rt&&$t(rt)<0){const Mt=Ct==null?void 0:Ct.find(Vt=>rt===Vt.assetId);Mt&&Ft(Mt)}},[Ct]),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill overflow-hidden",children:[jsxRuntimeExports.jsxs("div",{className:"search d-flex bg-light rounded-top border border-bottom-0",children:[ut&&jsxRuntimeExports.jsx("div",{className:"flex-shrink-1 px-8 py-12 border-end",children:jsxRuntimeExports.jsxs(Dropdown,{overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{icon:jsxRuntimeExports.jsx("div",{className:"pe-8",children:(Et==null?void 0:Et.icon)||jsxRuntimeExports.jsx(SvgIconApplications,{})}),label:dt((Et==null?void 0:Et.displayName)||"bbm.linker.int.choose"),variant:"ghost",size:"md"}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:vt==null?void 0:vt.map(Mt=>jsxRuntimeExports.jsx(Dropdown.Item,{icon:Mt.icon,onClick:()=>Ht(Mt),children:Mt.displayName},Mt.application))})]})}),jsxRuntimeExports.jsx("div",{className:"flex-grow-1 align-self-center",children:jsxRuntimeExports.jsx("form",{className:"gap-16 d-flex w-100 align-items-center px-16 py-8",onSubmit:kt,children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,placeholder:dt("search"),size:"lg",className:"w-100",disabled:!Et,onChange:Lt})})})]}),jsxRuntimeExports.jsxs("div",{className:"internal-linker flex-grow-1 w-100 rounded-bottom border gap-0 overflow-auto",children:[Et&&Ct&&Ct.length>0&&jsxRuntimeExports.jsx("div",{children:Ct.map(Mt=>{const Vt=Ut.findIndex(Bt=>Bt.assetId===Mt.assetId)>=0;return jsxRuntimeExports.jsx(LinkerCard,{doc:Mt,isSelected:Vt,onClick:()=>Gt(Mt)},Mt.path)})}),Et&&Ct&&Ct.length<=0&&jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-16",children:jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:emptyScreenMapping[(ht==null?void 0:ht.bootstrapVersion)??"one"][Et==null?void 0:Et.application],text:dt("bbm.linker.int.notfound"),className:"mt-16"})}),!Et&&jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-32",children:jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:emptyScreenMapping[(ht==null?void 0:ht.bootstrapVersion)??"one"].empty,text:dt("bbm.linker.int.empty"),className:"mt-32"})})]})]})},InternalLink=({target:tt,resourceId:et,appPrefix:rt})=>{const{t:st}=useTranslation(),{setResult:nt,setResultCounter:ot,appCode:at,multiple:lt}=useMediaLibraryContext(),[ut,ct]=useToggle(tt==="_blank"),[dt,ht]=reactExports.useState([]),ft=xt=>{ht(xt)};return reactExports.useEffect(()=>{nt({target:ut?"_blank":void 0,resources:dt}),dt&&dt.length?ot(dt.length):ot(void 0)},[ut,dt]),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill gap-16 overflow-hidden",children:[jsxRuntimeExports.jsx(InternalLinker,{appCode:at,defaultAppCode:rt,defaultResourceId:et,onSelect:ft,multiple:lt}),jsxRuntimeExports.jsx(Checkbox,{className:"align-items-center",checked:ut,label:st("bbm.linker.open.tab"),onChange:ct})]})},SvgIconReset=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.583 7.313 3.976 3.87a.996.996 0 1 0-1.96.346l1.012 5.747a.996.996 0 0 0 1.153.809l5.743-1.014a.997.997 0 0 0-.346-1.962l-3.3.582a7.754 7.754 0 0 1 8.399-4.254 7.76 7.76 0 0 1 .78 15.064 7.745 7.745 0 0 1-8.912-3.56.995.995 0 1 0-1.724.997 9.744 9.744 0 0 0 11.201 4.474 9.74 9.74 0 0 0 5.19-3.718 9.756 9.756 0 0 0-.625-12.055A9.74 9.74 0 0 0 8.73 3.117a9.75 9.75 0 0 0-4.147 4.196",clipRule:"evenodd"})]}),SvgIconWand=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10 0a1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 1 1 0 2 1 1 0 0 0-1 1 1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 0 1 0-2 1 1 0 0 0 1-1 1 1 0 0 1 1-1m9.914 2a2 2 0 0 0-2.828 0L1 18.086a2 2 0 0 0 0 2.828L3.086 23a2 2 0 0 0 2.828 0L22 6.914a2 2 0 0 0 0-2.828zm-3.75 3.75L18.5 3.414 20.586 5.5 18.25 7.836zM14.75 7.164 2.414 19.5 4.5 21.586 16.836 9.25zM21 13a1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 1 1 0 0 1 1-1 1 1 0 1 0 0-2 1 1 0 0 1-1-1",clipRule:"evenodd"})]}),UploadCard=({item:tt,status:et="idle",isClickable:rt=!1,isSelectable:st=!1,onDelete:nt,onEdit:ot,onRetry:at})=>{const{t:lt}=useTranslation(),{src:ut,name:ct,info:dt}=tt,ht=et==="idle",ft=et==="loading",xt=et==="success",vt=dt==null?void 0:dt.type.startsWith("image"),yt={text:"",context:null,image:jsxRuntimeExports.jsx("img",{src:commonPlaceholder,alt:"",width:"48",height:"48"})},Et={error:{text:jsxRuntimeExports.jsx("strong",{children:jsxRuntimeExports.jsx("small",{className:"text-danger caption",children:lt("tiptap.upload.error")})}),context:jsxRuntimeExports.jsx(Button,{leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),variant:"ghost",color:"tertiary",onClick:at,children:lt("tiptap.upload.retry")}),image:jsxRuntimeExports.jsx(Image$1,{alt:"",src:`${commonPlaceholder}/common/image-status-error.svg`,objectFit:"cover"})},idle:yt,loading:{text:"",context:jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.loading"),placement:"top",children:jsxRuntimeExports.jsx(Loading,{isLoading:!0,loadingPosition:"left",className:"text-secondary"})}),image:yt.image},warning:yt,success:{text:jsxRuntimeExports.jsxs("em",{children:[dt==null?void 0:dt.type," ",(dt==null?void 0:dt.weight)&&`- ${dt.weight}`]}),context:jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.loaded"),placement:"top",children:jsxRuntimeExports.jsx(SvgIconSuccessOutline,{className:"text-success"})}),image:jsxRuntimeExports.jsx(Image$1,{alt:"",src:ut??"",width:"48",objectFit:"cover",className:"rounded",style:{aspectRatio:1/1}})},unknown:yt},bt=()=>vt&&jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.edit"),placement:"top",children:jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconWand,{}),variant:"ghost","aria-label":lt("tiptap.tooltip.upload.loading"),disabled:ft||!xt,onClick:ot,color:"secondary"})});return jsxRuntimeExports.jsx(Card,{isClickable:rt,isSelectable:st,className:"card-upload",children:jsxRuntimeExports.jsxs(Card.Body,{children:[jsxRuntimeExports.jsx("div",{className:"card-image",children:Et[et].image}),jsxRuntimeExports.jsxs("div",{className:"text-truncate",children:[jsxRuntimeExports.jsx(Card.Text,{children:ct}),jsxRuntimeExports.jsx(Card.Text,{className:"caption",children:Et[et].text})]}),!ht&&jsxRuntimeExports.jsx("div",{className:"ms-auto",children:jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-12",children:[Et[et].context,!ht&&jsxRuntimeExports.jsx("div",{className:"vr"}),bt(),jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.delete"),placement:"top",children:jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconClose,{}),variant:"ghost","aria-label":lt("tiptap.tooltip.upload.delete"),color:"tertiary",onClick:nt})})]})})]})})};var module={exports:{}},ENV=(tt=>(tt[tt.WEBGL_LEGACY=0]="WEBGL_LEGACY",tt[tt.WEBGL=1]="WEBGL",tt[tt.WEBGL2=2]="WEBGL2",tt))(ENV||{}),RENDERER_TYPE=(tt=>(tt[tt.UNKNOWN=0]="UNKNOWN",tt[tt.WEBGL=1]="WEBGL",tt[tt.CANVAS=2]="CANVAS",tt))(RENDERER_TYPE||{}),BUFFER_BITS=(tt=>(tt[tt.COLOR=16384]="COLOR",tt[tt.DEPTH=256]="DEPTH",tt[tt.STENCIL=1024]="STENCIL",tt))(BUFFER_BITS||{}),BLEND_MODES=(tt=>(tt[tt.NORMAL=0]="NORMAL",tt[tt.ADD=1]="ADD",tt[tt.MULTIPLY=2]="MULTIPLY",tt[tt.SCREEN=3]="SCREEN",tt[tt.OVERLAY=4]="OVERLAY",tt[tt.DARKEN=5]="DARKEN",tt[tt.LIGHTEN=6]="LIGHTEN",tt[tt.COLOR_DODGE=7]="COLOR_DODGE",tt[tt.COLOR_BURN=8]="COLOR_BURN",tt[tt.HARD_LIGHT=9]="HARD_LIGHT",tt[tt.SOFT_LIGHT=10]="SOFT_LIGHT",tt[tt.DIFFERENCE=11]="DIFFERENCE",tt[tt.EXCLUSION=12]="EXCLUSION",tt[tt.HUE=13]="HUE",tt[tt.SATURATION=14]="SATURATION",tt[tt.COLOR=15]="COLOR",tt[tt.LUMINOSITY=16]="LUMINOSITY",tt[tt.NORMAL_NPM=17]="NORMAL_NPM",tt[tt.ADD_NPM=18]="ADD_NPM",tt[tt.SCREEN_NPM=19]="SCREEN_NPM",tt[tt.NONE=20]="NONE",tt[tt.SRC_OVER=0]="SRC_OVER",tt[tt.SRC_IN=21]="SRC_IN",tt[tt.SRC_OUT=22]="SRC_OUT",tt[tt.SRC_ATOP=23]="SRC_ATOP",tt[tt.DST_OVER=24]="DST_OVER",tt[tt.DST_IN=25]="DST_IN",tt[tt.DST_OUT=26]="DST_OUT",tt[tt.DST_ATOP=27]="DST_ATOP",tt[tt.ERASE=26]="ERASE",tt[tt.SUBTRACT=28]="SUBTRACT",tt[tt.XOR=29]="XOR",tt))(BLEND_MODES||{}),DRAW_MODES=(tt=>(tt[tt.POINTS=0]="POINTS",tt[tt.LINES=1]="LINES",tt[tt.LINE_LOOP=2]="LINE_LOOP",tt[tt.LINE_STRIP=3]="LINE_STRIP",tt[tt.TRIANGLES=4]="TRIANGLES",tt[tt.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",tt[tt.TRIANGLE_FAN=6]="TRIANGLE_FAN",tt))(DRAW_MODES||{}),FORMATS=(tt=>(tt[tt.RGBA=6408]="RGBA",tt[tt.RGB=6407]="RGB",tt[tt.RG=33319]="RG",tt[tt.RED=6403]="RED",tt[tt.RGBA_INTEGER=36249]="RGBA_INTEGER",tt[tt.RGB_INTEGER=36248]="RGB_INTEGER",tt[tt.RG_INTEGER=33320]="RG_INTEGER",tt[tt.RED_INTEGER=36244]="RED_INTEGER",tt[tt.ALPHA=6406]="ALPHA",tt[tt.LUMINANCE=6409]="LUMINANCE",tt[tt.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",tt[tt.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",tt[tt.DEPTH_STENCIL=34041]="DEPTH_STENCIL",tt))(FORMATS||{}),TARGETS=(tt=>(tt[tt.TEXTURE_2D=3553]="TEXTURE_2D",tt[tt.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",tt[tt.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",tt))(TARGETS||{}),TYPES=(tt=>(tt[tt.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",tt[tt.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",tt[tt.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",tt[tt.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",tt[tt.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",tt[tt.UNSIGNED_INT=5125]="UNSIGNED_INT",tt[tt.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",tt[tt.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",tt[tt.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",tt[tt.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",tt[tt.BYTE=5120]="BYTE",tt[tt.SHORT=5122]="SHORT",tt[tt.INT=5124]="INT",tt[tt.FLOAT=5126]="FLOAT",tt[tt.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",tt[tt.HALF_FLOAT=36193]="HALF_FLOAT",tt))(TYPES||{}),SAMPLER_TYPES=(tt=>(tt[tt.FLOAT=0]="FLOAT",tt[tt.INT=1]="INT",tt[tt.UINT=2]="UINT",tt))(SAMPLER_TYPES||{}),SCALE_MODES=(tt=>(tt[tt.NEAREST=0]="NEAREST",tt[tt.LINEAR=1]="LINEAR",tt))(SCALE_MODES||{}),WRAP_MODES=(tt=>(tt[tt.CLAMP=33071]="CLAMP",tt[tt.REPEAT=10497]="REPEAT",tt[tt.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",tt))(WRAP_MODES||{}),MIPMAP_MODES=(tt=>(tt[tt.OFF=0]="OFF",tt[tt.POW2=1]="POW2",tt[tt.ON=2]="ON",tt[tt.ON_MANUAL=3]="ON_MANUAL",tt))(MIPMAP_MODES||{}),ALPHA_MODES=(tt=>(tt[tt.NPM=0]="NPM",tt[tt.UNPACK=1]="UNPACK",tt[tt.PMA=2]="PMA",tt[tt.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",tt[tt.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",tt[tt.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",tt))(ALPHA_MODES||{}),CLEAR_MODES=(tt=>(tt[tt.NO=0]="NO",tt[tt.YES=1]="YES",tt[tt.AUTO=2]="AUTO",tt[tt.BLEND=0]="BLEND",tt[tt.CLEAR=1]="CLEAR",tt[tt.BLIT=2]="BLIT",tt))(CLEAR_MODES||{}),GC_MODES=(tt=>(tt[tt.AUTO=0]="AUTO",tt[tt.MANUAL=1]="MANUAL",tt))(GC_MODES||{}),PRECISION=(tt=>(tt.LOW="lowp",tt.MEDIUM="mediump",tt.HIGH="highp",tt))(PRECISION||{}),MASK_TYPES=(tt=>(tt[tt.NONE=0]="NONE",tt[tt.SCISSOR=1]="SCISSOR",tt[tt.STENCIL=2]="STENCIL",tt[tt.SPRITE=3]="SPRITE",tt[tt.COLOR=4]="COLOR",tt))(MASK_TYPES||{}),MSAA_QUALITY=(tt=>(tt[tt.NONE=0]="NONE",tt[tt.LOW=2]="LOW",tt[tt.MEDIUM=4]="MEDIUM",tt[tt.HIGH=8]="HIGH",tt))(MSAA_QUALITY||{}),BUFFER_TYPE=(tt=>(tt[tt.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",tt[tt.ARRAY_BUFFER=34962]="ARRAY_BUFFER",tt[tt.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",tt))(BUFFER_TYPE||{});const BrowserAdapter={createCanvas:(tt,et)=>{const rt=document.createElement("canvas");return rt.width=tt,rt.height=et,rt},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(tt,et)=>fetch(tt,et),parseXML:tt=>new DOMParser().parseFromString(tt,"text/xml")},settings={ADAPTER:BrowserAdapter,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var appleIphone=/iPhone/i,appleIpod=/iPod/i,appleTablet=/iPad/i,appleUniversal=/\biOS-universal(?:.+)Mac\b/i,androidPhone=/\bAndroid(?:.+)Mobile\b/i,androidTablet=/Android/i,amazonPhone=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,amazonTablet=/Silk/i,windowsPhone=/Windows Phone/i,windowsTablet=/\bWindows(?:.+)ARM\b/i,otherBlackBerry=/BlackBerry/i,otherBlackBerry10=/BB10/i,otherOpera=/Opera Mini/i,otherChrome=/\b(CriOS|Chrome)(?:.+)Mobile/i,otherFirefox=/Mobile(?:.+)Firefox\b/i,isAppleTabletOnIos13=function(tt){return typeof tt<"u"&&tt.platform==="MacIntel"&&typeof tt.maxTouchPoints=="number"&&tt.maxTouchPoints>1&&typeof MSStream>"u"};function createMatch(tt){return function(et){return et.test(tt)}}function isMobile$1(tt){var et={userAgent:"",platform:"",maxTouchPoints:0};!tt&&typeof navigator<"u"?et={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof tt=="string"?et.userAgent=tt:tt&&tt.userAgent&&(et={userAgent:tt.userAgent,platform:tt.platform,maxTouchPoints:tt.maxTouchPoints||0});var rt=et.userAgent,st=rt.split("[FBAN");typeof st[1]<"u"&&(rt=st[0]),st=rt.split("Twitter"),typeof st[1]<"u"&&(rt=st[0]);var nt=createMatch(rt),ot={apple:{phone:nt(appleIphone)&&!nt(windowsPhone),ipod:nt(appleIpod),tablet:!nt(appleIphone)&&(nt(appleTablet)||isAppleTabletOnIos13(et))&&!nt(windowsPhone),universal:nt(appleUniversal),device:(nt(appleIphone)||nt(appleIpod)||nt(appleTablet)||nt(appleUniversal)||isAppleTabletOnIos13(et))&&!nt(windowsPhone)},amazon:{phone:nt(amazonPhone),tablet:!nt(amazonPhone)&&nt(amazonTablet),device:nt(amazonPhone)||nt(amazonTablet)},android:{phone:!nt(windowsPhone)&&nt(amazonPhone)||!nt(windowsPhone)&&nt(androidPhone),tablet:!nt(windowsPhone)&&!nt(amazonPhone)&&!nt(androidPhone)&&(nt(amazonTablet)||nt(androidTablet)),device:!nt(windowsPhone)&&(nt(amazonPhone)||nt(amazonTablet)||nt(androidPhone)||nt(androidTablet))||nt(/\bokhttp\b/i)},windows:{phone:nt(windowsPhone),tablet:nt(windowsTablet),device:nt(windowsPhone)||nt(windowsTablet)},other:{blackberry:nt(otherBlackBerry),blackberry10:nt(otherBlackBerry10),opera:nt(otherOpera),firefox:nt(otherFirefox),chrome:nt(otherChrome),device:nt(otherBlackBerry)||nt(otherBlackBerry10)||nt(otherOpera)||nt(otherFirefox)||nt(otherChrome)},any:!1,phone:!1,tablet:!1};return ot.any=ot.apple.device||ot.android.device||ot.windows.device||ot.other.device,ot.phone=ot.apple.phone||ot.android.phone||ot.windows.phone,ot.tablet=ot.apple.tablet||ot.android.tablet||ot.windows.tablet,ot}const isMobileCall=isMobile$1.default??isMobile$1,isMobile=isMobileCall(globalThis.navigator);settings.RETINA_PREFIX=/@([0-9\.]+)x/;settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var eventemitter3={exports:{}};(function(tt){var et=Object.prototype.hasOwnProperty,rt="~";function st(){}Object.create&&(st.prototype=Object.create(null),new st().__proto__||(rt=!1));function nt(ut,ct,dt){this.fn=ut,this.context=ct,this.once=dt||!1}function ot(ut,ct,dt,ht,ft){if(typeof dt!="function")throw new TypeError("The listener must be a function");var xt=new nt(dt,ht||ut,ft),vt=rt?rt+ct:ct;return ut._events[vt]?ut._events[vt].fn?ut._events[vt]=[ut._events[vt],xt]:ut._events[vt].push(xt):(ut._events[vt]=xt,ut._eventsCount++),ut}function at(ut,ct){--ut._eventsCount===0?ut._events=new st:delete ut._events[ct]}function lt(){this._events=new st,this._eventsCount=0}lt.prototype.eventNames=function(){var ct=[],dt,ht;if(this._eventsCount===0)return ct;for(ht in dt=this._events)et.call(dt,ht)&&ct.push(rt?ht.slice(1):ht);return Object.getOwnPropertySymbols?ct.concat(Object.getOwnPropertySymbols(dt)):ct},lt.prototype.listeners=function(ct){var dt=rt?rt+ct:ct,ht=this._events[dt];if(!ht)return[];if(ht.fn)return[ht.fn];for(var ft=0,xt=ht.length,vt=new Array(xt);ft<xt;ft++)vt[ft]=ht[ft].fn;return vt},lt.prototype.listenerCount=function(ct){var dt=rt?rt+ct:ct,ht=this._events[dt];return ht?ht.fn?1:ht.length:0},lt.prototype.emit=function(ct,dt,ht,ft,xt,vt){var yt=rt?rt+ct:ct;if(!this._events[yt])return!1;var Et=this._events[yt],bt=arguments.length,wt,St;if(Et.fn){switch(Et.once&&this.removeListener(ct,Et.fn,void 0,!0),bt){case 1:return Et.fn.call(Et.context),!0;case 2:return Et.fn.call(Et.context,dt),!0;case 3:return Et.fn.call(Et.context,dt,ht),!0;case 4:return Et.fn.call(Et.context,dt,ht,ft),!0;case 5:return Et.fn.call(Et.context,dt,ht,ft,xt),!0;case 6:return Et.fn.call(Et.context,dt,ht,ft,xt,vt),!0}for(St=1,wt=new Array(bt-1);St<bt;St++)wt[St-1]=arguments[St];Et.fn.apply(Et.context,wt)}else{var Rt=Et.length,Ct;for(St=0;St<Rt;St++)switch(Et[St].once&&this.removeListener(ct,Et[St].fn,void 0,!0),bt){case 1:Et[St].fn.call(Et[St].context);break;case 2:Et[St].fn.call(Et[St].context,dt);break;case 3:Et[St].fn.call(Et[St].context,dt,ht);break;case 4:Et[St].fn.call(Et[St].context,dt,ht,ft);break;default:if(!wt)for(Ct=1,wt=new Array(bt-1);Ct<bt;Ct++)wt[Ct-1]=arguments[Ct];Et[St].fn.apply(Et[St].context,wt)}}return!0},lt.prototype.on=function(ct,dt,ht){return ot(this,ct,dt,ht,!1)},lt.prototype.once=function(ct,dt,ht){return ot(this,ct,dt,ht,!0)},lt.prototype.removeListener=function(ct,dt,ht,ft){var xt=rt?rt+ct:ct;if(!this._events[xt])return this;if(!dt)return at(this,xt),this;var vt=this._events[xt];if(vt.fn)vt.fn===dt&&(!ft||vt.once)&&(!ht||vt.context===ht)&&at(this,xt);else{for(var yt=0,Et=[],bt=vt.length;yt<bt;yt++)(vt[yt].fn!==dt||ft&&!vt[yt].once||ht&&vt[yt].context!==ht)&&Et.push(vt[yt]);Et.length?this._events[xt]=Et.length===1?Et[0]:Et:at(this,xt)}return this},lt.prototype.removeAllListeners=function(ct){var dt;return ct?(dt=rt?rt+ct:ct,this._events[dt]&&at(this,dt)):(this._events=new st,this._eventsCount=0),this},lt.prototype.off=lt.prototype.removeListener,lt.prototype.addListener=lt.prototype.on,lt.prefixed=rt,lt.EventEmitter=lt,tt.exports=lt})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);var earcut$2={exports:{}};earcut$2.exports=earcut;earcut$2.exports.default=earcut;function earcut(tt,et,rt){rt=rt||2;var st=et&&et.length,nt=st?et[0]*rt:tt.length,ot=linkedList(tt,0,nt,rt,!0),at=[];if(!ot||ot.next===ot.prev)return at;var lt,ut,ct,dt,ht,ft,xt;if(st&&(ot=eliminateHoles(tt,et,ot,rt)),tt.length>80*rt){lt=ct=tt[0],ut=dt=tt[1];for(var vt=rt;vt<nt;vt+=rt)ht=tt[vt],ft=tt[vt+1],ht<lt&&(lt=ht),ft<ut&&(ut=ft),ht>ct&&(ct=ht),ft>dt&&(dt=ft);xt=Math.max(ct-lt,dt-ut),xt=xt!==0?32767/xt:0}return earcutLinked(ot,at,rt,lt,ut,xt,0),at}function linkedList(tt,et,rt,st,nt){var ot,at;if(nt===signedArea(tt,et,rt,st)>0)for(ot=et;ot<rt;ot+=st)at=insertNode(ot,tt[ot],tt[ot+1],at);else for(ot=rt-st;ot>=et;ot-=st)at=insertNode(ot,tt[ot],tt[ot+1],at);return at&&equals(at,at.next)&&(removeNode(at),at=at.next),at}function filterPoints(tt,et){if(!tt)return tt;et||(et=tt);var rt=tt,st;do if(st=!1,!rt.steiner&&(equals(rt,rt.next)||area(rt.prev,rt,rt.next)===0)){if(removeNode(rt),rt=et=rt.prev,rt===rt.next)break;st=!0}else rt=rt.next;while(st||rt!==et);return et}function earcutLinked(tt,et,rt,st,nt,ot,at){if(tt){!at&&ot&&indexCurve(tt,st,nt,ot);for(var lt=tt,ut,ct;tt.prev!==tt.next;){if(ut=tt.prev,ct=tt.next,ot?isEarHashed(tt,st,nt,ot):isEar(tt)){et.push(ut.i/rt|0),et.push(tt.i/rt|0),et.push(ct.i/rt|0),removeNode(tt),tt=ct.next,lt=ct.next;continue}if(tt=ct,tt===lt){at?at===1?(tt=cureLocalIntersections(filterPoints(tt),et,rt),earcutLinked(tt,et,rt,st,nt,ot,2)):at===2&&splitEarcut(tt,et,rt,st,nt,ot):earcutLinked(filterPoints(tt),et,rt,st,nt,ot,1);break}}}}function isEar(tt){var et=tt.prev,rt=tt,st=tt.next;if(area(et,rt,st)>=0)return!1;for(var nt=et.x,ot=rt.x,at=st.x,lt=et.y,ut=rt.y,ct=st.y,dt=nt<ot?nt<at?nt:at:ot<at?ot:at,ht=lt<ut?lt<ct?lt:ct:ut<ct?ut:ct,ft=nt>ot?nt>at?nt:at:ot>at?ot:at,xt=lt>ut?lt>ct?lt:ct:ut>ct?ut:ct,vt=st.next;vt!==et;){if(vt.x>=dt&&vt.x<=ft&&vt.y>=ht&&vt.y<=xt&&pointInTriangle(nt,lt,ot,ut,at,ct,vt.x,vt.y)&&area(vt.prev,vt,vt.next)>=0)return!1;vt=vt.next}return!0}function isEarHashed(tt,et,rt,st){var nt=tt.prev,ot=tt,at=tt.next;if(area(nt,ot,at)>=0)return!1;for(var lt=nt.x,ut=ot.x,ct=at.x,dt=nt.y,ht=ot.y,ft=at.y,xt=lt<ut?lt<ct?lt:ct:ut<ct?ut:ct,vt=dt<ht?dt<ft?dt:ft:ht<ft?ht:ft,yt=lt>ut?lt>ct?lt:ct:ut>ct?ut:ct,Et=dt>ht?dt>ft?dt:ft:ht>ft?ht:ft,bt=zOrder(xt,vt,et,rt,st),wt=zOrder(yt,Et,et,rt,st),St=tt.prevZ,Rt=tt.nextZ;St&&St.z>=bt&&Rt&&Rt.z<=wt;){if(St.x>=xt&&St.x<=yt&&St.y>=vt&&St.y<=Et&&St!==nt&&St!==at&&pointInTriangle(lt,dt,ut,ht,ct,ft,St.x,St.y)&&area(St.prev,St,St.next)>=0||(St=St.prevZ,Rt.x>=xt&&Rt.x<=yt&&Rt.y>=vt&&Rt.y<=Et&&Rt!==nt&&Rt!==at&&pointInTriangle(lt,dt,ut,ht,ct,ft,Rt.x,Rt.y)&&area(Rt.prev,Rt,Rt.next)>=0))return!1;Rt=Rt.nextZ}for(;St&&St.z>=bt;){if(St.x>=xt&&St.x<=yt&&St.y>=vt&&St.y<=Et&&St!==nt&&St!==at&&pointInTriangle(lt,dt,ut,ht,ct,ft,St.x,St.y)&&area(St.prev,St,St.next)>=0)return!1;St=St.prevZ}for(;Rt&&Rt.z<=wt;){if(Rt.x>=xt&&Rt.x<=yt&&Rt.y>=vt&&Rt.y<=Et&&Rt!==nt&&Rt!==at&&pointInTriangle(lt,dt,ut,ht,ct,ft,Rt.x,Rt.y)&&area(Rt.prev,Rt,Rt.next)>=0)return!1;Rt=Rt.nextZ}return!0}function cureLocalIntersections(tt,et,rt){var st=tt;do{var nt=st.prev,ot=st.next.next;!equals(nt,ot)&&intersects(nt,st,st.next,ot)&&locallyInside(nt,ot)&&locallyInside(ot,nt)&&(et.push(nt.i/rt|0),et.push(st.i/rt|0),et.push(ot.i/rt|0),removeNode(st),removeNode(st.next),st=tt=ot),st=st.next}while(st!==tt);return filterPoints(st)}function splitEarcut(tt,et,rt,st,nt,ot){var at=tt;do{for(var lt=at.next.next;lt!==at.prev;){if(at.i!==lt.i&&isValidDiagonal(at,lt)){var ut=splitPolygon(at,lt);at=filterPoints(at,at.next),ut=filterPoints(ut,ut.next),earcutLinked(at,et,rt,st,nt,ot,0),earcutLinked(ut,et,rt,st,nt,ot,0);return}lt=lt.next}at=at.next}while(at!==tt)}function eliminateHoles(tt,et,rt,st){var nt=[],ot,at,lt,ut,ct;for(ot=0,at=et.length;ot<at;ot++)lt=et[ot]*st,ut=ot<at-1?et[ot+1]*st:tt.length,ct=linkedList(tt,lt,ut,st,!1),ct===ct.next&&(ct.steiner=!0),nt.push(getLeftmost(ct));for(nt.sort(compareX),ot=0;ot<nt.length;ot++)rt=eliminateHole(nt[ot],rt);return rt}function compareX(tt,et){return tt.x-et.x}function eliminateHole(tt,et){var rt=findHoleBridge(tt,et);if(!rt)return et;var st=splitPolygon(rt,tt);return filterPoints(st,st.next),filterPoints(rt,rt.next)}function findHoleBridge(tt,et){var rt=et,st=tt.x,nt=tt.y,ot=-1/0,at;do{if(nt<=rt.y&&nt>=rt.next.y&&rt.next.y!==rt.y){var lt=rt.x+(nt-rt.y)*(rt.next.x-rt.x)/(rt.next.y-rt.y);if(lt<=st&<>ot&&(ot=lt,at=rt.x<rt.next.x?rt:rt.next,lt===st))return at}rt=rt.next}while(rt!==et);if(!at)return null;var ut=at,ct=at.x,dt=at.y,ht=1/0,ft;rt=at;do st>=rt.x&&rt.x>=ct&&st!==rt.x&&pointInTriangle(nt<dt?st:ot,nt,ct,dt,nt<dt?ot:st,nt,rt.x,rt.y)&&(ft=Math.abs(nt-rt.y)/(st-rt.x),locallyInside(rt,tt)&&(ft<ht||ft===ht&&(rt.x>at.x||rt.x===at.x&§orContainsSector(at,rt)))&&(at=rt,ht=ft)),rt=rt.next;while(rt!==ut);return at}function sectorContainsSector(tt,et){return area(tt.prev,tt,et.prev)<0&&area(et.next,tt,tt.next)<0}function indexCurve(tt,et,rt,st){var nt=tt;do nt.z===0&&(nt.z=zOrder(nt.x,nt.y,et,rt,st)),nt.prevZ=nt.prev,nt.nextZ=nt.next,nt=nt.next;while(nt!==tt);nt.prevZ.nextZ=null,nt.prevZ=null,sortLinked(nt)}function sortLinked(tt){var et,rt,st,nt,ot,at,lt,ut,ct=1;do{for(rt=tt,tt=null,ot=null,at=0;rt;){for(at++,st=rt,lt=0,et=0;et<ct&&(lt++,st=st.nextZ,!!st);et++);for(ut=ct;lt>0||ut>0&&st;)lt!==0&&(ut===0||!st||rt.z<=st.z)?(nt=rt,rt=rt.nextZ,lt--):(nt=st,st=st.nextZ,ut--),ot?ot.nextZ=nt:tt=nt,nt.prevZ=ot,ot=nt;rt=st}ot.nextZ=null,ct*=2}while(at>1);return tt}function zOrder(tt,et,rt,st,nt){return tt=(tt-rt)*nt|0,et=(et-st)*nt|0,tt=(tt|tt<<8)&16711935,tt=(tt|tt<<4)&252645135,tt=(tt|tt<<2)&858993459,tt=(tt|tt<<1)&1431655765,et=(et|et<<8)&16711935,et=(et|et<<4)&252645135,et=(et|et<<2)&858993459,et=(et|et<<1)&1431655765,tt|et<<1}function getLeftmost(tt){var et=tt,rt=tt;do(et.x<rt.x||et.x===rt.x&&et.y<rt.y)&&(rt=et),et=et.next;while(et!==tt);return rt}function pointInTriangle(tt,et,rt,st,nt,ot,at,lt){return(nt-at)*(et-lt)>=(tt-at)*(ot-lt)&&(tt-at)*(st-lt)>=(rt-at)*(et-lt)&&(rt-at)*(ot-lt)>=(nt-at)*(st-lt)}function isValidDiagonal(tt,et){return tt.next.i!==et.i&&tt.prev.i!==et.i&&!intersectsPolygon(tt,et)&&(locallyInside(tt,et)&&locallyInside(et,tt)&&middleInside(tt,et)&&(area(tt.prev,tt,et.prev)||area(tt,et.prev,et))||equals(tt,et)&&area(tt.prev,tt,tt.next)>0&&area(et.prev,et,et.next)>0)}function area(tt,et,rt){return(et.y-tt.y)*(rt.x-et.x)-(et.x-tt.x)*(rt.y-et.y)}function equals(tt,et){return tt.x===et.x&&tt.y===et.y}function intersects(tt,et,rt,st){var nt=sign$3(area(tt,et,rt)),ot=sign$3(area(tt,et,st)),at=sign$3(area(rt,st,tt)),lt=sign$3(area(rt,st,et));return!!(nt!==ot&&at!==lt||nt===0&&onSegment(tt,rt,et)||ot===0&&onSegment(tt,st,et)||at===0&&onSegment(rt,tt,st)||lt===0&&onSegment(rt,et,st))}function onSegment(tt,et,rt){return et.x<=Math.max(tt.x,rt.x)&&et.x>=Math.min(tt.x,rt.x)&&et.y<=Math.max(tt.y,rt.y)&&et.y>=Math.min(tt.y,rt.y)}function sign$3(tt){return tt>0?1:tt<0?-1:0}function intersectsPolygon(tt,et){var rt=tt;do{if(rt.i!==tt.i&&rt.next.i!==tt.i&&rt.i!==et.i&&rt.next.i!==et.i&&intersects(rt,rt.next,tt,et))return!0;rt=rt.next}while(rt!==tt);return!1}function locallyInside(tt,et){return area(tt.prev,tt,tt.next)<0?area(tt,et,tt.next)>=0&&area(tt,tt.prev,et)>=0:area(tt,et,tt.prev)<0||area(tt,tt.next,et)<0}function middleInside(tt,et){var rt=tt,st=!1,nt=(tt.x+et.x)/2,ot=(tt.y+et.y)/2;do rt.y>ot!=rt.next.y>ot&&rt.next.y!==rt.y&&nt<(rt.next.x-rt.x)*(ot-rt.y)/(rt.next.y-rt.y)+rt.x&&(st=!st),rt=rt.next;while(rt!==tt);return st}function splitPolygon(tt,et){var rt=new Node$2(tt.i,tt.x,tt.y),st=new Node$2(et.i,et.x,et.y),nt=tt.next,ot=et.prev;return tt.next=et,et.prev=tt,rt.next=nt,nt.prev=rt,st.next=rt,rt.prev=st,ot.next=st,st.prev=ot,st}function insertNode(tt,et,rt,st){var nt=new Node$2(tt,et,rt);return st?(nt.next=st.next,nt.prev=st,st.next.prev=nt,st.next=nt):(nt.prev=nt,nt.next=nt),nt}function removeNode(tt){tt.next.prev=tt.prev,tt.prev.next=tt.next,tt.prevZ&&(tt.prevZ.nextZ=tt.nextZ),tt.nextZ&&(tt.nextZ.prevZ=tt.prevZ)}function Node$2(tt,et,rt){this.i=tt,this.x=et,this.y=rt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}earcut.deviation=function(tt,et,rt,st){var nt=et&&et.length,ot=nt?et[0]*rt:tt.length,at=Math.abs(signedArea(tt,0,ot,rt));if(nt)for(var lt=0,ut=et.length;lt<ut;lt++){var ct=et[lt]*rt,dt=lt<ut-1?et[lt+1]*rt:tt.length;at-=Math.abs(signedArea(tt,ct,dt,rt))}var ht=0;for(lt=0;lt<st.length;lt+=3){var ft=st[lt]*rt,xt=st[lt+1]*rt,vt=st[lt+2]*rt;ht+=Math.abs((tt[ft]-tt[vt])*(tt[xt+1]-tt[ft+1])-(tt[ft]-tt[xt])*(tt[vt+1]-tt[ft+1]))}return at===0&&ht===0?0:Math.abs((ht-at)/at)};function signedArea(tt,et,rt,st){for(var nt=0,ot=et,at=rt-st;ot<rt;ot+=st)nt+=(tt[at]-tt[ot])*(tt[ot+1]+tt[at+1]),at=ot;return nt}earcut.flatten=function(tt){for(var et=tt[0][0].length,rt={vertices:[],holes:[],dimensions:et},st=0,nt=0;nt<tt.length;nt++){for(var ot=0;ot<tt[nt].length;ot++)for(var at=0;at<et;at++)rt.vertices.push(tt[nt][ot][at]);nt>0&&(st+=tt[nt-1].length,rt.holes.push(st))}return rt};var earcutExports=earcut$2.exports;const earcut$1=getDefaultExportFromCjs(earcutExports);var punycode$1={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */punycode$1.exports;(function(tt,et){(function(rt){var st=et&&!et.nodeType&&et,nt=tt&&!tt.nodeType&&tt,ot=typeof commonjsGlobal=="object"&&commonjsGlobal;(ot.global===ot||ot.window===ot||ot.self===ot)&&(rt=ot);var at,lt=2147483647,ut=36,ct=1,dt=26,ht=38,ft=700,xt=72,vt=128,yt="-",Et=/^xn--/,bt=/[^\x20-\x7E]/,wt=/[\x2E\u3002\uFF0E\uFF61]/g,St={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Rt=ut-ct,Ct=Math.floor,It=String.fromCharCode,jt;function Pt(Bt){throw new RangeError(St[Bt])}function Ot(Bt,qt){for(var Qt=Bt.length,Yt=[];Qt--;)Yt[Qt]=qt(Bt[Qt]);return Yt}function Ut(Bt,qt){var Qt=Bt.split("@"),Yt="";Qt.length>1&&(Yt=Qt[0]+"@",Bt=Qt[1]),Bt=Bt.replace(wt,".");var tr=Bt.split("."),lr=Ot(tr,qt).join(".");return Yt+lr}function Nt(Bt){for(var qt=[],Qt=0,Yt=Bt.length,tr,lr;Qt<Yt;)tr=Bt.charCodeAt(Qt++),tr>=55296&&tr<=56319&&Qt<Yt?(lr=Bt.charCodeAt(Qt++),(lr&64512)==56320?qt.push(((tr&1023)<<10)+(lr&1023)+65536):(qt.push(tr),Qt--)):qt.push(tr);return qt}function Ht(Bt){return Ot(Bt,function(qt){var Qt="";return qt>65535&&(qt-=65536,Qt+=It(qt>>>10&1023|55296),qt=56320|qt&1023),Qt+=It(qt),Qt}).join("")}function Lt(Bt){return Bt-48<10?Bt-22:Bt-65<26?Bt-65:Bt-97<26?Bt-97:ut}function kt(Bt,qt){return Bt+22+75*(Bt<26)-((qt!=0)<<5)}function $t(Bt,qt,Qt){var Yt=0;for(Bt=Qt?Ct(Bt/ft):Bt>>1,Bt+=Ct(Bt/qt);Bt>Rt*dt>>1;Yt+=ut)Bt=Ct(Bt/Rt);return Ct(Yt+(Rt+1)*Bt/(Bt+ht))}function Ft(Bt){var qt=[],Qt=Bt.length,Yt,tr=0,lr=vt,ur=xt,mr,yr,or,hr,pr,_r,Ar,Hr,Ur;for(mr=Bt.lastIndexOf(yt),mr<0&&(mr=0),yr=0;yr<mr;++yr)Bt.charCodeAt(yr)>=128&&Pt("not-basic"),qt.push(Bt.charCodeAt(yr));for(or=mr>0?mr+1:0;or<Qt;){for(hr=tr,pr=1,_r=ut;or>=Qt&&Pt("invalid-input"),Ar=Lt(Bt.charCodeAt(or++)),(Ar>=ut||Ar>Ct((lt-tr)/pr))&&Pt("overflow"),tr+=Ar*pr,Hr=_r<=ur?ct:_r>=ur+dt?dt:_r-ur,!(Ar<Hr);_r+=ut)Ur=ut-Hr,pr>Ct(lt/Ur)&&Pt("overflow"),pr*=Ur;Yt=qt.length+1,ur=$t(tr-hr,Yt,hr==0),Ct(tr/Yt)>lt-lr&&Pt("overflow"),lr+=Ct(tr/Yt),tr%=Yt,qt.splice(tr++,0,lr)}return Ht(qt)}function Gt(Bt){var qt,Qt,Yt,tr,lr,ur,mr,yr,or,hr,pr,_r=[],Ar,Hr,Ur,os;for(Bt=Nt(Bt),Ar=Bt.length,qt=vt,Qt=0,lr=xt,ur=0;ur<Ar;++ur)pr=Bt[ur],pr<128&&_r.push(It(pr));for(Yt=tr=_r.length,tr&&_r.push(yt);Yt<Ar;){for(mr=lt,ur=0;ur<Ar;++ur)pr=Bt[ur],pr>=qt&&pr<mr&&(mr=pr);for(Hr=Yt+1,mr-qt>Ct((lt-Qt)/Hr)&&Pt("overflow"),Qt+=(mr-qt)*Hr,qt=mr,ur=0;ur<Ar;++ur)if(pr=Bt[ur],pr<qt&&++Qt>lt&&Pt("overflow"),pr==qt){for(yr=Qt,or=ut;hr=or<=lr?ct:or>=lr+dt?dt:or-lr,!(yr<hr);or+=ut)os=yr-hr,Ur=ut-hr,_r.push(It(kt(hr+os%Ur,0))),yr=Ct(os/Ur);_r.push(It(kt(yr,0))),lr=$t(Qt,Hr,Yt==tr),Qt=0,++Yt}++Qt,++qt}return _r.join("")}function Mt(Bt){return Ut(Bt,function(qt){return Et.test(qt)?Ft(qt.slice(4).toLowerCase()):qt})}function Vt(Bt){return Ut(Bt,function(qt){return bt.test(qt)?"xn--"+Gt(qt):qt})}if(at={version:"1.4.1",ucs2:{decode:Nt,encode:Ht},decode:Ft,encode:Gt,toASCII:Vt,toUnicode:Mt},st&&nt)if(tt.exports==st)nt.exports=at;else for(jt in at)at.hasOwnProperty(jt)&&(st[jt]=at[jt]);else rt.punycode=at})(commonjsGlobal)})(punycode$1,punycode$1.exports);var punycodeExports=punycode$1.exports,type=TypeError;const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(__viteBrowserExternal$1);var hasMap=typeof Map=="function"&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize$1=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get=="function"?mapSizeDescriptor.get:null,mapForEach=hasMap&&Map.prototype.forEach,hasSet=typeof Set=="function"&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get=="function"?setSizeDescriptor.get:null,setForEach=hasSet&&Set.prototype.forEach,hasWeakMap=typeof WeakMap=="function"&&WeakMap.prototype,weakMapHas=hasWeakMap?WeakMap.prototype.has:null,hasWeakSet=typeof WeakSet=="function"&&WeakSet.prototype,weakSetHas=hasWeakSet?WeakSet.prototype.has:null,hasWeakRef=typeof WeakRef=="function"&&WeakRef.prototype,weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null,booleanValueOf=Boolean.prototype.valueOf,objectToString=Object.prototype.toString,functionToString=Function.prototype.toString,$match=String.prototype.match,$slice=String.prototype.slice,$replace$1=String.prototype.replace,$toUpperCase=String.prototype.toUpperCase,$toLowerCase=String.prototype.toLowerCase,$test=RegExp.prototype.test,$concat$1=Array.prototype.concat,$join=Array.prototype.join,$arrSlice=Array.prototype.slice,$floor=Math.floor,bigIntValueOf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,gOPS=Object.getOwnPropertySymbols,symToString=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hasShammedSymbols=typeof Symbol=="function"&&typeof Symbol.iterator=="object",toStringTag=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hasShammedSymbols||!0)?Symbol.toStringTag:null,isEnumerable=Object.prototype.propertyIsEnumerable,gPO=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(tt){return tt.__proto__}:null);function addNumericSeparator(tt,et){if(tt===1/0||tt===-1/0||tt!==tt||tt&&tt>-1e3&&tt<1e3||$test.call(/e/,et))return et;var rt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof tt=="number"){var st=tt<0?-$floor(-tt):$floor(tt);if(st!==tt){var nt=String(st),ot=$slice.call(et,nt.length+1);return $replace$1.call(nt,rt,"$&_")+"."+$replace$1.call($replace$1.call(ot,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace$1.call(et,rt,"$&_")}var utilInspect=require$$0$1,inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,quotes={__proto__:null,double:'"',single:"'"},quoteREs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},objectInspect=function tt(et,rt,st,nt){var ot=rt||{};if(has$3(ot,"quoteStyle")&&!has$3(quotes,ot.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$3(ot,"maxStringLength")&&(typeof ot.maxStringLength=="number"?ot.maxStringLength<0&&ot.maxStringLength!==1/0:ot.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var at=has$3(ot,"customInspect")?ot.customInspect:!0;if(typeof at!="boolean"&&at!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$3(ot,"indent")&&ot.indent!==null&&ot.indent!==" "&&!(parseInt(ot.indent,10)===ot.indent&&ot.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$3(ot,"numericSeparator")&&typeof ot.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var lt=ot.numericSeparator;if(typeof et>"u")return"undefined";if(et===null)return"null";if(typeof et=="boolean")return et?"true":"false";if(typeof et=="string")return inspectString(et,ot);if(typeof et=="number"){if(et===0)return 1/0/et>0?"0":"-0";var ut=String(et);return lt?addNumericSeparator(et,ut):ut}if(typeof et=="bigint"){var ct=String(et)+"n";return lt?addNumericSeparator(et,ct):ct}var dt=typeof ot.depth>"u"?5:ot.depth;if(typeof st>"u"&&(st=0),st>=dt&&dt>0&&typeof et=="object")return isArray$3(et)?"[Array]":"[Object]";var ht=getIndent(ot,st);if(typeof nt>"u")nt=[];else if(indexOf(nt,et)>=0)return"[Circular]";function ft(Lt,kt,$t){if(kt&&(nt=$arrSlice.call(nt),nt.push(kt)),$t){var Ft={depth:ot.depth};return has$3(ot,"quoteStyle")&&(Ft.quoteStyle=ot.quoteStyle),tt(Lt,Ft,st+1,nt)}return tt(Lt,ot,st+1,nt)}if(typeof et=="function"&&!isRegExp$1(et)){var xt=nameOf(et),vt=arrObjKeys(et,ft);return"[Function"+(xt?": "+xt:" (anonymous)")+"]"+(vt.length>0?" { "+$join.call(vt,", ")+" }":"")}if(isSymbol(et)){var yt=hasShammedSymbols?$replace$1.call(String(et),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(et);return typeof et=="object"&&!hasShammedSymbols?markBoxed(yt):yt}if(isElement(et)){for(var Et="<"+$toLowerCase.call(String(et.nodeName)),bt=et.attributes||[],wt=0;wt<bt.length;wt++)Et+=" "+bt[wt].name+"="+wrapQuotes(quote(bt[wt].value),"double",ot);return Et+=">",et.childNodes&&et.childNodes.length&&(Et+="..."),Et+="</"+$toLowerCase.call(String(et.nodeName))+">",Et}if(isArray$3(et)){if(et.length===0)return"[]";var St=arrObjKeys(et,ft);return ht&&!singleLineValues(St)?"["+indentedJoin(St,ht)+"]":"[ "+$join.call(St,", ")+" ]"}if(isError(et)){var Rt=arrObjKeys(et,ft);return!("cause"in Error.prototype)&&"cause"in et&&!isEnumerable.call(et,"cause")?"{ ["+String(et)+"] "+$join.call($concat$1.call("[cause]: "+ft(et.cause),Rt),", ")+" }":Rt.length===0?"["+String(et)+"]":"{ ["+String(et)+"] "+$join.call(Rt,", ")+" }"}if(typeof et=="object"&&at){if(inspectSymbol&&typeof et[inspectSymbol]=="function"&&utilInspect)return utilInspect(et,{depth:dt-st});if(at!=="symbol"&&typeof et.inspect=="function")return et.inspect()}if(isMap(et)){var Ct=[];return mapForEach&&mapForEach.call(et,function(Lt,kt){Ct.push(ft(kt,et,!0)+" => "+ft(Lt,et))}),collectionOf("Map",mapSize$1.call(et),Ct,ht)}if(isSet(et)){var It=[];return setForEach&&setForEach.call(et,function(Lt){It.push(ft(Lt,et))}),collectionOf("Set",setSize.call(et),It,ht)}if(isWeakMap(et))return weakCollectionOf("WeakMap");if(isWeakSet(et))return weakCollectionOf("WeakSet");if(isWeakRef(et))return weakCollectionOf("WeakRef");if(isNumber(et))return markBoxed(ft(Number(et)));if(isBigInt(et))return markBoxed(ft(bigIntValueOf.call(et)));if(isBoolean(et))return markBoxed(booleanValueOf.call(et));if(isString(et))return markBoxed(ft(String(et)));if(typeof window<"u"&&et===window)return"{ [object Window] }";if(typeof globalThis<"u"&&et===globalThis||typeof commonjsGlobal<"u"&&et===commonjsGlobal)return"{ [object globalThis] }";if(!isDate(et)&&!isRegExp$1(et)){var jt=arrObjKeys(et,ft),Pt=gPO?gPO(et)===Object.prototype:et instanceof Object||et.constructor===Object,Ot=et instanceof Object?"":"null prototype",Ut=!Pt&&toStringTag&&Object(et)===et&&toStringTag in et?$slice.call(toStr(et),8,-1):Ot?"Object":"",Nt=Pt||typeof et.constructor!="function"?"":et.constructor.name?et.constructor.name+" ":"",Ht=Nt+(Ut||Ot?"["+$join.call($concat$1.call([],Ut||[],Ot||[]),": ")+"] ":"");return jt.length===0?Ht+"{}":ht?Ht+"{"+indentedJoin(jt,ht)+"}":Ht+"{ "+$join.call(jt,", ")+" }"}return String(et)};function wrapQuotes(tt,et,rt){var st=rt.quoteStyle||et,nt=quotes[st];return nt+tt+nt}function quote(tt){return $replace$1.call(String(tt),/"/g,""")}function canTrustToString(tt){return!toStringTag||!(typeof tt=="object"&&(toStringTag in tt||typeof tt[toStringTag]<"u"))}function isArray$3(tt){return toStr(tt)==="[object Array]"&&canTrustToString(tt)}function isDate(tt){return toStr(tt)==="[object Date]"&&canTrustToString(tt)}function isRegExp$1(tt){return toStr(tt)==="[object RegExp]"&&canTrustToString(tt)}function isError(tt){return toStr(tt)==="[object Error]"&&canTrustToString(tt)}function isString(tt){return toStr(tt)==="[object String]"&&canTrustToString(tt)}function isNumber(tt){return toStr(tt)==="[object Number]"&&canTrustToString(tt)}function isBoolean(tt){return toStr(tt)==="[object Boolean]"&&canTrustToString(tt)}function isSymbol(tt){if(hasShammedSymbols)return tt&&typeof tt=="object"&&tt instanceof Symbol;if(typeof tt=="symbol")return!0;if(!tt||typeof tt!="object"||!symToString)return!1;try{return symToString.call(tt),!0}catch{}return!1}function isBigInt(tt){if(!tt||typeof tt!="object"||!bigIntValueOf)return!1;try{return bigIntValueOf.call(tt),!0}catch{}return!1}var hasOwn$1=Object.prototype.hasOwnProperty||function(tt){return tt in this};function has$3(tt,et){return hasOwn$1.call(tt,et)}function toStr(tt){return objectToString.call(tt)}function nameOf(tt){if(tt.name)return tt.name;var et=$match.call(functionToString.call(tt),/^function\s*([\w$]+)/);return et?et[1]:null}function indexOf(tt,et){if(tt.indexOf)return tt.indexOf(et);for(var rt=0,st=tt.length;rt<st;rt++)if(tt[rt]===et)return rt;return-1}function isMap(tt){if(!mapSize$1||!tt||typeof tt!="object")return!1;try{mapSize$1.call(tt);try{setSize.call(tt)}catch{return!0}return tt instanceof Map}catch{}return!1}function isWeakMap(tt){if(!weakMapHas||!tt||typeof tt!="object")return!1;try{weakMapHas.call(tt,weakMapHas);try{weakSetHas.call(tt,weakSetHas)}catch{return!0}return tt instanceof WeakMap}catch{}return!1}function isWeakRef(tt){if(!weakRefDeref||!tt||typeof tt!="object")return!1;try{return weakRefDeref.call(tt),!0}catch{}return!1}function isSet(tt){if(!setSize||!tt||typeof tt!="object")return!1;try{setSize.call(tt);try{mapSize$1.call(tt)}catch{return!0}return tt instanceof Set}catch{}return!1}function isWeakSet(tt){if(!weakSetHas||!tt||typeof tt!="object")return!1;try{weakSetHas.call(tt,weakSetHas);try{weakMapHas.call(tt,weakMapHas)}catch{return!0}return tt instanceof WeakSet}catch{}return!1}function isElement(tt){return!tt||typeof tt!="object"?!1:typeof HTMLElement<"u"&&tt instanceof HTMLElement?!0:typeof tt.nodeName=="string"&&typeof tt.getAttribute=="function"}function inspectString(tt,et){if(tt.length>et.maxStringLength){var rt=tt.length-et.maxStringLength,st="... "+rt+" more character"+(rt>1?"s":"");return inspectString($slice.call(tt,0,et.maxStringLength),et)+st}var nt=quoteREs[et.quoteStyle||"single"];nt.lastIndex=0;var ot=$replace$1.call($replace$1.call(tt,nt,"\\$1"),/[\x00-\x1f]/g,lowbyte);return wrapQuotes(ot,"single",et)}function lowbyte(tt){var et=tt.charCodeAt(0),rt={8:"b",9:"t",10:"n",12:"f",13:"r"}[et];return rt?"\\"+rt:"\\x"+(et<16?"0":"")+$toUpperCase.call(et.toString(16))}function markBoxed(tt){return"Object("+tt+")"}function weakCollectionOf(tt){return tt+" { ? }"}function collectionOf(tt,et,rt,st){var nt=st?indentedJoin(rt,st):$join.call(rt,", ");return tt+" ("+et+") {"+nt+"}"}function singleLineValues(tt){for(var et=0;et<tt.length;et++)if(indexOf(tt[et],`
|
|
226
|
+
`,D$1=16,Fe$1=({reverseOrder:tt,position:et="top-center",toastOptions:rt,gutter:st,children:nt,toasterId:ot,containerStyle:at,containerClassName:lt})=>{let{toasts:ut,handlers:ct}=w$1(rt,ot);return reactExports.createElement("div",{"data-rht-toaster":ot||"",style:{position:"fixed",zIndex:9999,top:D$1,left:D$1,right:D$1,bottom:D$1,pointerEvents:"none",...at},className:lt,onMouseEnter:ct.startPause,onMouseLeave:ct.endPause},ut.map(dt=>{let ht=dt.position||et,ft=ct.calculateOffset(dt,{reverseOrder:tt,gutter:st,defaultPosition:et}),xt=Me$1(ht,ft);return reactExports.createElement(we$1,{id:dt.id,key:dt.id,onHeightUpdate:ct.updateHeight,className:dt.visible?Ce$1:"",style:xt},dt.type==="custom"?h$1(dt.message,dt):nt?nt(dt):reactExports.createElement(N$2,{toast:dt,position:ht}))}))},zt=n$1;const DEFAULT_POSITION="top-right";function useToast(){return{success:(tt,et)=>zt.custom(jsxRuntimeExports.jsx(Alert,{type:"success",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),error:(tt,et)=>zt.custom(jsxRuntimeExports.jsx(Alert,{type:"danger",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),info:(tt,et)=>zt.custom(jsxRuntimeExports.jsx(Alert,{type:"info",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),warning:(tt,et)=>zt.custom(jsxRuntimeExports.jsx(Alert,{type:"warning",isToast:!0,isDismissible:et==null?void 0:et.isDismissible,className:"mb-12",children:tt}),{id:et==null?void 0:et.id,duration:et==null?void 0:et.duration,position:(et==null?void 0:et.position)??DEFAULT_POSITION}),loading:zt.loading,dismiss:tt=>zt.dismiss(tt),remove:tt=>zt.remove(tt)}}const useHttpErrorToast=({active:tt=!0,...et})=>{const rt=reactExports.useRef(),st=useToast(),{t:nt}=useTranslation();return reactExports.useEffect(()=>{if(tt){const ot=odeServices.notify().events().subscribe(LAYER_NAME.TRANSPORT,at=>{var lt;if(!(at!=null&&at.data))return;const{response:ut}=at.data,ct=((lt=at.data.payload)==null?void 0:lt.error)||([400,401,403,404,408,413,500,504].includes(ut==null?void 0:ut.status)?`e${at.data.response.status}`:void 0)||(ut==null?void 0:ut.statusText);typeof ct=="string"&&(rt.current=nt(ct),st.error(React$4.createElement("div",{children:[rt.current]}),et))});return()=>ot.revoke()}},[nt,st,tt]),rt.current};function useIsAdml(){const[tt,et]=reactExports.useState(!1);reactExports.useEffect(()=>{rt()},[]);const rt=reactExports.useCallback(async()=>{const st=await odeServices.session().isAdml();et(st)},[]);return{isAdml:tt}}const useLibraryUrl=tt=>{var et;const{user:rt,appCode:st}=useEdificeClient(),nt=e$3[st],ot=rt==null?void 0:rt.apps.find(dt=>dt.isExternal&&dt.address.includes("library"));if(!ot)return null;const at=(et=ot.address)==null?void 0:et.split("?");if(!at||at.length<2)return null;let lt=at[0];lt.endsWith("/")||(lt=`${lt}/`);const ut=at==null?void 0:at[1],ct=`application%5B0%5D=${nt}&page=1&sort_field=views&sort_order=desc`;return`${lt}search/?${ut}&${ct}`},useWorkspaceFile=()=>({createOrUpdate:async({alt:tt,uri:et,blob:rt,legend:st,parentId:nt,application:ot,visibility:at})=>{const lt=/\/workspace\/document\/([0-9a-fA-F-]+)/,ut=(et??"").match(lt);if(ut&&ut.length===2){const ct=ut[1],dt=await odeServices.workspace().searchDocuments({filter:"all",id:ct,limit:1}),ht=dt.length?dt[0].name:void 0;await odeServices.workspace().updateFile(ct,rt,{alt:tt,legend:st,name:ht});const ft=(await odeServices.workspace().searchDocuments({filter:"all",id:ct,limit:1}))[0];return{file:ft,src:`/workspace/${ft.public?"pub/":""}document/${ct}`}}else{const ct=await odeServices.workspace().saveFile(rt,{application:ot,parentId:nt,visibility:at});return`/workspace/${ct.public?"pub/":""}document/${ct._id}`}},create:async(tt,et)=>await odeServices.workspace().saveFile(tt,et),remove:async tt=>!tt||Array.isArray(tt)&&tt.length===0?Promise.resolve():await odeServices.workspace().deleteFile(Array.isArray(tt)?tt:[tt])}),useMediaLibrary=()=>{const tt=reactExports.useRef(null),[et,rt]=reactExports.useState(),{remove:st}=useWorkspaceFile();return{ref:tt,libraryMedia:et,setLibraryMedia:rt,onCancel:async nt=>{var ot,at;(ot=tt.current)!=null&&ot.type&&nt&&nt.length>0&&await st(nt),(at=tt.current)==null||at.hide()},onSuccess:nt=>{var ot,at,lt,ut;let ct;switch((ot=tt.current)==null?void 0:ot.type){case"video":{if(typeof nt=="object")ct=nt[0];else{const dt=new DOMParser().parseFromString(nt,"text/html").body.firstChild,ht=dt==null?void 0:dt.getAttribute("src");(at=tt.current)==null||at.hide(),ct=ht}break}case"embedder":{const dt=new DOMParser().parseFromString(nt,"text/html").body.firstChild,ht=dt==null?void 0:dt.getAttribute("src");(lt=tt.current)==null||lt.hide(),ct=ht;break}case"audio":{nt.length===void 0?ct=nt:ct=nt[0];break}case"hyperlink":{ct=nt;break}case"image":{ct=`/workspace/document/${nt[0]._id}`;break}default:ct=nt[0]}(ut=tt.current)==null||ut.hide(),rt(ct)},onTabChange:async(nt,ot)=>{var at;(at=tt.current)!=null&&at.type&&ot&&ot.length>0&&await st(ot)}}};function useScrollToTop(){const tt=document.querySelector("html");return()=>{tt&&tt.scrollIntoView()}}function useToggle(tt=!1){const[et,rt]=reactExports.useState(tt),st=reactExports.useCallback(()=>{rt(nt=>!nt)},[]);return[et,st]}const EdificeThemeContext=reactExports.createContext(null);function useEdificeTheme(){const tt=reactExports.useContext(EdificeThemeContext);if(!tt)throw new Error("Cannot be used outside of EdificeThemeProvider");return tt}function useUser(){const{user:tt,userDescription:et}=useEdificeClient(),{theme:rt}=useEdificeTheme();function st(){let nt=et==null?void 0:et.picture;return(!nt||nt==="no-avatar.jpg"||nt==="no-avatar.svg")&&(nt=`${rt==null?void 0:rt.basePath}/img/illustrations/no-avatar.svg`),nt}return{user:tt,avatar:st(),userDescription:et}}const useUpload=(tt,et="media-library")=>{const[rt,st]=reactExports.useState({}),{browser:nt,device:ot}=useBrowserInfo(navigator.userAgent),{create:at}=useWorkspaceFile(),{t:lt}=useTranslation(),ut=reactExports.useCallback(Et=>rt[s$2(Et)],[rt]),ct=(Et,bt)=>{st(wt=>{const St=s$2(Et);return{...wt,[St]:bt}})},dt=Et=>{st(bt=>{const wt=s$2(Et),{[wt]:St,...Rt}=bt;return Rt})},ht=()=>{const Et=new Date;return`${Et.getFullYear()}-${String(Et.getMonth()+1).padStart(2,"0")}-${String(Et.getDate()).padStart(2,"0")} ${String(Et.getHours()).padStart(2,"0")}h${String(Et.getMinutes()).padStart(2,"0")} `+lt("bbm.video.recorder.defaultName")};async function ft(Et,bt){ct(Et,"loading");try{let wt;return et==="media-library"&&Et.type.includes("video")?wt=await vt(Et,{filename:Et.name,...bt}):wt=await at(Et,{application:et,visibility:tt}),ct(Et,"success"),wt}catch(wt){return console.error(wt),ct(Et,"error"),null}}async function xt(Et,bt){ct(Et,"loading");try{let wt;if(Et.type.includes("video"))wt=await vt(Et,bt);else throw new Error(ERROR_CODE.NOT_SUPPORTED);return ct(Et,"success"),wt}catch(wt){return console.error(wt),ct(Et,"error"),null}}const vt=async(Et,bt)=>{const wt={data:{device:ot.type,browser:{name:nt.name,version:nt.version},url:window.location.hostname,file:Et,filename:ht()??"filename",weight:Et.size},appCode:et,captation:!(Et instanceof File),duration:(bt==null?void 0:bt.duration)??0},St=await odeServices.video().upload(wt);if(St.state==="succeed")return{_id:St.videoworkspaceid,file:St.videoid,name:wt.data.filename,eType:"file",eParent:"",children:[],created:new Date,_shared:[],_isShared:!1,owner:{userId:"",displayName:""}};throw St.state==="error"?new Error(St.code||"Error while uploading video"):new Error("Video encoding is still running")};function yt(Et,bt,wt){return s$2(bt,s$2(Et)),ft(bt,wt)}return{getUploadStatus:ut,setUploadStatus:ct,clearUploadStatus:dt,uploadFile:ft,uploadAlternateFile:yt,uploadBlob:xt}},useUploadFiles=({handleOnChange:tt,visibility:et,application:rt})=>{const[st,nt]=reactExports.useState([]),[ot,at]=reactExports.useState(void 0),{files:lt,deleteFile:ut,replaceFileAt:ct,inputRef:dt}=useDropzoneContext(),{remove:ht,createOrUpdate:ft}=useWorkspaceFile(),{getUploadStatus:xt,setUploadStatus:vt,clearUploadStatus:yt,uploadFile:Et,uploadAlternateFile:bt}=useUpload(et,rt),wt=reactExports.useCallback(()=>{dt.current&&(dt.current.value="")},[dt]),St=reactExports.useCallback(Pt=>{Pt.forEach(async(Ot,Ut)=>{if(Ot==null)return;let Nt,Ht;if(Ot.type.startsWith("image"))try{Ht=await p$3.resizeImageFile(Ot),Nt=await bt(Ot,Ht),ct(Ut,Ht)}catch(Lt){console.error(Lt)}!Nt&&!Ht&&(Nt=await Et(Ot)),Nt?nt(Lt=>[...Lt,Nt]):wt()})},[bt,Et,ct]);reactExports.useEffect(()=>{let Pt=0;const Ot=lt.map(Ut=>{if(Pt>=5)return null;const Nt=xt(Ut);return Nt==="loading"&&Pt++,Nt?null:Ut});Ot.forEach(Ut=>Ut&&vt(Ut,"idle")),St(Ot)},[lt,st,xt,vt,St]),reactExports.useEffect(()=>{const Pt=Rt(lt,st);tt(Pt)},[st]);const Rt=(Pt,Ot)=>{const Ut=Pt.reduce((Nt,Ht,Lt)=>(Nt[Ht.name]=Lt,Nt),{});return Ot.sort((Nt,Ht)=>Ut[Nt.name]-Ut[Ht.name])};async function Ct(Pt){const Ot=st.find(Ut=>Ut.name===Pt.name);Ot&&(await ht(Ot),yt(Pt),nt(Ut=>Ut.filter(Nt=>Nt.name!==(Ot==null?void 0:Ot.name)))),ut(Pt),wt()}async function It({blob:Pt,legend:Ot,altText:Ut}){if(ot)try{const Nt=await ft({blob:Pt,legend:Ot,alt:Ut,uri:jt(ot)});Nt&&typeof Nt=="object"&&nt(Ht=>Ht.map(Lt=>Lt._id===Nt.file._id?{...Nt.file,title:Ot,alt:Ut}:Lt))}finally{at(void 0)}}const jt=(Pt,Ot)=>{const Ut=`/workspace/${Pt!=null&&Pt.public?"pub/":""}document/${Pt==null?void 0:Pt._id}`;return Pt?Ot?m$3(Ut):Ut:""};return{files:lt,getUploadStatus:xt,clearUploadStatus:yt,uploadedFiles:st,editingImage:ot,setEditingImage:at,getUrl:jt,updateImage:It,uploadFile:Et,removeFile:Ct}};function useWorkspaceSearch(tt,et,rt,st){const nt=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|listDocuments"),ot=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|listFolders");function at(dt,ht){switch(ht.type){case"update":{const ft=findNodeById(dt,ht.folderId);return ft&&(ft.children=ht.subfolders.map(xt=>({id:xt._id||"",name:xt.name})),ft.files=ht.files),{...dt}}default:throw Error("[useWorkspaceSearch] Unknown action type: "+ht.type)}}const[lt,ut]=reactExports.useReducer(at,{id:tt,name:et,section:!0}),ct=reactExports.useCallback(async dt=>{if(nt&&ot){const ht=dt===tt?"":dt,ft=await odeServices.workspace().listDocuments(rt,ht),xt=[],vt=[];ft.filter(yt=>{if(!st||yt.eType==="folder")return!0;const Et=DocumentHelper.getRole(yt);return typeof st=="string"?st===Et:Array.isArray(st)?st.findIndex(bt=>bt===Et)>=0:!1}).forEach(yt=>{yt.eType==="folder"?xt.push(yt):vt.push(yt)}),ut({folderId:dt,subfolders:xt,files:vt,type:"update"})}},[nt,ot,tt,rt,st]);return{root:lt,loadContent:ct}}function useXitiTrackPageLoad(){const[tt,et]=reactExports.useState("pending"),{currentApp:rt}=useEdificeClient();reactExports.useEffect(()=>{st()},[]);const st=async()=>{if(!rt){et("[Xiti] Error, currentApp is not defined.");return}try{await odeServices.analytics().trackPageLoad(window.location.pathname,rt),console.info(`[Xiti] Success tracking page ${window.location.pathname}`),et(`[Xiti] Success tracking page ${window.location.pathname}`)}catch(nt){console.error("[Xiti] Error Tracking Page Load",nt),et(`[Xiti] Error Tracking Page Load: ${nt}`)}};return{xitiStatus:tt}}function useZendeskGuide(){const{currentLanguage:tt}=useEdificeClient(),{userDescription:et}=useUser(),{isAdml:rt}=useIsAdml(),{theme:st}=useEdificeTheme(),nt=window.innerWidth<=768,ot=useHasWorkflow("net.atos.entng.support.controllers.DisplayController|view"),[at,lt]=reactExports.useState(""),[ut,ct]=reactExports.useState(void 0),dt=()=>{const ht=at.split("/");let ft="",xt="";if(ut!=null&&ut.labels&&Object.keys(ut==null?void 0:ut.labels).length>0&&ht.length>1){for(let vt=1;vt<ht.length;vt++)ht[vt].length>0&&ht[vt].match(/\d/)==null&&(ft.length===0?ft=ht[vt]:ft=ft+"/"+ht[vt]);ut!=null&&ut.labels&&Object.prototype.hasOwnProperty.call(ut==null?void 0:ut.labels,ft)?xt=ut==null?void 0:ut.labels[ft]:ut!=null&&ut.default&&String(ut.default).length>0&&(xt=ut==null?void 0:ut.default)}else ut!=null&&ut.default&&String(ut==null?void 0:ut.default).length>0&&(xt=ut==null?void 0:ut.default);if(ht.includes("collaborativewall")&&ht.includes("id")&&nt&&window.zE("webWidget","hide"),xt.includes("${adml}")&&(rt?xt=xt.replace("${adml}","adml"):xt=xt.replace("/${adml}","")),xt.includes("${profile}")){const vt=et==null?void 0:et.profiles;xt=xt.replace("${profile}",vt[0].toLowerCase())}xt.includes("${theme")&&(st!=null&&st.is1d?xt=xt.replace("${theme}","1D"):xt=xt.replace("${theme}","2D")),window.zE("webWidget","helpCenter:setSuggestions",{labels:[xt]})};return reactExports.useEffect(()=>{window.location.pathname!==at&<(window.location.pathname),!(ut===void 0||Object.keys(ut).length===0)&&dt()},[window.location.pathname,ut]),reactExports.useEffect(()=>{document.getElementById("ze-snippet")||ot===void 0||(async()=>{const ht=await odeServices.http().get("/zendeskGuide/config");if(ht&&ht.key&&ht.key!==""){const ft=document.createElement("script");ft.id="ze-snippet",ft.src=`https://static.zdassets.com/ekr/snippet.js?key=${ht.key}`,document.body.appendChild(ft).onload=()=>{tt==="es"?window.zE(function(){window.zE.setLocale("es-419")}):window.zE(function(){window.zE.setLocale("fr")}),Object.keys(ht.module).length>0&&ct(ht.module),window.zE("webWidget","show"),window.zE("webWidget","updateSettings",{webWidget:{color:{theme:ht.color||"#ffc400"},zIndex:3,launcher:{mobile:{labelVisible:!0}},contactForm:{suppress:!ot},helpCenter:{messageButton:{"*":"Assistance ENT","es-419":"Asistencia ENT"},originalArticleButton:ht.articleRedirectButton??!0}}}),window.addEventListener("scroll",()=>{window.zE("webWidget","updateSettings",{webWidget:{launcher:{mobile:{labelVisible:window.scrollY<=5}}}})}),window.zE("webWidget:on","open",function(){ot&&window.zE("webWidget","updateSettings",{webWidget:{contactForm:{suppress:!1}}})}),window.zE("webWidget:on","userEvent",function(xt){const vt=xt.category,yt=xt.action,Et=xt.properties;yt==="Contact Form Shown"&&vt==="Zendesk Web Widget"&&Et&&Et.name==="contact-form"&&ot&&(window.zE("webWidget","updateSettings",{webWidget:{contactForm:{suppress:!0}}}),window.zE("webWidget","close"),window.open("/support","_blank"))})}}})()},[ot]),null}function isObject$3(tt){return tt!==null&&typeof tt=="object"&&"constructor"in tt&&tt.constructor===Object}function extend$2(tt,et){tt===void 0&&(tt={}),et===void 0&&(et={}),Object.keys(et).forEach(rt=>{typeof tt[rt]>"u"?tt[rt]=et[rt]:isObject$3(et[rt])&&isObject$3(tt[rt])&&Object.keys(et[rt]).length>0&&extend$2(tt[rt],et[rt])})}const ssrDocument={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function getDocument(){const tt=typeof document<"u"?document:{};return extend$2(tt,ssrDocument),tt}const ssrWindow={document:ssrDocument,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function tt(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(tt){return typeof setTimeout>"u"?(tt(),null):setTimeout(tt,0)},cancelAnimationFrame(tt){typeof setTimeout>"u"||clearTimeout(tt)}};function getWindow(){const tt=typeof window<"u"?window:{};return extend$2(tt,ssrWindow),tt}function deleteProps(tt){const et=tt;Object.keys(et).forEach(rt=>{try{et[rt]=null}catch{}try{delete et[rt]}catch{}})}function nextTick(tt,et){return et===void 0&&(et=0),setTimeout(tt,et)}function now(){return Date.now()}function getComputedStyle$1(tt){const et=getWindow();let rt;return et.getComputedStyle&&(rt=et.getComputedStyle(tt,null)),!rt&&tt.currentStyle&&(rt=tt.currentStyle),rt||(rt=tt.style),rt}function getTranslate(tt,et){et===void 0&&(et="x");const rt=getWindow();let st,nt,ot;const at=getComputedStyle$1(tt);return rt.WebKitCSSMatrix?(nt=at.transform||at.webkitTransform,nt.split(",").length>6&&(nt=nt.split(", ").map(lt=>lt.replace(",",".")).join(", ")),ot=new rt.WebKitCSSMatrix(nt==="none"?"":nt)):(ot=at.MozTransform||at.OTransform||at.MsTransform||at.msTransform||at.transform||at.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),st=ot.toString().split(",")),et==="x"&&(rt.WebKitCSSMatrix?nt=ot.m41:st.length===16?nt=parseFloat(st[12]):nt=parseFloat(st[4])),et==="y"&&(rt.WebKitCSSMatrix?nt=ot.m42:st.length===16?nt=parseFloat(st[13]):nt=parseFloat(st[5])),nt||0}function isObject$2(tt){return typeof tt=="object"&&tt!==null&&tt.constructor&&Object.prototype.toString.call(tt).slice(8,-1)==="Object"}function isNode(tt){return typeof window<"u"&&typeof window.HTMLElement<"u"?tt instanceof HTMLElement:tt&&(tt.nodeType===1||tt.nodeType===11)}function extend$1(){const tt=Object(arguments.length<=0?void 0:arguments[0]),et=["__proto__","constructor","prototype"];for(let rt=1;rt<arguments.length;rt+=1){const st=rt<0||arguments.length<=rt?void 0:arguments[rt];if(st!=null&&!isNode(st)){const nt=Object.keys(Object(st)).filter(ot=>et.indexOf(ot)<0);for(let ot=0,at=nt.length;ot<at;ot+=1){const lt=nt[ot],ut=Object.getOwnPropertyDescriptor(st,lt);ut!==void 0&&ut.enumerable&&(isObject$2(tt[lt])&&isObject$2(st[lt])?st[lt].__swiper__?tt[lt]=st[lt]:extend$1(tt[lt],st[lt]):!isObject$2(tt[lt])&&isObject$2(st[lt])?(tt[lt]={},st[lt].__swiper__?tt[lt]=st[lt]:extend$1(tt[lt],st[lt])):tt[lt]=st[lt])}}}return tt}function setCSSProperty(tt,et,rt){tt.style.setProperty(et,rt)}function animateCSSModeScroll(tt){let{swiper:et,targetPosition:rt,side:st}=tt;const nt=getWindow(),ot=-et.translate;let at=null,lt;const ut=et.params.speed;et.wrapperEl.style.scrollSnapType="none",nt.cancelAnimationFrame(et.cssModeFrameID);const ct=rt>ot?"next":"prev",dt=(ft,xt)=>ct==="next"&&ft>=xt||ct==="prev"&&ft<=xt,ht=()=>{lt=new Date().getTime(),at===null&&(at=lt);const ft=Math.max(Math.min((lt-at)/ut,1),0),xt=.5-Math.cos(ft*Math.PI)/2;let vt=ot+xt*(rt-ot);if(dt(vt,rt)&&(vt=rt),et.wrapperEl.scrollTo({[st]:vt}),dt(vt,rt)){et.wrapperEl.style.overflow="hidden",et.wrapperEl.style.scrollSnapType="",setTimeout(()=>{et.wrapperEl.style.overflow="",et.wrapperEl.scrollTo({[st]:vt})}),nt.cancelAnimationFrame(et.cssModeFrameID);return}et.cssModeFrameID=nt.requestAnimationFrame(ht)};ht()}function elementChildren(tt,et){return et===void 0&&(et=""),[...tt.children].filter(rt=>rt.matches(et))}function createElement(tt,et){et===void 0&&(et=[]);const rt=document.createElement(tt);return rt.classList.add(...Array.isArray(et)?et:[et]),rt}function elementPrevAll(tt,et){const rt=[];for(;tt.previousElementSibling;){const st=tt.previousElementSibling;et?st.matches(et)&&rt.push(st):rt.push(st),tt=st}return rt}function elementNextAll(tt,et){const rt=[];for(;tt.nextElementSibling;){const st=tt.nextElementSibling;et?st.matches(et)&&rt.push(st):rt.push(st),tt=st}return rt}function elementStyle(tt,et){return getWindow().getComputedStyle(tt,null).getPropertyValue(et)}function elementIndex(tt){let et=tt,rt;if(et){for(rt=0;(et=et.previousSibling)!==null;)et.nodeType===1&&(rt+=1);return rt}}function elementParents(tt,et){const rt=[];let st=tt.parentElement;for(;st;)et?st.matches(et)&&rt.push(st):rt.push(st),st=st.parentElement;return rt}function elementOuterSize(tt,et,rt){const st=getWindow();return tt[et==="width"?"offsetWidth":"offsetHeight"]+parseFloat(st.getComputedStyle(tt,null).getPropertyValue(et==="width"?"margin-right":"margin-top"))+parseFloat(st.getComputedStyle(tt,null).getPropertyValue(et==="width"?"margin-left":"margin-bottom"))}function createElementIfNotDefined(tt,et,rt,st){return tt.params.createElements&&Object.keys(st).forEach(nt=>{if(!rt[nt]&&rt.auto===!0){let ot=elementChildren(tt.el,`.${st[nt]}`)[0];ot||(ot=createElement("div",st[nt]),ot.className=st[nt],tt.el.append(ot)),rt[nt]=ot,et[nt]=ot}}),rt}function classesToSelector(tt){return tt===void 0&&(tt=""),`.${tt.trim().replace(/([\.:!+\/])/g,"\\$1").replace(/ /g,".")}`}function Pagination(tt){let{swiper:et,extendParams:rt,on:st,emit:nt}=tt;const ot="swiper-pagination";rt({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:wt=>wt,formatFractionTotal:wt=>wt,bulletClass:`${ot}-bullet`,bulletActiveClass:`${ot}-bullet-active`,modifierClass:`${ot}-`,currentClass:`${ot}-current`,totalClass:`${ot}-total`,hiddenClass:`${ot}-hidden`,progressbarFillClass:`${ot}-progressbar-fill`,progressbarOppositeClass:`${ot}-progressbar-opposite`,clickableClass:`${ot}-clickable`,lockClass:`${ot}-lock`,horizontalClass:`${ot}-horizontal`,verticalClass:`${ot}-vertical`,paginationDisabledClass:`${ot}-disabled`}}),et.pagination={el:null,bullets:[]};let at,lt=0;const ut=wt=>(Array.isArray(wt)?wt:[wt]).filter(St=>!!St);function ct(){return!et.params.pagination.el||!et.pagination.el||Array.isArray(et.pagination.el)&&et.pagination.el.length===0}function dt(wt,St){const{bulletActiveClass:Rt}=et.params.pagination;wt&&(wt=wt[`${St==="prev"?"previous":"next"}ElementSibling`],wt&&(wt.classList.add(`${Rt}-${St}`),wt=wt[`${St==="prev"?"previous":"next"}ElementSibling`],wt&&wt.classList.add(`${Rt}-${St}-${St}`)))}function ht(wt){const St=wt.target.closest(classesToSelector(et.params.pagination.bulletClass));if(!St)return;wt.preventDefault();const Rt=elementIndex(St)*et.params.slidesPerGroup;if(et.params.loop){if(et.realIndex===Rt)return;const Ct=et.realIndex,It=et.getSlideIndexByData(Rt),jt=et.getSlideIndexByData(et.realIndex),Pt=Ot=>{const Ut=et.activeIndex;et.loopFix({direction:Ot,activeSlideIndex:It,slideTo:!1});const Nt=et.activeIndex;Ut===Nt&&et.slideToLoop(Ct,0,!1,!0)};if(It>et.slides.length-et.loopedSlides)Pt(It>jt?"next":"prev");else if(et.params.centeredSlides){const Ot=et.params.slidesPerView==="auto"?et.slidesPerViewDynamic():Math.ceil(parseFloat(et.params.slidesPerView,10));It<Math.floor(Ot/2)&&Pt("prev")}et.slideToLoop(Rt)}else et.slideTo(Rt)}function ft(){const wt=et.rtl,St=et.params.pagination;if(ct())return;let Rt=et.pagination.el;Rt=ut(Rt);let Ct,It;const jt=et.virtual&&et.params.virtual.enabled?et.virtual.slides.length:et.slides.length,Pt=et.params.loop?Math.ceil(jt/et.params.slidesPerGroup):et.snapGrid.length;if(et.params.loop?(It=et.previousRealIndex||0,Ct=et.params.slidesPerGroup>1?Math.floor(et.realIndex/et.params.slidesPerGroup):et.realIndex):typeof et.snapIndex<"u"?(Ct=et.snapIndex,It=et.previousSnapIndex):(It=et.previousIndex||0,Ct=et.activeIndex||0),St.type==="bullets"&&et.pagination.bullets&&et.pagination.bullets.length>0){const Ot=et.pagination.bullets;let Ut,Nt,Ht;if(St.dynamicBullets&&(at=elementOuterSize(Ot[0],et.isHorizontal()?"width":"height"),Rt.forEach(Lt=>{Lt.style[et.isHorizontal()?"width":"height"]=`${at*(St.dynamicMainBullets+4)}px`}),St.dynamicMainBullets>1&&It!==void 0&&(lt+=Ct-(It||0),lt>St.dynamicMainBullets-1?lt=St.dynamicMainBullets-1:lt<0&&(lt=0)),Ut=Math.max(Ct-lt,0),Nt=Ut+(Math.min(Ot.length,St.dynamicMainBullets)-1),Ht=(Nt+Ut)/2),Ot.forEach(Lt=>{const kt=[...["","-next","-next-next","-prev","-prev-prev","-main"].map($t=>`${St.bulletActiveClass}${$t}`)].map($t=>typeof $t=="string"&&$t.includes(" ")?$t.split(" "):$t).flat();Lt.classList.remove(...kt)}),Rt.length>1)Ot.forEach(Lt=>{const kt=elementIndex(Lt);kt===Ct?Lt.classList.add(...St.bulletActiveClass.split(" ")):et.isElement&&Lt.setAttribute("part","bullet"),St.dynamicBullets&&(kt>=Ut&&kt<=Nt&&Lt.classList.add(...`${St.bulletActiveClass}-main`.split(" ")),kt===Ut&&dt(Lt,"prev"),kt===Nt&&dt(Lt,"next"))});else{const Lt=Ot[Ct];if(Lt&&Lt.classList.add(...St.bulletActiveClass.split(" ")),et.isElement&&Ot.forEach((kt,$t)=>{kt.setAttribute("part",$t===Ct?"bullet-active":"bullet")}),St.dynamicBullets){const kt=Ot[Ut],$t=Ot[Nt];for(let Ft=Ut;Ft<=Nt;Ft+=1)Ot[Ft]&&Ot[Ft].classList.add(...`${St.bulletActiveClass}-main`.split(" "));dt(kt,"prev"),dt($t,"next")}}if(St.dynamicBullets){const Lt=Math.min(Ot.length,St.dynamicMainBullets+4),kt=(at*Lt-at)/2-Ht*at,$t=wt?"right":"left";Ot.forEach(Ft=>{Ft.style[et.isHorizontal()?$t:"top"]=`${kt}px`})}}Rt.forEach((Ot,Ut)=>{if(St.type==="fraction"&&(Ot.querySelectorAll(classesToSelector(St.currentClass)).forEach(Nt=>{Nt.textContent=St.formatFractionCurrent(Ct+1)}),Ot.querySelectorAll(classesToSelector(St.totalClass)).forEach(Nt=>{Nt.textContent=St.formatFractionTotal(Pt)})),St.type==="progressbar"){let Nt;St.progressbarOpposite?Nt=et.isHorizontal()?"vertical":"horizontal":Nt=et.isHorizontal()?"horizontal":"vertical";const Ht=(Ct+1)/Pt;let Lt=1,kt=1;Nt==="horizontal"?Lt=Ht:kt=Ht,Ot.querySelectorAll(classesToSelector(St.progressbarFillClass)).forEach($t=>{$t.style.transform=`translate3d(0,0,0) scaleX(${Lt}) scaleY(${kt})`,$t.style.transitionDuration=`${et.params.speed}ms`})}St.type==="custom"&&St.renderCustom?(Ot.innerHTML=St.renderCustom(et,Ct+1,Pt),Ut===0&&nt("paginationRender",Ot)):(Ut===0&&nt("paginationRender",Ot),nt("paginationUpdate",Ot)),et.params.watchOverflow&&et.enabled&&Ot.classList[et.isLocked?"add":"remove"](St.lockClass)})}function xt(){const wt=et.params.pagination;if(ct())return;const St=et.virtual&&et.params.virtual.enabled?et.virtual.slides.length:et.slides.length;let Rt=et.pagination.el;Rt=ut(Rt);let Ct="";if(wt.type==="bullets"){let It=et.params.loop?Math.ceil(St/et.params.slidesPerGroup):et.snapGrid.length;et.params.freeMode&&et.params.freeMode.enabled&&It>St&&(It=St);for(let jt=0;jt<It;jt+=1)wt.renderBullet?Ct+=wt.renderBullet.call(et,jt,wt.bulletClass):Ct+=`<${wt.bulletElement} ${et.isElement?'part="bullet"':""} class="${wt.bulletClass}"></${wt.bulletElement}>`}wt.type==="fraction"&&(wt.renderFraction?Ct=wt.renderFraction.call(et,wt.currentClass,wt.totalClass):Ct=`<span class="${wt.currentClass}"></span> / <span class="${wt.totalClass}"></span>`),wt.type==="progressbar"&&(wt.renderProgressbar?Ct=wt.renderProgressbar.call(et,wt.progressbarFillClass):Ct=`<span class="${wt.progressbarFillClass}"></span>`),et.pagination.bullets=[],Rt.forEach(It=>{wt.type!=="custom"&&(It.innerHTML=Ct||""),wt.type==="bullets"&&et.pagination.bullets.push(...It.querySelectorAll(classesToSelector(wt.bulletClass)))}),wt.type!=="custom"&&nt("paginationRender",Rt[0])}function vt(){et.params.pagination=createElementIfNotDefined(et,et.originalParams.pagination,et.params.pagination,{el:"swiper-pagination"});const wt=et.params.pagination;if(!wt.el)return;let St;typeof wt.el=="string"&&et.isElement&&(St=et.el.querySelector(wt.el)),!St&&typeof wt.el=="string"&&(St=[...document.querySelectorAll(wt.el)]),St||(St=wt.el),!(!St||St.length===0)&&(et.params.uniqueNavElements&&typeof wt.el=="string"&&Array.isArray(St)&&St.length>1&&(St=[...et.el.querySelectorAll(wt.el)],St.length>1&&(St=St.filter(Rt=>elementParents(Rt,".swiper")[0]===et.el)[0])),Array.isArray(St)&&St.length===1&&(St=St[0]),Object.assign(et.pagination,{el:St}),St=ut(St),St.forEach(Rt=>{wt.type==="bullets"&&wt.clickable&&Rt.classList.add(...(wt.clickableClass||"").split(" ")),Rt.classList.add(wt.modifierClass+wt.type),Rt.classList.add(et.isHorizontal()?wt.horizontalClass:wt.verticalClass),wt.type==="bullets"&&wt.dynamicBullets&&(Rt.classList.add(`${wt.modifierClass}${wt.type}-dynamic`),lt=0,wt.dynamicMainBullets<1&&(wt.dynamicMainBullets=1)),wt.type==="progressbar"&&wt.progressbarOpposite&&Rt.classList.add(wt.progressbarOppositeClass),wt.clickable&&Rt.addEventListener("click",ht),et.enabled||Rt.classList.add(wt.lockClass)}))}function yt(){const wt=et.params.pagination;if(ct())return;let St=et.pagination.el;St&&(St=ut(St),St.forEach(Rt=>{Rt.classList.remove(wt.hiddenClass),Rt.classList.remove(wt.modifierClass+wt.type),Rt.classList.remove(et.isHorizontal()?wt.horizontalClass:wt.verticalClass),wt.clickable&&(Rt.classList.remove(...(wt.clickableClass||"").split(" ")),Rt.removeEventListener("click",ht))})),et.pagination.bullets&&et.pagination.bullets.forEach(Rt=>Rt.classList.remove(...wt.bulletActiveClass.split(" ")))}st("changeDirection",()=>{if(!et.pagination||!et.pagination.el)return;const wt=et.params.pagination;let{el:St}=et.pagination;St=ut(St),St.forEach(Rt=>{Rt.classList.remove(wt.horizontalClass,wt.verticalClass),Rt.classList.add(et.isHorizontal()?wt.horizontalClass:wt.verticalClass)})}),st("init",()=>{et.params.pagination.enabled===!1?bt():(vt(),xt(),ft())}),st("activeIndexChange",()=>{typeof et.snapIndex>"u"&&ft()}),st("snapIndexChange",()=>{ft()}),st("snapGridLengthChange",()=>{xt(),ft()}),st("destroy",()=>{yt()}),st("enable disable",()=>{let{el:wt}=et.pagination;wt&&(wt=ut(wt),wt.forEach(St=>St.classList[et.enabled?"remove":"add"](et.params.pagination.lockClass)))}),st("lock unlock",()=>{ft()}),st("click",(wt,St)=>{const Rt=St.target,Ct=ut(et.pagination.el);if(et.params.pagination.el&&et.params.pagination.hideOnClick&&Ct&&Ct.length>0&&!Rt.classList.contains(et.params.pagination.bulletClass)){if(et.navigation&&(et.navigation.nextEl&&Rt===et.navigation.nextEl||et.navigation.prevEl&&Rt===et.navigation.prevEl))return;const It=Ct[0].classList.contains(et.params.pagination.hiddenClass);nt(It===!0?"paginationShow":"paginationHide"),Ct.forEach(jt=>jt.classList.toggle(et.params.pagination.hiddenClass))}});const Et=()=>{et.el.classList.remove(et.params.pagination.paginationDisabledClass);let{el:wt}=et.pagination;wt&&(wt=ut(wt),wt.forEach(St=>St.classList.remove(et.params.pagination.paginationDisabledClass))),vt(),xt(),ft()},bt=()=>{et.el.classList.add(et.params.pagination.paginationDisabledClass);let{el:wt}=et.pagination;wt&&(wt=ut(wt),wt.forEach(St=>St.classList.add(et.params.pagination.paginationDisabledClass))),yt()};Object.assign(et.pagination,{enable:Et,disable:bt,render:xt,update:ft,init:vt,destroy:yt})}let support;function calcSupport(){const tt=getWindow(),et=getDocument();return{smoothScroll:et.documentElement&&et.documentElement.style&&"scrollBehavior"in et.documentElement.style,touch:!!("ontouchstart"in tt||tt.DocumentTouch&&et instanceof tt.DocumentTouch)}}function getSupport(){return support||(support=calcSupport()),support}let deviceCached;function calcDevice(tt){let{userAgent:et}=tt===void 0?{}:tt;const rt=getSupport(),st=getWindow(),nt=st.navigator.platform,ot=et||st.navigator.userAgent,at={ios:!1,android:!1},lt=st.screen.width,ut=st.screen.height,ct=ot.match(/(Android);?[\s\/]+([\d.]+)?/);let dt=ot.match(/(iPad).*OS\s([\d_]+)/);const ht=ot.match(/(iPod)(.*OS\s([\d_]+))?/),ft=!dt&&ot.match(/(iPhone\sOS|iOS)\s([\d_]+)/),xt=nt==="Win32";let vt=nt==="MacIntel";const yt=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!dt&&vt&&rt.touch&&yt.indexOf(`${lt}x${ut}`)>=0&&(dt=ot.match(/(Version)\/([\d.]+)/),dt||(dt=[0,1,"13_0_0"]),vt=!1),ct&&!xt&&(at.os="android",at.android=!0),(dt||ft||ht)&&(at.os="ios",at.ios=!0),at}function getDevice(tt){return tt===void 0&&(tt={}),deviceCached||(deviceCached=calcDevice(tt)),deviceCached}let browser;function calcBrowser(){const tt=getWindow();let et=!1;function rt(){const st=tt.navigator.userAgent.toLowerCase();return st.indexOf("safari")>=0&&st.indexOf("chrome")<0&&st.indexOf("android")<0}if(rt()){const st=String(tt.navigator.userAgent);if(st.includes("Version/")){const[nt,ot]=st.split("Version/")[1].split(" ")[0].split(".").map(at=>Number(at));et=nt<16||nt===16&&ot<2}}return{isSafari:et||rt(),needPerspectiveFix:et,isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(tt.navigator.userAgent)}}function getBrowser(){return browser||(browser=calcBrowser()),browser}function Resize(tt){let{swiper:et,on:rt,emit:st}=tt;const nt=getWindow();let ot=null,at=null;const lt=()=>{!et||et.destroyed||!et.initialized||(st("beforeResize"),st("resize"))},ut=()=>{!et||et.destroyed||!et.initialized||(ot=new ResizeObserver(ht=>{at=nt.requestAnimationFrame(()=>{const{width:ft,height:xt}=et;let vt=ft,yt=xt;ht.forEach(Et=>{let{contentBoxSize:bt,contentRect:wt,target:St}=Et;St&&St!==et.el||(vt=wt?wt.width:(bt[0]||bt).inlineSize,yt=wt?wt.height:(bt[0]||bt).blockSize)}),(vt!==ft||yt!==xt)&<()})}),ot.observe(et.el))},ct=()=>{at&&nt.cancelAnimationFrame(at),ot&&ot.unobserve&&et.el&&(ot.unobserve(et.el),ot=null)},dt=()=>{!et||et.destroyed||!et.initialized||st("orientationchange")};rt("init",()=>{if(et.params.resizeObserver&&typeof nt.ResizeObserver<"u"){ut();return}nt.addEventListener("resize",lt),nt.addEventListener("orientationchange",dt)}),rt("destroy",()=>{ct(),nt.removeEventListener("resize",lt),nt.removeEventListener("orientationchange",dt)})}function Observer(tt){let{swiper:et,extendParams:rt,on:st,emit:nt}=tt;const ot=[],at=getWindow(),lt=function(dt,ht){ht===void 0&&(ht={});const ft=at.MutationObserver||at.WebkitMutationObserver,xt=new ft(vt=>{if(et.__preventObserver__)return;if(vt.length===1){nt("observerUpdate",vt[0]);return}const yt=function(){nt("observerUpdate",vt[0])};at.requestAnimationFrame?at.requestAnimationFrame(yt):at.setTimeout(yt,0)});xt.observe(dt,{attributes:typeof ht.attributes>"u"?!0:ht.attributes,childList:typeof ht.childList>"u"?!0:ht.childList,characterData:typeof ht.characterData>"u"?!0:ht.characterData}),ot.push(xt)},ut=()=>{if(et.params.observer){if(et.params.observeParents){const dt=elementParents(et.hostEl);for(let ht=0;ht<dt.length;ht+=1)lt(dt[ht])}lt(et.hostEl,{childList:et.params.observeSlideChildren}),lt(et.wrapperEl,{attributes:!1})}},ct=()=>{ot.forEach(dt=>{dt.disconnect()}),ot.splice(0,ot.length)};rt({observer:!1,observeParents:!1,observeSlideChildren:!1}),st("init",ut),st("destroy",ct)}var eventsEmitter={on(tt,et,rt){const st=this;if(!st.eventsListeners||st.destroyed||typeof et!="function")return st;const nt=rt?"unshift":"push";return tt.split(" ").forEach(ot=>{st.eventsListeners[ot]||(st.eventsListeners[ot]=[]),st.eventsListeners[ot][nt](et)}),st},once(tt,et,rt){const st=this;if(!st.eventsListeners||st.destroyed||typeof et!="function")return st;function nt(){st.off(tt,nt),nt.__emitterProxy&&delete nt.__emitterProxy;for(var ot=arguments.length,at=new Array(ot),lt=0;lt<ot;lt++)at[lt]=arguments[lt];et.apply(st,at)}return nt.__emitterProxy=et,st.on(tt,nt,rt)},onAny(tt,et){const rt=this;if(!rt.eventsListeners||rt.destroyed||typeof tt!="function")return rt;const st=et?"unshift":"push";return rt.eventsAnyListeners.indexOf(tt)<0&&rt.eventsAnyListeners[st](tt),rt},offAny(tt){const et=this;if(!et.eventsListeners||et.destroyed||!et.eventsAnyListeners)return et;const rt=et.eventsAnyListeners.indexOf(tt);return rt>=0&&et.eventsAnyListeners.splice(rt,1),et},off(tt,et){const rt=this;return!rt.eventsListeners||rt.destroyed||!rt.eventsListeners||tt.split(" ").forEach(st=>{typeof et>"u"?rt.eventsListeners[st]=[]:rt.eventsListeners[st]&&rt.eventsListeners[st].forEach((nt,ot)=>{(nt===et||nt.__emitterProxy&&nt.__emitterProxy===et)&&rt.eventsListeners[st].splice(ot,1)})}),rt},emit(){const tt=this;if(!tt.eventsListeners||tt.destroyed||!tt.eventsListeners)return tt;let et,rt,st;for(var nt=arguments.length,ot=new Array(nt),at=0;at<nt;at++)ot[at]=arguments[at];return typeof ot[0]=="string"||Array.isArray(ot[0])?(et=ot[0],rt=ot.slice(1,ot.length),st=tt):(et=ot[0].events,rt=ot[0].data,st=ot[0].context||tt),rt.unshift(st),(Array.isArray(et)?et:et.split(" ")).forEach(ut=>{tt.eventsAnyListeners&&tt.eventsAnyListeners.length&&tt.eventsAnyListeners.forEach(ct=>{ct.apply(st,[ut,...rt])}),tt.eventsListeners&&tt.eventsListeners[ut]&&tt.eventsListeners[ut].forEach(ct=>{ct.apply(st,rt)})}),tt}};function updateSize(){const tt=this;let et,rt;const st=tt.el;typeof tt.params.width<"u"&&tt.params.width!==null?et=tt.params.width:et=st.clientWidth,typeof tt.params.height<"u"&&tt.params.height!==null?rt=tt.params.height:rt=st.clientHeight,!(et===0&&tt.isHorizontal()||rt===0&&tt.isVertical())&&(et=et-parseInt(elementStyle(st,"padding-left")||0,10)-parseInt(elementStyle(st,"padding-right")||0,10),rt=rt-parseInt(elementStyle(st,"padding-top")||0,10)-parseInt(elementStyle(st,"padding-bottom")||0,10),Number.isNaN(et)&&(et=0),Number.isNaN(rt)&&(rt=0),Object.assign(tt,{width:et,height:rt,size:tt.isHorizontal()?et:rt}))}function updateSlides(){const tt=this;function et(Nt){return tt.isHorizontal()?Nt:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[Nt]}function rt(Nt,Ht){return parseFloat(Nt.getPropertyValue(et(Ht))||0)}const st=tt.params,{wrapperEl:nt,slidesEl:ot,size:at,rtlTranslate:lt,wrongRTL:ut}=tt,ct=tt.virtual&&st.virtual.enabled,dt=ct?tt.virtual.slides.length:tt.slides.length,ht=elementChildren(ot,`.${tt.params.slideClass}, swiper-slide`),ft=ct?tt.virtual.slides.length:ht.length;let xt=[];const vt=[],yt=[];let Et=st.slidesOffsetBefore;typeof Et=="function"&&(Et=st.slidesOffsetBefore.call(tt));let bt=st.slidesOffsetAfter;typeof bt=="function"&&(bt=st.slidesOffsetAfter.call(tt));const wt=tt.snapGrid.length,St=tt.slidesGrid.length;let Rt=st.spaceBetween,Ct=-Et,It=0,jt=0;if(typeof at>"u")return;typeof Rt=="string"&&Rt.indexOf("%")>=0?Rt=parseFloat(Rt.replace("%",""))/100*at:typeof Rt=="string"&&(Rt=parseFloat(Rt)),tt.virtualSize=-Rt,ht.forEach(Nt=>{lt?Nt.style.marginLeft="":Nt.style.marginRight="",Nt.style.marginBottom="",Nt.style.marginTop=""}),st.centeredSlides&&st.cssMode&&(setCSSProperty(nt,"--swiper-centered-offset-before",""),setCSSProperty(nt,"--swiper-centered-offset-after",""));const Pt=st.grid&&st.grid.rows>1&&tt.grid;Pt&&tt.grid.initSlides(ft);let Ot;const Ut=st.slidesPerView==="auto"&&st.breakpoints&&Object.keys(st.breakpoints).filter(Nt=>typeof st.breakpoints[Nt].slidesPerView<"u").length>0;for(let Nt=0;Nt<ft;Nt+=1){Ot=0;let Ht;if(ht[Nt]&&(Ht=ht[Nt]),Pt&&tt.grid.updateSlide(Nt,Ht,ft,et),!(ht[Nt]&&elementStyle(Ht,"display")==="none")){if(st.slidesPerView==="auto"){Ut&&(ht[Nt].style[et("width")]="");const Lt=getComputedStyle(Ht),kt=Ht.style.transform,$t=Ht.style.webkitTransform;if(kt&&(Ht.style.transform="none"),$t&&(Ht.style.webkitTransform="none"),st.roundLengths)Ot=tt.isHorizontal()?elementOuterSize(Ht,"width"):elementOuterSize(Ht,"height");else{const Ft=rt(Lt,"width"),Gt=rt(Lt,"padding-left"),Mt=rt(Lt,"padding-right"),Vt=rt(Lt,"margin-left"),Bt=rt(Lt,"margin-right"),qt=Lt.getPropertyValue("box-sizing");if(qt&&qt==="border-box")Ot=Ft+Vt+Bt;else{const{clientWidth:Qt,offsetWidth:Yt}=Ht;Ot=Ft+Gt+Mt+Vt+Bt+(Yt-Qt)}}kt&&(Ht.style.transform=kt),$t&&(Ht.style.webkitTransform=$t),st.roundLengths&&(Ot=Math.floor(Ot))}else Ot=(at-(st.slidesPerView-1)*Rt)/st.slidesPerView,st.roundLengths&&(Ot=Math.floor(Ot)),ht[Nt]&&(ht[Nt].style[et("width")]=`${Ot}px`);ht[Nt]&&(ht[Nt].swiperSlideSize=Ot),yt.push(Ot),st.centeredSlides?(Ct=Ct+Ot/2+It/2+Rt,It===0&&Nt!==0&&(Ct=Ct-at/2-Rt),Nt===0&&(Ct=Ct-at/2-Rt),Math.abs(Ct)<1/1e3&&(Ct=0),st.roundLengths&&(Ct=Math.floor(Ct)),jt%st.slidesPerGroup===0&&xt.push(Ct),vt.push(Ct)):(st.roundLengths&&(Ct=Math.floor(Ct)),(jt-Math.min(tt.params.slidesPerGroupSkip,jt))%tt.params.slidesPerGroup===0&&xt.push(Ct),vt.push(Ct),Ct=Ct+Ot+Rt),tt.virtualSize+=Ot+Rt,It=Ot,jt+=1}}if(tt.virtualSize=Math.max(tt.virtualSize,at)+bt,lt&&ut&&(st.effect==="slide"||st.effect==="coverflow")&&(nt.style.width=`${tt.virtualSize+Rt}px`),st.setWrapperSize&&(nt.style[et("width")]=`${tt.virtualSize+Rt}px`),Pt&&tt.grid.updateWrapperSize(Ot,xt,et),!st.centeredSlides){const Nt=[];for(let Ht=0;Ht<xt.length;Ht+=1){let Lt=xt[Ht];st.roundLengths&&(Lt=Math.floor(Lt)),xt[Ht]<=tt.virtualSize-at&&Nt.push(Lt)}xt=Nt,Math.floor(tt.virtualSize-at)-Math.floor(xt[xt.length-1])>1&&xt.push(tt.virtualSize-at)}if(ct&&st.loop){const Nt=yt[0]+Rt;if(st.slidesPerGroup>1){const Ht=Math.ceil((tt.virtual.slidesBefore+tt.virtual.slidesAfter)/st.slidesPerGroup),Lt=Nt*st.slidesPerGroup;for(let kt=0;kt<Ht;kt+=1)xt.push(xt[xt.length-1]+Lt)}for(let Ht=0;Ht<tt.virtual.slidesBefore+tt.virtual.slidesAfter;Ht+=1)st.slidesPerGroup===1&&xt.push(xt[xt.length-1]+Nt),vt.push(vt[vt.length-1]+Nt),tt.virtualSize+=Nt}if(xt.length===0&&(xt=[0]),Rt!==0){const Nt=tt.isHorizontal()&<?"marginLeft":et("marginRight");ht.filter((Ht,Lt)=>!st.cssMode||st.loop?!0:Lt!==ht.length-1).forEach(Ht=>{Ht.style[Nt]=`${Rt}px`})}if(st.centeredSlides&&st.centeredSlidesBounds){let Nt=0;yt.forEach(Lt=>{Nt+=Lt+(Rt||0)}),Nt-=Rt;const Ht=Nt-at;xt=xt.map(Lt=>Lt<=0?-Et:Lt>Ht?Ht+bt:Lt)}if(st.centerInsufficientSlides){let Nt=0;if(yt.forEach(Ht=>{Nt+=Ht+(Rt||0)}),Nt-=Rt,Nt<at){const Ht=(at-Nt)/2;xt.forEach((Lt,kt)=>{xt[kt]=Lt-Ht}),vt.forEach((Lt,kt)=>{vt[kt]=Lt+Ht})}}if(Object.assign(tt,{slides:ht,snapGrid:xt,slidesGrid:vt,slidesSizesGrid:yt}),st.centeredSlides&&st.cssMode&&!st.centeredSlidesBounds){setCSSProperty(nt,"--swiper-centered-offset-before",`${-xt[0]}px`),setCSSProperty(nt,"--swiper-centered-offset-after",`${tt.size/2-yt[yt.length-1]/2}px`);const Nt=-tt.snapGrid[0],Ht=-tt.slidesGrid[0];tt.snapGrid=tt.snapGrid.map(Lt=>Lt+Nt),tt.slidesGrid=tt.slidesGrid.map(Lt=>Lt+Ht)}if(ft!==dt&&tt.emit("slidesLengthChange"),xt.length!==wt&&(tt.params.watchOverflow&&tt.checkOverflow(),tt.emit("snapGridLengthChange")),vt.length!==St&&tt.emit("slidesGridLengthChange"),st.watchSlidesProgress&&tt.updateSlidesOffset(),!ct&&!st.cssMode&&(st.effect==="slide"||st.effect==="fade")){const Nt=`${st.containerModifierClass}backface-hidden`,Ht=tt.el.classList.contains(Nt);ft<=st.maxBackfaceHiddenSlides?Ht||tt.el.classList.add(Nt):Ht&&tt.el.classList.remove(Nt)}}function updateAutoHeight(tt){const et=this,rt=[],st=et.virtual&&et.params.virtual.enabled;let nt=0,ot;typeof tt=="number"?et.setTransition(tt):tt===!0&&et.setTransition(et.params.speed);const at=lt=>st?et.slides[et.getSlideIndexByData(lt)]:et.slides[lt];if(et.params.slidesPerView!=="auto"&&et.params.slidesPerView>1)if(et.params.centeredSlides)(et.visibleSlides||[]).forEach(lt=>{rt.push(lt)});else for(ot=0;ot<Math.ceil(et.params.slidesPerView);ot+=1){const lt=et.activeIndex+ot;if(lt>et.slides.length&&!st)break;rt.push(at(lt))}else rt.push(at(et.activeIndex));for(ot=0;ot<rt.length;ot+=1)if(typeof rt[ot]<"u"){const lt=rt[ot].offsetHeight;nt=lt>nt?lt:nt}(nt||nt===0)&&(et.wrapperEl.style.height=`${nt}px`)}function updateSlidesOffset(){const tt=this,et=tt.slides,rt=tt.isElement?tt.isHorizontal()?tt.wrapperEl.offsetLeft:tt.wrapperEl.offsetTop:0;for(let st=0;st<et.length;st+=1)et[st].swiperSlideOffset=(tt.isHorizontal()?et[st].offsetLeft:et[st].offsetTop)-rt-tt.cssOverflowAdjustment()}function updateSlidesProgress(tt){tt===void 0&&(tt=this&&this.translate||0);const et=this,rt=et.params,{slides:st,rtlTranslate:nt,snapGrid:ot}=et;if(st.length===0)return;typeof st[0].swiperSlideOffset>"u"&&et.updateSlidesOffset();let at=-tt;nt&&(at=tt),st.forEach(ut=>{ut.classList.remove(rt.slideVisibleClass)}),et.visibleSlidesIndexes=[],et.visibleSlides=[];let lt=rt.spaceBetween;typeof lt=="string"&<.indexOf("%")>=0?lt=parseFloat(lt.replace("%",""))/100*et.size:typeof lt=="string"&&(lt=parseFloat(lt));for(let ut=0;ut<st.length;ut+=1){const ct=st[ut];let dt=ct.swiperSlideOffset;rt.cssMode&&rt.centeredSlides&&(dt-=st[0].swiperSlideOffset);const ht=(at+(rt.centeredSlides?et.minTranslate():0)-dt)/(ct.swiperSlideSize+lt),ft=(at-ot[0]+(rt.centeredSlides?et.minTranslate():0)-dt)/(ct.swiperSlideSize+lt),xt=-(at-dt),vt=xt+et.slidesSizesGrid[ut];(xt>=0&&xt<et.size-1||vt>1&&vt<=et.size||xt<=0&&vt>=et.size)&&(et.visibleSlides.push(ct),et.visibleSlidesIndexes.push(ut),st[ut].classList.add(rt.slideVisibleClass)),ct.progress=nt?-ht:ht,ct.originalProgress=nt?-ft:ft}}function updateProgress(tt){const et=this;if(typeof tt>"u"){const dt=et.rtlTranslate?-1:1;tt=et&&et.translate&&et.translate*dt||0}const rt=et.params,st=et.maxTranslate()-et.minTranslate();let{progress:nt,isBeginning:ot,isEnd:at,progressLoop:lt}=et;const ut=ot,ct=at;if(st===0)nt=0,ot=!0,at=!0;else{nt=(tt-et.minTranslate())/st;const dt=Math.abs(tt-et.minTranslate())<1,ht=Math.abs(tt-et.maxTranslate())<1;ot=dt||nt<=0,at=ht||nt>=1,dt&&(nt=0),ht&&(nt=1)}if(rt.loop){const dt=et.getSlideIndexByData(0),ht=et.getSlideIndexByData(et.slides.length-1),ft=et.slidesGrid[dt],xt=et.slidesGrid[ht],vt=et.slidesGrid[et.slidesGrid.length-1],yt=Math.abs(tt);yt>=ft?lt=(yt-ft)/vt:lt=(yt+vt-xt)/vt,lt>1&&(lt-=1)}Object.assign(et,{progress:nt,progressLoop:lt,isBeginning:ot,isEnd:at}),(rt.watchSlidesProgress||rt.centeredSlides&&rt.autoHeight)&&et.updateSlidesProgress(tt),ot&&!ut&&et.emit("reachBeginning toEdge"),at&&!ct&&et.emit("reachEnd toEdge"),(ut&&!ot||ct&&!at)&&et.emit("fromEdge"),et.emit("progress",nt)}function updateSlidesClasses(){const tt=this,{slides:et,params:rt,slidesEl:st,activeIndex:nt}=tt,ot=tt.virtual&&rt.virtual.enabled,at=ut=>elementChildren(st,`.${rt.slideClass}${ut}, swiper-slide${ut}`)[0];et.forEach(ut=>{ut.classList.remove(rt.slideActiveClass,rt.slideNextClass,rt.slidePrevClass)});let lt;if(ot)if(rt.loop){let ut=nt-tt.virtual.slidesBefore;ut<0&&(ut=tt.virtual.slides.length+ut),ut>=tt.virtual.slides.length&&(ut-=tt.virtual.slides.length),lt=at(`[data-swiper-slide-index="${ut}"]`)}else lt=at(`[data-swiper-slide-index="${nt}"]`);else lt=et[nt];if(lt){lt.classList.add(rt.slideActiveClass);let ut=elementNextAll(lt,`.${rt.slideClass}, swiper-slide`)[0];rt.loop&&!ut&&(ut=et[0]),ut&&ut.classList.add(rt.slideNextClass);let ct=elementPrevAll(lt,`.${rt.slideClass}, swiper-slide`)[0];rt.loop&&!ct===0&&(ct=et[et.length-1]),ct&&ct.classList.add(rt.slidePrevClass)}tt.emitSlidesClasses()}const processLazyPreloader=(tt,et)=>{if(!tt||tt.destroyed||!tt.params)return;const rt=()=>tt.isElement?"swiper-slide":`.${tt.params.slideClass}`,st=et.closest(rt());if(st){let nt=st.querySelector(`.${tt.params.lazyPreloaderClass}`);!nt&&tt.isElement&&(st.shadowRoot?nt=st.shadowRoot.querySelector(`.${tt.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{st.shadowRoot&&(nt=st.shadowRoot.querySelector(`.${tt.params.lazyPreloaderClass}`),nt&&nt.remove())})),nt&&nt.remove()}},unlazy=(tt,et)=>{if(!tt.slides[et])return;const rt=tt.slides[et].querySelector('[loading="lazy"]');rt&&rt.removeAttribute("loading")},preload=tt=>{if(!tt||tt.destroyed||!tt.params)return;let et=tt.params.lazyPreloadPrevNext;const rt=tt.slides.length;if(!rt||!et||et<0)return;et=Math.min(et,rt);const st=tt.params.slidesPerView==="auto"?tt.slidesPerViewDynamic():Math.ceil(tt.params.slidesPerView),nt=tt.activeIndex;if(tt.params.grid&&tt.params.grid.rows>1){const at=nt,lt=[at-et];lt.push(...Array.from({length:et}).map((ut,ct)=>at+st+ct)),tt.slides.forEach((ut,ct)=>{lt.includes(ut.column)&&unlazy(tt,ct)});return}const ot=nt+st-1;if(tt.params.rewind||tt.params.loop)for(let at=nt-et;at<=ot+et;at+=1){const lt=(at%rt+rt)%rt;(lt<nt||lt>ot)&&unlazy(tt,lt)}else for(let at=Math.max(nt-et,0);at<=Math.min(ot+et,rt-1);at+=1)at!==nt&&(at>ot||at<nt)&&unlazy(tt,at)};function getActiveIndexByTranslate(tt){const{slidesGrid:et,params:rt}=tt,st=tt.rtlTranslate?tt.translate:-tt.translate;let nt;for(let ot=0;ot<et.length;ot+=1)typeof et[ot+1]<"u"?st>=et[ot]&&st<et[ot+1]-(et[ot+1]-et[ot])/2?nt=ot:st>=et[ot]&&st<et[ot+1]&&(nt=ot+1):st>=et[ot]&&(nt=ot);return rt.normalizeSlideIndex&&(nt<0||typeof nt>"u")&&(nt=0),nt}function updateActiveIndex(tt){const et=this,rt=et.rtlTranslate?et.translate:-et.translate,{snapGrid:st,params:nt,activeIndex:ot,realIndex:at,snapIndex:lt}=et;let ut=tt,ct;const dt=ft=>{let xt=ft-et.virtual.slidesBefore;return xt<0&&(xt=et.virtual.slides.length+xt),xt>=et.virtual.slides.length&&(xt-=et.virtual.slides.length),xt};if(typeof ut>"u"&&(ut=getActiveIndexByTranslate(et)),st.indexOf(rt)>=0)ct=st.indexOf(rt);else{const ft=Math.min(nt.slidesPerGroupSkip,ut);ct=ft+Math.floor((ut-ft)/nt.slidesPerGroup)}if(ct>=st.length&&(ct=st.length-1),ut===ot){ct!==lt&&(et.snapIndex=ct,et.emit("snapIndexChange")),et.params.loop&&et.virtual&&et.params.virtual.enabled&&(et.realIndex=dt(ut));return}let ht;et.virtual&&nt.virtual.enabled&&nt.loop?ht=dt(ut):et.slides[ut]?ht=parseInt(et.slides[ut].getAttribute("data-swiper-slide-index")||ut,10):ht=ut,Object.assign(et,{previousSnapIndex:lt,snapIndex:ct,previousRealIndex:at,realIndex:ht,previousIndex:ot,activeIndex:ut}),et.initialized&&preload(et),et.emit("activeIndexChange"),et.emit("snapIndexChange"),(et.initialized||et.params.runCallbacksOnInit)&&(at!==ht&&et.emit("realIndexChange"),et.emit("slideChange"))}function updateClickedSlide(tt,et){const rt=this,st=rt.params;let nt=tt.closest(`.${st.slideClass}, swiper-slide`);!nt&&rt.isElement&&et&&et.length>1&&et.includes(tt)&&[...et.slice(et.indexOf(tt)+1,et.length)].forEach(lt=>{!nt&<.matches&<.matches(`.${st.slideClass}, swiper-slide`)&&(nt=lt)});let ot=!1,at;if(nt){for(let lt=0;lt<rt.slides.length;lt+=1)if(rt.slides[lt]===nt){ot=!0,at=lt;break}}if(nt&&ot)rt.clickedSlide=nt,rt.virtual&&rt.params.virtual.enabled?rt.clickedIndex=parseInt(nt.getAttribute("data-swiper-slide-index"),10):rt.clickedIndex=at;else{rt.clickedSlide=void 0,rt.clickedIndex=void 0;return}st.slideToClickedSlide&&rt.clickedIndex!==void 0&&rt.clickedIndex!==rt.activeIndex&&rt.slideToClickedSlide()}var update={updateSize,updateSlides,updateAutoHeight,updateSlidesOffset,updateSlidesProgress,updateProgress,updateSlidesClasses,updateActiveIndex,updateClickedSlide};function getSwiperTranslate(tt){tt===void 0&&(tt=this.isHorizontal()?"x":"y");const et=this,{params:rt,rtlTranslate:st,translate:nt,wrapperEl:ot}=et;if(rt.virtualTranslate)return st?-nt:nt;if(rt.cssMode)return nt;let at=getTranslate(ot,tt);return at+=et.cssOverflowAdjustment(),st&&(at=-at),at||0}function setTranslate(tt,et){const rt=this,{rtlTranslate:st,params:nt,wrapperEl:ot,progress:at}=rt;let lt=0,ut=0;const ct=0;rt.isHorizontal()?lt=st?-tt:tt:ut=tt,nt.roundLengths&&(lt=Math.floor(lt),ut=Math.floor(ut)),rt.previousTranslate=rt.translate,rt.translate=rt.isHorizontal()?lt:ut,nt.cssMode?ot[rt.isHorizontal()?"scrollLeft":"scrollTop"]=rt.isHorizontal()?-lt:-ut:nt.virtualTranslate||(rt.isHorizontal()?lt-=rt.cssOverflowAdjustment():ut-=rt.cssOverflowAdjustment(),ot.style.transform=`translate3d(${lt}px, ${ut}px, ${ct}px)`);let dt;const ht=rt.maxTranslate()-rt.minTranslate();ht===0?dt=0:dt=(tt-rt.minTranslate())/ht,dt!==at&&rt.updateProgress(tt),rt.emit("setTranslate",rt.translate,et)}function minTranslate(){return-this.snapGrid[0]}function maxTranslate(){return-this.snapGrid[this.snapGrid.length-1]}function translateTo(tt,et,rt,st,nt){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),st===void 0&&(st=!0);const ot=this,{params:at,wrapperEl:lt}=ot;if(ot.animating&&at.preventInteractionOnTransition)return!1;const ut=ot.minTranslate(),ct=ot.maxTranslate();let dt;if(st&&tt>ut?dt=ut:st&&tt<ct?dt=ct:dt=tt,ot.updateProgress(dt),at.cssMode){const ht=ot.isHorizontal();if(et===0)lt[ht?"scrollLeft":"scrollTop"]=-dt;else{if(!ot.support.smoothScroll)return animateCSSModeScroll({swiper:ot,targetPosition:-dt,side:ht?"left":"top"}),!0;lt.scrollTo({[ht?"left":"top"]:-dt,behavior:"smooth"})}return!0}return et===0?(ot.setTransition(0),ot.setTranslate(dt),rt&&(ot.emit("beforeTransitionStart",et,nt),ot.emit("transitionEnd"))):(ot.setTransition(et),ot.setTranslate(dt),rt&&(ot.emit("beforeTransitionStart",et,nt),ot.emit("transitionStart")),ot.animating||(ot.animating=!0,ot.onTranslateToWrapperTransitionEnd||(ot.onTranslateToWrapperTransitionEnd=function(ft){!ot||ot.destroyed||ft.target===this&&(ot.wrapperEl.removeEventListener("transitionend",ot.onTranslateToWrapperTransitionEnd),ot.onTranslateToWrapperTransitionEnd=null,delete ot.onTranslateToWrapperTransitionEnd,rt&&ot.emit("transitionEnd"))}),ot.wrapperEl.addEventListener("transitionend",ot.onTranslateToWrapperTransitionEnd))),!0}var translate={getTranslate:getSwiperTranslate,setTranslate,minTranslate,maxTranslate,translateTo};function setTransition(tt,et){const rt=this;rt.params.cssMode||(rt.wrapperEl.style.transitionDuration=`${tt}ms`,rt.wrapperEl.style.transitionDelay=tt===0?"0ms":""),rt.emit("setTransition",tt,et)}function transitionEmit(tt){let{swiper:et,runCallbacks:rt,direction:st,step:nt}=tt;const{activeIndex:ot,previousIndex:at}=et;let lt=st;if(lt||(ot>at?lt="next":ot<at?lt="prev":lt="reset"),et.emit(`transition${nt}`),rt&&ot!==at){if(lt==="reset"){et.emit(`slideResetTransition${nt}`);return}et.emit(`slideChangeTransition${nt}`),lt==="next"?et.emit(`slideNextTransition${nt}`):et.emit(`slidePrevTransition${nt}`)}}function transitionStart(tt,et){tt===void 0&&(tt=!0);const rt=this,{params:st}=rt;st.cssMode||(st.autoHeight&&rt.updateAutoHeight(),transitionEmit({swiper:rt,runCallbacks:tt,direction:et,step:"Start"}))}function transitionEnd(tt,et){tt===void 0&&(tt=!0);const rt=this,{params:st}=rt;rt.animating=!1,!st.cssMode&&(rt.setTransition(0),transitionEmit({swiper:rt,runCallbacks:tt,direction:et,step:"End"}))}var transition={setTransition,transitionStart,transitionEnd};function slideTo(tt,et,rt,st,nt){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),typeof tt=="string"&&(tt=parseInt(tt,10));const ot=this;let at=tt;at<0&&(at=0);const{params:lt,snapGrid:ut,slidesGrid:ct,previousIndex:dt,activeIndex:ht,rtlTranslate:ft,wrapperEl:xt,enabled:vt}=ot;if(ot.animating&<.preventInteractionOnTransition||!vt&&!st&&!nt)return!1;const yt=Math.min(ot.params.slidesPerGroupSkip,at);let Et=yt+Math.floor((at-yt)/ot.params.slidesPerGroup);Et>=ut.length&&(Et=ut.length-1);const bt=-ut[Et];if(lt.normalizeSlideIndex)for(let St=0;St<ct.length;St+=1){const Rt=-Math.floor(bt*100),Ct=Math.floor(ct[St]*100),It=Math.floor(ct[St+1]*100);typeof ct[St+1]<"u"?Rt>=Ct&&Rt<It-(It-Ct)/2?at=St:Rt>=Ct&&Rt<It&&(at=St+1):Rt>=Ct&&(at=St)}if(ot.initialized&&at!==ht&&(!ot.allowSlideNext&&(ft?bt>ot.translate&&bt>ot.minTranslate():bt<ot.translate&&bt<ot.minTranslate())||!ot.allowSlidePrev&&bt>ot.translate&&bt>ot.maxTranslate()&&(ht||0)!==at))return!1;at!==(dt||0)&&rt&&ot.emit("beforeSlideChangeStart"),ot.updateProgress(bt);let wt;if(at>ht?wt="next":at<ht?wt="prev":wt="reset",ft&&-bt===ot.translate||!ft&&bt===ot.translate)return ot.updateActiveIndex(at),lt.autoHeight&&ot.updateAutoHeight(),ot.updateSlidesClasses(),lt.effect!=="slide"&&ot.setTranslate(bt),wt!=="reset"&&(ot.transitionStart(rt,wt),ot.transitionEnd(rt,wt)),!1;if(lt.cssMode){const St=ot.isHorizontal(),Rt=ft?bt:-bt;if(et===0){const Ct=ot.virtual&&ot.params.virtual.enabled;Ct&&(ot.wrapperEl.style.scrollSnapType="none",ot._immediateVirtual=!0),Ct&&!ot._cssModeVirtualInitialSet&&ot.params.initialSlide>0?(ot._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{xt[St?"scrollLeft":"scrollTop"]=Rt})):xt[St?"scrollLeft":"scrollTop"]=Rt,Ct&&requestAnimationFrame(()=>{ot.wrapperEl.style.scrollSnapType="",ot._immediateVirtual=!1})}else{if(!ot.support.smoothScroll)return animateCSSModeScroll({swiper:ot,targetPosition:Rt,side:St?"left":"top"}),!0;xt.scrollTo({[St?"left":"top"]:Rt,behavior:"smooth"})}return!0}return ot.setTransition(et),ot.setTranslate(bt),ot.updateActiveIndex(at),ot.updateSlidesClasses(),ot.emit("beforeTransitionStart",et,st),ot.transitionStart(rt,wt),et===0?ot.transitionEnd(rt,wt):ot.animating||(ot.animating=!0,ot.onSlideToWrapperTransitionEnd||(ot.onSlideToWrapperTransitionEnd=function(Rt){!ot||ot.destroyed||Rt.target===this&&(ot.wrapperEl.removeEventListener("transitionend",ot.onSlideToWrapperTransitionEnd),ot.onSlideToWrapperTransitionEnd=null,delete ot.onSlideToWrapperTransitionEnd,ot.transitionEnd(rt,wt))}),ot.wrapperEl.addEventListener("transitionend",ot.onSlideToWrapperTransitionEnd)),!0}function slideToLoop(tt,et,rt,st){tt===void 0&&(tt=0),et===void 0&&(et=this.params.speed),rt===void 0&&(rt=!0),typeof tt=="string"&&(tt=parseInt(tt,10));const nt=this;let ot=tt;return nt.params.loop&&(nt.virtual&&nt.params.virtual.enabled?ot=ot+nt.virtual.slidesBefore:ot=nt.getSlideIndexByData(ot)),nt.slideTo(ot,et,rt,st)}function slideNext(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const st=this,{enabled:nt,params:ot,animating:at}=st;if(!nt)return st;let lt=ot.slidesPerGroup;ot.slidesPerView==="auto"&&ot.slidesPerGroup===1&&ot.slidesPerGroupAuto&&(lt=Math.max(st.slidesPerViewDynamic("current",!0),1));const ut=st.activeIndex<ot.slidesPerGroupSkip?1:lt,ct=st.virtual&&ot.virtual.enabled;if(ot.loop){if(at&&!ct&&ot.loopPreventsSliding)return!1;if(st.loopFix({direction:"next"}),st._clientLeft=st.wrapperEl.clientLeft,st.activeIndex===st.slides.length-1&&ot.cssMode)return requestAnimationFrame(()=>{st.slideTo(st.activeIndex+ut,tt,et,rt)}),!0}return ot.rewind&&st.isEnd?st.slideTo(0,tt,et,rt):st.slideTo(st.activeIndex+ut,tt,et,rt)}function slidePrev(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const st=this,{params:nt,snapGrid:ot,slidesGrid:at,rtlTranslate:lt,enabled:ut,animating:ct}=st;if(!ut)return st;const dt=st.virtual&&nt.virtual.enabled;if(nt.loop){if(ct&&!dt&&nt.loopPreventsSliding)return!1;st.loopFix({direction:"prev"}),st._clientLeft=st.wrapperEl.clientLeft}const ht=lt?st.translate:-st.translate;function ft(bt){return bt<0?-Math.floor(Math.abs(bt)):Math.floor(bt)}const xt=ft(ht),vt=ot.map(bt=>ft(bt));let yt=ot[vt.indexOf(xt)-1];if(typeof yt>"u"&&nt.cssMode){let bt;ot.forEach((wt,St)=>{xt>=wt&&(bt=St)}),typeof bt<"u"&&(yt=ot[bt>0?bt-1:bt])}let Et=0;if(typeof yt<"u"&&(Et=at.indexOf(yt),Et<0&&(Et=st.activeIndex-1),nt.slidesPerView==="auto"&&nt.slidesPerGroup===1&&nt.slidesPerGroupAuto&&(Et=Et-st.slidesPerViewDynamic("previous",!0)+1,Et=Math.max(Et,0))),nt.rewind&&st.isBeginning){const bt=st.params.virtual&&st.params.virtual.enabled&&st.virtual?st.virtual.slides.length-1:st.slides.length-1;return st.slideTo(bt,tt,et,rt)}else if(nt.loop&&st.activeIndex===0&&nt.cssMode)return requestAnimationFrame(()=>{st.slideTo(Et,tt,et,rt)}),!0;return st.slideTo(Et,tt,et,rt)}function slideReset(tt,et,rt){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0);const st=this;return st.slideTo(st.activeIndex,tt,et,rt)}function slideToClosest(tt,et,rt,st){tt===void 0&&(tt=this.params.speed),et===void 0&&(et=!0),st===void 0&&(st=.5);const nt=this;let ot=nt.activeIndex;const at=Math.min(nt.params.slidesPerGroupSkip,ot),lt=at+Math.floor((ot-at)/nt.params.slidesPerGroup),ut=nt.rtlTranslate?nt.translate:-nt.translate;if(ut>=nt.snapGrid[lt]){const ct=nt.snapGrid[lt],dt=nt.snapGrid[lt+1];ut-ct>(dt-ct)*st&&(ot+=nt.params.slidesPerGroup)}else{const ct=nt.snapGrid[lt-1],dt=nt.snapGrid[lt];ut-ct<=(dt-ct)*st&&(ot-=nt.params.slidesPerGroup)}return ot=Math.max(ot,0),ot=Math.min(ot,nt.slidesGrid.length-1),nt.slideTo(ot,tt,et,rt)}function slideToClickedSlide(){const tt=this,{params:et,slidesEl:rt}=tt,st=et.slidesPerView==="auto"?tt.slidesPerViewDynamic():et.slidesPerView;let nt=tt.clickedIndex,ot;const at=tt.isElement?"swiper-slide":`.${et.slideClass}`;if(et.loop){if(tt.animating)return;ot=parseInt(tt.clickedSlide.getAttribute("data-swiper-slide-index"),10),et.centeredSlides?nt<tt.loopedSlides-st/2||nt>tt.slides.length-tt.loopedSlides+st/2?(tt.loopFix(),nt=tt.getSlideIndex(elementChildren(rt,`${at}[data-swiper-slide-index="${ot}"]`)[0]),nextTick(()=>{tt.slideTo(nt)})):tt.slideTo(nt):nt>tt.slides.length-st?(tt.loopFix(),nt=tt.getSlideIndex(elementChildren(rt,`${at}[data-swiper-slide-index="${ot}"]`)[0]),nextTick(()=>{tt.slideTo(nt)})):tt.slideTo(nt)}else tt.slideTo(nt)}var slide={slideTo,slideToLoop,slideNext,slidePrev,slideReset,slideToClosest,slideToClickedSlide};function loopCreate(tt){const et=this,{params:rt,slidesEl:st}=et;if(!rt.loop||et.virtual&&et.params.virtual.enabled)return;elementChildren(st,`.${rt.slideClass}, swiper-slide`).forEach((ot,at)=>{ot.setAttribute("data-swiper-slide-index",at)}),et.loopFix({slideRealIndex:tt,direction:rt.centeredSlides?void 0:"next"})}function loopFix(tt){let{slideRealIndex:et,slideTo:rt=!0,direction:st,setTranslate:nt,activeSlideIndex:ot,byController:at,byMousewheel:lt}=tt===void 0?{}:tt;const ut=this;if(!ut.params.loop)return;ut.emit("beforeLoopFix");const{slides:ct,allowSlidePrev:dt,allowSlideNext:ht,slidesEl:ft,params:xt}=ut;if(ut.allowSlidePrev=!0,ut.allowSlideNext=!0,ut.virtual&&xt.virtual.enabled){rt&&(!xt.centeredSlides&&ut.snapIndex===0?ut.slideTo(ut.virtual.slides.length,0,!1,!0):xt.centeredSlides&&ut.snapIndex<xt.slidesPerView?ut.slideTo(ut.virtual.slides.length+ut.snapIndex,0,!1,!0):ut.snapIndex===ut.snapGrid.length-1&&ut.slideTo(ut.virtual.slidesBefore,0,!1,!0)),ut.allowSlidePrev=dt,ut.allowSlideNext=ht,ut.emit("loopFix");return}const vt=xt.slidesPerView==="auto"?ut.slidesPerViewDynamic():Math.ceil(parseFloat(xt.slidesPerView,10));let yt=xt.loopedSlides||vt;yt%xt.slidesPerGroup!==0&&(yt+=xt.slidesPerGroup-yt%xt.slidesPerGroup),ut.loopedSlides=yt;const Et=[],bt=[];let wt=ut.activeIndex;typeof ot>"u"?ot=ut.getSlideIndex(ut.slides.filter(jt=>jt.classList.contains(xt.slideActiveClass))[0]):wt=ot;const St=st==="next"||!st,Rt=st==="prev"||!st;let Ct=0,It=0;if(ot<yt){Ct=Math.max(yt-ot,xt.slidesPerGroup);for(let jt=0;jt<yt-ot;jt+=1){const Pt=jt-Math.floor(jt/ct.length)*ct.length;Et.push(ct.length-Pt-1)}}else if(ot>ut.slides.length-yt*2){It=Math.max(ot-(ut.slides.length-yt*2),xt.slidesPerGroup);for(let jt=0;jt<It;jt+=1){const Pt=jt-Math.floor(jt/ct.length)*ct.length;bt.push(Pt)}}if(Rt&&Et.forEach(jt=>{ut.slides[jt].swiperLoopMoveDOM=!0,ft.prepend(ut.slides[jt]),ut.slides[jt].swiperLoopMoveDOM=!1}),St&&bt.forEach(jt=>{ut.slides[jt].swiperLoopMoveDOM=!0,ft.append(ut.slides[jt]),ut.slides[jt].swiperLoopMoveDOM=!1}),ut.recalcSlides(),xt.slidesPerView==="auto"&&ut.updateSlides(),xt.watchSlidesProgress&&ut.updateSlidesOffset(),rt){if(Et.length>0&&Rt)if(typeof et>"u"){const jt=ut.slidesGrid[wt],Ot=ut.slidesGrid[wt+Ct]-jt;lt?ut.setTranslate(ut.translate-Ot):(ut.slideTo(wt+Ct,0,!1,!0),nt&&(ut.touches[ut.isHorizontal()?"startX":"startY"]+=Ot,ut.touchEventsData.currentTranslate=ut.translate))}else nt&&(ut.slideToLoop(et,0,!1,!0),ut.touchEventsData.currentTranslate=ut.translate);else if(bt.length>0&&St)if(typeof et>"u"){const jt=ut.slidesGrid[wt],Ot=ut.slidesGrid[wt-It]-jt;lt?ut.setTranslate(ut.translate-Ot):(ut.slideTo(wt-It,0,!1,!0),nt&&(ut.touches[ut.isHorizontal()?"startX":"startY"]+=Ot,ut.touchEventsData.currentTranslate=ut.translate))}else ut.slideToLoop(et,0,!1,!0)}if(ut.allowSlidePrev=dt,ut.allowSlideNext=ht,ut.controller&&ut.controller.control&&!at){const jt={slideRealIndex:et,direction:st,setTranslate:nt,activeSlideIndex:ot,byController:!0};Array.isArray(ut.controller.control)?ut.controller.control.forEach(Pt=>{!Pt.destroyed&&Pt.params.loop&&Pt.loopFix({...jt,slideTo:Pt.params.slidesPerView===xt.slidesPerView?rt:!1})}):ut.controller.control instanceof ut.constructor&&ut.controller.control.params.loop&&ut.controller.control.loopFix({...jt,slideTo:ut.controller.control.params.slidesPerView===xt.slidesPerView?rt:!1})}ut.emit("loopFix")}function loopDestroy(){const tt=this,{params:et,slidesEl:rt}=tt;if(!et.loop||tt.virtual&&tt.params.virtual.enabled)return;tt.recalcSlides();const st=[];tt.slides.forEach(nt=>{const ot=typeof nt.swiperSlideIndex>"u"?nt.getAttribute("data-swiper-slide-index")*1:nt.swiperSlideIndex;st[ot]=nt}),tt.slides.forEach(nt=>{nt.removeAttribute("data-swiper-slide-index")}),st.forEach(nt=>{rt.append(nt)}),tt.recalcSlides(),tt.slideTo(tt.realIndex,0)}var loop={loopCreate,loopFix,loopDestroy};function setGrabCursor(tt){const et=this;if(!et.params.simulateTouch||et.params.watchOverflow&&et.isLocked||et.params.cssMode)return;const rt=et.params.touchEventsTarget==="container"?et.el:et.wrapperEl;et.isElement&&(et.__preventObserver__=!0),rt.style.cursor="move",rt.style.cursor=tt?"grabbing":"grab",et.isElement&&requestAnimationFrame(()=>{et.__preventObserver__=!1})}function unsetGrabCursor(){const tt=this;tt.params.watchOverflow&&tt.isLocked||tt.params.cssMode||(tt.isElement&&(tt.__preventObserver__=!0),tt[tt.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",tt.isElement&&requestAnimationFrame(()=>{tt.__preventObserver__=!1}))}var grabCursor={setGrabCursor,unsetGrabCursor};function closestElement(tt,et){et===void 0&&(et=this);function rt(st){if(!st||st===getDocument()||st===getWindow())return null;st.assignedSlot&&(st=st.assignedSlot);const nt=st.closest(tt);return!nt&&!st.getRootNode?null:nt||rt(st.getRootNode().host)}return rt(et)}function onTouchStart(tt){const et=this,rt=getDocument(),st=getWindow(),nt=et.touchEventsData;nt.evCache.push(tt);const{params:ot,touches:at,enabled:lt}=et;if(!lt||!ot.simulateTouch&&tt.pointerType==="mouse"||et.animating&&ot.preventInteractionOnTransition)return;!et.animating&&ot.cssMode&&ot.loop&&et.loopFix();let ut=tt;ut.originalEvent&&(ut=ut.originalEvent);let ct=ut.target;if(ot.touchEventsTarget==="wrapper"&&!et.wrapperEl.contains(ct)||"which"in ut&&ut.which===3||"button"in ut&&ut.button>0||nt.isTouched&&nt.isMoved)return;const dt=!!ot.noSwipingClass&&ot.noSwipingClass!=="",ht=tt.composedPath?tt.composedPath():tt.path;dt&&ut.target&&ut.target.shadowRoot&&ht&&(ct=ht[0]);const ft=ot.noSwipingSelector?ot.noSwipingSelector:`.${ot.noSwipingClass}`,xt=!!(ut.target&&ut.target.shadowRoot);if(ot.noSwiping&&(xt?closestElement(ft,ct):ct.closest(ft))){et.allowClick=!0;return}if(ot.swipeHandler&&!ct.closest(ot.swipeHandler))return;at.currentX=ut.pageX,at.currentY=ut.pageY;const vt=at.currentX,yt=at.currentY,Et=ot.edgeSwipeDetection||ot.iOSEdgeSwipeDetection,bt=ot.edgeSwipeThreshold||ot.iOSEdgeSwipeThreshold;if(Et&&(vt<=bt||vt>=st.innerWidth-bt))if(Et==="prevent")tt.preventDefault();else return;Object.assign(nt,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),at.startX=vt,at.startY=yt,nt.touchStartTime=now(),et.allowClick=!0,et.updateSize(),et.swipeDirection=void 0,ot.threshold>0&&(nt.allowThresholdMove=!1);let wt=!0;ct.matches(nt.focusableElements)&&(wt=!1,ct.nodeName==="SELECT"&&(nt.isTouched=!1)),rt.activeElement&&rt.activeElement.matches(nt.focusableElements)&&rt.activeElement!==ct&&rt.activeElement.blur();const St=wt&&et.allowTouchMove&&ot.touchStartPreventDefault;(ot.touchStartForcePreventDefault||St)&&!ct.isContentEditable&&ut.preventDefault(),ot.freeMode&&ot.freeMode.enabled&&et.freeMode&&et.animating&&!ot.cssMode&&et.freeMode.onTouchStart(),et.emit("touchStart",ut)}function onTouchMove(tt){const et=getDocument(),rt=this,st=rt.touchEventsData,{params:nt,touches:ot,rtlTranslate:at,enabled:lt}=rt;if(!lt||!nt.simulateTouch&&tt.pointerType==="mouse")return;let ut=tt;if(ut.originalEvent&&(ut=ut.originalEvent),!st.isTouched){st.startMoving&&st.isScrolling&&rt.emit("touchMoveOpposite",ut);return}const ct=st.evCache.findIndex(jt=>jt.pointerId===ut.pointerId);ct>=0&&(st.evCache[ct]=ut);const dt=st.evCache.length>1?st.evCache[0]:ut,ht=dt.pageX,ft=dt.pageY;if(ut.preventedByNestedSwiper){ot.startX=ht,ot.startY=ft;return}if(!rt.allowTouchMove){ut.target.matches(st.focusableElements)||(rt.allowClick=!1),st.isTouched&&(Object.assign(ot,{startX:ht,startY:ft,prevX:rt.touches.currentX,prevY:rt.touches.currentY,currentX:ht,currentY:ft}),st.touchStartTime=now());return}if(nt.touchReleaseOnEdges&&!nt.loop){if(rt.isVertical()){if(ft<ot.startY&&rt.translate<=rt.maxTranslate()||ft>ot.startY&&rt.translate>=rt.minTranslate()){st.isTouched=!1,st.isMoved=!1;return}}else if(ht<ot.startX&&rt.translate<=rt.maxTranslate()||ht>ot.startX&&rt.translate>=rt.minTranslate())return}if(et.activeElement&&ut.target===et.activeElement&&ut.target.matches(st.focusableElements)){st.isMoved=!0,rt.allowClick=!1;return}if(st.allowTouchCallbacks&&rt.emit("touchMove",ut),ut.targetTouches&&ut.targetTouches.length>1)return;ot.currentX=ht,ot.currentY=ft;const xt=ot.currentX-ot.startX,vt=ot.currentY-ot.startY;if(rt.params.threshold&&Math.sqrt(xt**2+vt**2)<rt.params.threshold)return;if(typeof st.isScrolling>"u"){let jt;rt.isHorizontal()&&ot.currentY===ot.startY||rt.isVertical()&&ot.currentX===ot.startX?st.isScrolling=!1:xt*xt+vt*vt>=25&&(jt=Math.atan2(Math.abs(vt),Math.abs(xt))*180/Math.PI,st.isScrolling=rt.isHorizontal()?jt>nt.touchAngle:90-jt>nt.touchAngle)}if(st.isScrolling&&rt.emit("touchMoveOpposite",ut),typeof st.startMoving>"u"&&(ot.currentX!==ot.startX||ot.currentY!==ot.startY)&&(st.startMoving=!0),st.isScrolling||rt.zoom&&rt.params.zoom&&rt.params.zoom.enabled&&st.evCache.length>1){st.isTouched=!1;return}if(!st.startMoving)return;rt.allowClick=!1,!nt.cssMode&&ut.cancelable&&ut.preventDefault(),nt.touchMoveStopPropagation&&!nt.nested&&ut.stopPropagation();let yt=rt.isHorizontal()?xt:vt,Et=rt.isHorizontal()?ot.currentX-ot.previousX:ot.currentY-ot.previousY;nt.oneWayMovement&&(yt=Math.abs(yt)*(at?1:-1),Et=Math.abs(Et)*(at?1:-1)),ot.diff=yt,yt*=nt.touchRatio,at&&(yt=-yt,Et=-Et);const bt=rt.touchesDirection;rt.swipeDirection=yt>0?"prev":"next",rt.touchesDirection=Et>0?"prev":"next";const wt=rt.params.loop&&!nt.cssMode,St=rt.swipeDirection==="next"&&rt.allowSlideNext||rt.swipeDirection==="prev"&&rt.allowSlidePrev;if(!st.isMoved){if(wt&&St&&rt.loopFix({direction:rt.swipeDirection}),st.startTranslate=rt.getTranslate(),rt.setTransition(0),rt.animating){const jt=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0});rt.wrapperEl.dispatchEvent(jt)}st.allowMomentumBounce=!1,nt.grabCursor&&(rt.allowSlideNext===!0||rt.allowSlidePrev===!0)&&rt.setGrabCursor(!0),rt.emit("sliderFirstMove",ut)}let Rt;st.isMoved&&bt!==rt.touchesDirection&&wt&&St&&Math.abs(yt)>=1&&(rt.loopFix({direction:rt.swipeDirection,setTranslate:!0}),Rt=!0),rt.emit("sliderMove",ut),st.isMoved=!0,st.currentTranslate=yt+st.startTranslate;let Ct=!0,It=nt.resistanceRatio;if(nt.touchReleaseOnEdges&&(It=0),yt>0?(wt&&St&&!Rt&&st.currentTranslate>(nt.centeredSlides?rt.minTranslate()-rt.size/2:rt.minTranslate())&&rt.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),st.currentTranslate>rt.minTranslate()&&(Ct=!1,nt.resistance&&(st.currentTranslate=rt.minTranslate()-1+(-rt.minTranslate()+st.startTranslate+yt)**It))):yt<0&&(wt&&St&&!Rt&&st.currentTranslate<(nt.centeredSlides?rt.maxTranslate()+rt.size/2:rt.maxTranslate())&&rt.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:rt.slides.length-(nt.slidesPerView==="auto"?rt.slidesPerViewDynamic():Math.ceil(parseFloat(nt.slidesPerView,10)))}),st.currentTranslate<rt.maxTranslate()&&(Ct=!1,nt.resistance&&(st.currentTranslate=rt.maxTranslate()+1-(rt.maxTranslate()-st.startTranslate-yt)**It))),Ct&&(ut.preventedByNestedSwiper=!0),!rt.allowSlideNext&&rt.swipeDirection==="next"&&st.currentTranslate<st.startTranslate&&(st.currentTranslate=st.startTranslate),!rt.allowSlidePrev&&rt.swipeDirection==="prev"&&st.currentTranslate>st.startTranslate&&(st.currentTranslate=st.startTranslate),!rt.allowSlidePrev&&!rt.allowSlideNext&&(st.currentTranslate=st.startTranslate),nt.threshold>0)if(Math.abs(yt)>nt.threshold||st.allowThresholdMove){if(!st.allowThresholdMove){st.allowThresholdMove=!0,ot.startX=ot.currentX,ot.startY=ot.currentY,st.currentTranslate=st.startTranslate,ot.diff=rt.isHorizontal()?ot.currentX-ot.startX:ot.currentY-ot.startY;return}}else{st.currentTranslate=st.startTranslate;return}!nt.followFinger||nt.cssMode||((nt.freeMode&&nt.freeMode.enabled&&rt.freeMode||nt.watchSlidesProgress)&&(rt.updateActiveIndex(),rt.updateSlidesClasses()),nt.freeMode&&nt.freeMode.enabled&&rt.freeMode&&rt.freeMode.onTouchMove(),rt.updateProgress(st.currentTranslate),rt.setTranslate(st.currentTranslate))}function onTouchEnd(tt){const et=this,rt=et.touchEventsData,st=rt.evCache.findIndex(St=>St.pointerId===tt.pointerId);if(st>=0&&rt.evCache.splice(st,1),["pointercancel","pointerout","pointerleave","contextmenu"].includes(tt.type)&&!(["pointercancel","contextmenu"].includes(tt.type)&&(et.browser.isSafari||et.browser.isWebView)))return;const{params:nt,touches:ot,rtlTranslate:at,slidesGrid:lt,enabled:ut}=et;if(!ut||!nt.simulateTouch&&tt.pointerType==="mouse")return;let ct=tt;if(ct.originalEvent&&(ct=ct.originalEvent),rt.allowTouchCallbacks&&et.emit("touchEnd",ct),rt.allowTouchCallbacks=!1,!rt.isTouched){rt.isMoved&&nt.grabCursor&&et.setGrabCursor(!1),rt.isMoved=!1,rt.startMoving=!1;return}nt.grabCursor&&rt.isMoved&&rt.isTouched&&(et.allowSlideNext===!0||et.allowSlidePrev===!0)&&et.setGrabCursor(!1);const dt=now(),ht=dt-rt.touchStartTime;if(et.allowClick){const St=ct.path||ct.composedPath&&ct.composedPath();et.updateClickedSlide(St&&St[0]||ct.target,St),et.emit("tap click",ct),ht<300&&dt-rt.lastClickTime<300&&et.emit("doubleTap doubleClick",ct)}if(rt.lastClickTime=now(),nextTick(()=>{et.destroyed||(et.allowClick=!0)}),!rt.isTouched||!rt.isMoved||!et.swipeDirection||ot.diff===0||rt.currentTranslate===rt.startTranslate){rt.isTouched=!1,rt.isMoved=!1,rt.startMoving=!1;return}rt.isTouched=!1,rt.isMoved=!1,rt.startMoving=!1;let ft;if(nt.followFinger?ft=at?et.translate:-et.translate:ft=-rt.currentTranslate,nt.cssMode)return;if(nt.freeMode&&nt.freeMode.enabled){et.freeMode.onTouchEnd({currentPos:ft});return}let xt=0,vt=et.slidesSizesGrid[0];for(let St=0;St<lt.length;St+=St<nt.slidesPerGroupSkip?1:nt.slidesPerGroup){const Rt=St<nt.slidesPerGroupSkip-1?1:nt.slidesPerGroup;typeof lt[St+Rt]<"u"?ft>=lt[St]&&ft<lt[St+Rt]&&(xt=St,vt=lt[St+Rt]-lt[St]):ft>=lt[St]&&(xt=St,vt=lt[lt.length-1]-lt[lt.length-2])}let yt=null,Et=null;nt.rewind&&(et.isBeginning?Et=nt.virtual&&nt.virtual.enabled&&et.virtual?et.virtual.slides.length-1:et.slides.length-1:et.isEnd&&(yt=0));const bt=(ft-lt[xt])/vt,wt=xt<nt.slidesPerGroupSkip-1?1:nt.slidesPerGroup;if(ht>nt.longSwipesMs){if(!nt.longSwipes){et.slideTo(et.activeIndex);return}et.swipeDirection==="next"&&(bt>=nt.longSwipesRatio?et.slideTo(nt.rewind&&et.isEnd?yt:xt+wt):et.slideTo(xt)),et.swipeDirection==="prev"&&(bt>1-nt.longSwipesRatio?et.slideTo(xt+wt):Et!==null&&bt<0&&Math.abs(bt)>nt.longSwipesRatio?et.slideTo(Et):et.slideTo(xt))}else{if(!nt.shortSwipes){et.slideTo(et.activeIndex);return}et.navigation&&(ct.target===et.navigation.nextEl||ct.target===et.navigation.prevEl)?ct.target===et.navigation.nextEl?et.slideTo(xt+wt):et.slideTo(xt):(et.swipeDirection==="next"&&et.slideTo(yt!==null?yt:xt+wt),et.swipeDirection==="prev"&&et.slideTo(Et!==null?Et:xt))}}function onResize(){const tt=this,{params:et,el:rt}=tt;if(rt&&rt.offsetWidth===0)return;et.breakpoints&&tt.setBreakpoint();const{allowSlideNext:st,allowSlidePrev:nt,snapGrid:ot}=tt,at=tt.virtual&&tt.params.virtual.enabled;tt.allowSlideNext=!0,tt.allowSlidePrev=!0,tt.updateSize(),tt.updateSlides(),tt.updateSlidesClasses();const lt=at&&et.loop;(et.slidesPerView==="auto"||et.slidesPerView>1)&&tt.isEnd&&!tt.isBeginning&&!tt.params.centeredSlides&&!lt?tt.slideTo(tt.slides.length-1,0,!1,!0):tt.params.loop&&!at?tt.slideToLoop(tt.realIndex,0,!1,!0):tt.slideTo(tt.activeIndex,0,!1,!0),tt.autoplay&&tt.autoplay.running&&tt.autoplay.paused&&(clearTimeout(tt.autoplay.resizeTimeout),tt.autoplay.resizeTimeout=setTimeout(()=>{tt.autoplay&&tt.autoplay.running&&tt.autoplay.paused&&tt.autoplay.resume()},500)),tt.allowSlidePrev=nt,tt.allowSlideNext=st,tt.params.watchOverflow&&ot!==tt.snapGrid&&tt.checkOverflow()}function onClick(tt){const et=this;et.enabled&&(et.allowClick||(et.params.preventClicks&&tt.preventDefault(),et.params.preventClicksPropagation&&et.animating&&(tt.stopPropagation(),tt.stopImmediatePropagation())))}function onScroll(){const tt=this,{wrapperEl:et,rtlTranslate:rt,enabled:st}=tt;if(!st)return;tt.previousTranslate=tt.translate,tt.isHorizontal()?tt.translate=-et.scrollLeft:tt.translate=-et.scrollTop,tt.translate===0&&(tt.translate=0),tt.updateActiveIndex(),tt.updateSlidesClasses();let nt;const ot=tt.maxTranslate()-tt.minTranslate();ot===0?nt=0:nt=(tt.translate-tt.minTranslate())/ot,nt!==tt.progress&&tt.updateProgress(rt?-tt.translate:tt.translate),tt.emit("setTranslate",tt.translate,!1)}function onLoad(tt){const et=this;processLazyPreloader(et,tt.target),!(et.params.cssMode||et.params.slidesPerView!=="auto"&&!et.params.autoHeight)&&et.update()}let dummyEventAttached=!1;function dummyEventListener(){}const events=(tt,et)=>{const rt=getDocument(),{params:st,el:nt,wrapperEl:ot,device:at}=tt,lt=!!st.nested,ut=et==="on"?"addEventListener":"removeEventListener",ct=et;nt[ut]("pointerdown",tt.onTouchStart,{passive:!1}),rt[ut]("pointermove",tt.onTouchMove,{passive:!1,capture:lt}),rt[ut]("pointerup",tt.onTouchEnd,{passive:!0}),rt[ut]("pointercancel",tt.onTouchEnd,{passive:!0}),rt[ut]("pointerout",tt.onTouchEnd,{passive:!0}),rt[ut]("pointerleave",tt.onTouchEnd,{passive:!0}),rt[ut]("contextmenu",tt.onTouchEnd,{passive:!0}),(st.preventClicks||st.preventClicksPropagation)&&nt[ut]("click",tt.onClick,!0),st.cssMode&&ot[ut]("scroll",tt.onScroll),st.updateOnWindowResize?tt[ct](at.ios||at.android?"resize orientationchange observerUpdate":"resize observerUpdate",onResize,!0):tt[ct]("observerUpdate",onResize,!0),nt[ut]("load",tt.onLoad,{capture:!0})};function attachEvents(){const tt=this,et=getDocument(),{params:rt}=tt;tt.onTouchStart=onTouchStart.bind(tt),tt.onTouchMove=onTouchMove.bind(tt),tt.onTouchEnd=onTouchEnd.bind(tt),rt.cssMode&&(tt.onScroll=onScroll.bind(tt)),tt.onClick=onClick.bind(tt),tt.onLoad=onLoad.bind(tt),dummyEventAttached||(et.addEventListener("touchstart",dummyEventListener),dummyEventAttached=!0),events(tt,"on")}function detachEvents(){events(this,"off")}var events$1={attachEvents,detachEvents};const isGridEnabled=(tt,et)=>tt.grid&&et.grid&&et.grid.rows>1;function setBreakpoint(){const tt=this,{realIndex:et,initialized:rt,params:st,el:nt}=tt,ot=st.breakpoints;if(!ot||ot&&Object.keys(ot).length===0)return;const at=tt.getBreakpoint(ot,tt.params.breakpointsBase,tt.el);if(!at||tt.currentBreakpoint===at)return;const ut=(at in ot?ot[at]:void 0)||tt.originalParams,ct=isGridEnabled(tt,st),dt=isGridEnabled(tt,ut),ht=st.enabled;ct&&!dt?(nt.classList.remove(`${st.containerModifierClass}grid`,`${st.containerModifierClass}grid-column`),tt.emitContainerClasses()):!ct&&dt&&(nt.classList.add(`${st.containerModifierClass}grid`),(ut.grid.fill&&ut.grid.fill==="column"||!ut.grid.fill&&st.grid.fill==="column")&&nt.classList.add(`${st.containerModifierClass}grid-column`),tt.emitContainerClasses()),["navigation","pagination","scrollbar"].forEach(bt=>{if(typeof ut[bt]>"u")return;const wt=st[bt]&&st[bt].enabled,St=ut[bt]&&ut[bt].enabled;wt&&!St&&tt[bt].disable(),!wt&&St&&tt[bt].enable()});const ft=ut.direction&&ut.direction!==st.direction,xt=st.loop&&(ut.slidesPerView!==st.slidesPerView||ft),vt=st.loop;ft&&rt&&tt.changeDirection(),extend$1(tt.params,ut);const yt=tt.params.enabled,Et=tt.params.loop;Object.assign(tt,{allowTouchMove:tt.params.allowTouchMove,allowSlideNext:tt.params.allowSlideNext,allowSlidePrev:tt.params.allowSlidePrev}),ht&&!yt?tt.disable():!ht&&yt&&tt.enable(),tt.currentBreakpoint=at,tt.emit("_beforeBreakpoint",ut),rt&&(xt?(tt.loopDestroy(),tt.loopCreate(et),tt.updateSlides()):!vt&&Et?(tt.loopCreate(et),tt.updateSlides()):vt&&!Et&&tt.loopDestroy()),tt.emit("breakpoint",ut)}function getBreakpoint(tt,et,rt){if(et===void 0&&(et="window"),!tt||et==="container"&&!rt)return;let st=!1;const nt=getWindow(),ot=et==="window"?nt.innerHeight:rt.clientHeight,at=Object.keys(tt).map(lt=>{if(typeof lt=="string"&<.indexOf("@")===0){const ut=parseFloat(lt.substr(1));return{value:ot*ut,point:lt}}return{value:lt,point:lt}});at.sort((lt,ut)=>parseInt(lt.value,10)-parseInt(ut.value,10));for(let lt=0;lt<at.length;lt+=1){const{point:ut,value:ct}=at[lt];et==="window"?nt.matchMedia(`(min-width: ${ct}px)`).matches&&(st=ut):ct<=rt.clientWidth&&(st=ut)}return st||"max"}var breakpoints={setBreakpoint,getBreakpoint};function prepareClasses(tt,et){const rt=[];return tt.forEach(st=>{typeof st=="object"?Object.keys(st).forEach(nt=>{st[nt]&&rt.push(et+nt)}):typeof st=="string"&&rt.push(et+st)}),rt}function addClasses(){const tt=this,{classNames:et,params:rt,rtl:st,el:nt,device:ot}=tt,at=prepareClasses(["initialized",rt.direction,{"free-mode":tt.params.freeMode&&rt.freeMode.enabled},{autoheight:rt.autoHeight},{rtl:st},{grid:rt.grid&&rt.grid.rows>1},{"grid-column":rt.grid&&rt.grid.rows>1&&rt.grid.fill==="column"},{android:ot.android},{ios:ot.ios},{"css-mode":rt.cssMode},{centered:rt.cssMode&&rt.centeredSlides},{"watch-progress":rt.watchSlidesProgress}],rt.containerModifierClass);et.push(...at),nt.classList.add(...et),tt.emitContainerClasses()}function removeClasses(){const tt=this,{el:et,classNames:rt}=tt;et.classList.remove(...rt),tt.emitContainerClasses()}var classes={addClasses,removeClasses};function checkOverflow(){const tt=this,{isLocked:et,params:rt}=tt,{slidesOffsetBefore:st}=rt;if(st){const nt=tt.slides.length-1,ot=tt.slidesGrid[nt]+tt.slidesSizesGrid[nt]+st*2;tt.isLocked=tt.size>ot}else tt.isLocked=tt.snapGrid.length===1;rt.allowSlideNext===!0&&(tt.allowSlideNext=!tt.isLocked),rt.allowSlidePrev===!0&&(tt.allowSlidePrev=!tt.isLocked),et&&et!==tt.isLocked&&(tt.isEnd=!1),et!==tt.isLocked&&tt.emit(tt.isLocked?"lock":"unlock")}var checkOverflow$1={checkOverflow},defaults$3={init:!0,direction:"horizontal",oneWayMovement:!1,touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopedSlides:null,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function moduleExtendParams(tt,et){return function(st){st===void 0&&(st={});const nt=Object.keys(st)[0],ot=st[nt];if(typeof ot!="object"||ot===null){extend$1(et,st);return}if(tt[nt]===!0&&(tt[nt]={enabled:!0}),nt==="navigation"&&tt[nt]&&tt[nt].enabled&&!tt[nt].prevEl&&!tt[nt].nextEl&&(tt[nt].auto=!0),["pagination","scrollbar"].indexOf(nt)>=0&&tt[nt]&&tt[nt].enabled&&!tt[nt].el&&(tt[nt].auto=!0),!(nt in tt&&"enabled"in ot)){extend$1(et,st);return}typeof tt[nt]=="object"&&!("enabled"in tt[nt])&&(tt[nt].enabled=!0),tt[nt]||(tt[nt]={enabled:!1}),extend$1(et,st)}}const prototypes={eventsEmitter,update,translate,transition,slide,loop,grabCursor,events:events$1,breakpoints,checkOverflow:checkOverflow$1,classes},extendedDefaults={};let Swiper$1=class Ao{constructor(){let et,rt;for(var st=arguments.length,nt=new Array(st),ot=0;ot<st;ot++)nt[ot]=arguments[ot];nt.length===1&&nt[0].constructor&&Object.prototype.toString.call(nt[0]).slice(8,-1)==="Object"?rt=nt[0]:[et,rt]=nt,rt||(rt={}),rt=extend$1({},rt),et&&!rt.el&&(rt.el=et);const at=getDocument();if(rt.el&&typeof rt.el=="string"&&at.querySelectorAll(rt.el).length>1){const dt=[];return at.querySelectorAll(rt.el).forEach(ht=>{const ft=extend$1({},rt,{el:ht});dt.push(new Ao(ft))}),dt}const lt=this;lt.__swiper__=!0,lt.support=getSupport(),lt.device=getDevice({userAgent:rt.userAgent}),lt.browser=getBrowser(),lt.eventsListeners={},lt.eventsAnyListeners=[],lt.modules=[...lt.__modules__],rt.modules&&Array.isArray(rt.modules)&<.modules.push(...rt.modules);const ut={};lt.modules.forEach(dt=>{dt({params:rt,swiper:lt,extendParams:moduleExtendParams(rt,ut),on:lt.on.bind(lt),once:lt.once.bind(lt),off:lt.off.bind(lt),emit:lt.emit.bind(lt)})});const ct=extend$1({},defaults$3,ut);return lt.params=extend$1({},ct,extendedDefaults,rt),lt.originalParams=extend$1({},lt.params),lt.passedParams=extend$1({},rt),lt.params&<.params.on&&Object.keys(lt.params.on).forEach(dt=>{lt.on(dt,lt.params.on[dt])}),lt.params&<.params.onAny&<.onAny(lt.params.onAny),Object.assign(lt,{enabled:lt.params.enabled,el:et,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return lt.params.direction==="horizontal"},isVertical(){return lt.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:lt.params.allowSlideNext,allowSlidePrev:lt.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:lt.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,evCache:[]},allowClick:!0,allowTouchMove:lt.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),lt.emit("_swiper"),lt.params.init&<.init(),lt}getSlideIndex(et){const{slidesEl:rt,params:st}=this,nt=elementChildren(rt,`.${st.slideClass}, swiper-slide`),ot=elementIndex(nt[0]);return elementIndex(et)-ot}getSlideIndexByData(et){return this.getSlideIndex(this.slides.filter(rt=>rt.getAttribute("data-swiper-slide-index")*1===et)[0])}recalcSlides(){const et=this,{slidesEl:rt,params:st}=et;et.slides=elementChildren(rt,`.${st.slideClass}, swiper-slide`)}enable(){const et=this;et.enabled||(et.enabled=!0,et.params.grabCursor&&et.setGrabCursor(),et.emit("enable"))}disable(){const et=this;et.enabled&&(et.enabled=!1,et.params.grabCursor&&et.unsetGrabCursor(),et.emit("disable"))}setProgress(et,rt){const st=this;et=Math.min(Math.max(et,0),1);const nt=st.minTranslate(),at=(st.maxTranslate()-nt)*et+nt;st.translateTo(at,typeof rt>"u"?0:rt),st.updateActiveIndex(),st.updateSlidesClasses()}emitContainerClasses(){const et=this;if(!et.params._emitClasses||!et.el)return;const rt=et.el.className.split(" ").filter(st=>st.indexOf("swiper")===0||st.indexOf(et.params.containerModifierClass)===0);et.emit("_containerClasses",rt.join(" "))}getSlideClasses(et){const rt=this;return rt.destroyed?"":et.className.split(" ").filter(st=>st.indexOf("swiper-slide")===0||st.indexOf(rt.params.slideClass)===0).join(" ")}emitSlidesClasses(){const et=this;if(!et.params._emitClasses||!et.el)return;const rt=[];et.slides.forEach(st=>{const nt=et.getSlideClasses(st);rt.push({slideEl:st,classNames:nt}),et.emit("_slideClass",st,nt)}),et.emit("_slideClasses",rt)}slidesPerViewDynamic(et,rt){et===void 0&&(et="current"),rt===void 0&&(rt=!1);const st=this,{params:nt,slides:ot,slidesGrid:at,slidesSizesGrid:lt,size:ut,activeIndex:ct}=st;let dt=1;if(typeof nt.slidesPerView=="number")return nt.slidesPerView;if(nt.centeredSlides){let ht=ot[ct]?ot[ct].swiperSlideSize:0,ft;for(let xt=ct+1;xt<ot.length;xt+=1)ot[xt]&&!ft&&(ht+=ot[xt].swiperSlideSize,dt+=1,ht>ut&&(ft=!0));for(let xt=ct-1;xt>=0;xt-=1)ot[xt]&&!ft&&(ht+=ot[xt].swiperSlideSize,dt+=1,ht>ut&&(ft=!0))}else if(et==="current")for(let ht=ct+1;ht<ot.length;ht+=1)(rt?at[ht]+lt[ht]-at[ct]<ut:at[ht]-at[ct]<ut)&&(dt+=1);else for(let ht=ct-1;ht>=0;ht-=1)at[ct]-at[ht]<ut&&(dt+=1);return dt}update(){const et=this;if(!et||et.destroyed)return;const{snapGrid:rt,params:st}=et;st.breakpoints&&et.setBreakpoint(),[...et.el.querySelectorAll('[loading="lazy"]')].forEach(at=>{at.complete&&processLazyPreloader(et,at)}),et.updateSize(),et.updateSlides(),et.updateProgress(),et.updateSlidesClasses();function nt(){const at=et.rtlTranslate?et.translate*-1:et.translate,lt=Math.min(Math.max(at,et.maxTranslate()),et.minTranslate());et.setTranslate(lt),et.updateActiveIndex(),et.updateSlidesClasses()}let ot;if(st.freeMode&&st.freeMode.enabled&&!st.cssMode)nt(),st.autoHeight&&et.updateAutoHeight();else{if((st.slidesPerView==="auto"||st.slidesPerView>1)&&et.isEnd&&!st.centeredSlides){const at=et.virtual&&st.virtual.enabled?et.virtual.slides:et.slides;ot=et.slideTo(at.length-1,0,!1,!0)}else ot=et.slideTo(et.activeIndex,0,!1,!0);ot||nt()}st.watchOverflow&&rt!==et.snapGrid&&et.checkOverflow(),et.emit("update")}changeDirection(et,rt){rt===void 0&&(rt=!0);const st=this,nt=st.params.direction;return et||(et=nt==="horizontal"?"vertical":"horizontal"),et===nt||et!=="horizontal"&&et!=="vertical"||(st.el.classList.remove(`${st.params.containerModifierClass}${nt}`),st.el.classList.add(`${st.params.containerModifierClass}${et}`),st.emitContainerClasses(),st.params.direction=et,st.slides.forEach(ot=>{et==="vertical"?ot.style.width="":ot.style.height=""}),st.emit("changeDirection"),rt&&st.update()),st}changeLanguageDirection(et){const rt=this;rt.rtl&&et==="rtl"||!rt.rtl&&et==="ltr"||(rt.rtl=et==="rtl",rt.rtlTranslate=rt.params.direction==="horizontal"&&rt.rtl,rt.rtl?(rt.el.classList.add(`${rt.params.containerModifierClass}rtl`),rt.el.dir="rtl"):(rt.el.classList.remove(`${rt.params.containerModifierClass}rtl`),rt.el.dir="ltr"),rt.update())}mount(et){const rt=this;if(rt.mounted)return!0;let st=et||rt.params.el;if(typeof st=="string"&&(st=document.querySelector(st)),!st)return!1;st.swiper=rt,st.parentNode&&st.parentNode.host&&st.parentNode.host.nodeName==="SWIPER-CONTAINER"&&(rt.isElement=!0);const nt=()=>`.${(rt.params.wrapperClass||"").trim().split(" ").join(".")}`;let at=st&&st.shadowRoot&&st.shadowRoot.querySelector?st.shadowRoot.querySelector(nt()):elementChildren(st,nt())[0];return!at&&rt.params.createElements&&(at=createElement("div",rt.params.wrapperClass),st.append(at),elementChildren(st,`.${rt.params.slideClass}`).forEach(lt=>{at.append(lt)})),Object.assign(rt,{el:st,wrapperEl:at,slidesEl:rt.isElement&&!st.parentNode.host.slideSlots?st.parentNode.host:at,hostEl:rt.isElement?st.parentNode.host:st,mounted:!0,rtl:st.dir.toLowerCase()==="rtl"||elementStyle(st,"direction")==="rtl",rtlTranslate:rt.params.direction==="horizontal"&&(st.dir.toLowerCase()==="rtl"||elementStyle(st,"direction")==="rtl"),wrongRTL:elementStyle(at,"display")==="-webkit-box"}),!0}init(et){const rt=this;if(rt.initialized||rt.mount(et)===!1)return rt;rt.emit("beforeInit"),rt.params.breakpoints&&rt.setBreakpoint(),rt.addClasses(),rt.updateSize(),rt.updateSlides(),rt.params.watchOverflow&&rt.checkOverflow(),rt.params.grabCursor&&rt.enabled&&rt.setGrabCursor(),rt.params.loop&&rt.virtual&&rt.params.virtual.enabled?rt.slideTo(rt.params.initialSlide+rt.virtual.slidesBefore,0,rt.params.runCallbacksOnInit,!1,!0):rt.slideTo(rt.params.initialSlide,0,rt.params.runCallbacksOnInit,!1,!0),rt.params.loop&&rt.loopCreate(),rt.attachEvents();const nt=[...rt.el.querySelectorAll('[loading="lazy"]')];return rt.isElement&&nt.push(...rt.hostEl.querySelectorAll('[loading="lazy"]')),nt.forEach(ot=>{ot.complete?processLazyPreloader(rt,ot):ot.addEventListener("load",at=>{processLazyPreloader(rt,at.target)})}),preload(rt),rt.initialized=!0,preload(rt),rt.emit("init"),rt.emit("afterInit"),rt}destroy(et,rt){et===void 0&&(et=!0),rt===void 0&&(rt=!0);const st=this,{params:nt,el:ot,wrapperEl:at,slides:lt}=st;return typeof st.params>"u"||st.destroyed||(st.emit("beforeDestroy"),st.initialized=!1,st.detachEvents(),nt.loop&&st.loopDestroy(),rt&&(st.removeClasses(),ot.removeAttribute("style"),at.removeAttribute("style"),lt&<.length&<.forEach(ut=>{ut.classList.remove(nt.slideVisibleClass,nt.slideActiveClass,nt.slideNextClass,nt.slidePrevClass),ut.removeAttribute("style"),ut.removeAttribute("data-swiper-slide-index")})),st.emit("destroy"),Object.keys(st.eventsListeners).forEach(ut=>{st.off(ut)}),et!==!1&&(st.el.swiper=null,deleteProps(st)),st.destroyed=!0),null}static extendDefaults(et){extend$1(extendedDefaults,et)}static get extendedDefaults(){return extendedDefaults}static get defaults(){return defaults$3}static installModule(et){Ao.prototype.__modules__||(Ao.prototype.__modules__=[]);const rt=Ao.prototype.__modules__;typeof et=="function"&&rt.indexOf(et)<0&&rt.push(et)}static use(et){return Array.isArray(et)?(et.forEach(rt=>Ao.installModule(rt)),Ao):(Ao.installModule(et),Ao)}};Object.keys(prototypes).forEach(tt=>{Object.keys(prototypes[tt]).forEach(et=>{Swiper$1.prototype[et]=prototypes[tt][et]})});Swiper$1.use([Resize,Observer]);const paramsList=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopedSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideNextClass","slidePrevClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function isObject$1(tt){return typeof tt=="object"&&tt!==null&&tt.constructor&&Object.prototype.toString.call(tt).slice(8,-1)==="Object"&&!tt.__swiper__}function extend(tt,et){const rt=["__proto__","constructor","prototype"];Object.keys(et).filter(st=>rt.indexOf(st)<0).forEach(st=>{typeof tt[st]>"u"?tt[st]=et[st]:isObject$1(et[st])&&isObject$1(tt[st])&&Object.keys(et[st]).length>0?et[st].__swiper__?tt[st]=et[st]:extend(tt[st],et[st]):tt[st]=et[st]})}function needsNavigation(tt){return tt===void 0&&(tt={}),tt.navigation&&typeof tt.navigation.nextEl>"u"&&typeof tt.navigation.prevEl>"u"}function needsPagination(tt){return tt===void 0&&(tt={}),tt.pagination&&typeof tt.pagination.el>"u"}function needsScrollbar(tt){return tt===void 0&&(tt={}),tt.scrollbar&&typeof tt.scrollbar.el>"u"}function uniqueClasses(tt){tt===void 0&&(tt="");const et=tt.split(" ").map(st=>st.trim()).filter(st=>!!st),rt=[];return et.forEach(st=>{rt.indexOf(st)<0&&rt.push(st)}),rt.join(" ")}function wrapperClass(tt){return tt===void 0&&(tt=""),tt?tt.includes("swiper-wrapper")?tt:`swiper-wrapper ${tt}`:"swiper-wrapper"}function updateSwiper(tt){let{swiper:et,slides:rt,passedParams:st,changedParams:nt,nextEl:ot,prevEl:at,scrollbarEl:lt,paginationEl:ut}=tt;const ct=nt.filter(Ot=>Ot!=="children"&&Ot!=="direction"&&Ot!=="wrapperClass"),{params:dt,pagination:ht,navigation:ft,scrollbar:xt,virtual:vt,thumbs:yt}=et;let Et,bt,wt,St,Rt,Ct,It,jt;nt.includes("thumbs")&&st.thumbs&&st.thumbs.swiper&&dt.thumbs&&!dt.thumbs.swiper&&(Et=!0),nt.includes("controller")&&st.controller&&st.controller.control&&dt.controller&&!dt.controller.control&&(bt=!0),nt.includes("pagination")&&st.pagination&&(st.pagination.el||ut)&&(dt.pagination||dt.pagination===!1)&&ht&&!ht.el&&(wt=!0),nt.includes("scrollbar")&&st.scrollbar&&(st.scrollbar.el||lt)&&(dt.scrollbar||dt.scrollbar===!1)&&xt&&!xt.el&&(St=!0),nt.includes("navigation")&&st.navigation&&(st.navigation.prevEl||at)&&(st.navigation.nextEl||ot)&&(dt.navigation||dt.navigation===!1)&&ft&&!ft.prevEl&&!ft.nextEl&&(Rt=!0);const Pt=Ot=>{et[Ot]&&(et[Ot].destroy(),Ot==="navigation"?(et.isElement&&(et[Ot].prevEl.remove(),et[Ot].nextEl.remove()),dt[Ot].prevEl=void 0,dt[Ot].nextEl=void 0,et[Ot].prevEl=void 0,et[Ot].nextEl=void 0):(et.isElement&&et[Ot].el.remove(),dt[Ot].el=void 0,et[Ot].el=void 0))};nt.includes("loop")&&et.isElement&&(dt.loop&&!st.loop?Ct=!0:!dt.loop&&st.loop?It=!0:jt=!0),ct.forEach(Ot=>{if(isObject$1(dt[Ot])&&isObject$1(st[Ot]))extend(dt[Ot],st[Ot]),(Ot==="navigation"||Ot==="pagination"||Ot==="scrollbar")&&"enabled"in st[Ot]&&!st[Ot].enabled&&Pt(Ot);else{const Ut=st[Ot];(Ut===!0||Ut===!1)&&(Ot==="navigation"||Ot==="pagination"||Ot==="scrollbar")?Ut===!1&&Pt(Ot):dt[Ot]=st[Ot]}}),ct.includes("controller")&&!bt&&et.controller&&et.controller.control&&dt.controller&&dt.controller.control&&(et.controller.control=dt.controller.control),nt.includes("children")&&rt&&vt&&dt.virtual.enabled&&(vt.slides=rt,vt.update(!0)),nt.includes("children")&&rt&&dt.loop&&(jt=!0),Et&&yt.init()&&yt.update(!0),bt&&(et.controller.control=dt.controller.control),wt&&(et.isElement&&(!ut||typeof ut=="string")&&(ut=document.createElement("div"),ut.classList.add("swiper-pagination"),ut.part.add("pagination"),et.el.appendChild(ut)),ut&&(dt.pagination.el=ut),ht.init(),ht.render(),ht.update()),St&&(et.isElement&&(!lt||typeof lt=="string")&&(lt=document.createElement("div"),lt.classList.add("swiper-scrollbar"),lt.part.add("scrollbar"),et.el.appendChild(lt)),lt&&(dt.scrollbar.el=lt),xt.init(),xt.updateSize(),xt.setTranslate()),Rt&&(et.isElement&&((!ot||typeof ot=="string")&&(ot=document.createElement("div"),ot.classList.add("swiper-button-next"),ot.innerHTML=et.hostEl.constructor.nextButtonSvg,ot.part.add("button-next"),et.el.appendChild(ot)),(!at||typeof at=="string")&&(at=document.createElement("div"),at.classList.add("swiper-button-prev"),at.innerHTML=et.hostEl.constructor.prevButtonSvg,at.part.add("button-prev"),et.el.appendChild(at))),ot&&(dt.navigation.nextEl=ot),at&&(dt.navigation.prevEl=at),ft.init(),ft.update()),nt.includes("allowSlideNext")&&(et.allowSlideNext=st.allowSlideNext),nt.includes("allowSlidePrev")&&(et.allowSlidePrev=st.allowSlidePrev),nt.includes("direction")&&et.changeDirection(st.direction,!1),(Ct||jt)&&et.loopDestroy(),(It||jt)&&et.loopCreate(),et.update()}function getParams(tt,et){tt===void 0&&(tt={}),et===void 0&&(et=!0);const rt={on:{}},st={},nt={};extend(rt,defaults$3),rt._emitClasses=!0,rt.init=!1;const ot={},at=paramsList.map(ut=>ut.replace(/_/,"")),lt=Object.assign({},tt);return Object.keys(lt).forEach(ut=>{typeof tt[ut]>"u"||(at.indexOf(ut)>=0?isObject$1(tt[ut])?(rt[ut]={},nt[ut]={},extend(rt[ut],tt[ut]),extend(nt[ut],tt[ut])):(rt[ut]=tt[ut],nt[ut]=tt[ut]):ut.search(/on[A-Z]/)===0&&typeof tt[ut]=="function"?et?st[`${ut[2].toLowerCase()}${ut.substr(3)}`]=tt[ut]:rt.on[`${ut[2].toLowerCase()}${ut.substr(3)}`]=tt[ut]:ot[ut]=tt[ut])}),["navigation","pagination","scrollbar"].forEach(ut=>{rt[ut]===!0&&(rt[ut]={}),rt[ut]===!1&&delete rt[ut]}),{params:rt,passedParams:nt,rest:ot,events:st}}function mountSwiper(tt,et){let{el:rt,nextEl:st,prevEl:nt,paginationEl:ot,scrollbarEl:at,swiper:lt}=tt;needsNavigation(et)&&st&&nt&&(lt.params.navigation.nextEl=st,lt.originalParams.navigation.nextEl=st,lt.params.navigation.prevEl=nt,lt.originalParams.navigation.prevEl=nt),needsPagination(et)&&ot&&(lt.params.pagination.el=ot,lt.originalParams.pagination.el=ot),needsScrollbar(et)&&at&&(lt.params.scrollbar.el=at,lt.originalParams.scrollbar.el=at),lt.init(rt)}function getChangedParams(tt,et,rt,st,nt){const ot=[];if(!et)return ot;const at=ut=>{ot.indexOf(ut)<0&&ot.push(ut)};if(rt&&st){const ut=st.map(nt),ct=rt.map(nt);ut.join("")!==ct.join("")&&at("children"),st.length!==rt.length&&at("children")}return paramsList.filter(ut=>ut[0]==="_").map(ut=>ut.replace(/_/,"")).forEach(ut=>{if(ut in tt&&ut in et)if(isObject$1(tt[ut])&&isObject$1(et[ut])){const ct=Object.keys(tt[ut]),dt=Object.keys(et[ut]);ct.length!==dt.length?at(ut):(ct.forEach(ht=>{tt[ut][ht]!==et[ut][ht]&&at(ut)}),dt.forEach(ht=>{tt[ut][ht]!==et[ut][ht]&&at(ut)}))}else tt[ut]!==et[ut]&&at(ut)}),ot}const updateOnVirtualData=tt=>{!tt||tt.destroyed||!tt.params.virtual||tt.params.virtual&&!tt.params.virtual.enabled||(tt.updateSlides(),tt.updateProgress(),tt.updateSlidesClasses(),tt.parallax&&tt.params.parallax&&tt.params.parallax.enabled&&tt.parallax.setTranslate())};function _extends(){return _extends=Object.assign?Object.assign.bind():function(tt){for(var et=1;et<arguments.length;et++){var rt=arguments[et];for(var st in rt)Object.prototype.hasOwnProperty.call(rt,st)&&(tt[st]=rt[st])}return tt},_extends.apply(this,arguments)}function isChildSwiperSlide(tt){return tt.type&&tt.type.displayName&&tt.type.displayName.includes("SwiperSlide")}function processChildren(tt){const et=[];return React$4.Children.toArray(tt).forEach(rt=>{isChildSwiperSlide(rt)?et.push(rt):rt.props&&rt.props.children&&processChildren(rt.props.children).forEach(st=>et.push(st))}),et}function getChildren(tt){const et=[],rt={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return React$4.Children.toArray(tt).forEach(st=>{if(isChildSwiperSlide(st))et.push(st);else if(st.props&&st.props.slot&&rt[st.props.slot])rt[st.props.slot].push(st);else if(st.props&&st.props.children){const nt=processChildren(st.props.children);nt.length>0?nt.forEach(ot=>et.push(ot)):rt["container-end"].push(st)}else rt["container-end"].push(st)}),{slides:et,slots:rt}}function renderVirtual(tt,et,rt){if(!rt)return null;const st=dt=>{let ht=dt;return dt<0?ht=et.length+dt:ht>=et.length&&(ht=ht-et.length),ht},nt=tt.isHorizontal()?{[tt.rtlTranslate?"right":"left"]:`${rt.offset}px`}:{top:`${rt.offset}px`},{from:ot,to:at}=rt,lt=tt.params.loop?-et.length:0,ut=tt.params.loop?et.length*2:et.length,ct=[];for(let dt=lt;dt<ut;dt+=1)dt>=ot&&dt<=at&&ct.push(et[st(dt)]);return ct.map((dt,ht)=>React$4.cloneElement(dt,{swiper:tt,style:nt,key:`slide-${ht}`}))}function useIsomorphicLayoutEffect$1(tt,et){return typeof window>"u"?reactExports.useEffect(tt,et):reactExports.useLayoutEffect(tt,et)}const SwiperSlideContext=reactExports.createContext(null),SwiperContext=reactExports.createContext(null),Swiper=reactExports.forwardRef(function(tt,et){let{className:rt,tag:st="div",wrapperTag:nt="div",children:ot,onSwiper:at,...lt}=tt===void 0?{}:tt,ut=!1;const[ct,dt]=reactExports.useState("swiper"),[ht,ft]=reactExports.useState(null),[xt,vt]=reactExports.useState(!1),yt=reactExports.useRef(!1),Et=reactExports.useRef(null),bt=reactExports.useRef(null),wt=reactExports.useRef(null),St=reactExports.useRef(null),Rt=reactExports.useRef(null),Ct=reactExports.useRef(null),It=reactExports.useRef(null),jt=reactExports.useRef(null),{params:Pt,passedParams:Ot,rest:Ut,events:Nt}=getParams(lt),{slides:Ht,slots:Lt}=getChildren(ot),kt=()=>{vt(!xt)};Object.assign(Pt.on,{_containerClasses(Vt,Bt){dt(Bt)}});const $t=()=>{Object.assign(Pt.on,Nt),ut=!0;const Vt={...Pt};if(delete Vt.wrapperClass,bt.current=new Swiper$1(Vt),bt.current.virtual&&bt.current.params.virtual.enabled){bt.current.virtual.slides=Ht;const Bt={cache:!1,slides:Ht,renderExternal:ft,renderExternalUpdate:!1};extend(bt.current.params.virtual,Bt),extend(bt.current.originalParams.virtual,Bt)}};Et.current||$t(),bt.current&&bt.current.on("_beforeBreakpoint",kt);const Ft=()=>{ut||!Nt||!bt.current||Object.keys(Nt).forEach(Vt=>{bt.current.on(Vt,Nt[Vt])})},Gt=()=>{!Nt||!bt.current||Object.keys(Nt).forEach(Vt=>{bt.current.off(Vt,Nt[Vt])})};reactExports.useEffect(()=>()=>{bt.current&&bt.current.off("_beforeBreakpoint",kt)}),reactExports.useEffect(()=>{!yt.current&&bt.current&&(bt.current.emitSlidesClasses(),yt.current=!0)}),useIsomorphicLayoutEffect$1(()=>{if(et&&(et.current=Et.current),!!Et.current)return bt.current.destroyed&&$t(),mountSwiper({el:Et.current,nextEl:Rt.current,prevEl:Ct.current,paginationEl:It.current,scrollbarEl:jt.current,swiper:bt.current},Pt),at&&at(bt.current),()=>{bt.current&&!bt.current.destroyed&&bt.current.destroy(!0,!1)}},[]),useIsomorphicLayoutEffect$1(()=>{Ft();const Vt=getChangedParams(Ot,wt.current,Ht,St.current,Bt=>Bt.key);return wt.current=Ot,St.current=Ht,Vt.length&&bt.current&&!bt.current.destroyed&&updateSwiper({swiper:bt.current,slides:Ht,passedParams:Ot,changedParams:Vt,nextEl:Rt.current,prevEl:Ct.current,scrollbarEl:jt.current,paginationEl:It.current}),()=>{Gt()}}),useIsomorphicLayoutEffect$1(()=>{updateOnVirtualData(bt.current)},[ht]);function Mt(){return Pt.virtual?renderVirtual(bt.current,Ht,ht):Ht.map((Vt,Bt)=>React$4.cloneElement(Vt,{swiper:bt.current,swiperSlideIndex:Bt}))}return React$4.createElement(st,_extends({ref:Et,className:uniqueClasses(`${ct}${rt?` ${rt}`:""}`)},Ut),React$4.createElement(SwiperContext.Provider,{value:bt.current},Lt["container-start"],React$4.createElement(nt,{className:wrapperClass(Pt.wrapperClass)},Lt["wrapper-start"],Mt(),Lt["wrapper-end"]),needsNavigation(Pt)&&React$4.createElement(React$4.Fragment,null,React$4.createElement("div",{ref:Ct,className:"swiper-button-prev"}),React$4.createElement("div",{ref:Rt,className:"swiper-button-next"})),needsScrollbar(Pt)&&React$4.createElement("div",{ref:jt,className:"swiper-scrollbar"}),needsPagination(Pt)&&React$4.createElement("div",{ref:It,className:"swiper-pagination"}),Lt["container-end"]))});Swiper.displayName="Swiper";const SwiperSlide=reactExports.forwardRef(function(tt,et){let{tag:rt="div",children:st,className:nt="",swiper:ot,zoom:at,lazy:lt,virtualIndex:ut,swiperSlideIndex:ct,...dt}=tt===void 0?{}:tt;const ht=reactExports.useRef(null),[ft,xt]=reactExports.useState("swiper-slide"),[vt,yt]=reactExports.useState(!1);function Et(Rt,Ct,It){Ct===ht.current&&xt(It)}useIsomorphicLayoutEffect$1(()=>{if(typeof ct<"u"&&(ht.current.swiperSlideIndex=ct),et&&(et.current=ht.current),!(!ht.current||!ot)){if(ot.destroyed){ft!=="swiper-slide"&&xt("swiper-slide");return}return ot.on("_slideClass",Et),()=>{ot&&ot.off("_slideClass",Et)}}}),useIsomorphicLayoutEffect$1(()=>{ot&&ht.current&&!ot.destroyed&&xt(ot.getSlideClasses(ht.current))},[ot]);const bt={isActive:ft.indexOf("swiper-slide-active")>=0,isVisible:ft.indexOf("swiper-slide-visible")>=0,isPrev:ft.indexOf("swiper-slide-prev")>=0,isNext:ft.indexOf("swiper-slide-next")>=0},wt=()=>typeof st=="function"?st(bt):st,St=()=>{yt(!0)};return React$4.createElement(rt,_extends({ref:ht,className:uniqueClasses(`${ft}${nt?` ${nt}`:""}`),"data-swiper-slide-index":ut,onLoad:St},dt),at&&React$4.createElement(SwiperSlideContext.Provider,{value:bt},React$4.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof at=="number"?at:void 0},wt(),lt&&!vt&&React$4.createElement("div",{className:"swiper-lazy-preloader"}))),!at&&React$4.createElement(SwiperSlideContext.Provider,{value:bt},wt(),lt&&!vt&&React$4.createElement("div",{className:"swiper-lazy-preloader"})))});SwiperSlide.displayName="SwiperSlide";const getOnboardingTrash=async tt=>await odeServices.conf().getPreference(tt),saveOnboardingTrash=async tt=>await odeServices.conf().savePreference(tt,JSON.stringify({key:!1})),useOnboardingModal=tt=>{const[et,rt]=reactExports.useState(!1),[st,nt]=reactExports.useState(!1);return reactExports.useEffect(()=>{(async()=>{const ot=await getOnboardingTrash(tt);if(ot){const{key:at}=ot;at===!0&&rt(!0),nt(at);return}nt(!0),rt(!0)})()},[tt]),{isOpen:et,setIsOpen:rt,isOnboarding:st,handleSavePreference:async()=>{await saveOnboardingTrash(tt),rt(!1),nt(!1)}}},OnboardingModal$2=reactExports.forwardRef(({id:tt,items:et,modalOptions:rt={},isOnboardingChange:st},nt)=>{var ot;const[at,lt]=reactExports.useState(),[ut,ct]=reactExports.useState(0),{isOpen:dt,isOnboarding:ht,setIsOpen:ft,handleSavePreference:xt}=useOnboardingModal(tt);reactExports.useImperativeHandle(nt,()=>({setIsOpen:ft,handleSavePreference:xt})),reactExports.useEffect(()=>{st&&st(ht)},[ht,st]),reactExports.useEffect(()=>{const It=document.createElement("link");return It.href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",It.rel="stylesheet",It.type="text/css",document.head.appendChild(It),()=>{document.head.removeChild(It)}},[]);const{t:vt}=useTranslation(),{title:yt,prevText:Et,closeText:bt,nextText:wt}=rt,St=(at==null?void 0:at.activeIndex)!=null&&(ot=et[at==null?void 0:at.activeIndex])!=null&&ot.title?et[at.activeIndex].title:yt,Rt=()=>{xt(),ct(0)},Ct=()=>{ft(!1),ct(0)};return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"onboarding-modal",size:"md",isOpen:dt,focusId:"nextButtonId",onModalClose:Ct,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Ct,centered:!0,children:vt(St||"explorer.modal.onboarding.trash.title")}),jsxRuntimeExports.jsx(Modal.Body,{children:jsxRuntimeExports.jsx(Swiper,{modules:[Pagination],onSwiper:It=>{lt(It)},onSlideChange:It=>{ct(It.progress)},pagination:{clickable:!0},children:et.map((It,jt)=>jsxRuntimeExports.jsxs(SwiperSlide,{children:[jsxRuntimeExports.jsx(Image$1,{width:"270",height:"140",className:"mx-auto my-12",loading:"lazy",src:It.src,alt:vt(It.alt)}),jsxRuntimeExports.jsx("p",{className:"text-center",dangerouslySetInnerHTML:{__html:vt(It.text)}})]},jt))})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:Ct,children:vt("explorer.modal.onboarding.trash.later")}),ut>0&&jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"outline",onClick:()=>at.slidePrev(),children:vt(Et||"explorer.modal.onboarding.trash.prev")}),ut<1&&jsxRuntimeExports.jsx(Button,{id:"nextButtonId",type:"button",color:"primary",variant:"filled",onClick:()=>at.slideNext(),children:vt(wt||"explorer.modal.onboarding.trash.next")}),ut===1&&jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",onClick:()=>{ht?Rt():Ct()},children:vt(bt||"explorer.modal.onboarding.trash.close")})]})]}),document.getElementById("portal")||document.body)});var isCheckBoxInput=tt=>tt.type==="checkbox",isDateObject=tt=>tt instanceof Date,isNullOrUndefined=tt=>tt==null;const isObjectType=tt=>typeof tt=="object";var isObject=tt=>!isNullOrUndefined(tt)&&!Array.isArray(tt)&&isObjectType(tt)&&!isDateObject(tt),getEventValue=tt=>isObject(tt)&&tt.target?isCheckBoxInput(tt.target)?tt.target.checked:tt.target.value:tt,getNodeParentName=tt=>tt.substring(0,tt.search(/\.\d+(\.|$)/))||tt,isNameInFieldArray=(tt,et)=>tt.has(getNodeParentName(et)),isPlainObject=tt=>{const et=tt.constructor&&tt.constructor.prototype;return isObject(et)&&et.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(tt){let et;const rt=Array.isArray(tt),st=typeof FileList<"u"?tt instanceof FileList:!1;if(tt instanceof Date)et=new Date(tt);else if(!(isWeb&&(tt instanceof Blob||st))&&(rt||isObject(tt)))if(et=rt?[]:Object.create(Object.getPrototypeOf(tt)),!rt&&!isPlainObject(tt))et=tt;else for(const nt in tt)tt.hasOwnProperty(nt)&&(et[nt]=cloneObject(tt[nt]));else return tt;return et}var isKey=tt=>/^\w*$/.test(tt),isUndefined=tt=>tt===void 0,compact$1=tt=>Array.isArray(tt)?tt.filter(Boolean):[],stringToPath$1=tt=>compact$1(tt.replace(/["|']|\]/g,"").split(/\.|\[/)),get$1=(tt,et,rt)=>{if(!et||!isObject(tt))return rt;const st=(isKey(et)?[et]:stringToPath$1(et)).reduce((nt,ot)=>isNullOrUndefined(nt)?nt:nt[ot],tt);return isUndefined(st)||st===tt?isUndefined(tt[et])?rt:tt[et]:st},isBoolean$1=tt=>typeof tt=="boolean",set=(tt,et,rt)=>{let st=-1;const nt=isKey(et)?[et]:stringToPath$1(et),ot=nt.length,at=ot-1;for(;++st<ot;){const lt=nt[st];let ut=rt;if(st!==at){const ct=tt[lt];ut=isObject(ct)||Array.isArray(ct)?ct:isNaN(+nt[st+1])?{}:[]}if(lt==="__proto__"||lt==="constructor"||lt==="prototype")return;tt[lt]=ut,tt=tt[lt]}};const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React$4.createContext(null);HookFormContext.displayName="HookFormContext";const useFormContext=()=>React$4.useContext(HookFormContext);var getProxyFormState=(tt,et,rt,st=!0)=>{const nt={defaultValues:et._defaultValues};for(const ot in tt)Object.defineProperty(nt,ot,{get:()=>{const at=ot;return et._proxyFormState[at]!==VALIDATION_MODE.all&&(et._proxyFormState[at]=!st||VALIDATION_MODE.all),rt&&(rt[at]=!0),tt[at]}});return nt};const useIsomorphicLayoutEffect=typeof window<"u"?React$4.useLayoutEffect:React$4.useEffect;function useFormState(tt){const et=useFormContext(),{control:rt=et.control,disabled:st,name:nt,exact:ot}=tt||{},[at,lt]=React$4.useState(rt._formState),ut=React$4.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return useIsomorphicLayoutEffect(()=>rt._subscribe({name:nt,formState:ut.current,exact:ot,callback:ct=>{!st&<({...rt._formState,...ct})}}),[nt,st,ot]),React$4.useEffect(()=>{ut.current.isValid&&rt._setValid(!0)},[rt]),React$4.useMemo(()=>getProxyFormState(at,rt,ut.current,!1),[at,rt])}var isString$1=tt=>typeof tt=="string",generateWatchOutput=(tt,et,rt,st,nt)=>isString$1(tt)?(st&&et.watch.add(tt),get$1(rt,tt,nt)):Array.isArray(tt)?tt.map(ot=>(st&&et.watch.add(ot),get$1(rt,ot))):(st&&(et.watchAll=!0),rt),isPrimitive=tt=>isNullOrUndefined(tt)||!isObjectType(tt);function deepEqual(tt,et,rt=new WeakSet){if(isPrimitive(tt)||isPrimitive(et))return tt===et;if(isDateObject(tt)&&isDateObject(et))return tt.getTime()===et.getTime();const st=Object.keys(tt),nt=Object.keys(et);if(st.length!==nt.length)return!1;if(rt.has(tt)||rt.has(et))return!0;rt.add(tt),rt.add(et);for(const ot of st){const at=tt[ot];if(!nt.includes(ot))return!1;if(ot!=="ref"){const lt=et[ot];if(isDateObject(at)&&isDateObject(lt)||isObject(at)&&isObject(lt)||Array.isArray(at)&&Array.isArray(lt)?!deepEqual(at,lt,rt):at!==lt)return!1}}return!0}function useWatch(tt){const et=useFormContext(),{control:rt=et.control,name:st,defaultValue:nt,disabled:ot,exact:at,compute:lt}=tt||{},ut=React$4.useRef(nt),ct=React$4.useRef(lt),dt=React$4.useRef(void 0);ct.current=lt;const ht=React$4.useMemo(()=>rt._getWatch(st,ut.current),[rt,st]),[ft,xt]=React$4.useState(ct.current?ct.current(ht):ht);return useIsomorphicLayoutEffect(()=>rt._subscribe({name:st,formState:{values:!0},exact:at,callback:vt=>{if(!ot){const yt=generateWatchOutput(st,rt._names,vt.values||rt._formValues,!1,ut.current);if(ct.current){const Et=ct.current(yt);deepEqual(Et,dt.current)||(xt(Et),dt.current=Et)}else xt(yt)}}}),[rt,ot,st,at]),React$4.useEffect(()=>rt._removeUnmounted()),ft}function useController(tt){const et=useFormContext(),{name:rt,disabled:st,control:nt=et.control,shouldUnregister:ot,defaultValue:at}=tt,lt=isNameInFieldArray(nt._names.array,rt),ut=React$4.useMemo(()=>get$1(nt._formValues,rt,get$1(nt._defaultValues,rt,at)),[nt,rt,at]),ct=useWatch({control:nt,name:rt,defaultValue:ut,exact:!0}),dt=useFormState({control:nt,name:rt,exact:!0}),ht=React$4.useRef(tt),ft=React$4.useRef(void 0),xt=React$4.useRef(nt.register(rt,{...tt.rules,value:ct,...isBoolean$1(tt.disabled)?{disabled:tt.disabled}:{}}));ht.current=tt;const vt=React$4.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get$1(dt.errors,rt)},isDirty:{enumerable:!0,get:()=>!!get$1(dt.dirtyFields,rt)},isTouched:{enumerable:!0,get:()=>!!get$1(dt.touchedFields,rt)},isValidating:{enumerable:!0,get:()=>!!get$1(dt.validatingFields,rt)},error:{enumerable:!0,get:()=>get$1(dt.errors,rt)}}),[dt,rt]),yt=React$4.useCallback(St=>xt.current.onChange({target:{value:getEventValue(St),name:rt},type:EVENTS.CHANGE}),[rt]),Et=React$4.useCallback(()=>xt.current.onBlur({target:{value:get$1(nt._formValues,rt),name:rt},type:EVENTS.BLUR}),[rt,nt._formValues]),bt=React$4.useCallback(St=>{const Rt=get$1(nt._fields,rt);Rt&&St&&(Rt._f.ref={focus:()=>St.focus&&St.focus(),select:()=>St.select&&St.select(),setCustomValidity:Ct=>St.setCustomValidity(Ct),reportValidity:()=>St.reportValidity()})},[nt._fields,rt]),wt=React$4.useMemo(()=>({name:rt,value:ct,...isBoolean$1(st)||dt.disabled?{disabled:dt.disabled||st}:{},onChange:yt,onBlur:Et,ref:bt}),[rt,st,dt.disabled,yt,Et,bt,ct]);return React$4.useEffect(()=>{const St=nt._options.shouldUnregister||ot,Rt=ft.current;Rt&&Rt!==rt&&!lt&&nt.unregister(Rt),nt.register(rt,{...ht.current.rules,...isBoolean$1(ht.current.disabled)?{disabled:ht.current.disabled}:{}});const Ct=(It,jt)=>{const Pt=get$1(nt._fields,It);Pt&&Pt._f&&(Pt._f.mount=jt)};if(Ct(rt,!0),St){const It=cloneObject(get$1(nt._options.defaultValues,rt,ht.current.defaultValue));set(nt._defaultValues,rt,It),isUndefined(get$1(nt._formValues,rt))&&set(nt._formValues,rt,It)}return!lt&&nt.register(rt),ft.current=rt,()=>{(lt?St&&!nt._state.action:St)?nt.unregister(rt):Ct(rt,!1)}},[rt,nt,lt,ot]),React$4.useEffect(()=>{nt._setDisabledField({disabled:st,name:rt})},[st,rt,nt]),React$4.useMemo(()=>({field:wt,formState:dt,fieldState:vt}),[wt,dt,vt])}const Controller=tt=>tt.render(useController(tt));var appendErrors=(tt,et,rt,st,nt)=>et?{...rt[tt],types:{...rt[tt]&&rt[tt].types?rt[tt].types:{},[st]:nt||!0}}:{},convertToArrayPayload=tt=>Array.isArray(tt)?tt:[tt],createSubject=()=>{let tt=[];return{get observers(){return tt},next:nt=>{for(const ot of tt)ot.next&&ot.next(nt)},subscribe:nt=>(tt.push(nt),{unsubscribe:()=>{tt=tt.filter(ot=>ot!==nt)}}),unsubscribe:()=>{tt=[]}}};function extractFormValues(tt,et){const rt={};for(const st in tt)if(tt.hasOwnProperty(st)){const nt=tt[st],ot=et[st];if(nt&&isObject(nt)&&ot){const at=extractFormValues(nt,ot);isObject(at)&&(rt[st]=at)}else tt[st]&&(rt[st]=ot)}return rt}var isEmptyObject=tt=>isObject(tt)&&!Object.keys(tt).length,isFileInput=tt=>tt.type==="file",isFunction=tt=>typeof tt=="function",isHTMLElement=tt=>{if(!isWeb)return!1;const et=tt?tt.ownerDocument:0;return tt instanceof(et&&et.defaultView?et.defaultView.HTMLElement:HTMLElement)},isMultipleSelect=tt=>tt.type==="select-multiple",isRadioInput=tt=>tt.type==="radio",isRadioOrCheckbox=tt=>isRadioInput(tt)||isCheckBoxInput(tt),live=tt=>isHTMLElement(tt)&&tt.isConnected;function baseGet(tt,et){const rt=et.slice(0,-1).length;let st=0;for(;st<rt;)tt=isUndefined(tt)?st++:tt[et[st++]];return tt}function isEmptyArray(tt){for(const et in tt)if(tt.hasOwnProperty(et)&&!isUndefined(tt[et]))return!1;return!0}function unset(tt,et){const rt=Array.isArray(et)?et:isKey(et)?[et]:stringToPath$1(et),st=rt.length===1?tt:baseGet(tt,rt),nt=rt.length-1,ot=rt[nt];return st&&delete st[ot],nt!==0&&(isObject(st)&&isEmptyObject(st)||Array.isArray(st)&&isEmptyArray(st))&&unset(tt,rt.slice(0,-1)),tt}var objectHasFunction=tt=>{for(const et in tt)if(isFunction(tt[et]))return!0;return!1};function isTraversable(tt){return Array.isArray(tt)||isObject(tt)&&!objectHasFunction(tt)}function markFieldsDirty(tt,et={}){for(const rt in tt)isTraversable(tt[rt])?(et[rt]=Array.isArray(tt[rt])?[]:{},markFieldsDirty(tt[rt],et[rt])):isUndefined(tt[rt])||(et[rt]=!0);return et}function getDirtyFields(tt,et,rt){rt||(rt=markFieldsDirty(et));for(const st in tt)isTraversable(tt[st])?isUndefined(et)||isPrimitive(rt[st])?rt[st]=markFieldsDirty(tt[st],Array.isArray(tt[st])?[]:{}):getDirtyFields(tt[st],isNullOrUndefined(et)?{}:et[st],rt[st]):rt[st]=!deepEqual(tt[st],et[st]);return rt}const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=tt=>{if(Array.isArray(tt)){if(tt.length>1){const et=tt.filter(rt=>rt&&rt.checked&&!rt.disabled).map(rt=>rt.value);return{value:et,isValid:!!et.length}}return tt[0].checked&&!tt[0].disabled?tt[0].attributes&&!isUndefined(tt[0].attributes.value)?isUndefined(tt[0].value)||tt[0].value===""?validResult:{value:tt[0].value,isValid:!0}:validResult:defaultResult}return defaultResult},getFieldValueAs=(tt,{valueAsNumber:et,valueAsDate:rt,setValueAs:st})=>isUndefined(tt)?tt:et?tt===""?NaN:tt&&+tt:rt&&isString$1(tt)?new Date(tt):st?st(tt):tt;const defaultReturn={isValid:!1,value:null};var getRadioValue=tt=>Array.isArray(tt)?tt.reduce((et,rt)=>rt&&rt.checked&&!rt.disabled?{isValid:!0,value:rt.value}:et,defaultReturn):defaultReturn;function getFieldValue(tt){const et=tt.ref;return isFileInput(et)?et.files:isRadioInput(et)?getRadioValue(tt.refs).value:isMultipleSelect(et)?[...et.selectedOptions].map(({value:rt})=>rt):isCheckBoxInput(et)?getCheckboxValue(tt.refs).value:getFieldValueAs(isUndefined(et.value)?tt.ref.value:et.value,tt)}var getResolverOptions=(tt,et,rt,st)=>{const nt={};for(const ot of tt){const at=get$1(et,ot);at&&set(nt,ot,at._f)}return{criteriaMode:rt,names:[...tt],fields:nt,shouldUseNativeValidation:st}},isRegex=tt=>tt instanceof RegExp,getRuleValue=tt=>isUndefined(tt)?tt:isRegex(tt)?tt.source:isObject(tt)?isRegex(tt.value)?tt.value.source:tt.value:tt,getValidationModes=tt=>({isOnSubmit:!tt||tt===VALIDATION_MODE.onSubmit,isOnBlur:tt===VALIDATION_MODE.onBlur,isOnChange:tt===VALIDATION_MODE.onChange,isOnAll:tt===VALIDATION_MODE.all,isOnTouch:tt===VALIDATION_MODE.onTouched});const ASYNC_FUNCTION="AsyncFunction";var hasPromiseValidation=tt=>!!tt&&!!tt.validate&&!!(isFunction(tt.validate)&&tt.validate.constructor.name===ASYNC_FUNCTION||isObject(tt.validate)&&Object.values(tt.validate).find(et=>et.constructor.name===ASYNC_FUNCTION)),hasValidation=tt=>tt.mount&&(tt.required||tt.min||tt.max||tt.maxLength||tt.minLength||tt.pattern||tt.validate),isWatched=(tt,et,rt)=>!rt&&(et.watchAll||et.watch.has(tt)||[...et.watch].some(st=>tt.startsWith(st)&&/^\.\w+/.test(tt.slice(st.length))));const iterateFieldsByAction=(tt,et,rt,st)=>{for(const nt of rt||Object.keys(tt)){const ot=get$1(tt,nt);if(ot){const{_f:at,...lt}=ot;if(at){if(at.refs&&at.refs[0]&&et(at.refs[0],nt)&&!st)return!0;if(at.ref&&et(at.ref,at.name)&&!st)return!0;if(iterateFieldsByAction(lt,et))break}else if(isObject(lt)&&iterateFieldsByAction(lt,et))break}}};function schemaErrorLookup(tt,et,rt){const st=get$1(tt,rt);if(st||isKey(rt))return{error:st,name:rt};const nt=rt.split(".");for(;nt.length;){const ot=nt.join("."),at=get$1(et,ot),lt=get$1(tt,ot);if(at&&!Array.isArray(at)&&rt!==ot)return{name:rt};if(lt&<.type)return{name:ot,error:lt};if(lt&<.root&<.root.type)return{name:`${ot}.root`,error:lt.root};nt.pop()}return{name:rt}}var shouldRenderFormState=(tt,et,rt,st)=>{rt(tt);const{name:nt,...ot}=tt;return isEmptyObject(ot)||Object.keys(ot).length>=Object.keys(et).length||Object.keys(ot).find(at=>et[at]===(!st||VALIDATION_MODE.all))},shouldSubscribeByName=(tt,et,rt)=>!tt||!et||tt===et||convertToArrayPayload(tt).some(st=>st&&(rt?st===et:st.startsWith(et)||et.startsWith(st))),skipValidation=(tt,et,rt,st,nt)=>nt.isOnAll?!1:!rt&&nt.isOnTouch?!(et||tt):(rt?st.isOnBlur:nt.isOnBlur)?!tt:(rt?st.isOnChange:nt.isOnChange)?tt:!0,unsetEmptyArray=(tt,et)=>!compact$1(get$1(tt,et)).length&&unset(tt,et),updateFieldArrayRootError=(tt,et,rt)=>{const st=convertToArrayPayload(get$1(tt,rt));return set(st,"root",et[rt]),set(tt,rt,st),tt};function getValidateError(tt,et,rt="validate"){if(isString$1(tt)||Array.isArray(tt)&&tt.every(isString$1)||isBoolean$1(tt)&&!tt)return{type:rt,message:isString$1(tt)?tt:"",ref:et}}var getValueAndMessage=tt=>isObject(tt)&&!isRegex(tt)?tt:{value:tt,message:""},validateField=async(tt,et,rt,st,nt,ot)=>{const{ref:at,refs:lt,required:ut,maxLength:ct,minLength:dt,min:ht,max:ft,pattern:xt,validate:vt,name:yt,valueAsNumber:Et,mount:bt}=tt._f,wt=get$1(rt,yt);if(!bt||et.has(yt))return{};const St=lt?lt[0]:at,Rt=Ht=>{nt&&St.reportValidity&&(St.setCustomValidity(isBoolean$1(Ht)?"":Ht||""),St.reportValidity())},Ct={},It=isRadioInput(at),jt=isCheckBoxInput(at),Pt=It||jt,Ot=(Et||isFileInput(at))&&isUndefined(at.value)&&isUndefined(wt)||isHTMLElement(at)&&at.value===""||wt===""||Array.isArray(wt)&&!wt.length,Ut=appendErrors.bind(null,yt,st,Ct),Nt=(Ht,Lt,kt,$t=INPUT_VALIDATION_RULES.maxLength,Ft=INPUT_VALIDATION_RULES.minLength)=>{const Gt=Ht?Lt:kt;Ct[yt]={type:Ht?$t:Ft,message:Gt,ref:at,...Ut(Ht?$t:Ft,Gt)}};if(ot?!Array.isArray(wt)||!wt.length:ut&&(!Pt&&(Ot||isNullOrUndefined(wt))||isBoolean$1(wt)&&!wt||jt&&!getCheckboxValue(lt).isValid||It&&!getRadioValue(lt).isValid)){const{value:Ht,message:Lt}=isString$1(ut)?{value:!!ut,message:ut}:getValueAndMessage(ut);if(Ht&&(Ct[yt]={type:INPUT_VALIDATION_RULES.required,message:Lt,ref:St,...Ut(INPUT_VALIDATION_RULES.required,Lt)},!st))return Rt(Lt),Ct}if(!Ot&&(!isNullOrUndefined(ht)||!isNullOrUndefined(ft))){let Ht,Lt;const kt=getValueAndMessage(ft),$t=getValueAndMessage(ht);if(!isNullOrUndefined(wt)&&!isNaN(wt)){const Ft=at.valueAsNumber||wt&&+wt;isNullOrUndefined(kt.value)||(Ht=Ft>kt.value),isNullOrUndefined($t.value)||(Lt=Ft<$t.value)}else{const Ft=at.valueAsDate||new Date(wt),Gt=Bt=>new Date(new Date().toDateString()+" "+Bt),Mt=at.type=="time",Vt=at.type=="week";isString$1(kt.value)&&wt&&(Ht=Mt?Gt(wt)>Gt(kt.value):Vt?wt>kt.value:Ft>new Date(kt.value)),isString$1($t.value)&&wt&&(Lt=Mt?Gt(wt)<Gt($t.value):Vt?wt<$t.value:Ft<new Date($t.value))}if((Ht||Lt)&&(Nt(!!Ht,kt.message,$t.message,INPUT_VALIDATION_RULES.max,INPUT_VALIDATION_RULES.min),!st))return Rt(Ct[yt].message),Ct}if((ct||dt)&&!Ot&&(isString$1(wt)||ot&&Array.isArray(wt))){const Ht=getValueAndMessage(ct),Lt=getValueAndMessage(dt),kt=!isNullOrUndefined(Ht.value)&&wt.length>+Ht.value,$t=!isNullOrUndefined(Lt.value)&&wt.length<+Lt.value;if((kt||$t)&&(Nt(kt,Ht.message,Lt.message),!st))return Rt(Ct[yt].message),Ct}if(xt&&!Ot&&isString$1(wt)){const{value:Ht,message:Lt}=getValueAndMessage(xt);if(isRegex(Ht)&&!wt.match(Ht)&&(Ct[yt]={type:INPUT_VALIDATION_RULES.pattern,message:Lt,ref:at,...Ut(INPUT_VALIDATION_RULES.pattern,Lt)},!st))return Rt(Lt),Ct}if(vt){if(isFunction(vt)){const Ht=await vt(wt,rt),Lt=getValidateError(Ht,St);if(Lt&&(Ct[yt]={...Lt,...Ut(INPUT_VALIDATION_RULES.validate,Lt.message)},!st))return Rt(Lt.message),Ct}else if(isObject(vt)){let Ht={};for(const Lt in vt){if(!isEmptyObject(Ht)&&!st)break;const kt=getValidateError(await vt[Lt](wt,rt),St,Lt);kt&&(Ht={...kt,...Ut(Lt,kt.message)},Rt(kt.message),st&&(Ct[yt]=Ht))}if(!isEmptyObject(Ht)&&(Ct[yt]={ref:St,...Ht},!st))return Ct}}return Rt(!0),Ct};const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(tt={}){let et={...defaultOptions,...tt},rt={submitCount:0,isDirty:!1,isReady:!1,isLoading:isFunction(et.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:et.errors||{},disabled:et.disabled||!1},st={},nt=isObject(et.defaultValues)||isObject(et.values)?cloneObject(et.defaultValues||et.values)||{}:{},ot=et.shouldUnregister?{}:cloneObject(nt),at={action:!1,mount:!1,watch:!1},lt={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},ut,ct=0;const dt={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let ht={...dt};const ft={array:createSubject(),state:createSubject()},xt=et.criteriaMode===VALIDATION_MODE.all,vt=Xt=>er=>{clearTimeout(ct),ct=setTimeout(Xt,er)},yt=async Xt=>{if(!et.disabled&&(dt.isValid||ht.isValid||Xt)){const er=et.resolver?isEmptyObject((await jt()).errors):await Ot(st,!0);er!==rt.isValid&&ft.state.next({isValid:er})}},Et=(Xt,er)=>{!et.disabled&&(dt.isValidating||dt.validatingFields||ht.isValidating||ht.validatingFields)&&((Xt||Array.from(lt.mount)).forEach(sr=>{sr&&(er?set(rt.validatingFields,sr,er):unset(rt.validatingFields,sr))}),ft.state.next({validatingFields:rt.validatingFields,isValidating:!isEmptyObject(rt.validatingFields)}))},bt=(Xt,er=[],sr,br,gr=!0,vr=!0)=>{if(br&&sr&&!et.disabled){if(at.action=!0,vr&&Array.isArray(get$1(st,Xt))){const Tr=sr(get$1(st,Xt),br.argA,br.argB);gr&&set(st,Xt,Tr)}if(vr&&Array.isArray(get$1(rt.errors,Xt))){const Tr=sr(get$1(rt.errors,Xt),br.argA,br.argB);gr&&set(rt.errors,Xt,Tr),unsetEmptyArray(rt.errors,Xt)}if((dt.touchedFields||ht.touchedFields)&&vr&&Array.isArray(get$1(rt.touchedFields,Xt))){const Tr=sr(get$1(rt.touchedFields,Xt),br.argA,br.argB);gr&&set(rt.touchedFields,Xt,Tr)}(dt.dirtyFields||ht.dirtyFields)&&(rt.dirtyFields=getDirtyFields(nt,ot)),ft.state.next({name:Xt,isDirty:Nt(Xt,er),dirtyFields:rt.dirtyFields,errors:rt.errors,isValid:rt.isValid})}else set(ot,Xt,er)},wt=(Xt,er)=>{set(rt.errors,Xt,er),ft.state.next({errors:rt.errors})},St=Xt=>{rt.errors=Xt,ft.state.next({errors:rt.errors,isValid:!1})},Rt=(Xt,er,sr,br)=>{const gr=get$1(st,Xt);if(gr){const vr=get$1(ot,Xt,isUndefined(sr)?get$1(nt,Xt):sr);isUndefined(vr)||br&&br.defaultChecked||er?set(ot,Xt,er?vr:getFieldValue(gr._f)):kt(Xt,vr),at.mount&&yt()}},Ct=(Xt,er,sr,br,gr)=>{let vr=!1,Tr=!1;const Lr={name:Xt};if(!et.disabled){if(!sr||br){(dt.isDirty||ht.isDirty)&&(Tr=rt.isDirty,rt.isDirty=Lr.isDirty=Nt(),vr=Tr!==Lr.isDirty);const Dr=deepEqual(get$1(nt,Xt),er);Tr=!!get$1(rt.dirtyFields,Xt),Dr?unset(rt.dirtyFields,Xt):set(rt.dirtyFields,Xt,!0),Lr.dirtyFields=rt.dirtyFields,vr=vr||(dt.dirtyFields||ht.dirtyFields)&&Tr!==!Dr}if(sr){const Dr=get$1(rt.touchedFields,Xt);Dr||(set(rt.touchedFields,Xt,sr),Lr.touchedFields=rt.touchedFields,vr=vr||(dt.touchedFields||ht.touchedFields)&&Dr!==sr)}vr&&gr&&ft.state.next(Lr)}return vr?Lr:{}},It=(Xt,er,sr,br)=>{const gr=get$1(rt.errors,Xt),vr=(dt.isValid||ht.isValid)&&isBoolean$1(er)&&rt.isValid!==er;if(et.delayError&&sr?(ut=vt(()=>wt(Xt,sr)),ut(et.delayError)):(clearTimeout(ct),ut=null,sr?set(rt.errors,Xt,sr):unset(rt.errors,Xt)),(sr?!deepEqual(gr,sr):gr)||!isEmptyObject(br)||vr){const Tr={...br,...vr&&isBoolean$1(er)?{isValid:er}:{},errors:rt.errors,name:Xt};rt={...rt,...Tr},ft.state.next(Tr)}},jt=async Xt=>{Et(Xt,!0);const er=await et.resolver(ot,et.context,getResolverOptions(Xt||lt.mount,st,et.criteriaMode,et.shouldUseNativeValidation));return Et(Xt),er},Pt=async Xt=>{const{errors:er}=await jt(Xt);if(Xt)for(const sr of Xt){const br=get$1(er,sr);br?set(rt.errors,sr,br):unset(rt.errors,sr)}else rt.errors=er;return er},Ot=async(Xt,er,sr={valid:!0})=>{for(const br in Xt){const gr=Xt[br];if(gr){const{_f:vr,...Tr}=gr;if(vr){const Lr=lt.array.has(vr.name),Dr=gr._f&&hasPromiseValidation(gr._f);Dr&&dt.validatingFields&&Et([vr.name],!0);const Zr=await validateField(gr,lt.disabled,ot,xt,et.shouldUseNativeValidation&&!er,Lr);if(Dr&&dt.validatingFields&&Et([vr.name]),Zr[vr.name]&&(sr.valid=!1,er))break;!er&&(get$1(Zr,vr.name)?Lr?updateFieldArrayRootError(rt.errors,Zr,vr.name):set(rt.errors,vr.name,Zr[vr.name]):unset(rt.errors,vr.name))}!isEmptyObject(Tr)&&await Ot(Tr,er,sr)}}return sr.valid},Ut=()=>{for(const Xt of lt.unMount){const er=get$1(st,Xt);er&&(er._f.refs?er._f.refs.every(sr=>!live(sr)):!live(er._f.ref))&&mr(Xt)}lt.unMount=new Set},Nt=(Xt,er)=>!et.disabled&&(Xt&&er&&set(ot,Xt,er),!deepEqual(Bt(),nt)),Ht=(Xt,er,sr)=>generateWatchOutput(Xt,lt,{...at.mount?ot:isUndefined(er)?nt:isString$1(Xt)?{[Xt]:er}:er},sr,er),Lt=Xt=>compact$1(get$1(at.mount?ot:nt,Xt,et.shouldUnregister?get$1(nt,Xt,[]):[])),kt=(Xt,er,sr={})=>{const br=get$1(st,Xt);let gr=er;if(br){const vr=br._f;vr&&(!vr.disabled&&set(ot,Xt,getFieldValueAs(er,vr)),gr=isHTMLElement(vr.ref)&&isNullOrUndefined(er)?"":er,isMultipleSelect(vr.ref)?[...vr.ref.options].forEach(Tr=>Tr.selected=gr.includes(Tr.value)):vr.refs?isCheckBoxInput(vr.ref)?vr.refs.forEach(Tr=>{(!Tr.defaultChecked||!Tr.disabled)&&(Array.isArray(gr)?Tr.checked=!!gr.find(Lr=>Lr===Tr.value):Tr.checked=gr===Tr.value||!!gr)}):vr.refs.forEach(Tr=>Tr.checked=Tr.value===gr):isFileInput(vr.ref)?vr.ref.value="":(vr.ref.value=gr,vr.ref.type||ft.state.next({name:Xt,values:cloneObject(ot)})))}(sr.shouldDirty||sr.shouldTouch)&&Ct(Xt,gr,sr.shouldTouch,sr.shouldDirty,!0),sr.shouldValidate&&Vt(Xt)},$t=(Xt,er,sr)=>{for(const br in er){if(!er.hasOwnProperty(br))return;const gr=er[br],vr=Xt+"."+br,Tr=get$1(st,vr);(lt.array.has(Xt)||isObject(gr)||Tr&&!Tr._f)&&!isDateObject(gr)?$t(vr,gr,sr):kt(vr,gr,sr)}},Ft=(Xt,er,sr={})=>{const br=get$1(st,Xt),gr=lt.array.has(Xt),vr=cloneObject(er);set(ot,Xt,vr),gr?(ft.array.next({name:Xt,values:cloneObject(ot)}),(dt.isDirty||dt.dirtyFields||ht.isDirty||ht.dirtyFields)&&sr.shouldDirty&&ft.state.next({name:Xt,dirtyFields:getDirtyFields(nt,ot),isDirty:Nt(Xt,vr)})):br&&!br._f&&!isNullOrUndefined(vr)?$t(Xt,vr,sr):kt(Xt,vr,sr),isWatched(Xt,lt)&&ft.state.next({...rt,name:Xt}),ft.state.next({name:at.mount?Xt:void 0,values:cloneObject(ot)})},Gt=async Xt=>{at.mount=!0;const er=Xt.target;let sr=er.name,br=!0;const gr=get$1(st,sr),vr=Dr=>{br=Number.isNaN(Dr)||isDateObject(Dr)&&isNaN(Dr.getTime())||deepEqual(Dr,get$1(ot,sr,Dr))},Tr=getValidationModes(et.mode),Lr=getValidationModes(et.reValidateMode);if(gr){let Dr,Zr;const ks=er.type?getFieldValue(gr._f):getEventValue(Xt),Ir=Xt.type===EVENTS.BLUR||Xt.type===EVENTS.FOCUS_OUT,Br=!hasValidation(gr._f)&&!et.resolver&&!get$1(rt.errors,sr)&&!gr._f.deps||skipValidation(Ir,get$1(rt.touchedFields,sr),rt.isSubmitted,Lr,Tr),kr=isWatched(sr,lt,Ir);set(ot,sr,ks),Ir?(!er||!er.readOnly)&&(gr._f.onBlur&&gr._f.onBlur(Xt),ut&&ut(0)):gr._f.onChange&&gr._f.onChange(Xt);const Wr=Ct(sr,ks,Ir),bs=!isEmptyObject(Wr)||kr;if(!Ir&&ft.state.next({name:sr,type:Xt.type,values:cloneObject(ot)}),Br)return(dt.isValid||ht.isValid)&&(et.mode==="onBlur"?Ir&&yt():Ir||yt()),bs&&ft.state.next({name:sr,...kr?{}:Wr});if(!Ir&&kr&&ft.state.next({...rt}),et.resolver){const{errors:ps}=await jt([sr]);if(vr(ks),br){const zr=schemaErrorLookup(rt.errors,st,sr),$r=schemaErrorLookup(ps,st,zr.name||sr);Dr=$r.error,sr=$r.name,Zr=isEmptyObject(ps)}}else Et([sr],!0),Dr=(await validateField(gr,lt.disabled,ot,xt,et.shouldUseNativeValidation))[sr],Et([sr]),vr(ks),br&&(Dr?Zr=!1:(dt.isValid||ht.isValid)&&(Zr=await Ot(st,!0)));br&&(gr._f.deps&&(!Array.isArray(gr._f.deps)||gr._f.deps.length>0)&&Vt(gr._f.deps),It(sr,Zr,Dr,Wr))}},Mt=(Xt,er)=>{if(get$1(rt.errors,er)&&Xt.focus)return Xt.focus(),1},Vt=async(Xt,er={})=>{let sr,br;const gr=convertToArrayPayload(Xt);if(et.resolver){const vr=await Pt(isUndefined(Xt)?Xt:gr);sr=isEmptyObject(vr),br=Xt?!gr.some(Tr=>get$1(vr,Tr)):sr}else Xt?(br=(await Promise.all(gr.map(async vr=>{const Tr=get$1(st,vr);return await Ot(Tr&&Tr._f?{[vr]:Tr}:Tr)}))).every(Boolean),!(!br&&!rt.isValid)&&yt()):br=sr=await Ot(st);return ft.state.next({...!isString$1(Xt)||(dt.isValid||ht.isValid)&&sr!==rt.isValid?{}:{name:Xt},...et.resolver||!Xt?{isValid:sr}:{},errors:rt.errors}),er.shouldFocus&&!br&&iterateFieldsByAction(st,Mt,Xt?gr:lt.mount),br},Bt=(Xt,er)=>{let sr={...at.mount?ot:nt};return er&&(sr=extractFormValues(er.dirtyFields?rt.dirtyFields:rt.touchedFields,sr)),isUndefined(Xt)?sr:isString$1(Xt)?get$1(sr,Xt):Xt.map(br=>get$1(sr,br))},qt=(Xt,er)=>({invalid:!!get$1((er||rt).errors,Xt),isDirty:!!get$1((er||rt).dirtyFields,Xt),error:get$1((er||rt).errors,Xt),isValidating:!!get$1(rt.validatingFields,Xt),isTouched:!!get$1((er||rt).touchedFields,Xt)}),Qt=Xt=>{Xt&&convertToArrayPayload(Xt).forEach(er=>unset(rt.errors,er)),ft.state.next({errors:Xt?rt.errors:{}})},Yt=(Xt,er,sr)=>{const br=(get$1(st,Xt,{_f:{}})._f||{}).ref,gr=get$1(rt.errors,Xt)||{},{ref:vr,message:Tr,type:Lr,...Dr}=gr;set(rt.errors,Xt,{...Dr,...er,ref:br}),ft.state.next({name:Xt,errors:rt.errors,isValid:!1}),sr&&sr.shouldFocus&&br&&br.focus&&br.focus()},tr=(Xt,er)=>isFunction(Xt)?ft.state.subscribe({next:sr=>"values"in sr&&Xt(Ht(void 0,er),sr)}):Ht(Xt,er,!0),lr=Xt=>ft.state.subscribe({next:er=>{shouldSubscribeByName(Xt.name,er.name,Xt.exact)&&shouldRenderFormState(er,Xt.formState||dt,Gs,Xt.reRenderRoot)&&Xt.callback({values:{...ot},...rt,...er,defaultValues:nt})}}).unsubscribe,ur=Xt=>(at.mount=!0,ht={...ht,...Xt.formState},lr({...Xt,formState:ht})),mr=(Xt,er={})=>{for(const sr of Xt?convertToArrayPayload(Xt):lt.mount)lt.mount.delete(sr),lt.array.delete(sr),er.keepValue||(unset(st,sr),unset(ot,sr)),!er.keepError&&unset(rt.errors,sr),!er.keepDirty&&unset(rt.dirtyFields,sr),!er.keepTouched&&unset(rt.touchedFields,sr),!er.keepIsValidating&&unset(rt.validatingFields,sr),!et.shouldUnregister&&!er.keepDefaultValue&&unset(nt,sr);ft.state.next({values:cloneObject(ot)}),ft.state.next({...rt,...er.keepDirty?{isDirty:Nt()}:{}}),!er.keepIsValid&&yt()},yr=({disabled:Xt,name:er})=>{(isBoolean$1(Xt)&&at.mount||Xt||lt.disabled.has(er))&&(Xt?lt.disabled.add(er):lt.disabled.delete(er))},or=(Xt,er={})=>{let sr=get$1(st,Xt);const br=isBoolean$1(er.disabled)||isBoolean$1(et.disabled);return set(st,Xt,{...sr||{},_f:{...sr&&sr._f?sr._f:{ref:{name:Xt}},name:Xt,mount:!0,...er}}),lt.mount.add(Xt),sr?yr({disabled:isBoolean$1(er.disabled)?er.disabled:et.disabled,name:Xt}):Rt(Xt,!0,er.value),{...br?{disabled:er.disabled||et.disabled}:{},...et.progressive?{required:!!er.required,min:getRuleValue(er.min),max:getRuleValue(er.max),minLength:getRuleValue(er.minLength),maxLength:getRuleValue(er.maxLength),pattern:getRuleValue(er.pattern)}:{},name:Xt,onChange:Gt,onBlur:Gt,ref:gr=>{if(gr){or(Xt,er),sr=get$1(st,Xt);const vr=isUndefined(gr.value)&&gr.querySelectorAll&&gr.querySelectorAll("input,select,textarea")[0]||gr,Tr=isRadioOrCheckbox(vr),Lr=sr._f.refs||[];if(Tr?Lr.find(Dr=>Dr===vr):vr===sr._f.ref)return;set(st,Xt,{_f:{...sr._f,...Tr?{refs:[...Lr.filter(live),vr,...Array.isArray(get$1(nt,Xt))?[{}]:[]],ref:{type:vr.type,name:Xt}}:{ref:vr}}}),Rt(Xt,!1,void 0,vr)}else sr=get$1(st,Xt,{}),sr._f&&(sr._f.mount=!1),(et.shouldUnregister||er.shouldUnregister)&&!(isNameInFieldArray(lt.array,Xt)&&at.action)&<.unMount.add(Xt)}}},hr=()=>et.shouldFocusError&&iterateFieldsByAction(st,Mt,lt.mount),pr=Xt=>{isBoolean$1(Xt)&&(ft.state.next({disabled:Xt}),iterateFieldsByAction(st,(er,sr)=>{const br=get$1(st,sr);br&&(er.disabled=br._f.disabled||Xt,Array.isArray(br._f.refs)&&br._f.refs.forEach(gr=>{gr.disabled=br._f.disabled||Xt}))},0,!1))},_r=(Xt,er)=>async sr=>{let br;sr&&(sr.preventDefault&&sr.preventDefault(),sr.persist&&sr.persist());let gr=cloneObject(ot);if(ft.state.next({isSubmitting:!0}),et.resolver){const{errors:vr,values:Tr}=await jt();rt.errors=vr,gr=cloneObject(Tr)}else await Ot(st);if(lt.disabled.size)for(const vr of lt.disabled)unset(gr,vr);if(unset(rt.errors,"root"),isEmptyObject(rt.errors)){ft.state.next({errors:{}});try{await Xt(gr,sr)}catch(vr){br=vr}}else er&&await er({...rt.errors},sr),hr(),setTimeout(hr);if(ft.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(rt.errors)&&!br,submitCount:rt.submitCount+1,errors:rt.errors}),br)throw br},Ar=(Xt,er={})=>{get$1(st,Xt)&&(isUndefined(er.defaultValue)?Ft(Xt,cloneObject(get$1(nt,Xt))):(Ft(Xt,er.defaultValue),set(nt,Xt,cloneObject(er.defaultValue))),er.keepTouched||unset(rt.touchedFields,Xt),er.keepDirty||(unset(rt.dirtyFields,Xt),rt.isDirty=er.defaultValue?Nt(Xt,cloneObject(get$1(nt,Xt))):Nt()),er.keepError||(unset(rt.errors,Xt),dt.isValid&&yt()),ft.state.next({...rt}))},Hr=(Xt,er={})=>{const sr=Xt?cloneObject(Xt):nt,br=cloneObject(sr),gr=isEmptyObject(Xt),vr=gr?nt:br;if(er.keepDefaultValues||(nt=sr),!er.keepValues){if(er.keepDirtyValues){const Tr=new Set([...lt.mount,...Object.keys(getDirtyFields(nt,ot))]);for(const Lr of Array.from(Tr))get$1(rt.dirtyFields,Lr)?set(vr,Lr,get$1(ot,Lr)):Ft(Lr,get$1(vr,Lr))}else{if(isWeb&&isUndefined(Xt))for(const Tr of lt.mount){const Lr=get$1(st,Tr);if(Lr&&Lr._f){const Dr=Array.isArray(Lr._f.refs)?Lr._f.refs[0]:Lr._f.ref;if(isHTMLElement(Dr)){const Zr=Dr.closest("form");if(Zr){Zr.reset();break}}}}if(er.keepFieldsRef)for(const Tr of lt.mount)Ft(Tr,get$1(vr,Tr));else st={}}ot=et.shouldUnregister?er.keepDefaultValues?cloneObject(nt):{}:cloneObject(vr),ft.array.next({values:{...vr}}),ft.state.next({values:{...vr}})}lt={mount:er.keepDirtyValues?lt.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},at.mount=!dt.isValid||!!er.keepIsValid||!!er.keepDirtyValues,at.watch=!!et.shouldUnregister,ft.state.next({submitCount:er.keepSubmitCount?rt.submitCount:0,isDirty:gr?!1:er.keepDirty?rt.isDirty:!!(er.keepDefaultValues&&!deepEqual(Xt,nt)),isSubmitted:er.keepIsSubmitted?rt.isSubmitted:!1,dirtyFields:gr?{}:er.keepDirtyValues?er.keepDefaultValues&&ot?getDirtyFields(nt,ot):rt.dirtyFields:er.keepDefaultValues&&Xt?getDirtyFields(nt,Xt):er.keepDirty?rt.dirtyFields:{},touchedFields:er.keepTouched?rt.touchedFields:{},errors:er.keepErrors?rt.errors:{},isSubmitSuccessful:er.keepIsSubmitSuccessful?rt.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:nt})},Ur=(Xt,er)=>Hr(isFunction(Xt)?Xt(ot):Xt,er),os=(Xt,er={})=>{const sr=get$1(st,Xt),br=sr&&sr._f;if(br){const gr=br.refs?br.refs[0]:br.ref;gr.focus&&(gr.focus(),er.shouldSelect&&isFunction(gr.select)&&gr.select())}},Gs=Xt=>{rt={...rt,...Xt}},Ws={control:{register:or,unregister:mr,getFieldState:qt,handleSubmit:_r,setError:Yt,_subscribe:lr,_runSchema:jt,_focusError:hr,_getWatch:Ht,_getDirty:Nt,_setValid:yt,_setFieldArray:bt,_setDisabledField:yr,_setErrors:St,_getFieldArray:Lt,_reset:Hr,_resetDefaultValues:()=>isFunction(et.defaultValues)&&et.defaultValues().then(Xt=>{Ur(Xt,et.resetOptions),ft.state.next({isLoading:!1})}),_removeUnmounted:Ut,_disableForm:pr,_subjects:ft,_proxyFormState:dt,get _fields(){return st},get _formValues(){return ot},get _state(){return at},set _state(Xt){at=Xt},get _defaultValues(){return nt},get _names(){return lt},set _names(Xt){lt=Xt},get _formState(){return rt},get _options(){return et},set _options(Xt){et={...et,...Xt}}},subscribe:ur,trigger:Vt,register:or,handleSubmit:_r,watch:tr,setValue:Ft,getValues:Bt,reset:Ur,resetField:Ar,clearErrors:Qt,unregister:mr,setError:Yt,setFocus:os,getFieldState:qt};return{...Ws,formControl:Ws}}function useForm(tt={}){const et=React$4.useRef(void 0),rt=React$4.useRef(void 0),[st,nt]=React$4.useState({isDirty:!1,isValidating:!1,isLoading:isFunction(tt.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:tt.errors||{},disabled:tt.disabled||!1,isReady:!1,defaultValues:isFunction(tt.defaultValues)?void 0:tt.defaultValues});if(!et.current)if(tt.formControl)et.current={...tt.formControl,formState:st},tt.defaultValues&&!isFunction(tt.defaultValues)&&tt.formControl.reset(tt.defaultValues,tt.resetOptions);else{const{formControl:at,...lt}=createFormControl(tt);et.current={...lt,formState:st}}const ot=et.current.control;return ot._options=tt,useIsomorphicLayoutEffect(()=>{const at=ot._subscribe({formState:ot._proxyFormState,callback:()=>nt({...ot._formState}),reRenderRoot:!0});return nt(lt=>({...lt,isReady:!0})),ot._formState.isReady=!0,at},[ot]),React$4.useEffect(()=>ot._disableForm(tt.disabled),[ot,tt.disabled]),React$4.useEffect(()=>{tt.mode&&(ot._options.mode=tt.mode),tt.reValidateMode&&(ot._options.reValidateMode=tt.reValidateMode)},[ot,tt.mode,tt.reValidateMode]),React$4.useEffect(()=>{tt.errors&&(ot._setErrors(tt.errors),ot._focusError())},[ot,tt.errors]),React$4.useEffect(()=>{tt.shouldUnregister&&ot._subjects.state.next({values:ot._getWatch()})},[ot,tt.shouldUnregister]),React$4.useEffect(()=>{if(ot._proxyFormState.isDirty){const at=ot._getDirty();at!==st.isDirty&&ot._subjects.state.next({isDirty:at})}},[ot,st.isDirty]),React$4.useEffect(()=>{tt.values&&!deepEqual(tt.values,rt.current)?(ot._reset(tt.values,{keepFieldsRef:!0,...ot._options.resetOptions}),rt.current=tt.values,nt(at=>({...at}))):ot._resetDefaultValues()},[ot,tt.values]),React$4.useEffect(()=>{ot._state.mount||(ot._setValid(),ot._state.mount=!0),ot._state.watch&&(ot._state.watch=!1,ot._subjects.state.next({...ot._formState})),ot._removeUnmounted()}),et.current.formState=getProxyFormState(st,ot),et.current}const useActivitiesOptions=()=>{const{t:tt}=useTranslation();return[{value:"bpr.activityType.classroomActivity",label:tt("bpr.activityType.classroomActivity")},{value:"bpr.activityType.groupActivity",label:tt("bpr.activityType.groupActivity")},{value:"bpr.activityType.personalActivity",label:tt("bpr.activityType.personalActivity")},{value:"bpr.activityType.homework",label:tt("bpr.activityType.homework")},{value:"bpr.activityType.exercize",label:tt("bpr.activityType.exercize")},{value:"bpr.activityType.learningPath",label:tt("bpr.activityType.learningPath")},{value:"bpr.activityType.courseElement",label:tt("bpr.activityType.courseElement")},{value:"bpr.other",label:tt("bpr.other")}]},ActivitiesDropdown=({control:tt,selectedActivities:et,selectActivities:rt})=>{const st=useActivitiesOptions(),{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"col d-flex",children:jsxRuntimeExports.jsx(Controller,{name:"activityType",control:tt,rules:{required:!0},render:({field:{onChange:ot}})=>jsxRuntimeExports.jsxs(Dropdown,{block:!0,overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"md",label:nt("bpr.form.publication.type"),badgeContent:et==null?void 0:et.length}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:st.map((at,lt)=>jsxRuntimeExports.jsx(Dropdown.CheckboxItem,{value:at.value,model:et,onChange:()=>{rt(at.value),ot(at.value)},children:at.label},lt))})]})})})},ageOptions=["3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18"],AgeSelect=({name:tt,control:et,placeholderOption:rt,validate:st})=>jsxRuntimeExports.jsx(Controller,{name:tt,control:et,rules:{required:!0,validate:st},render:({field:{onChange:nt}})=>jsxRuntimeExports.jsx(Select,{block:!0,size:"md",onValueChange:nt,options:ageOptions,"aria-required":!0,placeholderOption:rt})}),useLanguageOptions=()=>{const{t:tt}=useTranslation();return[{value:"de_DE",label:tt("de_DE")},{value:"en_EN",label:tt("en_EN")},{value:"ar_DZ",label:tt("ar_DZ")},{value:"es_ES",label:tt("es_ES")},{value:"fr_FR",label:tt("fr_FR")},{value:"it_IT",label:tt("it_IT")},{value:"ja_JP",label:tt("ja_JP")},{value:"zh_CN",label:tt("zh_CN")},{value:"pt_PT",label:tt("pt_PT")},{value:"ru_RU",label:tt("ru_RU")},{value:"bpr.other",label:tt("bpr.other")}]},defaultSelectLanguageOption="bpr.form.publication.language",LangSelect=({control:tt})=>{const et=useLanguageOptions();return jsxRuntimeExports.jsx("div",{className:"col",children:jsxRuntimeExports.jsx(Controller,{name:"language",control:tt,rules:{required:!0},render:({field:{onChange:rt}})=>jsxRuntimeExports.jsx(Select,{block:!0,size:"md",onValueChange:rt,options:et,"aria-required":!0,placeholderOption:defaultSelectLanguageOption})})})},creativeCommons="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEUAAAAYCAYAAACsnTAAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAubSURBVHgB7Vh3UNVnFj2P/kAQURGNsa2GKKIOCjGzIEUhqElsY40m9lgiGksmWUfjTNZel8ggblSIxjUxujbEiiiwoiiixoqVJtKkCQg82O9c9r0AeaiTP3ZmZ3NnmAHed9/v+84999zz/TRvvvnmlo6dO04xMTExw/95VLyoyEm6lDRW4+XjpZszP8gE/4XQ6XQoeFYAXbVO/m7atCksLS1fK7eqqgqFhYXyHaYmprCzs4O5hflr5VZUVKCosAjVNdUw0ZjArqkdLCwsjO7voxHjtpsphpigpgbQaIwuys3JxS/J13H9+i/qQM/k/81bNEdXl27o5dZLftcYya0bZWVluJ58DSeOnUBxYTHMzMxlg9bWWri/4wHfAb6wtLJsNPda8lVEHY5C6fMymJubyyFtmlgjcHAg3Pr0hoWlhdHc8vJynI8/j7iYWJSXlssZK6sqpBg+/X3k2XVzeY7q6moTMw00RgEpLi7GrohduBCfoDZTClNTU3To0EEqdvvmbcSqB9k3s4enjxfGfDTGKPKyMXWoiL+Hq4Ndw7Rp0zBgwAA0a9YMz58/R0JCAtavX4/LiZcQtGAubO1s6+WWqD2EBociMz0T8+bNg4eHhzCkqKgIZ8+exYYNGxB7NhYzg2ahSZMm9XLJqg2r1uNZ3jMsWrQI7u7usLW1RUFBAY4fP46wsDBcTbqK6Z99qopkZgCFYVJj5CCpjx5j9TerEBt9Dp5/9sShQ4cEpHv37uHRo0dyoH379sG1uyuO/PMwVny9XOhpLMK/i0Budi4OHjyIFStWoHPnzti6dStatmyJhQsXIjExEVYWVli/cp0CsNyQR4YQEF2lDjExMbK2X79+yMrKgpubG5YsWSK5leWVCAvZgsrKSkMuW/Tb9cFwsHfAjRs3MH/+fHh6eqJHjx7w8fHBypUrER0djccPH2NrSJgwr26YoAFJnpeUIGRTCDLSMrBlyxYcOHAAH3zwAbRarWGNlZUVhg8fjmPHjmHVqlXIzMjExjUbUKiqUDcSExJx6UIiQkJC8O6778r/0tPTcebMGQGY0bZtW+zatQu6Kp2wTx8xp84oBl3G4sWL0aZNG2nlU6dOYe7cuYiKikJOTo4AvGPHDuRk5SL+XLwhN/5cHFAN7N69W1jJ9X379kWnTp0EWD7f1dUVP/74I5IvJyPlTkoDUOpQpUZpS/h34cjLzcOaNWswefLkemA0DGtra3z++eey8ZS7KTh+9IThM7bZ8aPHMHToUKkSqUnqEgACQebcvn1b1vJwZALXcw9lpWWiBS1atMCcOXMwduxYqfaHH34oB1u+fDlu3rwpub169cJH48bhRNQJ6oGwLfpktKxv166dMGXKlCmyV7bvixcvMGbMGFy+fFlaaurUqTgeeaw+KHWJ8uDefanW4MGDBZBXCSiDWsKNe/fzxsF9B5CV+UT+Tx3KSM/AyJEjDWtJ/dDQUJw+fRo7d+6UVtQHaZ39NBs52Tl4pgSdwOzdu1d6v0Sxd/PmzTKpRo8eLXri5eVlyCVYZHhxUTGys7NhrbWWAzOCg4ORl5cne2Txtm3bJsCQYQxvb29kPckSDTKAoicKUT594rSIDpPZIlTvPXv2yN/ff/+9bI4MOHr0KJYuXSobZTtws+xxUjzubJzh+9gSZMHrBIXS3t5etKFCbZoMZtu8//77AiL1IzAwUJhJdvCwmZmZkss9c0xT96h3LCaZwfj4448xadIkAZ1B9pH9+oI4OjrKEFEe5VdQZByrHwLwWAkse00/ZUi76dOnq3F83QDCunXrMGHCBCQnJ4vmfPXVVyKKzs7OUEYQ9xXbKitqRc/UzBSpqamGh3EU8mCMrl27omPHjobPSktLZaqQeZaqIHQKBXU0qmfPnti4caOA4+DgIBOFgsu2416ojQRWq7WSFtQLL5/JXD3rWVjut1WrVvJ3fn6+nJXAMk9A1j9Ub6ycuzgLchQyiiwrRUF68OCBbMbFxUUqRWqnpaX9ZyNaUXAnJycUFBUoL1Ap8/+Ntm+IdgQEBMgzWrduLfSnQJO2BFIfnAZkJ30P6W1hZSEA9OnTR1jH0c2Jx5wnT57gk08+EfHmWOY0c3RyrDVl6rlFJUUy7rt06SJF+eKLL3D37l0MGzYMmzZtkvONUzrEOHfuHJo5NENT+6a/MkUQpGlRoFTrqgUx/vCQ/CGFGRQ40pvVJAXZMmwNAsGgqeKhXpTXUp/09fb1xk8//YRbt27hZZGRkSHa4R/oLwwhyN5+PiL2rCT/R7FlG3A8L1u2TD4jkwk6/Yd/YICs43M9+npg7dq1yM3Nhb+/P4KCgoTVLAQnD/PZTpyA1Dg/fz/J/Y1PMVOHamLXRASHleIoI8VPnjwpFZoxY4agTLQpdJwirMDMmTOFjmw/boKGjgAxvHz7oVOXP8nmySoGgSXT9GDy0F9++SUKiwoRMOg9A1Ce/TyhtdFiyJAhAhpbk3uYNWuWVJmspZ4RKIcWDnBzdzPkDhk+FCXPSzB79mwpIqcV2cXicB8U3ZSUFAGa+3Nz712vSKYdOrRf5tHXXZC6oaw8NYGL2XO9e/fG+fPnBRj9SKMjvXPnjrTW06dPpQqk6cOHD7F69Wq49OiOPu/0MTzgbZe3kaTGX/DfggUssovA8pAUUOpTxpMMzJgzE46tHA15ZuZm6K02Gxsbh3/8sBu1t5EamSo8IKcXXW6VrgrTZk8XM6gPtpBzN2ccPRKFiPAIKQTZb2NjI0By8rCgNrY2mDl3lkGU+f0/7/k5WaMoXjN73mxpIRqm0G9D5XAUMgYZwBHZvHlzg5WnMLHC+gsdRY3rORG+/uvX6ObqUg95jueLCRcReShSOdQqsfNyQVNa4ePvi/4B/cW+GwtWOl5NtDNqb3yOnW2tzTc1N4Vvfz+hvtbauJfKz8tHgvI79DCcTgSF4k0GvjcoEJ7envWuJ9zPmKGjwzU+fj41swgKasV28aK/ID83H3FxcSKqrxN0mqx4y1YtseSbpY2u4/dnqSpXVlDtTeHUprXh3vGqoL7Rx1QpUCmUTm2cDG36ylw1bulfmMubtVNrJ/mOhkGmjB4yKtyMc/3h/YcyPrl44tRJWLtyjThRili3bt1e+sCkpCQxejzw+InjhVlPs54K6i+LSsW2tNQ0/J5gy6SnpeP3BMFNfZxq9DP9SNYotGuInij8+LEYoCbA2egY7I7YLa1BpR40aJBYc65hEAAKFo0dL1ca5Ys//WyGaECEuibEqPz/1VCtHs4ZZLj90HMELZyLHr16qNcDt7AtbBuys7JlHFNM9eOZs//atWti29u1b4dJn07GW85vCRhbN4cJaHWDk4KiTcrSL1A/KMwcge3btxdz2BizWAyOeq7nd9CocXoxj1OQbdFYMM/X11d+56WQRfXz8xNv0vBmXCfC2VjL9H9xYXJSsjhN156uIkQEghtKOJ+Aixcv4tKlS8IS567OGDZyGMZPmiDKH6WUfteOnfWu8Pqg4aKv4NQis2gM2XLcICl75cqVxjYot3Hesukv6GiZS/2ipeeo379/f6O5vOzxMspJR0Dorw4fPixg1nXaDSL5NyrHS9W6lWsxcuwoBAwMEK/BHwZf+vCtmZWy0vooLChE5MEjOKJ+OJUaC7Zi9+7dBVD6HmoW/dD27dvxquA9hXceBl0sc+Lj42Usvyyod3ztwQshR/GCBQvEAY8aNUry9RrSMIxKPzf7g3rrFn3ytALEC93VfYg2mKNPpz7ja8kc9ZoyUY3ZhH9dMLymfFmw1SIjI2s1SLUNPcqz18hjcLrxBRFtAa8brD4vcjzwxIkTG83j3YgFYAuSNWw7ehbm8sqhv1A2jHqa0liwyvQWWnUl11VXoUy9K6VXaKgdjQU1ZeDAgQZ/QzPIDdIz1H19YCzILgafxxdFvKGPGDFCWoKu+mX5fJ/C1wrUFl4POP55J2Lb0t3SBBoJJbQaTanikRZ/hITSntB/Awop/YGn+Be4AAAAAElFTkSuQmCC",PublishModalFooter=()=>{const{t:tt}=useTranslation();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("ul",{className:"mb-12",children:[jsxRuntimeExports.jsxs("li",{children:[tt("bpr.form.publication.licence.text.1"),jsxRuntimeExports.jsx("img",{className:"ms-8 d-inline-block",src:creativeCommons,alt:"licence creative commons"})]}),jsxRuntimeExports.jsx("li",{children:tt("bpr.form.publication.licence.text.2")})]}),jsxRuntimeExports.jsx(Alert,{type:"info",className:"mb-12",children:tt("bpr.form.publication.licence.text.3")}),jsxRuntimeExports.jsx(Alert,{type:"warning",children:tt("bpr.form.publication.licence.text.4")})]})},useSubjectsOptions=()=>{const{t:tt}=useTranslation();return[{value:"bpr.subjectArea.artActivity",label:tt("bpr.subjectArea.artActivity")},{value:"bpr.subjectArea.readLearning",label:tt("bpr.subjectArea.readLearning")},{value:"bpr.subjectArea.chemistry",label:tt("bpr.subjectArea.chemistry")},{value:"bpr.subjectArea.law",label:tt("bpr.subjectArea.law")},{value:"bpr.subjectArea.worldDiscovery",label:tt("bpr.subjectArea.worldDiscovery")},{value:"bpr.subjectArea.economy",label:tt("bpr.subjectArea.economy")},{value:"bpr.subjectArea.mediaEducation",label:tt("bpr.subjectArea.mediaEducation")},{value:"bpr.subjectArea.musicEducation",label:tt("bpr.subjectArea.musicEducation")},{value:"bpr.subjectArea.sportEducation",label:tt("bpr.subjectArea.sportEducation")},{value:"bpr.subjectArea.citizenshipEducation",label:tt("bpr.subjectArea.citizenshipEducation")},{value:"bpr.subjectArea.geography",label:tt("bpr.subjectArea.geography")},{value:"bpr.subjectArea.history",label:tt("bpr.subjectArea.history")},{value:"bpr.subjectArea.artHistory",label:tt("bpr.subjectArea.artHistory")},{value:"bpr.subjectArea.ComputerScience",label:tt("bpr.subjectArea.ComputerScience")},{value:"bpr.subjectArea.languages",label:tt("bpr.subjectArea.languages")},{value:"bpr.subjectArea.italian",label:tt("bpr.subjectArea.italian")},{value:"bpr.subjectArea.spanish",label:tt("bpr.subjectArea.spanish")},{value:"bpr.subjectArea.french",label:tt("bpr.subjectArea.french")},{value:"bpr.subjectArea.german",label:tt("bpr.subjectArea.german")},{value:"bpr.subjectArea.english",label:tt("bpr.subjectArea.english")},{value:"bpr.subjectArea.ancientLanguages",label:tt("bpr.subjectArea.ancientLanguages")},{value:"bpr.subjectArea.literature",label:tt("bpr.subjectArea.literature")},{value:"bpr.subjectArea.mathematics",label:tt("bpr.subjectArea.mathematics")},{value:"bpr.subjectArea.vocationalGuidance",label:tt("bpr.subjectArea.vocationalGuidance")},{value:"bpr.subjectArea.philosohppy",label:tt("bpr.subjectArea.philosohppy")},{value:"bpr.subjectArea.physics",label:tt("bpr.subjectArea.physics")},{value:"bpr.subjectArea.politicalSscience",label:tt("bpr.subjectArea.politicalSscience")},{value:"bpr.subjectArea.sociology",label:tt("bpr.subjectArea.sociology")},{value:"bpr.subjectArea.biology",label:tt("bpr.subjectArea.biology")},{value:"bpr.subjectArea.geology",label:tt("bpr.subjectArea.geology")},{value:"bpr.subjectArea.technology",label:tt("bpr.subjectArea.technology")},{value:"bpr.subjectArea.Arabic",label:tt("bpr.subjectArea.Arabic")},{value:"bpr.subjectArea.Chinese",label:tt("bpr.subjectArea.Chinese")},{value:"bpr.subjectArea.NaturalSciences",label:tt("bpr.subjectArea.NaturalSciences")},{value:"bpr.subjectArea.SocioEmotionalEducation",label:tt("bpr.subjectArea.SocioEmotionalEducation")},{value:"bpr.other",label:tt("bpr.other")}]},SubjectsDropdown=({control:tt,selectedSubjectAreas:et,selectSubjects:rt})=>{const st=useSubjectsOptions(),{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"col d-flex",children:jsxRuntimeExports.jsx(Controller,{name:"subjectArea",control:tt,rules:{required:!0},render:({field:{onChange:ot}})=>jsxRuntimeExports.jsxs(Dropdown,{block:!0,overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"md",label:nt("bpr.form.publication.discipline"),badgeContent:et==null?void 0:et.length}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:st.map((at,lt)=>jsxRuntimeExports.jsx(Dropdown.CheckboxItem,{value:at.value,model:et,onChange:()=>{rt(at.value),ot(at.value)},children:at.label},lt))})]})})})};function ToastError({formData:tt,errorMessage:et}){const{t:rt}=useTranslation(),st=nt=>nt==null?void 0:nt.match(/^\s/);return et==="CONTENT_TOO_LARGE"?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:rt("bpr.form.publication.response.error.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.error.content_too_large")})})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:rt("bpr.form.publication.response.error.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.error.content")})}),jsxRuntimeExports.jsxs("ul",{children:[st(tt==null?void 0:tt.title)&&jsxRuntimeExports.jsx("li",{className:"pt-2 pb-2",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.empty.title")})}),st(tt==null?void 0:tt.description)&&jsxRuntimeExports.jsx("li",{className:"pt-2 pb-2",children:jsxRuntimeExports.jsx("strong",{children:rt("bpr.form.publication.response.empty.description")})})]})]})}function ToastSuccess({result:tt}){const{t:et}=useTranslation();return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("h3",{className:"pt-24",children:et("bpr.form.publication.response.success.title")}),jsxRuntimeExports.jsx("p",{className:"pt-24",children:et("bpr.form.publication.response.success.content.1")}),jsxRuntimeExports.jsx("p",{className:"pt-24",children:et("bpr.form.publication.response.success.content.2")}),tt.details.front_url&&jsxRuntimeExports.jsx("p",{className:"pt-24 pb-24",children:jsxRuntimeExports.jsx("a",{className:"button right-magnet",href:tt.details.front_url,target:"_blank",rel:"noreferrer",children:et("bpr.form.publication.response.success.button")})})]})}function usePublishModal({onSuccess:tt,resource:et}){const{user:rt,appCode:st}=useEdificeClient(),nt=useToast(),[ot,at]=reactExports.useState((et==null?void 0:et.thumbnail)||"");reactExports.useEffect(()=>{at(et==null?void 0:et.thumbnail)},[et]);const{control:lt,register:ut,watch:ct,setValue:dt,handleSubmit:ht,formState:{errors:ft,isSubmitting:xt,isDirty:vt,isValid:yt}}=useForm({mode:"onChange"}),[Et,bt]=reactExports.useState([]),[wt,St]=reactExports.useState([]),Rt=(Ct,It,jt)=>{let Pt=[...It];const Ot=Pt.findIndex(Ut=>Ut===Ct);It.includes(Ct)?Pt=It.filter((Ut,Nt)=>Nt!==Ot):Pt=[...It,Ct],jt(Pt)};return{control:lt,cover:ot,formState:{errors:ft,isSubmitting:xt,isDirty:vt,isValid:yt},handleDeleteImage:()=>at(""),handlePublish:async Ct=>{const It=rt?rt==null?void 0:rt.userId:"";try{let jt=new Blob;typeof ot=="string"?jt=await odeServices.http().get(ot,{responseType:"blob"}):ot?jt=await odeServices.http().get(URL.createObjectURL(ot),{responseType:"blob"}):et!=null&&et.thumbnail&&(jt=await odeServices.http().get(et==null?void 0:et.thumbnail,{responseType:"blob"}));const Pt=await odeServices.http().get(`/userbook/avatar/${It}?thumbnail=48x48`,{responseType:"blob"}),Ot=await odeServices.http().get(`/directory/user/${It}/attachment-school`,{responseType:"json"}),Ut=e$3[st],Nt={activityType:Et,age:[Ct.ageMin,Ct.ageMax],application:Ut,cover:jt,description:Ct.description,keyWords:Ct.keyWords,language:Ct.language,licence:"CC-BY",resourceId:et==null?void 0:et.assetId,resourceEntId:et==null?void 0:et.assetId,subjectArea:wt,teacherAvatar:Pt,title:Ct.title,userId:It,userStructureName:Ot.name||(rt==null?void 0:rt.structureNames[0])},Ht=await odeServices.resource(st).publish(Nt);Ht.success?nt.success(jsxRuntimeExports.jsx(ToastSuccess,{result:Ht}),{duration:1e4}):Ht.message==="CONTENT_TOO_LARGE"?nt.error(jsxRuntimeExports.jsx(ToastError,{errorMessage:Ht.message})):nt.error(jsxRuntimeExports.jsx(ToastError,{formData:Ct})),tt==null||tt()}catch(jt){console.error(jt),nt.error(jsxRuntimeExports.jsx(ToastError,{formData:Ct}))}},handleSubmit:ht,handleUploadImage:Ct=>at(Ct),register:ut,selectActivities:Ct=>{Rt(Ct,Et,bt)},selectedActivities:Et,selectedSubjectAreas:wt,selectSubjects:Ct=>{Rt(Ct,wt,St)},setValue:dt,watch:ct}}const SvgIconDelete=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.461 3.689a.96.96 0 0 1 .675-.28h3.819a.955.955 0 0 1 .954.955v.954H9.182v-.954c0-.254.1-.496.28-.675m7.357.675v.954h3.818a.955.955 0 0 1 0 1.91h-.954v12.408a2.864 2.864 0 0 1-2.864 2.864H7.273a2.864 2.864 0 0 1-2.864-2.864V7.227h-.954a.955.955 0 1 1 0-1.909h3.818v-.954A2.864 2.864 0 0 1 10.136 1.5h3.819a2.864 2.864 0 0 1 2.863 2.864m-10.5 2.863v12.41a.954.954 0 0 0 .955.954h9.545a.955.955 0 0 0 .955-.955V7.227zm3.818 2.864c.528 0 .955.427.955.955v5.727a.955.955 0 1 1-1.91 0v-5.727c0-.528.428-.955.955-.955m4.773 6.682v-5.727a.955.955 0 0 0-1.909 0v5.727a.955.955 0 1 0 1.91 0",clipRule:"evenodd"})]}),SvgIconEdit=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1.879 3.879A3 3 0 0 1 4 3h7a1 1 0 1 1 0 2H4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-7a1 1 0 1 1 2 0v7a3 3 0 0 1-3 3H4a3 3 0 0 1-3-3V6a3 3 0 0 1 .879-2.121",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 2.879c-.297 0-.583.118-.793.328l-9.304 9.304-.529 2.115 2.115-.529 9.304-9.304A1.121 1.121 0 0 0 20 2.879m-2.207-1.086a3.121 3.121 0 0 1 4.414 4.414l-9.5 9.5a1 1 0 0 1-.464.263l-4 1a1 1 0 0 1-1.213-1.212l1-4a1 1 0 0 1 .263-.465z",clipRule:"evenodd"})]}),ImagePicker=({addButtonLabel:tt="Add image",deleteButtonLabel:et="Delete image",src:rt,className:st,mediaLibraryRef:nt,libraryMedia:ot,app:at,onUploadImage:lt,onDeleteImage:ut})=>{const[ct,dt]=reactExports.useState(rt||"");reactExports.useEffect(()=>{ot&&(dt(ot),lt(ot))},[ot]);const ht=()=>{var vt;(vt=nt.current)==null||vt.show("image")},ft=()=>{dt(""),ut()},xt=clsx("image-input",st);return jsxRuntimeExports.jsxs("div",{id:"image-input",className:xt,children:[jsxRuntimeExports.jsxs("div",{className:"image-input-actions gap-8",children:[jsxRuntimeExports.jsx(IconButton,{"aria-label":tt,color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconEdit,{}),onClick:ht,type:"button",variant:"ghost"}),jsxRuntimeExports.jsx(IconButton,{"aria-label":et,color:"danger",disabled:!ct,icon:jsxRuntimeExports.jsx(SvgIconDelete,{}),onClick:ft,type:"button",variant:"ghost"})]}),ct?jsxRuntimeExports.jsx(Avatar,{alt:"",src:ct,size:"xl"}):jsxRuntimeExports.jsx(AppIcon,{app:at,iconFit:"ratio",size:"160",variant:"rounded"})]})},useResource=(tt,et)=>{const[rt,st]=reactExports.useState(null);return reactExports.useEffect(()=>{if(et===""){console.warn("resourceId must be an assetId and not an empty string");return}(async()=>{try{const nt=await odeServices.resource(tt).searchResource({application:tt,id:et});st(nt)}catch(nt){console.error(nt)}})()},[]),rt},SvgIconApplications=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M1 3c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2zm8 0H3v6h6zm4 0c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2zm8 0h-6v6h6zm-8 12c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2zm8 0h-6v6h6zM1 15c0-1.1.9-2 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2zm8 0H3v6h6z",clipRule:"evenodd"})]}),SvgIconCode=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M17.327 5.76a1 1 0 0 1 1.413.067l5 5.5a1 1 0 0 1 0 1.346l-5 5.5a1 1 0 1 1-1.48-1.346L21.648 12 17.26 7.173a1 1 0 0 1 .067-1.413M6.673 5.76a1 1 0 0 1 .067 1.413L2.35 12l4.389 4.827a1 1 0 0 1-1.48 1.346l-5-5.5a1 1 0 0 1 0-1.346l5-5.5a1 1 0 0 1 1.413-.067M8.979 21.609a1 1 0 0 1-.658-1.252l5.375-17.29a1 1 0 1 1 1.91.594L10.23 20.95a1 1 0 0 1-1.251.658",clipRule:"evenodd"})]}),SvgIconGlobe=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.726 3.29A9.01 9.01 0 0 0 3.055 11H7.05a16.3 16.3 0 0 1 2.676-7.71m4.548 0A16.3 16.3 0 0 1 16.95 11h3.995a9.01 9.01 0 0 0-6.67-7.71m.668 7.71A14.3 14.3 0 0 0 12 3.55 14.3 14.3 0 0 0 9.058 11zm-5.884 2h5.884A14.3 14.3 0 0 1 12 20.45 14.3 14.3 0 0 1 9.058 13M7.05 13H3.055a9.01 9.01 0 0 0 6.67 7.71A16.3 16.3 0 0 1 7.05 13m7.224 7.71A16.3 16.3 0 0 0 16.95 13h3.995a9.01 9.01 0 0 1-6.67 7.71M12 23c6.075 0 11-4.925 11-11S18.075 1 12 1 1 5.925 1 12s4.925 11 11 11",clipRule:"evenodd"})]}),SvgIconMic=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 .5a4.07 4.07 0 0 0-2.812 1.115A3.8 3.8 0 0 0 8 4.364V12a3.8 3.8 0 0 0 1.188 2.748A4.07 4.07 0 0 0 12 15.864a4.07 4.07 0 0 0 2.812-1.116A3.8 3.8 0 0 0 16 12V4.364a3.8 3.8 0 0 0-1.188-2.749A4.07 4.07 0 0 0 12 .5m-1.43 2.562A2.07 2.07 0 0 1 12 2.5c.545 0 1.059.207 1.43.562.371.354.57.823.57 1.302V12a1.8 1.8 0 0 1-.57 1.302 2.07 2.07 0 0 1-1.43.562 2.07 2.07 0 0 1-1.43-.562A1.8 1.8 0 0 1 10 12V4.364a1.8 1.8 0 0 1 .57-1.302M6 10.091a1 1 0 0 0-2 0V12c0 2.053.855 4.011 2.36 5.448A8.13 8.13 0 0 0 11 19.622V21.5H8a1 1 0 1 0 0 2h8a1 1 0 1 0 0-2h-3v-1.878a8.13 8.13 0 0 0 4.64-2.174C19.145 16.011 20 14.053 20 12v-1.91a1 1 0 0 0-2 0V12c0 1.491-.62 2.932-1.74 4.001s-2.646 1.678-4.248 1.68h-.024c-1.602-.002-3.128-.611-4.247-1.68C6.62 14.931 6 13.491 6 12z",clipRule:"evenodd"})]}),SvgIconRecordVideo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-1.936l4.409 1.365A2 2 0 0 0 24 15.519V8.48a2 2 0 0 0-2.591-1.91l-4.41 1.364V6a2 2 0 0 0-2-2zm0 2h13v12H2zm15 7.97V10.03l5-1.548v7.037z",clipRule:"evenodd"})]}),SvgIconSmartphone=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 3a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1zM4 4a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11 18a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1",clipRule:"evenodd"})]}),MediaLibraryContext=reactExports.createContext(null);function useMediaLibraryContext(){const tt=reactExports.useContext(MediaLibraryContext);if(!tt)throw new Error("Innertabs compound components cannot be rendered outside the MediaLibrary component");return tt}const SvgIconPause=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 2h3v16h-3zm10-2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h3a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zm0 2h3v16h-3z",clipRule:"evenodd"})]}),SvgIconRecord=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("circle",{cx:12,cy:12,r:11,fill:"currentColor"})]}),AudioRecorderTimer=({recordState:tt,playState:et,recordTime:rt,audioTime:st,maxDuration:nt})=>jsxRuntimeExports.jsxs("div",{className:"audio-recorder-time my-16 mx-auto",children:[et==="IDLE"&&jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center",children:[tt==="PAUSED"?jsxRuntimeExports.jsx(SvgIconPause,{width:12,height:12,className:"me-8 text-danger"}):jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,className:"me-8 text-danger"}),n$4(tt!=="IDLE"?rt:0)+" / "+n$4(nt)]}),et!=="IDLE"&&jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mx-auto",children:[jsxRuntimeExports.jsx(SvgIconMic,{width:12,height:12,className:"me-8"}),n$4(st*1e3)," /",n$4(rt)]})]}),SvgIconPlayFilled=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M5 3.804c0-1.57 1.728-2.528 3.06-1.696l13.113 8.196a2 2 0 0 1 0 3.392L8.06 21.892C6.728 22.724 5 21.767 5 20.196z"})]}),SvgIconRecordPause=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M23 12c0 6.075-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1s11 4.925 11 11M10 6H8a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1m4 0h2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconRefresh=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{clipPath:"url(#icon-refresh_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.304 21c3.015 0 5.65-1.924 6.838-4.752a.986.986 0 0 1 1.297-.53c.503.216.738.803.524 1.311C19.498 20.522 16.19 23 12.304 23c-4.644 0-8.444-3.522-9.299-8.113L1.86 17.142a.99.99 0 0 1-1.33.449 1 1 0 0 1-.417-1.348L2.51 11.52c.135-.265.376-.457.66-.527a.96.96 0 0 1 .812.169L8.1 14.297c.433.33.515.958.185 1.404a.98.98 0 0 1-1.382.212L4.93 14.41c.65 3.785 3.744 6.59 7.374 6.59m4.794-12.913a.98.98 0 0 0-1.381.211 1.01 1.01 0 0 0 .184 1.405l4.117 3.135a.96.96 0 0 0 .812.169c.284-.07.525-.262.66-.527l2.398-4.723c.252-.496.065-1.1-.418-1.348a.99.99 0 0 0-1.329.449l-1.145 2.255C20.14 4.522 16.34 1 11.696 1 7.81 1 4.505 3.478 3.037 6.97a1.004 1.004 0 0 0 .525 1.312.986.986 0 0 0 1.297-.53C6.046 4.924 8.681 3 11.697 3c3.63 0 6.724 2.805 7.374 6.59z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-refresh_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconRestart=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M17.919 3.15c1.33-.856 3.081.1 3.081 1.682v14.336c0 1.583-1.75 2.538-3.081 1.683L7 13.83V19a2 2 0 1 1-4 0V5a2 2 0 1 1 4 0v5.168z"})]}),SvgIconSave=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 4a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h1v-7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7h1a1 1 0 0 0 1-1V8.414L15.586 4H8v3h7a1 1 0 1 1 0 2H7a1 1 0 0 1-1-1V4zm2-2H5a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V8a1 1 0 0 0-.293-.707l-5-5A1 1 0 0 0 16 2zm1 12v6h8v-6z",clipRule:"evenodd"})]});function useAudioRecorder(tt,et,rt=!1,st="protected",nt="media-library"){var ot;function at(Yt,tr){return{...Yt,...tr.updatedState}}const[{recordState:lt,playState:ut,micStream:ct,micStreamAudioSourceNode:dt,audioWorkletNode:ht,audioContext:ft,encoderWorker:xt,maxDuration:vt,recordTime:yt,isEncoding:Et},bt]=reactExports.useReducer(at,{recordState:"IDLE",isEncoding:!1,playState:"IDLE",recordTime:0,maxDuration:180}),wt=reactExports.useRef(null),St=reactExports.useRef(null),Rt=reactExports.useRef(),Ct=reactExports.useRef(),{t:It}=useTranslation(),{create:jt}=useWorkspaceFile(),Pt=128,Ot=48e3;reactExports.useEffect(()=>{const Yt=new Worker("/infra/public/js/audioEncoder.js");return bt({type:"update",updatedState:{encoderWorker:Yt}}),Yt.postMessage(["init",(ft==null?void 0:ft.sampleRate)||Ot]),()=>{Nt(),Yt.terminate()}},[]);const Ut=Yt=>{var tr,lr;const ur=Yt.data.inputs[0][0];let mr=Yt.data.inputs[0][1];(!mr||mr.filter(yr=>yr!==void 0).length===0)&&(mr=ur),(tr=Rt.current)==null||tr.push(ur),(lr=Ct.current)==null||lr.push(mr)},Nt=reactExports.useCallback(()=>{ct==null||ct.getTracks().forEach(Yt=>Yt.stop()),dt==null||dt.disconnect(),ht==null||ht.port.removeEventListener("message",Ut),ht==null||ht.port.close(),ht==null||ht.disconnect(),ft==null||ft.close()},[ft,ht,ct,dt]),Ht=async()=>{const Yt=await navigator.mediaDevices.getUserMedia({audio:!0}),tr=new AudioContext({sampleRate:Ot}),lr=tr.createMediaStreamSource(Yt);try{await tr.audioWorklet.addModule("/infra/public/js/audio-recorder-processor.js")}catch(mr){console.error(mr)}const ur=new AudioWorkletNode(tr,"audio-recorder-processor");ur.port.addEventListener("message",Ut),bt({type:"update",updatedState:{micStream:Yt,micStreamAudioSourceNode:lr,audioContext:tr,recordTime:0,audioWorkletNode:ur,recordState:"RECORDING",playState:"IDLE"}}),Ct.current=[],Rt.current=[],ur.port.start(),lr.connect(ur),ur.connect(tr.destination)},Lt=reactExports.useCallback(async()=>{St.current&&(St.current.currentTime=0,St.current.pause()),lt==="PAUSED"?(bt({type:"update",updatedState:{recordState:"RECORDING",playState:"IDLE"}}),ft==null||ft.resume(),et==null||et(void 0)):Ht()},[lt,ft,St]),kt=reactExports.useCallback(()=>{bt({type:"update",updatedState:{recordState:"PAUSED",playState:"IDLE",isEncoding:!0}}),ft==null||ft.suspend(),xt&&Rt.current&&Ct.current&&(xt.postMessage(["wav",Ct.current,Rt.current,Ct.current.length*Pt]),xt.onmessage=Yt=>{const tr=window.URL.createObjectURL(Yt.data);bt({type:"update",updatedState:{isEncoding:!1}}),St.current&&(St.current.src=tr),et&&et(tr)})},[ft,xt,et]),$t=reactExports.useCallback(()=>{var Yt;bt({type:"update",updatedState:{playState:"PLAYING"}}),((Yt=St==null?void 0:St.current)!=null&&Yt.currentTime||St.current)&&St.current.play()},[St]),Ft=reactExports.useCallback(()=>{var Yt;(Yt=St==null?void 0:St.current)==null||Yt.pause(),bt({type:"update",updatedState:{playState:"PAUSED"}})},[St]),Gt=reactExports.useCallback(()=>{Nt(),bt({type:"update",updatedState:{playState:"IDLE",recordState:"IDLE"}}),Ct.current=[],Rt.current=[],et&&et(void 0)},[Nt,et]),Mt=reactExports.useCallback(async()=>{var Yt;const tr=(Yt=wt.current)==null?void 0:Yt.value;if(!tr){console.error("Audio name is required");return}return St.current&&(St.current.pause(),St.current.currentTime=0),bt({type:"update",updatedState:{recordState:"SAVING",playState:"IDLE"}}),new Promise((lr,ur)=>{try{xt&&Rt.current&&Ct.current&&(xt.postMessage(["mp3",Ct.current,Rt.current,Ct.current.length*Pt]),xt.onmessage=async mr=>{if(mr.data instanceof Blob){const yr=new File([mr.data],tr,{type:"audio/mp3"}),or=await jt(yr,{application:nt,visibility:st});or&&tt&&tt(or),bt({type:"update",updatedState:{recordState:"SAVED"}}),lr(or)}})}catch(mr){bt({type:"update",updatedState:{playState:"IDLE",recordState:"IDLE"}}),console.error("Error while saving",mr),ur()}})},[lt,tt,Nt]),Vt=reactExports.useCallback(()=>{St!=null&&St.current&&(St.current.pause(),St.current.currentTime=0),bt({type:"update",updatedState:{playState:"IDLE"}})},[St]),Bt=reactExports.useCallback(()=>{bt({type:"update",updatedState:{playState:"PAUSED"}}),St.current&&(St.current.currentTime=0)},[St]);reactExports.useEffect(()=>{if(lt==="RECORDING"&&ft){const Yt=window.setInterval(()=>{bt({type:"update",updatedState:{recordTime:ft.currentTime}}),ft.currentTime>=vt&&(kt(),window.clearInterval(Yt))},100);return()=>window.clearInterval(Yt)}},[ft,kt,vt,lt]);const qt=It(lt==="IDLE"?"bbm.audio.record.start":"bbm.audio.record.resume"),Qt=[{type:"icon",name:"record",visibility:lt==="RECORDING"?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{}),color:"danger",disabled:lt!=="IDLE"&<!=="PAUSED"||yt>=vt,onClick:Lt,"aria-label":qt},tooltip:qt},{type:"icon",name:"recordPause",visibility:lt==="RECORDING"?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordPause,{}),color:"danger",disabled:lt!=="RECORDING",onClick:kt,"aria-label":It("bbm.audio.record.pause")},tooltip:It("bbm.audio.record.pause")},{type:"divider"},{type:"icon",name:"encoding",visibility:Et?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconLoader,{style:{animation:"loading 1s infinite"}}),disabled:!0}},{type:"icon",name:"play",visibility:Et||ut==="PLAYING"?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:lt!=="RECORDED"&<!=="PAUSED"&<!=="SAVED",onClick:$t,"aria-label":It("bbm.audio.play.start")},tooltip:It("bbm.audio.play.start")},{type:"icon",name:"playPause",visibility:!Et&&ut==="PLAYING"?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),onClick:Ft,"aria-label":It("bbm.audio.play.pause")},tooltip:It("bbm.audio.play.pause")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRestart,{}),disabled:ut!=="PLAYING"&&ut!=="PAUSED",onClick:Vt,"aria-label":It("bbm.audio.play.stop")},tooltip:It("bbm.audio.play.stop")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:lt!=="RECORDED"&<!=="PAUSED"&&ut!=="PLAYING"&&ut!=="PAUSED",onClick:Gt,"aria-label":It("bbm.audio.record.reset")},tooltip:It("bbm.audio.record.reset")},{type:"icon",name:"save",visibility:rt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:lt!=="RECORDED"&<!=="PAUSED"&&ut!=="PLAYING"&&ut!=="PAUSED"||lt==="SAVED"||!((ot=wt.current)!=null&&ot.value),onClick:Mt,"aria-label":It("bbm.audio.record.save")},tooltip:It("bbm.audio.record.save")}];return{recordState:lt,playState:ut,audioContext:ft,recordTime:yt*1e3,maxDuration:vt*1e3,audioRef:St,audioNameRef:wt,toolbarItems:Qt,handlePlayEnded:Bt,handleSave:Mt}}const Toolbar=reactExports.forwardRef(({items:tt,variant:et="default",align:rt="space",isBlock:st=!1,ariaControls:nt,className:ot,shouldHideLabelsOnMobile:at=!1},lt)=>{const[ut,ct]=reactExports.useState(0),[dt,ht]=reactExports.useState([]),[ft,xt]=reactExports.useState(),[vt,yt]=reactExports.useState(),Et=reactExports.useRef(),{lg:bt}=useBreakpoint(),wt=clsx("toolbar z-1000 bg-white",ot,{default:et==="default","no-shadow":et==="no-shadow","d-flex":st,"d-inline-flex":!st,"overflow-x-auto":st,"justify-content-start":rt==="left","justify-content-between":rt==="space","justify-content-center":rt==="center","justify-content-end":rt==="right"});reactExports.useEffect(()=>{var Pt;const Ot=(Pt=Et.current)==null?void 0:Pt.querySelectorAll("button"),Ut=[];let Nt=!1;Ot==null||Ot.forEach(Ht=>{Ht.disabled||(Nt||(xt(Ht),Nt=!0),yt(Ht),Ut.push(Ht))}),ht(Ut),ct(tt.findIndex(Ht=>(Ht.type==="button"||Ht.type==="icon")&&!Ht.props.disabled))},[tt]);const St=Pt=>{Pt.target.classList.add("focus")},Rt=Pt=>{Pt.target.classList.remove("focus")},Ct=Pt=>{var Ot,Ut;const Nt=dt.indexOf(Pt.currentTarget);switch(Pt.code){case"ArrowLeft":Pt.currentTarget===ft?vt==null||vt.focus():(Ot=dt[Nt-1])==null||Ot.focus();break;case"ArrowRight":Pt.currentTarget===vt?ft==null||ft.focus():(Ut=dt[Nt+1])==null||Ut.focus();break}},It=Pt=>{var Ot;return typeof Pt.tooltip=="string"?Pt.tooltip:(Ot=Pt.tooltip)==null?void 0:Ot.message},jt=Pt=>{var Ot;return typeof Pt.tooltip!="string"?(Ot=Pt.tooltip)==null?void 0:Ot.position:"top"};return jsxRuntimeExports.jsx("div",{ref:mergeRefs(lt,Et),className:wt,role:"toolbar","aria-label":"Text Formatting","aria-controls":nt,onFocus:St,onBlur:Rt,children:tt.map((Pt,Ot)=>{if(Pt.visibility==="hide")return null;const Ut=at&&!bt;switch(Pt.type){case"divider":return jsxRuntimeExports.jsx("div",{className:"toolbar-divider"},Pt.name??Ot);case"button":return jsxRuntimeExports.jsx(Tooltip,{message:Ut?It(Pt):void 0,placement:jt(Pt),children:reactExports.createElement(Button,{...Pt.props,children:!Ut&&Pt.props.children,"aria-label":Pt.name,key:Pt.name??Ot,color:Pt.props.color||"tertiary",variant:"ghost",size:Pt.props.size||Ut?"sm":"md",tabIndex:Ot===ut?0:-1,onKeyDown:Ct})},Pt.name??Ot);case"icon":return jsxRuntimeExports.jsx(Tooltip,{message:It(Pt),placement:jt(Pt),children:reactExports.createElement(IconButton,{...Pt.props,key:Pt.name??Ot,color:Pt.props.color?Pt.props.color:"tertiary",variant:Pt.props.variant?Pt.props.variant:"ghost",tabIndex:Ot===ut?0:-1,onKeyDown:Ct})},Pt.name??Ot);case"dropdown":return reactExports.createElement(Dropdown,{...Pt.props,key:Pt.name??Ot,extraTriggerKeyDownHandler:Ct,overflow:Pt.overflow});case"primary":return jsxRuntimeExports.jsx(Tooltip,{message:It(Pt),placement:jt(Pt),children:jsxRuntimeExports.jsx(Button,{...Pt.props,variant:"filled",color:"primary",tabIndex:Ot===ut?0:-1,onKeyDown:Ct})},Pt.name??Ot)}return null})})}),AudioRecorder=reactExports.forwardRef(({onSaveSuccess:tt,onRecordUpdated:et,hideSaveAction:rt=!1,visibility:st="protected"},nt)=>{const{recordState:ot,playState:at,recordTime:lt,audioRef:ut,audioNameRef:ct,toolbarItems:dt,maxDuration:ht,handlePlayEnded:ft,handleSave:xt}=useAudioRecorder(tt,et,rt,st,"media-library"),{t:vt}=useTranslation();function yt(){const Rt=new Date;return`${Rt.getFullYear()}-${String(Rt.getMonth()+1).padStart(2,"0")}-${String(Rt.getDate()).padStart(2,"0")} ${String(Rt.getHours()).padStart(2,"0")}h${String(Rt.getMinutes()).padStart(2,"0")} `+vt("bbm.audio.recorder.defaultName")}reactExports.useImperativeHandle(nt,()=>({save:xt}));const[Et,bt]=reactExports.useState(0),wt=clsx({"text-danger":ot==="RECORDING","text-success":at==="PLAYING"}),St=Rt=>{bt(Rt.target.currentTime)};return jsxRuntimeExports.jsxs("div",{className:"audio-recorder m-auto d-flex flex-column",children:[jsxRuntimeExports.jsx(FormControl,{id:"recordName",className:"mb-32",isRequired:!0,isReadOnly:ot==="SAVED"||ot==="SAVING",children:jsxRuntimeExports.jsx(Input,{type:"text",size:"sm",placeholder:vt("bbm.audio.recorder.name"),ref:ct,defaultValue:yt()})}),jsxRuntimeExports.jsx("div",{className:"audio-recorder-icon mx-auto",children:jsxRuntimeExports.jsx(SvgIconMic,{width:64,height:64,className:wt})}),jsxRuntimeExports.jsx(AudioRecorderTimer,{recordState:ot,playState:at,recordTime:lt,audioTime:Et,maxDuration:ht}),jsxRuntimeExports.jsx("audio",{ref:ut,onEnded:ft,onTimeUpdate:St,children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),jsxRuntimeExports.jsx(Toolbar,{items:dt})]})}),Audio=()=>{const{setResult:tt,setPreSuccess:et,visibility:rt}=useMediaLibraryContext(),st=reactExports.useRef(null);return jsxRuntimeExports.jsx(AudioRecorder,{ref:st,onRecordUpdated:nt=>{nt?(tt(nt),et(()=>st.current.save)):tt()},onSaveSuccess:nt=>{nt&&tt(nt)},hideSaveAction:!0,visibility:rt})},ExternalLinker=({link:tt,onChange:et,multiNodeSelected:rt=!1})=>{const{t:st}=useTranslation(),[nt,ot]=reactExports.useState((tt==null?void 0:tt.text)||""),[at,lt]=reactExports.useState((tt==null?void 0:tt.url)||""),[ut,ct]=useToggle(tt?tt.target==="_blank":!0);return reactExports.useEffect(()=>{rt&&tt!=null&&tt.text&&ot(tt.text.slice(0,20)+"...")},[rt,tt]),reactExports.useEffect(()=>{if(!at.length){et==null||et();return}const dt={url:at,text:rt?tt==null?void 0:tt.text:nt||at,target:ut?"_blank":void 0};!s$3.isLocalURL(at)&&!s$3.startWithHttp(at)&&(dt.url="http://"+at),et==null||et(dt)},[nt,at,ut]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill gap-24",children:[jsxRuntimeExports.jsxs(FormControl,{id:"linkText",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:st("bbm.linker.ext.text")}),jsxRuntimeExports.jsx(Input,{type:"text",placeholder:st("bbm.linker.ext.text.placeholder"),size:"md",disabled:rt,value:nt,onChange:dt=>ot(dt.target.value)})]}),jsxRuntimeExports.jsxs(FormControl,{id:"linkUrl",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:st("bbm.linker.ext.url")}),jsxRuntimeExports.jsx(Input,{type:"text",placeholder:st("bbm.linker.ext.url.placeholder"),size:"md",value:at,onChange:dt=>lt(dt.target.value)})]}),jsxRuntimeExports.jsx(Checkbox,{label:st("bbm.linker.open.tab"),onChange:()=>ct(),checked:ut})]})})},ExternalLink=({link:tt,multiNodeSelected:et=!1})=>{const{setResult:rt}=useMediaLibraryContext();return jsxRuntimeExports.jsx(ExternalLinker,{link:tt,onChange:st=>{rt(st)},multiNodeSelected:et})},Embed=({onSuccess:tt})=>{const{t:et}=useTranslation(),[rt,st]=reactExports.useState();function nt(ot){const at=ot.target.value;st(at),at!=null&&at.length?tt(at):tt()}return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill",children:[jsxRuntimeExports.jsx("div",{className:"mb-32",children:et("bbm.embed.description")}),jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconCode,{className:"me-8"}),et("bbm.embed.title")]}),jsxRuntimeExports.jsx(FormControl,{id:"iframeContent",children:jsxRuntimeExports.jsx(TextArea,{size:"md",height:"sm",placeholder:et("bbm.embed.placeholder"),onChange:nt})}),!!(rt!=null&&rt.length)&&jsxRuntimeExports.jsx("div",{className:"embed-preview mt-12",dangerouslySetInnerHTML:{__html:rt}}),!(rt!=null&&rt.length)&&jsxRuntimeExports.jsx("div",{className:"embed-preview mt-12 d-flex align-items-center justify-content-center bg-gray-300 text-black-50 rounded-3",children:jsxRuntimeExports.jsx("strong",{children:et("bbm.embed.preview")})})]})},Iframe=()=>{const{setResult:tt}=useMediaLibraryContext();return jsxRuntimeExports.jsx(Embed,{onSuccess:et=>{et=et==null?void 0:et.replace(/<p /g,"<div ").replace(/\/p>/g,"/div>"),tt(et)}})},SvgIconUsers=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-users_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M19.055 12.803a1 1 0 0 1 1.272-.618c1.128.39 2.061 1.247 2.7 2.351.64 1.106.972 2.435.973 3.782V21a1 1 0 1 1-2 0v-2.681c0-1.03-.258-2.009-.704-2.782-.448-.773-1.034-1.258-1.623-1.462a1 1 0 0 1-.618-1.272M15.187 1.384a1 1 0 0 1 1.036-.962 5.129 5.129 0 0 1 2.11 9.71 1 1 0 1 1-.896-1.788 3.129 3.129 0 0 0-1.288-5.924 1 1 0 0 1-.962-1.036M1.505 15.694C2.481 14.622 3.825 14 5.25 14h8.5c1.424 0 2.769.622 3.744 1.694.974 1.068 1.506 2.498 1.506 3.973V22a1 1 0 1 1-2 0v-2.333c0-1.001-.363-1.945-.984-2.627-.618-.679-1.436-1.04-2.266-1.04h-8.5c-.83 0-1.648.361-2.266 1.04-.621.682-.984 1.626-.984 2.627V22a1 1 0 1 1-2 0v-2.333c0-1.475.533-2.905 1.505-3.974M9.5 3a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M4 6.5a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-users_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),LinkerCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:st=!1,onClick:nt,className:ot})=>{const{fromNow:at}=useDate(),{fromDate:lt}=reactExports.useMemo(()=>({fromDate:at(tt.modifiedAt)}),[at,tt]);return jsxRuntimeExports.jsx(Card,{className:clsx("card-linker shadow-none",ot),isClickable:et,isSelectable:rt,isSelected:st,onClick:nt,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{className:"card-image ps-8 pe-4",children:tt.thumbnail&&tt.thumbnail.length>0?jsxRuntimeExports.jsx(Image$1,{alt:"",height:48,width:48,src:tt.thumbnail,objectFit:"cover",className:"rounded h-full",style:{aspectRatio:1/1}}):jsxRuntimeExports.jsx(AppIcon,{app:tt.application,iconFit:"ratio",size:"48",variant:"rounded"})}),jsxRuntimeExports.jsxs("div",{className:"w-75",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.creatorName})]}),jsxRuntimeExports.jsx("div",{className:"d-none d-md-block text-black-50 ps-4 pe-8",children:jsxRuntimeExports.jsx(Card.Text,{children:lt})}),tt.shared&&jsxRuntimeExports.jsx("div",{className:"ps-4 pe-8",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:"20",height:"20"})})]})})},useResourceSearch=tt=>{const[et,rt]=reactExports.useState([]);reactExports.useEffect(()=>{(async()=>(await SnipletsService.initialize(odeServices,tt),await SnipletsService.registerBehaviours(tt),rt(SnipletsService.resourceProducingApps)))()},[]);const st=reactExports.useCallback(async nt=>{const[ot]=nt.types;return await odeServices.behaviour(tt,ot).loadResources(nt)},[tt]);return{resourceApplications:et,loadResources:st}},illuOneBlog="/assets/js/ode-explorer/illu-empty-search-blog.svg",illuOneCollaborativeWall="/assets/js/ode-explorer/illu-empty-search-collaborativewall.svg",illuOneCommunity="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_149764)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M167.746%20130.552C172.704%20130.552%20176.962%20132.327%20180.519%20135.877C184.076%20139.427%20185.855%20143.677%20185.854%20148.625C185.854%20153.574%20184.076%20157.823%20180.519%20161.373C176.962%20164.923%20172.758%20166.698%20167.908%20166.698C163.057%20166.698%20158.799%20164.923%20155.135%20161.373C151.47%20157.823%20149.692%20153.52%20149.799%20148.464C149.799%20146.528%20150.23%20144.43%20151.093%20142.171L123.768%20122.484C118.487%20127.863%20112.127%20130.552%20104.69%20130.552C97.2522%20130.552%2090.8927%20127.917%2085.6111%20122.646C80.3295%20117.374%2077.6348%20110.974%2077.5271%20103.443C77.5271%20102.475%2077.6887%20101.077%2078.012%2099.2476L56.3468%2092.1477C54.6221%2093.6538%2052.6819%2094.4069%2050.5261%2094.4069C47.9391%2094.4069%2045.7833%2093.5463%2044.0587%2091.825C42.334%2090.1037%2041.4717%2087.9522%2041.4717%2085.3703C41.4717%2082.7884%2042.334%2080.6906%2044.0587%2079.0771C45.7833%2077.4635%2047.9391%2076.6028%2050.5261%2076.4952C52.6819%2076.4952%2054.5143%2077.1944%2056.0234%2078.5928C57.5325%2079.9912%2058.5564%2081.6586%2059.0953%2083.595L80.9224%2090.8565C83.1858%2086.4458%2086.4734%2082.9496%2090.785%2080.3677C95.0966%2077.7858%2099.7315%2076.4948%20104.69%2076.4948C110.295%2076.4948%20115.468%2078.1623%20120.211%2081.4971L152.386%2049.3856C150.661%2046.1582%20149.799%2043.1998%20149.799%2040.5105C149.799%2035.562%20151.577%2031.3127%20155.134%2027.7625C158.691%2024.2123%20162.949%2022.4373%20167.907%2022.4375C172.866%2022.4377%20177.069%2024.2127%20180.518%2027.7625C183.968%2031.3123%20185.746%2035.5616%20185.854%2040.5105C185.962%2045.4593%20184.183%2049.6548%20180.518%2053.0969C176.854%2056.539%20172.596%2058.314%20167.745%2058.4219C164.943%2058.4219%20161.979%2057.5075%20158.853%2055.6788L126.678%2087.9518C130.02%2092.6851%20131.69%2097.8488%20131.69%20103.443C131.69%20107.423%20130.774%20111.35%20128.942%20115.223L156.266%20134.748C159.823%20131.951%20163.65%20130.552%20167.746%20130.552V130.552Z'%20fill='%23A348C0'/%3e%3cg%20filter='url(%23filter0_d_3597_149764)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_149764'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_149764'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_149764'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_149764'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneExercizer="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_148725)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M83.4104%20149.864L112.194%20135.472V111.738L83.4104%20124.138V149.864ZM78.5673%20115.516L108.965%20102.602L78.5673%2089.5493L48.3412%20102.773L78.5673%20115.516ZM160.349%20149.864L189.167%20135.472V111.738L160.384%20124.138L160.349%20149.864ZM155.506%20115.516L185.732%20102.773L155.472%2089.7211L125.074%20102.773L155.506%20115.516ZM121.88%2093.568L150.663%2081.2028V61.3498L121.88%2073.715V93.568ZM117.037%2065.2311L150.114%2051.1141L117.037%2036.8598L83.9256%2051.1141L117.037%2065.2311ZM198.682%20104.113V135.472C198.694%20137.212%20198.231%20138.923%20197.342%20140.418C196.429%20141.946%20195.059%20143.147%20193.426%20143.853L159.8%20160.684C158.476%20161.382%20157.003%20161.746%20155.506%20161.746C154.01%20161.746%20152.536%20161.382%20151.213%20160.684L117.586%20143.853C117.379%20143.822%20117.187%20143.726%20117.037%20143.578C116.881%20143.717%20116.692%20143.812%20116.487%20143.853L82.8608%20160.684C81.5508%20161.417%2080.068%20161.784%2078.5673%20161.748C77.0983%20161.794%2075.6461%20161.425%2074.3769%20160.684L40.7504%20143.853C39.1325%20143.137%2037.7764%20141.937%2036.8691%20140.418C35.9651%20138.922%2035.4568%20137.22%2035.3921%20135.472V104.113C35.3757%20102.237%2035.9395%20100.401%2037.0064%2098.8576C38.051%2097.299%2039.55%2096.0997%2041.2999%2095.4228L73.8617%2081.4433V51.3889C73.8545%2049.5056%2074.3966%2047.6611%2075.4214%2046.0811C76.4463%2044.5011%2077.9095%2043.2541%2079.6321%2042.4928L113.259%2028.1011C114.45%2027.581%20115.737%2027.3125%20117.037%2027.3125C118.337%2027.3125%20119.623%2027.581%20120.815%2028.1011L154.442%2042.4928C156.151%2043.2379%20157.633%2044.4231%20158.735%2045.9276C159.819%2047.5145%20160.383%2049.3988%20160.349%2051.3202V81.3059L192.911%2095.2854C194.661%2095.9623%20196.16%2097.1616%20197.205%2098.7202C198.26%20100.263%20198.779%20102.109%20198.682%20103.975V104.113Z'%20fill='%23A348C0'/%3e%3cg%20filter='url(%23filter0_d_3597_148725)'%3e%3cellipse%20cx='169.707'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.011%20150.405C214.308%20149.703%20213.482%20149.21%20212.605%20148.92C220.41%20139.391%20225.098%20127.21%20225.098%20113.934C225.098%2095.9054%20216.453%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.866%2058.6953C165.678%2058.6953%20161.598%2059.1808%20157.678%2060.0649C152.634%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.366%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.634%20106.855%20114.634%20113.934C114.634%20144.442%20139.359%20169.166%20169.866%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.337%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.714%20185.775C244.113%20183.376%20244.113%20179.492%20241.714%20177.094L241.707%20177.101ZM169.859%20156.891C146.134%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.895%2090.4489C136.482%2086.4924%20139.707%2082.9924%20143.424%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.627%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_148725'%20x='108.634'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_148725'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_148725'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_148725'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneFormulaire="/assets/js/ode-explorer/illu-empty-search-formulaire.svg",illuOneForum="/assets/js/ode-explorer/illu-empty-search-forum.svg",illuOneHomeworks="/assets/js/ode-explorer/illu-empty-search-homeworks.svg",illuOneMagneto="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_149757)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M127.341%20120.329V89.4164C127.341%2077.1185%20122.455%2065.3242%20113.759%2056.6282C105.063%2047.9322%2093.2691%2043.0469%2080.9711%2043.0469C68.6731%2043.0469%2056.8789%2047.9322%2048.1829%2056.6282C39.4869%2065.3242%2034.6016%2077.1185%2034.6016%2089.4164L34.6016%20120.329H55.2103V89.4164C55.2103%2082.5842%2057.9243%2076.0319%2062.7554%2071.2008C67.5865%2066.3696%2074.1389%2063.6556%2080.9711%2063.6556C84.3541%2063.6556%2087.7039%2064.3219%2090.8294%2065.6165C93.9548%2066.9111%2096.7947%2068.8086%2099.1868%2071.2007C101.579%2073.5929%20103.476%2076.4327%20104.771%2079.5582C106.066%2082.6836%20106.732%2086.0335%20106.732%2089.4164V120.329M55.2103%20130.634H34.6016V146.09H55.2103M127.341%20130.634H106.732V146.09H127.341'%20fill='%23F1CA00'/%3e%3cpath%20d='M199.472%20120.329V89.4164C199.472%2083.3271%20198.272%2077.2974%20195.942%2071.6716C193.612%2066.0457%20190.196%2060.934%20185.89%2056.6282C181.584%2052.3224%20176.473%2048.9068%20170.847%2046.5765C165.221%2044.2463%20159.191%2043.0469%20153.102%2043.0469C140.804%2043.0469%20129.01%2047.9322%20120.314%2056.6282C111.618%2065.3242%20106.732%2077.1185%20106.732%2089.4164V120.329H127.341V89.4164C127.341%2082.5842%20130.055%2076.0319%20134.886%2071.2008C139.717%2066.3696%20146.27%2063.6556%20153.102%2063.6556C156.485%2063.6556%20159.835%2064.3219%20162.96%2065.6165C166.086%2066.9111%20168.926%2068.8086%20171.318%2071.2007C173.71%2073.5929%20175.607%2076.4327%20176.902%2079.5582C178.197%2082.6836%20178.863%2086.0335%20178.863%2089.4164V120.329M127.341%20130.634H106.732V146.09H127.341M199.472%20130.634H178.863V146.09H199.472'%20fill='%23F1CA00'/%3e%3cg%20filter='url(%23filter0_d_3597_149757)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_149757'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_149757'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_149757'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_149757'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuOneWiki="/assets/js/ode-explorer/illu-empty-search-wiki.svg",illuOneEmpty="/assets/js/ode-explorer/illu-empty-search.svg",illuNeoBlog="/assets/js/ode-explorer/illu-empty-search-blog2.svg",illuNeoCollaborativeWall="/assets/js/ode-explorer/illu-empty-search-collaborativewall2.svg",illuNeoCommunity="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_141038)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M167.746%20130.552C172.704%20130.552%20176.962%20132.327%20180.519%20135.877C184.076%20139.427%20185.855%20143.677%20185.854%20148.625C185.854%20153.574%20184.076%20157.823%20180.519%20161.373C176.962%20164.923%20172.758%20166.698%20167.908%20166.698C163.057%20166.698%20158.799%20164.923%20155.135%20161.373C151.47%20157.823%20149.692%20153.52%20149.799%20148.464C149.799%20146.528%20150.23%20144.43%20151.093%20142.171L123.768%20122.484C118.487%20127.863%20112.127%20130.552%20104.69%20130.552C97.2522%20130.552%2090.8927%20127.917%2085.6111%20122.646C80.3295%20117.374%2077.6348%20110.974%2077.5271%20103.443C77.5271%20102.475%2077.6887%20101.077%2078.012%2099.2476L56.3468%2092.1477C54.6221%2093.6538%2052.6819%2094.4069%2050.5261%2094.4069C47.9391%2094.4069%2045.7833%2093.5463%2044.0587%2091.825C42.334%2090.1037%2041.4717%2087.9522%2041.4717%2085.3703C41.4717%2082.7884%2042.334%2080.6906%2044.0587%2079.0771C45.7833%2077.4635%2047.9391%2076.6028%2050.5261%2076.4952C52.6819%2076.4952%2054.5143%2077.1944%2056.0234%2078.5928C57.5325%2079.9912%2058.5564%2081.6586%2059.0953%2083.595L80.9224%2090.8565C83.1858%2086.4458%2086.4734%2082.9496%2090.785%2080.3677C95.0966%2077.7858%2099.7315%2076.4948%20104.69%2076.4948C110.295%2076.4948%20115.468%2078.1623%20120.211%2081.4971L152.386%2049.3856C150.661%2046.1582%20149.799%2043.1998%20149.799%2040.5105C149.799%2035.562%20151.577%2031.3127%20155.134%2027.7625C158.691%2024.2123%20162.949%2022.4373%20167.907%2022.4375C172.866%2022.4377%20177.069%2024.2127%20180.518%2027.7625C183.968%2031.3123%20185.746%2035.5616%20185.854%2040.5105C185.962%2045.4593%20184.183%2049.6548%20180.518%2053.0969C176.854%2056.539%20172.596%2058.314%20167.745%2058.4219C164.943%2058.4219%20161.979%2057.5075%20158.853%2055.6788L126.678%2087.9518C130.02%2092.6851%20131.69%2097.8488%20131.69%20103.443C131.69%20107.423%20130.774%20111.35%20128.942%20115.223L156.266%20134.748C159.823%20131.951%20163.65%20130.552%20167.746%20130.552V130.552Z'%20fill='%23823AA1'/%3e%3cg%20filter='url(%23filter0_d_3597_141038)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_141038'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_141038'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_141038'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_141038'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoExercizer="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_148718)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M83.4104%20149.864L112.194%20135.472V111.738L83.4104%20124.138V149.864ZM78.5673%20115.516L108.965%20102.602L78.5673%2089.5493L48.3412%20102.773L78.5673%20115.516ZM160.349%20149.864L189.167%20135.472V111.738L160.384%20124.138L160.349%20149.864ZM155.506%20115.516L185.732%20102.773L155.472%2089.7211L125.074%20102.773L155.506%20115.516ZM121.88%2093.568L150.663%2081.2028V61.3498L121.88%2073.715V93.568ZM117.037%2065.2311L150.114%2051.1141L117.037%2036.8598L83.9256%2051.1141L117.037%2065.2311ZM198.682%20104.113V135.472C198.694%20137.212%20198.231%20138.923%20197.342%20140.418C196.429%20141.946%20195.059%20143.147%20193.426%20143.853L159.8%20160.684C158.476%20161.382%20157.003%20161.746%20155.506%20161.746C154.01%20161.746%20152.536%20161.382%20151.213%20160.684L117.586%20143.853C117.379%20143.822%20117.187%20143.726%20117.037%20143.578C116.881%20143.717%20116.692%20143.812%20116.487%20143.853L82.8608%20160.684C81.5508%20161.417%2080.068%20161.784%2078.5673%20161.748C77.0983%20161.794%2075.6461%20161.425%2074.3769%20160.684L40.7504%20143.853C39.1325%20143.137%2037.7764%20141.937%2036.8691%20140.418C35.9651%20138.922%2035.4568%20137.22%2035.3921%20135.472V104.113C35.3757%20102.237%2035.9395%20100.401%2037.0064%2098.8576C38.051%2097.299%2039.55%2096.0997%2041.2999%2095.4228L73.8617%2081.4433V51.3889C73.8545%2049.5056%2074.3966%2047.6611%2075.4214%2046.0811C76.4463%2044.5011%2077.9095%2043.2541%2079.6321%2042.4928L113.259%2028.1011C114.45%2027.581%20115.737%2027.3125%20117.037%2027.3125C118.337%2027.3125%20119.623%2027.581%20120.815%2028.1011L154.442%2042.4928C156.151%2043.2379%20157.633%2044.4231%20158.735%2045.9276C159.819%2047.5145%20160.383%2049.3988%20160.349%2051.3202V81.3059L192.911%2095.2854C194.661%2095.9623%20196.16%2097.1616%20197.205%2098.7202C198.26%20100.263%20198.779%20102.109%20198.682%20103.975V104.113Z'%20fill='%23823AA1'/%3e%3cg%20filter='url(%23filter0_d_3597_148718)'%3e%3cellipse%20cx='169.707'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.011%20150.405C214.308%20149.703%20213.482%20149.21%20212.605%20148.92C220.41%20139.391%20225.098%20127.21%20225.098%20113.934C225.098%2095.9054%20216.453%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.866%2058.6953C165.678%2058.6953%20161.598%2059.1808%20157.678%2060.0649C152.634%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.366%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.634%20106.855%20114.634%20113.934C114.634%20144.442%20139.359%20169.166%20169.866%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.337%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.714%20185.775C244.113%20183.376%20244.113%20179.492%20241.714%20177.094L241.707%20177.101ZM169.859%20156.891C146.134%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.895%2090.4489C136.482%2086.4924%20139.707%2082.9924%20143.424%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.627%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_148718'%20x='108.634'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_148718'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_148718'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_148718'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoFormulaire="/assets/js/ode-explorer/illu-empty-search-formulaire2.svg",illuNeoForum="/assets/js/ode-explorer/illu-empty-search-forum2.svg",illuNeoHomeworks="/assets/js/ode-explorer/illu-empty-search-homeworks2.svg",illuNeoMagneto="data:image/svg+xml,%3csvg%20width='250'%20height='195'%20viewBox='0%200%20250%20195'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_3597_141030)'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3cpath%20d='M127.341%20120.329V89.4164C127.341%2077.1185%20122.455%2065.3242%20113.759%2056.6282C105.063%2047.9322%2093.2691%2043.0469%2080.9711%2043.0469C68.6731%2043.0469%2056.8789%2047.9322%2048.1829%2056.6282C39.4869%2065.3242%2034.6016%2077.1185%2034.6016%2089.4164L34.6016%20120.329H55.2103V89.4164C55.2103%2082.5842%2057.9243%2076.0319%2062.7554%2071.2008C67.5865%2066.3696%2074.1389%2063.6556%2080.9711%2063.6556C84.3541%2063.6556%2087.7039%2064.3219%2090.8294%2065.6165C93.9548%2066.9111%2096.7947%2068.8086%2099.1868%2071.2007C101.579%2073.5929%20103.476%2076.4327%20104.771%2079.5582C106.066%2082.6836%20106.732%2086.0335%20106.732%2089.4164V120.329M55.2103%20130.634H34.6016V146.09H55.2103M127.341%20130.634H106.732V146.09H127.341'%20fill='%23ECBE30'/%3e%3cpath%20d='M199.472%20120.329V89.4164C199.472%2083.3271%20198.272%2077.2974%20195.942%2071.6716C193.612%2066.0457%20190.196%2060.934%20185.89%2056.6282C181.584%2052.3224%20176.473%2048.9068%20170.847%2046.5765C165.221%2044.2463%20159.191%2043.0469%20153.102%2043.0469C140.804%2043.0469%20129.01%2047.9322%20120.314%2056.6282C111.618%2065.3242%20106.732%2077.1185%20106.732%2089.4164V120.329H127.341V89.4164C127.341%2082.5842%20130.055%2076.0319%20134.886%2071.2008C139.717%2066.3696%20146.27%2063.6556%20153.102%2063.6556C156.485%2063.6556%20159.835%2064.3219%20162.96%2065.6165C166.086%2066.9111%20168.926%2068.8086%20171.318%2071.2007C173.71%2073.5929%20175.607%2076.4327%20176.902%2079.5582C178.197%2082.6836%20178.863%2086.0335%20178.863%2089.4164V120.329M127.341%20130.634H106.732V146.09H127.341M199.472%20130.634H178.863V146.09H199.472'%20fill='%23ECBE30'/%3e%3cg%20filter='url(%23filter0_d_3597_141030)'%3e%3cellipse%20cx='169.708'%20cy='113.765'%20rx='44.2029'%20ry='44.2029'%20fill='white'%20fill-opacity='0.85'/%3e%3cpath%20d='M241.707%20177.101L215.012%20150.405C214.309%20149.703%20213.483%20149.21%20212.606%20148.92C220.41%20139.391%20225.099%20127.21%20225.099%20113.934C225.099%2095.9054%20216.454%2079.891%20203.091%2069.8112C198.323%2066.217%20192.946%2063.3837%20187.149%2061.4707C181.707%2059.6808%20175.903%2058.6953%20169.867%2058.6953C165.678%2058.6953%20161.599%2059.1808%20157.678%2060.0649C152.635%2061.2026%20147.852%2063.0142%20143.432%2065.4272C135.272%2069.8837%20128.374%2076.3402%20123.367%2084.1373C121.403%2087.1953%20119.736%2090.4489%20118.403%2093.8765C115.975%20100.094%20114.635%20106.855%20114.635%20113.934C114.635%20144.442%20139.359%20169.166%20169.867%20169.166C183.142%20169.166%20195.323%20164.485%20204.852%20156.674C205.142%20157.55%20205.642%20158.384%20206.338%20159.079L233.033%20185.775C235.432%20188.174%20239.316%20188.174%20241.715%20185.775C244.113%20183.376%20244.113%20179.492%20241.715%20177.094L241.707%20177.101ZM169.859%20156.891C146.135%20156.891%20126.903%20137.659%20126.903%20113.934C126.903%20109.203%20127.678%20104.652%20129.091%20100.391C130.265%2096.8475%20131.888%2093.5141%20133.896%2090.4489C136.483%2086.4924%20139.707%2082.9924%20143.425%2080.0866C147.62%2076.804%20152.432%2074.2895%20157.671%2072.746C161.533%2071.6011%20165.628%2070.9779%20169.859%2070.9779C193.584%2070.9779%20212.816%2090.2098%20212.816%20113.934C212.816%20137.659%20193.584%20156.891%20169.859%20156.891Z'%20fill='%23B9E3F8'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_d_3597_141030'%20x='108.635'%20y='54.6953'%20width='140.879'%20height='140.875'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='out'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200.15%200'/%3e%3cfeBlend%20mode='normal'%20in2='BackgroundImageFix'%20result='effect1_dropShadow_3597_141030'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='effect1_dropShadow_3597_141030'%20result='shape'/%3e%3c/filter%3e%3cclipPath%20id='clip0_3597_141030'%3e%3crect%20width='250'%20height='194.203'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",illuNeoWiki="/assets/js/ode-explorer/illu-empty-search-wiki2.svg",illuNeoEmpty="/assets/js/ode-explorer/illu-empty-search2.svg",emptyScreenMapping={one:{blog:illuOneBlog,wiki:illuOneWiki,empty:illuOneEmpty,"collaborative-wall":illuOneCollaborativeWall,community:illuOneCommunity,exercizer:illuOneExercizer,formulaire:illuOneFormulaire,forum:illuOneForum,homeworks:illuOneHomeworks,magneto:illuOneMagneto},neo:{blog:illuNeoBlog,wiki:illuNeoWiki,empty:illuNeoEmpty,"collaborative-wall":illuNeoCollaborativeWall,community:illuNeoCommunity,exercizer:illuNeoExercizer,formulaire:illuNeoFormulaire,forum:illuNeoForum,homeworks:illuNeoHomeworks,magneto:illuNeoMagneto}},InternalLinker=({appCode:tt,defaultAppCode:et,defaultResourceId:rt,onChange:st,onSelect:nt,multiple:ot=!0,resourceList:at,applicationList:lt,showApplicationSelector:ut=!0,resourceFilter:ct})=>{const{t:dt}=useTranslation(),{theme:ht}=useEdificeTheme(),{resourceApplications:ft,loadResources:xt}=useResourceSearch(tt),[vt,yt]=reactExports.useState(),[Et,bt]=reactExports.useState(),[wt,St]=reactExports.useState(),Rt=useDebounce(wt||"",500),[Ct,It]=reactExports.useState([]),jt=reactExports.useCallback((Mt,Vt)=>{var Bt,qt,Qt;if(!Vt)return!0;const Yt=(Vt==null?void 0:Vt.toLowerCase())||"";return((Bt=Mt.name)==null?void 0:Bt.toLowerCase().includes(Yt))||((qt=Mt.creatorName)==null?void 0:qt.toLowerCase().includes(Yt))||((Qt=Mt.description)==null?void 0:Qt.toLowerCase().includes(Yt))},[]),Pt=reactExports.useCallback(Mt=>Mt.sort((Vt,Bt)=>Vt.modifiedAt<Bt.modifiedAt?1:-1),[]),Ot=reactExports.useCallback(Mt=>{async function Vt(){if(at){let Bt=at.filter(qt=>jt(qt,Mt));ct&&(Bt=Bt.filter(ct)),It(Pt(Bt));return}else if(Et)try{let Bt=(await xt({application:Et.application,search:Mt,types:[Et.application],filters:{},pagination:{startIdx:0,pageSize:300}})).filter(qt=>jt(qt,Mt));ct&&(Bt=Bt.filter(ct)),It(Pt(Bt));return}catch{}It([])}Vt()},[xt,Et,jt,Pt,at,ct]),[Ut,Nt]=reactExports.useState([]),Ht=Mt=>{st==null||st(Mt),bt(Mt)},Lt=Mt=>{const Vt=Mt.target.value;St(Vt.toString())},kt=reactExports.useCallback(Mt=>{Ot(wt),Mt.stopPropagation(),Mt.preventDefault()},[Ot,wt]),$t=reactExports.useCallback(Mt=>Ut.findIndex(Vt=>Vt.assetId===Mt),[Ut]),Ft=reactExports.useCallback(Mt=>{Nt(ot?Vt=>[...Vt,Mt]:[Mt])},[Nt,ot]),Gt=reactExports.useCallback(Mt=>{const Vt=$t(Mt.assetId);Vt<0?Ft(Mt):Nt(Ut.filter((Bt,qt)=>qt!==Vt))},[$t,Ft,Ut]);return reactExports.useEffect(()=>{(async()=>{if(lt){yt(lt.sort((qt,Qt)=>qt.displayName.localeCompare(Qt.displayName)));return}const Mt=ft.map(qt=>odeServices.session().getWebApp(qt)),Vt=await Promise.all(Mt),Bt=ft.map((qt,Qt)=>{var Yt;let tr=((Yt=Vt[Qt])==null?void 0:Yt.displayName)??qt;return qt==="exercizer"?tr="bbm.linker.int.app.exercizer":qt==="formulaire"&&(tr="bbm.linker.int.app.forms"),{application:qt,displayName:dt(tr??qt),icon:jsxRuntimeExports.jsx(AppIcon,{app:Vt[Qt],size:"24"})}}).sort((qt,Qt)=>qt.displayName.localeCompare(Qt.displayName));yt(Bt)})()},[ft,dt,lt]),reactExports.useEffect(()=>{Ot(Rt)},[Ot,Rt]),reactExports.useEffect(()=>{nt==null||nt(Ut)},[Ut]),reactExports.useEffect(()=>{var Mt;const Vt=et??((lt==null?void 0:lt.length)===1&&((Mt=lt==null?void 0:lt[0])==null?void 0:Mt.application));if(Vt){const Bt=vt==null?void 0:vt.find(qt=>Vt===qt.application);bt(Bt),Ot("")}},[vt,et]),reactExports.useEffect(()=>{if(rt&&$t(rt)<0){const Mt=Ct==null?void 0:Ct.find(Vt=>rt===Vt.assetId);Mt&&Ft(Mt)}},[Ct]),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill overflow-hidden",children:[jsxRuntimeExports.jsxs("div",{className:"search d-flex bg-light rounded-top border border-bottom-0",children:[ut&&jsxRuntimeExports.jsx("div",{className:"flex-shrink-1 px-8 py-12 border-end",children:jsxRuntimeExports.jsxs(Dropdown,{overflow:!0,children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{icon:jsxRuntimeExports.jsx("div",{className:"pe-8",children:(Et==null?void 0:Et.icon)||jsxRuntimeExports.jsx(SvgIconApplications,{})}),label:dt((Et==null?void 0:Et.displayName)||"bbm.linker.int.choose"),variant:"ghost",size:"md"}),jsxRuntimeExports.jsx(Dropdown.Menu,{children:vt==null?void 0:vt.map(Mt=>jsxRuntimeExports.jsx(Dropdown.Item,{icon:Mt.icon,onClick:()=>Ht(Mt),children:Mt.displayName},Mt.application))})]})}),jsxRuntimeExports.jsx("div",{className:"flex-grow-1 align-self-center",children:jsxRuntimeExports.jsx("form",{className:"gap-16 d-flex w-100 align-items-center px-16 py-8",onSubmit:kt,children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,placeholder:dt("search"),size:"lg",className:"w-100",disabled:!Et,onChange:Lt})})})]}),jsxRuntimeExports.jsxs("div",{className:"internal-linker flex-grow-1 w-100 rounded-bottom border gap-0 overflow-auto",children:[Et&&Ct&&Ct.length>0&&jsxRuntimeExports.jsx("div",{children:Ct.map(Mt=>{const Vt=Ut.findIndex(Bt=>Bt.assetId===Mt.assetId)>=0;return jsxRuntimeExports.jsx(LinkerCard,{doc:Mt,isSelected:Vt,onClick:()=>Gt(Mt)},Mt.path)})}),Et&&Ct&&Ct.length<=0&&jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-16",children:jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:emptyScreenMapping[(ht==null?void 0:ht.bootstrapVersion)??"one"][Et==null?void 0:Et.application],text:dt("bbm.linker.int.notfound"),className:"mt-16"})}),!Et&&jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-center mt-32",children:jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:emptyScreenMapping[(ht==null?void 0:ht.bootstrapVersion)??"one"].empty,text:dt("bbm.linker.int.empty"),className:"mt-32"})})]})]})},InternalLink=({target:tt,resourceId:et,appPrefix:rt})=>{const{t:st}=useTranslation(),{setResult:nt,setResultCounter:ot,appCode:at,multiple:lt}=useMediaLibraryContext(),[ut,ct]=useToggle(tt==="_blank"),[dt,ht]=reactExports.useState([]),ft=xt=>{ht(xt)};return reactExports.useEffect(()=>{nt({target:ut?"_blank":void 0,resources:dt}),dt&&dt.length?ot(dt.length):ot(void 0)},[ut,dt]),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill gap-16 overflow-hidden",children:[jsxRuntimeExports.jsx(InternalLinker,{appCode:at,defaultAppCode:rt,defaultResourceId:et,onSelect:ft,multiple:lt}),jsxRuntimeExports.jsx(Checkbox,{className:"align-items-center",checked:ut,label:st("bbm.linker.open.tab"),onChange:ct})]})},SvgIconReset=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.583 7.313 3.976 3.87a.996.996 0 1 0-1.96.346l1.012 5.747a.996.996 0 0 0 1.153.809l5.743-1.014a.997.997 0 0 0-.346-1.962l-3.3.582a7.754 7.754 0 0 1 8.399-4.254 7.76 7.76 0 0 1 .78 15.064 7.745 7.745 0 0 1-8.912-3.56.995.995 0 1 0-1.724.997 9.744 9.744 0 0 0 11.201 4.474 9.74 9.74 0 0 0 5.19-3.718 9.756 9.756 0 0 0-.625-12.055A9.74 9.74 0 0 0 8.73 3.117a9.75 9.75 0 0 0-4.147 4.196",clipRule:"evenodd"})]}),SvgIconWand=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10 0a1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 1 1 0 2 1 1 0 0 0-1 1 1 1 0 1 1-2 0 1 1 0 0 0-1-1 1 1 0 0 1 0-2 1 1 0 0 0 1-1 1 1 0 0 1 1-1m9.914 2a2 2 0 0 0-2.828 0L1 18.086a2 2 0 0 0 0 2.828L3.086 23a2 2 0 0 0 2.828 0L22 6.914a2 2 0 0 0 0-2.828zm-3.75 3.75L18.5 3.414 20.586 5.5 18.25 7.836zM14.75 7.164 2.414 19.5 4.5 21.586 16.836 9.25zM21 13a1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 1 1 0 0 1 1-1 1 1 0 1 0 0-2 1 1 0 0 1-1-1",clipRule:"evenodd"})]}),UploadCard=({item:tt,status:et="idle",isClickable:rt=!1,isSelectable:st=!1,onDelete:nt,onEdit:ot,onRetry:at})=>{const{t:lt}=useTranslation(),{src:ut,name:ct,info:dt}=tt,ht=et==="idle",ft=et==="loading",xt=et==="success",vt=dt==null?void 0:dt.type.startsWith("image"),yt={text:"",context:null,image:jsxRuntimeExports.jsx("img",{src:commonPlaceholder,alt:"",width:"48",height:"48"})},Et={error:{text:jsxRuntimeExports.jsx("strong",{children:jsxRuntimeExports.jsx("small",{className:"text-danger caption",children:lt("tiptap.upload.error")})}),context:jsxRuntimeExports.jsx(Button,{leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),variant:"ghost",color:"tertiary",onClick:at,children:lt("tiptap.upload.retry")}),image:jsxRuntimeExports.jsx(Image$1,{alt:"",src:`${commonPlaceholder}/common/image-status-error.svg`,objectFit:"cover"})},idle:yt,loading:{text:"",context:jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.loading"),placement:"top",children:jsxRuntimeExports.jsx(Loading,{isLoading:!0,loadingPosition:"left",className:"text-secondary"})}),image:yt.image},warning:yt,success:{text:jsxRuntimeExports.jsxs("em",{children:[dt==null?void 0:dt.type," ",(dt==null?void 0:dt.weight)&&`- ${dt.weight}`]}),context:jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.loaded"),placement:"top",children:jsxRuntimeExports.jsx(SvgIconSuccessOutline,{className:"text-success"})}),image:jsxRuntimeExports.jsx(Image$1,{alt:"",src:ut??"",width:"48",objectFit:"cover",className:"rounded",style:{aspectRatio:1/1}})},unknown:yt},bt=()=>vt&&jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.edit"),placement:"top",children:jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconWand,{}),variant:"ghost","aria-label":lt("tiptap.tooltip.upload.loading"),disabled:ft||!xt,onClick:ot,color:"secondary"})});return jsxRuntimeExports.jsx(Card,{isClickable:rt,isSelectable:st,className:"card-upload",children:jsxRuntimeExports.jsxs(Card.Body,{children:[jsxRuntimeExports.jsx("div",{className:"card-image",children:Et[et].image}),jsxRuntimeExports.jsxs("div",{className:"text-truncate",children:[jsxRuntimeExports.jsx(Card.Text,{children:ct}),jsxRuntimeExports.jsx(Card.Text,{className:"caption",children:Et[et].text})]}),!ht&&jsxRuntimeExports.jsx("div",{className:"ms-auto",children:jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-12",children:[Et[et].context,!ht&&jsxRuntimeExports.jsx("div",{className:"vr"}),bt(),jsxRuntimeExports.jsx(Tooltip,{message:lt("tiptap.tooltip.upload.delete"),placement:"top",children:jsxRuntimeExports.jsx(IconButton,{icon:jsxRuntimeExports.jsx(SvgIconClose,{}),variant:"ghost","aria-label":lt("tiptap.tooltip.upload.delete"),color:"tertiary",onClick:nt})})]})})]})})};var module={exports:{}},ENV=(tt=>(tt[tt.WEBGL_LEGACY=0]="WEBGL_LEGACY",tt[tt.WEBGL=1]="WEBGL",tt[tt.WEBGL2=2]="WEBGL2",tt))(ENV||{}),RENDERER_TYPE=(tt=>(tt[tt.UNKNOWN=0]="UNKNOWN",tt[tt.WEBGL=1]="WEBGL",tt[tt.CANVAS=2]="CANVAS",tt))(RENDERER_TYPE||{}),BUFFER_BITS=(tt=>(tt[tt.COLOR=16384]="COLOR",tt[tt.DEPTH=256]="DEPTH",tt[tt.STENCIL=1024]="STENCIL",tt))(BUFFER_BITS||{}),BLEND_MODES=(tt=>(tt[tt.NORMAL=0]="NORMAL",tt[tt.ADD=1]="ADD",tt[tt.MULTIPLY=2]="MULTIPLY",tt[tt.SCREEN=3]="SCREEN",tt[tt.OVERLAY=4]="OVERLAY",tt[tt.DARKEN=5]="DARKEN",tt[tt.LIGHTEN=6]="LIGHTEN",tt[tt.COLOR_DODGE=7]="COLOR_DODGE",tt[tt.COLOR_BURN=8]="COLOR_BURN",tt[tt.HARD_LIGHT=9]="HARD_LIGHT",tt[tt.SOFT_LIGHT=10]="SOFT_LIGHT",tt[tt.DIFFERENCE=11]="DIFFERENCE",tt[tt.EXCLUSION=12]="EXCLUSION",tt[tt.HUE=13]="HUE",tt[tt.SATURATION=14]="SATURATION",tt[tt.COLOR=15]="COLOR",tt[tt.LUMINOSITY=16]="LUMINOSITY",tt[tt.NORMAL_NPM=17]="NORMAL_NPM",tt[tt.ADD_NPM=18]="ADD_NPM",tt[tt.SCREEN_NPM=19]="SCREEN_NPM",tt[tt.NONE=20]="NONE",tt[tt.SRC_OVER=0]="SRC_OVER",tt[tt.SRC_IN=21]="SRC_IN",tt[tt.SRC_OUT=22]="SRC_OUT",tt[tt.SRC_ATOP=23]="SRC_ATOP",tt[tt.DST_OVER=24]="DST_OVER",tt[tt.DST_IN=25]="DST_IN",tt[tt.DST_OUT=26]="DST_OUT",tt[tt.DST_ATOP=27]="DST_ATOP",tt[tt.ERASE=26]="ERASE",tt[tt.SUBTRACT=28]="SUBTRACT",tt[tt.XOR=29]="XOR",tt))(BLEND_MODES||{}),DRAW_MODES=(tt=>(tt[tt.POINTS=0]="POINTS",tt[tt.LINES=1]="LINES",tt[tt.LINE_LOOP=2]="LINE_LOOP",tt[tt.LINE_STRIP=3]="LINE_STRIP",tt[tt.TRIANGLES=4]="TRIANGLES",tt[tt.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",tt[tt.TRIANGLE_FAN=6]="TRIANGLE_FAN",tt))(DRAW_MODES||{}),FORMATS=(tt=>(tt[tt.RGBA=6408]="RGBA",tt[tt.RGB=6407]="RGB",tt[tt.RG=33319]="RG",tt[tt.RED=6403]="RED",tt[tt.RGBA_INTEGER=36249]="RGBA_INTEGER",tt[tt.RGB_INTEGER=36248]="RGB_INTEGER",tt[tt.RG_INTEGER=33320]="RG_INTEGER",tt[tt.RED_INTEGER=36244]="RED_INTEGER",tt[tt.ALPHA=6406]="ALPHA",tt[tt.LUMINANCE=6409]="LUMINANCE",tt[tt.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",tt[tt.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",tt[tt.DEPTH_STENCIL=34041]="DEPTH_STENCIL",tt))(FORMATS||{}),TARGETS=(tt=>(tt[tt.TEXTURE_2D=3553]="TEXTURE_2D",tt[tt.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",tt[tt.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",tt[tt.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",tt[tt.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",tt))(TARGETS||{}),TYPES=(tt=>(tt[tt.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",tt[tt.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",tt[tt.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",tt[tt.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",tt[tt.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",tt[tt.UNSIGNED_INT=5125]="UNSIGNED_INT",tt[tt.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",tt[tt.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",tt[tt.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",tt[tt.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",tt[tt.BYTE=5120]="BYTE",tt[tt.SHORT=5122]="SHORT",tt[tt.INT=5124]="INT",tt[tt.FLOAT=5126]="FLOAT",tt[tt.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",tt[tt.HALF_FLOAT=36193]="HALF_FLOAT",tt))(TYPES||{}),SAMPLER_TYPES=(tt=>(tt[tt.FLOAT=0]="FLOAT",tt[tt.INT=1]="INT",tt[tt.UINT=2]="UINT",tt))(SAMPLER_TYPES||{}),SCALE_MODES=(tt=>(tt[tt.NEAREST=0]="NEAREST",tt[tt.LINEAR=1]="LINEAR",tt))(SCALE_MODES||{}),WRAP_MODES=(tt=>(tt[tt.CLAMP=33071]="CLAMP",tt[tt.REPEAT=10497]="REPEAT",tt[tt.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",tt))(WRAP_MODES||{}),MIPMAP_MODES=(tt=>(tt[tt.OFF=0]="OFF",tt[tt.POW2=1]="POW2",tt[tt.ON=2]="ON",tt[tt.ON_MANUAL=3]="ON_MANUAL",tt))(MIPMAP_MODES||{}),ALPHA_MODES=(tt=>(tt[tt.NPM=0]="NPM",tt[tt.UNPACK=1]="UNPACK",tt[tt.PMA=2]="PMA",tt[tt.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",tt[tt.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",tt[tt.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",tt))(ALPHA_MODES||{}),CLEAR_MODES=(tt=>(tt[tt.NO=0]="NO",tt[tt.YES=1]="YES",tt[tt.AUTO=2]="AUTO",tt[tt.BLEND=0]="BLEND",tt[tt.CLEAR=1]="CLEAR",tt[tt.BLIT=2]="BLIT",tt))(CLEAR_MODES||{}),GC_MODES=(tt=>(tt[tt.AUTO=0]="AUTO",tt[tt.MANUAL=1]="MANUAL",tt))(GC_MODES||{}),PRECISION=(tt=>(tt.LOW="lowp",tt.MEDIUM="mediump",tt.HIGH="highp",tt))(PRECISION||{}),MASK_TYPES=(tt=>(tt[tt.NONE=0]="NONE",tt[tt.SCISSOR=1]="SCISSOR",tt[tt.STENCIL=2]="STENCIL",tt[tt.SPRITE=3]="SPRITE",tt[tt.COLOR=4]="COLOR",tt))(MASK_TYPES||{}),MSAA_QUALITY=(tt=>(tt[tt.NONE=0]="NONE",tt[tt.LOW=2]="LOW",tt[tt.MEDIUM=4]="MEDIUM",tt[tt.HIGH=8]="HIGH",tt))(MSAA_QUALITY||{}),BUFFER_TYPE=(tt=>(tt[tt.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",tt[tt.ARRAY_BUFFER=34962]="ARRAY_BUFFER",tt[tt.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",tt))(BUFFER_TYPE||{});const BrowserAdapter={createCanvas:(tt,et)=>{const rt=document.createElement("canvas");return rt.width=tt,rt.height=et,rt},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(tt,et)=>fetch(tt,et),parseXML:tt=>new DOMParser().parseFromString(tt,"text/xml")},settings={ADAPTER:BrowserAdapter,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var appleIphone=/iPhone/i,appleIpod=/iPod/i,appleTablet=/iPad/i,appleUniversal=/\biOS-universal(?:.+)Mac\b/i,androidPhone=/\bAndroid(?:.+)Mobile\b/i,androidTablet=/Android/i,amazonPhone=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,amazonTablet=/Silk/i,windowsPhone=/Windows Phone/i,windowsTablet=/\bWindows(?:.+)ARM\b/i,otherBlackBerry=/BlackBerry/i,otherBlackBerry10=/BB10/i,otherOpera=/Opera Mini/i,otherChrome=/\b(CriOS|Chrome)(?:.+)Mobile/i,otherFirefox=/Mobile(?:.+)Firefox\b/i,isAppleTabletOnIos13=function(tt){return typeof tt<"u"&&tt.platform==="MacIntel"&&typeof tt.maxTouchPoints=="number"&&tt.maxTouchPoints>1&&typeof MSStream>"u"};function createMatch(tt){return function(et){return et.test(tt)}}function isMobile$1(tt){var et={userAgent:"",platform:"",maxTouchPoints:0};!tt&&typeof navigator<"u"?et={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof tt=="string"?et.userAgent=tt:tt&&tt.userAgent&&(et={userAgent:tt.userAgent,platform:tt.platform,maxTouchPoints:tt.maxTouchPoints||0});var rt=et.userAgent,st=rt.split("[FBAN");typeof st[1]<"u"&&(rt=st[0]),st=rt.split("Twitter"),typeof st[1]<"u"&&(rt=st[0]);var nt=createMatch(rt),ot={apple:{phone:nt(appleIphone)&&!nt(windowsPhone),ipod:nt(appleIpod),tablet:!nt(appleIphone)&&(nt(appleTablet)||isAppleTabletOnIos13(et))&&!nt(windowsPhone),universal:nt(appleUniversal),device:(nt(appleIphone)||nt(appleIpod)||nt(appleTablet)||nt(appleUniversal)||isAppleTabletOnIos13(et))&&!nt(windowsPhone)},amazon:{phone:nt(amazonPhone),tablet:!nt(amazonPhone)&&nt(amazonTablet),device:nt(amazonPhone)||nt(amazonTablet)},android:{phone:!nt(windowsPhone)&&nt(amazonPhone)||!nt(windowsPhone)&&nt(androidPhone),tablet:!nt(windowsPhone)&&!nt(amazonPhone)&&!nt(androidPhone)&&(nt(amazonTablet)||nt(androidTablet)),device:!nt(windowsPhone)&&(nt(amazonPhone)||nt(amazonTablet)||nt(androidPhone)||nt(androidTablet))||nt(/\bokhttp\b/i)},windows:{phone:nt(windowsPhone),tablet:nt(windowsTablet),device:nt(windowsPhone)||nt(windowsTablet)},other:{blackberry:nt(otherBlackBerry),blackberry10:nt(otherBlackBerry10),opera:nt(otherOpera),firefox:nt(otherFirefox),chrome:nt(otherChrome),device:nt(otherBlackBerry)||nt(otherBlackBerry10)||nt(otherOpera)||nt(otherFirefox)||nt(otherChrome)},any:!1,phone:!1,tablet:!1};return ot.any=ot.apple.device||ot.android.device||ot.windows.device||ot.other.device,ot.phone=ot.apple.phone||ot.android.phone||ot.windows.phone,ot.tablet=ot.apple.tablet||ot.android.tablet||ot.windows.tablet,ot}const isMobileCall=isMobile$1.default??isMobile$1,isMobile=isMobileCall(globalThis.navigator);settings.RETINA_PREFIX=/@([0-9\.]+)x/;settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var eventemitter3={exports:{}};(function(tt){var et=Object.prototype.hasOwnProperty,rt="~";function st(){}Object.create&&(st.prototype=Object.create(null),new st().__proto__||(rt=!1));function nt(ut,ct,dt){this.fn=ut,this.context=ct,this.once=dt||!1}function ot(ut,ct,dt,ht,ft){if(typeof dt!="function")throw new TypeError("The listener must be a function");var xt=new nt(dt,ht||ut,ft),vt=rt?rt+ct:ct;return ut._events[vt]?ut._events[vt].fn?ut._events[vt]=[ut._events[vt],xt]:ut._events[vt].push(xt):(ut._events[vt]=xt,ut._eventsCount++),ut}function at(ut,ct){--ut._eventsCount===0?ut._events=new st:delete ut._events[ct]}function lt(){this._events=new st,this._eventsCount=0}lt.prototype.eventNames=function(){var ct=[],dt,ht;if(this._eventsCount===0)return ct;for(ht in dt=this._events)et.call(dt,ht)&&ct.push(rt?ht.slice(1):ht);return Object.getOwnPropertySymbols?ct.concat(Object.getOwnPropertySymbols(dt)):ct},lt.prototype.listeners=function(ct){var dt=rt?rt+ct:ct,ht=this._events[dt];if(!ht)return[];if(ht.fn)return[ht.fn];for(var ft=0,xt=ht.length,vt=new Array(xt);ft<xt;ft++)vt[ft]=ht[ft].fn;return vt},lt.prototype.listenerCount=function(ct){var dt=rt?rt+ct:ct,ht=this._events[dt];return ht?ht.fn?1:ht.length:0},lt.prototype.emit=function(ct,dt,ht,ft,xt,vt){var yt=rt?rt+ct:ct;if(!this._events[yt])return!1;var Et=this._events[yt],bt=arguments.length,wt,St;if(Et.fn){switch(Et.once&&this.removeListener(ct,Et.fn,void 0,!0),bt){case 1:return Et.fn.call(Et.context),!0;case 2:return Et.fn.call(Et.context,dt),!0;case 3:return Et.fn.call(Et.context,dt,ht),!0;case 4:return Et.fn.call(Et.context,dt,ht,ft),!0;case 5:return Et.fn.call(Et.context,dt,ht,ft,xt),!0;case 6:return Et.fn.call(Et.context,dt,ht,ft,xt,vt),!0}for(St=1,wt=new Array(bt-1);St<bt;St++)wt[St-1]=arguments[St];Et.fn.apply(Et.context,wt)}else{var Rt=Et.length,Ct;for(St=0;St<Rt;St++)switch(Et[St].once&&this.removeListener(ct,Et[St].fn,void 0,!0),bt){case 1:Et[St].fn.call(Et[St].context);break;case 2:Et[St].fn.call(Et[St].context,dt);break;case 3:Et[St].fn.call(Et[St].context,dt,ht);break;case 4:Et[St].fn.call(Et[St].context,dt,ht,ft);break;default:if(!wt)for(Ct=1,wt=new Array(bt-1);Ct<bt;Ct++)wt[Ct-1]=arguments[Ct];Et[St].fn.apply(Et[St].context,wt)}}return!0},lt.prototype.on=function(ct,dt,ht){return ot(this,ct,dt,ht,!1)},lt.prototype.once=function(ct,dt,ht){return ot(this,ct,dt,ht,!0)},lt.prototype.removeListener=function(ct,dt,ht,ft){var xt=rt?rt+ct:ct;if(!this._events[xt])return this;if(!dt)return at(this,xt),this;var vt=this._events[xt];if(vt.fn)vt.fn===dt&&(!ft||vt.once)&&(!ht||vt.context===ht)&&at(this,xt);else{for(var yt=0,Et=[],bt=vt.length;yt<bt;yt++)(vt[yt].fn!==dt||ft&&!vt[yt].once||ht&&vt[yt].context!==ht)&&Et.push(vt[yt]);Et.length?this._events[xt]=Et.length===1?Et[0]:Et:at(this,xt)}return this},lt.prototype.removeAllListeners=function(ct){var dt;return ct?(dt=rt?rt+ct:ct,this._events[dt]&&at(this,dt)):(this._events=new st,this._eventsCount=0),this},lt.prototype.off=lt.prototype.removeListener,lt.prototype.addListener=lt.prototype.on,lt.prefixed=rt,lt.EventEmitter=lt,tt.exports=lt})(eventemitter3);var eventemitter3Exports=eventemitter3.exports;const EventEmitter=getDefaultExportFromCjs(eventemitter3Exports);var earcut$2={exports:{}};earcut$2.exports=earcut;earcut$2.exports.default=earcut;function earcut(tt,et,rt){rt=rt||2;var st=et&&et.length,nt=st?et[0]*rt:tt.length,ot=linkedList(tt,0,nt,rt,!0),at=[];if(!ot||ot.next===ot.prev)return at;var lt,ut,ct,dt,ht,ft,xt;if(st&&(ot=eliminateHoles(tt,et,ot,rt)),tt.length>80*rt){lt=ct=tt[0],ut=dt=tt[1];for(var vt=rt;vt<nt;vt+=rt)ht=tt[vt],ft=tt[vt+1],ht<lt&&(lt=ht),ft<ut&&(ut=ft),ht>ct&&(ct=ht),ft>dt&&(dt=ft);xt=Math.max(ct-lt,dt-ut),xt=xt!==0?32767/xt:0}return earcutLinked(ot,at,rt,lt,ut,xt,0),at}function linkedList(tt,et,rt,st,nt){var ot,at;if(nt===signedArea(tt,et,rt,st)>0)for(ot=et;ot<rt;ot+=st)at=insertNode(ot,tt[ot],tt[ot+1],at);else for(ot=rt-st;ot>=et;ot-=st)at=insertNode(ot,tt[ot],tt[ot+1],at);return at&&equals(at,at.next)&&(removeNode(at),at=at.next),at}function filterPoints(tt,et){if(!tt)return tt;et||(et=tt);var rt=tt,st;do if(st=!1,!rt.steiner&&(equals(rt,rt.next)||area(rt.prev,rt,rt.next)===0)){if(removeNode(rt),rt=et=rt.prev,rt===rt.next)break;st=!0}else rt=rt.next;while(st||rt!==et);return et}function earcutLinked(tt,et,rt,st,nt,ot,at){if(tt){!at&&ot&&indexCurve(tt,st,nt,ot);for(var lt=tt,ut,ct;tt.prev!==tt.next;){if(ut=tt.prev,ct=tt.next,ot?isEarHashed(tt,st,nt,ot):isEar(tt)){et.push(ut.i/rt|0),et.push(tt.i/rt|0),et.push(ct.i/rt|0),removeNode(tt),tt=ct.next,lt=ct.next;continue}if(tt=ct,tt===lt){at?at===1?(tt=cureLocalIntersections(filterPoints(tt),et,rt),earcutLinked(tt,et,rt,st,nt,ot,2)):at===2&&splitEarcut(tt,et,rt,st,nt,ot):earcutLinked(filterPoints(tt),et,rt,st,nt,ot,1);break}}}}function isEar(tt){var et=tt.prev,rt=tt,st=tt.next;if(area(et,rt,st)>=0)return!1;for(var nt=et.x,ot=rt.x,at=st.x,lt=et.y,ut=rt.y,ct=st.y,dt=nt<ot?nt<at?nt:at:ot<at?ot:at,ht=lt<ut?lt<ct?lt:ct:ut<ct?ut:ct,ft=nt>ot?nt>at?nt:at:ot>at?ot:at,xt=lt>ut?lt>ct?lt:ct:ut>ct?ut:ct,vt=st.next;vt!==et;){if(vt.x>=dt&&vt.x<=ft&&vt.y>=ht&&vt.y<=xt&&pointInTriangle(nt,lt,ot,ut,at,ct,vt.x,vt.y)&&area(vt.prev,vt,vt.next)>=0)return!1;vt=vt.next}return!0}function isEarHashed(tt,et,rt,st){var nt=tt.prev,ot=tt,at=tt.next;if(area(nt,ot,at)>=0)return!1;for(var lt=nt.x,ut=ot.x,ct=at.x,dt=nt.y,ht=ot.y,ft=at.y,xt=lt<ut?lt<ct?lt:ct:ut<ct?ut:ct,vt=dt<ht?dt<ft?dt:ft:ht<ft?ht:ft,yt=lt>ut?lt>ct?lt:ct:ut>ct?ut:ct,Et=dt>ht?dt>ft?dt:ft:ht>ft?ht:ft,bt=zOrder(xt,vt,et,rt,st),wt=zOrder(yt,Et,et,rt,st),St=tt.prevZ,Rt=tt.nextZ;St&&St.z>=bt&&Rt&&Rt.z<=wt;){if(St.x>=xt&&St.x<=yt&&St.y>=vt&&St.y<=Et&&St!==nt&&St!==at&&pointInTriangle(lt,dt,ut,ht,ct,ft,St.x,St.y)&&area(St.prev,St,St.next)>=0||(St=St.prevZ,Rt.x>=xt&&Rt.x<=yt&&Rt.y>=vt&&Rt.y<=Et&&Rt!==nt&&Rt!==at&&pointInTriangle(lt,dt,ut,ht,ct,ft,Rt.x,Rt.y)&&area(Rt.prev,Rt,Rt.next)>=0))return!1;Rt=Rt.nextZ}for(;St&&St.z>=bt;){if(St.x>=xt&&St.x<=yt&&St.y>=vt&&St.y<=Et&&St!==nt&&St!==at&&pointInTriangle(lt,dt,ut,ht,ct,ft,St.x,St.y)&&area(St.prev,St,St.next)>=0)return!1;St=St.prevZ}for(;Rt&&Rt.z<=wt;){if(Rt.x>=xt&&Rt.x<=yt&&Rt.y>=vt&&Rt.y<=Et&&Rt!==nt&&Rt!==at&&pointInTriangle(lt,dt,ut,ht,ct,ft,Rt.x,Rt.y)&&area(Rt.prev,Rt,Rt.next)>=0)return!1;Rt=Rt.nextZ}return!0}function cureLocalIntersections(tt,et,rt){var st=tt;do{var nt=st.prev,ot=st.next.next;!equals(nt,ot)&&intersects(nt,st,st.next,ot)&&locallyInside(nt,ot)&&locallyInside(ot,nt)&&(et.push(nt.i/rt|0),et.push(st.i/rt|0),et.push(ot.i/rt|0),removeNode(st),removeNode(st.next),st=tt=ot),st=st.next}while(st!==tt);return filterPoints(st)}function splitEarcut(tt,et,rt,st,nt,ot){var at=tt;do{for(var lt=at.next.next;lt!==at.prev;){if(at.i!==lt.i&&isValidDiagonal(at,lt)){var ut=splitPolygon(at,lt);at=filterPoints(at,at.next),ut=filterPoints(ut,ut.next),earcutLinked(at,et,rt,st,nt,ot,0),earcutLinked(ut,et,rt,st,nt,ot,0);return}lt=lt.next}at=at.next}while(at!==tt)}function eliminateHoles(tt,et,rt,st){var nt=[],ot,at,lt,ut,ct;for(ot=0,at=et.length;ot<at;ot++)lt=et[ot]*st,ut=ot<at-1?et[ot+1]*st:tt.length,ct=linkedList(tt,lt,ut,st,!1),ct===ct.next&&(ct.steiner=!0),nt.push(getLeftmost(ct));for(nt.sort(compareX),ot=0;ot<nt.length;ot++)rt=eliminateHole(nt[ot],rt);return rt}function compareX(tt,et){return tt.x-et.x}function eliminateHole(tt,et){var rt=findHoleBridge(tt,et);if(!rt)return et;var st=splitPolygon(rt,tt);return filterPoints(st,st.next),filterPoints(rt,rt.next)}function findHoleBridge(tt,et){var rt=et,st=tt.x,nt=tt.y,ot=-1/0,at;do{if(nt<=rt.y&&nt>=rt.next.y&&rt.next.y!==rt.y){var lt=rt.x+(nt-rt.y)*(rt.next.x-rt.x)/(rt.next.y-rt.y);if(lt<=st&<>ot&&(ot=lt,at=rt.x<rt.next.x?rt:rt.next,lt===st))return at}rt=rt.next}while(rt!==et);if(!at)return null;var ut=at,ct=at.x,dt=at.y,ht=1/0,ft;rt=at;do st>=rt.x&&rt.x>=ct&&st!==rt.x&&pointInTriangle(nt<dt?st:ot,nt,ct,dt,nt<dt?ot:st,nt,rt.x,rt.y)&&(ft=Math.abs(nt-rt.y)/(st-rt.x),locallyInside(rt,tt)&&(ft<ht||ft===ht&&(rt.x>at.x||rt.x===at.x&§orContainsSector(at,rt)))&&(at=rt,ht=ft)),rt=rt.next;while(rt!==ut);return at}function sectorContainsSector(tt,et){return area(tt.prev,tt,et.prev)<0&&area(et.next,tt,tt.next)<0}function indexCurve(tt,et,rt,st){var nt=tt;do nt.z===0&&(nt.z=zOrder(nt.x,nt.y,et,rt,st)),nt.prevZ=nt.prev,nt.nextZ=nt.next,nt=nt.next;while(nt!==tt);nt.prevZ.nextZ=null,nt.prevZ=null,sortLinked(nt)}function sortLinked(tt){var et,rt,st,nt,ot,at,lt,ut,ct=1;do{for(rt=tt,tt=null,ot=null,at=0;rt;){for(at++,st=rt,lt=0,et=0;et<ct&&(lt++,st=st.nextZ,!!st);et++);for(ut=ct;lt>0||ut>0&&st;)lt!==0&&(ut===0||!st||rt.z<=st.z)?(nt=rt,rt=rt.nextZ,lt--):(nt=st,st=st.nextZ,ut--),ot?ot.nextZ=nt:tt=nt,nt.prevZ=ot,ot=nt;rt=st}ot.nextZ=null,ct*=2}while(at>1);return tt}function zOrder(tt,et,rt,st,nt){return tt=(tt-rt)*nt|0,et=(et-st)*nt|0,tt=(tt|tt<<8)&16711935,tt=(tt|tt<<4)&252645135,tt=(tt|tt<<2)&858993459,tt=(tt|tt<<1)&1431655765,et=(et|et<<8)&16711935,et=(et|et<<4)&252645135,et=(et|et<<2)&858993459,et=(et|et<<1)&1431655765,tt|et<<1}function getLeftmost(tt){var et=tt,rt=tt;do(et.x<rt.x||et.x===rt.x&&et.y<rt.y)&&(rt=et),et=et.next;while(et!==tt);return rt}function pointInTriangle(tt,et,rt,st,nt,ot,at,lt){return(nt-at)*(et-lt)>=(tt-at)*(ot-lt)&&(tt-at)*(st-lt)>=(rt-at)*(et-lt)&&(rt-at)*(ot-lt)>=(nt-at)*(st-lt)}function isValidDiagonal(tt,et){return tt.next.i!==et.i&&tt.prev.i!==et.i&&!intersectsPolygon(tt,et)&&(locallyInside(tt,et)&&locallyInside(et,tt)&&middleInside(tt,et)&&(area(tt.prev,tt,et.prev)||area(tt,et.prev,et))||equals(tt,et)&&area(tt.prev,tt,tt.next)>0&&area(et.prev,et,et.next)>0)}function area(tt,et,rt){return(et.y-tt.y)*(rt.x-et.x)-(et.x-tt.x)*(rt.y-et.y)}function equals(tt,et){return tt.x===et.x&&tt.y===et.y}function intersects(tt,et,rt,st){var nt=sign$3(area(tt,et,rt)),ot=sign$3(area(tt,et,st)),at=sign$3(area(rt,st,tt)),lt=sign$3(area(rt,st,et));return!!(nt!==ot&&at!==lt||nt===0&&onSegment(tt,rt,et)||ot===0&&onSegment(tt,st,et)||at===0&&onSegment(rt,tt,st)||lt===0&&onSegment(rt,et,st))}function onSegment(tt,et,rt){return et.x<=Math.max(tt.x,rt.x)&&et.x>=Math.min(tt.x,rt.x)&&et.y<=Math.max(tt.y,rt.y)&&et.y>=Math.min(tt.y,rt.y)}function sign$3(tt){return tt>0?1:tt<0?-1:0}function intersectsPolygon(tt,et){var rt=tt;do{if(rt.i!==tt.i&&rt.next.i!==tt.i&&rt.i!==et.i&&rt.next.i!==et.i&&intersects(rt,rt.next,tt,et))return!0;rt=rt.next}while(rt!==tt);return!1}function locallyInside(tt,et){return area(tt.prev,tt,tt.next)<0?area(tt,et,tt.next)>=0&&area(tt,tt.prev,et)>=0:area(tt,et,tt.prev)<0||area(tt,tt.next,et)<0}function middleInside(tt,et){var rt=tt,st=!1,nt=(tt.x+et.x)/2,ot=(tt.y+et.y)/2;do rt.y>ot!=rt.next.y>ot&&rt.next.y!==rt.y&&nt<(rt.next.x-rt.x)*(ot-rt.y)/(rt.next.y-rt.y)+rt.x&&(st=!st),rt=rt.next;while(rt!==tt);return st}function splitPolygon(tt,et){var rt=new Node$2(tt.i,tt.x,tt.y),st=new Node$2(et.i,et.x,et.y),nt=tt.next,ot=et.prev;return tt.next=et,et.prev=tt,rt.next=nt,nt.prev=rt,st.next=rt,rt.prev=st,ot.next=st,st.prev=ot,st}function insertNode(tt,et,rt,st){var nt=new Node$2(tt,et,rt);return st?(nt.next=st.next,nt.prev=st,st.next.prev=nt,st.next=nt):(nt.prev=nt,nt.next=nt),nt}function removeNode(tt){tt.next.prev=tt.prev,tt.prev.next=tt.next,tt.prevZ&&(tt.prevZ.nextZ=tt.nextZ),tt.nextZ&&(tt.nextZ.prevZ=tt.prevZ)}function Node$2(tt,et,rt){this.i=tt,this.x=et,this.y=rt,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}earcut.deviation=function(tt,et,rt,st){var nt=et&&et.length,ot=nt?et[0]*rt:tt.length,at=Math.abs(signedArea(tt,0,ot,rt));if(nt)for(var lt=0,ut=et.length;lt<ut;lt++){var ct=et[lt]*rt,dt=lt<ut-1?et[lt+1]*rt:tt.length;at-=Math.abs(signedArea(tt,ct,dt,rt))}var ht=0;for(lt=0;lt<st.length;lt+=3){var ft=st[lt]*rt,xt=st[lt+1]*rt,vt=st[lt+2]*rt;ht+=Math.abs((tt[ft]-tt[vt])*(tt[xt+1]-tt[ft+1])-(tt[ft]-tt[xt])*(tt[vt+1]-tt[ft+1]))}return at===0&&ht===0?0:Math.abs((ht-at)/at)};function signedArea(tt,et,rt,st){for(var nt=0,ot=et,at=rt-st;ot<rt;ot+=st)nt+=(tt[at]-tt[ot])*(tt[ot+1]+tt[at+1]),at=ot;return nt}earcut.flatten=function(tt){for(var et=tt[0][0].length,rt={vertices:[],holes:[],dimensions:et},st=0,nt=0;nt<tt.length;nt++){for(var ot=0;ot<tt[nt].length;ot++)for(var at=0;at<et;at++)rt.vertices.push(tt[nt][ot][at]);nt>0&&(st+=tt[nt-1].length,rt.holes.push(st))}return rt};var earcutExports=earcut$2.exports;const earcut$1=getDefaultExportFromCjs(earcutExports);var punycode$1={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */punycode$1.exports;(function(tt,et){(function(rt){var st=et&&!et.nodeType&&et,nt=tt&&!tt.nodeType&&tt,ot=typeof commonjsGlobal=="object"&&commonjsGlobal;(ot.global===ot||ot.window===ot||ot.self===ot)&&(rt=ot);var at,lt=2147483647,ut=36,ct=1,dt=26,ht=38,ft=700,xt=72,vt=128,yt="-",Et=/^xn--/,bt=/[^\x20-\x7E]/,wt=/[\x2E\u3002\uFF0E\uFF61]/g,St={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Rt=ut-ct,Ct=Math.floor,It=String.fromCharCode,jt;function Pt(Bt){throw new RangeError(St[Bt])}function Ot(Bt,qt){for(var Qt=Bt.length,Yt=[];Qt--;)Yt[Qt]=qt(Bt[Qt]);return Yt}function Ut(Bt,qt){var Qt=Bt.split("@"),Yt="";Qt.length>1&&(Yt=Qt[0]+"@",Bt=Qt[1]),Bt=Bt.replace(wt,".");var tr=Bt.split("."),lr=Ot(tr,qt).join(".");return Yt+lr}function Nt(Bt){for(var qt=[],Qt=0,Yt=Bt.length,tr,lr;Qt<Yt;)tr=Bt.charCodeAt(Qt++),tr>=55296&&tr<=56319&&Qt<Yt?(lr=Bt.charCodeAt(Qt++),(lr&64512)==56320?qt.push(((tr&1023)<<10)+(lr&1023)+65536):(qt.push(tr),Qt--)):qt.push(tr);return qt}function Ht(Bt){return Ot(Bt,function(qt){var Qt="";return qt>65535&&(qt-=65536,Qt+=It(qt>>>10&1023|55296),qt=56320|qt&1023),Qt+=It(qt),Qt}).join("")}function Lt(Bt){return Bt-48<10?Bt-22:Bt-65<26?Bt-65:Bt-97<26?Bt-97:ut}function kt(Bt,qt){return Bt+22+75*(Bt<26)-((qt!=0)<<5)}function $t(Bt,qt,Qt){var Yt=0;for(Bt=Qt?Ct(Bt/ft):Bt>>1,Bt+=Ct(Bt/qt);Bt>Rt*dt>>1;Yt+=ut)Bt=Ct(Bt/Rt);return Ct(Yt+(Rt+1)*Bt/(Bt+ht))}function Ft(Bt){var qt=[],Qt=Bt.length,Yt,tr=0,lr=vt,ur=xt,mr,yr,or,hr,pr,_r,Ar,Hr,Ur;for(mr=Bt.lastIndexOf(yt),mr<0&&(mr=0),yr=0;yr<mr;++yr)Bt.charCodeAt(yr)>=128&&Pt("not-basic"),qt.push(Bt.charCodeAt(yr));for(or=mr>0?mr+1:0;or<Qt;){for(hr=tr,pr=1,_r=ut;or>=Qt&&Pt("invalid-input"),Ar=Lt(Bt.charCodeAt(or++)),(Ar>=ut||Ar>Ct((lt-tr)/pr))&&Pt("overflow"),tr+=Ar*pr,Hr=_r<=ur?ct:_r>=ur+dt?dt:_r-ur,!(Ar<Hr);_r+=ut)Ur=ut-Hr,pr>Ct(lt/Ur)&&Pt("overflow"),pr*=Ur;Yt=qt.length+1,ur=$t(tr-hr,Yt,hr==0),Ct(tr/Yt)>lt-lr&&Pt("overflow"),lr+=Ct(tr/Yt),tr%=Yt,qt.splice(tr++,0,lr)}return Ht(qt)}function Gt(Bt){var qt,Qt,Yt,tr,lr,ur,mr,yr,or,hr,pr,_r=[],Ar,Hr,Ur,os;for(Bt=Nt(Bt),Ar=Bt.length,qt=vt,Qt=0,lr=xt,ur=0;ur<Ar;++ur)pr=Bt[ur],pr<128&&_r.push(It(pr));for(Yt=tr=_r.length,tr&&_r.push(yt);Yt<Ar;){for(mr=lt,ur=0;ur<Ar;++ur)pr=Bt[ur],pr>=qt&&pr<mr&&(mr=pr);for(Hr=Yt+1,mr-qt>Ct((lt-Qt)/Hr)&&Pt("overflow"),Qt+=(mr-qt)*Hr,qt=mr,ur=0;ur<Ar;++ur)if(pr=Bt[ur],pr<qt&&++Qt>lt&&Pt("overflow"),pr==qt){for(yr=Qt,or=ut;hr=or<=lr?ct:or>=lr+dt?dt:or-lr,!(yr<hr);or+=ut)os=yr-hr,Ur=ut-hr,_r.push(It(kt(hr+os%Ur,0))),yr=Ct(os/Ur);_r.push(It(kt(yr,0))),lr=$t(Qt,Hr,Yt==tr),Qt=0,++Yt}++Qt,++qt}return _r.join("")}function Mt(Bt){return Ut(Bt,function(qt){return Et.test(qt)?Ft(qt.slice(4).toLowerCase()):qt})}function Vt(Bt){return Ut(Bt,function(qt){return bt.test(qt)?"xn--"+Gt(qt):qt})}if(at={version:"1.4.1",ucs2:{decode:Nt,encode:Ht},decode:Ft,encode:Gt,toASCII:Vt,toUnicode:Mt},st&&nt)if(tt.exports==st)nt.exports=at;else for(jt in at)at.hasOwnProperty(jt)&&(st[jt]=at[jt]);else rt.punycode=at})(commonjsGlobal)})(punycode$1,punycode$1.exports);var punycodeExports=punycode$1.exports,type=TypeError;const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$0$1=getAugmentedNamespace(__viteBrowserExternal$1);var hasMap=typeof Map=="function"&&Map.prototype,mapSizeDescriptor=Object.getOwnPropertyDescriptor&&hasMap?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,mapSize$1=hasMap&&mapSizeDescriptor&&typeof mapSizeDescriptor.get=="function"?mapSizeDescriptor.get:null,mapForEach=hasMap&&Map.prototype.forEach,hasSet=typeof Set=="function"&&Set.prototype,setSizeDescriptor=Object.getOwnPropertyDescriptor&&hasSet?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,setSize=hasSet&&setSizeDescriptor&&typeof setSizeDescriptor.get=="function"?setSizeDescriptor.get:null,setForEach=hasSet&&Set.prototype.forEach,hasWeakMap=typeof WeakMap=="function"&&WeakMap.prototype,weakMapHas=hasWeakMap?WeakMap.prototype.has:null,hasWeakSet=typeof WeakSet=="function"&&WeakSet.prototype,weakSetHas=hasWeakSet?WeakSet.prototype.has:null,hasWeakRef=typeof WeakRef=="function"&&WeakRef.prototype,weakRefDeref=hasWeakRef?WeakRef.prototype.deref:null,booleanValueOf=Boolean.prototype.valueOf,objectToString=Object.prototype.toString,functionToString=Function.prototype.toString,$match=String.prototype.match,$slice=String.prototype.slice,$replace$1=String.prototype.replace,$toUpperCase=String.prototype.toUpperCase,$toLowerCase=String.prototype.toLowerCase,$test=RegExp.prototype.test,$concat$1=Array.prototype.concat,$join=Array.prototype.join,$arrSlice=Array.prototype.slice,$floor=Math.floor,bigIntValueOf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,gOPS=Object.getOwnPropertySymbols,symToString=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,hasShammedSymbols=typeof Symbol=="function"&&typeof Symbol.iterator=="object",toStringTag=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===hasShammedSymbols||!0)?Symbol.toStringTag:null,isEnumerable=Object.prototype.propertyIsEnumerable,gPO=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(tt){return tt.__proto__}:null);function addNumericSeparator(tt,et){if(tt===1/0||tt===-1/0||tt!==tt||tt&&tt>-1e3&&tt<1e3||$test.call(/e/,et))return et;var rt=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof tt=="number"){var st=tt<0?-$floor(-tt):$floor(tt);if(st!==tt){var nt=String(st),ot=$slice.call(et,nt.length+1);return $replace$1.call(nt,rt,"$&_")+"."+$replace$1.call($replace$1.call(ot,/([0-9]{3})/g,"$&_"),/_$/,"")}}return $replace$1.call(et,rt,"$&_")}var utilInspect=require$$0$1,inspectCustom=utilInspect.custom,inspectSymbol=isSymbol(inspectCustom)?inspectCustom:null,quotes={__proto__:null,double:'"',single:"'"},quoteREs={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},objectInspect=function tt(et,rt,st,nt){var ot=rt||{};if(has$3(ot,"quoteStyle")&&!has$3(quotes,ot.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(has$3(ot,"maxStringLength")&&(typeof ot.maxStringLength=="number"?ot.maxStringLength<0&&ot.maxStringLength!==1/0:ot.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var at=has$3(ot,"customInspect")?ot.customInspect:!0;if(typeof at!="boolean"&&at!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(has$3(ot,"indent")&&ot.indent!==null&&ot.indent!==" "&&!(parseInt(ot.indent,10)===ot.indent&&ot.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(has$3(ot,"numericSeparator")&&typeof ot.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var lt=ot.numericSeparator;if(typeof et>"u")return"undefined";if(et===null)return"null";if(typeof et=="boolean")return et?"true":"false";if(typeof et=="string")return inspectString(et,ot);if(typeof et=="number"){if(et===0)return 1/0/et>0?"0":"-0";var ut=String(et);return lt?addNumericSeparator(et,ut):ut}if(typeof et=="bigint"){var ct=String(et)+"n";return lt?addNumericSeparator(et,ct):ct}var dt=typeof ot.depth>"u"?5:ot.depth;if(typeof st>"u"&&(st=0),st>=dt&&dt>0&&typeof et=="object")return isArray$3(et)?"[Array]":"[Object]";var ht=getIndent(ot,st);if(typeof nt>"u")nt=[];else if(indexOf(nt,et)>=0)return"[Circular]";function ft(Lt,kt,$t){if(kt&&(nt=$arrSlice.call(nt),nt.push(kt)),$t){var Ft={depth:ot.depth};return has$3(ot,"quoteStyle")&&(Ft.quoteStyle=ot.quoteStyle),tt(Lt,Ft,st+1,nt)}return tt(Lt,ot,st+1,nt)}if(typeof et=="function"&&!isRegExp$1(et)){var xt=nameOf(et),vt=arrObjKeys(et,ft);return"[Function"+(xt?": "+xt:" (anonymous)")+"]"+(vt.length>0?" { "+$join.call(vt,", ")+" }":"")}if(isSymbol(et)){var yt=hasShammedSymbols?$replace$1.call(String(et),/^(Symbol\(.*\))_[^)]*$/,"$1"):symToString.call(et);return typeof et=="object"&&!hasShammedSymbols?markBoxed(yt):yt}if(isElement(et)){for(var Et="<"+$toLowerCase.call(String(et.nodeName)),bt=et.attributes||[],wt=0;wt<bt.length;wt++)Et+=" "+bt[wt].name+"="+wrapQuotes(quote(bt[wt].value),"double",ot);return Et+=">",et.childNodes&&et.childNodes.length&&(Et+="..."),Et+="</"+$toLowerCase.call(String(et.nodeName))+">",Et}if(isArray$3(et)){if(et.length===0)return"[]";var St=arrObjKeys(et,ft);return ht&&!singleLineValues(St)?"["+indentedJoin(St,ht)+"]":"[ "+$join.call(St,", ")+" ]"}if(isError(et)){var Rt=arrObjKeys(et,ft);return!("cause"in Error.prototype)&&"cause"in et&&!isEnumerable.call(et,"cause")?"{ ["+String(et)+"] "+$join.call($concat$1.call("[cause]: "+ft(et.cause),Rt),", ")+" }":Rt.length===0?"["+String(et)+"]":"{ ["+String(et)+"] "+$join.call(Rt,", ")+" }"}if(typeof et=="object"&&at){if(inspectSymbol&&typeof et[inspectSymbol]=="function"&&utilInspect)return utilInspect(et,{depth:dt-st});if(at!=="symbol"&&typeof et.inspect=="function")return et.inspect()}if(isMap(et)){var Ct=[];return mapForEach&&mapForEach.call(et,function(Lt,kt){Ct.push(ft(kt,et,!0)+" => "+ft(Lt,et))}),collectionOf("Map",mapSize$1.call(et),Ct,ht)}if(isSet(et)){var It=[];return setForEach&&setForEach.call(et,function(Lt){It.push(ft(Lt,et))}),collectionOf("Set",setSize.call(et),It,ht)}if(isWeakMap(et))return weakCollectionOf("WeakMap");if(isWeakSet(et))return weakCollectionOf("WeakSet");if(isWeakRef(et))return weakCollectionOf("WeakRef");if(isNumber(et))return markBoxed(ft(Number(et)));if(isBigInt(et))return markBoxed(ft(bigIntValueOf.call(et)));if(isBoolean(et))return markBoxed(booleanValueOf.call(et));if(isString(et))return markBoxed(ft(String(et)));if(typeof window<"u"&&et===window)return"{ [object Window] }";if(typeof globalThis<"u"&&et===globalThis||typeof commonjsGlobal<"u"&&et===commonjsGlobal)return"{ [object globalThis] }";if(!isDate(et)&&!isRegExp$1(et)){var jt=arrObjKeys(et,ft),Pt=gPO?gPO(et)===Object.prototype:et instanceof Object||et.constructor===Object,Ot=et instanceof Object?"":"null prototype",Ut=!Pt&&toStringTag&&Object(et)===et&&toStringTag in et?$slice.call(toStr(et),8,-1):Ot?"Object":"",Nt=Pt||typeof et.constructor!="function"?"":et.constructor.name?et.constructor.name+" ":"",Ht=Nt+(Ut||Ot?"["+$join.call($concat$1.call([],Ut||[],Ot||[]),": ")+"] ":"");return jt.length===0?Ht+"{}":ht?Ht+"{"+indentedJoin(jt,ht)+"}":Ht+"{ "+$join.call(jt,", ")+" }"}return String(et)};function wrapQuotes(tt,et,rt){var st=rt.quoteStyle||et,nt=quotes[st];return nt+tt+nt}function quote(tt){return $replace$1.call(String(tt),/"/g,""")}function canTrustToString(tt){return!toStringTag||!(typeof tt=="object"&&(toStringTag in tt||typeof tt[toStringTag]<"u"))}function isArray$3(tt){return toStr(tt)==="[object Array]"&&canTrustToString(tt)}function isDate(tt){return toStr(tt)==="[object Date]"&&canTrustToString(tt)}function isRegExp$1(tt){return toStr(tt)==="[object RegExp]"&&canTrustToString(tt)}function isError(tt){return toStr(tt)==="[object Error]"&&canTrustToString(tt)}function isString(tt){return toStr(tt)==="[object String]"&&canTrustToString(tt)}function isNumber(tt){return toStr(tt)==="[object Number]"&&canTrustToString(tt)}function isBoolean(tt){return toStr(tt)==="[object Boolean]"&&canTrustToString(tt)}function isSymbol(tt){if(hasShammedSymbols)return tt&&typeof tt=="object"&&tt instanceof Symbol;if(typeof tt=="symbol")return!0;if(!tt||typeof tt!="object"||!symToString)return!1;try{return symToString.call(tt),!0}catch{}return!1}function isBigInt(tt){if(!tt||typeof tt!="object"||!bigIntValueOf)return!1;try{return bigIntValueOf.call(tt),!0}catch{}return!1}var hasOwn$1=Object.prototype.hasOwnProperty||function(tt){return tt in this};function has$3(tt,et){return hasOwn$1.call(tt,et)}function toStr(tt){return objectToString.call(tt)}function nameOf(tt){if(tt.name)return tt.name;var et=$match.call(functionToString.call(tt),/^function\s*([\w$]+)/);return et?et[1]:null}function indexOf(tt,et){if(tt.indexOf)return tt.indexOf(et);for(var rt=0,st=tt.length;rt<st;rt++)if(tt[rt]===et)return rt;return-1}function isMap(tt){if(!mapSize$1||!tt||typeof tt!="object")return!1;try{mapSize$1.call(tt);try{setSize.call(tt)}catch{return!0}return tt instanceof Map}catch{}return!1}function isWeakMap(tt){if(!weakMapHas||!tt||typeof tt!="object")return!1;try{weakMapHas.call(tt,weakMapHas);try{weakSetHas.call(tt,weakSetHas)}catch{return!0}return tt instanceof WeakMap}catch{}return!1}function isWeakRef(tt){if(!weakRefDeref||!tt||typeof tt!="object")return!1;try{return weakRefDeref.call(tt),!0}catch{}return!1}function isSet(tt){if(!setSize||!tt||typeof tt!="object")return!1;try{setSize.call(tt);try{mapSize$1.call(tt)}catch{return!0}return tt instanceof Set}catch{}return!1}function isWeakSet(tt){if(!weakSetHas||!tt||typeof tt!="object")return!1;try{weakSetHas.call(tt,weakSetHas);try{weakMapHas.call(tt,weakMapHas)}catch{return!0}return tt instanceof WeakSet}catch{}return!1}function isElement(tt){return!tt||typeof tt!="object"?!1:typeof HTMLElement<"u"&&tt instanceof HTMLElement?!0:typeof tt.nodeName=="string"&&typeof tt.getAttribute=="function"}function inspectString(tt,et){if(tt.length>et.maxStringLength){var rt=tt.length-et.maxStringLength,st="... "+rt+" more character"+(rt>1?"s":"");return inspectString($slice.call(tt,0,et.maxStringLength),et)+st}var nt=quoteREs[et.quoteStyle||"single"];nt.lastIndex=0;var ot=$replace$1.call($replace$1.call(tt,nt,"\\$1"),/[\x00-\x1f]/g,lowbyte);return wrapQuotes(ot,"single",et)}function lowbyte(tt){var et=tt.charCodeAt(0),rt={8:"b",9:"t",10:"n",12:"f",13:"r"}[et];return rt?"\\"+rt:"\\x"+(et<16?"0":"")+$toUpperCase.call(et.toString(16))}function markBoxed(tt){return"Object("+tt+")"}function weakCollectionOf(tt){return tt+" { ? }"}function collectionOf(tt,et,rt,st){var nt=st?indentedJoin(rt,st):$join.call(rt,", ");return tt+" ("+et+") {"+nt+"}"}function singleLineValues(tt){for(var et=0;et<tt.length;et++)if(indexOf(tt[et],`
|
|
227
227
|
`)>=0)return!1;return!0}function getIndent(tt,et){var rt;if(tt.indent===" ")rt=" ";else if(typeof tt.indent=="number"&&tt.indent>0)rt=$join.call(Array(tt.indent+1)," ");else return null;return{base:rt,prev:$join.call(Array(et+1),rt)}}function indentedJoin(tt,et){if(tt.length===0)return"";var rt=`
|
|
228
228
|
`+et.prev+et.base;return rt+$join.call(tt,","+rt)+`
|
|
229
229
|
`+et.prev}function arrObjKeys(tt,et){var rt=isArray$3(tt),st=[];if(rt){st.length=tt.length;for(var nt=0;nt<tt.length;nt++)st[nt]=has$3(tt,nt)?et(tt[nt],tt):""}var ot=typeof gOPS=="function"?gOPS(tt):[],at;if(hasShammedSymbols){at={};for(var lt=0;lt<ot.length;lt++)at["$"+ot[lt]]=ot[lt]}for(var ut in tt)has$3(tt,ut)&&(rt&&String(Number(ut))===ut&&ut<tt.length||hasShammedSymbols&&at["$"+ut]instanceof Symbol||($test.call(/[^\w$]/,ut)?st.push(et(ut,tt)+": "+et(tt[ut],tt)):st.push(ut+": "+et(tt[ut],tt))));if(typeof gOPS=="function")for(var ct=0;ct<ot.length;ct++)isEnumerable.call(tt,ot[ct])&&st.push("["+et(ot[ct])+"]: "+et(tt[ot[ct]],tt));return st}var inspect$3=objectInspect,$TypeError$5=type,listGetNode=function(tt,et,rt){for(var st=tt,nt;(nt=st.next)!=null;st=nt)if(nt.key===et)return st.next=nt.next,rt||(nt.next=tt.next,tt.next=nt),nt},listGet=function(tt,et){if(tt){var rt=listGetNode(tt,et);return rt&&rt.value}},listSet=function(tt,et,rt){var st=listGetNode(tt,et);st?st.value=rt:tt.next={key:et,next:tt.next,value:rt}},listHas=function(tt,et){return tt?!!listGetNode(tt,et):!1},listDelete=function(tt,et){if(tt)return listGetNode(tt,et,!0)},sideChannelList=function tt(){var et,rt={assert:function(st){if(!rt.has(st))throw new $TypeError$5("Side channel does not contain "+inspect$3(st))},delete:function(st){var nt=et&&et.next,ot=listDelete(et,st);return ot&&nt&&nt===ot&&(et=void 0),!!ot},get:function(st){return listGet(et,st)},has:function(st){return listHas(et,st)},set:function(st,nt){et||(et={next:void 0}),listSet(et,st,nt)}};return rt},esObjectAtoms=Object,esErrors=Error,_eval=EvalError,range=RangeError,ref=ReferenceError,syntax=SyntaxError,uri=URIError,abs$1=Math.abs,floor$1=Math.floor,max$1=Math.max,min$1=Math.min,pow$1=Math.pow,round$2=Math.round,_isNaN=Number.isNaN||function tt(et){return et!==et},$isNaN=_isNaN,sign$2=function tt(et){return $isNaN(et)||et===0?et:et<0?-1:1},gOPD=Object.getOwnPropertyDescriptor,$gOPD$1=gOPD;if($gOPD$1)try{$gOPD$1([],"length")}catch{$gOPD$1=null}var gopd=$gOPD$1,$defineProperty$1=Object.defineProperty||!1;if($defineProperty$1)try{$defineProperty$1({},"a",{value:1})}catch{$defineProperty$1=!1}var esDefineProperty=$defineProperty$1,shams,hasRequiredShams;function requireShams(){return hasRequiredShams||(hasRequiredShams=1,shams=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var et={},rt=Symbol("test"),st=Object(rt);if(typeof rt=="string"||Object.prototype.toString.call(rt)!=="[object Symbol]"||Object.prototype.toString.call(st)!=="[object Symbol]")return!1;var nt=42;et[rt]=nt;for(var ot in et)return!1;if(typeof Object.keys=="function"&&Object.keys(et).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(et).length!==0)return!1;var at=Object.getOwnPropertySymbols(et);if(at.length!==1||at[0]!==rt||!Object.prototype.propertyIsEnumerable.call(et,rt))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var lt=Object.getOwnPropertyDescriptor(et,rt);if(lt.value!==nt||lt.enumerable!==!0)return!1}return!0}),shams}var hasSymbols$1,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols$1;hasRequiredHasSymbols=1;var tt=typeof Symbol<"u"&&Symbol,et=requireShams();return hasSymbols$1=function(){return typeof tt!="function"||typeof Symbol!="function"||typeof tt("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:et()},hasSymbols$1}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var tt=esObjectAtoms;return Object_getPrototypeOf=tt.getPrototypeOf||null,Object_getPrototypeOf}var implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var tt="Function.prototype.bind called on incompatible ",et=Object.prototype.toString,rt=Math.max,st="[object Function]",nt=function(ut,ct){for(var dt=[],ht=0;ht<ut.length;ht+=1)dt[ht]=ut[ht];for(var ft=0;ft<ct.length;ft+=1)dt[ft+ut.length]=ct[ft];return dt},ot=function(ut,ct){for(var dt=[],ht=ct,ft=0;ht<ut.length;ht+=1,ft+=1)dt[ft]=ut[ht];return dt},at=function(lt,ut){for(var ct="",dt=0;dt<lt.length;dt+=1)ct+=lt[dt],dt+1<lt.length&&(ct+=ut);return ct};return implementation=function(ut){var ct=this;if(typeof ct!="function"||et.apply(ct)!==st)throw new TypeError(tt+ct);for(var dt=ot(arguments,1),ht,ft=function(){if(this instanceof ht){var bt=ct.apply(this,nt(dt,arguments));return Object(bt)===bt?bt:this}return ct.apply(ut,nt(dt,arguments))},xt=rt(0,ct.length-dt.length),vt=[],yt=0;yt<xt;yt++)vt[yt]="$"+yt;if(ht=Function("binder","return function ("+at(vt,",")+"){ return binder.apply(this,arguments); }")(ft),ct.prototype){var Et=function(){};Et.prototype=ct.prototype,ht.prototype=new Et,Et.prototype=null}return ht},implementation}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var tt=requireImplementation();return functionBind=Function.prototype.bind||tt,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply,bind$2=requireFunctionBind(),$apply$1=requireFunctionApply(),$call$2=requireFunctionCall(),$reflectApply=reflectApply,actualApply=$reflectApply||bind$2.call($call$2,$apply$1),bind$1=requireFunctionBind(),$TypeError$4=type,$call$1=requireFunctionCall(),$actualApply=actualApply,callBindApplyHelpers=function tt(et){if(et.length<1||typeof et[0]!="function")throw new $TypeError$4("a function is required");return $actualApply(bind$1,$call$1,et)},get,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var tt=callBindApplyHelpers,et=gopd,rt;try{rt=[].__proto__===Array.prototype}catch(at){if(!at||typeof at!="object"||!("code"in at)||at.code!=="ERR_PROTO_ACCESS")throw at}var st=!!rt&&et&&et(Object.prototype,"__proto__"),nt=Object,ot=nt.getPrototypeOf;return get=st&&typeof st.get=="function"?tt([st.get]):typeof ot=="function"?function(lt){return ot(lt==null?lt:nt(lt))}:!1,get}var getProto$1,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto$1;hasRequiredGetProto=1;var tt=requireReflect_getPrototypeOf(),et=requireObject_getPrototypeOf(),rt=requireGet();return getProto$1=tt?function(nt){return tt(nt)}:et?function(nt){if(!nt||typeof nt!="object"&&typeof nt!="function")throw new TypeError("getProto: not an object");return et(nt)}:rt?function(nt){return rt(nt)}:null,getProto$1}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var tt=Function.prototype.call,et=Object.prototype.hasOwnProperty,rt=requireFunctionBind();return hasown=rt.call(tt,et),hasown}var undefined$1,$Object=esObjectAtoms,$Error=esErrors,$EvalError=_eval,$RangeError=range,$ReferenceError=ref,$SyntaxError=syntax,$TypeError$3=type,$URIError=uri,abs=abs$1,floor=floor$1,max=max$1,min=min$1,pow=pow$1,round$1=round$2,sign$1=sign$2,$Function=Function,getEvalledConstructor=function(tt){try{return $Function('"use strict"; return ('+tt+").constructor;")()}catch{}},$gOPD=gopd,$defineProperty=esDefineProperty,throwTypeError=function(){throw new $TypeError$3},ThrowTypeError=$gOPD?function(){try{return arguments.callee,throwTypeError}catch{try{return $gOPD(arguments,"callee").get}catch{return throwTypeError}}}():throwTypeError,hasSymbols=requireHasSymbols()(),getProto=requireGetProto(),$ObjectGPO=requireObject_getPrototypeOf(),$ReflectGPO=requireReflect_getPrototypeOf(),$apply=requireFunctionApply(),$call=requireFunctionCall(),needsEval={},TypedArray=typeof Uint8Array>"u"||!getProto?undefined$1:getProto(Uint8Array),INTRINSICS={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto?getProto([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float16Array%":typeof Float16Array>"u"?undefined$1:Float16Array,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto?getProto(getProto([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols||!getProto?undefined$1:getProto(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto?getProto(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$3,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":$URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply,"%Object.defineProperty%":$defineProperty,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max,"%Math.min%":min,"%Math.pow%":pow,"%Math.round%":round$1,"%Math.sign%":sign$1,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto)try{null.error}catch(tt){var errorProto=getProto(getProto(tt));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function tt(et){var rt;if(et==="%AsyncFunction%")rt=getEvalledConstructor("async function () {}");else if(et==="%GeneratorFunction%")rt=getEvalledConstructor("function* () {}");else if(et==="%AsyncGeneratorFunction%")rt=getEvalledConstructor("async function* () {}");else if(et==="%AsyncGenerator%"){var st=tt("%AsyncGeneratorFunction%");st&&(rt=st.prototype)}else if(et==="%AsyncIteratorPrototype%"){var nt=tt("%AsyncGenerator%");nt&&getProto&&(rt=getProto(nt.prototype))}return INTRINSICS[et]=rt,rt},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind=requireFunctionBind(),hasOwn=requireHasown(),$concat=bind.call($call,Array.prototype.concat),$spliceApply=bind.call($apply,Array.prototype.splice),$replace=bind.call($call,String.prototype.replace),$strSlice=bind.call($call,String.prototype.slice),$exec=bind.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function tt(et){var rt=$strSlice(et,0,1),st=$strSlice(et,-1);if(rt==="%"&&st!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");if(st==="%"&&rt!=="%")throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");var nt=[];return $replace(et,rePropName,function(ot,at,lt,ut){nt[nt.length]=lt?$replace(ut,reEscapeChar,"$1"):at||ot}),nt},getBaseIntrinsic=function tt(et,rt){var st=et,nt;if(hasOwn(LEGACY_ALIASES,st)&&(nt=LEGACY_ALIASES[st],st="%"+nt[0]+"%"),hasOwn(INTRINSICS,st)){var ot=INTRINSICS[st];if(ot===needsEval&&(ot=doEval(st)),typeof ot>"u"&&!rt)throw new $TypeError$3("intrinsic "+et+" exists, but is not available. Please file an issue!");return{alias:nt,name:st,value:ot}}throw new $SyntaxError("intrinsic "+et+" does not exist!")},getIntrinsic=function tt(et,rt){if(typeof et!="string"||et.length===0)throw new $TypeError$3("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof rt!="boolean")throw new $TypeError$3('"allowMissing" argument must be a boolean');if($exec(/^%?[^%]*%?$/,et)===null)throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var st=stringToPath(et),nt=st.length>0?st[0]:"",ot=getBaseIntrinsic("%"+nt+"%",rt),at=ot.name,lt=ot.value,ut=!1,ct=ot.alias;ct&&(nt=ct[0],$spliceApply(st,$concat([0,1],ct)));for(var dt=1,ht=!0;dt<st.length;dt+=1){var ft=st[dt],xt=$strSlice(ft,0,1),vt=$strSlice(ft,-1);if((xt==='"'||xt==="'"||xt==="`"||vt==='"'||vt==="'"||vt==="`")&&xt!==vt)throw new $SyntaxError("property names with quotes must have matching quotes");if((ft==="constructor"||!ht)&&(ut=!0),nt+="."+ft,at="%"+nt+"%",hasOwn(INTRINSICS,at))lt=INTRINSICS[at];else if(lt!=null){if(!(ft in lt)){if(!rt)throw new $TypeError$3("base intrinsic for "+et+" exists, but the property is not available.");return}if($gOPD&&dt+1>=st.length){var yt=$gOPD(lt,ft);ht=!!yt,ht&&"get"in yt&&!("originalValue"in yt.get)?lt=yt.get:lt=lt[ft]}else ht=hasOwn(lt,ft),lt=lt[ft];ht&&!ut&&(INTRINSICS[at]=lt)}}return lt},GetIntrinsic$2=getIntrinsic,callBindBasic=callBindApplyHelpers,$indexOf=callBindBasic([GetIntrinsic$2("%String.prototype.indexOf%")]),callBound$2=function tt(et,rt){var st=GetIntrinsic$2(et,!!rt);return typeof st=="function"&&$indexOf(et,".prototype.")>-1?callBindBasic([st]):st},GetIntrinsic$1=getIntrinsic,callBound$1=callBound$2,inspect$2=objectInspect,$TypeError$2=type,$Map=GetIntrinsic$1("%Map%",!0),$mapGet=callBound$1("Map.prototype.get",!0),$mapSet=callBound$1("Map.prototype.set",!0),$mapHas=callBound$1("Map.prototype.has",!0),$mapDelete=callBound$1("Map.prototype.delete",!0),$mapSize=callBound$1("Map.prototype.size",!0),sideChannelMap=!!$Map&&function tt(){var et,rt={assert:function(st){if(!rt.has(st))throw new $TypeError$2("Side channel does not contain "+inspect$2(st))},delete:function(st){if(et){var nt=$mapDelete(et,st);return $mapSize(et)===0&&(et=void 0),nt}return!1},get:function(st){if(et)return $mapGet(et,st)},has:function(st){return et?$mapHas(et,st):!1},set:function(st,nt){et||(et=new $Map),$mapSet(et,st,nt)}};return rt},GetIntrinsic=getIntrinsic,callBound=callBound$2,inspect$1=objectInspect,getSideChannelMap$1=sideChannelMap,$TypeError$1=type,$WeakMap=GetIntrinsic("%WeakMap%",!0),$weakMapGet=callBound("WeakMap.prototype.get",!0),$weakMapSet=callBound("WeakMap.prototype.set",!0),$weakMapHas=callBound("WeakMap.prototype.has",!0),$weakMapDelete=callBound("WeakMap.prototype.delete",!0),sideChannelWeakmap=$WeakMap?function tt(){var et,rt,st={assert:function(nt){if(!st.has(nt))throw new $TypeError$1("Side channel does not contain "+inspect$1(nt))},delete:function(nt){if($WeakMap&&nt&&(typeof nt=="object"||typeof nt=="function")){if(et)return $weakMapDelete(et,nt)}else if(getSideChannelMap$1&&rt)return rt.delete(nt);return!1},get:function(nt){return $WeakMap&&nt&&(typeof nt=="object"||typeof nt=="function")&&et?$weakMapGet(et,nt):rt&&rt.get(nt)},has:function(nt){return $WeakMap&&nt&&(typeof nt=="object"||typeof nt=="function")&&et?$weakMapHas(et,nt):!!rt&&rt.has(nt)},set:function(nt,ot){$WeakMap&&nt&&(typeof nt=="object"||typeof nt=="function")?(et||(et=new $WeakMap),$weakMapSet(et,nt,ot)):getSideChannelMap$1&&(rt||(rt=getSideChannelMap$1()),rt.set(nt,ot))}};return st}:getSideChannelMap$1,$TypeError=type,inspect=objectInspect,getSideChannelList=sideChannelList,getSideChannelMap=sideChannelMap,getSideChannelWeakMap=sideChannelWeakmap,makeChannel=getSideChannelWeakMap||getSideChannelMap||getSideChannelList,sideChannel=function tt(){var et,rt={assert:function(st){if(!rt.has(st))throw new $TypeError("Side channel does not contain "+inspect(st))},delete:function(st){return!!et&&et.delete(st)},get:function(st){return et&&et.get(st)},has:function(st){return!!et&&et.has(st)},set:function(st,nt){et||(et=makeChannel()),et.set(st,nt)}};return rt},replace=String.prototype.replace,percentTwenties=/%20/g,Format={RFC1738:"RFC1738",RFC3986:"RFC3986"},formats$4={default:Format.RFC3986,formatters:{RFC1738:function(tt){return replace.call(tt,percentTwenties,"+")},RFC3986:function(tt){return String(tt)}},RFC1738:Format.RFC1738,RFC3986:Format.RFC3986},formats$3=formats$4,has$2=Object.prototype.hasOwnProperty,isArray$2=Array.isArray,hexTable=function(){for(var tt=[],et=0;et<256;++et)tt.push("%"+((et<16?"0":"")+et.toString(16)).toUpperCase());return tt}(),compactQueue=function tt(et){for(;et.length>1;){var rt=et.pop(),st=rt.obj[rt.prop];if(isArray$2(st)){for(var nt=[],ot=0;ot<st.length;++ot)typeof st[ot]<"u"&&nt.push(st[ot]);rt.obj[rt.prop]=nt}}},arrayToObject=function tt(et,rt){for(var st=rt&&rt.plainObjects?{__proto__:null}:{},nt=0;nt<et.length;++nt)typeof et[nt]<"u"&&(st[nt]=et[nt]);return st},merge=function tt(et,rt,st){if(!rt)return et;if(typeof rt!="object"&&typeof rt!="function"){if(isArray$2(et))et.push(rt);else if(et&&typeof et=="object")(st&&(st.plainObjects||st.allowPrototypes)||!has$2.call(Object.prototype,rt))&&(et[rt]=!0);else return[et,rt];return et}if(!et||typeof et!="object")return[et].concat(rt);var nt=et;return isArray$2(et)&&!isArray$2(rt)&&(nt=arrayToObject(et,st)),isArray$2(et)&&isArray$2(rt)?(rt.forEach(function(ot,at){if(has$2.call(et,at)){var lt=et[at];lt&&typeof lt=="object"&&ot&&typeof ot=="object"?et[at]=tt(lt,ot,st):et.push(ot)}else et[at]=ot}),et):Object.keys(rt).reduce(function(ot,at){var lt=rt[at];return has$2.call(ot,at)?ot[at]=tt(ot[at],lt,st):ot[at]=lt,ot},nt)},assign=function tt(et,rt){return Object.keys(rt).reduce(function(st,nt){return st[nt]=rt[nt],st},et)},decode=function(tt,et,rt){var st=tt.replace(/\+/g," ");if(rt==="iso-8859-1")return st.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(st)}catch{return st}},limit=1024,encode=function tt(et,rt,st,nt,ot){if(et.length===0)return et;var at=et;if(typeof et=="symbol"?at=Symbol.prototype.toString.call(et):typeof et!="string"&&(at=String(et)),st==="iso-8859-1")return escape(at).replace(/%u[0-9a-f]{4}/gi,function(xt){return"%26%23"+parseInt(xt.slice(2),16)+"%3B"});for(var lt="",ut=0;ut<at.length;ut+=limit){for(var ct=at.length>=limit?at.slice(ut,ut+limit):at,dt=[],ht=0;ht<ct.length;++ht){var ft=ct.charCodeAt(ht);if(ft===45||ft===46||ft===95||ft===126||ft>=48&&ft<=57||ft>=65&&ft<=90||ft>=97&&ft<=122||ot===formats$3.RFC1738&&(ft===40||ft===41)){dt[dt.length]=ct.charAt(ht);continue}if(ft<128){dt[dt.length]=hexTable[ft];continue}if(ft<2048){dt[dt.length]=hexTable[192|ft>>6]+hexTable[128|ft&63];continue}if(ft<55296||ft>=57344){dt[dt.length]=hexTable[224|ft>>12]+hexTable[128|ft>>6&63]+hexTable[128|ft&63];continue}ht+=1,ft=65536+((ft&1023)<<10|ct.charCodeAt(ht)&1023),dt[dt.length]=hexTable[240|ft>>18]+hexTable[128|ft>>12&63]+hexTable[128|ft>>6&63]+hexTable[128|ft&63]}lt+=dt.join("")}return lt},compact=function tt(et){for(var rt=[{obj:{o:et},prop:"o"}],st=[],nt=0;nt<rt.length;++nt)for(var ot=rt[nt],at=ot.obj[ot.prop],lt=Object.keys(at),ut=0;ut<lt.length;++ut){var ct=lt[ut],dt=at[ct];typeof dt=="object"&&dt!==null&&st.indexOf(dt)===-1&&(rt.push({obj:at,prop:ct}),st.push(dt))}return compactQueue(rt),et},isRegExp=function tt(et){return Object.prototype.toString.call(et)==="[object RegExp]"},isBuffer=function tt(et){return!et||typeof et!="object"?!1:!!(et.constructor&&et.constructor.isBuffer&&et.constructor.isBuffer(et))},combine=function tt(et,rt){return[].concat(et,rt)},maybeMap=function tt(et,rt){if(isArray$2(et)){for(var st=[],nt=0;nt<et.length;nt+=1)st.push(rt(et[nt]));return st}return rt(et)},utils$2={arrayToObject,assign,combine,compact,decode,encode,isBuffer,isRegExp,maybeMap,merge},getSideChannel=sideChannel,utils$1=utils$2,formats$2=formats$4,has$1=Object.prototype.hasOwnProperty,arrayPrefixGenerators={brackets:function tt(et){return et+"[]"},comma:"comma",indices:function tt(et,rt){return et+"["+rt+"]"},repeat:function tt(et){return et}},isArray$1=Array.isArray,push=Array.prototype.push,pushToArray=function(tt,et){push.apply(tt,isArray$1(et)?et:[et])},toISO=Date.prototype.toISOString,defaultFormat=formats$2.default,defaults$2={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:utils$1.encode,encodeValuesOnly:!1,filter:void 0,format:defaultFormat,formatter:formats$2.formatters[defaultFormat],indices:!1,serializeDate:function tt(et){return toISO.call(et)},skipNulls:!1,strictNullHandling:!1},isNonNullishPrimitive=function tt(et){return typeof et=="string"||typeof et=="number"||typeof et=="boolean"||typeof et=="symbol"||typeof et=="bigint"},sentinel={},stringify$1=function tt(et,rt,st,nt,ot,at,lt,ut,ct,dt,ht,ft,xt,vt,yt,Et,bt,wt){for(var St=et,Rt=wt,Ct=0,It=!1;(Rt=Rt.get(sentinel))!==void 0&&!It;){var jt=Rt.get(et);if(Ct+=1,typeof jt<"u"){if(jt===Ct)throw new RangeError("Cyclic object value");It=!0}typeof Rt.get(sentinel)>"u"&&(Ct=0)}if(typeof dt=="function"?St=dt(rt,St):St instanceof Date?St=xt(St):st==="comma"&&isArray$1(St)&&(St=utils$1.maybeMap(St,function(Bt){return Bt instanceof Date?xt(Bt):Bt})),St===null){if(at)return ct&&!Et?ct(rt,defaults$2.encoder,bt,"key",vt):rt;St=""}if(isNonNullishPrimitive(St)||utils$1.isBuffer(St)){if(ct){var Pt=Et?rt:ct(rt,defaults$2.encoder,bt,"key",vt);return[yt(Pt)+"="+yt(ct(St,defaults$2.encoder,bt,"value",vt))]}return[yt(rt)+"="+yt(String(St))]}var Ot=[];if(typeof St>"u")return Ot;var Ut;if(st==="comma"&&isArray$1(St))Et&&ct&&(St=utils$1.maybeMap(St,ct)),Ut=[{value:St.length>0?St.join(",")||null:void 0}];else if(isArray$1(dt))Ut=dt;else{var Nt=Object.keys(St);Ut=ht?Nt.sort(ht):Nt}var Ht=ut?String(rt).replace(/\./g,"%2E"):String(rt),Lt=nt&&isArray$1(St)&&St.length===1?Ht+"[]":Ht;if(ot&&isArray$1(St)&&St.length===0)return Lt+"[]";for(var kt=0;kt<Ut.length;++kt){var $t=Ut[kt],Ft=typeof $t=="object"&&$t&&typeof $t.value<"u"?$t.value:St[$t];if(!(lt&&Ft===null)){var Gt=ft&&ut?String($t).replace(/\./g,"%2E"):String($t),Mt=isArray$1(St)?typeof st=="function"?st(Lt,Gt):Lt:Lt+(ft?"."+Gt:"["+Gt+"]");wt.set(et,Ct);var Vt=getSideChannel();Vt.set(sentinel,wt),pushToArray(Ot,tt(Ft,Mt,st,nt,ot,at,lt,ut,st==="comma"&&Et&&isArray$1(St)?null:ct,dt,ht,ft,xt,vt,yt,Et,bt,Vt))}}return Ot},normalizeStringifyOptions=function tt(et){if(!et)return defaults$2;if(typeof et.allowEmptyArrays<"u"&&typeof et.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof et.encodeDotInKeys<"u"&&typeof et.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(et.encoder!==null&&typeof et.encoder<"u"&&typeof et.encoder!="function")throw new TypeError("Encoder has to be a function.");var rt=et.charset||defaults$2.charset;if(typeof et.charset<"u"&&et.charset!=="utf-8"&&et.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var st=formats$2.default;if(typeof et.format<"u"){if(!has$1.call(formats$2.formatters,et.format))throw new TypeError("Unknown format option provided.");st=et.format}var nt=formats$2.formatters[st],ot=defaults$2.filter;(typeof et.filter=="function"||isArray$1(et.filter))&&(ot=et.filter);var at;if(et.arrayFormat in arrayPrefixGenerators?at=et.arrayFormat:"indices"in et?at=et.indices?"indices":"repeat":at=defaults$2.arrayFormat,"commaRoundTrip"in et&&typeof et.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var lt=typeof et.allowDots>"u"?et.encodeDotInKeys===!0?!0:defaults$2.allowDots:!!et.allowDots;return{addQueryPrefix:typeof et.addQueryPrefix=="boolean"?et.addQueryPrefix:defaults$2.addQueryPrefix,allowDots:lt,allowEmptyArrays:typeof et.allowEmptyArrays=="boolean"?!!et.allowEmptyArrays:defaults$2.allowEmptyArrays,arrayFormat:at,charset:rt,charsetSentinel:typeof et.charsetSentinel=="boolean"?et.charsetSentinel:defaults$2.charsetSentinel,commaRoundTrip:!!et.commaRoundTrip,delimiter:typeof et.delimiter>"u"?defaults$2.delimiter:et.delimiter,encode:typeof et.encode=="boolean"?et.encode:defaults$2.encode,encodeDotInKeys:typeof et.encodeDotInKeys=="boolean"?et.encodeDotInKeys:defaults$2.encodeDotInKeys,encoder:typeof et.encoder=="function"?et.encoder:defaults$2.encoder,encodeValuesOnly:typeof et.encodeValuesOnly=="boolean"?et.encodeValuesOnly:defaults$2.encodeValuesOnly,filter:ot,format:st,formatter:nt,serializeDate:typeof et.serializeDate=="function"?et.serializeDate:defaults$2.serializeDate,skipNulls:typeof et.skipNulls=="boolean"?et.skipNulls:defaults$2.skipNulls,sort:typeof et.sort=="function"?et.sort:null,strictNullHandling:typeof et.strictNullHandling=="boolean"?et.strictNullHandling:defaults$2.strictNullHandling}},stringify_1=function(tt,et){var rt=tt,st=normalizeStringifyOptions(et),nt,ot;typeof st.filter=="function"?(ot=st.filter,rt=ot("",rt)):isArray$1(st.filter)&&(ot=st.filter,nt=ot);var at=[];if(typeof rt!="object"||rt===null)return"";var lt=arrayPrefixGenerators[st.arrayFormat],ut=lt==="comma"&&st.commaRoundTrip;nt||(nt=Object.keys(rt)),st.sort&&nt.sort(st.sort);for(var ct=getSideChannel(),dt=0;dt<nt.length;++dt){var ht=nt[dt],ft=rt[ht];st.skipNulls&&ft===null||pushToArray(at,stringify$1(ft,ht,lt,ut,st.allowEmptyArrays,st.strictNullHandling,st.skipNulls,st.encodeDotInKeys,st.encode?st.encoder:null,st.filter,st.sort,st.allowDots,st.serializeDate,st.format,st.formatter,st.encodeValuesOnly,st.charset,ct))}var xt=at.join(st.delimiter),vt=st.addQueryPrefix===!0?"?":"";return st.charsetSentinel&&(st.charset==="iso-8859-1"?vt+="utf8=%26%2310003%3B&":vt+="utf8=%E2%9C%93&"),xt.length>0?vt+xt:""},utils=utils$2,has=Object.prototype.hasOwnProperty,isArray=Array.isArray,defaults$1={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:utils.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},interpretNumericEntities=function(tt){return tt.replace(/&#(\d+);/g,function(et,rt){return String.fromCharCode(parseInt(rt,10))})},parseArrayValue=function(tt,et,rt){if(tt&&typeof tt=="string"&&et.comma&&tt.indexOf(",")>-1)return tt.split(",");if(et.throwOnLimitExceeded&&rt>=et.arrayLimit)throw new RangeError("Array limit exceeded. Only "+et.arrayLimit+" element"+(et.arrayLimit===1?"":"s")+" allowed in an array.");return tt},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function tt(et,rt){var st={__proto__:null},nt=rt.ignoreQueryPrefix?et.replace(/^\?/,""):et;nt=nt.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var ot=rt.parameterLimit===1/0?void 0:rt.parameterLimit,at=nt.split(rt.delimiter,rt.throwOnLimitExceeded?ot+1:ot);if(rt.throwOnLimitExceeded&&at.length>ot)throw new RangeError("Parameter limit exceeded. Only "+ot+" parameter"+(ot===1?"":"s")+" allowed.");var lt=-1,ut,ct=rt.charset;if(rt.charsetSentinel)for(ut=0;ut<at.length;++ut)at[ut].indexOf("utf8=")===0&&(at[ut]===charsetSentinel?ct="utf-8":at[ut]===isoSentinel&&(ct="iso-8859-1"),lt=ut,ut=at.length);for(ut=0;ut<at.length;++ut)if(ut!==lt){var dt=at[ut],ht=dt.indexOf("]="),ft=ht===-1?dt.indexOf("="):ht+1,xt,vt;ft===-1?(xt=rt.decoder(dt,defaults$1.decoder,ct,"key"),vt=rt.strictNullHandling?null:""):(xt=rt.decoder(dt.slice(0,ft),defaults$1.decoder,ct,"key"),vt=utils.maybeMap(parseArrayValue(dt.slice(ft+1),rt,isArray(st[xt])?st[xt].length:0),function(Et){return rt.decoder(Et,defaults$1.decoder,ct,"value")})),vt&&rt.interpretNumericEntities&&ct==="iso-8859-1"&&(vt=interpretNumericEntities(String(vt))),dt.indexOf("[]=")>-1&&(vt=isArray(vt)?[vt]:vt);var yt=has.call(st,xt);yt&&rt.duplicates==="combine"?st[xt]=utils.combine(st[xt],vt):(!yt||rt.duplicates==="last")&&(st[xt]=vt)}return st},parseObject=function(tt,et,rt,st){var nt=0;if(tt.length>0&&tt[tt.length-1]==="[]"){var ot=tt.slice(0,-1).join("");nt=Array.isArray(et)&&et[ot]?et[ot].length:0}for(var at=st?et:parseArrayValue(et,rt,nt),lt=tt.length-1;lt>=0;--lt){var ut,ct=tt[lt];if(ct==="[]"&&rt.parseArrays)ut=rt.allowEmptyArrays&&(at===""||rt.strictNullHandling&&at===null)?[]:utils.combine([],at);else{ut=rt.plainObjects?{__proto__:null}:{};var dt=ct.charAt(0)==="["&&ct.charAt(ct.length-1)==="]"?ct.slice(1,-1):ct,ht=rt.decodeDotInKeys?dt.replace(/%2E/g,"."):dt,ft=parseInt(ht,10);!rt.parseArrays&&ht===""?ut={0:at}:!isNaN(ft)&&ct!==ht&&String(ft)===ht&&ft>=0&&rt.parseArrays&&ft<=rt.arrayLimit?(ut=[],ut[ft]=at):ht!=="__proto__"&&(ut[ht]=at)}at=ut}return at},parseKeys=function tt(et,rt,st,nt){if(et){var ot=st.allowDots?et.replace(/\.([^.[]+)/g,"[$1]"):et,at=/(\[[^[\]]*])/,lt=/(\[[^[\]]*])/g,ut=st.depth>0&&at.exec(ot),ct=ut?ot.slice(0,ut.index):ot,dt=[];if(ct){if(!st.plainObjects&&has.call(Object.prototype,ct)&&!st.allowPrototypes)return;dt.push(ct)}for(var ht=0;st.depth>0&&(ut=lt.exec(ot))!==null&&ht<st.depth;){if(ht+=1,!st.plainObjects&&has.call(Object.prototype,ut[1].slice(1,-1))&&!st.allowPrototypes)return;dt.push(ut[1])}if(ut){if(st.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+st.depth+" and strictDepth is true");dt.push("["+ot.slice(ut.index)+"]")}return parseObject(dt,rt,st,nt)}},normalizeParseOptions=function tt(et){if(!et)return defaults$1;if(typeof et.allowEmptyArrays<"u"&&typeof et.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof et.decodeDotInKeys<"u"&&typeof et.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(et.decoder!==null&&typeof et.decoder<"u"&&typeof et.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof et.charset<"u"&&et.charset!=="utf-8"&&et.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof et.throwOnLimitExceeded<"u"&&typeof et.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var rt=typeof et.charset>"u"?defaults$1.charset:et.charset,st=typeof et.duplicates>"u"?defaults$1.duplicates:et.duplicates;if(st!=="combine"&&st!=="first"&&st!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var nt=typeof et.allowDots>"u"?et.decodeDotInKeys===!0?!0:defaults$1.allowDots:!!et.allowDots;return{allowDots:nt,allowEmptyArrays:typeof et.allowEmptyArrays=="boolean"?!!et.allowEmptyArrays:defaults$1.allowEmptyArrays,allowPrototypes:typeof et.allowPrototypes=="boolean"?et.allowPrototypes:defaults$1.allowPrototypes,allowSparse:typeof et.allowSparse=="boolean"?et.allowSparse:defaults$1.allowSparse,arrayLimit:typeof et.arrayLimit=="number"?et.arrayLimit:defaults$1.arrayLimit,charset:rt,charsetSentinel:typeof et.charsetSentinel=="boolean"?et.charsetSentinel:defaults$1.charsetSentinel,comma:typeof et.comma=="boolean"?et.comma:defaults$1.comma,decodeDotInKeys:typeof et.decodeDotInKeys=="boolean"?et.decodeDotInKeys:defaults$1.decodeDotInKeys,decoder:typeof et.decoder=="function"?et.decoder:defaults$1.decoder,delimiter:typeof et.delimiter=="string"||utils.isRegExp(et.delimiter)?et.delimiter:defaults$1.delimiter,depth:typeof et.depth=="number"||et.depth===!1?+et.depth:defaults$1.depth,duplicates:st,ignoreQueryPrefix:et.ignoreQueryPrefix===!0,interpretNumericEntities:typeof et.interpretNumericEntities=="boolean"?et.interpretNumericEntities:defaults$1.interpretNumericEntities,parameterLimit:typeof et.parameterLimit=="number"?et.parameterLimit:defaults$1.parameterLimit,parseArrays:et.parseArrays!==!1,plainObjects:typeof et.plainObjects=="boolean"?et.plainObjects:defaults$1.plainObjects,strictDepth:typeof et.strictDepth=="boolean"?!!et.strictDepth:defaults$1.strictDepth,strictNullHandling:typeof et.strictNullHandling=="boolean"?et.strictNullHandling:defaults$1.strictNullHandling,throwOnLimitExceeded:typeof et.throwOnLimitExceeded=="boolean"?et.throwOnLimitExceeded:!1}},parse$2=function(tt,et){var rt=normalizeParseOptions(et);if(tt===""||tt===null||typeof tt>"u")return rt.plainObjects?{__proto__:null}:{};for(var st=typeof tt=="string"?parseValues(tt,rt):tt,nt=rt.plainObjects?{__proto__:null}:{},ot=Object.keys(st),at=0;at<ot.length;++at){var lt=ot[at],ut=parseKeys(lt,st[lt],rt,typeof tt=="string");nt=utils.merge(nt,ut,rt)}return rt.allowSparse===!0?nt:utils.compact(nt)},stringify=stringify_1,parse$1=parse$2,formats$1=formats$4,lib$3={formats:formats$1,parse:parse$1,stringify},punycode=punycodeExports;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r",`
|
|
@@ -1388,7 +1388,7 @@ void main()
|
|
|
1388
1388
|
font-weight: ${rt.weight};
|
|
1389
1389
|
font-style: ${rt.style};
|
|
1390
1390
|
font-display: ${rt.display};
|
|
1391
|
-
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(et){this._stylesheet!==et&&(this._stylesheet=et,this.styleID++)}normalizeColor(et){return Array.isArray(et)&&(et=rgb2hex(et)),typeof et=="number"?hex2string(et):et}dropShadowToCSS(){let et=this.normalizeColor(this.dropShadowColor);const rt=this.dropShadowAlpha,st=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),nt=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);et.startsWith("#")&&rt<1&&(et+=(rt*255|0).toString(16).padStart(2,"0"));const ot=`${st}px ${nt}px`;return this.dropShadowBlur>0?`text-shadow: ${ot} ${this.dropShadowBlur}px ${et}`:`text-shadow: ${ot} ${et}`}reset(){Object.assign(this,Kl.defaultOptions)}onBeforeDraw(){const{fontsDirty:et}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&et?new Promise(rt=>setTimeout(rt,100)):Promise.resolve()}get isSafari(){const{userAgent:et}=settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(et)}set fillGradientStops(et){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(et){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(et){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(et){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(et){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(et){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(et){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};_HTMLTextStyle.availableFonts={},_HTMLTextStyle.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let HTMLTextStyle=_HTMLTextStyle;const _HTMLText=class Ql extends Sprite{constructor(et="",rt={}){super(Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const st=new Image,nt=Texture.from(st,{scaleMode:settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});nt.orig=new Rectangle,nt.trim=new Rectangle,this.texture=nt;const ot="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",lt=document.createElementNS(ot,"svg"),ut=document.createElementNS(ot,"foreignObject"),ct=document.createElementNS(at,"div"),dt=document.createElementNS(at,"style");ut.setAttribute("width","10000"),ut.setAttribute("height","10000"),ut.style.overflow="hidden",lt.appendChild(ut),this.maxWidth=Ql.defaultMaxWidth,this.maxHeight=Ql.defaultMaxHeight,this._domElement=ct,this._styleElement=dt,this._svgRoot=lt,this._foreignObject=ut,this._foreignObject.appendChild(dt),this._foreignObject.appendChild(ct),this._image=st,this._loadImage=new Image,this._autoResolution=Ql.defaultAutoResolution,this._resolution=Ql.defaultResolution??settings.RESOLUTION,this.text=et,this.style=rt}measureText(et){var dt,ht;const{text:rt,style:st,resolution:nt}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},et);Object.assign(this._domElement,{innerHTML:rt,style:st.toCSS(nt)}),this._styleElement.textContent=st.toGlobalCSS(),document.body.appendChild(this._svgRoot);const ot=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:at,height:lt}=ot;(at>this.maxWidth||lt>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const ut=Math.min(this.maxWidth,Math.ceil(at)),ct=Math.min(this.maxHeight,Math.ceil(lt));return this._svgRoot.setAttribute("width",ut.toString()),this._svgRoot.setAttribute("height",ct.toString()),rt!==this._text&&(this._domElement.innerHTML=this._text),st!==this._style&&(Object.assign(this._domElement,{style:(dt=this._style)==null?void 0:dt.toCSS(nt)}),this._styleElement.textContent=(ht=this._style)==null?void 0:ht.toGlobalCSS()),{width:ut+st.padding*2,height:ct+st.padding*2}}async updateText(et=!0){const{style:rt,_image:st,_loadImage:nt}=this;if(this.localStyleID!==rt.styleID&&(this.dirty=!0,this.localStyleID=rt.styleID),!this.dirty&&et)return;const{width:ot,height:at}=this.measureText();st.width=nt.width=Math.ceil(Math.max(1,ot)),st.height=nt.height=Math.ceil(Math.max(1,at)),this._updateID++;const lt=this._updateID;await new Promise(ut=>{nt.onload=async()=>{if(lt<this._updateID){ut();return}await rt.onBeforeDraw(),st.src=nt.src,nt.onload=null,nt.src="",this.updateTexture(),ut()};const ct=new XMLSerializer().serializeToString(this._svgRoot);nt.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(ct)}`})}get source(){return this._image}updateTexture(){const{style:et,texture:rt,_image:st,resolution:nt}=this,{padding:ot}=et,{baseTexture:at}=rt;rt.trim.width=rt._frame.width=st.width/nt,rt.trim.height=rt._frame.height=st.height/nt,rt.trim.x=-ot,rt.trim.y=-ot,rt.orig.width=rt._frame.width-ot*2,rt.orig.height=rt._frame.height-ot*2,this._onTextureUpdate(),at.setRealSize(st.width,st.height,nt),this.dirty=!1}_render(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._render(et)}_renderCanvas(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(et)}getLocalBounds(et){return this.updateText(!0),super.getLocalBounds(et)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(et){var st,nt,ot,at,lt;typeof et=="boolean"&&(et={children:et}),et=Object.assign({},Ql.defaultDestroyOptions,et),super.destroy(et);const rt=null;this.ownsStyle&&((st=this._style)==null||st.cleanFonts()),this._style=rt,(nt=this._svgRoot)==null||nt.remove(),this._svgRoot=rt,(ot=this._domElement)==null||ot.remove(),this._domElement=rt,(at=this._foreignObject)==null||at.remove(),this._foreignObject=rt,(lt=this._styleElement)==null||lt.remove(),this._styleElement=rt,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=rt,this._image.src="",this._image=rt}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(et){this.updateText(!0);const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._image.width/this.resolution,this._width=et}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(et){this.updateText(!0);const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._image.height/this.resolution,this._height=et}get style(){return this._style}set style(et){this._style!==et&&(et=et||{},et instanceof HTMLTextStyle?(this.ownsStyle=!1,this._style=et):et instanceof TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=HTMLTextStyle.from(et)):(this.ownsStyle=!0,this._style=new HTMLTextStyle(et)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(et){et=String(et===""||et===null||et===void 0?" ":et),et=this.sanitiseText(et),this._text!==et&&(this._text=et,this.dirty=!0)}get resolution(){return this._resolution}set resolution(et){this._autoResolution=!1,this._resolution!==et&&(this._resolution=et,this.dirty=!0)}sanitiseText(et){return et.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};_HTMLText.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},_HTMLText.defaultMaxWidth=2024,_HTMLText.defaultMaxHeight=2024,_HTMLText.defaultAutoResolution=!0;const MIN_HEIGHT=100,MIN_WIDTH=100,MODAL_VERTICAL_PADDING=450,MODAL_HORIZONTAL_PADDING=64,DEFAULT_QUALITY=.5,DEFAULT_SPRITE_NAME="image";function updateImageFromBlob(tt,{spriteName:et,imgDatasource:rt,settings:st}){const nt=URL.createObjectURL(rt),ot=new Image;return ot.src=nt,new Promise(at=>{ot.onload=async()=>{await updateImage(tt,{spriteName:et,imgDatasource:ot,settings:st});const lt=tt==null?void 0:tt.stage.getChildByName(et,!0);at(lt)}})}async function updateImage(tt,{spriteName:et,imgDatasource:rt,settings:st}){if(tt===void 0||tt.stage===null)return;const nt=tt.stage.getChildByName(et,!0);nt==null||nt.removeFromParent();const ot=rt instanceof HTMLImageElement?Texture.from(rt):rt instanceof Sprite?rt:await Texture.fromURL(rt),at=ot instanceof Sprite?ot:Sprite.from(ot,{});if(at.interactive=!0,at.name=et,st){const{sprite:{anchor:lt,position:ut,scale:ct,size:dt,rotation:ht},stage:{size:ft}}=st,xt=ht%Math.PI!==0;at.anchor.x=lt.x,at.anchor.y=lt.y,at.position.x=ut.x,at.position.y=ut.y,at.scale.x=ct.x,at.scale.y=ct.y,at.width=xt?dt.height:dt.width,at.height=xt?dt.width:dt.height,tt.stage.height=ft.height,tt.stage.width=ft.width,tt.renderer.resize(ft.width,ft.height),tt.stage.addChild(at)}else tt.stage.addChild(at),tt.renderer.resize(at.width,at.height);autoResize(tt,at)}function autoResize(tt,et){var rt;const st=tt.view.parentNode,nt=window.innerWidth-MODAL_HORIZONTAL_PADDING,ot=Math.max((st==null?void 0:st.offsetWidth)??0,MIN_WIDTH),at=constraintSize({width:et.width,height:et.height},{width:{max:Math.min(ot,nt),min:MIN_WIDTH},height:{min:MIN_HEIGHT,max:window.innerHeight-MODAL_VERTICAL_PADDING}}),{height:lt,width:ut}=at;(rt=tt.view)!=null&&rt.style&&(tt.view.style.width=`${ut}px`,tt.view.style.height=`${lt}px`)}function constraintSize(tt,et){const{height:rt,width:st}=tt,nt=st/rt,{height:ot,width:at}=et;let lt=at.max,ut=at.max/nt;return st>at.max&&(lt=at.max,ut=lt/nt),ut>ot.max&&(ut=ot.max,lt=ut*nt),lt<at.min&&(lt=at.min,ut=lt/nt),ut<ot.min&&(ut=ot.min,lt=ut*nt),{width:lt,height:ut}}function saveAsBlob(tt){return new Promise((et,rt)=>{var st;(st=tt==null?void 0:tt.view)!=null&&st.toBlob?tt.view.toBlob(nt=>{nt?et(nt):rt("EXTRACT_FAILED")},"image/jpeg",DEFAULT_QUALITY):rt("EXTRACT_FAILED")})}function saveAsDataURL(tt){var et,rt;return(rt=(et=tt.view).toDataURL)==null?void 0:rt.call(et)}function getApplicationScale(tt){return tt.view.getBoundingClientRect?tt.view.getBoundingClientRect().width/tt.view.width:1}function toBlob(tt){return new Promise((et,rt)=>{var st,nt;(nt=(st=tt.view).toBlob)==null||nt.call(st,ot=>{ot?et(ot):rt("EXTRACT_FAIL")},"image/png",1)})}function createImageSettings({application:tt,sprite:et}){return{sprite:{rotation:et.rotation,size:{width:et.width,height:et.height},position:{x:et.position.x,y:et.position.y},scale:{x:et.scale.x,y:et.scale.y},anchor:{x:et.anchor.x,y:et.anchor.y}},stage:{size:{width:tt.stage.width,height:tt.stage.height},scale:{x:tt.stage.scale.x,y:tt.stage.scale.y}}}}function resizeStage({application:tt,sprite:et,newHeight:rt,newWidth:st}){et.anchor.x=.5,et.anchor.y=.5,et.position=new Point(st/2,rt/2),tt.stage.height=rt,tt.stage.width=st,tt.renderer.resize(st,rt)}const DEFAULT_MAX_HISTORY=20,useHistoryTool=({maxSize:tt=DEFAULT_MAX_HISTORY,application:et,spriteName:rt,onRestore:st})=>{const[nt,ot]=reactExports.useState([]);reactExports.useEffect(()=>{ot([])},[et]);const at=async()=>{const ct=nt.pop();ct&&(st(await ct.backup,ct),ot(nt.filter(dt=>dt!==ct)))},lt=ct=>(ct.length>tt&&ct.splice(0,ct.length-tt),ct),ut=async ct=>{{if(!et)return;const dt=et.stage.getChildByName(rt,!0);if(dt==null)return;const ht=toBlob(et),ft={backup:ht,sprite:{rotation:dt.rotation,size:{width:dt.width,height:dt.height},position:{x:dt.position.x,y:dt.position.y},scale:{x:dt.scale.x,y:dt.scale.y},anchor:{x:dt.anchor.x,y:dt.anchor.y}},stage:{size:{width:et.stage.width,height:et.stage.height},scale:{x:et.stage.scale.x,y:et.stage.scale.y}}};return ot([...lt(nt),ft]),await ht,ct.call(ct)}};return{historyCount:nt.length,restore:at,historize:ut}};function aggregate(tt,et,rt){let st;const nt=[];return function(ot){nt.push(et(ot)),!st&&(st=setTimeout(()=>{const at=[...nt];nt.splice(0,nt.length),rt(at),st=void 0},tt))}}const BRUSH_SIZE=20,DEBOUNCE=50,CURSOR_NAME="BRUSH_CURSOR";function drawBrush(tt,et){const rt=new Graphics;for(const st of tt)st&&(rt.beginFill(16777215,1),rt.drawCircle(st.x,st.y,BRUSH_SIZE/et),rt.lineStyle(0),rt.endFill());return rt}function drawBlurListener(tt,{spriteName:et}){return aggregate(DEBOUNCE,rt=>tt.stage.toLocal(rt.global),rt=>{const st=tt.stage.getChildByName(et),nt=getApplicationScale(tt);if(st==null)return;const ot=new Sprite(st.texture);ot.filters=[new BlurFilter(8,4,Math.min(nt,1))],ot.width=st.width,ot.height=st.height,ot.scale=new Point(1,1),ot.anchor=st.anchor,ot.mask=drawBrush(rt,nt),st.addChild(ot)})}function drawCursor(tt){removeCursor(tt);const et=getApplicationScale(tt),rt=new Graphics;return rt.lineStyle(Math.max(1,1/et),16711680),rt.drawCircle(0,0,BRUSH_SIZE/et),rt.endFill(),rt.name=CURSOR_NAME,tt.stage.addChild(rt),rt}function removeCursor(tt){const et=tt.stage.getChildByName(CURSOR_NAME);et&&et.removeFromParent()}function moveCursorListener(tt){return et=>{if(!tt)return;const rt=tt.stage.toLocal(et.global),st=tt.stage.getChildByName(CURSOR_NAME,!0);st&&(st.position.x=rt.x,st.position.y=rt.y)}}function start$2(tt,{spriteName:et}){tt.stage.interactive=!0;const rt=drawCursor(tt),st=moveCursorListener(tt);tt.stage.on("pointermove",st);const nt=drawBlurListener(tt,{spriteName:et});tt.stage.on("pointerdown",()=>{tt.stage.on("pointermove",nt)});const ot=()=>{var at;(at=tt==null?void 0:tt.stage)==null||at.off("pointermove",nt)};globalThis.addEventListener("pointerup",ot),rt.once("destroyed",()=>{globalThis.removeEventListener("pointerup",ot)})}function stop$2(tt){removeCursor(tt),tt.stage.off("pointerdown"),tt.stage.off("pointermove")}const CORNERS=["TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT"],PADDING=0,POINT_RADIUS$1=20,CROP_BACKGROUND_NAME="CROP_BACKGROUND_NAME",CROP_MASK_NAME="CROP_MASK_NAME";function getCornerName$1(tt){return"CROP_CORNER_"+tt}function drawBackground(tt,{spriteName:et}){removeBackground(tt);const rt=tt.stage.getChildByName(et);if(rt==null)return;const st=rt.getBounds(),nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);ot.height=st.height,ot.width=st.width,ot.position=new Point(0,0);const at=new Graphics;at.beginFill(16777215,.5),at.drawRect(0,0,st.width,st.height),at.endFill(),at.name=CROP_BACKGROUND_NAME,at.position=new Point(st.x,st.y);const lt=new Graphics;lt.beginFill(0,1),lt.drawRect(0,0,st.width-2*PADDING,st.height-2*PADDING),lt.endFill(),lt.position=new Point(PADDING,PADDING),lt.name=CROP_MASK_NAME,ot.mask=lt,tt.stage.addChild(at),at.addChild(lt),at.addChild(ot)}function removeBackground(tt){const et=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0);et==null||et.removeFromParent()}function computeCornerPosition$1(tt,et){switch(tt){case"TOP_LEFT":return{x:et.x,y:et.y,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:et.x+et.width,y:et.y,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:et.x,y:et.y+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:et.x+et.width,y:et.y+et.height,start:Math.PI,end:3*Math.PI/2}}}function refreshCorners(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);et!=null&&CORNERS.forEach(rt=>{const st=tt.stage.getChildByName(getCornerName$1(rt),!0);if(st==null)return;const nt=computeCornerPosition$1(rt,{height:et.height,width:et.width,x:et.x,y:et.y});st.position=new Point(nt.x,nt.y)})}function drawCorner$1(tt,et,{spriteName:rt}){const st=tt.stage.getChildByName(getCornerName$1(et),!0),nt=getApplicationScale(tt);st==null||st.removeFromParent();const ot=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0),at=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(tt.stage.getChildByName(rt)==null||ot===null||ot===void 0||at===void 0||at===null)return;const ut=computeCornerPosition$1(et,{height:at.height,width:at.width,x:at.x,y:at.y}),ct=new Graphics;ct.beginFill(4960213,1),ct.arc(0,0,POINT_RADIUS$1/nt,ut.start,ut.end),ct.lineTo(0,0),ct.endFill(),ct.position=new Point(ut.x,ut.y),ct.name=getCornerName$1(et),ct.interactive=!0;let dt=!1;tt.stage.on("pointermove",xt=>{if(dt===!1)return;const vt=ot.toLocal(xt.global);ct.position.x=vt.x,ct.position.y=vt.y,moveMask(tt,et,vt)});const ht=()=>{dt=!0};ct.on("pointerdown",ht);const ft=()=>{dt=!1};globalThis.addEventListener("pointerup",ft),ct.once("destroyed",()=>{ct.off("pointerdown"),globalThis.removeEventListener("pointerup",ft)}),ot.addChild(ct)}function moveMask(tt,et,rt){const st=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(st==null)return;const nt=st.position.x+st.width,ot=st.position.y+st.height;switch(et){case"TOP_LEFT":{st.position.x=rt.x,st.position.y=rt.y,st.width=nt-rt.x,st.height=ot-rt.y;break}case"TOP_RIGHT":{st.position.y=rt.y,st.width=rt.x-st.position.x,st.height=ot-rt.y;break}case"BOTTOM_LEFT":{st.position.x=rt.x,st.width=nt-rt.x,st.height=rt.y-st.position.y;break}case"BOTTOM_RIGHT":{st.width=rt.x-st.position.x,st.height=rt.y-st.position.y;break}}refreshCorners(tt)}function start$1(tt,{spriteName:et}){stop$1(tt),tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,drawBackground(tt,{spriteName:et}),drawCorner$1(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner$1(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner$1(tt,"TOP_LEFT",{spriteName:et}),drawCorner$1(tt,"TOP_RIGHT",{spriteName:et})}function stop$1(tt){removeBackground(tt),tt.stage.off("pointermove"),tt.render()}function save$1(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(et==null)return;stop$1(tt);const rt=tt.renderer.generateTexture(tt.stage).clone(),st=new Sprite(rt),nt=et.getBounds(),ot=new Rectangle(Math.floor(nt.x),Math.floor(nt.y),Math.floor(nt.width),Math.floor(nt.height)),at=new Texture(st.texture.baseTexture,ot);return new Sprite(at)}const POINT_RADIUS=20,CONTROL_NAME="CONTROL_NAME";function getCornerName(tt){return"RESIZE_CORNER_"+tt}function computeCornerPosition(tt,et){const rt=et.x,st=et.y;switch(tt){case"TOP_LEFT":return{x:rt,y:st,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:rt+et.width,y:st,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:rt,y:st+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:rt+et.width,y:st+et.height,start:Math.PI,end:3*Math.PI/2}}}function resizeContainer(tt,{container:et,cornerType:rt,position:st,spriteName:nt}){const ot=tt.stage.getChildByName(nt,!0);if(ot==null)return;const at=ot.rotation%Math.PI!==0,lt=at?ot.height:ot.width,ut=at?ot.width:ot.height;switch(rt){case"TOP_LEFT":{et.position=new Point(st.x,st.y),et.width=lt-2*st.x,et.height=ut-2*st.y;break}case"TOP_RIGHT":{const ct=lt-st.x;et.position=new Point(ct,st.y),et.width=lt-2*ct,et.height=ut-2*st.y;break}case"BOTTOM_LEFT":{const ct=ut-st.y;et.position=new Point(st.x,ct),et.width=lt-2*st.x,et.height=ut-2*ct;break}case"BOTTOM_RIGHT":{const ct=ut-st.y,dt=lt-st.x;et.position=new Point(dt,ct),et.width=lt-2*dt,et.height=ut-2*ct;break}}}function removeCorner(tt,et){const rt=tt.stage.getChildByName(getCornerName(et),!0);rt==null||rt.removeFromParent()}function drawCorner(tt,et,{spriteName:rt}){removeCorner(tt,et);const st=tt.stage.getChildByName(rt,!0),nt=tt.stage.getChildByName(CONTROL_NAME,!0);if(st==null||nt===null||nt===void 0)return;const ot=computeCornerPosition(et,nt),at=new Graphics;at.beginFill(4960213,1),at.arc(0,0,POINT_RADIUS,ot.start,ot.end),at.lineTo(0,0),at.endFill(),at.position=new Point(ot.x,ot.y),at.name=getCornerName(et),at.interactive=!0;let lt=!1;tt.stage.on("pointermove",dt=>{if(lt===!1)return;const ht=tt.stage.toLocal(dt.global);resizeContainer(tt,{cornerType:et,position:ht,container:nt,spriteName:rt})});const ut=()=>{lt=!1};globalThis.addEventListener("pointerup",ut),at.once("destroyed",()=>{at.off("pointerdown"),globalThis.removeEventListener("pointerup",ut)});const ct=()=>{lt=!0};at.on("pointerdown",ct),nt.addChild(at)}function drawContainer(tt,et){removeContainer(tt);const rt=tt.stage.getChildByName(et,!0);if(rt==null)return;const st=tt.renderer.generateTexture(tt.stage),nt=new Sprite(st);tt.stage.children.forEach(at=>{at.alpha=0});const ot=new Graphics;ot.drawRect(0,0,rt.width,rt.height),ot.name=CONTROL_NAME,ot.interactive=!0,ot.interactiveChildren=!0,tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,tt.stage.addChild(ot),ot.addChild(nt)}function removeContainer(tt){const et=tt.stage.getChildByName(CONTROL_NAME,!0);et==null||et.removeFromParent(),tt.stage.children.forEach(rt=>{rt.alpha=1})}function drawControl(tt,et){drawContainer(tt,et),drawCorner(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner(tt,"TOP_LEFT",{spriteName:et}),drawCorner(tt,"TOP_RIGHT",{spriteName:et})}function removeControl(tt){removeContainer(tt),removeCorner(tt,"BOTTOM_LEFT"),removeCorner(tt,"BOTTOM_RIGHT"),removeCorner(tt,"TOP_LEFT"),removeCorner(tt,"TOP_RIGHT"),tt.stage.off("pointermove")}function start(tt,et){drawControl(tt,et)}function stop(tt){removeControl(tt),tt.stage.off("pointermove"),tt.render()}function save(tt){var et;const rt=(et=tt==null?void 0:tt.stage)==null?void 0:et.getChildByName(CONTROL_NAME,!0),st=rt?{height:rt.height,width:rt.width}:void 0;if(removeControl(tt),st){const nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);return ot.width=st.width,ot.height=st.height,ot}else return}async function rotate(tt,et){const rt=tt==null?void 0:tt.stage.getChildByName(et,!0);if(tt&&rt){if(!tt)return;const st=await toBlob(tt),nt=await updateImageFromBlob(tt,{imgDatasource:st,spriteName:et,settings:createImageSettings({application:tt,sprite:rt})});if(!nt)return;let ot,at;const lt=tt.view;lt.style&&(ot=lt.style.maxHeight??"",at=lt.style.visibility??"",lt.style.maxHeight=`${lt.clientHeight}px`,lt.style.visibility="hidden"),nt.rotation+=Math.PI/2,resizeStage({application:tt,sprite:nt,newHeight:nt.width,newWidth:nt.height}),tt.render();const ut=await toBlob(tt);ot!==void 0&&(lt.style.maxHeight=ot),at!==void 0&&(lt.style.visibility=at),await updateImageFromBlob(tt,{imgDatasource:ut,spriteName:et})}}function useImageEffects({application:tt,spriteName:et,onSave:rt}){return{rotate:async()=>{tt&&await rotate(tt,et)},startCrop:()=>{tt&&start$1(tt,{spriteName:et})},stopCrop:st=>{if(tt){if(st){const nt=save$1(tt);nt&&rt(nt)}stop$1(tt)}},startBlur:()=>{tt&&start$2(tt,{spriteName:et})},stopBlur:()=>{tt&&stop$2(tt)},startResize:()=>{tt&&start(tt,et)},stopResize:st=>{if(tt){if(st){const nt=save(tt);nt&&rt(nt)}stop(tt)}}}}function useImageEditor({imageSrc:tt,spriteName:et=DEFAULT_SPRITE_NAME}){const[rt,st]=reactExports.useState(void 0),[nt,ot]=reactExports.useState(!0),{rotate:at,startBlur:lt,startCrop:ut,startResize:ct,stopBlur:dt,stopCrop:ht,stopResize:ft}=useImageEffects({spriteName:et,application:rt,onSave(wt){rt&&updateImage(rt,{imgDatasource:wt,spriteName:et})}}),xt=()=>rt?saveAsBlob(rt):Promise.resolve(void 0),vt=()=>{if(rt)return saveAsDataURL(rt)},{restore:yt,historize:Et,historyCount:bt}=useHistoryTool({application:rt,spriteName:et,onRestore(wt,St){rt&&updateImageFromBlob(rt,{imgDatasource:wt,spriteName:et,settings:St})}});return reactExports.useEffect(()=>{rt&&(ot(!0),updateImage(rt,{spriteName:et,imgDatasource:tt}).finally(()=>ot(!1)))},[rt,tt,et]),{historyCount:bt,setApplication:st,restore:yt,stopCrop:ht,stopBlur:dt,stopResize:ft,startResize:async()=>{ot(!0),await Et(ct),ot(!1)},startCrop:async()=>{ot(!0),await Et(ut),ot(!1)},startBlur:async()=>{ot(!0),await Et(lt),ot(!1)},rotate:async()=>{ot(!0),await Et(at),ot(!1)},toBlob:xt,toDataURL:vt,loading:nt}}const SvgIconBlur=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-blur_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M17.504 1.673a1 1 0 0 1 .932.491c.37.63.9 1.935 1.404 3.18l.08.197c.502 1.24.994 2.457 1.369 3.205l-.895.447.895-.447c.561 1.122 1.962 4.049 2.136 6.753.087 1.364-.125 2.839-1.094 3.978-.987 1.16-2.573 1.76-4.757 1.76-2.186 0-3.777-.6-4.777-1.752-.983-1.134-1.221-2.604-1.152-3.973.138-2.711 1.514-5.636 2.13-6.79.86-1.611 2.414-5.32 2.874-6.433a1 1 0 0 1 .855-.616m.104 3.492c-.657 1.533-1.496 3.425-2.07 4.5-.59 1.106-1.781 3.703-1.895 5.949-.057 1.11.158 1.976.665 2.56.49.565 1.427 1.063 3.266 1.063 1.84 0 2.76-.498 3.233-1.055.492-.579.694-1.44.622-2.555-.145-2.253-1.36-4.848-1.929-5.986-.412-.823-.932-2.108-1.417-3.308l-.097-.238q-.196-.487-.378-.93M12.843 22.535a1 1 0 0 1-1.034.964l-.259-.009a1 1 0 0 1-.257-.042q-.125.029-.26.024l-.257-.009a11 11 0 0 1-2.102-.279 1 1 0 0 1 .457-1.947 9 9 0 0 0 1.715.228l.258.009q.134.004.257.042.125-.028.26-.024l.257.009a1 1 0 0 1 .965 1.034m-6.615-1.329a1 1 0 0 1-1.396.226 10.9 10.9 0 0 1-2.877-3.086 1 1 0 1 1 1.7-1.054 8.9 8.9 0 0 0 2.347 2.518 1 1 0 0 1 .226 1.396M1.622 15.22a1 1 0 0 1-1.147-.827 10.9 10.9 0 0 1 .148-4.218 1 1 0 0 1 1.947.457 8.9 8.9 0 0 0-.12 3.441 1 1 0 0 1-.828 1.147m.978-7.49a1 1 0 0 1-.226-1.397A10.9 10.9 0 0 1 5.46 3.455a1 1 0 0 1 1.054 1.7 8.9 8.9 0 0 0-2.518 2.347 1 1 0 0 1-1.396.226m5.988-4.607a1 1 0 0 1 .827-1.147 11 11 0 0 1 2.116-.132l.258.01q.135.004.257.042.125-.03.26-.025l.258.01a1 1 0 0 1-.07 1.998l-.258-.009a1 1 0 0 1-.258-.043q-.125.03-.259.025l-.258-.009a9 9 0 0 0-1.727.108 1 1 0 0 1-1.146-.828"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-blur_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconCrop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{clipPath:"url(#icon-crop_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7.13 1.009a1 1 0 1 0-2-.018l-.036 4.103-4.103.036a1 1 0 1 0 .018 2l4.068-.035L5 15.99V16a3 3 0 0 0 3 3h9v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V8a3 3 0 0 0-3-3l-8.905.077zm-.053 6.068L7 16.004A1 1 0 0 0 8 17h9V8a1 1 0 0 0-.996-1z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-crop_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconUndo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.707 13.707a1 1 0 0 0 0-1.414L5.414 8l4.293-4.293a1 1 0 0 0-1.414-1.414l-5 5a1 1 0 0 0 0 1.414l5 5a1 1 0 0 0 1.414 0",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 20a1 1 0 0 0 1-1v-7a5 5 0 0 0-5-5H4a1 1 0 1 0 0 2h12a3 3 0 0 1 3 3v7a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),ImageEditorToolbar=({historyCount:tt,handle:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(void 0),ot=lt=>{nt(lt),et(lt)},at=[{type:"button",name:"undo",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconUndo,{}),"aria-label":rt("cancel"),children:rt("cancel"),onClick:()=>ot("UNDO"),disabled:tt===0},tooltip:rt("cancel")},{type:"divider",name:"div-1"},{type:"button",name:"reset",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),"aria-label":rt("rotate"),children:rt("rotate"),onClick:()=>ot("ROTATE")},tooltip:rt("rotate")},{type:"button",name:"crop",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconCrop,{}),"aria-label":rt("crop"),children:rt("crop"),className:st==="CROP"?"is-selected":"",onClick:()=>ot("CROP")},tooltip:rt("crop")},{type:"button",name:"blur",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBlur,{}),"aria-label":rt("blur"),children:rt("blur"),className:st==="BLUR"?"is-selected":"",onClick:()=>ot("BLUR")},tooltip:rt("blur")}];return jsxRuntimeExports.jsx(Toolbar,{variant:"no-shadow",align:"left",isBlock:!0,items:at})},ImageEditor=({altText:tt,legend:et,image:rt,isOpen:st,onCancel:nt,onError:ot,onSave:at})=>{const{t:lt}=useTranslation(),[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(!1),[ft,xt]=reactExports.useState(tt??""),[vt,yt]=reactExports.useState(et??""),[Et,bt]=reactExports.useState(!1),{toBlob:wt,setApplication:St,startBlur:Rt,stopBlur:Ct,restore:It,rotate:jt,startCrop:Pt,stopCrop:Ot,startResize:Ut,stopResize:Nt,historyCount:Ht,loading:Lt}=useImageEditor({imageSrc:rt}),kt=()=>{Ct(),Ot(ut==="CROP"),Nt(ut==="RESIZE")},$t=async()=>{try{ht(!0),kt();const Mt=await wt();Mt&&await at({blob:Mt,legend:vt,altText:ft})}catch(Mt){ot==null||ot(`${Mt}`)}finally{ht(!1)}},Ft=()=>{nt()},Gt=async Mt=>{switch(kt(),ct(Mt),bt(!0),Mt){case"ROTATE":{await jt();break}case"UNDO":{await It();break}case"CROP":{Pt();break}case"RESIZE":{await Ut();break}case"BLUR":{await Rt();break}}};return jsxRuntimeExports.jsxs(Modal,{id:"image-editor",isOpen:st,onModalClose:Ft,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Ft,children:jsxRuntimeExports.jsx("span",{className:"h2",children:lt("imageeditor.title")})}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex flex-column align-items-center",children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-12 w-100 flex-grow-1",children:[jsxRuntimeExports.jsx(ImageEditorToolbar,{handle:Gt,historyCount:Ht}),jsxRuntimeExports.jsxs("div",{className:"position-relative d-flex flex-column align-items-center justify-content-center flex-grow-1 w-100 image-editor",children:[jsxRuntimeExports.jsx(moduleExports.Stage,{onMount:Mt=>St(Mt),options:{preserveDrawingBuffer:!0,backgroundAlpha:0,resolution:1}}),!!Lt&&jsxRuntimeExports.jsx("div",{className:"position-absolute top-0 start-0 bottom-0 end-0 m-10 d-flex align-items-center justify-content-center bg-black opacity-25",children:jsxRuntimeExports.jsx(LoadingScreen,{})})]}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row m-10 gap-12 w-100",children:[jsxRuntimeExports.jsxs(FormControl,{id:"alt",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("alttext")}),jsxRuntimeExports.jsx(Input,{value:ft,onChange:Mt=>{bt(!0),xt(Mt.target.value)},placeholder:lt("alttext.help"),size:"md",type:"text"})]}),jsxRuntimeExports.jsxs(FormControl,{id:"legend",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("legend")}),jsxRuntimeExports.jsx(Input,{value:vt,onChange:Mt=>{bt(!0),yt(Mt.target.value)},placeholder:lt("legend.help"),size:"md",type:"text"})]})]})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:Ft,type:"button",variant:"ghost",children:lt("imageeditor.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:$t,type:"button",variant:"filled",isLoading:dt,disabled:dt||!Et,children:lt("imageeditor.save")})]})]})},UploadFiles=({onFilesChange:tt,visibility:et="protected"})=>{const{files:rt,uploadedFiles:st,getUploadStatus:nt,uploadFile:ot,removeFile:at,updateImage:lt,editingImage:ut,setEditingImage:ct,getUrl:dt}=useUploadFiles({handleOnChange:tt,application:"media-library",visibility:et}),ht=reactExports.useRef(new Map);reactExports.useEffect(()=>{const vt=ht.current;return()=>{vt.forEach(yt=>URL.revokeObjectURL(yt)),vt.clear()}},[]);const ft=vt=>{const yt=vt.type.startsWith("image")?ht.current.get(vt.name):"";return ht.current.has(vt.name)||ht.current.set(vt.name,URL.createObjectURL(vt)),{name:vt.name,info:{type:vt.type,weight:c$2(vt.size||0,1)},src:yt}},xt=vt=>{const yt=ht.current.get(vt.name);yt&&(URL.revokeObjectURL(yt),ht.current.delete(vt.name)),at(vt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[rt.map(vt=>{const yt=st.find(Et=>Et.name===vt.name);return jsxRuntimeExports.jsx(UploadCard,{status:nt(vt),item:ft(vt),onEdit:()=>ct(yt),onRetry:()=>ot(vt),onDelete:()=>xt(vt)},vt.name)}),ut&&jsxRuntimeExports.jsx(ImageEditor,{altText:ut.alt,legend:ut.title,image:dt(ut,!0),isOpen:!!ut,onCancel:()=>ct(void 0),onSave:lt,onError:console.error})]})},acceptedTypes=tt=>{const et=[];switch(tt){case"audio":et.push("audio/*");break;case"video":et.push("video/*");break;case"image":et.push("image/png"),et.push("image/jpeg"),et.push("image/webp"),et.push("image/gif"),et.push("image/avif");break}return et},Upload=()=>{const{type:tt,visibility:et,multiple:rt,setResult:st,setResultCounter:nt,setCancellable:ot}=useMediaLibraryContext(),at=lt=>{lt.length?(ot(lt),nt(lt.length),st(lt)):(ot([]),nt(void 0),st(void 0))};return jsxRuntimeExports.jsx("div",{className:"py-8 flex-grow-1",children:jsxRuntimeExports.jsx(Dropzone,{multiple:rt,accept:acceptedTypes(tt??"embedder"),children:jsxRuntimeExports.jsx(UploadFiles,{onFilesChange:at,visibility:et})})})},VIDEO_HEIGHT=9,VIDEO_WIDTH=16;function useCameras(){const{device:tt}=useBrowserInfo(navigator.userAgent),{t:et}=useTranslation(),[rt,st]=reactExports.useState([]),[nt,ot]=reactExports.useState({audio:!0,video:!0}),[at,lt]=reactExports.useState();async function ut(){return(await navigator.mediaDevices.enumerateDevices()).filter(ft=>ft.kind==="videoinput")}const ct=async ft=>{try{const xt=await navigator.mediaDevices.getUserMedia(ft);lt(xt)}catch(xt){console.error(xt)}},dt=()=>{at==null||at.getTracks().forEach(ft=>ft.stop()),ct(nt)},ht=ft=>{let xt={};ft!=null&&ft.deviceId?(ft.deviceId==="environment"||ft.deviceId==="user"?xt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,facingMode:ft==null?void 0:ft.deviceId}}:xt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,deviceId:{exact:ft.deviceId}}},ot(xt)):console.error("Selected input device id is null")};return reactExports.useEffect(()=>{dt()},[nt]),reactExports.useEffect(()=>{async function ft(){await ct(nt);const xt=await ut();switch(tt.type){case"mobile":case"tablet":{const vt={deviceId:"environment",label:et("video.back.camera"),groupId:"",kind:"videoinput"},yt={deviceId:"user",label:et("video.front.camera"),groupId:"",kind:"videoinput"};(xt==null?void 0:xt.length)>1?st([vt,yt]):st([vt]);break}default:st(xt);break}}ft()},[]),{inputDevices:rt,setPreferedDevice:ht,stream:at,restartStream:dt}}const SvgIconRecordStop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4z"})]}),VideoRecorderToolbar=({playing:tt,recording:et,recorded:rt,saving:st,saved:nt,hideSaveAction:ot,handleRecord:at,handleStop:lt,handlePlayPause:ut,handleReset:ct,handleSave:dt})=>{const{t:ht}=useTranslation(),ft=[{type:"icon",name:"record",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{color:et||rt?"":"red"}),color:"danger",disabled:et||rt||st,onClick:at,"aria-label":ht("bbm.video.record.start")},tooltip:ht("bbm.video.record.start")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordStop,{}),disabled:!et||rt||st,onClick:lt,"aria-label":ht("bbm.video.record.stop")},tooltip:ht("bbm.video.record.stop")},{type:"icon",name:"play",visibility:tt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:!rt||st,onClick:ut,"aria-label":ht("bbm.video.play.start")},tooltip:ht("bbm.video.play.start")},{type:"icon",name:"pause",visibility:tt?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),disabled:!rt||st,onClick:ut,"aria-label":ht("bbm.video.play.pause")},tooltip:ht("bbm.video.play.pause")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:!rt||st,onClick:ct,"aria-label":ht("bbm.video.record.reset")},tooltip:ht("bbm.video.record.reset")},{type:"icon",name:"save",visibility:ot?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:!rt||st||nt,onClick:dt,"aria-label":ht("bbm.video.record.save")},tooltip:ht("bbm.video.record.save")}];return jsxRuntimeExports.jsx(Toolbar,{items:ft,className:"position-absolute bottom-0 start-50 bg-white"})},VideoRecorder=reactExports.forwardRef(({appCode:tt,caption:et,onSuccess:rt,onError:st,onRecordUpdated:nt,hideSaveAction:ot=!1},at)=>{const{inputDevices:lt,setPreferedDevice:ut,restartStream:ct,stream:dt}=useCameras(),[ht,ft]=reactExports.useState(18e4),[xt,vt]=reactExports.useState(!1),[yt,Et]=reactExports.useState(!1),[bt,wt]=reactExports.useState(!1),[St,Rt]=reactExports.useState(!1),[Ct,It]=reactExports.useState(!1),[jt,Pt]=reactExports.useState(""),[Ot,Ut]=reactExports.useState([]),[Nt,Ht]=reactExports.useState(),[Lt,kt]=reactExports.useState(0),[$t,Ft]=reactExports.useState(0),Gt=reactExports.useRef(null),Mt=reactExports.useRef(null),{uploadBlob:Vt}=useUpload(void 0,tt);reactExports.useImperativeHandle(at,()=>({save:ur}));const{t:Bt}=useTranslation();reactExports.useEffect(()=>{qt()},[]);async function qt(){try{const or=await odeServices.video().getVideoConf();ft(or.maxDuration*60*1e3)}catch{ft(3*60*1e3)}}reactExports.useEffect(()=>{try{Gt.current&&(Gt.current.src&&(window.URL.revokeObjectURL(Gt.current.src),Gt.current.src=""),Gt.current.srcObject instanceof MediaStream&&(Gt.current.srcObject=null),dt&&(Gt.current.srcObject=dt,Gt.current.autoplay=!0,Gt.current.volume=1,Gt.current.muted=!0,Gt.current.load()))}catch(or){console.error(or)}},[dt]),reactExports.useEffect(()=>{if(Ot.length&&!xt&&Gt.current){const or=new Blob(Ot,{type:jt});if(Ht(or),nt){const hr=window.URL.createObjectURL(or);nt(hr)}Gt.current.autoplay=!1,Gt.current.srcObject=null,Gt.current.src=window.URL.createObjectURL(or)}},[xt,Ot]),reactExports.useEffect(()=>{if(xt){const or=Date.now(),hr=window.setInterval(()=>kt(Date.now()-or),500);return()=>{window.clearInterval(hr)}}},[xt]),reactExports.useEffect(()=>{if(bt){const or=window.setInterval(()=>Ft(hr=>hr+500),500);return()=>{window.clearInterval(or)}}},[bt]);const Qt=reactExports.useCallback(()=>{vt(!0),Gt&&Gt.current&&(Gt.current.muted=!0);const or=o$2();Pt(or),dt&&(Mt.current=new MediaRecorder(dt,{mimeType:or}),Mt.current.ondataavailable=({data:hr})=>{hr.size>0&&Ut(pr=>[...pr,hr])},Mt.current.onerror=hr=>console.error(hr),Mt.current.start(1e3))},[dt]),Yt=reactExports.useCallback(()=>{var or;vt(!1),Et(!0),((or=Mt.current)==null?void 0:or.state)==="recording"&&(Mt.current.requestData(),Mt.current.stop())},[Mt]),tr=reactExports.useCallback(()=>{var or,hr;Gt&&Gt.current&&(Gt.current.muted=!1),bt?((hr=Gt==null?void 0:Gt.current)==null||hr.pause(),wt(!1)):((or=Gt==null?void 0:Gt.current)==null||or.play(),wt(!0))},[bt]),lr=()=>{Et(!1),vt(!1),wt(!1),It(!1),kt(0),Ut([]),Ht(void 0),ct(),nt&&nt()},ur=async()=>{var or;if((or=Gt==null?void 0:Gt.current)==null||or.pause(),Rt(!0),!Nt){console.error("Error while saving video: recorded video is undefined.");return}const hr=await Vt(Nt,{duration:Lt});if(hr!=null)return rt==null||rt([hr]),Rt(!1),It(!0),[hr];st("Error while uploading video"),Rt(!1),It(!0)},mr=()=>{wt(!1),Ft(0),Gt.current&&(Gt.current.currentTime=0)},yr=or=>{var hr;const pr=lt.find(_r=>_r.label===or);((hr=Mt.current)==null?void 0:hr.state)==="recording"&&(Mt.current.requestData(),Mt.current.stop()),ut(pr)};return reactExports.useEffect(()=>{Lt>=ht&&Yt()},[Lt,Yt]),jsxRuntimeExports.jsxs("div",{className:"video-recorder d-flex flex-fill flex-column align-items-center pb-8",children:[jsxRuntimeExports.jsx("div",{className:"video-recorder-caption d-none d-md-block",children:et}),lt.length>1&&jsxRuntimeExports.jsx("div",{className:"video-recorder-devices mb-12",children:jsxRuntimeExports.jsxs(FormControl,{id:"selectInputDevice",children:[jsxRuntimeExports.jsx(Label,{className:"d-none d-md-block",children:Bt("bbm.video.record.select.devices.label")}),jsxRuntimeExports.jsx(Select,{placeholderOption:Bt("bbm.video.record.select.devices.placeholder"),options:lt.map(or=>or.label),onValueChange:yr})]})}),jsxRuntimeExports.jsxs("div",{className:"video-recorder-video-container position-relative align-self-stretch",children:[jsxRuntimeExports.jsx("video",{ref:Gt,playsInline:!0,autoPlay:!0,controls:!1,muted:!0,onEnded:mr,className:"rounded",children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),(xt||yt)&&jsxRuntimeExports.jsxs("div",{className:"video-recorder-time d-flex align-items-center font-monospace fs-6 text-bg-dark rounded",children:[xt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,color:"red",className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$4(Lt),"/",n$4(ht)]})]}),yt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecordVideo,{width:14,height:14,className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$4($t),"/",n$4(Lt)]})]})]}),dt&&jsxRuntimeExports.jsx(VideoRecorderToolbar,{playing:bt,recording:xt,recorded:yt,saving:St,saved:Ct,hideSaveAction:ot,handleRecord:Qt,handleStop:Yt,handlePlayPause:tr,handleReset:lr,handleSave:ur})]}),St&&jsxRuntimeExports.jsx(LoadingScreen,{position:!1,caption:Bt("bbm.video.save.loader.caption")})]})}),Video=()=>{const{appCode:tt,setResult:et,setPreSuccess:rt}=useMediaLibraryContext(),{t:st}=useTranslation(),nt=reactExports.useRef(null),ot=lt=>{lt?(et(lt),rt(()=>nt.current.save)):et()},at=lt=>{console.error(lt)};return jsxRuntimeExports.jsx(VideoRecorder,{ref:nt,appCode:tt,caption:st("bbm.video.caption"),onRecordUpdated:ot,onError:at,hideSaveAction:!0})},SvgIconArrowRight=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L17.586 12l-6.293-6.293a1 1 0 0 1 0-1.414",clipRule:"evenodd"})]}),illuError="/assets/js/ode-explorer/illu-error.svg",illuError$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuError},Symbol.toStringTag,{value:"Module"})),VideoEmbed=({switchType:tt,onSuccess:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(),[ot,at]=reactExports.useState(),[lt,ut]=reactExports.useState(void 0),[ct,dt]=reactExports.useState(),ht=useDebounce(st||"",300),ft=reactExports.useId();reactExports.useEffect(()=>{xt()},[]),reactExports.useEffect(()=>{if(ct&&ht){const bt=odeServices.embedder().getProviderFromUrl(ct,ht);if(bt){ut(bt);const wt=odeServices.embedder().getEmbedCodeForProvider(bt,ht);at(wt),et(wt)}else ut(void 0),et()}},[ht,ct]);const xt=async()=>{const bt=await Promise.all([odeServices.embedder().getDefault(),odeServices.embedder().getCustom()]).then(wt=>wt.flat());dt(bt)};function vt(bt){const wt=bt.currentTarget.value;nt(wt),et(wt!=null&&wt.length?wt:void 0)}function yt(){tt==null||tt("embedder")}const Et=()=>ht?lt?jsxRuntimeExports.jsxs("div",{className:"mx-auto mt-16",children:[jsxRuntimeExports.jsxs("div",{className:"video-embed-provider d-flex align-items-center",children:[jsxRuntimeExports.jsx(Image$1,{src:lt.logo,alt:"Logo "+lt.displayName,className:"video-embed-provider-logo"}),lt.displayName]}),ot&&jsxRuntimeExports.jsx("div",{className:"video-embed-preview mt-12",dangerouslySetInnerHTML:{__html:ot}})]}):jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column align-items-center m-16",children:[jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuError,title:rt("bbm.video.previewError.title"),text:rt("bbm.video.previewError.text")}),tt&&jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:yt,className:"align-items-start mt-16",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})]}):tt&&jsxRuntimeExports.jsx("div",{className:"d-flex my-16 align-items-start",children:jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:yt,className:"align-items-start",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})});return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill video-embed",children:[jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconGlobe,{className:"me-8"}),rt("bbm.video.url.title")]}),jsxRuntimeExports.jsx(FormControl,{id:ft,children:jsxRuntimeExports.jsx(Input,{size:"md",type:"text",placeholder:rt("bbm.video.url.placeholder"),onChange:vt})}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Et()})]})},VideoEmbedder=()=>{const{switchType:tt,setResult:et}=useMediaLibraryContext();return jsxRuntimeExports.jsx(VideoEmbed,{switchType:tt,onSuccess:rt=>{et(rt)}})},SvgIconSortAscendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 16.293a1 1 0 0 1 1.414 0L7 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 4a1 1 0 0 1 1 1v15a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconSortDescendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 8.707a1 1 0 0 0 1.414 0L7 6.414l2.293 2.293a1 1 0 0 0 1.414-1.414l-3-3a1 1 0 0 0-1.414 0l-3 3a1 1 0 0 0 0 1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 21a1 1 0 0 0 1-1V5a1 1 0 0 0-2 0v15a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),SvgIconSortTime=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.509 6.027a6.138 6.138 0 1 1-.28 12.099 1 1 0 1 0-.383 1.963A8.138 8.138 0 1 0 9.653 5.488a1 1 0 1 0 1.168 1.624 6.1 6.1 0 0 1 2.688-1.085",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.38 8.252a1 1 0 0 0-1 1v3.8a1 1 0 0 0 .456.838l2.052 1.332a1 1 0 0 0 1.089-1.678l-1.597-1.036V9.252a1 1 0 0 0-1-1M1.793 16.293a1 1 0 0 1 1.414 0L5.5 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 4a1 1 0 0 0-1 1v15a1 1 0 1 0 2 0V5a1 1 0 0 0-1-1",clipRule:"evenodd"})]}),illuTrash="/assets/js/ode-explorer/illu-trash.svg",illuTrash$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTrash},Symbol.toStringTag,{value:"Module"})),Grid=({children:tt,className:et,...rt})=>{const st=clsx("grid",et);return jsxRuntimeExports.jsx("div",{className:st,...rt,children:tt})},Column=({sm:tt,md:et,lg:rt,xl:st,children:nt,className:ot,as:at,...lt})=>{const ut=at||"div",ct=clsx({[`g-col-${tt}`]:tt,[et?`g-col-md-${et}`:""]:et,[rt?`g-col-lg-${rt}`:""]:rt,[st?`g-col-xl-${st}`:""]:st},ot);return jsxRuntimeExports.jsx(ut,{className:ct,...lt,children:nt})};Grid.Col=Column;const SvgIconLandscape=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.222 5.037c-.895 0-1.222.555-1.222.792v12.675c0 .237.327.792 1.222.792h1.364l9.707-9.886a.987.987 0 0 1 1.414 0L21 13.782V5.829c0-.237-.328-.792-1.222-.792zM23 16.224V5.829C23 4.066 21.337 3 19.778 3H4.222C2.662 3 1 4.066 1 5.83v12.674c0 1.763 1.662 2.829 3.222 2.829h15.556c1.56 0 3.222-1.066 3.222-2.83v-2.279m-2 .439-5-5.093-7.585 7.726h11.363c.894 0 1.222-.555 1.222-.792zM8 8.093c-.552 0-1 .455-1 1.018a1.01 1.01 0 0 0 1 1.018c.552 0 1-.456 1-1.018a1.01 1.01 0 0 0-1-1.019M5 9.11c0-1.688 1.343-3.056 3-3.056s3 1.368 3 3.056-1.343 3.055-3 3.055-3-1.368-3-3.055",clipRule:"evenodd"})]}),SvgIconTextPage=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.286 3c-.35 0-.68.135-.92.368-.238.231-.366.54-.366.854v15.556c0 .315.128.623.367.854.239.233.569.368.919.368h11.428c.35 0 .68-.135.92-.368.238-.231.366-.54.366-.854V8h-3a2 2 0 0 1-2-2V3zM16 6h1.986L16 4.08zm5 13.778V6.556a1 1 0 0 0-.305-.72L15.98 1.281A1 1 0 0 0 15.286 1h-9a3.32 3.32 0 0 0-2.314.934A3.2 3.2 0 0 0 3 4.222v15.556c0 .864.353 1.686.972 2.288S5.423 23 6.286 23h11.428c.863 0 1.695-.333 2.314-.934.619-.602.972-1.424.972-2.288M8 6a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm-1 6a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1m5 4a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2z",clipRule:"evenodd"})]}),SvgIconVideo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 4.962C4 4.376 4.435 4 4.853 4H6.5v2H4zM4 8h2.5v3H4zm-2 4V4.962C2 3.381 3.224 2 4.853 2h13.294C19.776 2 21 3.38 21 4.962v14.076C21 20.619 19.776 22 18.147 22H4.853C3.224 22 2 20.62 2 19.038zm17-6V4.962c0-.586-.435-.962-.853-.962H16.5v2zm0 2h-2.5v3H19zm-2.5 5H19v3h-2.5zm0 5H19v1.038c0 .586-.435.962-.853.962H16.5zm-2-7V4h-6v7zm-6 2h6v7h-6zm-2 5v2H4.853C4.435 20 4 19.624 4 19.038V18zm0-2v-3H4v3z",clipRule:"evenodd"})]}),FileIcon=({type:tt,roleMap:et})=>{const rt=typeof(et==null?void 0:et.icon)!="string"&&tt!=="unknown"&&(et==null?void 0:et.hasShadow)!==!1,st=clsx("position-absolute top-50 start-50 translate-middle",{"p-12 rounded-circle shadow":rt},et==null?void 0:et.color);return jsxRuntimeExports.jsx("div",{className:st,children:(et==null?void 0:et.icon)??jsxRuntimeExports.jsx(SvgIconPaperclip,{})})};var observerMap=new Map,RootIds=new WeakMap,rootId=0,unsupportedValue=void 0;function getRootId(tt){return tt?(RootIds.has(tt)||(rootId+=1,RootIds.set(tt,rootId.toString())),RootIds.get(tt)):"0"}function optionsToId(tt){return Object.keys(tt).sort().filter(et=>tt[et]!==void 0).map(et=>`${et}_${et==="root"?getRootId(tt.root):tt[et]}`).toString()}function createObserver(tt){let et=optionsToId(tt),rt=observerMap.get(et);if(!rt){const st=new Map;let nt;const ot=new IntersectionObserver(at=>{at.forEach(lt=>{var ut;const ct=lt.isIntersecting&&nt.some(dt=>lt.intersectionRatio>=dt);tt.trackVisibility&&typeof lt.isVisible>"u"&&(lt.isVisible=ct),(ut=st.get(lt.target))==null||ut.forEach(dt=>{dt(ct,lt)})})},tt);nt=ot.thresholds||(Array.isArray(tt.threshold)?tt.threshold:[tt.threshold||0]),rt={id:et,observer:ot,elements:st},observerMap.set(et,rt)}return rt}function observe(tt,et,rt={},st=unsupportedValue){if(typeof window.IntersectionObserver>"u"&&st!==void 0){const ut=tt.getBoundingClientRect();return et(st,{isIntersecting:st,target:tt,intersectionRatio:typeof rt.threshold=="number"?rt.threshold:0,time:0,boundingClientRect:ut,intersectionRect:ut,rootBounds:ut}),()=>{}}const{id:nt,observer:ot,elements:at}=createObserver(rt);let lt=at.get(tt)||[];return at.has(tt)||at.set(tt,lt),lt.push(et),ot.observe(tt),function(){lt.splice(lt.indexOf(et),1),lt.length===0&&(at.delete(tt),ot.unobserve(tt)),at.size===0&&(ot.disconnect(),observerMap.delete(nt))}}function useInView({threshold:tt,delay:et,trackVisibility:rt,rootMargin:st,root:nt,triggerOnce:ot,skip:at,initialInView:lt,fallbackInView:ut,onChange:ct}={}){var dt;const[ht,ft]=reactExports.useState(null),xt=reactExports.useRef(),[vt,yt]=reactExports.useState({inView:!!lt,entry:void 0});xt.current=ct,reactExports.useEffect(()=>{if(at||!ht)return;let St;return St=observe(ht,(Rt,Ct)=>{yt({inView:Rt,entry:Ct}),xt.current&&xt.current(Rt,Ct),Ct.isIntersecting&&ot&&St&&(St(),St=void 0)},{root:nt,rootMargin:st,threshold:tt,trackVisibility:rt,delay:et},ut),()=>{St&&St()}},[Array.isArray(tt)?tt.toString():tt,ht,nt,st,ot,at,rt,ut,et]);const Et=(dt=vt.entry)==null?void 0:dt.target,bt=reactExports.useRef();!ht&&Et&&!ot&&!at&&bt.current!==Et&&(bt.current=Et,yt({inView:!!lt,entry:void 0}));const wt=[ft,vt.inView,vt.entry];return wt.ref=wt[0],wt.inView=wt[1],wt.entry=wt[2],wt}function useThumbnail(tt,et){const[rt,st]=reactExports.useState(null),{ref:nt,inView:ot}=useInView({triggerOnce:!0,...et==null?void 0:et.intersectionOptions});return reactExports.useEffect(()=>{var at;(at=et==null?void 0:et.ref)!=null&&at.current&&(nt==null||nt(et.ref.current))},[et==null?void 0:et.ref,nt]),reactExports.useEffect(()=>{if((et==null?void 0:et.ref)===void 0||ot){const at=new Image;return at.src=tt,at.onload=()=>{st(!0)},at.onerror=()=>{st(!1)},()=>{at.onload=null,at.onerror=null,st(null)}}},[ot]),rt}const FileCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:st=!1,onClick:nt,className:ot,onSelect:at,isFocused:lt,app:ut,customIcon:ct,customColor:dt})=>{const ht=reactExports.useRef(null),ft=DocumentHelper.getRole(tt);function xt(St){if(ct!==void 0||dt!==void 0)return{icon:ct||jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:dt||"bg-gray-300",hasShadow:!1};const Rt={csv:{icon:".CSV",color:"bg-orange-200"},xls:{icon:".XLS",color:"bg-green-200"},doc:{icon:".DOC",color:"bg-blue-200"},txt:{icon:".TXT",color:"bg-blue-200"},pdf:{icon:".PDF",color:"bg-red-200"},audio:{icon:jsxRuntimeExports.jsx(SvgIconMic,{width:22,height:22}),color:"bg-red-200"},ppt:{icon:".PPT",color:"bg-yellow-200"},img:{icon:jsxRuntimeExports.jsx(SvgIconLandscape,{width:22,height:22}),color:"bg-green-200"},video:{icon:jsxRuntimeExports.jsx(SvgIconVideo,{width:22,height:22}),color:"bg-purple-200"},zip:{icon:".ZIP",color:"bg-gray-300"},md:{icon:".MD",color:"bg-blue-200"},unknown:{icon:jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:"bg-gray-300"}};return Rt[St]||Rt.unknown}const vt=xt(ft??"unknown"),yt=clsx("file position-relative rounded",(vt==null?void 0:vt.color)??"bg-yellow-200"),Et=ft==="img"||ft==="video"?odeServices.workspace().getThumbnailUrl(tt):null,bt=useThumbnail(Et,{ref:ht}),wt=bt&&{backgroundImage:`url(${Et})`,backgroundSize:"cover"};return jsxRuntimeExports.jsx(Card,{className:clsx("card-file",ot),isClickable:et,isSelectable:rt,isSelected:st,onClick:nt,app:ut,isFocused:lt,onSelect:at,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{ref:ht,className:yt,style:{aspectRatio:"16/10",...wt},children:ft!=="img"||ft==="img"&&!bt?jsxRuntimeExports.jsx(FileIcon,{type:ft,roleMap:vt}):null}),jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.ownerName})]})]})})},Workspace$1=({roles:tt,onSelect:et,multiple:rt=!0,className:st,defaultFolder:nt,showPublicFolder:ot})=>{const{t:at}=useTranslation(),{root:lt,loadContent:ut}=useWorkspaceSearch("root",at("workspace.tree.owner"),"owner",tt),{root:ct,loadContent:dt}=useWorkspaceSearch("root",at("workspace.tree.shared"),"shared",tt),{root:ht,loadContent:ft}=useWorkspaceSearch("root",at("workspace.tree.protected"),"protected",tt),{root:xt,loadContent:vt}=useWorkspaceSearch("root",at("workspace.tree.public"),"public",tt),yt=reactExports.useRef(null),Et=reactExports.useRef(null),bt=reactExports.useRef(null),wt=reactExports.useRef(null),[St,Rt]=reactExports.useState(()=>nt==="public"?ot?nt:"protected":nt==="protected"||nt==="shared"?nt:"owner"),[Ct,It]=reactExports.useState(()=>nt==="public"?ot?xt:ht:nt==="protected"?ht:nt==="shared"?ct:lt),[jt,Pt]=reactExports.useState(),[Ot,Ut]=reactExports.useState(null),[Nt,Ht]=reactExports.useState(["modified","desc"]),[Lt,kt]=reactExports.useState([]),$t=reactExports.useCallback(Yt=>{switch(Yt){case"owner":return{root:lt,othersRef:[Et,bt,wt]};case"shared":return{root:ct,othersRef:[yt,bt,wt]};case"protected":return{root:ht,othersRef:[yt,Et,wt]};case"public":return{root:xt,othersRef:[yt,Et,bt]};default:throw"no.root.node"}},[lt,ct,ht,xt]),Ft=reactExports.useCallback(()=>{switch(St){case"owner":ut(Ct.id);break;case"shared":dt(Ct.id);break;case"protected":ft(Ct.id);break;case"public":vt(Ct.id);break;default:throw"no.way"}},[St,Ct.id,ut,ft,vt,dt]);function Gt(Yt,tr){Rt(Yt);const{root:lr,othersRef:ur}=$t(Yt),mr=findTreeNode(lr,yr=>yr.id===tr);mr&&(It(mr),ur.forEach(yr=>{var or;return(or=yr.current)==null?void 0:or.unselectAll()}))}reactExports.useEffect(()=>{var Yt;let tr;switch(St){case"owner":tr=yt;break;case"shared":tr=Et;break;case"protected":tr=bt;break;case"public":tr=wt;break;default:return}(Yt=tr==null?void 0:tr.current)==null||Yt.select("root")},[St]),reactExports.useEffect(Ft,[Ft]),reactExports.useEffect(()=>{if(Ct.files){let Yt=[].concat(Ct.files);Ot&&(Yt=Yt.filter(lr=>lr.name.indexOf(Ot)>=0));const tr=Nt[0]==="name"?Nt[1]==="asc"?(lr,ur)=>Vt(lr.name,ur.name):(lr,ur)=>Vt(ur.name,lr.name):(lr,ur)=>Vt(ur.modified,lr.modified);Pt(()=>Yt.sort(tr))}else Pt(void 0)},[Ct,lt,ht,ct,xt,Ot,Nt]);const Mt=reactExports.useCallback(Yt=>{Ut(Yt.target.value)},[Ut]);function Vt(Yt,tr){return Yt?tr?Yt.localeCompare(tr):1:-1}function Bt(){return Nt[0]==="name"?Nt[1]==="asc"?at("sort.order.alpha.asc"):at("sort.order.alpha.desc"):at("sort.order.modify.desc")}function qt(Yt){let tr=[...Lt];rt?tr.includes(Yt)?tr=tr.filter(lr=>lr._id!==Yt._id):tr=[...tr,Yt]:tr=[Yt],kt(tr),et(tr)}const Qt=clsx("workspace flex-grow-1 gap-0",st);return jsxRuntimeExports.jsxs(Grid,{className:Qt,children:[jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"3",xl:"4",className:"workspace-folders p-12 pt-0 gap-12",children:jsxRuntimeExports.jsxs("div",{style:{position:"sticky",top:0,paddingTop:"1.2rem"},children:[jsxRuntimeExports.jsx(TreeView,{ref:yt,data:lt,onTreeItemClick:Yt=>Gt("owner",Yt),onTreeItemUnfold:Yt=>Gt("owner",Yt)}),jsxRuntimeExports.jsx(TreeView,{ref:Et,data:ct,onTreeItemClick:Yt=>Gt("shared",Yt),onTreeItemUnfold:Yt=>Gt("shared",Yt)}),jsxRuntimeExports.jsx(TreeView,{ref:bt,data:ht,onTreeItemClick:Yt=>Gt("protected",Yt),onTreeItemUnfold:Yt=>Gt("protected",Yt)}),ot&&jsxRuntimeExports.jsx(TreeView,{ref:wt,data:xt,onTreeItemClick:Yt=>Gt("public",Yt),onTreeItemUnfold:Yt=>Gt("public",Yt)})]})}),jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"5",xl:"8",children:jsxRuntimeExports.jsxs(Grid,{className:"flex-grow-1 gap-0",children:[jsxRuntimeExports.jsxs(Grid.Col,{sm:"4",md:"8",xl:"12",children:[jsxRuntimeExports.jsx("div",{className:"workspace-search px-16 py-8 ",children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,className:"gap-16",onChange:Mt})}),jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center justify-content-end px-8 py-4",children:[jsxRuntimeExports.jsx("small",{className:"text-muted",children:at("workspace.search.order")}),jsxRuntimeExports.jsxs(Dropdown,{children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"sm",label:Bt(),variant:"ghost"}),jsxRuntimeExports.jsxs(Dropdown.Menu,{children:[jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortTime,{}),onClick:()=>Ht(["modified","desc"]),children:at("sort.order.modify.desc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortAscendingLetters,{}),onClick:()=>Ht(["name","asc"]),children:at("sort.order.alpha.asc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortDescendingLetters,{}),onClick:()=>Ht(["name","desc"]),children:at("sort.order.alpha.desc")})]})]})]})]}),jsxRuntimeExports.jsx(Grid.Col,{sm:"4",md:"8",xl:"12",className:"p-8 gap-8",children:jt?jt.length!==0?jsxRuntimeExports.jsx("div",{className:"grid grid-workspace",children:jt.map(Yt=>{const tr=Lt.includes(Yt);return jsxRuntimeExports.jsx(FileCard,{doc:Yt,isSelected:tr,onClick:()=>qt(Yt)},Yt._id)})}):jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuTrash,text:at("workspace.empty.docSpace"),title:at("explorer.emptyScreen.trash.title")}):jsxRuntimeExports.jsx(LoadingScreen,{})})]})})]})},Workspace=()=>{const{type:tt,setResultCounter:et,setResult:rt,multiple:st,visibility:nt}=useMediaLibraryContext();function ot(){switch(tt){case"image":return"img";case"audio":return"audio";case"video":return"video";default:return null}}function at(lt){et(lt.length),lt.length?rt(lt):rt()}return jsxRuntimeExports.jsx(Workspace$1,{roles:ot(),onSelect:at,multiple:st,className:"border rounded overflow-y-auto",defaultFolder:nt,showPublicFolder:nt==="public"})},InnerTabs={Audio,Video,Upload,ExternalLink,Workspace,InternalLink,Iframe,VideoEmbedder},TabsContext=reactExports.createContext(null);function useTabsContext(){const tt=reactExports.useContext(TabsContext);if(!tt)throw new Error("Tabs compound components cannot be rendered outside the Tabs component");return tt}const useTabs=({defaultId:tt,items:et,onChange:rt})=>{const[st,nt]=reactExports.useState(tt||""),[ot,at]=reactExports.useState(0),[lt,ut]=reactExports.useState(0),ct=reactExports.useRef([]),dt=reactExports.useCallback(vt=>{nt(vt)},[]);reactExports.useEffect(()=>{const vt=et.find(yt=>yt.id===st);vt&&(rt==null||rt(vt))},[st]),reactExports.useEffect(()=>{function vt(){var yt;if(((yt=document==null?void 0:document.activeElement)==null?void 0:yt.tagName)!=="INPUT"){const Et=et.findIndex(wt=>wt.id===st);Et===-1&&tt&&nt(tt);const bt=ct.current[Et];bt&&(bt.focus(),ut((bt==null?void 0:bt.offsetLeft)??0),at((bt==null?void 0:bt.clientWidth)??0))}}return vt(),window.addEventListener("resize",vt),()=>window.removeEventListener("resize",vt)},[st,et,tt]);const ht=reactExports.useCallback(vt=>{var yt,Et,bt;const wt=et.findIndex(St=>St.id===vt);vt===((yt=et[0])==null?void 0:yt.id)?nt((Et=et[et.length-1])==null?void 0:Et.id):nt((bt=et[wt-1])==null?void 0:bt.id)},[et]),ft=reactExports.useCallback(vt=>{var yt,Et,bt;const wt=et.findIndex(St=>St.id===vt);vt===((yt=et[et.length-1])==null?void 0:yt.id)?nt((Et=et[0])==null?void 0:Et.id):nt((bt=et[wt+1])==null?void 0:bt.id)},[et]),xt=reactExports.useCallback(vt=>{var yt,Et;switch(vt.code){case"ArrowLeft":ht(st);break;case"ArrowRight":ft(st);break;case"Home":nt((yt=et[0])==null?void 0:yt.id);break;case"End":nt((Et=et[et.length-1])==null?void 0:Et.id);break}},[st,et,ft,ht]);return{activeTab:st,setSelectedTab:dt,tabsRef:ct,tabUnderlineLeft:lt,tabUnderlineWidth:ot,onKeyDown:xt}},TabsItem=({icon:tt,badge:et,label:rt,id:st,order:nt})=>{const{activeTab:ot,setSelectedTab:at,onKeyDown:lt,tabsRef:ut}=useTabsContext(),{t:ct}=useTranslation(),dt=clsx("nav-link d-inline-flex gap-8 border-0",ot===st?"selected":"");return jsxRuntimeExports.jsx("li",{className:"nav-item flex-shrink-0",role:"presentation",children:jsxRuntimeExports.jsxs("button",{ref:ht=>ut.current[nt]=ht,type:"button",id:`tab-${st}`,className:dt,onClick:()=>at(st),onKeyDown:ht=>lt(ht),role:"tab","aria-controls":`tabpanel-${st}`,"aria-selected":ot===st,tabIndex:ot===st?0:-1,children:[tt,jsxRuntimeExports.jsxs("small",{children:[ct(rt)," ",et]})]})})},TabsList=tt=>{const{items:et,tabUnderlineLeft:rt,tabUnderlineWidth:st}=useTabsContext(),{className:nt,fullWidth:ot,isSticky:at,stickyTop:lt,...ut}=tt,ct=clsx("nav nav-tabs flex-nowrap",{"w-100":ot}),dt=clsx(" flex-shrink-0 overflow-x-auto",{"position-sticky z-1":at,"position-relative":!at},nt);return jsxRuntimeExports.jsx("div",{className:dt,...ut,style:at?{top:lt}:void 0,children:jsxRuntimeExports.jsxs("ul",{className:ct,role:"tablist",children:[et.map((ht,ft)=>jsxRuntimeExports.jsx(Tabs.Item,{order:ft,...ht},ht.id)),jsxRuntimeExports.jsx("span",{className:"nav-slide",style:{left:rt,width:st}})]})})},TabsPanel=({children:tt,currentItem:et,fullHeight:rt,className:st})=>{const{activeTab:nt}=useTabsContext(),ot=clsx("tab-content d-flex flex-fill w-100",{"position-relative h-100":rt},st);return jsxRuntimeExports.jsx("div",{className:ot,children:jsxRuntimeExports.jsx("div",{className:`tab-pane flex-fill w-100 fade ${nt===(et==null?void 0:et.id)?"show active":""}`,id:`tabpanel-${et==null?void 0:et.id}`,role:"tabpanel","aria-labelledby":`tab-${et==null?void 0:et.id}`,tabIndex:0,children:tt})})},Tabs=({defaultId:tt,items:et,fullWidth:rt=!1,fullHeight:st=!1,onChange:nt,children:ot,isSticky:at=!1,stickyTop:lt=0,headerClassName:ut,contentClassName:ct})=>{const{activeTab:dt,setSelectedTab:ht,tabsRef:ft,tabUnderlineLeft:xt,tabUnderlineWidth:vt,onKeyDown:yt}=useTabs({defaultId:tt,items:et,onChange:nt}),Et=reactExports.useMemo(()=>({activeTab:dt,items:et,setSelectedTab:ht,tabsRef:ft,tabUnderlineLeft:xt,tabUnderlineWidth:vt,onKeyDown:yt}),[dt,et,yt,ht,xt,vt,ft]),bt=et.find(wt=>wt.id===dt);return jsxRuntimeExports.jsx(TabsContext.Provider,{value:Et,children:typeof ot=="function"?ot(bt):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tabs.List,{fullWidth:rt,isSticky:at,stickyTop:lt,className:ut}),jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:bt,fullHeight:st,className:ct,children:bt==null?void 0:bt.content})]})})};Tabs.Item=TabsItem;Tabs.Panel=TabsPanel;Tabs.List=TabsList;const orderedTabs=["audio-capture","video-capture","internal-link","external-link","iframe","upload","workspace","video-embedder"],mediaLibraryTypes={none:null,audio:{title:"bbm.audio.modal.title",defaultTab:"audio-capture"},video:{title:"bbm.video.modal.title",defaultTab:"video-capture"},image:{title:"bbm.image.modal.title",defaultTab:"workspace"},attachment:{title:"bbm.attachment.modal.title",defaultTab:"workspace"},hyperlink:{title:"bbm.link.modal.title",defaultTab:"linker"},embedder:{title:"bbm.embed.modal.title",defaultTab:"iframe"},studio:{title:"bbm.studio.modal.title",defaultTab:"audio-capture"}},MediaLibrary=reactExports.forwardRef(({appCode:tt,visibility:et,multiple:rt,onSuccess:st,onCancel:nt,onTabChange:ot},at)=>{var lt;const ut=reactExports.useRef(),ct=reactExports.useRef(null);reactExports.useImperativeHandle(at,()=>({show:kt,hide:$t,showLink:Ft,type:xt,...ct.current})),useHttpErrorToast({isDismissible:!0,duration:1/0});const{t:dt}=useTranslation(),ht=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"),ft=useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),[xt,vt]=reactExports.useState(null),yt={workspace:{id:"workspace",icon:jsxRuntimeExports.jsx(SvgIconFolder,{}),label:dt("bbm.workspace"),content:jsxRuntimeExports.jsx(InnerTabs.Workspace,{}),availableFor:["audio","video","image","attachment"],isEnable:null},upload:{id:"upload",icon:jsxRuntimeExports.jsx(SvgIconSmartphone,{}),label:dt("bbm.device"),content:jsxRuntimeExports.jsx(InnerTabs.Upload,{}),availableFor:["audio","video","image","attachment"],isEnable:()=>!!ht},"video-capture":{id:"video-capture",icon:jsxRuntimeExports.jsx(SvgIconRecordVideo,{}),label:dt("bbm.video"),content:jsxRuntimeExports.jsx(InnerTabs.Video,{}),availableFor:["video","studio"],isEnable:()=>!!ft},"audio-capture":{id:"audio-capture",icon:jsxRuntimeExports.jsx(SvgIconMic,{}),label:dt("bbm.audio"),content:jsxRuntimeExports.jsx(InnerTabs.Audio,{}),availableFor:["audio","studio"],isEnable:()=>!!ht},"external-link":{id:"external-link",icon:jsxRuntimeExports.jsx(SvgIconGlobe,{}),label:dt("bbm.linker.ext"),content:jsxRuntimeExports.jsx(InnerTabs.ExternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},"internal-link":{id:"internal-link",icon:jsxRuntimeExports.jsx(SvgIconApplications,{}),label:dt("bbm.linker.int"),content:jsxRuntimeExports.jsx(InnerTabs.InternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},iframe:{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.Iframe,{}),availableFor:["embedder"],isEnable:null},"video-embedder":{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.VideoEmbedder,{}),availableFor:["video"],isEnable:null}},Et=reactExports.useMemo(()=>orderedTabs.map(Qt=>yt[Qt]).filter(Qt=>{var Yt;return((Yt=Qt.isEnable)==null?void 0:Yt.call(Qt))!==!1&&(Qt.availableFor.length===0||Qt.availableFor.includes(xt))}),[xt]),[bt,wt]=reactExports.useState(),St=reactExports.useMemo(()=>{const Qt=Et.findIndex(Yt=>Yt.id===bt);return 0>Qt||Qt>=Et.length?0:Qt},[Et,bt]),[Rt,Ct]=reactExports.useState(),[It,jt]=reactExports.useState(),[Pt,Ot]=reactExports.useState([]),[Ut,Nt]=reactExports.useState();function Ht(Qt){throw Et.findIndex(Yt=>Yt.id===Qt)<0?"tab.not.visible":"not.implemented.yet"}function Lt(Qt){ut.current=void 0,wt(void 0),vt(Qt)}const kt=Qt=>{vt(Qt)},$t=()=>{vt(null)},Ft=Qt=>{ut.current=Qt,"resourceId"in Qt||"appPrefix"in Qt||wt("external-link"),vt("hyperlink")};reactExports.useEffect(()=>{var Qt,Yt;const tr=xt||"none";!bt&&typeof((Qt=mediaLibraryTypes[tr])==null?void 0:Qt.defaultTab)=="string"&&wt((Yt=mediaLibraryTypes[tr])==null?void 0:Yt.defaultTab)},[bt,xt]);const Gt=dt(((lt=mediaLibraryTypes[xt??"none"])==null?void 0:lt.title)??"bbm"),Mt=()=>{ut.current=void 0,jt(void 0),Ct(void 0),wt(void 0),Nt(void 0),Ot([])},Vt=Qt=>{ot==null||ot(Qt,Pt),Mt()},Bt=reactExports.useCallback(()=>{const Qt=async Yt=>{Yt instanceof Array&&["protected","public"].findIndex(tr=>tr===et)>=0&&(Yt=await odeServices.workspace().transferDocuments(Yt,tt??"media-library",et)),st(Yt)};Ut?Ut().then(Yt=>{Qt(Yt)}):It&&Qt(It),Mt()},[Ut,It,st,et,tt]),qt=()=>{nt(Pt),Mt()};return xt&&jsxRuntimeExports.jsx(MediaLibraryContext.Provider,{value:{appCode:tt,visibility:et,multiple:rt,type:xt,setResultCounter:Ct,setResult:jt,setCancellable:Qt=>Ot([...Qt]),setVisibleTab:Ht,switchType:Lt,setPreSuccess:Nt},children:jsxRuntimeExports.jsxs(Modal,{id:"media-library",isOpen:xt!==null,onModalClose:qt,size:"lg",viewport:!0,scrollable:!0,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:qt,children:Gt}),jsxRuntimeExports.jsx(Tabs,{items:Et,defaultId:Et[St].id,onChange:Vt,children:Qt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Et.length>1&&jsxRuntimeExports.jsx(Tabs.List,{className:"mt-16"}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex",children:jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:Qt,children:Qt==null?void 0:Qt.content})})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:qt,children:dt("cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",disabled:typeof It>"u",onClick:Bt,children:Rt&&Rt>1?dt("addMultiple",{number:Rt}):dt("add")})]})]})})});function PublishModal$2({isOpen:tt,resourceId:et,onSuccess:rt,onCancel:st}){const{appCode:nt,currentApp:ot}=useEdificeClient(),{ref:at,libraryMedia:lt,...ut}=useMediaLibrary(),{t:ct}=useTranslation(),dt=useResource(nt,et),{control:ht,cover:ft,formState:{isDirty:xt,isValid:vt,isSubmitting:yt},handleDeleteImage:Et,handleSubmit:bt,handleUploadImage:wt,handlePublish:St,register:Rt,selectActivities:Ct,selectedActivities:It,selectedSubjectAreas:jt,selectSubjects:Pt}=usePublishModal({resource:dt,onSuccess:rt});return dt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:st,id:"libraryModal",size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:st,children:ct("bpr.publish")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:ct("bpr.form.tip")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.general")}),jsxRuntimeExports.jsxs("form",{id:"libraryModalForm",onSubmit:bt(St),children:[jsxRuntimeExports.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[jsxRuntimeExports.jsxs("div",{style:{maxWidth:"160px"},children:[jsxRuntimeExports.jsx("div",{className:"form-label",children:ct("bpr.form.publication.cover.title")}),jsxRuntimeExports.jsx(ImagePicker,{app:ot,src:dt==null?void 0:dt.thumbnail,addButtonLabel:ct("bpr.form.publication.cover.upload.add"),deleteButtonLabel:ct("bpr.form.publication.cover.upload.remove"),onUploadImage:wt,onDeleteImage:Et,className:"align-self-center",libraryMedia:lt,mediaLibraryRef:at}),!ft&&jsxRuntimeExports.jsx("p",{className:"form-text is-invalid",children:jsxRuntimeExports.jsx("em",{children:ct("bpr.form.publication.cover.upload.required.image")})})]}),jsxRuntimeExports.jsxs("div",{className:"flex-fill",children:[jsxRuntimeExports.jsxs(FormControl,{id:"title",className:"mb-16",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.title")}),jsxRuntimeExports.jsx(Input,{type:"text",defaultValue:dt==null?void 0:dt.name,...Rt("title",{required:!0}),placeholder:ct("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),jsxRuntimeExports.jsxs(FormControl,{id:"description",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.description")}),jsxRuntimeExports.jsx(TextArea,{...Rt("description",{required:!0}),placeholder:ct("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.infos")}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[jsxRuntimeExports.jsx(ActivitiesDropdown,{control:ht,selectedActivities:It,selectActivities:Ct}),jsxRuntimeExports.jsx(SubjectsDropdown,{control:ht,selectedSubjectAreas:jt,selectSubjects:Pt}),jsxRuntimeExports.jsx(LangSelect,{control:ht})]}),jsxRuntimeExports.jsxs("div",{className:"mb-24",children:[jsxRuntimeExports.jsx("label",{htmlFor:"",className:"form-label",children:ct("bpr.form.publication.age")}),jsxRuntimeExports.jsxs("div",{className:"d-flex gap-8",children:[jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(Nt,Ht)=>parseInt(Nt)<=parseInt(Ht.ageMax)})}),jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(Nt,Ht)=>parseInt(Nt)>=parseInt(Ht.ageMin)})})]})]}),jsxRuntimeExports.jsx("div",{className:"mb-24",children:jsxRuntimeExports.jsxs(FormControl,{id:"keywords",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.keywords")}),jsxRuntimeExports.jsx(Input,{type:"text",...Rt("keyWords"),size:"md",placeholder:ct("bpr.form.publication.keywords.placeholder")})]})}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.licence.text")}),jsxRuntimeExports.jsx(PublishModalFooter,{})]})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:st,type:"button",variant:"ghost",children:ct("cancel")}),jsxRuntimeExports.jsx(Button,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:yt,disabled:!ft||yt||!xt||!vt,children:ct("bpr.form.submit")})]}),jsxRuntimeExports.jsx(MediaLibrary,{appCode:nt,ref:at,multiple:!1,visibility:"protected",...ut})]}),document.getElementById("portal")):jsxRuntimeExports.jsx(LoadingScreen,{})}const SvgIconCopy=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.676 3c.284-.672.853-1 1.263-1h11.423c.566 0 1.438.628 1.438 1.923v13.154c0 1.056-.58 1.668-1.1 1.858V6.923C19.7 4.99 18.3 3 16.061 3zm-2.272.007C4.765 1.41 6.056 0 7.939 0h11.423C21.599 0 23 1.99 23 3.923v13.154c0 1.865-1.303 3.782-3.403 3.916C19.235 22.59 17.944 24 16.06 24H4.638C2.401 24 1 22.01 1 20.077V6.923c0-1.865 1.303-3.782 3.404-3.916M3.2 6.923C3.2 5.628 4.072 5 4.638 5h11.423c.567 0 1.439.628 1.439 1.923v13.154c0 1.295-.872 1.923-1.439 1.923H4.638c-.566 0-1.438-.628-1.438-1.923z",clipRule:"evenodd"})]}),defaults=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function objectHash(tt,et){et?et={...defaults,...et}:et=defaults;const rt=createHasher(et);return rt.dispatch(tt),rt.toString()}const defaultPrototypesKeys=Object.freeze(["prototype","__proto__","constructor"]);function createHasher(tt){let et="",rt=new Map;const st=nt=>{et+=nt};return{toString(){return et},getContext(){return rt},dispatch(nt){return tt.replacer&&(nt=tt.replacer(nt)),this[nt===null?"null":typeof nt](nt)},object(nt){if(nt&&typeof nt.toJSON=="function")return this.object(nt.toJSON());const ot=Object.prototype.toString.call(nt);let at="";const lt=ot.length;lt<10?at="unknown:["+ot+"]":at=ot.slice(8,lt-1),at=at.toLowerCase();let ut=null;if((ut=rt.get(nt))===void 0)rt.set(nt,rt.size);else return this.dispatch("[CIRCULAR:"+ut+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(nt))return st("buffer:"),st(nt.toString("utf8"));if(at!=="object"&&at!=="function"&&at!=="asyncfunction")this[at]?this[at](nt):tt.ignoreUnknown||this.unkown(nt,at);else{let ct=Object.keys(nt);tt.unorderedObjects&&(ct=ct.sort());let dt=[];tt.respectType!==!1&&!isNativeFunction(nt)&&(dt=defaultPrototypesKeys),tt.excludeKeys&&(ct=ct.filter(ft=>!tt.excludeKeys(ft)),dt=dt.filter(ft=>!tt.excludeKeys(ft))),st("object:"+(ct.length+dt.length)+":");const ht=ft=>{this.dispatch(ft),st(":"),tt.excludeValues||this.dispatch(nt[ft]),st(",")};for(const ft of ct)ht(ft);for(const ft of dt)ht(ft)}},array(nt,ot){if(ot=ot===void 0?tt.unorderedArrays!==!1:ot,st("array:"+nt.length+":"),!ot||nt.length<=1){for(const ut of nt)this.dispatch(ut);return}const at=new Map,lt=nt.map(ut=>{const ct=createHasher(tt);ct.dispatch(ut);for(const[dt,ht]of ct.getContext())at.set(dt,ht);return ct.toString()});return rt=at,lt.sort(),this.array(lt,!1)},date(nt){return st("date:"+nt.toJSON())},symbol(nt){return st("symbol:"+nt.toString())},unkown(nt,ot){if(st(ot),!!nt&&(st(":"),nt&&typeof nt.entries=="function"))return this.array(Array.from(nt.entries()),!0)},error(nt){return st("error:"+nt.toString())},boolean(nt){return st("bool:"+nt)},string(nt){st("string:"+nt.length+":"),st(nt)},function(nt){st("fn:"),isNativeFunction(nt)?this.dispatch("[native]"):this.dispatch(nt.toString()),tt.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(nt.name)),tt.respectFunctionProperties&&this.object(nt)},number(nt){return st("number:"+nt)},xml(nt){return st("xml:"+nt.toString())},null(){return st("Null")},undefined(){return st("Undefined")},regexp(nt){return st("regex:"+nt.toString())},uint8array(nt){return st("uint8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint8clampedarray(nt){return st("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(nt))},int8array(nt){return st("int8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint16array(nt){return st("uint16array:"),this.dispatch(Array.prototype.slice.call(nt))},int16array(nt){return st("int16array:"),this.dispatch(Array.prototype.slice.call(nt))},uint32array(nt){return st("uint32array:"),this.dispatch(Array.prototype.slice.call(nt))},int32array(nt){return st("int32array:"),this.dispatch(Array.prototype.slice.call(nt))},float32array(nt){return st("float32array:"),this.dispatch(Array.prototype.slice.call(nt))},float64array(nt){return st("float64array:"),this.dispatch(Array.prototype.slice.call(nt))},arraybuffer(nt){return st("arraybuffer:"),this.dispatch(new Uint8Array(nt))},url(nt){return st("url:"+nt.toString())},map(nt){st("map:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},set(nt){st("set:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},file(nt){return st("file:"),this.dispatch([nt.name,nt.size,nt.type,nt.lastModfied])},blob(){if(tt.ignoreUnknown)return st("[blob]");throw new Error(`Hashing Blob objects is currently not supported
|
|
1391
|
+
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(et){this._stylesheet!==et&&(this._stylesheet=et,this.styleID++)}normalizeColor(et){return Array.isArray(et)&&(et=rgb2hex(et)),typeof et=="number"?hex2string(et):et}dropShadowToCSS(){let et=this.normalizeColor(this.dropShadowColor);const rt=this.dropShadowAlpha,st=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),nt=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);et.startsWith("#")&&rt<1&&(et+=(rt*255|0).toString(16).padStart(2,"0"));const ot=`${st}px ${nt}px`;return this.dropShadowBlur>0?`text-shadow: ${ot} ${this.dropShadowBlur}px ${et}`:`text-shadow: ${ot} ${et}`}reset(){Object.assign(this,Kl.defaultOptions)}onBeforeDraw(){const{fontsDirty:et}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&et?new Promise(rt=>setTimeout(rt,100)):Promise.resolve()}get isSafari(){const{userAgent:et}=settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(et)}set fillGradientStops(et){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(et){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(et){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(et){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(et){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(et){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(et){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};_HTMLTextStyle.availableFonts={},_HTMLTextStyle.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let HTMLTextStyle=_HTMLTextStyle;const _HTMLText=class Ql extends Sprite{constructor(et="",rt={}){super(Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const st=new Image,nt=Texture.from(st,{scaleMode:settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});nt.orig=new Rectangle,nt.trim=new Rectangle,this.texture=nt;const ot="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",lt=document.createElementNS(ot,"svg"),ut=document.createElementNS(ot,"foreignObject"),ct=document.createElementNS(at,"div"),dt=document.createElementNS(at,"style");ut.setAttribute("width","10000"),ut.setAttribute("height","10000"),ut.style.overflow="hidden",lt.appendChild(ut),this.maxWidth=Ql.defaultMaxWidth,this.maxHeight=Ql.defaultMaxHeight,this._domElement=ct,this._styleElement=dt,this._svgRoot=lt,this._foreignObject=ut,this._foreignObject.appendChild(dt),this._foreignObject.appendChild(ct),this._image=st,this._loadImage=new Image,this._autoResolution=Ql.defaultAutoResolution,this._resolution=Ql.defaultResolution??settings.RESOLUTION,this.text=et,this.style=rt}measureText(et){var dt,ht;const{text:rt,style:st,resolution:nt}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},et);Object.assign(this._domElement,{innerHTML:rt,style:st.toCSS(nt)}),this._styleElement.textContent=st.toGlobalCSS(),document.body.appendChild(this._svgRoot);const ot=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:at,height:lt}=ot;(at>this.maxWidth||lt>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const ut=Math.min(this.maxWidth,Math.ceil(at)),ct=Math.min(this.maxHeight,Math.ceil(lt));return this._svgRoot.setAttribute("width",ut.toString()),this._svgRoot.setAttribute("height",ct.toString()),rt!==this._text&&(this._domElement.innerHTML=this._text),st!==this._style&&(Object.assign(this._domElement,{style:(dt=this._style)==null?void 0:dt.toCSS(nt)}),this._styleElement.textContent=(ht=this._style)==null?void 0:ht.toGlobalCSS()),{width:ut+st.padding*2,height:ct+st.padding*2}}async updateText(et=!0){const{style:rt,_image:st,_loadImage:nt}=this;if(this.localStyleID!==rt.styleID&&(this.dirty=!0,this.localStyleID=rt.styleID),!this.dirty&&et)return;const{width:ot,height:at}=this.measureText();st.width=nt.width=Math.ceil(Math.max(1,ot)),st.height=nt.height=Math.ceil(Math.max(1,at)),this._updateID++;const lt=this._updateID;await new Promise(ut=>{nt.onload=async()=>{if(lt<this._updateID){ut();return}await rt.onBeforeDraw(),st.src=nt.src,nt.onload=null,nt.src="",this.updateTexture(),ut()};const ct=new XMLSerializer().serializeToString(this._svgRoot);nt.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(ct)}`})}get source(){return this._image}updateTexture(){const{style:et,texture:rt,_image:st,resolution:nt}=this,{padding:ot}=et,{baseTexture:at}=rt;rt.trim.width=rt._frame.width=st.width/nt,rt.trim.height=rt._frame.height=st.height/nt,rt.trim.x=-ot,rt.trim.y=-ot,rt.orig.width=rt._frame.width-ot*2,rt.orig.height=rt._frame.height-ot*2,this._onTextureUpdate(),at.setRealSize(st.width,st.height,nt),this.dirty=!1}_render(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._render(et)}_renderCanvas(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(et)}getLocalBounds(et){return this.updateText(!0),super.getLocalBounds(et)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(et){var st,nt,ot,at,lt;typeof et=="boolean"&&(et={children:et}),et=Object.assign({},Ql.defaultDestroyOptions,et),super.destroy(et);const rt=null;this.ownsStyle&&((st=this._style)==null||st.cleanFonts()),this._style=rt,(nt=this._svgRoot)==null||nt.remove(),this._svgRoot=rt,(ot=this._domElement)==null||ot.remove(),this._domElement=rt,(at=this._foreignObject)==null||at.remove(),this._foreignObject=rt,(lt=this._styleElement)==null||lt.remove(),this._styleElement=rt,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=rt,this._image.src="",this._image=rt}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(et){this.updateText(!0);const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._image.width/this.resolution,this._width=et}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(et){this.updateText(!0);const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._image.height/this.resolution,this._height=et}get style(){return this._style}set style(et){this._style!==et&&(et=et||{},et instanceof HTMLTextStyle?(this.ownsStyle=!1,this._style=et):et instanceof TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=HTMLTextStyle.from(et)):(this.ownsStyle=!0,this._style=new HTMLTextStyle(et)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(et){et=String(et===""||et===null||et===void 0?" ":et),et=this.sanitiseText(et),this._text!==et&&(this._text=et,this.dirty=!0)}get resolution(){return this._resolution}set resolution(et){this._autoResolution=!1,this._resolution!==et&&(this._resolution=et,this.dirty=!0)}sanitiseText(et){return et.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};_HTMLText.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},_HTMLText.defaultMaxWidth=2024,_HTMLText.defaultMaxHeight=2024,_HTMLText.defaultAutoResolution=!0;const MIN_HEIGHT=100,MIN_WIDTH=100,MODAL_VERTICAL_PADDING=450,MODAL_HORIZONTAL_PADDING=64,DEFAULT_QUALITY=.5,DEFAULT_SPRITE_NAME="image";function updateImageFromBlob(tt,{spriteName:et,imgDatasource:rt,settings:st}){const nt=URL.createObjectURL(rt),ot=new Image;return ot.src=nt,new Promise(at=>{ot.onload=async()=>{await updateImage(tt,{spriteName:et,imgDatasource:ot,settings:st});const lt=tt==null?void 0:tt.stage.getChildByName(et,!0);at(lt)}})}async function updateImage(tt,{spriteName:et,imgDatasource:rt,settings:st}){if(tt===void 0||tt.stage===null)return;const nt=tt.stage.getChildByName(et,!0);nt==null||nt.removeFromParent();const ot=rt instanceof HTMLImageElement?Texture.from(rt):rt instanceof Sprite?rt:await Texture.fromURL(rt),at=ot instanceof Sprite?ot:Sprite.from(ot,{});if(at.interactive=!0,at.name=et,st){const{sprite:{anchor:lt,position:ut,scale:ct,size:dt,rotation:ht},stage:{size:ft}}=st,xt=ht%Math.PI!==0;at.anchor.x=lt.x,at.anchor.y=lt.y,at.position.x=ut.x,at.position.y=ut.y,at.scale.x=ct.x,at.scale.y=ct.y,at.width=xt?dt.height:dt.width,at.height=xt?dt.width:dt.height,tt.stage.height=ft.height,tt.stage.width=ft.width,tt.renderer.resize(ft.width,ft.height),tt.stage.addChild(at)}else tt.stage.addChild(at),tt.renderer.resize(at.width,at.height);autoResize(tt,at)}function autoResize(tt,et){var rt;const st=tt.view.parentNode,nt=window.innerWidth-MODAL_HORIZONTAL_PADDING,ot=Math.max((st==null?void 0:st.offsetWidth)??0,MIN_WIDTH),at=constraintSize({width:et.width,height:et.height},{width:{max:Math.min(ot,nt),min:MIN_WIDTH},height:{min:MIN_HEIGHT,max:window.innerHeight-MODAL_VERTICAL_PADDING}}),{height:lt,width:ut}=at;(rt=tt.view)!=null&&rt.style&&(tt.view.style.width=`${ut}px`,tt.view.style.height=`${lt}px`)}function constraintSize(tt,et){const{height:rt,width:st}=tt,nt=st/rt,{height:ot,width:at}=et;let lt=at.max,ut=at.max/nt;return st>at.max&&(lt=at.max,ut=lt/nt),ut>ot.max&&(ut=ot.max,lt=ut*nt),lt<at.min&&(lt=at.min,ut=lt/nt),ut<ot.min&&(ut=ot.min,lt=ut*nt),{width:lt,height:ut}}function saveAsBlob(tt){return new Promise((et,rt)=>{var st;(st=tt==null?void 0:tt.view)!=null&&st.toBlob?tt.view.toBlob(nt=>{nt?et(nt):rt("EXTRACT_FAILED")},"image/jpeg",DEFAULT_QUALITY):rt("EXTRACT_FAILED")})}function saveAsDataURL(tt){var et,rt;return(rt=(et=tt.view).toDataURL)==null?void 0:rt.call(et)}function getApplicationScale(tt){return tt.view.getBoundingClientRect?tt.view.getBoundingClientRect().width/tt.view.width:1}function toBlob(tt){return new Promise((et,rt)=>{var st,nt;(nt=(st=tt.view).toBlob)==null||nt.call(st,ot=>{ot?et(ot):rt("EXTRACT_FAIL")},"image/png",1)})}function createImageSettings({application:tt,sprite:et}){return{sprite:{rotation:et.rotation,size:{width:et.width,height:et.height},position:{x:et.position.x,y:et.position.y},scale:{x:et.scale.x,y:et.scale.y},anchor:{x:et.anchor.x,y:et.anchor.y}},stage:{size:{width:tt.stage.width,height:tt.stage.height},scale:{x:tt.stage.scale.x,y:tt.stage.scale.y}}}}function resizeStage({application:tt,sprite:et,newHeight:rt,newWidth:st}){et.anchor.x=.5,et.anchor.y=.5,et.position=new Point(st/2,rt/2),tt.stage.height=rt,tt.stage.width=st,tt.renderer.resize(st,rt)}const DEFAULT_MAX_HISTORY=20,useHistoryTool=({maxSize:tt=DEFAULT_MAX_HISTORY,application:et,spriteName:rt,onRestore:st})=>{const[nt,ot]=reactExports.useState([]);reactExports.useEffect(()=>{ot([])},[et]);const at=async()=>{const ct=nt.pop();ct&&(st(await ct.backup,ct),ot(nt.filter(dt=>dt!==ct)))},lt=ct=>(ct.length>tt&&ct.splice(0,ct.length-tt),ct),ut=async ct=>{{if(!et)return;const dt=et.stage.getChildByName(rt,!0);if(dt==null)return;const ht=toBlob(et),ft={backup:ht,sprite:{rotation:dt.rotation,size:{width:dt.width,height:dt.height},position:{x:dt.position.x,y:dt.position.y},scale:{x:dt.scale.x,y:dt.scale.y},anchor:{x:dt.anchor.x,y:dt.anchor.y}},stage:{size:{width:et.stage.width,height:et.stage.height},scale:{x:et.stage.scale.x,y:et.stage.scale.y}}};return ot([...lt(nt),ft]),await ht,ct.call(ct)}};return{historyCount:nt.length,restore:at,historize:ut}};function aggregate(tt,et,rt){let st;const nt=[];return function(ot){nt.push(et(ot)),!st&&(st=setTimeout(()=>{const at=[...nt];nt.splice(0,nt.length),rt(at),st=void 0},tt))}}const BRUSH_SIZE=20,DEBOUNCE=50,CURSOR_NAME="BRUSH_CURSOR";function drawBrush(tt,et){const rt=new Graphics;for(const st of tt)st&&(rt.beginFill(16777215,1),rt.drawCircle(st.x,st.y,BRUSH_SIZE/et),rt.lineStyle(0),rt.endFill());return rt}function drawBlurListener(tt,{spriteName:et}){return aggregate(DEBOUNCE,rt=>tt.stage.toLocal(rt.global),rt=>{const st=tt.stage.getChildByName(et),nt=getApplicationScale(tt);if(st==null)return;const ot=new Sprite(st.texture);ot.filters=[new BlurFilter(8,4,Math.min(nt,1))],ot.width=st.width,ot.height=st.height,ot.scale=new Point(1,1),ot.anchor=st.anchor,ot.mask=drawBrush(rt,nt),st.addChild(ot)})}function drawCursor(tt){removeCursor(tt);const et=getApplicationScale(tt),rt=new Graphics;return rt.lineStyle(Math.max(1,1/et),16711680),rt.drawCircle(0,0,BRUSH_SIZE/et),rt.endFill(),rt.name=CURSOR_NAME,tt.stage.addChild(rt),rt}function removeCursor(tt){const et=tt.stage.getChildByName(CURSOR_NAME);et&&et.removeFromParent()}function moveCursorListener(tt){return et=>{if(!tt)return;const rt=tt.stage.toLocal(et.global),st=tt.stage.getChildByName(CURSOR_NAME,!0);st&&(st.position.x=rt.x,st.position.y=rt.y)}}function start$2(tt,{spriteName:et}){tt.stage.interactive=!0;const rt=drawCursor(tt),st=moveCursorListener(tt);tt.stage.on("pointermove",st);const nt=drawBlurListener(tt,{spriteName:et});tt.stage.on("pointerdown",()=>{tt.stage.on("pointermove",nt)});const ot=()=>{var at;(at=tt==null?void 0:tt.stage)==null||at.off("pointermove",nt)};globalThis.addEventListener("pointerup",ot),rt.once("destroyed",()=>{globalThis.removeEventListener("pointerup",ot)})}function stop$2(tt){removeCursor(tt),tt.stage.off("pointerdown"),tt.stage.off("pointermove")}const CORNERS=["TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT"],PADDING=0,POINT_RADIUS$1=20,CROP_BACKGROUND_NAME="CROP_BACKGROUND_NAME",CROP_MASK_NAME="CROP_MASK_NAME";function getCornerName$1(tt){return"CROP_CORNER_"+tt}function drawBackground(tt,{spriteName:et}){removeBackground(tt);const rt=tt.stage.getChildByName(et);if(rt==null)return;const st=rt.getBounds(),nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);ot.height=st.height,ot.width=st.width,ot.position=new Point(0,0);const at=new Graphics;at.beginFill(16777215,.5),at.drawRect(0,0,st.width,st.height),at.endFill(),at.name=CROP_BACKGROUND_NAME,at.position=new Point(st.x,st.y);const lt=new Graphics;lt.beginFill(0,1),lt.drawRect(0,0,st.width-2*PADDING,st.height-2*PADDING),lt.endFill(),lt.position=new Point(PADDING,PADDING),lt.name=CROP_MASK_NAME,ot.mask=lt,tt.stage.addChild(at),at.addChild(lt),at.addChild(ot)}function removeBackground(tt){const et=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0);et==null||et.removeFromParent()}function computeCornerPosition$1(tt,et){switch(tt){case"TOP_LEFT":return{x:et.x,y:et.y,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:et.x+et.width,y:et.y,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:et.x,y:et.y+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:et.x+et.width,y:et.y+et.height,start:Math.PI,end:3*Math.PI/2}}}function refreshCorners(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);et!=null&&CORNERS.forEach(rt=>{const st=tt.stage.getChildByName(getCornerName$1(rt),!0);if(st==null)return;const nt=computeCornerPosition$1(rt,{height:et.height,width:et.width,x:et.x,y:et.y});st.position=new Point(nt.x,nt.y)})}function drawCorner$1(tt,et,{spriteName:rt}){const st=tt.stage.getChildByName(getCornerName$1(et),!0),nt=getApplicationScale(tt);st==null||st.removeFromParent();const ot=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0),at=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(tt.stage.getChildByName(rt)==null||ot===null||ot===void 0||at===void 0||at===null)return;const ut=computeCornerPosition$1(et,{height:at.height,width:at.width,x:at.x,y:at.y}),ct=new Graphics;ct.beginFill(4960213,1),ct.arc(0,0,POINT_RADIUS$1/nt,ut.start,ut.end),ct.lineTo(0,0),ct.endFill(),ct.position=new Point(ut.x,ut.y),ct.name=getCornerName$1(et),ct.interactive=!0;let dt=!1;tt.stage.on("pointermove",xt=>{if(dt===!1)return;const vt=ot.toLocal(xt.global);ct.position.x=vt.x,ct.position.y=vt.y,moveMask(tt,et,vt)});const ht=()=>{dt=!0};ct.on("pointerdown",ht);const ft=()=>{dt=!1};globalThis.addEventListener("pointerup",ft),ct.once("destroyed",()=>{ct.off("pointerdown"),globalThis.removeEventListener("pointerup",ft)}),ot.addChild(ct)}function moveMask(tt,et,rt){const st=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(st==null)return;const nt=st.position.x+st.width,ot=st.position.y+st.height;switch(et){case"TOP_LEFT":{st.position.x=rt.x,st.position.y=rt.y,st.width=nt-rt.x,st.height=ot-rt.y;break}case"TOP_RIGHT":{st.position.y=rt.y,st.width=rt.x-st.position.x,st.height=ot-rt.y;break}case"BOTTOM_LEFT":{st.position.x=rt.x,st.width=nt-rt.x,st.height=rt.y-st.position.y;break}case"BOTTOM_RIGHT":{st.width=rt.x-st.position.x,st.height=rt.y-st.position.y;break}}refreshCorners(tt)}function start$1(tt,{spriteName:et}){stop$1(tt),tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,drawBackground(tt,{spriteName:et}),drawCorner$1(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner$1(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner$1(tt,"TOP_LEFT",{spriteName:et}),drawCorner$1(tt,"TOP_RIGHT",{spriteName:et})}function stop$1(tt){removeBackground(tt),tt.stage.off("pointermove"),tt.render()}function save$1(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(et==null)return;stop$1(tt);const rt=tt.renderer.generateTexture(tt.stage).clone(),st=new Sprite(rt),nt=et.getBounds(),ot=new Rectangle(Math.floor(nt.x),Math.floor(nt.y),Math.floor(nt.width),Math.floor(nt.height)),at=new Texture(st.texture.baseTexture,ot);return new Sprite(at)}const POINT_RADIUS=20,CONTROL_NAME="CONTROL_NAME";function getCornerName(tt){return"RESIZE_CORNER_"+tt}function computeCornerPosition(tt,et){const rt=et.x,st=et.y;switch(tt){case"TOP_LEFT":return{x:rt,y:st,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:rt+et.width,y:st,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:rt,y:st+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:rt+et.width,y:st+et.height,start:Math.PI,end:3*Math.PI/2}}}function resizeContainer(tt,{container:et,cornerType:rt,position:st,spriteName:nt}){const ot=tt.stage.getChildByName(nt,!0);if(ot==null)return;const at=ot.rotation%Math.PI!==0,lt=at?ot.height:ot.width,ut=at?ot.width:ot.height;switch(rt){case"TOP_LEFT":{et.position=new Point(st.x,st.y),et.width=lt-2*st.x,et.height=ut-2*st.y;break}case"TOP_RIGHT":{const ct=lt-st.x;et.position=new Point(ct,st.y),et.width=lt-2*ct,et.height=ut-2*st.y;break}case"BOTTOM_LEFT":{const ct=ut-st.y;et.position=new Point(st.x,ct),et.width=lt-2*st.x,et.height=ut-2*ct;break}case"BOTTOM_RIGHT":{const ct=ut-st.y,dt=lt-st.x;et.position=new Point(dt,ct),et.width=lt-2*dt,et.height=ut-2*ct;break}}}function removeCorner(tt,et){const rt=tt.stage.getChildByName(getCornerName(et),!0);rt==null||rt.removeFromParent()}function drawCorner(tt,et,{spriteName:rt}){removeCorner(tt,et);const st=tt.stage.getChildByName(rt,!0),nt=tt.stage.getChildByName(CONTROL_NAME,!0);if(st==null||nt===null||nt===void 0)return;const ot=computeCornerPosition(et,nt),at=new Graphics;at.beginFill(4960213,1),at.arc(0,0,POINT_RADIUS,ot.start,ot.end),at.lineTo(0,0),at.endFill(),at.position=new Point(ot.x,ot.y),at.name=getCornerName(et),at.interactive=!0;let lt=!1;tt.stage.on("pointermove",dt=>{if(lt===!1)return;const ht=tt.stage.toLocal(dt.global);resizeContainer(tt,{cornerType:et,position:ht,container:nt,spriteName:rt})});const ut=()=>{lt=!1};globalThis.addEventListener("pointerup",ut),at.once("destroyed",()=>{at.off("pointerdown"),globalThis.removeEventListener("pointerup",ut)});const ct=()=>{lt=!0};at.on("pointerdown",ct),nt.addChild(at)}function drawContainer(tt,et){removeContainer(tt);const rt=tt.stage.getChildByName(et,!0);if(rt==null)return;const st=tt.renderer.generateTexture(tt.stage),nt=new Sprite(st);tt.stage.children.forEach(at=>{at.alpha=0});const ot=new Graphics;ot.drawRect(0,0,rt.width,rt.height),ot.name=CONTROL_NAME,ot.interactive=!0,ot.interactiveChildren=!0,tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,tt.stage.addChild(ot),ot.addChild(nt)}function removeContainer(tt){const et=tt.stage.getChildByName(CONTROL_NAME,!0);et==null||et.removeFromParent(),tt.stage.children.forEach(rt=>{rt.alpha=1})}function drawControl(tt,et){drawContainer(tt,et),drawCorner(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner(tt,"TOP_LEFT",{spriteName:et}),drawCorner(tt,"TOP_RIGHT",{spriteName:et})}function removeControl(tt){removeContainer(tt),removeCorner(tt,"BOTTOM_LEFT"),removeCorner(tt,"BOTTOM_RIGHT"),removeCorner(tt,"TOP_LEFT"),removeCorner(tt,"TOP_RIGHT"),tt.stage.off("pointermove")}function start(tt,et){drawControl(tt,et)}function stop(tt){removeControl(tt),tt.stage.off("pointermove"),tt.render()}function save(tt){var et;const rt=(et=tt==null?void 0:tt.stage)==null?void 0:et.getChildByName(CONTROL_NAME,!0),st=rt?{height:rt.height,width:rt.width}:void 0;if(removeControl(tt),st){const nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);return ot.width=st.width,ot.height=st.height,ot}else return}async function rotate(tt,et){const rt=tt==null?void 0:tt.stage.getChildByName(et,!0);if(tt&&rt){if(!tt)return;const st=await toBlob(tt),nt=await updateImageFromBlob(tt,{imgDatasource:st,spriteName:et,settings:createImageSettings({application:tt,sprite:rt})});if(!nt)return;let ot,at;const lt=tt.view;lt.style&&(ot=lt.style.maxHeight??"",at=lt.style.visibility??"",lt.style.maxHeight=`${lt.clientHeight}px`,lt.style.visibility="hidden"),nt.rotation+=Math.PI/2,resizeStage({application:tt,sprite:nt,newHeight:nt.width,newWidth:nt.height}),tt.render();const ut=await toBlob(tt);ot!==void 0&&(lt.style.maxHeight=ot),at!==void 0&&(lt.style.visibility=at),await updateImageFromBlob(tt,{imgDatasource:ut,spriteName:et})}}function useImageEffects({application:tt,spriteName:et,onSave:rt}){return{rotate:async()=>{tt&&await rotate(tt,et)},startCrop:()=>{tt&&start$1(tt,{spriteName:et})},stopCrop:st=>{if(tt){if(st){const nt=save$1(tt);nt&&rt(nt)}stop$1(tt)}},startBlur:()=>{tt&&start$2(tt,{spriteName:et})},stopBlur:()=>{tt&&stop$2(tt)},startResize:()=>{tt&&start(tt,et)},stopResize:st=>{if(tt){if(st){const nt=save(tt);nt&&rt(nt)}stop(tt)}}}}function useImageEditor({imageSrc:tt,spriteName:et=DEFAULT_SPRITE_NAME}){const[rt,st]=reactExports.useState(void 0),[nt,ot]=reactExports.useState(!0),{rotate:at,startBlur:lt,startCrop:ut,startResize:ct,stopBlur:dt,stopCrop:ht,stopResize:ft}=useImageEffects({spriteName:et,application:rt,onSave(wt){rt&&updateImage(rt,{imgDatasource:wt,spriteName:et})}}),xt=()=>rt?saveAsBlob(rt):Promise.resolve(void 0),vt=()=>{if(rt)return saveAsDataURL(rt)},{restore:yt,historize:Et,historyCount:bt}=useHistoryTool({application:rt,spriteName:et,onRestore(wt,St){rt&&updateImageFromBlob(rt,{imgDatasource:wt,spriteName:et,settings:St})}});return reactExports.useEffect(()=>{rt&&(ot(!0),updateImage(rt,{spriteName:et,imgDatasource:tt}).finally(()=>ot(!1)))},[rt,tt,et]),{historyCount:bt,setApplication:st,restore:yt,stopCrop:ht,stopBlur:dt,stopResize:ft,startResize:async()=>{ot(!0),await Et(ct),ot(!1)},startCrop:async()=>{ot(!0),await Et(ut),ot(!1)},startBlur:async()=>{ot(!0),await Et(lt),ot(!1)},rotate:async()=>{ot(!0),await Et(at),ot(!1)},toBlob:xt,toDataURL:vt,loading:nt}}const SvgIconBlur=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-blur_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M17.504 1.673a1 1 0 0 1 .932.491c.37.63.9 1.935 1.404 3.18l.08.197c.502 1.24.994 2.457 1.369 3.205l-.895.447.895-.447c.561 1.122 1.962 4.049 2.136 6.753.087 1.364-.125 2.839-1.094 3.978-.987 1.16-2.573 1.76-4.757 1.76-2.186 0-3.777-.6-4.777-1.752-.983-1.134-1.221-2.604-1.152-3.973.138-2.711 1.514-5.636 2.13-6.79.86-1.611 2.414-5.32 2.874-6.433a1 1 0 0 1 .855-.616m.104 3.492c-.657 1.533-1.496 3.425-2.07 4.5-.59 1.106-1.781 3.703-1.895 5.949-.057 1.11.158 1.976.665 2.56.49.565 1.427 1.063 3.266 1.063 1.84 0 2.76-.498 3.233-1.055.492-.579.694-1.44.622-2.555-.145-2.253-1.36-4.848-1.929-5.986-.412-.823-.932-2.108-1.417-3.308l-.097-.238q-.196-.487-.378-.93M12.843 22.535a1 1 0 0 1-1.034.964l-.259-.009a1 1 0 0 1-.257-.042q-.125.029-.26.024l-.257-.009a11 11 0 0 1-2.102-.279 1 1 0 0 1 .457-1.947 9 9 0 0 0 1.715.228l.258.009q.134.004.257.042.125-.028.26-.024l.257.009a1 1 0 0 1 .965 1.034m-6.615-1.329a1 1 0 0 1-1.396.226 10.9 10.9 0 0 1-2.877-3.086 1 1 0 1 1 1.7-1.054 8.9 8.9 0 0 0 2.347 2.518 1 1 0 0 1 .226 1.396M1.622 15.22a1 1 0 0 1-1.147-.827 10.9 10.9 0 0 1 .148-4.218 1 1 0 0 1 1.947.457 8.9 8.9 0 0 0-.12 3.441 1 1 0 0 1-.828 1.147m.978-7.49a1 1 0 0 1-.226-1.397A10.9 10.9 0 0 1 5.46 3.455a1 1 0 0 1 1.054 1.7 8.9 8.9 0 0 0-2.518 2.347 1 1 0 0 1-1.396.226m5.988-4.607a1 1 0 0 1 .827-1.147 11 11 0 0 1 2.116-.132l.258.01q.135.004.257.042.125-.03.26-.025l.258.01a1 1 0 0 1-.07 1.998l-.258-.009a1 1 0 0 1-.258-.043q-.125.03-.259.025l-.258-.009a9 9 0 0 0-1.727.108 1 1 0 0 1-1.146-.828"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-blur_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconCrop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("g",{clipPath:"url(#icon-crop_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7.13 1.009a1 1 0 1 0-2-.018l-.036 4.103-4.103.036a1 1 0 1 0 .018 2l4.068-.035L5 15.99V16a3 3 0 0 0 3 3h9v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V8a3 3 0 0 0-3-3l-8.905.077zm-.053 6.068L7 16.004A1 1 0 0 0 8 17h9V8a1 1 0 0 0-.996-1z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-crop_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconUndo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.707 13.707a1 1 0 0 0 0-1.414L5.414 8l4.293-4.293a1 1 0 0 0-1.414-1.414l-5 5a1 1 0 0 0 0 1.414l5 5a1 1 0 0 0 1.414 0",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 20a1 1 0 0 0 1-1v-7a5 5 0 0 0-5-5H4a1 1 0 1 0 0 2h12a3 3 0 0 1 3 3v7a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),ImageEditorToolbar=({historyCount:tt,handle:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(void 0),ot=lt=>{nt(lt),et(lt)},at=[{type:"button",name:"undo",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconUndo,{}),"aria-label":rt("cancel"),children:rt("cancel"),onClick:()=>ot("UNDO"),disabled:tt===0},tooltip:rt("cancel")},{type:"divider",name:"div-1"},{type:"button",name:"reset",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),"aria-label":rt("rotate"),children:rt("rotate"),onClick:()=>ot("ROTATE")},tooltip:rt("rotate")},{type:"button",name:"crop",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconCrop,{}),"aria-label":rt("crop"),children:rt("crop"),className:st==="CROP"?"is-selected":"",onClick:()=>ot("CROP")},tooltip:rt("crop")},{type:"button",name:"blur",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBlur,{}),"aria-label":rt("blur"),children:rt("blur"),className:st==="BLUR"?"is-selected":"",onClick:()=>ot("BLUR")},tooltip:rt("blur")}];return jsxRuntimeExports.jsx(Toolbar,{variant:"no-shadow",align:"left",isBlock:!0,items:at})},ImageEditor=({altText:tt,legend:et,image:rt,isOpen:st,onCancel:nt,onError:ot,onSave:at})=>{const{t:lt}=useTranslation(),[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(!1),[ft,xt]=reactExports.useState(tt??""),[vt,yt]=reactExports.useState(et??""),[Et,bt]=reactExports.useState(!1),{toBlob:wt,setApplication:St,startBlur:Rt,stopBlur:Ct,restore:It,rotate:jt,startCrop:Pt,stopCrop:Ot,startResize:Ut,stopResize:Nt,historyCount:Ht,loading:Lt}=useImageEditor({imageSrc:rt}),kt=()=>{Ct(),Ot(ut==="CROP"),Nt(ut==="RESIZE")},$t=async()=>{try{ht(!0),kt();const Mt=await wt();Mt&&await at({blob:Mt,legend:vt,altText:ft})}catch(Mt){ot==null||ot(`${Mt}`)}finally{ht(!1)}},Ft=()=>{nt()},Gt=async Mt=>{switch(kt(),ct(Mt),bt(!0),Mt){case"ROTATE":{await jt();break}case"UNDO":{await It();break}case"CROP":{Pt();break}case"RESIZE":{await Ut();break}case"BLUR":{await Rt();break}}};return jsxRuntimeExports.jsxs(Modal,{id:"image-editor",isOpen:st,onModalClose:Ft,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Ft,children:jsxRuntimeExports.jsx("span",{className:"h2",children:lt("imageeditor.title")})}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex flex-column align-items-center",children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-12 w-100 flex-grow-1",children:[jsxRuntimeExports.jsx(ImageEditorToolbar,{handle:Gt,historyCount:Ht}),jsxRuntimeExports.jsxs("div",{className:"position-relative d-flex flex-column align-items-center justify-content-center flex-grow-1 w-100 image-editor",children:[jsxRuntimeExports.jsx(moduleExports.Stage,{onMount:Mt=>St(Mt),options:{preserveDrawingBuffer:!0,backgroundAlpha:0,resolution:1}}),!!Lt&&jsxRuntimeExports.jsx("div",{className:"position-absolute top-0 start-0 bottom-0 end-0 m-10 d-flex align-items-center justify-content-center bg-black opacity-25",children:jsxRuntimeExports.jsx(LoadingScreen,{})})]}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row m-10 gap-12 w-100",children:[jsxRuntimeExports.jsxs(FormControl,{id:"alt",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("alttext")}),jsxRuntimeExports.jsx(Input,{value:ft,onChange:Mt=>{bt(!0),xt(Mt.target.value)},placeholder:lt("alttext.help"),size:"md",type:"text"})]}),jsxRuntimeExports.jsxs(FormControl,{id:"legend",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("legend")}),jsxRuntimeExports.jsx(Input,{value:vt,onChange:Mt=>{bt(!0),yt(Mt.target.value)},placeholder:lt("legend.help"),size:"md",type:"text"})]})]})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:Ft,type:"button",variant:"ghost",children:lt("imageeditor.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:$t,type:"button",variant:"filled",isLoading:dt,disabled:dt||!Et,children:lt("imageeditor.save")})]})]})},UploadFiles=({onFilesChange:tt,visibility:et="protected"})=>{const{files:rt,uploadedFiles:st,getUploadStatus:nt,uploadFile:ot,removeFile:at,updateImage:lt,editingImage:ut,setEditingImage:ct,getUrl:dt}=useUploadFiles({handleOnChange:tt,application:"media-library",visibility:et}),ht=reactExports.useRef(new Map);reactExports.useEffect(()=>{const vt=ht.current;return()=>{vt.forEach(yt=>URL.revokeObjectURL(yt)),vt.clear()}},[]);const ft=vt=>{const yt=vt.type.startsWith("image")?ht.current.get(vt.name):"";return ht.current.has(vt.name)||ht.current.set(vt.name,URL.createObjectURL(vt)),{name:vt.name,info:{type:vt.type,weight:c$2(vt.size||0,1)},src:yt}},xt=vt=>{const yt=ht.current.get(vt.name);yt&&(URL.revokeObjectURL(yt),ht.current.delete(vt.name)),at(vt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[rt.map(vt=>{const yt=st.find(Et=>Et.name===vt.name);return jsxRuntimeExports.jsx(UploadCard,{status:nt(vt),item:ft(vt),onEdit:()=>ct(yt),onRetry:()=>ot(vt),onDelete:()=>xt(vt)},vt.name)}),ut&&jsxRuntimeExports.jsx(ImageEditor,{altText:ut.alt,legend:ut.title,image:dt(ut,!0),isOpen:!!ut,onCancel:()=>ct(void 0),onSave:lt,onError:console.error})]})},acceptedTypes=tt=>{const et=[];switch(tt){case"audio":et.push("audio/*");break;case"video":et.push("video/*");break;case"image":et.push("image/png"),et.push("image/jpeg"),et.push("image/webp"),et.push("image/gif"),et.push("image/avif");break}return et},Upload=()=>{const{type:tt,visibility:et,multiple:rt,setResult:st,setResultCounter:nt,setCancellable:ot}=useMediaLibraryContext(),at=lt=>{lt.length?(ot(lt),nt(lt.length),st(lt)):(ot([]),nt(void 0),st(void 0))};return jsxRuntimeExports.jsx("div",{className:"py-8 flex-grow-1",children:jsxRuntimeExports.jsx(Dropzone,{multiple:rt,accept:acceptedTypes(tt??"embedder"),children:jsxRuntimeExports.jsx(UploadFiles,{onFilesChange:at,visibility:et})})})},VIDEO_HEIGHT=9,VIDEO_WIDTH=16;function useCameras(){const{device:tt}=useBrowserInfo(navigator.userAgent),{t:et}=useTranslation(),[rt,st]=reactExports.useState([]),[nt,ot]=reactExports.useState({audio:!0,video:!0}),[at,lt]=reactExports.useState();async function ut(){return(await navigator.mediaDevices.enumerateDevices()).filter(ft=>ft.kind==="videoinput")}const ct=async ft=>{try{const xt=await navigator.mediaDevices.getUserMedia(ft);lt(xt)}catch(xt){console.error(xt)}},dt=()=>{at==null||at.getTracks().forEach(ft=>ft.stop()),ct(nt)},ht=ft=>{let xt={};ft!=null&&ft.deviceId?(ft.deviceId==="environment"||ft.deviceId==="user"?xt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,facingMode:ft==null?void 0:ft.deviceId}}:xt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,deviceId:{exact:ft.deviceId}}},ot(xt)):console.error("Selected input device id is null")};return reactExports.useEffect(()=>{dt()},[nt]),reactExports.useEffect(()=>{async function ft(){await ct(nt);const xt=await ut();switch(tt.type){case"mobile":case"tablet":{const vt={deviceId:"environment",label:et("video.back.camera"),groupId:"",kind:"videoinput"},yt={deviceId:"user",label:et("video.front.camera"),groupId:"",kind:"videoinput"};(xt==null?void 0:xt.length)>1?st([vt,yt]):st([vt]);break}default:st(xt);break}}ft()},[]),{inputDevices:rt,setPreferedDevice:ht,stream:at,restartStream:dt}}const SvgIconRecordStop=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4z"})]}),VideoRecorderToolbar=({playing:tt,recording:et,recorded:rt,saving:st,saved:nt,hideSaveAction:ot,handleRecord:at,handleStop:lt,handlePlayPause:ut,handleReset:ct,handleSave:dt})=>{const{t:ht}=useTranslation(),ft=[{type:"icon",name:"record",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{color:et||rt?"":"red"}),color:"danger",disabled:et||rt||st,onClick:at,"aria-label":ht("bbm.video.record.start")},tooltip:ht("bbm.video.record.start")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordStop,{}),disabled:!et||rt||st,onClick:lt,"aria-label":ht("bbm.video.record.stop")},tooltip:ht("bbm.video.record.stop")},{type:"icon",name:"play",visibility:tt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:!rt||st,onClick:ut,"aria-label":ht("bbm.video.play.start")},tooltip:ht("bbm.video.play.start")},{type:"icon",name:"pause",visibility:tt?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),disabled:!rt||st,onClick:ut,"aria-label":ht("bbm.video.play.pause")},tooltip:ht("bbm.video.play.pause")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:!rt||st,onClick:ct,"aria-label":ht("bbm.video.record.reset")},tooltip:ht("bbm.video.record.reset")},{type:"icon",name:"save",visibility:ot?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:!rt||st||nt,onClick:dt,"aria-label":ht("bbm.video.record.save")},tooltip:ht("bbm.video.record.save")}];return jsxRuntimeExports.jsx(Toolbar,{items:ft,className:"position-absolute bottom-0 start-50 bg-white"})},VideoRecorder=reactExports.forwardRef(({appCode:tt,caption:et,onSuccess:rt,onError:st,onRecordUpdated:nt,hideSaveAction:ot=!1},at)=>{const{inputDevices:lt,setPreferedDevice:ut,restartStream:ct,stream:dt}=useCameras(),[ht,ft]=reactExports.useState(18e4),[xt,vt]=reactExports.useState(!1),[yt,Et]=reactExports.useState(!1),[bt,wt]=reactExports.useState(!1),[St,Rt]=reactExports.useState(!1),[Ct,It]=reactExports.useState(!1),[jt,Pt]=reactExports.useState(""),[Ot,Ut]=reactExports.useState([]),[Nt,Ht]=reactExports.useState(),[Lt,kt]=reactExports.useState(0),[$t,Ft]=reactExports.useState(0),Gt=reactExports.useRef(null),Mt=reactExports.useRef(null),{uploadBlob:Vt}=useUpload(void 0,tt);reactExports.useImperativeHandle(at,()=>({save:ur}));const{t:Bt}=useTranslation();reactExports.useEffect(()=>{qt()},[]);async function qt(){try{const or=await odeServices.video().getVideoConf();ft(or.maxDuration*60*1e3)}catch{ft(3*60*1e3)}}reactExports.useEffect(()=>{try{Gt.current&&(Gt.current.src&&(window.URL.revokeObjectURL(Gt.current.src),Gt.current.src=""),Gt.current.srcObject instanceof MediaStream&&(Gt.current.srcObject=null),dt&&(Gt.current.srcObject=dt,Gt.current.autoplay=!0,Gt.current.volume=1,Gt.current.muted=!0,Gt.current.load()))}catch(or){console.error(or)}},[dt]),reactExports.useEffect(()=>{if(Ot.length&&!xt&&Gt.current){const or=new Blob(Ot,{type:jt});if(Ht(or),nt){const hr=window.URL.createObjectURL(or);nt(hr)}Gt.current.autoplay=!1,Gt.current.srcObject=null,Gt.current.src=window.URL.createObjectURL(or)}},[xt,Ot]),reactExports.useEffect(()=>{if(xt){const or=Date.now(),hr=window.setInterval(()=>kt(Date.now()-or),500);return()=>{window.clearInterval(hr)}}},[xt]),reactExports.useEffect(()=>{if(bt){const or=window.setInterval(()=>Ft(hr=>hr+500),500);return()=>{window.clearInterval(or)}}},[bt]);const Qt=reactExports.useCallback(()=>{vt(!0),Gt&&Gt.current&&(Gt.current.muted=!0);const or=o$2();Pt(or),dt&&(Mt.current=new MediaRecorder(dt,{mimeType:or}),Mt.current.ondataavailable=({data:hr})=>{hr.size>0&&Ut(pr=>[...pr,hr])},Mt.current.onerror=hr=>console.error(hr),Mt.current.start(1e3))},[dt]),Yt=reactExports.useCallback(()=>{var or;vt(!1),Et(!0),((or=Mt.current)==null?void 0:or.state)==="recording"&&(Mt.current.requestData(),Mt.current.stop())},[Mt]),tr=reactExports.useCallback(()=>{var or,hr;Gt&&Gt.current&&(Gt.current.muted=!1),bt?((hr=Gt==null?void 0:Gt.current)==null||hr.pause(),wt(!1)):((or=Gt==null?void 0:Gt.current)==null||or.play(),wt(!0))},[bt]),lr=()=>{Et(!1),vt(!1),wt(!1),It(!1),kt(0),Ut([]),Ht(void 0),ct(),nt&&nt()},ur=async()=>{var or;if((or=Gt==null?void 0:Gt.current)==null||or.pause(),Rt(!0),!Nt){console.error("Error while saving video: recorded video is undefined.");return}const hr=await Vt(Nt,{duration:Lt});if(hr!=null)return rt==null||rt([hr]),Rt(!1),It(!0),[hr];st("Error while uploading video"),Rt(!1),It(!0)},mr=()=>{wt(!1),Ft(0),Gt.current&&(Gt.current.currentTime=0)},yr=or=>{var hr;const pr=lt.find(_r=>_r.label===or);((hr=Mt.current)==null?void 0:hr.state)==="recording"&&(Mt.current.requestData(),Mt.current.stop()),ut(pr)};return reactExports.useEffect(()=>{Lt>=ht&&Yt()},[Lt,Yt]),jsxRuntimeExports.jsxs("div",{className:"video-recorder d-flex flex-fill flex-column align-items-center pb-8",children:[jsxRuntimeExports.jsx("div",{className:"video-recorder-caption d-none d-md-block",children:et}),lt.length>1&&jsxRuntimeExports.jsx("div",{className:"video-recorder-devices mb-12",children:jsxRuntimeExports.jsxs(FormControl,{id:"selectInputDevice",children:[jsxRuntimeExports.jsx(Label,{className:"d-none d-md-block",children:Bt("bbm.video.record.select.devices.label")}),jsxRuntimeExports.jsx(Select,{placeholderOption:Bt("bbm.video.record.select.devices.placeholder"),options:lt.map(or=>or.label),onValueChange:yr})]})}),jsxRuntimeExports.jsxs("div",{className:"video-recorder-video-container position-relative align-self-stretch",children:[jsxRuntimeExports.jsx("video",{ref:Gt,playsInline:!0,autoPlay:!0,controls:!1,muted:!0,onEnded:mr,className:"rounded",children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),(xt||yt)&&jsxRuntimeExports.jsxs("div",{className:"video-recorder-time d-flex align-items-center font-monospace fs-6 text-bg-dark rounded",children:[xt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,color:"red",className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$4(Lt),"/",n$4(ht)]})]}),yt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecordVideo,{width:14,height:14,className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$4($t),"/",n$4(Lt)]})]})]}),dt&&jsxRuntimeExports.jsx(VideoRecorderToolbar,{playing:bt,recording:xt,recorded:yt,saving:St,saved:Ct,hideSaveAction:ot,handleRecord:Qt,handleStop:Yt,handlePlayPause:tr,handleReset:lr,handleSave:ur})]}),St&&jsxRuntimeExports.jsx(LoadingScreen,{position:!1,caption:Bt("bbm.video.save.loader.caption")})]})}),Video=()=>{const{appCode:tt,setResult:et,setPreSuccess:rt}=useMediaLibraryContext(),{t:st}=useTranslation(),nt=reactExports.useRef(null),ot=lt=>{lt?(et(lt),rt(()=>nt.current.save)):et()},at=lt=>{console.error(lt)};return jsxRuntimeExports.jsx(VideoRecorder,{ref:nt,appCode:tt,caption:st("bbm.video.caption"),onRecordUpdated:ot,onError:at,hideSaveAction:!0})},SvgIconArrowRight=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L17.586 12l-6.293-6.293a1 1 0 0 1 0-1.414",clipRule:"evenodd"})]}),illuError="/assets/js/ode-explorer/illu-error.svg",illuError$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuError},Symbol.toStringTag,{value:"Module"})),VideoEmbed=({switchType:tt,onSuccess:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(),[ot,at]=reactExports.useState(),[lt,ut]=reactExports.useState(void 0),[ct,dt]=reactExports.useState(),ht=useDebounce(st||"",300),ft=reactExports.useId();reactExports.useEffect(()=>{xt()},[]),reactExports.useEffect(()=>{if(ct&&ht){const bt=odeServices.embedder().getProviderFromUrl(ct,ht);if(bt){ut(bt);const wt=odeServices.embedder().getEmbedCodeForProvider(bt,ht);at(wt),et(wt)}else ut(void 0),et()}},[ht,ct]);const xt=async()=>{const bt=await Promise.all([odeServices.embedder().getDefault(),odeServices.embedder().getCustom()]).then(wt=>wt.flat());dt(bt)};function vt(bt){const wt=bt.currentTarget.value;nt(wt),et(wt!=null&&wt.length?wt:void 0)}function yt(){tt==null||tt("embedder")}const Et=()=>ht?lt?jsxRuntimeExports.jsxs("div",{className:"mx-auto mt-16",children:[jsxRuntimeExports.jsxs("div",{className:"video-embed-provider d-flex align-items-center",children:[jsxRuntimeExports.jsx(Image$1,{src:lt.logo,alt:"Logo "+lt.displayName,className:"video-embed-provider-logo"}),lt.displayName]}),ot&&jsxRuntimeExports.jsx("div",{className:"video-embed-preview mt-12",dangerouslySetInnerHTML:{__html:ot}})]}):jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column align-items-center m-16",children:[jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuError,title:rt("bbm.video.previewError.title"),text:rt("bbm.video.previewError.text")}),tt&&jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:yt,className:"align-items-start mt-16",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})]}):tt&&jsxRuntimeExports.jsx("div",{className:"d-flex my-16 align-items-start",children:jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:yt,className:"align-items-start",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})});return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill video-embed",children:[jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconGlobe,{className:"me-8"}),rt("bbm.video.url.title")]}),jsxRuntimeExports.jsx(FormControl,{id:ft,children:jsxRuntimeExports.jsx(Input,{size:"md",type:"text",placeholder:rt("bbm.video.url.placeholder"),onChange:vt})}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Et()})]})},VideoEmbedder=()=>{const{switchType:tt,setResult:et}=useMediaLibraryContext();return jsxRuntimeExports.jsx(VideoEmbed,{switchType:tt,onSuccess:rt=>{et(rt)}})},SvgIconSortAscendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 16.293a1 1 0 0 1 1.414 0L7 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 4a1 1 0 0 1 1 1v15a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconSortDescendingLetters=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 8.707a1 1 0 0 0 1.414 0L7 6.414l2.293 2.293a1 1 0 0 0 1.414-1.414l-3-3a1 1 0 0 0-1.414 0l-3 3a1 1 0 0 0 0 1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 21a1 1 0 0 0 1-1V5a1 1 0 0 0-2 0v15a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),SvgIconSortTime=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.509 6.027a6.138 6.138 0 1 1-.28 12.099 1 1 0 1 0-.383 1.963A8.138 8.138 0 1 0 9.653 5.488a1 1 0 1 0 1.168 1.624 6.1 6.1 0 0 1 2.688-1.085",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.38 8.252a1 1 0 0 0-1 1v3.8a1 1 0 0 0 .456.838l2.052 1.332a1 1 0 0 0 1.089-1.678l-1.597-1.036V9.252a1 1 0 0 0-1-1M1.793 16.293a1 1 0 0 1 1.414 0L5.5 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 4a1 1 0 0 0-1 1v15a1 1 0 1 0 2 0V5a1 1 0 0 0-1-1",clipRule:"evenodd"})]}),illuTrash="/assets/js/ode-explorer/illu-trash.svg",illuTrash$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTrash},Symbol.toStringTag,{value:"Module"})),Grid=({children:tt,className:et,...rt})=>{const st=clsx("grid",et);return jsxRuntimeExports.jsx("div",{className:st,...rt,children:tt})},Column=({sm:tt,md:et,lg:rt,xl:st,children:nt,className:ot,as:at,...lt})=>{const ut=at||"div",ct=clsx({[`g-col-${tt}`]:tt,[et?`g-col-md-${et}`:""]:et,[rt?`g-col-lg-${rt}`:""]:rt,[st?`g-col-xl-${st}`:""]:st},ot);return jsxRuntimeExports.jsx(ut,{className:ct,...lt,children:nt})};Grid.Col=Column;const SvgIconLandscape=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.222 5.037c-.895 0-1.222.555-1.222.792v12.675c0 .237.327.792 1.222.792h1.364l9.707-9.886a.987.987 0 0 1 1.414 0L21 13.782V5.829c0-.237-.328-.792-1.222-.792zM23 16.224V5.829C23 4.066 21.337 3 19.778 3H4.222C2.662 3 1 4.066 1 5.83v12.674c0 1.763 1.662 2.829 3.222 2.829h15.556c1.56 0 3.222-1.066 3.222-2.83v-2.279m-2 .439-5-5.093-7.585 7.726h11.363c.894 0 1.222-.555 1.222-.792zM8 8.093c-.552 0-1 .455-1 1.018a1.01 1.01 0 0 0 1 1.018c.552 0 1-.456 1-1.018a1.01 1.01 0 0 0-1-1.019M5 9.11c0-1.688 1.343-3.056 3-3.056s3 1.368 3 3.056-1.343 3.055-3 3.055-3-1.368-3-3.055",clipRule:"evenodd"})]}),SvgIconTextPage=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.286 3c-.35 0-.68.135-.92.368-.238.231-.366.54-.366.854v15.556c0 .315.128.623.367.854.239.233.569.368.919.368h11.428c.35 0 .68-.135.92-.368.238-.231.366-.54.366-.854V8h-3a2 2 0 0 1-2-2V3zM16 6h1.986L16 4.08zm5 13.778V6.556a1 1 0 0 0-.305-.72L15.98 1.281A1 1 0 0 0 15.286 1h-9a3.32 3.32 0 0 0-2.314.934A3.2 3.2 0 0 0 3 4.222v15.556c0 .864.353 1.686.972 2.288S5.423 23 6.286 23h11.428c.863 0 1.695-.333 2.314-.934.619-.602.972-1.424.972-2.288M8 6a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm-1 6a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1m5 4a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2z",clipRule:"evenodd"})]}),SvgIconVideo=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4 4.962C4 4.376 4.435 4 4.853 4H6.5v2H4zM4 8h2.5v3H4zm-2 4V4.962C2 3.381 3.224 2 4.853 2h13.294C19.776 2 21 3.38 21 4.962v14.076C21 20.619 19.776 22 18.147 22H4.853C3.224 22 2 20.62 2 19.038zm17-6V4.962c0-.586-.435-.962-.853-.962H16.5v2zm0 2h-2.5v3H19zm-2.5 5H19v3h-2.5zm0 5H19v1.038c0 .586-.435.962-.853.962H16.5zm-2-7V4h-6v7zm-6 2h6v7h-6zm-2 5v2H4.853C4.435 20 4 19.624 4 19.038V18zm0-2v-3H4v3z",clipRule:"evenodd"})]}),FileIcon=({type:tt,roleMap:et})=>{const rt=typeof(et==null?void 0:et.icon)!="string"&&tt!=="unknown"&&(et==null?void 0:et.hasShadow)!==!1,st=clsx("position-absolute top-50 start-50 translate-middle",{"p-12 rounded-circle shadow":rt},et==null?void 0:et.color);return jsxRuntimeExports.jsx("div",{className:st,children:(et==null?void 0:et.icon)??jsxRuntimeExports.jsx(SvgIconPaperclip,{})})};var observerMap=new Map,RootIds=new WeakMap,rootId=0,unsupportedValue=void 0;function getRootId(tt){return tt?(RootIds.has(tt)||(rootId+=1,RootIds.set(tt,rootId.toString())),RootIds.get(tt)):"0"}function optionsToId(tt){return Object.keys(tt).sort().filter(et=>tt[et]!==void 0).map(et=>`${et}_${et==="root"?getRootId(tt.root):tt[et]}`).toString()}function createObserver(tt){let et=optionsToId(tt),rt=observerMap.get(et);if(!rt){const st=new Map;let nt;const ot=new IntersectionObserver(at=>{at.forEach(lt=>{var ut;const ct=lt.isIntersecting&&nt.some(dt=>lt.intersectionRatio>=dt);tt.trackVisibility&&typeof lt.isVisible>"u"&&(lt.isVisible=ct),(ut=st.get(lt.target))==null||ut.forEach(dt=>{dt(ct,lt)})})},tt);nt=ot.thresholds||(Array.isArray(tt.threshold)?tt.threshold:[tt.threshold||0]),rt={id:et,observer:ot,elements:st},observerMap.set(et,rt)}return rt}function observe(tt,et,rt={},st=unsupportedValue){if(typeof window.IntersectionObserver>"u"&&st!==void 0){const ut=tt.getBoundingClientRect();return et(st,{isIntersecting:st,target:tt,intersectionRatio:typeof rt.threshold=="number"?rt.threshold:0,time:0,boundingClientRect:ut,intersectionRect:ut,rootBounds:ut}),()=>{}}const{id:nt,observer:ot,elements:at}=createObserver(rt);let lt=at.get(tt)||[];return at.has(tt)||at.set(tt,lt),lt.push(et),ot.observe(tt),function(){lt.splice(lt.indexOf(et),1),lt.length===0&&(at.delete(tt),ot.unobserve(tt)),at.size===0&&(ot.disconnect(),observerMap.delete(nt))}}function useInView({threshold:tt,delay:et,trackVisibility:rt,rootMargin:st,root:nt,triggerOnce:ot,skip:at,initialInView:lt,fallbackInView:ut,onChange:ct}={}){var dt;const[ht,ft]=reactExports.useState(null),xt=reactExports.useRef(),[vt,yt]=reactExports.useState({inView:!!lt,entry:void 0});xt.current=ct,reactExports.useEffect(()=>{if(at||!ht)return;let St;return St=observe(ht,(Rt,Ct)=>{yt({inView:Rt,entry:Ct}),xt.current&&xt.current(Rt,Ct),Ct.isIntersecting&&ot&&St&&(St(),St=void 0)},{root:nt,rootMargin:st,threshold:tt,trackVisibility:rt,delay:et},ut),()=>{St&&St()}},[Array.isArray(tt)?tt.toString():tt,ht,nt,st,ot,at,rt,ut,et]);const Et=(dt=vt.entry)==null?void 0:dt.target,bt=reactExports.useRef();!ht&&Et&&!ot&&!at&&bt.current!==Et&&(bt.current=Et,yt({inView:!!lt,entry:void 0}));const wt=[ft,vt.inView,vt.entry];return wt.ref=wt[0],wt.inView=wt[1],wt.entry=wt[2],wt}function useThumbnail(tt,et){const[rt,st]=reactExports.useState(null),{ref:nt,inView:ot}=useInView({triggerOnce:!0,...et==null?void 0:et.intersectionOptions});return reactExports.useEffect(()=>{var at;(at=et==null?void 0:et.ref)!=null&&at.current&&(nt==null||nt(et.ref.current))},[et==null?void 0:et.ref,nt]),reactExports.useEffect(()=>{if((et==null?void 0:et.ref)===void 0||ot){const at=new Image;return at.src=tt,at.onload=()=>{st(!0)},at.onerror=()=>{st(!1)},()=>{at.onload=null,at.onerror=null,st(null)}}},[ot]),rt}const FileCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:st=!1,onClick:nt,className:ot,onSelect:at,isFocused:lt,app:ut,customIcon:ct,customColor:dt})=>{const ht=reactExports.useRef(null),ft=DocumentHelper.getRole(tt);function xt(St){if(ct!==void 0||dt!==void 0)return{icon:ct||jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:dt||"bg-gray-300",hasShadow:!1};const Rt={csv:{icon:".CSV",color:"bg-orange-200"},xls:{icon:".XLS",color:"bg-green-200"},doc:{icon:".DOC",color:"bg-blue-200"},txt:{icon:".TXT",color:"bg-blue-200"},pdf:{icon:".PDF",color:"bg-red-200"},audio:{icon:jsxRuntimeExports.jsx(SvgIconMic,{width:22,height:22}),color:"bg-red-200"},ppt:{icon:".PPT",color:"bg-yellow-200"},img:{icon:jsxRuntimeExports.jsx(SvgIconLandscape,{width:22,height:22}),color:"bg-green-200"},video:{icon:jsxRuntimeExports.jsx(SvgIconVideo,{width:22,height:22}),color:"bg-purple-200"},zip:{icon:".ZIP",color:"bg-gray-300"},md:{icon:".MD",color:"bg-blue-200"},unknown:{icon:jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:"bg-gray-300"}};return Rt[St]||Rt.unknown}const vt=xt(ft??"unknown"),yt=clsx("file position-relative rounded",(vt==null?void 0:vt.color)??"bg-yellow-200"),Et=ft==="img"||ft==="video"?odeServices.workspace().getThumbnailUrl(tt):null,bt=useThumbnail(Et,{ref:ht}),wt=bt&&{backgroundImage:`url(${Et})`,backgroundSize:"cover"};return jsxRuntimeExports.jsx(Card,{className:clsx("card-file",ot),isClickable:et,isSelectable:rt,isSelected:st,onClick:nt,app:ut,isFocused:lt,onSelect:at,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{ref:ht,className:yt,style:{aspectRatio:"16/10",...wt},children:ft!=="img"||ft==="img"&&!bt?jsxRuntimeExports.jsx(FileIcon,{type:ft,roleMap:vt}):null}),jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.ownerName})]})]})})},Workspace$1=({roles:tt,onSelect:et,multiple:rt=!0,className:st,defaultFolder:nt,showPublicFolder:ot})=>{const{t:at}=useTranslation(),{root:lt,loadContent:ut}=useWorkspaceSearch("root",at("workspace.tree.owner"),"owner",tt),{root:ct,loadContent:dt}=useWorkspaceSearch("root",at("workspace.tree.shared"),"shared",tt),{root:ht,loadContent:ft}=useWorkspaceSearch("root",at("workspace.tree.protected"),"protected",tt),{root:xt,loadContent:vt}=useWorkspaceSearch("root",at("workspace.tree.public"),"public",tt),yt=reactExports.useRef(null),Et=reactExports.useRef(null),bt=reactExports.useRef(null),wt=reactExports.useRef(null),[St,Rt]=reactExports.useState(()=>nt==="public"?ot?nt:"protected":nt==="protected"||nt==="shared"?nt:"owner"),[Ct,It]=reactExports.useState(()=>nt==="public"?ot?xt:ht:nt==="protected"?ht:nt==="shared"?ct:lt),[jt,Pt]=reactExports.useState(),[Ot,Ut]=reactExports.useState(null),[Nt,Ht]=reactExports.useState(["modified","desc"]),[Lt,kt]=reactExports.useState([]),$t=reactExports.useCallback(Yt=>{switch(Yt){case"owner":return{root:lt,othersRef:[Et,bt,wt]};case"shared":return{root:ct,othersRef:[yt,bt,wt]};case"protected":return{root:ht,othersRef:[yt,Et,wt]};case"public":return{root:xt,othersRef:[yt,Et,bt]};default:throw"no.root.node"}},[lt,ct,ht,xt]),Ft=reactExports.useCallback(()=>{switch(St){case"owner":ut(Ct.id);break;case"shared":dt(Ct.id);break;case"protected":ft(Ct.id);break;case"public":vt(Ct.id);break;default:throw"no.way"}},[St,Ct.id,ut,ft,vt,dt]);function Gt(Yt,tr){Rt(Yt);const{root:lr,othersRef:ur}=$t(Yt),mr=findTreeNode(lr,yr=>yr.id===tr);mr&&(It(mr),ur.forEach(yr=>{var or;return(or=yr.current)==null?void 0:or.unselectAll()}))}reactExports.useEffect(()=>{var Yt;let tr;switch(St){case"owner":tr=yt;break;case"shared":tr=Et;break;case"protected":tr=bt;break;case"public":tr=wt;break;default:return}(Yt=tr==null?void 0:tr.current)==null||Yt.select("root")},[St]),reactExports.useEffect(Ft,[Ft]),reactExports.useEffect(()=>{if(Ct.files){let Yt=[].concat(Ct.files);Ot&&(Yt=Yt.filter(lr=>lr.name.indexOf(Ot)>=0));const tr=Nt[0]==="name"?Nt[1]==="asc"?(lr,ur)=>Vt(lr.name,ur.name):(lr,ur)=>Vt(ur.name,lr.name):(lr,ur)=>Vt(ur.modified,lr.modified);Pt(()=>Yt.sort(tr))}else Pt(void 0)},[Ct,lt,ht,ct,xt,Ot,Nt]);const Mt=reactExports.useCallback(Yt=>{Ut(Yt.target.value)},[Ut]);function Vt(Yt,tr){return Yt?tr?Yt.localeCompare(tr):1:-1}function Bt(){return Nt[0]==="name"?Nt[1]==="asc"?at("sort.order.alpha.asc"):at("sort.order.alpha.desc"):at("sort.order.modify.desc")}function qt(Yt){let tr=[...Lt];rt?tr.includes(Yt)?tr=tr.filter(lr=>lr._id!==Yt._id):tr=[...tr,Yt]:tr=[Yt],kt(tr),et(tr)}const Qt=clsx("workspace flex-grow-1 gap-0",st);return jsxRuntimeExports.jsxs(Grid,{className:Qt,children:[jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"3",xl:"4",className:"workspace-folders p-12 pt-0 gap-12",children:jsxRuntimeExports.jsxs("div",{style:{position:"sticky",top:0,paddingTop:"1.2rem"},children:[jsxRuntimeExports.jsx(TreeView,{ref:yt,data:lt,onTreeItemClick:Yt=>Gt("owner",Yt),onTreeItemUnfold:Yt=>Gt("owner",Yt)}),jsxRuntimeExports.jsx(TreeView,{ref:Et,data:ct,onTreeItemClick:Yt=>Gt("shared",Yt),onTreeItemUnfold:Yt=>Gt("shared",Yt)}),jsxRuntimeExports.jsx(TreeView,{ref:bt,data:ht,onTreeItemClick:Yt=>Gt("protected",Yt),onTreeItemUnfold:Yt=>Gt("protected",Yt)}),ot&&jsxRuntimeExports.jsx(TreeView,{ref:wt,data:xt,onTreeItemClick:Yt=>Gt("public",Yt),onTreeItemUnfold:Yt=>Gt("public",Yt)})]})}),jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"5",xl:"8",children:jsxRuntimeExports.jsxs(Grid,{className:"flex-grow-1 gap-0",children:[jsxRuntimeExports.jsxs(Grid.Col,{sm:"4",md:"8",xl:"12",children:[jsxRuntimeExports.jsx("div",{className:"workspace-search px-16 py-8 ",children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,className:"gap-16",onChange:Mt})}),jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center justify-content-end px-8 py-4",children:[jsxRuntimeExports.jsx("small",{className:"text-muted",children:at("workspace.search.order")}),jsxRuntimeExports.jsxs(Dropdown,{children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"sm",label:Bt(),variant:"ghost"}),jsxRuntimeExports.jsxs(Dropdown.Menu,{children:[jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortTime,{}),onClick:()=>Ht(["modified","desc"]),children:at("sort.order.modify.desc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortAscendingLetters,{}),onClick:()=>Ht(["name","asc"]),children:at("sort.order.alpha.asc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortDescendingLetters,{}),onClick:()=>Ht(["name","desc"]),children:at("sort.order.alpha.desc")})]})]})]})]}),jsxRuntimeExports.jsx(Grid.Col,{sm:"4",md:"8",xl:"12",className:"p-8 gap-8",children:jt?jt.length!==0?jsxRuntimeExports.jsx("div",{className:"grid grid-workspace",children:jt.map(Yt=>{const tr=Lt.includes(Yt);return jsxRuntimeExports.jsx(FileCard,{doc:Yt,isSelected:tr,onClick:()=>qt(Yt)},Yt._id)})}):jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuTrash,text:at("workspace.empty.docSpace"),title:at("explorer.emptyScreen.trash.title")}):jsxRuntimeExports.jsx(LoadingScreen,{})})]})})]})},Workspace=()=>{const{type:tt,setResultCounter:et,setResult:rt,multiple:st,visibility:nt}=useMediaLibraryContext();function ot(){switch(tt){case"image":return"img";case"audio":return"audio";case"video":return"video";default:return null}}function at(lt){et(lt.length),lt.length?rt(lt):rt()}return jsxRuntimeExports.jsx(Workspace$1,{roles:ot(),onSelect:at,multiple:st,className:"border rounded overflow-y-auto",defaultFolder:nt,showPublicFolder:nt==="public"})},InnerTabs={Audio,Video,Upload,ExternalLink,Workspace,InternalLink,Iframe,VideoEmbedder},TabsContext=reactExports.createContext(null);function useTabsContext(){const tt=reactExports.useContext(TabsContext);if(!tt)throw new Error("Tabs compound components cannot be rendered outside the Tabs component");return tt}const useTabs=({defaultId:tt,items:et,onChange:rt})=>{const[st,nt]=reactExports.useState(tt||""),[ot,at]=reactExports.useState(0),[lt,ut]=reactExports.useState(0),ct=reactExports.useRef([]),dt=reactExports.useCallback(vt=>{nt(vt)},[]);reactExports.useEffect(()=>{const vt=et.find(yt=>yt.id===st);vt&&(rt==null||rt(vt))},[st]),reactExports.useEffect(()=>{function vt(){var yt;if(((yt=document==null?void 0:document.activeElement)==null?void 0:yt.tagName)!=="INPUT"){const Et=et.findIndex(wt=>wt.id===st);Et===-1&&tt&&nt(tt);const bt=ct.current[Et];bt&&(bt.focus(),ut((bt==null?void 0:bt.offsetLeft)??0),at((bt==null?void 0:bt.clientWidth)??0))}}return vt(),window.addEventListener("resize",vt),()=>window.removeEventListener("resize",vt)},[st,et,tt]);const ht=reactExports.useCallback(vt=>{var yt,Et,bt;const wt=et.findIndex(St=>St.id===vt);vt===((yt=et[0])==null?void 0:yt.id)?nt((Et=et[et.length-1])==null?void 0:Et.id):nt((bt=et[wt-1])==null?void 0:bt.id)},[et]),ft=reactExports.useCallback(vt=>{var yt,Et,bt;const wt=et.findIndex(St=>St.id===vt);vt===((yt=et[et.length-1])==null?void 0:yt.id)?nt((Et=et[0])==null?void 0:Et.id):nt((bt=et[wt+1])==null?void 0:bt.id)},[et]),xt=reactExports.useCallback(vt=>{var yt,Et;switch(vt.code){case"ArrowLeft":ht(st);break;case"ArrowRight":ft(st);break;case"Home":nt((yt=et[0])==null?void 0:yt.id);break;case"End":nt((Et=et[et.length-1])==null?void 0:Et.id);break}},[st,et,ft,ht]);return{activeTab:st,setSelectedTab:dt,tabsRef:ct,tabUnderlineLeft:lt,tabUnderlineWidth:ot,onKeyDown:xt}},TabsItem=({icon:tt,badge:et,label:rt,id:st,order:nt})=>{const{activeTab:ot,setSelectedTab:at,onKeyDown:lt,tabsRef:ut}=useTabsContext(),{t:ct}=useTranslation(),dt=clsx("nav-link d-inline-flex gap-8 border-0",ot===st?"selected":"");return jsxRuntimeExports.jsx("li",{className:"nav-item flex-shrink-0",role:"presentation",children:jsxRuntimeExports.jsxs("button",{ref:ht=>ut.current[nt]=ht,type:"button",id:`tab-${st}`,className:dt,onClick:()=>at(st),onKeyDown:ht=>lt(ht),role:"tab","aria-controls":`tabpanel-${st}`,"aria-selected":ot===st,tabIndex:ot===st?0:-1,children:[tt,jsxRuntimeExports.jsxs("small",{children:[ct(rt)," ",et]})]})})},TabsList=tt=>{const{items:et,tabUnderlineLeft:rt,tabUnderlineWidth:st}=useTabsContext(),{className:nt,fullWidth:ot,isSticky:at,stickyTop:lt,...ut}=tt,ct=clsx("nav nav-tabs flex-nowrap",{"w-100":ot}),dt=clsx(" flex-shrink-0 overflow-x-auto",{"position-sticky z-1":at,"position-relative":!at},nt);return jsxRuntimeExports.jsx("div",{className:dt,...ut,style:at?{top:lt}:void 0,children:jsxRuntimeExports.jsxs("ul",{className:ct,role:"tablist",children:[et.map((ht,ft)=>jsxRuntimeExports.jsx(Tabs.Item,{order:ft,...ht},ht.id)),jsxRuntimeExports.jsx("span",{className:"nav-slide",style:{left:rt,width:st}})]})})},TabsPanel=({children:tt,currentItem:et,fullHeight:rt,className:st})=>{const{activeTab:nt}=useTabsContext(),ot=clsx("tab-content d-flex flex-fill w-100",{"position-relative h-100":rt},st);return jsxRuntimeExports.jsx("div",{className:ot,children:jsxRuntimeExports.jsx("div",{className:`tab-pane flex-fill w-100 fade ${nt===(et==null?void 0:et.id)?"show active":""}`,id:`tabpanel-${et==null?void 0:et.id}`,role:"tabpanel","aria-labelledby":`tab-${et==null?void 0:et.id}`,tabIndex:0,children:tt})})},Tabs=({defaultId:tt,items:et,fullWidth:rt=!1,fullHeight:st=!1,onChange:nt,children:ot,isSticky:at=!1,stickyTop:lt=0,headerClassName:ut,contentClassName:ct})=>{const{activeTab:dt,setSelectedTab:ht,tabsRef:ft,tabUnderlineLeft:xt,tabUnderlineWidth:vt,onKeyDown:yt}=useTabs({defaultId:tt,items:et,onChange:nt}),Et=reactExports.useMemo(()=>({activeTab:dt,items:et,setSelectedTab:ht,tabsRef:ft,tabUnderlineLeft:xt,tabUnderlineWidth:vt,onKeyDown:yt}),[dt,et,yt,ht,xt,vt,ft]),bt=et.find(wt=>wt.id===dt);return jsxRuntimeExports.jsx(TabsContext.Provider,{value:Et,children:typeof ot=="function"?ot(bt):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tabs.List,{fullWidth:rt,isSticky:at,stickyTop:lt,className:ut}),jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:bt,fullHeight:st,className:ct,children:bt==null?void 0:bt.content})]})})};Tabs.Item=TabsItem;Tabs.Panel=TabsPanel;Tabs.List=TabsList;const orderedTabs=["audio-capture","video-capture","internal-link","external-link","iframe","upload","workspace","video-embedder"],mediaLibraryTypes={none:null,audio:{title:"bbm.audio.modal.title",defaultTab:"audio-capture"},video:{title:"bbm.video.modal.title",defaultTab:"video-capture"},image:{title:"bbm.image.modal.title",defaultTab:"workspace"},attachment:{title:"bbm.attachment.modal.title",defaultTab:"workspace"},hyperlink:{title:"bbm.link.modal.title",defaultTab:"linker"},embedder:{title:"bbm.embed.modal.title",defaultTab:"iframe"},studio:{title:"bbm.studio.modal.title",defaultTab:"audio-capture"}},MediaLibrary=reactExports.forwardRef(({appCode:tt,visibility:et,multiple:rt,onSuccess:st,onCancel:nt,onTabChange:ot},at)=>{var lt;const ut=reactExports.useRef(),ct=reactExports.useRef(null);reactExports.useImperativeHandle(at,()=>({show:kt,hide:$t,showLink:Ft,type:xt,...ct.current}));const{t:dt}=useTranslation(),ht=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"),ft=useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),[xt,vt]=reactExports.useState(null);useHttpErrorToast({active:!!xt,isDismissible:!0,duration:1/0});const yt={workspace:{id:"workspace",icon:jsxRuntimeExports.jsx(SvgIconFolder,{}),label:dt("bbm.workspace"),content:jsxRuntimeExports.jsx(InnerTabs.Workspace,{}),availableFor:["audio","video","image","attachment"],isEnable:null},upload:{id:"upload",icon:jsxRuntimeExports.jsx(SvgIconSmartphone,{}),label:dt("bbm.device"),content:jsxRuntimeExports.jsx(InnerTabs.Upload,{}),availableFor:["audio","video","image","attachment"],isEnable:()=>!!ht},"video-capture":{id:"video-capture",icon:jsxRuntimeExports.jsx(SvgIconRecordVideo,{}),label:dt("bbm.video"),content:jsxRuntimeExports.jsx(InnerTabs.Video,{}),availableFor:["video","studio"],isEnable:()=>!!ft},"audio-capture":{id:"audio-capture",icon:jsxRuntimeExports.jsx(SvgIconMic,{}),label:dt("bbm.audio"),content:jsxRuntimeExports.jsx(InnerTabs.Audio,{}),availableFor:["audio","studio"],isEnable:()=>!!ht},"external-link":{id:"external-link",icon:jsxRuntimeExports.jsx(SvgIconGlobe,{}),label:dt("bbm.linker.ext"),content:jsxRuntimeExports.jsx(InnerTabs.ExternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},"internal-link":{id:"internal-link",icon:jsxRuntimeExports.jsx(SvgIconApplications,{}),label:dt("bbm.linker.int"),content:jsxRuntimeExports.jsx(InnerTabs.InternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},iframe:{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.Iframe,{}),availableFor:["embedder"],isEnable:null},"video-embedder":{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.VideoEmbedder,{}),availableFor:["video"],isEnable:null}},Et=reactExports.useMemo(()=>orderedTabs.map(Qt=>yt[Qt]).filter(Qt=>{var Yt;return((Yt=Qt.isEnable)==null?void 0:Yt.call(Qt))!==!1&&(Qt.availableFor.length===0||Qt.availableFor.includes(xt))}),[xt]),[bt,wt]=reactExports.useState(),St=reactExports.useMemo(()=>{const Qt=Et.findIndex(Yt=>Yt.id===bt);return 0>Qt||Qt>=Et.length?0:Qt},[Et,bt]),[Rt,Ct]=reactExports.useState(),[It,jt]=reactExports.useState(),[Pt,Ot]=reactExports.useState([]),[Ut,Nt]=reactExports.useState();function Ht(Qt){throw Et.findIndex(Yt=>Yt.id===Qt)<0?"tab.not.visible":"not.implemented.yet"}function Lt(Qt){ut.current=void 0,wt(void 0),vt(Qt)}const kt=Qt=>{vt(Qt)},$t=()=>{vt(null)},Ft=Qt=>{ut.current=Qt,"resourceId"in Qt||"appPrefix"in Qt||wt("external-link"),vt("hyperlink")};reactExports.useEffect(()=>{var Qt,Yt;const tr=xt||"none";!bt&&typeof((Qt=mediaLibraryTypes[tr])==null?void 0:Qt.defaultTab)=="string"&&wt((Yt=mediaLibraryTypes[tr])==null?void 0:Yt.defaultTab)},[bt,xt]);const Gt=dt(((lt=mediaLibraryTypes[xt??"none"])==null?void 0:lt.title)??"bbm"),Mt=()=>{ut.current=void 0,jt(void 0),Ct(void 0),wt(void 0),Nt(void 0),Ot([])},Vt=Qt=>{ot==null||ot(Qt,Pt),Mt()},Bt=reactExports.useCallback(()=>{const Qt=async Yt=>{Yt instanceof Array&&["protected","public"].findIndex(tr=>tr===et)>=0&&(Yt=await odeServices.workspace().transferDocuments(Yt,tt??"media-library",et)),st(Yt)};Ut?Ut().then(Yt=>{Qt(Yt)}):It&&Qt(It),Mt()},[Ut,It,st,et,tt]),qt=()=>{nt(Pt),Mt()};return xt&&jsxRuntimeExports.jsx(MediaLibraryContext.Provider,{value:{appCode:tt,visibility:et,multiple:rt,type:xt,setResultCounter:Ct,setResult:jt,setCancellable:Qt=>Ot([...Qt]),setVisibleTab:Ht,switchType:Lt,setPreSuccess:Nt},children:jsxRuntimeExports.jsxs(Modal,{id:"media-library",isOpen:xt!==null,onModalClose:qt,size:"lg",viewport:!0,scrollable:!0,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:qt,children:Gt}),jsxRuntimeExports.jsx(Tabs,{items:Et,defaultId:Et[St].id,onChange:Vt,children:Qt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Et.length>1&&jsxRuntimeExports.jsx(Tabs.List,{className:"mt-16"}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex",children:jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:Qt,children:Qt==null?void 0:Qt.content})})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:qt,children:dt("cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",disabled:typeof It>"u",onClick:Bt,children:Rt&&Rt>1?dt("addMultiple",{number:Rt}):dt("add")})]})]})})});function PublishModal$2({isOpen:tt,resourceId:et,onSuccess:rt,onCancel:st}){const{appCode:nt,currentApp:ot}=useEdificeClient(),{ref:at,libraryMedia:lt,...ut}=useMediaLibrary(),{t:ct}=useTranslation(),dt=useResource(nt,et),{control:ht,cover:ft,formState:{isDirty:xt,isValid:vt,isSubmitting:yt},handleDeleteImage:Et,handleSubmit:bt,handleUploadImage:wt,handlePublish:St,register:Rt,selectActivities:Ct,selectedActivities:It,selectedSubjectAreas:jt,selectSubjects:Pt}=usePublishModal({resource:dt,onSuccess:rt});return dt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:st,id:"libraryModal",size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:st,children:ct("bpr.publish")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:ct("bpr.form.tip")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.general")}),jsxRuntimeExports.jsxs("form",{id:"libraryModalForm",onSubmit:bt(St),children:[jsxRuntimeExports.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[jsxRuntimeExports.jsxs("div",{style:{maxWidth:"160px"},children:[jsxRuntimeExports.jsx("div",{className:"form-label",children:ct("bpr.form.publication.cover.title")}),jsxRuntimeExports.jsx(ImagePicker,{app:ot,src:dt==null?void 0:dt.thumbnail,addButtonLabel:ct("bpr.form.publication.cover.upload.add"),deleteButtonLabel:ct("bpr.form.publication.cover.upload.remove"),onUploadImage:wt,onDeleteImage:Et,className:"align-self-center",libraryMedia:lt,mediaLibraryRef:at}),!ft&&jsxRuntimeExports.jsx("p",{className:"form-text is-invalid",children:jsxRuntimeExports.jsx("em",{children:ct("bpr.form.publication.cover.upload.required.image")})})]}),jsxRuntimeExports.jsxs("div",{className:"flex-fill",children:[jsxRuntimeExports.jsxs(FormControl,{id:"title",className:"mb-16",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.title")}),jsxRuntimeExports.jsx(Input,{type:"text",defaultValue:dt==null?void 0:dt.name,...Rt("title",{required:!0}),placeholder:ct("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),jsxRuntimeExports.jsxs(FormControl,{id:"description",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.description")}),jsxRuntimeExports.jsx(TextArea,{...Rt("description",{required:!0}),placeholder:ct("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.infos")}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[jsxRuntimeExports.jsx(ActivitiesDropdown,{control:ht,selectedActivities:It,selectActivities:Ct}),jsxRuntimeExports.jsx(SubjectsDropdown,{control:ht,selectedSubjectAreas:jt,selectSubjects:Pt}),jsxRuntimeExports.jsx(LangSelect,{control:ht})]}),jsxRuntimeExports.jsxs("div",{className:"mb-24",children:[jsxRuntimeExports.jsx("label",{htmlFor:"",className:"form-label",children:ct("bpr.form.publication.age")}),jsxRuntimeExports.jsxs("div",{className:"d-flex gap-8",children:[jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(Nt,Ht)=>parseInt(Nt)<=parseInt(Ht.ageMax)})}),jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(Nt,Ht)=>parseInt(Nt)>=parseInt(Ht.ageMin)})})]})]}),jsxRuntimeExports.jsx("div",{className:"mb-24",children:jsxRuntimeExports.jsxs(FormControl,{id:"keywords",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.keywords")}),jsxRuntimeExports.jsx(Input,{type:"text",...Rt("keyWords"),size:"md",placeholder:ct("bpr.form.publication.keywords.placeholder")})]})}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.licence.text")}),jsxRuntimeExports.jsx(PublishModalFooter,{})]})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:st,type:"button",variant:"ghost",children:ct("cancel")}),jsxRuntimeExports.jsx(Button,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:yt,disabled:!ft||yt||!xt||!vt,children:ct("bpr.form.submit")})]}),jsxRuntimeExports.jsx(MediaLibrary,{appCode:nt,ref:at,multiple:!1,visibility:"protected",...ut})]}),document.getElementById("portal")):jsxRuntimeExports.jsx(LoadingScreen,{})}const SvgIconCopy=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.676 3c.284-.672.853-1 1.263-1h11.423c.566 0 1.438.628 1.438 1.923v13.154c0 1.056-.58 1.668-1.1 1.858V6.923C19.7 4.99 18.3 3 16.061 3zm-2.272.007C4.765 1.41 6.056 0 7.939 0h11.423C21.599 0 23 1.99 23 3.923v13.154c0 1.865-1.303 3.782-3.403 3.916C19.235 22.59 17.944 24 16.06 24H4.638C2.401 24 1 22.01 1 20.077V6.923c0-1.865 1.303-3.782 3.404-3.916M3.2 6.923C3.2 5.628 4.072 5 4.638 5h11.423c.567 0 1.439.628 1.439 1.923v13.154c0 1.295-.872 1.923-1.439 1.923H4.638c-.566 0-1.438-.628-1.438-1.923z",clipRule:"evenodd"})]}),defaults=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function objectHash(tt,et){et?et={...defaults,...et}:et=defaults;const rt=createHasher(et);return rt.dispatch(tt),rt.toString()}const defaultPrototypesKeys=Object.freeze(["prototype","__proto__","constructor"]);function createHasher(tt){let et="",rt=new Map;const st=nt=>{et+=nt};return{toString(){return et},getContext(){return rt},dispatch(nt){return tt.replacer&&(nt=tt.replacer(nt)),this[nt===null?"null":typeof nt](nt)},object(nt){if(nt&&typeof nt.toJSON=="function")return this.object(nt.toJSON());const ot=Object.prototype.toString.call(nt);let at="";const lt=ot.length;lt<10?at="unknown:["+ot+"]":at=ot.slice(8,lt-1),at=at.toLowerCase();let ut=null;if((ut=rt.get(nt))===void 0)rt.set(nt,rt.size);else return this.dispatch("[CIRCULAR:"+ut+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(nt))return st("buffer:"),st(nt.toString("utf8"));if(at!=="object"&&at!=="function"&&at!=="asyncfunction")this[at]?this[at](nt):tt.ignoreUnknown||this.unkown(nt,at);else{let ct=Object.keys(nt);tt.unorderedObjects&&(ct=ct.sort());let dt=[];tt.respectType!==!1&&!isNativeFunction(nt)&&(dt=defaultPrototypesKeys),tt.excludeKeys&&(ct=ct.filter(ft=>!tt.excludeKeys(ft)),dt=dt.filter(ft=>!tt.excludeKeys(ft))),st("object:"+(ct.length+dt.length)+":");const ht=ft=>{this.dispatch(ft),st(":"),tt.excludeValues||this.dispatch(nt[ft]),st(",")};for(const ft of ct)ht(ft);for(const ft of dt)ht(ft)}},array(nt,ot){if(ot=ot===void 0?tt.unorderedArrays!==!1:ot,st("array:"+nt.length+":"),!ot||nt.length<=1){for(const ut of nt)this.dispatch(ut);return}const at=new Map,lt=nt.map(ut=>{const ct=createHasher(tt);ct.dispatch(ut);for(const[dt,ht]of ct.getContext())at.set(dt,ht);return ct.toString()});return rt=at,lt.sort(),this.array(lt,!1)},date(nt){return st("date:"+nt.toJSON())},symbol(nt){return st("symbol:"+nt.toString())},unkown(nt,ot){if(st(ot),!!nt&&(st(":"),nt&&typeof nt.entries=="function"))return this.array(Array.from(nt.entries()),!0)},error(nt){return st("error:"+nt.toString())},boolean(nt){return st("bool:"+nt)},string(nt){st("string:"+nt.length+":"),st(nt)},function(nt){st("fn:"),isNativeFunction(nt)?this.dispatch("[native]"):this.dispatch(nt.toString()),tt.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(nt.name)),tt.respectFunctionProperties&&this.object(nt)},number(nt){return st("number:"+nt)},xml(nt){return st("xml:"+nt.toString())},null(){return st("Null")},undefined(){return st("Undefined")},regexp(nt){return st("regex:"+nt.toString())},uint8array(nt){return st("uint8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint8clampedarray(nt){return st("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(nt))},int8array(nt){return st("int8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint16array(nt){return st("uint16array:"),this.dispatch(Array.prototype.slice.call(nt))},int16array(nt){return st("int16array:"),this.dispatch(Array.prototype.slice.call(nt))},uint32array(nt){return st("uint32array:"),this.dispatch(Array.prototype.slice.call(nt))},int32array(nt){return st("int32array:"),this.dispatch(Array.prototype.slice.call(nt))},float32array(nt){return st("float32array:"),this.dispatch(Array.prototype.slice.call(nt))},float64array(nt){return st("float64array:"),this.dispatch(Array.prototype.slice.call(nt))},arraybuffer(nt){return st("arraybuffer:"),this.dispatch(new Uint8Array(nt))},url(nt){return st("url:"+nt.toString())},map(nt){st("map:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},set(nt){st("set:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},file(nt){return st("file:"),this.dispatch([nt.name,nt.size,nt.type,nt.lastModfied])},blob(){if(tt.ignoreUnknown)return st("[blob]");throw new Error(`Hashing Blob objects is currently not supported
|
|
1392
1392
|
Use "options.replacer" or "options.ignoreUnknown"
|
|
1393
1393
|
`)},domwindow(){return st("domwindow")},bigint(nt){return st("bigint:"+nt.toString())},process(){return st("process")},timer(){return st("timer")},pipe(){return st("pipe")},tcp(){return st("tcp")},udp(){return st("udp")},tty(){return st("tty")},statwatcher(){return st("statwatcher")},securecontext(){return st("securecontext")},connection(){return st("connection")},zlib(){return st("zlib")},context(){return st("context")},nodescript(){return st("nodescript")},httpparser(){return st("httpparser")},dataview(){return st("dataview")},signal(){return st("signal")},fsevent(){return st("fsevent")},tlswrap(){return st("tlswrap")}}}const nativeFunc="[native code] }",nativeFuncLength=nativeFunc.length;function isNativeFunction(tt){return typeof tt!="function"?!1:Function.prototype.toString.call(tt).slice(-nativeFuncLength)===nativeFunc}class WordArray{constructor(et,rt){et=this.words=et||[],this.sigBytes=rt===void 0?et.length*4:rt}toString(et){return(et||Hex).stringify(this)}concat(et){if(this.clamp(),this.sigBytes%4)for(let rt=0;rt<et.sigBytes;rt++){const st=et.words[rt>>>2]>>>24-rt%4*8&255;this.words[this.sigBytes+rt>>>2]|=st<<24-(this.sigBytes+rt)%4*8}else for(let rt=0;rt<et.sigBytes;rt+=4)this.words[this.sigBytes+rt>>>2]=et.words[rt>>>2];return this.sigBytes+=et.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new WordArray([...this.words])}}const Hex={stringify(tt){const et=[];for(let rt=0;rt<tt.sigBytes;rt++){const st=tt.words[rt>>>2]>>>24-rt%4*8&255;et.push((st>>>4).toString(16),(st&15).toString(16))}return et.join("")}},Base64={stringify(tt){const et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",rt=[];for(let st=0;st<tt.sigBytes;st+=3){const nt=tt.words[st>>>2]>>>24-st%4*8&255,ot=tt.words[st+1>>>2]>>>24-(st+1)%4*8&255,at=tt.words[st+2>>>2]>>>24-(st+2)%4*8&255,lt=nt<<16|ot<<8|at;for(let ut=0;ut<4&&st*8+ut*6<tt.sigBytes*8;ut++)rt.push(et.charAt(lt>>>6*(3-ut)&63))}return rt.join("")}},Latin1={parse(tt){const et=tt.length,rt=[];for(let st=0;st<et;st++)rt[st>>>2]|=(tt.charCodeAt(st)&255)<<24-st%4*8;return new WordArray(rt,et)}},Utf8={parse(tt){return Latin1.parse(unescape(encodeURIComponent(tt)))}};class BufferedBlockAlgorithm{constructor(){this._data=new WordArray,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new WordArray,this._nDataBytes=0}_append(et){typeof et=="string"&&(et=Utf8.parse(et)),this._data.concat(et),this._nDataBytes+=et.sigBytes}_doProcessBlock(et,rt){}_process(et){let rt,st=this._data.sigBytes/(this.blockSize*4);et?st=Math.ceil(st):st=Math.max((st|0)-this._minBufferSize,0);const nt=st*this.blockSize,ot=Math.min(nt*4,this._data.sigBytes);if(nt){for(let at=0;at<nt;at+=this.blockSize)this._doProcessBlock(this._data.words,at);rt=this._data.words.splice(0,nt),this._data.sigBytes-=ot}return new WordArray(rt,ot)}}class Hasher extends BufferedBlockAlgorithm{update(et){return this._append(et),this._process(),this}finalize(et){et&&this._append(et)}}const H=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],K=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],W=[];class SHA256 extends Hasher{constructor(){super(...arguments),this._hash=new WordArray([...H])}reset(){super.reset(),this._hash=new WordArray([...H])}_doProcessBlock(et,rt){const st=this._hash.words;let nt=st[0],ot=st[1],at=st[2],lt=st[3],ut=st[4],ct=st[5],dt=st[6],ht=st[7];for(let ft=0;ft<64;ft++){if(ft<16)W[ft]=et[rt+ft]|0;else{const St=W[ft-15],Rt=(St<<25|St>>>7)^(St<<14|St>>>18)^St>>>3,Ct=W[ft-2],It=(Ct<<15|Ct>>>17)^(Ct<<13|Ct>>>19)^Ct>>>10;W[ft]=Rt+W[ft-7]+It+W[ft-16]}const xt=ut&ct^~ut&dt,vt=nt&ot^nt&at^ot&at,yt=(nt<<30|nt>>>2)^(nt<<19|nt>>>13)^(nt<<10|nt>>>22),Et=(ut<<26|ut>>>6)^(ut<<21|ut>>>11)^(ut<<7|ut>>>25),bt=ht+Et+xt+K[ft]+W[ft],wt=yt+vt;ht=dt,dt=ct,ct=ut,ut=lt+bt|0,lt=at,at=ot,ot=nt,nt=bt+wt|0}st[0]=st[0]+nt|0,st[1]=st[1]+ot|0,st[2]=st[2]+at|0,st[3]=st[3]+lt|0,st[4]=st[4]+ut|0,st[5]=st[5]+ct|0,st[6]=st[6]+dt|0,st[7]=st[7]+ht|0}finalize(et){super.finalize(et);const rt=this._nDataBytes*8,st=this._data.sigBytes*8;return this._data.words[st>>>5]|=128<<24-st%32,this._data.words[(st+64>>>9<<4)+14]=Math.floor(rt/4294967296),this._data.words[(st+64>>>9<<4)+15]=rt,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function sha256base64(tt){return new SHA256().finalize(tt).toString(Base64)}function hash(tt,et={}){const rt=typeof tt=="string"?tt:objectHash(tt,et);return sha256base64(rt).slice(0,10)}var slugify$1={};Object.defineProperty(slugify$1,"__esModule",{value:!0});const stripAccents=tt=>{const et="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",rt="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",st=et.split("").join("|"),nt=new RegExp(`(${st})`,"g");function ot(at){return rt[et.indexOf(at)]||""}return tt.replace(nt,ot)},getSafeRegexpString=tt=>tt.split("").map(et=>`\\${et}`).join(""),harmonize=(tt,et,rt=!1)=>{const st=stripAccents(tt).trim().toLowerCase(),nt=getSafeRegexpString(et);return rt?st.replace(/\s+/g,et):st.replace(new RegExp(`[^a-z0-9${nt}]+`,"g"),et).replace(new RegExp(`${nt}+`,"g"),et).replace(new RegExp(`^${nt}`,"g"),"").replace(new RegExp(`${nt}$`,"g"),"")},slugify=(tt,et={delimiter:"-",prefix:""})=>{if(et.delimiter||(et.delimiter="-"),et.prefix||(et.prefix=""),!tt||typeof tt=="boolean")return"";const{delimiter:rt,prefix:st}=et;if(typeof tt=="boolean")return"";if(typeof tt=="string"||typeof tt=="number"){const nt=harmonize(st,rt,!0),ot=harmonize(String(tt),rt);return nt?`${nt}${rt}${ot}`:ot}return"children"in tt?slugify(tt.children):"type"in tt?slugify(tt.props.children,et):Symbol.iterator in tt?slugify(Array.from(tt).map(nt=>slugify(nt,{delimiter:rt})).join(rt),et):""};var _default=slugify$1.default=slugify;const useSlug=({watch:tt,setValue:et,selectedResource:rt})=>{const[st,nt]=reactExports.useState(""),[ot,at]=reactExports.useState((rt==null?void 0:rt.public)||!1),lt=reactExports.useId(),ut=tt("title"),{t:ct}=useTranslation(),dt=useToast();reactExports.useEffect(()=>{if(ot){let xt="";rt?xt=rt.slug?rt.slug:`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`:xt=`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`,et("formSlug",xt),nt(xt)}},[ot,ut]);function ht(xt){at(xt)}function ft(xt){navigator.clipboard.writeText(`${window.location.origin}${xt||window.location.pathname}/pub/${st}`),dt.success(ct("explorer.copy.clipboard"))}return{slug:st,uniqueId:lt,isPublic:ot,resourceName:ut,onPublicChange:ht,onCopyToClipBoard:ft}},BlogPublic=({appCode:tt,isUpdating:et,resource:rt,watch:st,register:nt,setValue:ot})=>{const{t:at}=useTranslation(),{slug:lt,isPublic:ut,resourceName:ct,onPublicChange:dt,onCopyToClipBoard:ht}=useSlug({watch:st,setValue:ot,selectedResource:et?rt:void 0});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:[at("explorer.resource.editModal.heading.access"),tt]}),jsxRuntimeExports.jsx(Alert,{type:"info",children:at("explorer.resource.editModal.access.alert")}),jsxRuntimeExports.jsxs(FormControl,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[jsxRuntimeExports.jsx(FormControl.Input,{type:"checkbox",role:"switch",defaultChecked:et?rt.public:!1,...nt("enablePublic",{disabled:!ct,onChange:ft=>{const xt=ft.target.checked;dt(xt)}}),className:"form-check-input mt-0",size:"md"}),jsxRuntimeExports.jsx(FormControl.Label,{className:"form-check-label mb-0",children:at("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),ut&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FormControl,{id:"formSlug",children:jsxRuntimeExports.jsx(Input,{type:"text",hidden:!0,defaultValue:et?lt:"",...nt("formSlug"),size:"sm"})},lt),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[jsxRuntimeExports.jsxs("p",{className:"text-break",children:[window.location.origin,"/blog/pub/",lt]}),jsxRuntimeExports.jsx(Button,{color:"primary",disabled:!ut,onClick:()=>ht("/blog"),type:"button",leftIcon:jsxRuntimeExports.jsx(SvgIconCopy,{}),variant:"ghost",className:"text-nowrap",children:at("explorer.resource.editModal.access.url.button")})]})]})]})},useUpdateMutation=({application:tt,options:et})=>useMutation({mutationFn:async rt=>await odeServices.resource(tt).update(rt),...et}),SvgIconBookmark=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M7 4a1 1 0 0 0-1 1v14.06l5.42-3.87a1 1 0 0 1 1.16 0L18 19.06V5a1 1 0 0 0-1-1zM4.88 2.88A3 3 0 0 1 7 2h10a3 3 0 0 1 3 3v16a1 1 0 0 1-1.58.81L12 17.23 5.58 21.8A1 1 0 0 1 4 21V5a3 3 0 0 1 .88-2.12"})]}),ShareBookmark=({bookmark:tt,refBookmark:et,onBookmarkChange:rt,onSave:st})=>{const{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"mt-16",children:jsxRuntimeExports.jsxs(FormControl,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[jsxRuntimeExports.jsx("div",{className:"flex-fill",children:jsxRuntimeExports.jsx(FormControl.Input,{ref:et,onChange:rt,placeholder:nt("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},tt.id)}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"ghost",disabled:tt.name.length===0,leftIcon:jsxRuntimeExports.jsx(SvgIconSave,{}),onClick:st,className:"text-nowrap",children:nt("explorer.modal.share.sharebookmark.save")})]})})},hasRight=(tt,et)=>tt.actions.filter(rt=>et.id===rt.id).length>0,showShareRightLine=(tt,et)=>tt.isBookmarkMember&&et||!tt.isBookmarkMember,DISABLED_GROUP_LABELS=["CommunityMemberGroup","CommunityAdminGroup"],useShareRightDisabled=()=>({isShareRightDisabled:(tt,et)=>{if(tt.type!=="group")return!1;const rt=et.visibleGroups.find(st=>st.id===tt.id);return!rt||!rt.labels||!Array.isArray(rt.labels)?!1:!!rt.labels.some(st=>DISABLED_GROUP_LABELS.includes(st))}}),HIDDEN_GROUP_LABELS=["CommunityAdminGroup"],useShareRightVisible=()=>({isShareRightVisible:(tt,et)=>{if(tt.type!=="group")return!0;const rt=et.visibleGroups.find(st=>st.id===tt.id);return!rt||!rt.labels||!Array.isArray(rt.labels)?!0:!rt.labels.some(st=>HIDDEN_GROUP_LABELS.includes(st))}}),ShareBookmarkLine=({shareRights:tt,showBookmark:et,toggleBookmark:rt,shareRightActions:st,toggleRight:nt,onDeleteRow:ot})=>{const{t:at}=useTranslation(),{isShareRightDisabled:lt}=useShareRightDisabled(),{isShareRightVisible:ut}=useShareRightVisible();return tt==null?void 0:tt.rights.map(ct=>{const dt={user:jsxRuntimeExports.jsx(Avatar,{alt:at("explorer.modal.share.avatar.shared.alt"),size:"xs",src:ct.avatarUrl,variant:"circle"}),group:jsxRuntimeExports.jsx("div",{className:"avatar-xs bg-primary-200 justify-content-center d-flex rounded-circle",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:16})}),sharebookmark:jsxRuntimeExports.jsx(SvgIconBookmark,{})}[ct.type]||null,ht=ct.type==="sharebookmark",ft=ct.type==="user",xt=lt(ct,tt);return ut(ct,tt)?showShareRightLine(ct,et)&&jsxRuntimeExports.jsxs("tr",{className:ct.isBookmarkMember?"bg-light":"",children:[jsxRuntimeExports.jsx("td",{children:dt}),jsxRuntimeExports.jsx("td",{children:jsxRuntimeExports.jsxs("div",{className:"d-flex",children:[ht&&jsxRuntimeExports.jsx(Button,{color:"tertiary",rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:at("show"),className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:et?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:rt,children:ct.displayName}),!ht&&ct.displayName,ft&&` (${at(ct.profile||"")})`]})}),st.map(vt=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:hasRight(ct,vt),onChange:()=>nt(ct,vt.id),disabled:xt})},vt.displayName)),jsxRuntimeExports.jsx("td",{children:!ct.isBookmarkMember&&!xt&&jsxRuntimeExports.jsx(IconButton,{"aria-label":at("close"),color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconClose,{}),type:"button",variant:"ghost",title:at("close"),onClick:()=>ot(ct)})})]},ct.id):null})},initialState$2={searchInputValue:"",searchResults:[],searchAPIResults:[],isSearching:!1};function reducer$1(tt,et){switch(et.type){case"onChange":return{...tt,searchInputValue:et.payload};case"isSearching":return{...tt,isSearching:et.payload};case"addResult":return{...tt,searchResults:et.payload};case"addApiResult":return{...tt,searchAPIResults:et.payload};case"updateSearchResult":return{...tt,searchResults:et.payload};case"emptyResult":return{...tt,searchResults:et.payload};default:throw new Error("Unhandled action type")}}const defaultActions=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],useSearch=({resourceId:tt,resourceCreatorId:et,shareRights:rt,shareDispatch:st})=>{const[nt,ot]=reactExports.useReducer(reducer$1,initialState$2),at=useDebounce(nt.searchInputValue,500),{isAdml:lt}=useIsAdml(),{appCode:ut}=useEdificeClient(),{t:ct}=useTranslation();reactExports.useEffect(()=>{ht(at)},[at]);const dt=ft=>{const xt=ft.target.value;ot({type:"onChange",payload:xt})},ht=async ft=>{if(tt){if(ot({type:"isSearching",payload:!0}),!lt&&ft.length>=1||lt&&ft.length>=3){const xt=await odeServices.share().searchShareSubjects(ut,tt,ft);ot({type:"addApiResult",payload:xt});const vt=xt.filter(yt=>!rt.rights.find(Et=>Et.id===yt.id)).filter(yt=>!(yt.type==="user"&&yt.id===et)).map(yt=>{let Et=yt.displayName;return yt.type==="user"&&yt.profile?Et=`${Et} (${ct(yt.profile)})`:yt.type==="group"&&yt.structureName&&(Et=`${Et} (${yt.structureName})`),{value:yt.id,label:Et,icon:yt.type==="sharebookmark"?jsxRuntimeExports.jsx(SvgIconBookmark,{}):null}});ot({type:"addResult",payload:vt})}else ot({type:"emptyResult",payload:[]}),Promise.resolve();ot({type:"isSearching",payload:!1})}};return{state:nt,showSearchAdmlHint:()=>lt&&nt.searchInputValue.length<3,showSearchLoading:()=>nt.isSearching,showSearchNoResults:()=>!nt.isSearching&&!lt&&at.length>0&&nt.searchResults.length===0||!nt.isSearching&<&&at.length>3&&nt.searchResults.length===0,getSearchMinLength:()=>lt?3:1,handleSearchInputChange:dt,handleSearchResultsChange:async ft=>{const xt=nt.searchAPIResults.find(vt=>vt.id===ft[0]);if(xt){let vt=[];if(xt.type==="sharebookmark"){const yt=await odeServices.directory().getBookMarkById(xt.id);vt.push({...yt,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:defaultActions}),yt==null||yt.users.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{vt.push({...Et,type:"user",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})}),yt.groups.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{vt.push({...Et,type:"group",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})})}else vt=[{...xt,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];st({type:"updateShareRights",payload:{...rt,rights:[...rt.rights,...vt]}}),ot({type:"updateSearchResult",payload:nt.searchResults.filter(yt=>yt.value!==ft[0])})}}}},initialState$1={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function reducer(tt,et){switch(et.type){case"init":return{...tt,...et.payload};case"deleteRow":return{...tt,shareRights:et.payload};case"updateShareRights":return{...tt,shareRights:et.payload};case"toggleRight":return{...tt,shareRights:et.payload};case"isSharing":return{...tt,isSharing:et.payload};default:throw new Error("Unhandled action type")}}function useShare({resourceId:tt,resourceRights:et,resourceCreatorId:rt,shareResource:st,setIsLoading:nt,onSuccess:ot}){const{appCode:at}=useEdificeClient(),{user:lt,avatar:ut}=useUser(),ct=useToast(),{t:dt}=useTranslation(),[ht,ft]=reactExports.useReducer(reducer,initialState$1);reactExports.useEffect(()=>{tt&&(async()=>{try{const[yt,Et]=await Promise.all([odeServices.share().getActionsForApp(at),odeServices.share().getRightsForResource(at,tt)]);ft({type:"init",payload:{shareRightActions:yt,shareRights:Et}})}catch(yt){console.error(yt)}nt(!1)})()},[tt]);const xt=(yt,Et)=>{var bt,wt;const{rights:St,...Rt}=ht.shareRights,Ct=[...St],It=Ct.findIndex(Pt=>Pt.id===yt.id),jt=ht.shareRightActions.filter(Pt=>Pt.id===Et)[0];if(Ct[It].actions.findIndex(Pt=>Pt.id===Et)>-1){let Pt=Ct[It].actions.filter(Ut=>Ut.id!==Et);const Ot=ht.shareRightActions.filter(Ut=>{var Nt;return(Nt=Ut.requires)==null?void 0:Nt.includes(Et)});Pt=Pt.filter(Ut=>!Ot.find(Nt=>Nt.id===Ut.id)),Ct[It]={...Ct[It],actions:Pt}}else{const Pt=ht.shareRightActions.filter(Ot=>{var Ut;return((Ut=jt.requires)==null?void 0:Ut.includes(Ot.id))&&!Ct[It].actions.find(Nt=>Nt.id===Ot.id)});Ct[It]={...Ct[It],actions:[...Ct[It].actions,jt,...Pt]}}yt.type==="sharebookmark"&&((bt=Ct[It].users)==null||bt.forEach(Pt=>{const Ot=Ct.findIndex(Ut=>Ut.id===Pt.id);Ct[Ot]={...Ct[Ot],actions:Ct[It].actions}}),(wt=Ct[It].groups)==null||wt.forEach(Pt=>{const Ot=Ct.findIndex(Ut=>Ut.id===Pt.id);Ct[Ot]={...Ct[Ot],actions:Ct[It].actions}})),ft({type:"toggleRight",payload:{rights:Ct,...Rt}})},vt=yt=>{Object.keys(yt)[0]==="error"?(ct.error(dt("explorer.shared.status.error")),console.error("Failed to save share",yt)):ct.success(dt("explorer.shared.status.saved"))};return{state:ht,dispatch:ft,currentIsAuthor:()=>rt===(lt==null?void 0:lt.userId),myAvatar:ut,handleDeleteRow:yt=>{ft({type:"deleteRow",payload:{...ht.shareRights,rights:ht.shareRights.rights.filter(Et=>{var bt,wt;return Et.id!==yt.id&&!((bt=yt.users)!=null&&bt.find(St=>St.id===Et.id))&&!((wt=yt.groups)!=null&&wt.find(St=>St.id===Et.id))})}})},handleShare:async()=>{ft({type:"isSharing",payload:!0});try{const yt=et.filter(bt=>lt&&bt.includes(`user:${lt.userId}`)).map(bt=>bt.split(":")[2]).filter(bt=>!!bt),Et=[...ht.shareRights.rights];if(yt.length>0){const bt=yt.map(wt=>({displayName:wt,id:wt}));Et.push({actions:bt,avatarUrl:"",directoryUrl:"",displayName:lt.username,id:lt.userId,type:"user"})}if(st){const bt=await st.mutateAsync({resourceId:tt,rights:Et});vt(bt)}else{const bt=await odeServices.share().saveRights(at,tt,Et);vt(bt)}ot()}catch(yt){typeof yt=="string"&&ct.error(dt("explorer.shared.status.error")),typeof yt=="object"&&ct.error(dt((yt==null?void 0:yt.error)||"explorer.shared.status.error")),console.error("Failed to save share",yt)}finally{ft({type:"isSharing",payload:!1})}},toggleRight:xt}}const useShareBookmark=({shareRights:tt,shareDispatch:et})=>{const rt=useToast(),{t:st}=useTranslation(),nt=reactExports.useRef(null),[ot,at]=reactExports.useState({name:"",id:reactExports.useId()}),[lt,ut]=useToggle$1(!1),[ct,dt]=reactExports.useState(!1),ht=()=>{ut()},ft=()=>{at(vt=>{var yt;return{...vt,name:((yt=nt.current)==null?void 0:yt.value)||""}})},xt=async vt=>{try{const yt=await odeServices.directory().saveBookmarks(vt,{users:tt.rights.filter(Et=>Et.type==="user").map(Et=>Et.id),groups:tt.rights.filter(Et=>Et.type==="group").map(Et=>Et.id),bookmarks:tt.rights.filter(Et=>Et.type==="sharebookmark").map(Et=>Et.id)});rt.success(st("explorer.bookmarked.status.saved")),et({type:"updateShareRights",payload:{...tt,visibleBookmarks:[...tt.visibleBookmarks,{displayName:vt,id:yt.id}]}}),at(Et=>({...Et,bookmarkId:Et.id+new Date().getTime().toString()})),dt(!1)}catch(yt){console.error("Failed to save bookmark",yt),rt.error(st("explorer.bookmarked.status.error"))}};return{refBookmark:nt,showBookmark:lt,showBookmarkInput:ct,bookmark:ot,handleBookmarkChange:ft,setBookmark:at,handleOnSave:()=>{var vt;const yt=((vt=nt.current)==null?void 0:vt.value)||"";xt(yt)},toggleBookmark:ht,toggleBookmarkInput:dt}};function ShareResourceModal({isOpen:tt,shareOptions:et,shareResource:rt,children:st,onSuccess:nt,onCancel:ot}){const{resourceId:at,resourceCreatorId:lt,resourceRights:ut}=et,[ct,dt]=reactExports.useState(!0),{state:{isSharing:ht,shareRights:ft,shareRightActions:xt},dispatch:vt,myAvatar:yt,currentIsAuthor:Et,handleShare:bt,toggleRight:wt,handleDeleteRow:St}=useShare({resourceId:at,resourceCreatorId:lt,resourceRights:ut,shareResource:rt,setIsLoading:dt,onSuccess:nt}),{state:{searchResults:Rt,searchInputValue:Ct},showSearchAdmlHint:It,showSearchLoading:jt,showSearchNoResults:Pt,getSearchMinLength:Ot,handleSearchInputChange:Ut,handleSearchResultsChange:Nt}=useSearch({resourceId:at,resourceCreatorId:lt,shareRights:ft,shareDispatch:vt}),{refBookmark:Ht,showBookmark:Lt,handleBookmarkChange:kt,toggleBookmark:$t,bookmark:Ft,handleOnSave:Gt,showBookmarkInput:Mt,toggleBookmarkInput:Vt}=useShareBookmark({shareRights:ft,shareDispatch:vt}),{t:Bt}=useTranslation(),qt=It()?Bt("explorer.search.adml.hint"):Bt("explorer.modal.share.search.placeholder");return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"share_modal",size:"lg",isOpen:tt,onModalClose:ot,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:ot,children:Bt("share.title")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Alert,{type:"info",className:"mb-16",children:Bt("explorer.modal.share.alert.community")}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:Bt("explorer.modal.share.usersWithAccess")}),jsxRuntimeExports.jsx("div",{className:"table-responsive",children:ct?jsxRuntimeExports.jsx(LoadingScreen,{}):jsxRuntimeExports.jsxs("table",{className:"table border align-middle mb-0",children:[jsxRuntimeExports.jsx("thead",{className:"bg-secondary",children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"col",className:"w-32",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Bt("explorer.modal.share.avatar.shared.alt")})}),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Bt("explorer.modal.share.search.placeholder")})}),xt.map(Qt=>jsxRuntimeExports.jsx("th",{scope:"col",className:"text-center text-white",children:Bt(Qt.displayName)},Qt.displayName)),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Bt("close")})})]})}),jsxRuntimeExports.jsxs("tbody",{children:[Et()&&jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"row",children:jsxRuntimeExports.jsx(Avatar,{alt:Bt("explorer.modal.share.avatar.me.alt"),size:"xs",src:yt,variant:"circle"})}),jsxRuntimeExports.jsx("td",{children:Bt("share.me")}),xt.map(Qt=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:!0,disabled:!0})},Qt.displayName)),jsxRuntimeExports.jsx("td",{})]}),jsxRuntimeExports.jsx(ShareBookmarkLine,{showBookmark:Lt,shareRightActions:xt,shareRights:ft,onDeleteRow:St,toggleRight:wt,toggleBookmark:$t})]})]})}),jsxRuntimeExports.jsxs("div",{className:"mt-16",children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBookmark,{}),rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:Bt("show"),className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:Mt?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>Vt(!Mt),children:Bt("share.save.sharebookmark")}),Mt&&jsxRuntimeExports.jsx(ShareBookmark,{refBookmark:Ht,bookmark:Ft,onBookmarkChange:kt,onSave:Gt})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[jsxRuntimeExports.jsx("div",{className:"me-8",children:Bt("explorer.modal.share.search")}),jsxRuntimeExports.jsx(Tooltip,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:jsxRuntimeExports.jsx(SvgIconInfoCircle,{className:"c-pointer",height:"18"})})]}),jsxRuntimeExports.jsx("div",{className:"row",children:jsxRuntimeExports.jsx("div",{className:"col-10",children:jsxRuntimeExports.jsx(Combobox,{value:Ct,placeholder:qt,isLoading:jt(),noResult:Pt(),options:Rt,searchMinLength:Ot(),onSearchInputChange:Ut,onSearchResultsChange:Nt})})}),st]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:ot,children:Bt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",isLoading:ht,onClick:bt,disabled:ht,children:Bt("share")})]})]}),document.getElementById("portal"))}function ShareBlog({resourceId:tt,updateResource:et}){const{appCode:rt}=useEdificeClient(),{t:st}=useTranslation(rt),nt=useResource("blog",tt),ot=nt&&nt["publish-type"],[at,lt]=reactExports.useState(ot??"RESTRAINT");reactExports.useEffect(()=>{ot&<(ot)},[ot]);const ut=async ct=>{const dt=ct.target.value,ht={description:nt.description||"",entId:nt.assetId,name:nt.name,public:!!nt.public,slug:nt.slug||"",thumbnail:nt.thumbnail,trashed:nt.trashed,"publish-type":dt};et?await et.mutateAsync(ht):await odeServices.resource("blog").update(ht),lt(dt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:st("explorer.publication.steps")}),jsxRuntimeExports.jsx(Radio,{label:st("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:at,checked:at==="IMMEDIATE",onChange:ut}),jsxRuntimeExports.jsx(Radio,{label:st("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:at==="RESTRAINT",model:at,onChange:ut})]})}const useShareMutation=({application:tt,options:et})=>useMutation({mutationFn:async({resourceId:rt,rights:st})=>await odeServices.share().saveRights(tt,rt,st),...et}),SvgIconCommunity=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M19.935 17.51q1.088 0 1.868.792.78.794.78 1.898 0 1.106-.78 1.898-.78.793-1.844.793t-1.869-.793a2.52 2.52 0 0 1-.78-1.922q0-.432.19-.936l-3.997-2.931q-1.16 1.2-2.79 1.2-1.633 0-2.791-1.176-1.16-1.177-1.183-2.86 0-.215.071-.624l-3.168-1.057a1.25 1.25 0 0 1-.852.337q-.567 0-.946-.385a1.32 1.32 0 0 1-.378-.96q0-.578.378-.938.38-.36.946-.384.474 0 .804.312.33.313.45.745l3.192 1.08a3.8 3.8 0 0 1 1.443-1.56 3.84 3.84 0 0 1 2.033-.577q1.23 0 2.27.745l4.706-4.781q-.378-.72-.378-1.321 0-1.106.78-1.898.78-.793 1.869-.793t1.844.793q.758.792.78 1.898a2.42 2.42 0 0 1-.78 1.873q-.804.77-1.868.793-.616 0-1.3-.408l-4.707 4.805q.734 1.056.733 2.306 0 .888-.402 1.753l3.997 2.907q.78-.624 1.679-.624"})]}),SvgIconDisconnect=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M22.996 13.153q0 2.09-.873 3.987a10.6 10.6 0 0 1-2.336 3.292q-1.462 1.393-3.516 2.21t-4.26.817-4.287-.817-3.49-2.21a12.3 12.3 0 0 1-2.362-3.291A8.1 8.1 0 0 1 1 13.153q0-2.451 1.155-4.589t3.234-3.627q.616-.433 1.386-.337t1.181.673q.462.553.36 1.273-.104.72-.72 1.13a7 7 0 0 0-2.155 2.426 6.38 6.38 0 0 0-.18 5.717 7 7 0 0 0 1.566 2.186q.975.913 2.335 1.466a7.5 7.5 0 0 0 2.85.552 7.3 7.3 0 0 0 2.823-.552 8.3 8.3 0 0 0 2.36-1.466 6.04 6.04 0 0 0 1.567-2.186q.538-1.274.564-2.666 0-1.635-.77-3.051T16.4 7.675a1.75 1.75 0 0 1-.719-1.129q-.128-.697.36-1.273.436-.577 1.206-.673t1.36.337q2.079 1.466 3.234 3.627a9.6 9.6 0 0 1 1.155 4.589M13.833 2.846v8.6q0 .698-.54 1.202-.538.505-1.283.505t-1.309-.505q-.564-.505-.539-1.201v-8.6q0-.697.54-1.202.538-.504 1.308-.504t1.284.504.539 1.201"})]}),SvgIconHome=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M20.584 13.536v7.458q0 .42-.294.699a1.06 1.06 0 0 1-.667.307H13.91v-5.978h-3.817V22H4.383a.85.85 0 0 1-.668-.307 1.16 1.16 0 0 1-.293-.699v-7.569l8.567-7.375 8.568 7.375q.027.027.027.111m3.31-1.09-.908 1.146a.54.54 0 0 1-.32.168h-.054a.6.6 0 0 1-.32-.084L11.989 4.682 1.687 13.676a.5.5 0 0 1-.347.084.54.54 0 0 1-.32-.168l-.935-1.145a.52.52 0 0 1-.08-.363.6.6 0 0 1 .16-.335l10.703-9.33q.48-.42 1.121-.419.64 0 1.148.419l3.63 3.156V2.56q0-.224.133-.363a.46.46 0 0 1 .347-.14h2.856q.214 0 .347.14a.5.5 0 0 1 .134.363v6.34l3.256 2.85q.16.111.16.335 0 .223-.107.363"})]}),SvgIconMyApps=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M1.898 22.555c-.072-.145-.096-1.37-.048-2.691l.048-2.402h5.261v5.26l-2.595.049c-1.994.048-2.594 0-2.666-.216m7.76 0c-.049-.145-.073-1.37-.049-2.691l.072-2.402h5.238v5.26l-2.571.049c-2.018.048-2.595 0-2.69-.216m7.759 0c-.048-.145-.072-1.37-.048-2.691l.072-2.402h5.237v5.26l-2.57.049c-1.994.048-2.595 0-2.691-.216m-15.52-7.76c-.071-.168-.095-1.37-.047-2.69l.048-2.403h5.261v5.261l-2.595.048c-1.994.048-2.594 0-2.666-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.238v5.261l-2.571.048c-2.018.048-2.595 0-2.69-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.237v5.261l-2.57.048c-1.994.048-2.595 0-2.691-.216M1.897 7.011c-.071-.144-.095-1.345-.047-2.666l.048-2.402h5.261V7.18l-2.595.072c-1.994.048-2.594 0-2.666-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.238V7.18l-2.571.072c-2.018.048-2.595 0-2.69-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.237V7.18l-2.57.072c-1.994.048-2.595 0-2.691-.24"})]}),SvgIconNeoAssistance=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12M7.123 7.667C8.276 5.958 9.745 5 12.013 5 14.425 5 17 6.941 17 9.5c0 2.113-1.377 2.932-2.418 3.552-.633.376-1.142.68-1.142 1.154v.169a.693.693 0 0 1-.682.703h-2.06a.693.693 0 0 1-.681-.703v-.287c0-1.768 1.269-2.5 2.266-3.075l.073-.042c.863-.499 1.392-.838 1.392-1.499 0-.874-1.082-1.454-1.956-1.454-1.112 0-1.64.53-2.351 1.449a.67.67 0 0 1-.945.121L7.27 8.63a.72.72 0 0 1-.147-.963M9.76 17.97c0-1.12.883-2.03 1.969-2.03 1.085 0 1.968.91 1.968 2.03S12.814 20 11.73 20c-1.086 0-1.969-.91-1.969-2.03",clipRule:"evenodd"})]}),SvgIconNeoMessaging=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"m.5 21.257 7.46-8.216 4.052 2.403 4.052-2.403 7.46 8.216zm0-2.738V8.573l5.848 3.531zm0-12.084V3.048h23.024v3.387l-11.512 6.847zm17.176 5.67 5.848-3.532v9.946z"})]}),SvgIconNewRelease=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M13.07 13.07V6.54h-2.14v6.53zm0 4.4v-2.2h-2.14v2.2zM24 12l-2.65 3.01.35 4.04-3.93.86-2.04 3.48L12 21.8l-3.73 1.6-2.04-3.42-3.93-.92.35-4.04L0 12l2.65-3.06-.35-3.99 3.93-.86L8.27.6 12 2.2 15.73.6l2.04 3.48 3.93.86L21.34 9z"})]}),SvgIconOneAssistance=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M11.685 2C8.66 2 6.7 3.277 5.164 5.556A.96.96 0 0 0 5.36 6.84l1.634 1.278a.89.89 0 0 0 1.26-.162c.95-1.226 1.653-1.932 3.136-1.932 1.165 0 2.607.773 2.607 1.939 0 .88-.705 1.333-1.856 1.998-1.342.776-3.118 1.742-3.118 4.157v.382c0 .518.407.938.909.938h2.746c.502 0 .91-.42.91-.938v-.226c0-1.674 4.745-1.743 4.745-6.274 0-3.412-3.432-6-6.648-6m-.38 14.588c-1.447 0-2.625 1.214-2.625 2.706S9.858 22 11.305 22s2.624-1.214 2.624-2.706-1.177-2.706-2.624-2.706"})]}),SvgIconOneMessaging=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.051 12.366a456 456 0 0 1-2.746-1.822A6.5 6.5 0 0 1 .74 9.067q-.737-.94-.737-1.745a2.7 2.7 0 0 1 .141-.905c.098-.286.242-.542.424-.752Q1.12 5 2.15 5h19.7c.541-.016 1.071.195 1.507.6q.636.6.636 1.446 0 1.01-.657 1.93a6.2 6.2 0 0 1-1.632 1.567q-5.037 3.338-6.267 4.156l-.242.167-.323.222q-.436.303-.724.487-.288.183-.696.415a4 4 0 0 1-.77.345 2.2 2.2 0 0 1-.67.115h-.026a2.2 2.2 0 0 1-.67-.116 4 4 0 0 1-.77-.344q-.41-.23-.697-.415a30 30 0 0 1-.723-.487q-.433-.3-.565-.389-1.215-.817-3.51-2.334m10.943 3.962q2.276-1.578 6.667-4.416c.478-.306.927-.68 1.339-1.113v10.16q0 .845-.63 1.446c-.437.405-.97.614-1.512.594H2.149c-.545.02-1.08-.192-1.52-.601C.21 21.996 0 21.52 0 20.95V10.8c.416.437.871.81 1.356 1.113q4.848 3.148 6.656 4.416.768.537 1.243.837a7.7 7.7 0 0 0 1.265.614c.475.198.97.303 1.47.313h.026c.5-.01.995-.115 1.47-.313a7.7 7.7 0 0 0 1.265-.614q.48-.3 1.243-.837",clipRule:"evenodd"})]}),SvgIconUserbook=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M0 24.58V.53h24.05v4.28h-2.62V7.1h2.62v4.28h-2.62v2.35h2.62V18h-2.62v2.3h2.62v4.29H0zm4.64-6.85h12.12V14l-4.5-2.67q.9-.46 1.4-1.3t.53-1.85q0-1.4-1.01-2.43T10.7 4.72 8.25 5.75 7.24 8.18q0 1.03.53 1.85t1.4 1.3L4.63 14v3.73z"})]});function useHeader({user:tt,avatar:et}){const{appCode:rt}=useEdificeClient(),{t:st}=useTranslation(),nt=st(rt),[ot,at]=reactExports.useState(!0),[lt,ut]=useHover$1(),ct=reactExports.useId(),dt=reactExports.useId(),ht=et,ft=tt==null?void 0:tt.username,xt=st("welcome",{username:tt==null?void 0:tt.firstName}),vt=useBookmark(),yt=useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"),Et=useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"),bt=useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"),wt=reactExports.useCallback(()=>{at(!ot)},[ot]);return reactExports.useMemo(()=>({title:nt,bookmarkedApps:vt,appsRef:lt,isAppsHovered:ut,popoverAppsId:ct,popoverSearchId:dt,userAvatar:ht,userName:ft,welcomeUser:xt,communityWorkflow:yt,conversationWorflow:Et,searchWorkflow:bt,isCollapsed:ot,toggleCollapsedNav:wt}),[lt,vt,yt,Et,ut,ot,ct,dt,bt,nt,wt,ht,ft,xt])}function Help({isHelpOpen:tt,setIsHelpOpen:et,parsedHeadline:rt,parsedContent:st,error:nt}){const{t:ot}=useTranslation(),at=()=>{et(!1)};return tt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"help-modal",isOpen:tt,onModalClose:at,scrollable:!0,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:at,children:ot("navbar.help")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:nt?ot("help.notfound.title"):rt}),jsxRuntimeExports.jsx(Modal.Body,{className:nt?"d-flex":null,children:nt?ot("help.notfound.text"):st})]}),document.getElementById("portal")):null}function Navbar({children:tt,className:et,...rt}){const st=clsx("navbar",et);return jsxRuntimeExports.jsx("nav",{className:st,...rt,children:tt})}function NavBarNav({children:tt,className:et,...rt}){const st=clsx("navbar-nav",et);return jsxRuntimeExports.jsx("ul",{className:st,...rt,children:tt})}const NavItem=reactExports.forwardRef(({children:tt,className:et,...rt},st)=>{const nt=clsx("nav-item",et);return jsxRuntimeExports.jsx("li",{ref:st,className:nt,...rt,children:tt})});function NavLink({link:tt,className:et,children:rt,translate:st,...nt}){const ot=clsx("nav-link",et);return jsxRuntimeExports.jsxs("a",{href:tt,className:ot,...nt,children:[rt,st&&jsxRuntimeExports.jsx(VisuallyHidden,{children:jsxRuntimeExports.jsx("span",{className:"nav-text",children:st})})]})}const SvgIconSearch=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M1.27 11.552a7.75 7.75 0 0 1 0-4.156Q1.84 5.33 3.42 3.792a7.9 7.9 0 0 1 2.716-1.777q1.53-.6 3.161-.6 1.605 0 3.136.6 1.53.6 2.716 1.777a7.9 7.9 0 0 1 1.902 2.86 7.8 7.8 0 0 1 .518 3.29 7.65 7.65 0 0 1-.889 3.171q.692.192 1.21.697l4.297 4.156q.864.84.864 2.042t-.864 2.042-2.099.841-2.099-.84l-4.272-4.18a2.42 2.42 0 0 1-.74-1.178 8.3 8.3 0 0 1-3.68.84q-1.63 0-3.16-.6a8.1 8.1 0 0 1-2.717-1.753 7.85 7.85 0 0 1-2.149-3.628m2.495-2.066q0 2.235 1.605 3.796 1.63 1.56 3.926 1.561 2.272 0 3.877-1.561 1.605-1.562 1.63-3.796t-1.63-3.796q-1.63-1.585-3.877-1.585-2.272 0-3.926 1.585-1.605 1.561-1.605 3.796"})]}),PopoverBody=({children:tt,className:et})=>{const rt=clsx("popover-body",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},PopoverFooter=({children:tt,className:et})=>{const rt=clsx("popover-footer p-8",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},Popover=reactExports.forwardRef(({children:tt,className:et,id:rt,isVisible:st,...nt},ot)=>{const at=clsx("popover d-block position-absolute top-100 start-50 translate-middle-x",et);return useTransition(st,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((lt,ut)=>ut&&jsxRuntimeExports.jsx(animated.div,{ref:ot,"aria-labelledby":rt,className:at,role:"tooltip",style:lt,...nt,children:tt}))}),SearchEngine=()=>{const[tt,et]=useHover(),rt=reactExports.useRef(null),st=reactExports.useId(),{t:nt}=useTranslation();function ot(){if(rt.current){const at=rt.current.value;window.location.href=`/searchengine#/${at}`}}return jsxRuntimeExports.jsxs(NavItem,{id:st,ref:tt,className:"position-relative","aria-haspopup":"true","aria-expanded":et,children:[jsxRuntimeExports.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconSearch,{className:"icon search"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:nt("navbar.search")})]}),jsxRuntimeExports.jsx(Popover,{id:st,isVisible:et,className:"d-none d-md-flex",children:jsxRuntimeExports.jsxs(FormControl,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[jsxRuntimeExports.jsx(FormControl.Input,{ref:rt,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),jsxRuntimeExports.jsx(SearchButton,{type:"submit",size:"sm",onClick:ot,"aria-label":nt("navbar.search")})]})})]})},WidgetAppsFooter=()=>{const{t:tt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"widget-footer",children:jsxRuntimeExports.jsx("div",{className:"widget-footer-action",children:jsxRuntimeExports.jsx("a",{href:"/welcome",className:"link",children:tt("plus")})})})},WidgetAppsBody=({bookmarkedApps:tt})=>{const{t:et}=useTranslation();return jsxRuntimeExports.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!tt.length&&jsxRuntimeExports.jsx("div",{className:"text-dark",children:et("navbar.myapps.more")}),tt.slice(0,6).map((rt,st)=>jsxRuntimeExports.jsx("a",{href:rt.address,className:"bookmarked-app",target:rt.isExternal||rt.category==="connector"?"_blank":void 0,children:jsxRuntimeExports.jsx(AppIcon,{app:rt,size:"32"})},st))]})};var lib$2={},lib$1={};(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.Doctype=tt.CDATA=tt.Tag=tt.Style=tt.Script=tt.Comment=tt.Directive=tt.Text=tt.Root=tt.isTag=tt.ElementType=void 0;var et;(function(st){st.Root="root",st.Text="text",st.Directive="directive",st.Comment="comment",st.Script="script",st.Style="style",st.Tag="tag",st.CDATA="cdata",st.Doctype="doctype"})(et=tt.ElementType||(tt.ElementType={}));function rt(st){return st.type===et.Tag||st.type===et.Script||st.type===et.Style}tt.isTag=rt,tt.Root=et.Root,tt.Text=et.Text,tt.Directive=et.Directive,tt.Comment=et.Comment,tt.Script=et.Script,tt.Style=et.Style,tt.Tag=et.Tag,tt.CDATA=et.CDATA,tt.Doctype=et.Doctype})(lib$1);var node={},__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(et,rt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(st,nt){st.__proto__=nt}||function(st,nt){for(var ot in nt)Object.prototype.hasOwnProperty.call(nt,ot)&&(st[ot]=nt[ot])},tt(et,rt)};return function(et,rt){if(typeof rt!="function"&&rt!==null)throw new TypeError("Class extends value "+String(rt)+" is not a constructor or null");tt(et,rt);function st(){this.constructor=et}et.prototype=rt===null?Object.create(rt):(st.prototype=rt.prototype,new st)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(tt){for(var et,rt=1,st=arguments.length;rt<st;rt++){et=arguments[rt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(tt[nt]=et[nt])}return tt},__assign.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0});node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.CDATA=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var domelementtype_1=lib$1,Node$1=function(){function tt(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(tt.prototype,"parentNode",{get:function(){return this.parent},set:function(et){this.parent=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"previousSibling",{get:function(){return this.prev},set:function(et){this.prev=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"nextSibling",{get:function(){return this.next},set:function(et){this.next=et},enumerable:!1,configurable:!0}),tt.prototype.cloneNode=function(et){return et===void 0&&(et=!1),cloneNode(this,et)},tt}();node.Node=Node$1;var DataNode=function(tt){__extends(et,tt);function et(rt){var st=tt.call(this)||this;return st.data=rt,st}return Object.defineProperty(et.prototype,"nodeValue",{get:function(){return this.data},set:function(rt){this.data=rt},enumerable:!1,configurable:!0}),et}(Node$1);node.DataNode=DataNode;var Text$1=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Text,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),et}(DataNode);node.Text=Text$1;var Comment$1=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Comment,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),et}(DataNode);node.Comment=Comment$1;var ProcessingInstruction$1=function(tt){__extends(et,tt);function et(rt,st){var nt=tt.call(this,st)||this;return nt.name=rt,nt.type=domelementtype_1.ElementType.Directive,nt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),et}(DataNode);node.ProcessingInstruction=ProcessingInstruction$1;var NodeWithChildren=function(tt){__extends(et,tt);function et(rt){var st=tt.call(this)||this;return st.children=rt,st}return Object.defineProperty(et.prototype,"firstChild",{get:function(){var rt;return(rt=this.children[0])!==null&&rt!==void 0?rt:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"childNodes",{get:function(){return this.children},set:function(rt){this.children=rt},enumerable:!1,configurable:!0}),et}(Node$1);node.NodeWithChildren=NodeWithChildren;var CDATA=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.CDATA,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.CDATA=CDATA;var Document=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Root,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Document=Document;var Element$2=function(tt){__extends(et,tt);function et(rt,st,nt,ot){nt===void 0&&(nt=[]),ot===void 0&&(ot=rt==="script"?domelementtype_1.ElementType.Script:rt==="style"?domelementtype_1.ElementType.Style:domelementtype_1.ElementType.Tag);var at=tt.call(this,nt)||this;return at.name=rt,at.attribs=st,at.type=ot,at}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"tagName",{get:function(){return this.name},set:function(rt){this.name=rt},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"attributes",{get:function(){var rt=this;return Object.keys(this.attribs).map(function(st){var nt,ot;return{name:st,value:rt.attribs[st],namespace:(nt=rt["x-attribsNamespace"])===null||nt===void 0?void 0:nt[st],prefix:(ot=rt["x-attribsPrefix"])===null||ot===void 0?void 0:ot[st]}})},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Element=Element$2;function isTag(tt){return(0,domelementtype_1.isTag)(tt)}node.isTag=isTag;function isCDATA(tt){return tt.type===domelementtype_1.ElementType.CDATA}node.isCDATA=isCDATA;function isText(tt){return tt.type===domelementtype_1.ElementType.Text}node.isText=isText;function isComment(tt){return tt.type===domelementtype_1.ElementType.Comment}node.isComment=isComment;function isDirective(tt){return tt.type===domelementtype_1.ElementType.Directive}node.isDirective=isDirective;function isDocument(tt){return tt.type===domelementtype_1.ElementType.Root}node.isDocument=isDocument;function hasChildren(tt){return Object.prototype.hasOwnProperty.call(tt,"children")}node.hasChildren=hasChildren;function cloneNode(tt,et){et===void 0&&(et=!1);var rt;if(isText(tt))rt=new Text$1(tt.data);else if(isComment(tt))rt=new Comment$1(tt.data);else if(isTag(tt)){var st=et?cloneChildren(tt.children):[],nt=new Element$2(tt.name,__assign({},tt.attribs),st);st.forEach(function(ut){return ut.parent=nt}),tt.namespace!=null&&(nt.namespace=tt.namespace),tt["x-attribsNamespace"]&&(nt["x-attribsNamespace"]=__assign({},tt["x-attribsNamespace"])),tt["x-attribsPrefix"]&&(nt["x-attribsPrefix"]=__assign({},tt["x-attribsPrefix"])),rt=nt}else if(isCDATA(tt)){var st=et?cloneChildren(tt.children):[],ot=new CDATA(st);st.forEach(function(ct){return ct.parent=ot}),rt=ot}else if(isDocument(tt)){var st=et?cloneChildren(tt.children):[],at=new Document(st);st.forEach(function(ct){return ct.parent=at}),tt["x-mode"]&&(at["x-mode"]=tt["x-mode"]),rt=at}else if(isDirective(tt)){var lt=new ProcessingInstruction$1(tt.name,tt.data);tt["x-name"]!=null&&(lt["x-name"]=tt["x-name"],lt["x-publicId"]=tt["x-publicId"],lt["x-systemId"]=tt["x-systemId"]),rt=lt}else throw new Error("Not implemented yet: ".concat(tt.type));return rt.startIndex=tt.startIndex,rt.endIndex=tt.endIndex,tt.sourceCodeLocation!=null&&(rt.sourceCodeLocation=tt.sourceCodeLocation),rt}node.cloneNode=cloneNode;function cloneChildren(tt){for(var et=tt.map(function(st){return cloneNode(st,!0)}),rt=1;rt<et.length;rt++)et[rt].prev=et[rt-1],et[rt-1].next=et[rt];return et}(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(lt,ut,ct,dt){dt===void 0&&(dt=ct);var ht=Object.getOwnPropertyDescriptor(ut,ct);(!ht||("get"in ht?!ut.__esModule:ht.writable||ht.configurable))&&(ht={enumerable:!0,get:function(){return ut[ct]}}),Object.defineProperty(lt,dt,ht)}:function(lt,ut,ct,dt){dt===void 0&&(dt=ct),lt[dt]=ut[ct]}),rt=commonjsGlobal&&commonjsGlobal.__exportStar||function(lt,ut){for(var ct in lt)ct!=="default"&&!Object.prototype.hasOwnProperty.call(ut,ct)&&et(ut,lt,ct)};Object.defineProperty(tt,"__esModule",{value:!0}),tt.DomHandler=void 0;var st=lib$1,nt=node;rt(node,tt);var ot={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},at=function(){function lt(ut,ct,dt){this.dom=[],this.root=new nt.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof ct=="function"&&(dt=ct,ct=ot),typeof ut=="object"&&(ct=ut,ut=void 0),this.callback=ut??null,this.options=ct??ot,this.elementCB=dt??null}return lt.prototype.onparserinit=function(ut){this.parser=ut},lt.prototype.onreset=function(){this.dom=[],this.root=new nt.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},lt.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},lt.prototype.onerror=function(ut){this.handleCallback(ut)},lt.prototype.onclosetag=function(){this.lastNode=null;var ut=this.tagStack.pop();this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(ut)},lt.prototype.onopentag=function(ut,ct){var dt=this.options.xmlMode?st.ElementType.Tag:void 0,ht=new nt.Element(ut,ct,void 0,dt);this.addNode(ht),this.tagStack.push(ht)},lt.prototype.ontext=function(ut){var ct=this.lastNode;if(ct&&ct.type===st.ElementType.Text)ct.data+=ut,this.options.withEndIndices&&(ct.endIndex=this.parser.endIndex);else{var dt=new nt.Text(ut);this.addNode(dt),this.lastNode=dt}},lt.prototype.oncomment=function(ut){if(this.lastNode&&this.lastNode.type===st.ElementType.Comment){this.lastNode.data+=ut;return}var ct=new nt.Comment(ut);this.addNode(ct),this.lastNode=ct},lt.prototype.oncommentend=function(){this.lastNode=null},lt.prototype.oncdatastart=function(){var ut=new nt.Text(""),ct=new nt.CDATA([ut]);this.addNode(ct),ut.parent=ct,this.lastNode=ut},lt.prototype.oncdataend=function(){this.lastNode=null},lt.prototype.onprocessinginstruction=function(ut,ct){var dt=new nt.ProcessingInstruction(ut,ct);this.addNode(dt)},lt.prototype.handleCallback=function(ut){if(typeof this.callback=="function")this.callback(ut,this.dom);else if(ut)throw ut},lt.prototype.addNode=function(ut){var ct=this.tagStack[this.tagStack.length-1],dt=ct.children[ct.children.length-1];this.options.withStartIndices&&(ut.startIndex=this.parser.startIndex),this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),ct.children.push(ut),dt&&(ut.prev=dt,dt.next=ut),ut.parent=ct,this.lastNode=null},lt}();tt.DomHandler=at,tt.default=at})(lib$2);var HTML="html",HEAD="head",BODY="body",FIRST_TAG_REGEX=/<([a-zA-Z]+[0-9]?)/,HEAD_TAG_REGEX=/<head[^]*>/i,BODY_TAG_REGEX=/<body[^]*>/i,parseFromDocument=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},parseFromString=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},DOMParser$1=typeof window=="object"&&window.DOMParser;if(typeof DOMParser$1=="function"){var domParser=new DOMParser$1,mimeType="text/html";parseFromString=function(tt,et){return et&&(tt="<"+et+">"+tt+"</"+et+">"),domParser.parseFromString(tt,mimeType)},parseFromDocument=parseFromString}if(typeof document=="object"&&document.implementation){var doc=document.implementation.createHTMLDocument();parseFromDocument=function(tt,et){if(et){var rt=doc.documentElement.querySelector(et);return rt.innerHTML=tt,doc}return doc.documentElement.innerHTML=tt,doc}}var template=typeof document=="object"?document.createElement("template"):{},parseFromTemplate;template.content&&(parseFromTemplate=function(tt){return template.innerHTML=tt,template.content.childNodes});function domparser$1(tt){var et,rt=tt.match(FIRST_TAG_REGEX);rt&&rt[1]&&(et=rt[1].toLowerCase());var st,nt,ot;switch(et){case HTML:return st=parseFromString(tt),HEAD_TAG_REGEX.test(tt)||(nt=st.querySelector(HEAD),nt&&nt.parentNode.removeChild(nt)),BODY_TAG_REGEX.test(tt)||(nt=st.querySelector(BODY),nt&&nt.parentNode.removeChild(nt)),st.querySelectorAll(HTML);case HEAD:case BODY:return st=parseFromDocument(tt),ot=st.querySelectorAll(et),BODY_TAG_REGEX.test(tt)&&HEAD_TAG_REGEX.test(tt)?ot[0].parentNode.childNodes:ot;default:return parseFromTemplate?parseFromTemplate(tt):(nt=parseFromDocument(tt,BODY).querySelector(BODY),nt.childNodes)}}var domparser_1=domparser$1,utilities$5={},constants$1={};constants$1.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"];var domhandler$1=lib$2,constants=constants$1,CASE_SENSITIVE_TAG_NAMES=constants.CASE_SENSITIVE_TAG_NAMES,Comment=domhandler$1.Comment,Element$1=domhandler$1.Element,ProcessingInstruction=domhandler$1.ProcessingInstruction,Text=domhandler$1.Text,caseSensitiveTagNamesMap={},tagName;for(var i=0,len=CASE_SENSITIVE_TAG_NAMES.length;i<len;i++)tagName=CASE_SENSITIVE_TAG_NAMES[i],caseSensitiveTagNamesMap[tagName.toLowerCase()]=tagName;function getCaseSensitiveTagName(tt){return caseSensitiveTagNamesMap[tt]}function formatAttributes(tt){for(var et={},rt,st=0,nt=tt.length;st<nt;st++)rt=tt[st],et[rt.name]=rt.value;return et}function formatTagName(tt){tt=tt.toLowerCase();var et=getCaseSensitiveTagName(tt);return et||tt}function formatDOM$1(tt,et,rt){et=et||null;for(var st=[],nt,ot=0,at=tt.length;ot<at;ot++){var lt=tt[ot],ut;switch(lt.nodeType){case 1:nt=formatTagName(lt.nodeName),ut=new Element$1(nt,formatAttributes(lt.attributes)),ut.children=formatDOM$1(nt==="template"?lt.content.childNodes:lt.childNodes,ut);break;case 3:ut=new Text(lt.nodeValue);break;case 8:ut=new Comment(lt.nodeValue);break;default:continue}var ct=st[ot-1]||null;ct&&(ct.next=ut),ut.parent=et,ut.prev=ct,ut.next=null,st.push(ut)}return rt&&(ut=new ProcessingInstruction(rt.substring(0,rt.indexOf(" ")).toLowerCase(),rt),ut.next=st[0]||null,ut.parent=et,st.unshift(ut),st[1]&&(st[1].prev=st[0])),st}utilities$5.formatAttributes=formatAttributes;utilities$5.formatDOM=formatDOM$1;var domparser=domparser_1,utilities$4=utilities$5,formatDOM=utilities$4.formatDOM,DIRECTIVE_REGEX=/<(![a-zA-Z\s]+)>/;function HTMLDOMParser(tt){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(tt==="")return[];var et=tt.match(DIRECTIVE_REGEX),rt;return et&&et[1]&&(rt=et[1]),formatDOM(domparser(tt),null,rt)}var htmlToDom=HTMLDOMParser,lib={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(lib,"__esModule",{value:!0});function _slicedToArray(tt,et){return _arrayWithHoles(tt)||_iterableToArrayLimit(tt,et)||_unsupportedIterableToArray(tt,et)||_nonIterableRest()}function _arrayWithHoles(tt){if(Array.isArray(tt))return tt}function _iterableToArrayLimit(tt,et){var rt=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(rt!=null){var st=[],nt=!0,ot=!1,at,lt;try{for(rt=rt.call(tt);!(nt=(at=rt.next()).done)&&(st.push(at.value),!(et&&st.length===et));nt=!0);}catch(ut){ot=!0,lt=ut}finally{try{!nt&&rt.return!=null&&rt.return()}finally{if(ot)throw lt}}return st}}function _unsupportedIterableToArray(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray(tt,et);var rt=Object.prototype.toString.call(tt).slice(8,-1);if(rt==="Object"&&tt.constructor&&(rt=tt.constructor.name),rt==="Map"||rt==="Set")return Array.from(tt);if(rt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(rt))return _arrayLikeToArray(tt,et)}}function _arrayLikeToArray(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var rt=0,st=new Array(et);rt<et;rt++)st[rt]=tt[rt];return st}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1394
1394
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var RESERVED=0,STRING=1,BOOLEANISH_STRING=2,BOOLEAN=3,OVERLOADED_BOOLEAN=4,NUMERIC=5,POSITIVE_NUMERIC=6;function getPropertyInfo(tt){return properties.hasOwnProperty(tt)?properties[tt]:null}function PropertyInfoRecord(tt,et,rt,st,nt,ot,at){this.acceptsBooleans=et===BOOLEANISH_STRING||et===BOOLEAN||et===OVERLOADED_BOOLEAN,this.attributeName=st,this.attributeNamespace=nt,this.mustUseProperty=rt,this.propertyName=tt,this.type=et,this.sanitizeURL=ot,this.removeEmptyString=at}var properties={},reservedProps=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];reservedProps.forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,RESERVED,!1,tt,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(tt){var et=_slicedToArray(tt,2),rt=et[0],st=et[1];properties[rt]=new PropertyInfoRecord(rt,STRING,!1,st,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEANISH_STRING,!1,tt.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEANISH_STRING,!1,tt,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEAN,!1,tt.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEAN,!0,tt,null,!1,!1)});["capture","download"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,OVERLOADED_BOOLEAN,!1,tt,null,!1,!1)});["cols","rows","size","span"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,POSITIVE_NUMERIC,!1,tt,null,!1,!1)});["rowSpan","start"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,NUMERIC,!1,tt.toLowerCase(),null,!1,!1)});var CAMELIZE=/[\-\:]([a-z])/g,capitalize$1=function tt(et){return et[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,STRING,!1,tt.toLowerCase(),null,!1,!1)});var xlinkHref="xlinkHref";properties[xlinkHref]=new PropertyInfoRecord("xlinkHref",STRING,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,STRING,!1,tt.toLowerCase(),null,!0,!0)});var _require=possibleStandardNamesOptimized$1,CAMELCASE=_require.CAMELCASE,SAME=_require.SAME,possibleStandardNamesOptimized=_require.possibleStandardNames,ATTRIBUTE_NAME_START_CHAR=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ATTRIBUTE_NAME_CHAR=ATTRIBUTE_NAME_START_CHAR+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",isCustomAttribute=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+ATTRIBUTE_NAME_CHAR+"]*$")),possibleStandardNames=Object.keys(possibleStandardNamesOptimized).reduce(function(tt,et){var rt=possibleStandardNamesOptimized[et];return rt===SAME?tt[et]=et:rt===CAMELCASE?tt[et.toLowerCase()]=et:tt[et]=rt,tt},{});lib.BOOLEAN=BOOLEAN;lib.BOOLEANISH_STRING=BOOLEANISH_STRING;lib.NUMERIC=NUMERIC;lib.OVERLOADED_BOOLEAN=OVERLOADED_BOOLEAN;lib.POSITIVE_NUMERIC=POSITIVE_NUMERIC;lib.RESERVED=RESERVED;lib.STRING=STRING;lib.getPropertyInfo=getPropertyInfo;lib.isCustomAttribute=isCustomAttribute;lib.possibleStandardNames=possibleStandardNames;var cjs={},styleToObject={exports:{}},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=`
|